:root {
  --bg: #f6f8fb;
  --card: #fff;
  --text: #172033;
  --muted: #718096;
  --line: #e8edf4;
  --blue: #3370ff;
  --blue-soft: #edf3ff;
  --green: #16a36a;
  --amber: #d98216;
  --red: #d94c4c;
  --shadow: 0 12px 36px rgba(34, 55, 91, 0.09);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
.hidden {
  display: none !important;
}
.loading-screen {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}
.loading-screen strong {
  font-size: 20px;
  color: var(--text);
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #5b8cff, #2861ec);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(51, 112, 255, 0.25);
}
.app-shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 24px 16px 18px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 26px;
}
.brand strong,
.brand small,
.sidebar-foot strong,
.sidebar-foot small {
  display: block;
}
.brand small,
.sidebar-foot small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
nav {
  display: grid;
  gap: 6px;
}
nav button {
  border: 0;
  background: transparent;
  color: #526079;
  text-align: left;
  padding: 11px 14px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
}
nav button:hover {
  background: #f5f7fb;
}
nav button.active {
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 650;
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 18px 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8efff;
  color: var(--blue);
  font-weight: 700;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
main {
  min-width: 0;
}
.topbar {
  height: 96px;
  padding: 22px 34px;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  border-bottom: 1px solid rgba(232, 237, 244, 0.8);
  background: rgba(246, 248, 251, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 {
  font-size: 22px;
  margin: 0;
}
.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.search {
  height: 40px;
  width: 230px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: #8995a8;
}
.search input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
}
.primary-btn,
.secondary-btn,
.danger-btn,
.ghost-btn {
  border: 0;
  border-radius: 9px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 650;
}
.primary-btn {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 14px rgba(51, 112, 255, 0.2);
}
.secondary-btn {
  background: var(--blue-soft);
  color: var(--blue);
}
.ghost-btn {
  background: #f3f5f8;
  color: #46536a;
}
.danger-btn {
  background: #fff0f0;
  color: var(--red);
}
.icon-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.content {
  padding: 28px 34px 60px;
  max-width: 1500px;
  margin: auto;
}
.resume-import {
  border: 1px dashed #b8c7e6;
  padding: 14px;
  border-radius: 8px;
  background: #f9fbff;
}
.resume-import:focus-within {
  border-color: var(--blue);
}
.resume-queue {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.resume-queue > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.resume-queue small {
  color: var(--muted);
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.profile-grid section {
  min-width: 0;
}
.profile-grid h3 {
  margin: 0 0 12px;
  font-size: 15px;
}
.profile-grid dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 9px 14px;
  margin: 0;
}
.profile-grid dt {
  color: var(--muted);
}
.profile-grid dd {
  margin: 0;
}
.profile-summary {
  grid-column: 1 / -1;
}
.profile-summary p {
  line-height: 1.8;
  white-space: pre-wrap;
}
.education-item {
  display: grid;
  gap: 4px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.education-item span {
  color: var(--muted);
}
.resume-link {
  display: inline-block;
  margin: 0 10px 8px 0;
  color: var(--blue);
}
.hero {
  border-radius: 16px;
  padding: 26px 28px;
  background: linear-gradient(120deg, #f0f5ff, #fff 58%, #f6f2ff);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #e4ebfb;
  margin-bottom: 20px;
}
.hero h2 {
  margin: 0 0 7px;
  font-size: 21px;
}
.hero p {
  margin: 0;
  color: var(--muted);
}
.hero-badge {
  background: #fff;
  border: 1px solid #dde7ff;
  color: var(--blue);
  padding: 9px 13px;
  border-radius: 30px;
  font-size: 13px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}
.metric,
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.metric-link {
  width: 100%;
  text-align: left;
  position: relative;
  cursor: pointer;
  color: inherit;
}
.metric-link:hover,
.metric-link:focus-visible {
  border-color: #b9c9eb;
  box-shadow: 0 8px 24px rgba(34, 55, 91, 0.1);
  transform: translateY(-1px);
}
.metric-arrow {
  position: absolute;
  right: 18px;
  bottom: 16px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 650;
}
.active-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
}
.metric {
  padding: 18px 20px;
}
.metric .label {
  color: var(--muted);
  font-size: 13px;
}
.metric strong {
  display: block;
  font-size: 27px;
  margin-top: 10px;
}
.metric small {
  color: #90a0b7;
}
.metric.blue {
  background: linear-gradient(145deg, #fff, #f1f5ff);
}
.metric.green {
  background: linear-gradient(145deg, #fff, #effbf6);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
}
.card {
  padding: 20px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-head h3 {
  margin: 0;
  font-size: 16px;
}
.card-head button {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
}
.empty {
  padding: 42px 15px;
  text-align: center;
  color: var(--muted);
}
.empty .empty-icon {
  font-size: 30px;
  margin-bottom: 8px;
}
.interview-row,
.activity-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.interview-row:last-child,
.activity-row:last-child {
  border: 0;
}
.date-tile {
  width: 48px;
  text-align: center;
  background: #f5f7fb;
  border-radius: 9px;
  padding: 6px;
}
.date-tile strong,
.date-tile small {
  display: block;
}
.date-tile small {
  font-size: 11px;
  color: var(--muted);
}
.row-main {
  min-width: 0;
  flex: 1;
}
.row-main strong,
.row-main small {
  display: block;
}
.row-main small {
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.time {
  color: var(--blue);
  font-size: 13px;
}
.filterbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
}
.filterbar select,
.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 10px 12px;
  outline: none;
  width: 100%;
}
.filterbar select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #9bb9ff;
  box-shadow: 0 0 0 3px #edf3ff;
}
.table-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  padding: 13px 16px;
  background: #fafbfc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.data-table td {
  padding: 15px 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.data-table tbody tr {
  cursor: pointer;
}
.data-table tbody tr:hover {
  background: #fafcff;
}
.candidate-table-wrap {
  overflow-x: auto;
}
.candidate-table {
  min-width: 1380px;
}
.candidate-table select,
.category-table input {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 8px;
  background: #fff;
}
.summary-cell {
  min-width: 220px;
  max-width: 300px;
  line-height: 1.55;
}
.icon-danger {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  color: var(--red);
  background: #fff0f0;
  cursor: pointer;
  font-size: 18px;
}
.access-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.access-toolbar p {
  color: var(--muted);
  margin: 5px 0 0;
  font-size: 13px;
}
.access-table select {
  min-width: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}
.access-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}
.directory-tools {
  display: grid;
  grid-template-columns: 1fr auto 150px;
  gap: 10px;
  margin-bottom: 16px;
}
.directory-tools input,
.directory-tools select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff;
}
.directory-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.directory-person {
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px;
}
.directory-person strong,
.directory-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.directory-person small {
  color: var(--muted);
  margin-top: 3px;
}
.person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.person-cell .avatar {
  width: 32px;
  height: 32px;
}
.tag,
.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 12px;
  background: #f1f4f8;
  color: #59677d;
}
.status.interviewing,
.status.scheduled {
  color: var(--blue);
  background: var(--blue-soft);
}
.status.hired,
.status.completed {
  color: var(--green);
  background: #eaf8f2;
}
.status.rejected,
.status.cancelled {
  color: var(--red);
  background: #fff0f0;
}
.status.decision,
.status.pending_evaluation {
  color: var(--amber);
  background: #fff5e7;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 31, 49, 0.36);
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  backdrop-filter: blur(2px);
}
.drawer {
  height: 100%;
  width: min(760px, 92vw);
  background: #fff;
  box-shadow: var(--shadow);
  overflow: auto;
  display: flex;
  flex-direction: column;
  animation: slide 0.2s ease;
}
.drawer > .modal-body {
  flex: 1;
}
.dialog {
  margin: auto;
  width: min(560px, 92vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 15px;
  box-shadow: var(--shadow);
  animation: pop 0.18s ease;
}
@keyframes slide {
  from {
    transform: translateX(30px);
    opacity: 0.4;
  }
}
@keyframes pop {
  from {
    transform: scale(0.97);
    opacity: 0.4;
  }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.modal-head h2 {
  margin: 0;
  font-size: 19px;
}
.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.close {
  border: 0;
  background: #f3f5f8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
}
.modal-body {
  padding: 22px 24px;
}
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: #fff;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  display: grid;
  gap: 7px;
}
.field.full {
  grid-column: 1/-1;
}
.resume-import {
  padding: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
}
.resume-import-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.resume-import-row input[type="file"] {
  min-width: 0;
  background: #fff;
}
.import-body {
  display: grid;
  gap: 18px;
}
.import-detail,
.import-row {
  border: 1px solid var(--line);
  padding: 16px;
}
.import-list {
  display: grid;
  gap: 12px;
}
.import-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.import-row-form {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 0.7fr 1fr 1.2fr 1.8fr auto;
  gap: 10px;
  align-items: end;
}
.import-row-form .field label {
  font-size: 12px;
}
.import-row-form textarea {
  min-height: 42px;
  height: 42px;
}
.import-warning {
  grid-column: 1/-1;
  color: var(--amber);
}
.category-toolbar {
  margin-top: 28px;
}
.category-table input[name="name"] {
  min-width: 220px;
}
.category-table input[name="sort_order"] {
  width: 90px;
}
.field label {
  font-size: 13px;
  color: #526079;
  font-weight: 600;
}
.field textarea {
  min-height: 92px;
  resize: vertical;
}
.detail-hero {
  padding: 22px 24px;
  background: linear-gradient(125deg, #f4f7ff, #fff);
}
.detail-hero h2 {
  margin: 8px 0 4px;
}
.detail-hero p {
  color: var(--muted);
  margin: 0;
}
.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
}
.tabs button {
  border: 0;
  background: transparent;
  padding: 13px 12px;
  cursor: pointer;
  color: var(--muted);
}
.tabs button.active {
  color: var(--blue);
  border-bottom: 2px solid var(--blue);
}
.timeline {
  border-left: 2px solid #e7ecf5;
  margin-left: 7px;
}
.timeline-item {
  position: relative;
  padding: 0 0 19px 20px;
}
.timeline-item:before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8aafff;
  border: 2px solid #fff;
}
.round-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  margin-bottom: 12px;
}
.interview-flow {
  display: grid;
  gap: 14px;
}
.flow-round {
  margin: 0;
}
.round-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
}
.round-meta a {
  color: var(--blue);
}
.handoff-note,
.final-review {
  margin: 12px 0;
  padding: 12px;
  border-left: 3px solid var(--amber);
  background: #fff8ed;
}
.handoff-note p,
.evaluation-item p {
  margin: 6px 0;
  line-height: 1.65;
  white-space: pre-wrap;
}
.round-evaluations,
.round-files {
  margin-top: 14px;
}
.round-evaluations h4,
.round-files h4,
.process-comments h3 {
  margin: 0 0 9px;
}
.evaluation-item {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.evaluation-item > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.grade {
  min-width: 30px;
  text-align: center;
  padding: 3px 8px;
  color: #fff;
  background: var(--blue);
  border-radius: 5px;
  font-weight: 750;
}
.muted {
  color: var(--muted);
}
.process-comments {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.round-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.round-actions {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}
.score {
  font-weight: 800;
  color: var(--blue);
}
.attachment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.attachment a {
  color: var(--blue);
  text-decoration: none;
}
.comment {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.comment small {
  color: var(--muted);
}
#toast-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  display: grid;
  gap: 10px;
}
.toast {
  background: #172033;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  animation: pop 0.18s ease;
}
.toast.error {
  background: #b83f47;
}
.skeleton {
  height: 70px;
  border-radius: 10px;
  background: linear-gradient(90deg, #f0f2f5 25%, #fafbfc 50%, #f0f2f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
#mobile-menu {
  display: none;
}
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: -240px;
    z-index: 40;
    width: 232px;
    transition: 0.2s;
  }
  .sidebar.open {
    left: 0;
  }
  .topbar {
    padding: 18px;
    height: auto;
    align-items: flex-start;
  }
  .top-actions .search {
    display: none;
  }
  .content {
    padding: 20px 16px;
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .data-table th:nth-child(4),
  .data-table td:nth-child(4),
  .data-table th:nth-child(5),
  .data-table td:nth-child(5) {
    display: none;
  }
  #mobile-menu {
    display: block;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .directory-results {
    grid-template-columns: 1fr;
  }
  .directory-tools {
    grid-template-columns: 1fr auto;
  }
  .directory-tools select {
    grid-column: 1/-1;
  }
  .drawer {
    width: 100vw;
  }
  .resume-import-row,
  .import-row-form {
    grid-template-columns: 1fr;
  }
  .import-row-form .resume-link,
  .import-warning {
    grid-column: auto;
  }
  .filterbar {
    flex-wrap: wrap;
  }
  .candidate-table th,
  .candidate-table td {
    display: table-cell !important;
  }
}
@media (max-width: 520px) {
  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .metric {
    padding: 14px;
  }
  .metric strong {
    font-size: 23px;
  }
  .metric-arrow {
    position: static;
    display: block;
    margin-top: 8px;
  }
  .metric small {
    display: block;
    min-height: 38px;
  }
  .topbar p {
    display: none;
  }
  .top-actions .primary-btn {
    font-size: 0;
    padding: 10px;
  }
  .top-actions .primary-btn:after {
    content: "＋";
    font-size: 18px;
  }
  .hero {
    align-items: flex-start;
    gap: 10px;
  }
  .hero-badge {
    display: none;
  }
  .drawer {
    width: 100%;
    max-width: 100%;
  }
  .detail-hero,
  .modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }
  .detail-actions,
  .round-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .detail-actions button,
  .round-actions button {
    width: 100%;
  }
  .tabs {
    padding: 0 10px;
  }
  .tabs button {
    flex: 1;
    padding: 12px 6px;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .profile-summary {
    grid-column: auto;
  }
  .profile-grid dl {
    grid-template-columns: 88px minmax(0, 1fr);
  }
  .round-top,
  .attachment {
    align-items: flex-start;
  }
  .round-top {
    display: grid;
  }
}
