:root {
  --bg: #f4f5f7;
  --sidebar: #414141;
  --sidebar-dark: #383838;
  --accent: #ec5436;
  --surface: #ffffff;
  --line: #d5d8de;
  --line-dark: #bfc5cf;
  --text: #253142;
  --muted: #6b7280;
  --blue: #1e6aa8;
  --green: #1f7a5c;
  --red: #b9473c;
  --orange: #b66a20;
  --shadow: 0 16px 45px rgba(26, 32, 44, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: var(--accent);
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: linear-gradient(135deg, #31363e, #f4f5f7 58%);
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(460px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0;
  color: var(--text);
  font-weight: 300;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.broker-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.broker-sidebar {
  min-height: 100vh;
  background: linear-gradient(90deg, var(--sidebar), var(--sidebar-dark));
  color: #d3d3d3;
}

.broker-brand {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
}

.broker-brand strong {
  font-size: 18px;
}

.broker-brand span {
  font-size: 20px;
  font-weight: 300;
}

.broker-user {
  display: grid;
  gap: 2px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.broker-user strong {
  color: #ff9a83;
  text-transform: uppercase;
}

.broker-user span {
  color: #bdbdbd;
  font-size: 13px;
}

.agent-language-switch {
  display: flex;
  gap: 4px;
  padding: 0 18px 10px;
}

.agent-language-switch button {
  display: inline-flex;
  min-width: 42px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 7px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: #e9eef5;
  font-size: 11px;
  font-weight: 800;
}

.agent-language-switch button:hover,
.agent-language-switch button.is-active {
  border-color: rgba(255,255,255,0.38);
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.agent-language-switch .flag {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 12px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.24);
}

.agent-language-switch .flag-gb {
  background:
    linear-gradient(0deg, transparent 42%, #fff 42%, #fff 58%, transparent 58%),
    linear-gradient(90deg, transparent 42%, #fff 42%, #fff 58%, transparent 58%),
    linear-gradient(0deg, transparent 46%, #c8102e 46%, #c8102e 54%, transparent 54%),
    linear-gradient(90deg, transparent 46%, #c8102e 46%, #c8102e 54%, transparent 54%),
    linear-gradient(32deg, transparent 44%, #fff 44%, #fff 56%, transparent 56%),
    linear-gradient(-32deg, transparent 44%, #fff 44%, #fff 56%, transparent 56%),
    #012169;
}

.agent-language-switch .flag-cn {
  background: #de2910;
}

.agent-language-switch .flag-cn::before {
  content: "★";
  position: absolute;
  top: -1px;
  left: 2px;
  color: #ffde00;
  font-size: 7px;
  line-height: 1;
}

.agent-language-switch .flag-cn::before {
  content: "";
  top: 2px;
  width: 5px;
  height: 5px;
  background: #ffde00;
  clip-path: polygon(50% 0%, 61% 34%, 98% 35%, 68% 55%, 79% 91%, 50% 70%, 21% 91%, 32% 55%, 2% 35%, 39% 34%);
}

.agent-language-switch .language-code {
  letter-spacing: 0;
}

.broker-nav {
  display: grid;
  padding: 8px 0;
}

.broker-nav button {
  min-height: 34px;
  padding: 0 18px;
  border: 0;
  border-left: 4px solid transparent;
  background: transparent;
  color: #d7d7d7;
  text-align: left;
}

.broker-nav button:hover {
  background: rgba(255,255,255,0.05);
}

.broker-nav button.is-active {
  border-left-color: var(--accent);
  background: rgba(0,0,0,0.16);
  color: #fff;
  font-weight: 700;
}

.broker-main {
  min-width: 0;
  padding: 20px 24px;
}

.page {
  display: grid;
  gap: 14px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.page h1 {
  margin: 0;
  color: #344056;
  font-size: 27px;
  font-weight: 300;
}

.page-actions,
.toolbar,
.bottom-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.bottom-bar {
  justify-content: flex-end;
}

.wizard-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.wizard-progress {
  display: grid;
  grid-template-columns: repeat(8, minmax(110px, 1fr));
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.wizard-progress button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 6px;
  min-height: 48px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--line-dark);
  background: #fff;
  color: var(--muted);
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.wizard-progress button span {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line-dark);
  background: #f4f5f7;
  color: var(--text);
}

.wizard-progress button.is-active {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: inset 0 3px 0 var(--accent);
}

.wizard-progress button.is-active span,
.wizard-progress button.is-complete span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.draft-banner {
  padding: 10px 12px;
  border: 1px solid #d8c79b;
  background: #fff8e5;
  color: #6d4c14;
  font-weight: 700;
}

.blank-news {
  min-height: 420px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.panel {
  border: 1px solid var(--line);
  background: var(--surface);
}

.panel.pad {
  padding: 16px;
}

.panel h2,
.panel-header h2 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfb;
}

.form-grid,
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid.wide-left {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
}

.candidate-info-panel {
  padding: 0;
  overflow: hidden;
}

.form-section-title {
  padding: 14px 14px 8px;
  color: #344056;
  font-size: 24px;
  font-weight: 300;
}

.candidate-edit-button {
  margin: 8px 14px 10px;
}

.candidate-contact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 0 14px 12px;
  color: var(--muted);
}

.candidate-contact-line input {
  min-width: 260px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line-dark);
  background: #fff;
}

.candidate-info-table {
  width: 100%;
  border-collapse: collapse;
}

.candidate-info-table th,
.candidate-info-table td {
  height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.candidate-info-table th {
  width: 260px;
  background: #f3f3f3;
  color: #28313d;
  font-weight: 700;
}

.candidate-info-table tr:nth-child(even) th,
.candidate-info-table tr:nth-child(even) td {
  background: #f7f7f7;
}

.candidate-info-table input,
.candidate-info-table select {
  width: 100%;
  min-height: 30px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
}

.candidate-info-table input:focus,
.candidate-info-table select:focus,
.candidate-contact-line input:focus {
  outline: 2px solid rgba(236, 84, 54, 0.2);
  border-color: var(--accent);
  background: #fff;
}

.candidate-dossier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dossier-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfb;
}

.dossier-section-head h2 {
  margin: 0;
  color: #344056;
  font-size: 22px;
  font-weight: 300;
}

.dossier-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.dossier-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.dossier-grid-panel {
  overflow: hidden;
}

.dossier-entry-table input {
  width: 100%;
  min-height: 32px;
  border: 1px solid transparent;
  background: transparent;
}

.dossier-entry-table input:focus {
  outline: 2px solid rgba(236, 84, 54, 0.2);
  border-color: var(--accent);
  background: #fff;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field input,
.field select,
.compact-input,
.search-input,
.search-toolbar select {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line-dark);
  background: #fff;
  color: var(--text);
}

.study-adjust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.search-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) auto minmax(160px, 0.75fr) minmax(190px, 1fr) auto;
}

.merged-search-toolbar {
  grid-template-columns: minmax(240px, 1.2fr) auto minmax(150px, 0.68fr) minmax(180px, 0.85fr) minmax(150px, 0.68fr) minmax(320px, 1.2fr);
}

.study-toolbar {
  grid-template-columns: minmax(240px, 1.15fr) auto minmax(160px, 0.72fr) minmax(150px, 0.68fr) minmax(150px, 0.68fr) minmax(320px, 1.2fr);
}

.sort-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  grid-column: -2 / -1;
  justify-self: end;
  width: 100%;
}

.sort-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.record-stack {
  display: grid;
  gap: 12px;
}

.record-entry {
  margin: 0;
}

.download-doc-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.search-toolbar .search-input {
  min-width: 220px;
}

.program-summary {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.program-summary span,
.muted {
  color: var(--muted);
}

.program-manager-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.program-editor-panel {
  display: grid;
  gap: 16px;
}

.panel-header.compact {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.program-editor-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.program-doc-editor {
  display: grid;
  gap: 10px;
}

.program-doc-editor h3 {
  margin: 0;
  font-size: 15px;
}

.program-doc-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.program-doc-grid label {
  min-height: 36px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.program-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1280px) {
  .program-manager-layout {
    grid-template-columns: 1fr;
  }

  .program-editor-panel {
    position: static;
  }
}

.candidate-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
}

.cell-separator {
  height: 1px;
  margin: 8px 0;
  border: 0;
  background: var(--line);
}

.candidate-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-list {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
}

.experience-entry {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.experience-entry:last-child {
  border-bottom: 0;
}

.experience-entry p {
  margin: 0;
  color: var(--muted);
}

.text-button,
.primary-button,
.icon-mini {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line-dark);
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.primary-button {
  border-color: #d84628;
  background: var(--accent);
  color: #fff;
}

.icon-mini {
  width: 32px;
  min-height: 28px;
  margin-right: 5px;
  padding: 0;
}

.text-button.mini {
  min-height: 28px;
  font-size: 12px;
  font-weight: 600;
}

.primary-button.mini {
  min-height: 28px;
  font-size: 12px;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status.draft {
  background: #f1eadf;
  color: #76501d;
}

.status.sent {
  background: #e2edf8;
  color: #1e5d93;
}

.status.complete {
  background: #dff0e8;
  color: #1f6e53;
}

.status.incomplete {
  background: #f8e2df;
  color: #9f3c35;
}

.table-wrap {
  overflow: auto;
}

.data-table,
.justif-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: #fff;
}

.data-table th,
.data-table td,
.justif-table th,
.justif-table td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th,
.justif-table th {
  background: linear-gradient(#fbfbfb, #ececec);
  color: #394355;
  font-size: 12px;
  text-transform: uppercase;
}

.data-table tr:nth-child(even) td,
.justif-table tr:nth-child(even) td {
  background: #f7f7f7;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  min-height: 102px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-value {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  font-weight: 800;
}

.stat-foot {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.flow-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 40px;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
}

.flow-track {
  height: 12px;
  background: #eef1f5;
}

.flow-fill {
  display: block;
  height: 100%;
  background: var(--accent);
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.download-card,
.notification,
.empty-state {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.notification.is-unread {
  border-left: 4px solid var(--accent);
}

.application-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  padding: 10px 12px;
  background: #fff;
}

.application-modal h1 {
  margin: 0;
  color: var(--accent);
  font-size: 21px;
  font-weight: 300;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 0;
  background: transparent;
  color: #8b95a2;
  font-size: 20px;
}

.modal-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.modal-box {
  min-height: 190px;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.modal-box header {
  min-height: 36px;
  padding: 8px 12px;
  background: #575b62;
  color: #fff;
}

.modal-box dl {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  padding: 18px;
}

.modal-box dt {
  color: var(--muted);
}

.modal-box dd {
  margin: 0;
}

.modal-tabs {
  display: flex;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

.modal-tabs button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: #f6f6f6;
  color: #777;
  font-size: 18px;
}

.modal-tabs button.is-active {
  background: #fff;
  color: var(--accent);
}

.modal-body {
  overflow: auto;
  border: 1px solid var(--line);
  border-top: 0;
}

.modal-pad {
  padding: 16px;
}

.modal-footer {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, auto));
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: 360px;
  padding: 13px 14px;
  border: 1px solid #d0d6df;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 800;
}

@media (max-width: 1050px) {
  .broker-shell,
  .form-grid,
  .grid-2,
  .candidate-detail-grid,
  .candidate-dossier-grid,
  .modal-summary,
  .stats-grid,
  .document-grid {
    grid-template-columns: 1fr;
  }

  .broker-sidebar {
    min-height: auto;
  }

  .broker-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-toolbar,
  .wizard-progress {
    grid-template-columns: 1fr;
  }

  .modal-footer {
    grid-template-columns: 1fr;
  }
}

/* Modern operational UI refresh */
:root {
  --bg: #f6f7fb;
  --sidebar: #151923;
  --sidebar-dark: #0f131b;
  --accent: #f05a3f;
  --accent-dark: #d94328;
  --surface: #ffffff;
  --surface-soft: #fbfcfe;
  --line: #e0e5ee;
  --line-dark: #c8d0dc;
  --text: #1d2634;
  --muted: #697386;
  --blue: #2766c5;
  --green: #1f7a5c;
  --red: #bd3f34;
  --orange: #a76113;
  --teal: #117e88;
  --shadow: 0 18px 42px rgba(31, 41, 55, 0.10);
  --shadow-sm: 0 8px 24px rgba(31, 41, 55, 0.07);
}

body {
  background:
    linear-gradient(180deg, #f8fafc 0, var(--bg) 240px),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
input,
select,
textarea {
  border-radius: 6px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(39, 102, 197, 0.18);
  outline-offset: 2px;
}

.login-screen {
  background:
    linear-gradient(135deg, rgba(21, 25, 35, 0.96), rgba(17, 126, 136, 0.86)),
    #151923;
}

.login-card {
  gap: 18px;
  border: 0;
  border-radius: 8px;
  border-top: 4px solid var(--accent);
  box-shadow: 0 32px 80px rgba(7, 12, 20, 0.28);
}

.login-card h1 {
  font-size: 30px;
  font-weight: 760;
}

.broker-shell {
  grid-template-columns: 260px minmax(0, 1fr);
}

.broker-sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(240, 90, 63, 0.08), transparent 220px),
    linear-gradient(90deg, var(--sidebar), var(--sidebar-dark));
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.06);
}

.broker-brand {
  min-height: 66px;
  padding: 16px 18px;
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.broker-brand strong {
  color: #fff;
  font-size: 20px;
  font-weight: 850;
}

.broker-brand span {
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 6px;
  color: #f3f7fb;
  font-size: 14px;
  font-weight: 760;
}

.broker-user {
  margin: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.045);
}

.broker-user strong {
  color: #fff;
  text-transform: none;
}

.broker-user span {
  color: #b8c2d2;
}

.agent-language-switch {
  padding: 0 12px 10px;
}

.agent-language-switch button {
  min-width: 42px;
  min-height: 28px;
  border-radius: 999px;
}

.broker-nav {
  gap: 3px;
  padding: 4px 10px 16px;
}

.broker-nav button {
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: #d7deea;
  font-weight: 680;
}

.broker-nav button:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.broker-nav button.is-active {
  border-left-color: transparent;
  background: linear-gradient(90deg, rgba(240, 90, 63, 0.98), rgba(240, 90, 63, 0.78));
  color: #fff;
  box-shadow: 0 10px 28px rgba(240, 90, 63, 0.18);
}

.broker-main {
  padding: 28px 32px 40px;
}

.page {
  gap: 18px;
}

.page-head {
  min-height: 52px;
  padding-bottom: 4px;
}

.page h1 {
  color: #182234;
  font-size: 30px;
  font-weight: 760;
}

.page-actions {
  justify-content: flex-end;
}

.blank-news {
  min-height: 520px;
  border: 1px dashed var(--line-dark);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.panel,
.stat,
.download-card,
.notification,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel.pad,
.stat,
.download-card,
.notification,
.empty-state {
  padding: 18px;
}

.panel h2,
.panel-header h2 {
  color: #182234;
  font-size: 17px;
  font-weight: 800;
}

.panel-header,
.dossier-section-head {
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.form-section-title,
.dossier-section-head h2 {
  color: #182234;
  font-size: 22px;
  font-weight: 760;
}

.candidate-info-panel,
.dossier-grid-panel {
  border-radius: 8px;
}

.candidate-contact-line {
  padding: 0 16px 14px;
}

.candidate-contact-line input,
.field input,
.field select,
.search-input,
.search-toolbar select,
.candidate-info-table input,
.candidate-info-table select,
.dossier-entry-table input,
.dossier-entry-table select {
  border: 1px solid var(--line-dark);
  background: #fff;
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.candidate-info-table input,
.candidate-info-table select,
.dossier-entry-table input,
.dossier-entry-table select {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
}

.candidate-info-table input:focus,
.candidate-info-table select:focus,
.candidate-contact-line input:focus,
.dossier-entry-table input:focus,
.dossier-entry-table select:focus,
.field input:focus,
.field select:focus,
.search-input:focus,
.search-toolbar select:focus {
  outline: 0;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(39, 102, 197, 0.14);
}

.candidate-info-table th,
.candidate-info-table td {
  border-color: var(--line);
}

.candidate-info-table th {
  background: #f8fafc;
  color: #465468;
}

.candidate-info-table tr:nth-child(even) th,
.candidate-info-table tr:nth-child(even) td {
  background: #fbfcfe;
}

.locked-note {
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff8ed;
  color: #7b4a11;
}

.file-input {
  display: none;
}

.doc-choice-list {
  display: grid;
  gap: 6px;
  min-width: 210px;
}

.doc-choice-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.doc-choice-list input {
  width: 14px;
  height: 14px;
  accent-color: var(--blue);
}

.multi-choice-dropdown {
  min-width: 260px;
}

.search-toolbar .multi-choice-dropdown {
  width: 100%;
  min-width: 0;
}

.multi-choice-dropdown summary {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 760;
  cursor: pointer;
  list-style: none;
}

.multi-choice-dropdown summary::-webkit-details-marker {
  display: none;
}

.multi-choice-dropdown summary::after {
  content: "+";
  color: var(--muted);
  font-weight: 900;
}

.multi-choice-dropdown[open] summary::after {
  content: "-";
}

.multi-choice-menu {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.multi-choice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.multi-choice-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.multi-choice-menu label {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.multi-choice-menu input {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  accent-color: var(--blue);
}

.multi-choice-menu span {
  display: grid;
  gap: 2px;
}

.multi-choice-menu small {
  color: var(--muted);
}

.notification-messenger {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.message-sidebar {
  display: grid;
  align-content: start;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.message-thread {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  width: 100%;
  padding: 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.message-thread:hover,
.message-thread.is-active {
  background: #fff;
}

.message-thread strong,
.message-thread small,
.message-thread p {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-thread small,
.message-thread p {
  color: var(--muted);
}

.message-thread p {
  grid-column: 1 / -1;
  margin: 0;
}

.message-thread em {
  min-width: 22px;
  height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
}

.message-empty,
.message-empty-panel {
  color: var(--muted);
}

.message-empty {
  padding: 18px;
}

.message-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  background: #fff;
}

.message-empty-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  min-height: 520px;
  padding: 24px;
  text-align: center;
}

.message-empty-panel h2,
.message-empty-panel p {
  margin: 0;
}

.message-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.message-panel-head h2,
.message-panel-head p {
  margin: 0;
}

.message-panel-head p {
  color: var(--muted);
}

.message-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 18px;
  background: #f5f7fb;
}

.message-bubble {
  max-width: min(680px, 78%);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.message-bubble.is-mine {
  align-self: flex-end;
  border-color: #bfd3f4;
  background: #eef5ff;
}

.message-bubble header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.message-bubble h3 {
  margin: 6px 0 4px;
  font-size: 14px;
}

.message-bubble p {
  margin: 0;
  white-space: pre-wrap;
}

.message-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.message-composer input {
  min-height: 40px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  padding: 8px 10px;
}

@media (max-width: 860px) {
  .notification-messenger {
    grid-template-columns: 1fr;
  }

  .message-sidebar {
    max-height: 250px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .message-bubble {
    max-width: 92%;
  }
}

.search-toolbar {
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.82);
  box-shadow: var(--shadow-sm);
}

.search-input,
.search-toolbar select {
  min-height: 42px;
}

.program-summary {
  border-color: var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.wizard-actions {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow-sm);
}

.wizard-progress {
  gap: 8px;
}

.wizard-progress button {
  min-height: 56px;
  border-color: var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(31,41,55,0.03);
}

.wizard-progress button.is-active {
  border-color: rgba(240, 90, 63, 0.65);
  box-shadow: inset 0 3px 0 var(--accent), var(--shadow-sm);
}

.wizard-progress button span {
  border-radius: 6px;
}

.draft-banner {
  border-radius: 8px;
}

.confirm-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-left: 4px solid var(--accent);
}

.confirm-panel h2 {
  margin: 0 0 4px;
}

.confirm-panel p {
  margin: 0;
  color: var(--muted);
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.text-button,
.primary-button,
.icon-mini {
  min-height: 38px;
  border-radius: 6px;
  font-weight: 760;
  transition: transform 120ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.text-button {
  border-color: var(--line-dark);
  background: #fff;
}

.text-button:hover {
  border-color: #aeb9ca;
  background: #f8fafc;
}

.primary-button {
  border-color: var(--accent-dark);
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  box-shadow: 0 10px 22px rgba(240, 90, 63, 0.22);
}

.primary-button:hover {
  transform: translateY(-1px);
}

.candidate-link {
  color: var(--blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.badge,
.status {
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 850;
}

.status.draft {
  background: #fff1da;
  color: #86540e;
}

.status.sent {
  background: #e7f0ff;
  color: #225ca8;
}

.status.complete {
  background: #dff7ed;
  color: #156448;
}

.status.incomplete {
  background: #ffe9e5;
  color: #a6372d;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.panel .table-wrap {
  border-width: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: none;
}

.data-table,
.justif-table {
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.data-table th,
.data-table td,
.justif-table th,
.justif-table td {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.data-table th,
.justif-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #465468;
  letter-spacing: 0;
}

.data-table tr:last-child td,
.justif-table tr:last-child td {
  border-bottom: 0;
}

.data-table tr:nth-child(even) td,
.justif-table tr:nth-child(even) td {
  background: #fcfdff;
}

.data-table tbody tr:hover td,
.justif-table tbody tr:hover td {
  background: #f6f9ff;
}

.sort-order-control {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  align-items: center;
  justify-self: stretch;
  gap: 8px;
  min-width: 300px;
}

.search-toolbar .sort-order-control {
  width: 100%;
}

.sort-order-control select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding-right: 28px;
  font-weight: 760;
  text-overflow: ellipsis;
}

textarea {
  width: 100%;
  min-width: 0;
  resize: vertical;
  border: 1px solid var(--line-dark);
  background: #fff;
  color: var(--text);
  line-height: 1.45;
}

.document-remark-panel,
.student-remark-panel {
  display: grid;
  gap: 12px;
}

.document-remark-panel {
  grid-template-columns: minmax(0, 1fr);
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.document-remark-panel h3,
.remark-readonly h3 {
  margin: 0 0 8px;
  color: #172033;
  font-size: 14px;
}

.document-remark-readonly {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 12px;
}

.remark-entry-list {
  display: grid;
  gap: 8px;
}

.remark-entry-row {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.remark-entry-row strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.remark-entry-row p {
  margin: 0;
  overflow-wrap: anywhere;
}

.hash-chip {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #c9d4e5;
  border-radius: 6px;
  background: #eef5ff;
  color: #24527f;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.student-remark-panel textarea {
  min-height: 118px;
}

.document-remark-panel textarea {
  min-height: 96px;
}

.new-application-remark-panel {
  border-top: 1px solid var(--line);
}

.application-modal .document-remark-panel {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.study-toolbar-enhanced {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
}

.study-search-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.study-search-row .search-input {
  width: 100%;
  min-width: 0;
}

.study-filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(390px, 1.45fr);
  gap: 10px;
  align-items: start;
}

.study-filter-row-agent {
  grid-template-columns: repeat(2, minmax(170px, 1fr)) minmax(390px, 1.45fr);
}

.study-filter-row .multi-choice-dropdown,
.study-filter-row .sort-control,
.study-filter-row .sort-control select {
  width: 100%;
  min-width: 0;
}

.study-filter-row .sort-control {
  grid-column: auto;
  justify-self: stretch;
}

.study-filter-row .sort-control span {
  white-space: nowrap;
}

.study-statistics {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.study-stat {
  display: grid;
  min-height: 74px;
  align-content: center;
  gap: 3px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.study-stat strong {
  color: #172033;
  font-size: 24px;
  line-height: 1;
}

.study-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.study-status-select {
  min-width: 150px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.study-table {
  min-width: 1040px;
  table-layout: fixed;
}

.study-table th,
.study-table td {
  vertical-align: top;
}

.study-table-admin .study-student-col {
  width: 20%;
}

.study-table-admin .study-agent-col {
  width: 13%;
}

.study-table-admin .study-program-col {
  width: 20%;
}

.study-table-admin .study-intake-col {
  width: 10%;
}

.study-table-admin .study-year-col {
  width: 13%;
}

.study-table-admin .study-status-col {
  width: 14%;
}

.study-table-admin .study-actions-col {
  width: 10%;
}

.study-table-agent .study-student-col {
  width: 25%;
}

.study-table-agent .study-program-col {
  width: 25%;
}

.study-table-agent .study-intake-col {
  width: 13%;
}

.study-table-agent .study-year-col {
  width: 15%;
}

.study-table-agent .study-status-col {
  width: 11%;
}

.study-table-agent .study-actions-col {
  width: 11%;
}

.admin-applications-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
}

.admin-applications-search-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.admin-applications-search-row .search-input {
  width: 100%;
  min-width: 0;
}

.admin-applications-filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) minmax(390px, 1.45fr);
  gap: 10px;
  align-items: start;
}

.admin-applications-filter-row .multi-choice-dropdown,
.admin-applications-filter-row .sort-control,
.admin-applications-filter-row .sort-control select {
  width: 100%;
  min-width: 0;
}

.study-filter-row .sort-order-control,
.admin-applications-filter-row .sort-order-control {
  min-width: 0;
}

.admin-applications-filter-row .sort-control {
  grid-column: auto;
  justify-self: stretch;
}

.admin-applications-filter-row .sort-control span {
  white-space: nowrap;
}

.admin-applications-table {
  min-width: 1080px;
  table-layout: fixed;
}

.admin-applications-table .candidate-col {
  width: 18%;
}

.admin-applications-table .applications-col {
  width: 12%;
}

.admin-applications-table .programs-col {
  width: 21%;
}

.admin-applications-table .intake-col {
  width: 9%;
}

.admin-applications-table .agent-col {
  width: 12%;
}

.admin-applications-table .submission-col {
  width: 11%;
}

.admin-applications-table .status-col {
  width: 10%;
}

.admin-applications-table .actions-col {
  width: 7%;
}

.admin-applications-table th,
.admin-applications-table td {
  padding: 12px;
  line-height: 1.35;
}

.admin-applications-table th {
  white-space: nowrap;
}

.admin-applications-table .application-count,
.admin-applications-table .application-number-list {
  display: block;
}

.admin-applications-table .application-count {
  margin-bottom: 4px;
}

.admin-applications-table .application-number-list {
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.35;
}

.admin-applications-table .cell-separator {
  margin: 8px 0;
}

.admin-applications-table .status {
  display: inline-flex;
  margin: 0 4px 5px 0;
  white-space: nowrap;
}

.admin-applications-table .actions-cell {
  text-align: right;
  white-space: nowrap;
}

.admin-applications-table .actions-cell .text-button {
  min-height: 32px;
  padding: 0 10px;
}

@media (max-width: 1180px) {
  .admin-applications-filter-row {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .study-filter-row,
  .study-filter-row-agent {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .study-statistics {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

@media (max-width: 700px) {
  .admin-applications-search-row,
  .admin-applications-filter-row,
  .study-search-row,
  .study-filter-row,
  .study-filter-row-agent {
    grid-template-columns: 1fr;
  }

  .sort-order-control {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .study-statistics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

.stats-grid {
  gap: 16px;
}

.stat {
  border-top: 3px solid var(--teal);
}

.stat-value {
  color: #182234;
}

.flow-track {
  border-radius: 6px;
  background: #e8edf5;
  overflow: hidden;
}

.flow-fill {
  background: linear-gradient(90deg, var(--teal), var(--accent));
}

.candidate-detail-grid {
  gap: 16px;
}

.detail-list {
  gap: 10px 16px;
}

.experience-entry {
  border-color: var(--line);
}

.application-modal {
  inset: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.28);
}

.application-modal h1 {
  color: #182234;
  font-weight: 780;
}

.modal-close {
  top: 12px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #f2f5f9;
}

.modal-box {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.modal-box header {
  background: #182234;
  font-weight: 800;
}

.modal-tabs {
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.modal-tabs button {
  min-height: 40px;
  border-radius: 6px 6px 0 0;
  background: #f4f7fb;
  color: var(--muted);
  font-size: 15px;
  font-weight: 760;
}

.modal-tabs button.is-active {
  background: #fff;
  color: var(--accent-dark);
}

.modal-body {
  border-color: var(--line);
}

.admin-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.procedure-list {
  display: grid;
  gap: 10px;
}

.procedure-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.procedure-step span {
  grid-row: 1 / 3;
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #182234;
  color: #fff;
  font-weight: 800;
}

.procedure-step strong,
.procedure-step p {
  margin: 0;
}

.procedure-step p {
  color: var(--muted);
  font-size: 13px;
}

.toast {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.broker-main {
  padding: clamp(20px, 2.4vw, 34px);
}

.page {
  width: min(100%, 1500px);
  margin: 0 auto;
  gap: clamp(14px, 1.4vw, 20px);
}

.page-head {
  align-items: flex-start;
}

.panel,
.table-wrap,
.toolbar,
.bottom-bar,
.empty-state {
  border-radius: 8px;
}

.panel.pad {
  padding: clamp(16px, 1.5vw, 22px);
}

.form-grid,
.grid-2,
.candidate-detail-grid {
  gap: clamp(12px, 1.3vw, 18px);
}

.field {
  min-width: 0;
}

.field input,
.field select,
.field textarea,
.compact-input,
.search-input {
  min-width: 0;
}

.modal-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.application-modal {
  max-width: 1180px;
  margin: auto;
}

html[lang="zh-CN"] body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Segoe UI", Arial, sans-serif;
  line-height: 1.58;
}

html[lang="zh-CN"] .broker-shell {
  grid-template-columns: 272px minmax(0, 1fr);
}

html[lang="zh-CN"] .broker-brand strong {
  font-size: 19px;
  letter-spacing: 0;
}

html[lang="zh-CN"] .broker-user {
  gap: 5px;
}

html[lang="zh-CN"] .broker-user strong {
  font-size: 15px;
  line-height: 1.35;
}

html[lang="zh-CN"] .agent-language-switch {
  gap: 6px;
  padding: 0 14px 12px;
}

html[lang="zh-CN"] .agent-language-switch button {
  min-width: 38px;
  min-height: 30px;
  padding: 0 9px;
}

html[lang="zh-CN"] .agent-language-switch .language-code {
  font-size: 12px;
  font-weight: 850;
}

html[lang="zh-CN"] .broker-nav {
  gap: 5px;
}

html[lang="zh-CN"] .broker-nav button {
  min-height: 44px;
  font-size: 15px;
  line-height: 1.25;
}

html[lang="zh-CN"] .page {
  max-width: 1480px;
  gap: 18px;
}

html[lang="zh-CN"] .page h1 {
  font-size: 28px;
  font-weight: 800;
}

html[lang="zh-CN"] .page-head {
  gap: 16px;
}

html[lang="zh-CN"] .search-toolbar,
html[lang="zh-CN"] .wizard-actions {
  gap: 12px;
}

html[lang="zh-CN"] .wizard-progress {
  grid-template-columns: repeat(4, minmax(155px, 1fr));
  gap: 10px;
}

html[lang="zh-CN"] .wizard-progress button {
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 58px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.25;
}

html[lang="zh-CN"] .wizard-progress button span {
  width: 28px;
  height: 28px;
}

html[lang="zh-CN"] .form-section-title,
html[lang="zh-CN"] .dossier-section-head h2 {
  font-size: 21px;
}

html[lang="zh-CN"] .candidate-info-table th {
  width: 190px;
  white-space: nowrap;
}

html[lang="zh-CN"] .candidate-info-table th,
html[lang="zh-CN"] .candidate-info-table td,
html[lang="zh-CN"] .dossier-entry-table th,
html[lang="zh-CN"] .dossier-entry-table td {
  padding: 10px 14px;
}

html[lang="zh-CN"] .candidate-contact-line {
  gap: 10px;
}

html[lang="zh-CN"] .field label,
html[lang="zh-CN"] .sort-control span,
html[lang="zh-CN"] .data-table th,
html[lang="zh-CN"] .justif-table th {
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

html[lang="zh-CN"] .text-button,
html[lang="zh-CN"] .primary-button,
html[lang="zh-CN"] .icon-mini {
  min-height: 40px;
  padding-inline: 14px;
}

html[lang="zh-CN"] .text-button.mini,
html[lang="zh-CN"] .primary-button.mini {
  min-height: 32px;
  padding-inline: 10px;
  font-size: 13px;
}

html[lang="zh-CN"] .multi-choice-dropdown summary {
  min-height: 42px;
  line-height: 1.25;
}

html[lang="zh-CN"] .multi-choice-menu label {
  align-items: center;
  font-size: 14px;
}

html[lang="zh-CN"] .status,
html[lang="zh-CN"] .badge {
  min-height: 26px;
  border-radius: 7px;
  font-size: 13px;
}

html[lang="zh-CN"] .message-thread,
html[lang="zh-CN"] .message-bubble {
  line-height: 1.55;
}

html[lang="zh-CN"] .message-bubble h3 {
  font-size: 15px;
}

html[lang="zh-CN"] .study-filter-row-agent {
  grid-template-columns: repeat(2, minmax(185px, 1fr)) minmax(360px, 1.35fr);
}

html[lang="zh-CN"] .study-stat span {
  letter-spacing: 0;
  text-transform: none;
}

@media (max-width: 1050px) {
  html[lang="zh-CN"] .broker-shell {
    grid-template-columns: 1fr;
  }

  html[lang="zh-CN"] .wizard-progress {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 640px) {
  html[lang="zh-CN"] .wizard-progress {
    grid-template-columns: 1fr;
  }

  html[lang="zh-CN"] .candidate-info-table th {
    width: 150px;
    white-space: normal;
  }
}

@media (max-width: 1050px) {
  .broker-shell {
    grid-template-columns: 1fr;
  }

  .broker-sidebar {
    position: static;
    min-height: auto;
  }

  .broker-brand {
    min-height: 58px;
  }

  .broker-main {
    padding: 20px 16px 32px;
  }

  .wizard-actions {
    position: static;
  }

  .confirm-panel,
  .confirm-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .application-modal {
    inset: 8px;
  }

  .admin-control-grid {
    grid-template-columns: 1fr;
  }

  .page-head,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-summary {
    grid-template-columns: 1fr;
  }
}

/* Refined candidate/study workspaces */
.candidate-toolbar,
.admin-applications-toolbar,
.study-toolbar-enhanced {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow-sm);
}

.candidate-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 14px;
  padding: 16px;
}

.candidate-search-row,
.admin-applications-search-row,
.study-search-row {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(96px, auto);
  gap: 12px;
  align-items: center;
}

.admin-applications-search-row {
  grid-template-columns: minmax(360px, 1fr) minmax(96px, auto) minmax(96px, auto);
}

.candidate-filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr)) minmax(330px, 1.15fr);
  gap: 12px;
  align-items: start;
}

.candidate-filter-row .multi-choice-dropdown,
.candidate-filter-row .sort-control,
.candidate-filter-row .sort-control select,
.admin-applications-filter-row .multi-choice-dropdown,
.admin-applications-filter-row .sort-control,
.admin-applications-filter-row .sort-control select,
.study-filter-row .multi-choice-dropdown,
.study-filter-row .sort-control,
.study-filter-row .sort-control select {
  width: 100%;
  min-width: 0;
}

.search-input,
.compact-input,
.field input,
.field select,
.field textarea,
.multi-choice-dropdown summary,
.sort-order-control select {
  min-height: 44px;
  font-size: 14px;
  line-height: 1.35;
}

.search-input {
  padding-inline: 12px;
  font-weight: 620;
  letter-spacing: 0;
}

.multi-choice-dropdown {
  position: relative;
  min-width: 0;
}

.multi-choice-dropdown summary {
  padding: 9px 12px;
  border-radius: 7px;
  font-weight: 760;
  overflow-wrap: anywhere;
  white-space: normal;
}

.multi-choice-menu {
  position: absolute;
  z-index: 40;
  width: 100%;
  min-width: min(320px, calc(100vw - 40px));
  max-height: min(430px, 68vh);
  overflow: auto;
  padding: 10px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
}

.multi-choice-menu label {
  min-height: 38px;
  padding: 8px 9px;
  font-size: 13px;
  line-height: 1.3;
}

.sort-order-control {
  grid-template-columns: max-content minmax(230px, 1fr);
  min-width: 0;
  align-items: center;
}

.sort-order-control span {
  font-size: 12px;
  line-height: 1.2;
}

.sort-order-control select {
  padding-inline: 12px 34px;
}

.student-file-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.student-file-card {
  gap: 14px;
}

.student-file-card > .primary-button {
  justify-self: end;
  min-width: 190px;
}

.student-file-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.student-file-card-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.student-file-card-head strong,
.student-file-card-head span {
  overflow-wrap: anywhere;
}

.student-file-card .download-doc-list {
  gap: 8px;
  margin-top: 0;
}

.student-file-card .download-doc-list .text-button {
  justify-content: flex-start;
  width: 100%;
}

.student-file-upload-list {
  display: grid;
  gap: 10px;
}

.student-file-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.student-file-upload-row > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.student-file-upload-row strong,
.student-file-upload-row span {
  overflow-wrap: anywhere;
}

.student-file-upload-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.student-file-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.file-upload-button {
  cursor: pointer;
}

.file-upload-button input {
  display: none;
}

.student-file-agent-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.student-file-agent-panel strong {
  color: #172033;
  font-size: 22px;
  line-height: 1;
}

.student-file-agent-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
}

.mobile-card-list {
  display: none;
}

.mobile-record-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.mobile-record-head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.mobile-card-field {
  display: grid;
  grid-template-columns: minmax(104px, 0.38fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.mobile-card-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.mobile-card-field > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mobile-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

@media (max-width: 1180px) {
  .candidate-filter-row {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .broker-main {
    padding: 14px 10px 28px;
  }

  .broker-brand {
    min-height: 54px;
    padding-inline: 14px;
  }

  .broker-user {
    margin: 10px;
    padding: 12px;
  }

  .broker-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 10px 12px;
    scrollbar-width: thin;
  }

  .broker-nav button {
    flex: 0 0 auto;
    min-height: 38px;
    min-width: max-content;
    padding: 0 14px;
    border-radius: 999px;
    text-align: center;
    white-space: nowrap;
  }

  .broker-nav button.is-active {
    box-shadow: 0 8px 18px rgba(240, 90, 63, 0.18);
  }

  .page {
    gap: 12px;
  }

  .page h1 {
    font-size: 23px;
    line-height: 1.2;
  }

  .candidate-toolbar,
  .admin-applications-toolbar,
  .study-toolbar-enhanced {
    gap: 10px;
    padding: 12px;
  }

  .candidate-search-row,
  .admin-applications-search-row,
  .study-search-row,
  .candidate-filter-row,
  .admin-applications-filter-row,
  .study-filter-row,
  .study-filter-row-agent,
  html[lang="zh-CN"] .study-filter-row,
  html[lang="zh-CN"] .study-filter-row-agent,
  html[lang="zh-CN"] .candidate-filter-row,
  html[lang="zh-CN"] .admin-applications-filter-row {
    grid-template-columns: 1fr;
  }

  .search-input,
  .compact-input,
  .field input,
  .field select,
  .field textarea,
  .multi-choice-dropdown summary,
  .sort-order-control select {
    min-height: 46px;
    font-size: 15px;
  }

  .candidate-search-row,
  .study-search-row,
  .admin-applications-search-row {
    gap: 8px;
  }

  .sort-order-control {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .sort-order-control span {
    font-size: 13px;
  }

  .multi-choice-menu {
    position: static;
    width: 100%;
    min-width: 0;
    max-height: none;
    box-shadow: none;
  }

  .study-statistics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-file-grid,
  .document-grid,
  .candidate-detail-grid,
  .grid-2,
  .form-grid,
  .form-grid.wide-left {
    grid-template-columns: 1fr;
  }

  .detail-list {
    grid-template-columns: 1fr;
    gap: 4px 0;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table th,
  .data-table td,
  .justif-table th,
  .justif-table td {
    padding: 10px;
    font-size: 14px;
  }

  .study-table,
  .admin-applications-table {
    min-width: 760px;
  }

  .application-modal {
    inset: 6px;
    padding: 8px;
  }

  .mobile-card-list {
    display: grid;
    gap: 10px;
  }

  .responsive-table-wrap {
    display: none;
  }

  .mobile-card-actions .text-button,
  .mobile-card-actions .primary-button {
    flex: 1 1 140px;
  }

  .student-file-upload-row {
    grid-template-columns: 1fr;
  }

  .student-file-row-actions {
    justify-content: flex-start;
  }

  .student-file-card > .primary-button {
    justify-self: stretch;
    min-width: 0;
  }
}

@media (max-width: 540px) {
  .broker-main {
    padding: 12px 8px 24px;
  }

  .page h1 {
    font-size: 21px;
  }

  .page-head,
  .panel-header,
  .student-file-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .study-statistics {
    grid-template-columns: 1fr;
  }

  .study-stat {
    min-height: 64px;
  }

  .study-stat strong {
    font-size: 22px;
  }

  .candidate-info-table,
  .candidate-info-table tbody,
  .candidate-info-table tr,
  .candidate-info-table th,
  .candidate-info-table td {
    display: block;
    width: 100%;
  }

  .candidate-info-table th,
  html[lang="zh-CN"] .candidate-info-table th {
    width: 100%;
    white-space: normal;
  }

  .candidate-info-table td {
    border-top: 0;
  }

  .login-actions {
    grid-template-columns: 1fr;
  }

  .mobile-record-card {
    padding: 12px;
  }

  .mobile-card-field {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .mobile-card-actions .text-button,
  .mobile-card-actions .primary-button {
    flex-basis: 100%;
  }
}

/* Final ergonomic refinements */
.candidate-toolbar,
.admin-applications-toolbar,
.study-toolbar-enhanced {
  gap: 13px;
  padding: 15px;
}

.candidate-search-row,
.admin-applications-search-row,
.study-search-row {
  grid-template-columns: minmax(320px, 1fr) minmax(104px, auto);
}

.admin-applications-search-row {
  grid-template-columns: minmax(320px, 1fr) minmax(104px, auto) minmax(104px, auto);
}

.candidate-filter-row {
  grid-template-columns: minmax(150px, 0.8fr) minmax(210px, 1.05fr) minmax(170px, 0.9fr) minmax(310px, 1.35fr);
}

.admin-applications-filter-row {
  grid-template-columns: minmax(140px, 0.8fr) minmax(210px, 1.05fr) minmax(160px, 0.85fr) minmax(170px, 0.95fr) minmax(310px, 1.35fr);
}

.study-filter-row {
  grid-template-columns: minmax(210px, 1.05fr) minmax(160px, 0.82fr) minmax(160px, 0.82fr) minmax(310px, 1.35fr);
}

.study-filter-row-agent {
  grid-template-columns: minmax(210px, 1.05fr) minmax(160px, 0.82fr) minmax(310px, 1.35fr);
}

.search-input,
.compact-input,
.field input,
.field select,
.field textarea,
.multi-choice-dropdown summary,
.sort-order-control select {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
}

.multi-choice-dropdown summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  padding-right: 34px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-choice-dropdown summary::after {
  justify-self: end;
}

.sort-order-control {
  gap: 9px;
}

.sort-order-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.uploaded-file-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.uploaded-file-cell .muted {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-file-agent-panel {
  justify-items: start;
}

.student-file-agent-panel .primary-button {
  min-width: 160px;
}

@media (max-width: 1180px) {
  .candidate-filter-row,
  .admin-applications-filter-row,
  .study-filter-row,
  .study-filter-row-agent {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
  }
}

@media (max-width: 760px) {
  .broker-shell {
    display: block;
  }

  .broker-sidebar {
    position: static !important;
    width: 100%;
    min-height: auto;
    overflow: visible;
  }

  .broker-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding: 8px 10px 12px;
  }

  .broker-nav button {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .candidate-search-row,
  .admin-applications-search-row,
  .study-search-row,
  .candidate-filter-row,
  .admin-applications-filter-row,
  .study-filter-row,
  .study-filter-row-agent {
    grid-template-columns: 1fr;
  }

  .candidate-toolbar,
  .admin-applications-toolbar,
  .study-toolbar-enhanced {
    border-radius: 8px;
    padding: 11px;
  }

  .multi-choice-dropdown summary {
    white-space: normal;
  }

  .uploaded-file-cell {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}

/* Compact filters, Agent management and mobile ergonomics */
.filter-panel {
  position: relative;
  min-width: 0;
}

.filter-panel > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--text);
  font-weight: 850;
  list-style: none;
  cursor: pointer;
}

.filter-panel > summary::-webkit-details-marker {
  display: none;
}

.filter-panel > summary::before {
  content: "Filter";
  display: inline-grid;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(236, 84, 54, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.filter-panel > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.filter-panel[open] > summary::after {
  transform: rotate(225deg);
}

.filter-panel > summary span,
.filter-panel > summary small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-panel > summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.filter-panel-body {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.multi-choice-menu label span,
.multi-choice-menu label small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-choice-menu label span {
  display: grid;
  gap: 2px;
}

.multi-choice-menu label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.program-hash {
  display: inline-grid;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(30, 106, 168, 0.18);
  border-radius: 999px;
  background: rgba(30, 106, 168, 0.08);
  color: #174f80;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-form-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.agent-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.agent-invite-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.agent-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.agent-detail-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fbfcfe;
}

.agent-detail-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.agent-detail-grid strong {
  min-width: 0;
  overflow: hidden;
  color: #172033;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-admin-controls {
  grid-template-columns: minmax(160px, 0.4fr) minmax(160px, 0.4fr) minmax(280px, 1fr);
}

.agent-program-picker {
  display: grid;
  gap: 10px;
}

.agent-program-picker > strong {
  font-size: 13px;
  text-transform: uppercase;
}

.agent-program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.agent-program-grid label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.agent-program-grid span,
.agent-program-grid small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-program-grid span {
  display: grid;
  gap: 2px;
  font-weight: 780;
}

.agent-program-grid small {
  color: var(--muted);
  font-size: 11px;
}

.agent-login-card {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px dashed var(--line-dark);
  border-radius: 8px;
  background: #fffdfb;
}

.agent-login-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.agent-login-card strong,
.agent-login-card code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-login-card code {
  padding: 5px 8px;
  border-radius: 6px;
  background: #f1f4f8;
  color: #172033;
  font-size: 12px;
  font-weight: 850;
}

.settings-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.9);
  border-radius: 8px;
  color: #475569;
}

.settings-note strong {
  color: #0f172a;
  font-size: 0.92rem;
}

.compact-profile-lines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.compact-profile-lines > div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fff;
}

.compact-profile-lines span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.compact-profile-lines strong {
  color: #0f172a;
  font-size: 0.94rem;
  line-height: 1.35;
}

.agent-program-form-dropdown {
  max-width: 420px;
}

.text-button.danger {
  color: var(--red);
}

@media (max-width: 860px) {
  .agent-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-invite-layout,
  .agent-account-layout {
    grid-template-columns: 1fr;
  }

  .agent-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-account-form,
  .agent-security-form {
    grid-column: 1;
    grid-row: auto;
  }

  .agent-account-form,
  .agent-security-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .compact-profile-lines {
    grid-template-columns: 1fr;
  }

  .settings-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .agent-detail-grid,
  .agent-account-form,
  .agent-security-form,
  .agent-admin-controls {
    grid-template-columns: 1fr;
  }

  .filter-panel > summary {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 42px;
    padding: 0 11px;
  }

  .filter-panel > summary small {
    display: none;
  }

  .filter-panel-body {
    padding: 9px;
  }

  .filter-panel .multi-choice-menu {
    max-height: 260px;
    overflow: auto;
  }

  .multi-choice-dropdown summary {
    white-space: nowrap;
  }

  .study-statistics {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .study-stat {
    flex: 0 0 124px;
    min-height: 58px;
    scroll-snap-align: start;
  }

  .study-stat strong {
    font-size: 22px;
  }

  .study-stat span {
    white-space: nowrap;
  }

  .mobile-card-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }

  .mobile-record-card {
    flex: 0 0 min(430px, 92vw);
    gap: 9px;
    scroll-snap-align: start;
  }

  .mobile-card-field {
    grid-template-columns: minmax(88px, 0.34fr) minmax(0, 1fr);
    gap: 8px;
  }

  .mobile-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-card-actions .text-button,
  .mobile-card-actions .primary-button {
    flex: unset;
    min-width: 0;
  }

  .agent-form-grid,
  .agent-program-grid,
  .agent-login-card {
    grid-template-columns: 1fr;
  }

  .agent-login-card {
    gap: 6px;
  }
}

@media (max-width: 540px) {
  .study-statistics {
    grid-template-columns: none;
  }

  .study-stat {
    min-height: 56px;
  }

  .mobile-card-field {
    grid-template-columns: minmax(82px, 0.34fr) minmax(0, 1fr);
    gap: 7px;
  }

  .mobile-card-actions .text-button,
  .mobile-card-actions .primary-button {
    flex-basis: auto;
  }
}

/* Account, dashboard and compact mobile refinements */
html,
body,
.broker-shell {
  max-width: 100vw;
  overflow-x: hidden;
}

.broker-main,
.page,
.panel,
.toolbar {
  min-width: 0;
}

.page {
  width: 100%;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.stat {
  display: grid;
  min-height: 74px;
  align-content: center;
  gap: 3px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.stat-label,
.stat-foot {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-value {
  font-size: 24px;
  line-height: 1;
}

.admin-account-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.admin-account-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
}

.field.full {
  grid-column: 1 / -1;
}

.auth-flow-card {
  width: min(720px, calc(100vw - 28px));
}

.login-actions.single-line {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.login-forgot-button {
  justify-self: start;
}

.field-hint,
.auth-message {
  color: var(--muted);
  font-size: 12px;
}

.auth-message {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow-wrap: anywhere;
}

.auth-message a {
  display: inline-block;
  margin-top: 6px;
  color: var(--blue);
  font-weight: 850;
}

.broker-user small {
  color: #d6d6d6;
  font-size: 12px;
  line-height: 1.3;
}

.table-code {
  display: inline-block;
  max-width: min(360px, 42vw);
  overflow: hidden;
  color: #172033;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.detail-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 12px;
  align-items: baseline;
}

.detail-list dt {
  white-space: nowrap;
}

.detail-list dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.candidate-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 850;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.agent-page-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
  padding: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.36);
}

.feedback-card {
  display: grid;
  gap: 12px;
  width: min(560px, 100%);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.feedback-card textarea {
  width: 100%;
  resize: vertical;
}

.modal-close.inline {
  position: static;
}

@media (max-width: 1180px) {
  .admin-account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .stats-grid,
  .study-statistics {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .stat,
  .study-stat {
    flex: 0 0 124px;
    min-height: 58px;
    padding: 10px 11px;
    scroll-snap-align: start;
  }

  .stat-value,
  .study-stat strong {
    font-size: 21px;
  }

  .admin-account-grid,
  .login-actions.single-line {
    grid-template-columns: 1fr;
  }

  .detail-list {
    grid-template-columns: minmax(86px, 0.35fr) minmax(0, 1fr);
    gap: 5px 8px;
    font-size: 13px;
  }

  .candidate-detail-grid .panel,
  .study-management-grid,
  .modal-box {
    min-width: 0;
  }

  .mobile-record-card {
    padding: 10px;
  }

  .mobile-card-field {
    grid-template-columns: minmax(86px, 0.35fr) minmax(0, 1fr);
    gap: 5px 8px;
  }

  .agent-page-footer {
    justify-content: space-between;
    padding-inline: 2px;
  }

  .feedback-modal {
    align-items: end;
    padding: 10px;
  }
}

.filter-panel > summary {
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
}

.filter-panel > summary::before {
  content: none;
  display: none;
}

.filter-panel > summary span {
  display: inline-grid;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(236, 84, 54, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .filter-panel > summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/* Final ergonomic pass: compact records, stable filters and name shortcuts */
.agent-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.agent-stack .agent-link {
  display: inline-block;
  max-width: 100%;
}

.candidate-link.agent-link {
  color: #155e78;
}

.data-table td,
.justif-table td {
  vertical-align: top;
}

.data-table td .muted,
.mobile-record-card .muted,
.modal-box .muted {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.candidate-search-row,
.admin-applications-search-row,
.study-search-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) max-content;
  gap: 10px;
  align-items: center;
}

.candidate-toolbar .search-input,
.admin-applications-toolbar .search-input,
.study-toolbar-enhanced .search-input {
  min-width: 0;
  height: 42px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
}

.candidate-filter-row,
.admin-applications-filter-row,
.study-filter-row {
  align-items: end;
}

.filter-dropdown,
.sort-order-control {
  min-width: min(100%, 210px);
}

.filter-dropdown summary,
.sort-order-control select {
  min-height: 42px;
  font-size: 13px;
  font-weight: 820;
}

.sort-order-control select {
  border-radius: 8px;
}

.multi-choice-menu {
  min-width: min(360px, calc(100vw - 40px));
  box-shadow: 0 18px 44px rgba(26, 32, 44, 0.12);
}

.mobile-record-card,
.modal-box,
.candidate-detail-grid .panel {
  overflow-wrap: anywhere;
}

.modal-summary {
  align-items: stretch;
}

.modal-box dl,
.detail-list {
  column-gap: 10px;
  row-gap: 6px;
}

.modal-box dd,
.detail-list dd {
  min-width: 0;
}

.study-table {
  min-width: 1120px;
}

.study-table-admin .study-student-col {
  width: 18%;
}

.study-table-admin .study-agent-col {
  width: 16%;
}

.study-table-admin .study-program-col {
  width: 22%;
}

.study-table-admin .study-intake-col {
  width: 9%;
}

.study-table-admin .study-year-col {
  width: 11%;
}

.study-table-admin .study-status-col {
  width: 12%;
}

.study-table-admin .study-actions-col {
  width: 12%;
}

@media (max-width: 920px) {
  .admin-account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-dropdown,
  .sort-order-control {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
  }

  .candidate-search-row,
  .admin-applications-search-row,
  .study-search-row {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .candidate-filter-row,
  .admin-applications-filter-row,
  .study-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .study-filter-row-agent {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-panel-body {
    overflow-x: auto;
  }

  .multi-choice-menu {
    min-width: 0;
    box-shadow: none;
  }

  .modal-summary,
  .candidate-detail-grid {
    gap: 8px;
  }

  .modal-box dl,
  .detail-list {
    grid-template-columns: minmax(92px, 0.36fr) minmax(0, 1fr);
    font-size: 13px;
  }

  .mobile-card-field {
    grid-template-columns: minmax(92px, 0.36fr) minmax(0, 1fr);
  }
}

@media (max-width: 460px) {
  .candidate-search-row,
  .admin-applications-search-row,
  .study-search-row {
    grid-template-columns: 1fr;
  }

  .candidate-search-row .text-button,
  .admin-applications-search-row .text-button,
  .study-search-row .text-button {
    justify-self: stretch;
  }

  .candidate-filter-row,
  .admin-applications-filter-row,
  .study-filter-row,
  .study-filter-row-agent {
    grid-template-columns: 1fr;
  }

  .modal-box dl,
  .detail-list,
  .mobile-card-field {
    grid-template-columns: minmax(82px, 0.34fr) minmax(0, 1fr);
  }
}

/* Local Admin Dashboard refinement */
.admin-dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
  gap: 14px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(236, 84, 54, 0.08), rgba(30, 106, 168, 0.07)),
    #fff;
  box-shadow: var(--shadow-sm, 0 8px 24px rgba(31, 41, 55, 0.07));
}

.admin-dashboard-hero h2 {
  margin: 0;
  color: #172033;
  font-size: 25px;
  line-height: 1.15;
}

.admin-dashboard-hero p:not(.eyebrow) {
  max-width: 780px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.admin-dashboard-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-shortcut,
.admin-dashboard-metric,
.dashboard-queue-row,
.dashboard-agent-row {
  width: 100%;
  min-width: 0;
  border-radius: 9px;
  text-align: left;
}

.dashboard-shortcut {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 72px;
  padding: 11px 12px;
  border: 1px solid rgba(23, 32, 51, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.dashboard-shortcut:hover,
.admin-dashboard-metric:hover,
.dashboard-queue-row:hover,
.dashboard-agent-row:hover {
  border-color: rgba(236, 84, 54, 0.45);
  background: #fff9f7;
}

.dashboard-shortcut strong,
.dashboard-shortcut span,
.dashboard-queue-row span,
.dashboard-agent-row span {
  min-width: 0;
}

.dashboard-shortcut span,
.dashboard-queue-row small,
.dashboard-agent-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.admin-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(126px, 1fr));
  gap: 10px;
}

.admin-dashboard-metric {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 4px solid #9aa4b2;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm, 0 8px 24px rgba(31, 41, 55, 0.07));
}

.admin-dashboard-metric span,
.admin-dashboard-metric small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-dashboard-metric strong {
  color: #172033;
  font-size: 25px;
  line-height: 1;
}

.admin-dashboard-metric.is-hot {
  border-top-color: var(--accent);
}

.admin-dashboard-metric.is-warning {
  border-top-color: var(--orange);
}

.admin-dashboard-metric.is-success {
  border-top-color: var(--green);
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.dashboard-side-stack,
.dashboard-list,
.dashboard-agent-list {
  display: grid;
  gap: 8px;
}

.dashboard-side-stack {
  align-content: start;
}

.dashboard-panel {
  overflow: hidden;
  border-radius: 10px;
  box-shadow: var(--shadow-sm, 0 8px 24px rgba(31, 41, 55, 0.07));
}

.dashboard-panel .panel-header {
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.dashboard-panel .panel-header h2 {
  margin-bottom: 2px;
}

.dashboard-list,
.dashboard-agent-list {
  padding: 12px;
}

.dashboard-list.compact {
  gap: 7px;
}

.dashboard-queue-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) minmax(140px, 1fr) minmax(110px, 0.8fr) 86px auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.dashboard-queue-row.document-row {
  grid-template-columns: minmax(150px, 1.2fr) minmax(92px, 0.6fr) minmax(120px, 1fr) auto auto;
}

.dashboard-queue-row > span,
.dashboard-agent-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-main {
  display: grid;
  gap: 2px;
}

.queue-main strong,
.dashboard-agent-row strong {
  overflow: hidden;
  color: #172033;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-agent-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) minmax(104px, 0.7fr) minmax(120px, 0.8fr) minmax(132px, 0.9fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.dashboard-agent-row > span:first-child {
  display: grid;
  gap: 2px;
}

.dashboard-privacy-grid {
  display: grid;
  grid-template-columns: minmax(128px, 1fr) minmax(0, auto);
  gap: 9px 12px;
  padding: 14px;
  font-size: 13px;
}

.dashboard-privacy-grid span {
  color: var(--muted);
}

.dashboard-privacy-grid strong {
  justify-self: end;
  color: #172033;
  text-align: right;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
}

.confirm-card {
  display: grid;
  gap: 12px;
  width: min(480px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.confirm-card.is-danger {
  border-top-color: var(--red);
}

.confirm-card h2 {
  margin: 0;
  color: #172033;
  font-size: 21px;
  line-height: 1.2;
}

.confirm-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.confirm-card .confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
}

.confirm-card .text-button.danger {
  border-color: rgba(185, 71, 60, 0.38);
  background: #fff5f3;
  color: var(--red);
}

@media (max-width: 1180px) {
  .admin-dashboard-hero,
  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .admin-dashboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .admin-dashboard-hero {
    gap: 12px;
    padding: 13px;
  }

  .admin-dashboard-hero h2 {
    font-size: 22px;
  }

  .admin-dashboard-shortcuts {
    grid-template-columns: 1fr;
  }

  .admin-dashboard-metrics {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .admin-dashboard-metric {
    flex: 0 0 136px;
    min-height: 70px;
    padding: 10px;
    scroll-snap-align: start;
  }

  .admin-dashboard-metric strong {
    font-size: 21px;
  }

  .dashboard-list,
  .dashboard-agent-list {
    overflow-x: auto;
  }

  .dashboard-queue-row,
  .dashboard-queue-row.document-row {
    min-width: 720px;
    grid-template-columns: minmax(160px, 1.25fr) minmax(138px, 1fr) minmax(116px, 0.8fr) 88px auto;
  }

  .dashboard-agent-row {
    min-width: 760px;
  }

  .dashboard-privacy-grid {
    grid-template-columns: minmax(120px, 1fr) minmax(0, auto);
  }
}

@media (max-width: 520px) {
  .confirm-card .confirm-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .confirm-card .confirm-actions button {
    width: 100%;
  }
}

/* Local Admin Dashboard v2: ergonomic control surface */
.admin-dashboard-hero-v2 {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.56fr);
  padding: 18px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(236, 84, 54, 0.07), rgba(30, 106, 168, 0.05)),
    #fff;
}

.admin-dashboard-copy {
  display: grid;
  align-content: center;
  gap: 8px;
}

.admin-dashboard-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.admin-dashboard-meta-strip span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.admin-dashboard-meta-strip strong {
  color: #172033;
}

.admin-dashboard-command-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.command-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.command-panel-head span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.command-panel-head strong {
  min-width: 0;
  overflow: hidden;
  color: #172033;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-dashboard-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-command {
  display: grid;
  min-height: 70px;
  align-content: center;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  text-align: left;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.dashboard-command:hover {
  border-color: rgba(236, 84, 54, 0.48);
  box-shadow: 0 10px 24px rgba(31, 41, 55, 0.09);
  transform: translateY(-1px);
}

.dashboard-command.is-primary {
  border-color: rgba(236, 84, 54, 0.34);
  background: #fff7f4;
}

.dashboard-command strong,
.dashboard-command span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-command strong {
  color: #172033;
  font-size: 14px;
}

.dashboard-command span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.admin-account-panel-v2 {
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: var(--shadow-sm, 0 8px 24px rgba(31, 41, 55, 0.07));
}

.admin-account-panel-v2 .account-panel-header {
  padding: 14px;
  background: #fbfcfe;
}

.admin-account-layout {
  display: grid;
  grid-template-columns: minmax(210px, 0.72fr) minmax(230px, 0.76fr) minmax(320px, 1fr);
  gap: 12px;
  padding: 14px;
  align-items: stretch;
}

.agent-account-layout {
  grid-template-columns: minmax(210px, 0.64fr) minmax(210px, 0.62fr) minmax(360px, 1.25fr);
}

.agent-account-form,
.agent-security-form {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.agent-account-form {
  grid-column: 3;
  grid-row: 1 / span 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.agent-security-form {
  grid-column: 1 / span 2;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.agent-security-form .settings-note {
  grid-column: 1 / -1;
}

.admin-profile-card,
.admin-account-facts,
.account-action-list,
.account-editor-card {
  min-width: 0;
}

.admin-profile-card {
  display: flex;
  grid-column: 1;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.account-avatar {
  display: inline-grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 12px;
  background: #172033;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.admin-profile-card div,
.admin-profile-card strong,
.admin-profile-card span {
  min-width: 0;
}

.admin-profile-card strong {
  display: block;
  overflow: hidden;
  color: #172033;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-profile-card span:not(.account-avatar) {
  color: var(--muted);
  font-size: 12px;
}

.admin-account-facts {
  display: grid;
  grid-column: 1;
  gap: 8px;
}

.admin-account-facts div {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-account-facts span,
.account-action-button span,
.account-editor-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.admin-account-facts strong {
  overflow: hidden;
  color: #172033;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-action-list {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  gap: 8px;
  align-content: start;
}

.account-action-button {
  display: grid;
  min-height: 70px;
  align-content: center;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.account-action-button:hover,
.account-action-button.is-active {
  border-color: rgba(236, 84, 54, 0.46);
  background: #fff7f4;
}

.account-action-button strong {
  color: #172033;
}

.account-editor-card {
  display: grid;
  grid-column: 3;
  grid-row: 1 / span 2;
  gap: 12px;
  align-content: start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.account-editor-card.is-empty {
  align-content: center;
  justify-items: start;
  background: #f8fafc;
}

.account-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.account-editor-head strong {
  display: block;
  margin-bottom: 2px;
  color: #172033;
}

.account-password-grid {
  display: grid;
  gap: 10px;
}

.account-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-account-panel-v2 input {
  min-height: 42px;
}

.confirm-card {
  border-radius: 12px;
}

@media (max-width: 1180px) {
  .admin-dashboard-hero-v2 {
    grid-template-columns: 1fr;
  }

  .admin-account-layout {
    grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1fr);
  }

  .account-action-list {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .account-editor-card {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .admin-dashboard-command-grid {
    grid-template-columns: 1fr;
  }

  .command-panel-head {
    display: grid;
  }

  .admin-dashboard-meta-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-dashboard-meta-strip span {
    justify-content: center;
    padding-inline: 8px;
    text-align: center;
  }

  .admin-account-layout {
    grid-template-columns: 1fr;
  }

  .admin-profile-card,
  .admin-account-facts,
  .account-action-list,
  .account-editor-card {
    grid-column: 1;
    grid-row: auto;
  }

  .account-action-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .admin-dashboard-meta-strip {
    grid-template-columns: 1fr;
  }

  .account-editor-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Local Admin Dashboard v3: CRM-style control surface */
.admin-dashboard-hero-v2 {
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.58fr);
  gap: 16px;
  padding: 16px;
  border-color: rgba(23, 32, 51, 0.1);
  background:
    linear-gradient(135deg, rgba(236, 84, 54, 0.06), rgba(30, 106, 168, 0.08)),
    #fff;
}

.admin-dashboard-hero-v2 h2 {
  font-size: clamp(23px, 2vw, 31px);
  font-weight: 850;
}

.admin-dashboard-copy p:not(.eyebrow) {
  max-width: 880px;
  font-size: 14px;
}

.admin-dashboard-command-panel {
  align-content: start;
  background: rgba(255, 255, 255, 0.86);
}

.admin-dashboard-command-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-command {
  min-height: 66px;
  border-radius: 8px;
}

.admin-dashboard-metrics {
  grid-template-columns: repeat(6, minmax(132px, 1fr));
}

.admin-dashboard-metric {
  min-height: 76px;
  padding: 11px 12px;
  border-radius: 8px;
}

.admin-dashboard-metric strong {
  font-size: 24px;
}

.admin-pipeline-panel {
  overflow: visible;
}

.admin-pipeline-panel .panel-header {
  padding: 12px 14px;
}

.admin-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.admin-pipeline-stage {
  display: grid;
  min-width: 0;
  min-height: 104px;
  gap: 4px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.86) inset;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.admin-pipeline-stage:hover {
  border-color: rgba(236, 84, 54, 0.45);
  box-shadow: 0 12px 26px rgba(31, 41, 55, 0.09);
  transform: translateY(-1px);
}

.admin-pipeline-stage span,
.admin-pipeline-stage small,
.admin-pipeline-stage em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-pipeline-stage span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-pipeline-stage strong {
  color: #172033;
  font-size: 28px;
  line-height: 1;
}

.admin-pipeline-stage small {
  color: #172033;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.admin-pipeline-stage em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.25;
}

.dashboard-queue-row,
.dashboard-agent-row {
  border-radius: 8px;
}

.admin-account-panel-v2 .account-panel-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.admin-account-layout {
  grid-template-columns: minmax(250px, 0.72fr) minmax(300px, 0.82fr) minmax(380px, 1.08fr);
  grid-template-areas:
    "profile actions editor"
    "facts actions editor";
  gap: 12px;
  padding: 14px;
  align-items: start;
}

.admin-profile-card {
  grid-area: profile;
  align-self: start;
  min-height: 88px;
}

.admin-account-facts {
  grid-area: facts;
}

.account-action-list {
  grid-area: actions;
  align-content: stretch;
  align-self: start;
}

.account-editor-card {
  grid-area: editor;
  align-self: start;
  min-height: 188px;
}

.account-action-button {
  grid-template-columns: minmax(0, 1fr);
  min-height: 78px;
  border-radius: 8px;
}

.account-action-kicker {
  display: inline-grid;
  width: max-content;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(30, 106, 168, 0.09);
  color: #174f80;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.account-action-button.is-active .account-action-kicker,
.account-action-button:hover .account-action-kicker {
  background: rgba(236, 84, 54, 0.12);
  color: var(--accent);
}

.account-editor-card {
  padding: 14px;
}

.account-editor-card.is-empty {
  min-height: 188px;
}

.account-editor-card .field,
.account-password-grid {
  max-width: 100%;
}

.account-editor-actions .text-button,
.account-editor-actions .primary-button {
  min-width: 128px;
}

@media (max-width: 1240px) {
  .admin-dashboard-metrics,
  .admin-pipeline-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-account-layout {
    grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1fr);
    grid-template-areas:
      "profile actions"
      "facts actions"
      "editor editor";
  }
}

@media (max-width: 820px) {
  .admin-dashboard-hero-v2,
  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .admin-dashboard-metrics,
  .admin-pipeline-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
    scroll-snap-type: x proximity;
  }

  .admin-dashboard-metric,
  .admin-pipeline-stage {
    flex: 0 0 142px;
    min-height: 76px;
    scroll-snap-align: start;
  }

  .admin-pipeline-stage strong {
    font-size: 23px;
  }

  .admin-pipeline-stage em {
    display: none;
  }

  .admin-account-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "profile"
      "facts"
      "actions"
      "editor";
  }

  .account-action-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .account-action-button {
    min-height: 84px;
    padding: 10px;
  }
}

@media (max-width: 560px) {
  .admin-dashboard-command-grid,
  .account-action-list,
  .admin-account-facts {
    grid-template-columns: 1fr;
  }

  .admin-profile-card {
    align-items: flex-start;
  }

  .account-editor-actions .text-button,
  .account-editor-actions .primary-button {
    width: 100%;
  }
}

/* Local Admin workflow refinements */
.admin-applications-search-row {
  grid-template-columns: minmax(320px, 1fr) minmax(104px, auto);
}

.program-doc-editor {
  gap: 12px;
}

.program-doc-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fbfcfe;
}

.program-doc-group h4 {
  margin: 0;
  color: #172033;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.program-doc-group .program-doc-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.agent-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.agent-action-dropdown {
  position: relative;
}

.agent-action-dropdown > summary {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font-size: 13px;
  font-weight: 850;
  list-style: none;
  cursor: pointer;
}

.agent-action-dropdown > summary::-webkit-details-marker {
  display: none;
}

.agent-action-menu {
  position: absolute;
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 190px;
  gap: 6px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
}

.agent-action-menu .text-button {
  justify-content: flex-start;
  width: 100%;
}

.agent-directory-panel {
  margin-top: 16px;
}

.agent-directory-table {
  min-width: 680px;
}

.agent-directory-table th:nth-child(1),
.agent-directory-table td:nth-child(1) {
  width: 38%;
}

.agent-directory-table th:nth-child(2),
.agent-directory-table td:nth-child(2) {
  width: 16%;
}

.agent-directory-table th:nth-child(3),
.agent-directory-table td:nth-child(3) {
  width: 28%;
}

/* Local interaction and ergonomics update */
.login-screen {
  min-height: 100svh;
  padding: 22px;
  place-items: center;
  background:
    radial-gradient(circle at 18% 18%, rgba(236, 84, 54, 0.18), transparent 30%),
    linear-gradient(135deg, #172033 0%, #1f5260 48%, #f4f6f8 48.2%, #eef2f6 100%);
}

.login-card-modern {
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 0.72fr);
  gap: 0;
  width: min(980px, calc(100vw - 44px));
  min-height: 520px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.62);
  border-radius: 12px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 32px 90px rgba(7, 12, 20, 0.28);
}

.login-intro,
.login-form-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(24px, 4vw, 46px);
}

.login-intro {
  color: #fff;
  background:
    linear-gradient(160deg, rgba(236, 84, 54, 0.86), rgba(23, 32, 51, 0.96)),
    #172033;
}

.login-intro h1 {
  max-width: 520px;
  color: #fff;
  font-size: clamp(34px, 4.3vw, 58px);
  line-height: 0.98;
}

.login-intro p:not(.eyebrow) {
  max-width: 520px;
  margin: 0;
  color: rgba(255,255,255,0.86);
  font-size: 16px;
}

.login-intro .eyebrow {
  color: rgba(255,255,255,0.82);
}

.login-feature-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-feature-strip span {
  min-height: 30px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.26);
  border-radius: 999px;
  background: rgba(255,255,255,0.11);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.login-form-panel {
  background: #fff;
}

.login-form-panel h2 {
  margin: 0 0 4px;
  color: #172033;
  font-size: 24px;
}

.login-form-panel .field {
  gap: 6px;
}

.login-form-panel input,
.auth-flow-card input {
  min-height: 44px;
  padding: 10px 12px;
}

.login-card-modern .login-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.login-forgot-button {
  width: max-content;
}

.page-title-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.page-title-line h1 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.page-nav-buttons {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
}

.page-nav-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.page-nav-button:hover:not(:disabled) {
  border-color: rgba(236, 84, 54, 0.42);
  background: #fff7f4;
  transform: translateY(-1px);
}

.agent-dashboard-profile-panel {
  overflow: hidden;
}

.agent-dashboard-profile-body {
  display: grid;
  grid-template-columns: minmax(230px, 0.48fr) minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
}

.agent-dashboard-profile-card {
  display: flex;
  min-width: 0;
  min-height: 96px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fbfcfe;
}

.agent-dashboard-profile-card > div {
  min-width: 0;
}

.agent-dashboard-profile-card strong,
.agent-dashboard-profile-card span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-dashboard-profile-card strong {
  color: #172033;
}

.agent-dashboard-profile-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.agent-dashboard-facts {
  grid-column: 2;
  padding: 0;
}

.agent-dashboard-profile-grid,
.agent-dashboard-security-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.agent-dashboard-security-grid {
  grid-template-columns: repeat(3, minmax(170px, 1fr));
}

.agent-dashboard-profile-grid .field,
.agent-dashboard-security-grid .field {
  min-width: 0;
}

.agent-dashboard-profile-grid input,
.agent-dashboard-security-grid input {
  min-height: 38px;
}

.agent-directory-table {
  min-width: 900px;
}

.agent-directory-table th:nth-child(1),
.agent-directory-table td:nth-child(1) {
  width: 25%;
}

.agent-directory-table th:nth-child(2),
.agent-directory-table td:nth-child(2) {
  width: 25%;
}

.agent-directory-table th:nth-child(3),
.agent-directory-table td:nth-child(3) {
  width: 12%;
}

.agent-directory-table th:nth-child(4),
.agent-directory-table td:nth-child(4) {
  width: 24%;
}

.agent-directory-table th:nth-child(5),
.agent-directory-table td:nth-child(5) {
  width: 14%;
}

.agent-performance-summary,
.agent-performance-applications {
  margin-top: 14px;
}

.agent-performance-grid {
  align-items: stretch;
}

.agent-performance-kpis {
  grid-template-columns: repeat(6, minmax(124px, 1fr));
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

button,
.candidate-link,
.message-thread,
.dashboard-command,
.admin-dashboard-metric {
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 980px) {
  .login-card-modern {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .login-intro {
    min-height: 240px;
  }

  .agent-dashboard-profile-body {
    grid-template-columns: 1fr;
  }

  .agent-dashboard-facts {
    grid-column: 1;
  }

  .agent-dashboard-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-dashboard-security-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .login-screen {
    align-items: stretch;
    padding: 12px;
  }

  .login-card-modern,
  .auth-flow-card {
    width: 100%;
    min-height: calc(100svh - 24px);
    border-radius: 10px;
  }

  .login-intro,
  .login-form-panel {
    padding: 22px;
  }

  .login-intro {
    min-height: 210px;
  }

  .login-card-modern .login-actions {
    grid-template-columns: 1fr;
  }

  .page-head {
    align-items: flex-start;
  }

  .page-title-line {
    width: 100%;
  }

  .page-nav-button {
    width: 34px;
    height: 34px;
  }

  .page-actions {
    width: 100%;
  }

  .agent-dashboard-profile-grid,
  .agent-dashboard-security-grid {
    grid-template-columns: 1fr;
  }

  .agent-dashboard-profile-card {
    min-height: 76px;
  }

  .agent-performance-kpis,
  .statistics-kpi-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .agent-performance-kpis .stat,
  .statistics-kpi-grid .stat {
    flex: 0 0 132px;
  }

  .agent-performance-grid {
    grid-template-columns: 1fr;
  }
}

.statistics-kpi-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.statistics-sales-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.statistics-sales-grid.wide {
  align-items: start;
}

.statistics-card .panel-header {
  border-bottom: 1px solid var(--line);
}

.statistics-bar-list {
  display: grid;
  gap: 11px;
}

.statistics-bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(120px, 1.4fr) 44px;
  gap: 10px;
  align-items: center;
}

.statistics-bar-row strong,
.statistics-bar-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-bar-row small {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.statistics-table {
  min-width: 720px;
}

.statistics-table td,
.statistics-table th {
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .statistics-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .statistics-sales-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .admin-applications-search-row {
    grid-template-columns: 1fr;
  }

  .agent-detail-actions {
    justify-content: flex-start;
  }

  .agent-action-menu {
    left: 0;
    right: auto;
  }

  .statistics-kpi-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .statistics-kpi-grid .stat {
    flex: 0 0 138px;
    min-height: 76px;
    scroll-snap-align: start;
  }

  .statistics-bar-row {
    grid-template-columns: minmax(92px, 0.75fr) minmax(90px, 1fr) 36px;
  }
}

/* Online-ready access, Agent language dropdown and Admin agent controls */
.login-screen {
  background: #f6f8fb;
}

.login-card-modern {
  width: min(900px, calc(100vw - 44px));
  min-height: 470px;
  border-color: rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.13);
}

.login-intro {
  color: #172033;
  background: #fbfcfe;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
}

.login-intro h1 {
  color: #172033;
  font-size: clamp(32px, 4vw, 52px);
}

.login-intro p:not(.eyebrow),
.login-intro .eyebrow {
  color: #526173;
}

.login-feature-strip span {
  border-color: rgba(15, 23, 42, 0.1);
  background: #fff;
  color: #172033;
}

.login-form-panel {
  gap: 14px;
}

.agent-language-switch {
  padding: 0 14px 12px;
}

.agent-language-switch label {
  display: grid;
  gap: 6px;
}

.agent-language-switch label span {
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.agent-language-switch select {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  background: rgba(255,255,255,0.09);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.agent-language-switch select option {
  color: #172033;
}

.agent-dashboard-profile-body {
  grid-template-columns: minmax(220px, 0.38fr) minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
}

.agent-dashboard-profile-card {
  min-height: 82px;
  padding: 12px;
}

.agent-dashboard-profile-grid {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.agent-dashboard-security-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.agent-dashboard-security-grid .settings-note {
  padding: 10px 12px;
}

.agent-admin-profile-controls,
.agent-admin-password-controls {
  margin-top: 12px;
}

.agent-admin-profile-controls {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.agent-admin-password-controls {
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr);
  align-items: end;
}

.agent-admin-password-controls .settings-note {
  align-self: stretch;
}

.agent-login-card code {
  max-width: 100%;
  white-space: normal;
  word-break: break-all;
}

.agent-list-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) auto minmax(190px, 0.8fr) minmax(220px, 1fr) minmax(220px, 1fr);
  align-items: end;
  gap: 10px;
  margin: 0 0 14px;
}

.agent-list-toolbar .multi-choice-dropdown,
.agent-list-toolbar .sort-order-control,
.agent-list-toolbar .sort-order-control select {
  min-width: 0;
  width: 100%;
}

.agent-list-toolbar .text-button {
  min-height: 38px;
}

.multi-choice-dropdown {
  position: relative;
}

.multi-choice-menu {
  position: absolute;
  z-index: 30;
  width: min(360px, calc(100vw - 28px));
  max-height: min(420px, calc(100vh - 140px));
  overflow: auto;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

@media (max-width: 980px) {
  .login-intro {
    border-right: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }

  .agent-dashboard-profile-body,
  .agent-admin-profile-controls,
  .agent-admin-password-controls {
    grid-template-columns: 1fr 1fr;
  }

  .agent-list-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .login-card-modern {
    min-height: 0;
  }

  .login-intro {
    min-height: 180px;
  }

  .agent-dashboard-profile-body,
  .agent-dashboard-profile-grid,
  .agent-dashboard-security-grid,
  .agent-admin-profile-controls,
  .agent-admin-password-controls,
  .agent-list-toolbar {
    grid-template-columns: 1fr;
  }

  .agent-list-toolbar {
    align-items: stretch;
  }

  .multi-choice-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    width: auto;
  }
}

/* Production UI refinements: sortable headers, balanced filters and Agent controls */
.sortable-th button {
  display: inline-flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  text-align: left;
}

.sortable-th button:hover span:first-child {
  color: var(--accent);
}

.sortable-th .sort-arrow {
  display: inline-flex;
  min-width: 14px;
  color: var(--accent);
  font-size: 13px;
  line-height: 1;
}

.sortable-th.is-sorted button {
  color: #172033;
}

.search-toolbar .search-input,
.candidate-search-row .search-input,
.admin-applications-search-row .search-input,
.study-search-row .search-input {
  min-height: 42px;
  min-width: 260px;
  font-size: 14px;
  font-weight: 650;
}

.filter-dropdown summary,
.sort-order-control select,
.multi-choice-menu label {
  font-size: 13px;
  letter-spacing: 0;
}

.candidate-filter-row,
.admin-applications-filter-row,
.study-filter-row {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  width: 100%;
}

.candidate-filter-row .sort-control,
.admin-applications-filter-row .sort-control,
.study-filter-row .sort-control,
.agent-list-toolbar .sort-control {
  display: grid;
  grid-column: auto;
  grid-template-columns: auto minmax(0, 1fr);
  justify-self: stretch;
  min-width: 0;
}

.candidate-filter-row .sort-order-control,
.admin-applications-filter-row .sort-order-control,
.study-filter-row .sort-order-control,
.agent-list-toolbar .sort-order-control {
  width: 100%;
  min-width: 0;
}

.candidate-filter-row .sort-order-control span,
.admin-applications-filter-row .sort-order-control span,
.study-filter-row .sort-order-control span,
.agent-list-toolbar .sort-order-control span {
  align-self: center;
  font-size: 11px;
}

.agent-admin-password-controls {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  align-items: start;
}

.agent-admin-password-controls .settings-note.full {
  grid-column: 1 / -1;
}

.agent-admin-password-controls .field {
  min-width: 0;
}

.agent-directory-table {
  min-width: 1040px;
  table-layout: fixed;
}

.agent-directory-table th:nth-child(1),
.agent-directory-table td:nth-child(1) {
  width: 26%;
}

.agent-directory-table th:nth-child(2),
.agent-directory-table td:nth-child(2) {
  width: 20%;
}

.agent-directory-table th:nth-child(3),
.agent-directory-table td:nth-child(3) {
  width: 12%;
}

.agent-directory-table th:nth-child(4),
.agent-directory-table td:nth-child(4) {
  width: 24%;
}

.agent-directory-table th:nth-child(5),
.agent-directory-table td:nth-child(5) {
  width: 18%;
}

.agent-directory-table .row-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
  white-space: nowrap;
}

.agent-directory-table .row-actions .text-button {
  min-height: 32px;
  padding-inline: 9px;
}

@media (max-width: 760px) {
  .search-toolbar .search-input,
  .candidate-search-row .search-input,
  .admin-applications-search-row .search-input,
  .study-search-row .search-input {
    min-width: 0;
    width: 100%;
  }

  .candidate-filter-row,
  .admin-applications-filter-row,
  .study-filter-row,
  .agent-admin-password-controls {
    grid-template-columns: 1fr;
  }

  .sortable-th button {
    min-height: 36px;
  }
}

/* Minimal public access screen */
.login-screen {
  position: relative;
  min-height: 100svh;
  padding: 32px;
  place-items: center;
  background: #f7f5f2;
}

.login-screen::before {
  content: "EduBroker";
  position: fixed;
  top: 24px;
  left: 42px;
  color: rgba(23, 32, 51, 0.22);
  font-size: 28px;
  font-weight: 850;
}

.minimal-login-card {
  display: block;
  width: min(402px, calc(100vw - 44px));
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 54px rgba(23, 32, 51, 0.08);
}

.minimal-login-card .login-form-panel {
  display: grid;
  gap: 28px;
  padding: 34px 48px 30px;
  background: #fff;
}

.minimal-login-card h1 {
  margin: 0;
  color: var(--accent);
  font-size: 16px;
  font-weight: 850;
  text-align: center;
}

.minimal-login-card .field {
  gap: 7px;
}

.minimal-login-card .field label {
  color: #8f332b;
  font-size: 13px;
  font-weight: 650;
  text-transform: none;
}

.minimal-login-card input {
  min-height: 42px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid rgba(23, 32, 51, 0.28);
  background: transparent;
  border-radius: 0;
}

.minimal-login-card input:focus {
  outline: 0;
  border-bottom-color: var(--accent);
  box-shadow: 0 1px 0 var(--accent);
}

.minimal-login-card .login-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 2px;
}

.minimal-login-card .primary-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: #a24d55;
  font-size: 15px;
  font-weight: 750;
}

.minimal-login-card .text-button,
.minimal-login-card .login-forgot-button {
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8f332b;
  font-weight: 650;
}

.minimal-login-card .login-forgot-button {
  justify-self: center;
  margin-top: 8px;
}

.auth-flow-card {
  width: min(560px, calc(100vw - 44px));
  max-height: calc(100svh - 64px);
  overflow: auto;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 18px 54px rgba(23, 32, 51, 0.08);
}

.auth-flow-card .login-actions.single-line {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

@media (max-width: 760px) {
  .login-screen {
    align-items: center;
    padding: 18px;
  }

  .login-screen::before {
    top: 16px;
    left: 22px;
    font-size: 22px;
  }

  .minimal-login-card {
    width: min(390px, 100%);
  }

  .minimal-login-card .login-form-panel {
    gap: 24px;
    padding: 30px 28px 28px;
  }

  .auth-flow-card {
    width: 100%;
    max-height: calc(100svh - 36px);
    min-height: 0;
  }

  .auth-flow-card .login-actions.single-line {
    grid-template-columns: 1fr;
  }
}
