:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-alt: #f0f4f1;
  --ink: #1c2320;
  --muted: #626d68;
  --line: #dce3df;
  --line-strong: #c5d0ca;
  --teal: #147d74;
  --teal-soft: #dff2ef;
  --amber: #a96d00;
  --amber-soft: #fff0cc;
  --rose: #b64f65;
  --rose-soft: #fde5eb;
  --indigo: #4d5db8;
  --indigo-soft: #e8ebff;
  --success: #1f7a4d;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(26, 39, 35, .10);
  --radius: 8px;
  --focus: 0 0 0 3px rgba(20, 125, 116, .24);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(223, 242, 239, .55), rgba(246, 247, 244, 0) 320px),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.skip-link,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  top: 12px;
  left: 12px;
  z-index: 30;
  width: auto;
  height: auto;
  padding: 10px 12px;
  clip: auto;
  color: var(--surface);
  background: var(--teal);
  border-radius: var(--radius);
}

.is-hidden {
  display: none !important;
}

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 430px);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-footer {
  position: absolute;
  right: 24px;
  bottom: 16px;
  left: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.brand-row,
.sidebar-brand,
.candidate-card,
.topbar-actions,
.login-meta,
.status-cluster {
  display: flex;
  align-items: center;
}

.brand-row {
  gap: 14px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  color: var(--surface);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0)),
    var(--teal);
  border-radius: var(--radius);
  font-weight: 800;
}

.brand-mark.small {
  width: 40px;
  height: 40px;
  font-size: 13px;
}

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

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.2;
}

h4 {
  margin-bottom: 0;
  font-size: 16px;
}

.stack {
  display: grid;
  gap: 16px;
}

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

.field label {
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  box-shadow: var(--focus);
  outline: none;
}

.password-wrap,
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input {
  padding-right: 50px;
}

.password-wrap .icon-button {
  position: absolute;
  right: 4px;
}

.field-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

.field-help,
.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.form-note {
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.login-meta {
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: 16px;
  min-height: 16px;
}

.primary-action,
.small-button,
.text-button,
.icon-button,
.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.primary-action {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--surface);
  background: var(--teal);
  border: 1px solid var(--teal);
  font-weight: 800;
}

.primary-action:hover {
  background: #0f6961;
}

.primary-action.compact {
  width: auto;
  min-height: 40px;
}

.small-button {
  min-height: 38px;
  padding: 9px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-weight: 700;
}

.small-button:hover,
.icon-button:hover,
.text-button:hover,
.nav-item:hover {
  background: var(--surface-alt);
}

.small-button.danger {
  color: var(--danger);
  border-color: rgba(180, 35, 24, .32);
}

.small-button.danger:hover {
  background: #fff1f0;
  border-color: rgba(180, 35, 24, .56);
}

.small-button.full {
  width: 100%;
}

.text-button {
  min-height: 36px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-weight: 700;
}

.icon-button {
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.icon-button.ghost {
  background: transparent;
  border-color: transparent;
}

.fallback-icon {
  display: none;
  font-size: 11px;
}

.security-strip {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 12px;
  color: var(--muted);
  background: var(--surface-alt);
  border-radius: var(--radius);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  transition: grid-template-columns .18s ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 18px;
  background: #fbfcfa;
  border-right: 1px solid var(--line);
  transition: transform .18s ease, padding .18s ease, border-color .18s ease;
}

.app-shell.sidebar-collapsed .sidebar {
  overflow: hidden;
  padding-right: 0;
  padding-left: 0;
  pointer-events: none;
  transform: translateX(-100%);
  border-right-color: transparent;
}

.sidebar-brand {
  gap: 10px;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand span {
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  font-weight: 750;
}

.nav-item.is-active {
  color: var(--teal);
  background: var(--teal-soft);
  border-color: #b7dfd9;
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.role-chip,
.status-pill {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 5px 10px;
  color: var(--muted);
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.success {
  color: var(--success);
  background: #e5f5ec;
  border-color: #bde5ce;
}

.status-pill.warning {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #f4cf7e;
}

.status-pill.danger {
  color: var(--danger);
  background: #fee7e2;
  border-color: #ffcdc3;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  min-height: 76px;
  padding: 14px 24px;
  background: rgba(246, 247, 244, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar-left,
.topbar-resume-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-resume-actions {
  flex-wrap: wrap;
}

.topbar-user {
  min-width: 0;
}

.topbar-user h2 {
  max-width: min(38vw, 520px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-button {
  display: inline-flex;
}

.topbar-actions {
  margin-left: auto;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-box {
  min-width: min(360px, 34vw);
}

.search-box svg {
  position: absolute;
  left: 11px;
  color: var(--muted);
}

.search-box input {
  padding-left: 38px;
}

.badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--rose);
  border: 2px solid var(--surface);
  border-radius: 50%;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--surface);
  background: var(--indigo);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}

.main-content {
  padding: 24px;
}

.app-footer {
  padding: 14px 24px 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.view-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.metric-grid,
.dashboard-grid,
.security-grid,
.support-grid,
.validation-layout {
  display: grid;
  gap: 16px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.metric-card,
.panel,
.table-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric-card {
  min-height: 152px;
  padding: 18px;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card span,
.metric-card strong,
.metric-card small {
  display: block;
}

.metric-card strong {
  margin: 10px 0 2px;
  font-size: 30px;
  line-height: 1;
}

.metric-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: var(--radius);
}

.metric-icon.teal {
  color: var(--teal);
  background: var(--teal-soft);
}

.metric-icon.amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.metric-icon.rose {
  color: var(--rose);
  background: var(--rose-soft);
}

.metric-icon.indigo {
  color: var(--indigo);
  background: var(--indigo-soft);
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
}

.panel {
  padding: 18px;
}

.queue-list,
.item-list,
.quality-bars,
.checklist {
  display: grid;
  gap: 12px;
}

.queue-section {
  display: grid;
  gap: 10px;
}

.queue-section + .queue-section {
  padding-top: 4px;
}

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

.queue-row,
.validation-item,
.support-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.queue-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.pending-document-row {
  border-left: 3px solid var(--amber);
}

.queue-row strong,
.queue-row span,
.support-card strong,
.support-card span {
  display: block;
}

.queue-row span,
.support-card span,
.candidate-card p,
.data-list dd,
.muted-text {
  color: var(--muted);
  font-size: 13px;
}

.quality-bars div {
  display: grid;
  gap: 6px;
}

progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--surface-alt);
}

progress::-webkit-progress-bar {
  background: var(--surface-alt);
}

progress::-webkit-progress-value {
  background: var(--teal);
}

progress::-moz-progress-bar {
  background: var(--teal);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.segmented button {
  min-height: 32px;
  padding: 6px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 750;
}

.segmented .is-selected {
  color: var(--teal);
  background: var(--teal-soft);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 160px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.compact-field {
  gap: 5px;
}

.compact-field input,
.compact-field select {
  min-height: 38px;
}

.table-shell {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: #fbfcfa;
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

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

.validation-layout {
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
}

#view-validation .validation-layout > .panel:first-child {
  position: sticky;
  top: 104px;
  padding: 20px;
  background: linear-gradient(180deg, #fbfffd 0%, var(--surface) 48%);
}

.candidate-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.candidate-photo {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  color: var(--surface);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .32), transparent 30%),
    var(--rose);
  border-radius: var(--radius);
  font-weight: 900;
}

.data-list {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.data-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.data-list dt {
  color: var(--muted);
  font-size: 13px;
}

.data-list dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

#approveResumeButton {
  min-height: 48px;
  margin-top: 10px;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(18, 127, 113, .18);
}

#approveResumeButton:disabled {
  color: rgba(255, 255, 255, .78);
  background: #8fcac0;
  box-shadow: none;
  cursor: not-allowed;
}

.validation-item {
  grid-template-columns: minmax(0, 1fr) 150px minmax(180px, .7fr) auto;
  align-items: center;
}

.validation-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.validation-toolbar {
  display: grid;
  grid-template-columns: auto minmax(180px, 220px) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.validation-tabs {
  margin-bottom: 14px;
  overflow-x: auto;
}

.validation-tabs .resume-tab {
  flex: 0 0 auto;
}

.validation-tabs .resume-tab small {
  color: inherit;
  font-size: 11px;
  font-weight: 800;
}

.validation-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.validation-check {
  padding-top: 4px;
}

.validation-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.validation-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

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

.validation-card textarea {
  min-height: 72px;
  resize: vertical;
}

.validation-record-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.validation-record-head,
.validation-control-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.validation-record-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.validation-readonly-grid div {
  min-width: 0;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.validation-readonly-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.validation-readonly-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-weight: 500;
}

.validation-control {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.validation-control textarea {
  min-height: 76px;
  resize: vertical;
}

.validation-review-table table {
  min-width: 1120px;
}

.validation-review-table th {
  padding: 10px 12px;
  font-size: 11px;
}

.validation-review-table td {
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 400;
  vertical-align: top;
}

.validation-review-table .validation-actions {
  gap: 6px;
}

.validation-review-table .small-button {
  min-height: 34px;
  padding: 7px 9px;
}

.validation-observation-row td {
  padding-top: 0;
  background: #fbfcfa;
}

.validation-observation-row textarea {
  min-height: 58px;
  resize: vertical;
}

.compact-check {
  gap: 6px;
  white-space: nowrap;
}

.support-card.is-readonly .upload-zone {
  opacity: .58;
  pointer-events: none;
}

.observed-section .pending-document-row {
  border-left-color: var(--rose);
}

.support-preview-modal {
  width: min(100%, 1040px);
  height: min(88vh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.support-preview-frame {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

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

.resume-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.resume-tab {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.resume-tab:hover,
.resume-tab:focus-visible {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.resume-tab.is-active {
  color: var(--surface);
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: var(--shadow);
}

.resume-tab svg {
  width: 18px;
  height: 18px;
}

.resume-tab-panel {
  display: none;
}

.resume-tab-panel.is-active {
  display: block;
}

.resume-tab-panel .panel:first-child {
  margin-top: 0;
}

.legacy-section {
  display: block;
}

.legacy-section .panel-head {
  margin-bottom: 16px;
}

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

.personal-form-grid {
  grid-template-columns:
    minmax(108px, .8fr)
    minmax(158px, 1.2fr)
    minmax(180px, 1.35fr)
    minmax(150px, 1.15fr)
    minmax(190px, 1.4fr)
    minmax(170px, 1.25fr)
    minmax(108px, .8fr);
  align-items: end;
}

.personal-form-grid .field {
  min-width: 0;
}

.personal-form-grid label {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pf-doc-type,
.pf-first-lastname,
.pf-mobile {
  grid-column: 1;
}

.pf-document,
.pf-second-lastname,
.pf-email {
  grid-column: 2;
}

.pf-expedition-place,
.pf-names,
.pf-residence-dept {
  grid-column: 3;
}

.pf-expedition-date,
.pf-gender,
.pf-residence-city {
  grid-column: 4;
}

.pf-military-class,
.pf-birth-date {
  grid-column: 5;
}

.pf-military-number,
.pf-birth-dept {
  grid-column: 6;
}

.pf-military-district,
.pf-birth-city {
  grid-column: 7;
}

.pf-address {
  grid-column: 5 / 8;
}

.pf-support,
.pf-signature {
  grid-column: 1 / -1;
}

.higher-education-form {
  display: grid;
  grid-template-columns: minmax(150px, 170px) minmax(150px, 170px) minmax(320px, 1fr) minmax(170px, 170px) minmax(170px, 170px);
  gap: 18px 16px;
  align-items: end;
}

.higher-level {
  grid-column: 1;
}

.higher-semesters {
  grid-column: 2;
}

.higher-institution {
  grid-column: 3 / 6;
}

.higher-title {
  grid-column: 1 / 4;
}

.higher-graduation-date {
  grid-column: 4;
}

.higher-card {
  grid-column: 5;
}

.higher-support,
.higher-actions {
  grid-column: 1 / -1;
}

.higher-support input[type="file"] {
  padding: 0;
  color: var(--muted);
}

.higher-support input[type="file"]::file-selector-button {
  min-height: 40px;
  margin-right: 12px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface-alt);
  font: inherit;
}

.higher-actions {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.compact-legacy-grid {
  margin-top: 18px;
}

.col-1 {
  grid-column: span 1;
}

.col-2 {
  grid-column: span 2;
}

.col-3 {
  grid-column: span 3;
}

.col-4 {
  grid-column: span 4;
}

.col-5 {
  grid-column: span 5;
}

.col-6 {
  grid-column: span 6;
}

.col-12 {
  grid-column: span 12;
}

.grade-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 8px 0;
}

.grade-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.grade-options input {
  accent-color: var(--teal);
}

.resume-section {
  margin-top: 16px;
}

.compact-table {
  margin-top: 16px;
}

.compact-table table {
  min-width: 720px;
}

.inline-support {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(220px, 320px);
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.inline-support strong,
.inline-support small,
.support-kicker {
  display: block;
}

.inline-support small {
  margin-top: 4px;
  color: var(--muted);
}

.support-kicker {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.compact-upload {
  min-height: 54px;
  padding: 10px 12px;
}

.span-2 {
  grid-column: span 2;
}

.form-actions,
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.support-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  align-items: start;
}

.resume-support-grid {
  margin-top: 4px;
}

.support-card {
  min-height: 170px;
  min-width: 0;
  overflow: hidden;
}

.support-card table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 14px;
}

.support-card th,
.support-card td {
  padding: 10px 4px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.support-card th:last-child,
.support-card td:last-child {
  width: 84px;
  text-align: right;
}

.support-card .upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.support-card .upload-zone {
  min-height: 42px;
  padding: 8px 10px;
  min-width: 0;
}

.support-file-name {
  color: var(--ink);
}

.support-file-meta {
  color: var(--muted);
  white-space: normal;
}

.support-inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.support-inline-actions .muted-text {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.support-card header > div {
  min-width: 0;
}

.support-card header .status-pill {
  flex: 0 0 auto;
}

.upload-zone {
  display: grid;
  place-items: center;
  min-height: 74px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  font-size: 13px;
}

.security-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
}

.code-block {
  overflow-x: auto;
  margin: 0;
  padding: 14px;
  color: #10211e;
  background: #eef4f1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  line-height: 1.55;
  white-space: pre-wrap;
}

.checklist {
  padding: 0;
  margin: 0;
  list-style: none;
}

.checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 31, 28, .42);
}

.modal {
  width: min(100%, 560px);
  max-height: min(760px, 90vh);
  overflow-y: auto;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-form {
  display: grid;
  gap: 14px;
}

.import-users-modal {
  width: min(100%, 920px);
}

.import-results {
  display: grid;
  gap: 12px;
}

.import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.import-results-table {
  max-height: 320px;
  overflow: auto;
}

.import-results-table table {
  min-width: 760px;
}

.experience-modal {
  width: min(100%, 1136px);
  padding: 0;
}

.experience-modal .modal-head {
  padding: 16px 20px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}

.experience-form {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px 16px;
  padding: 18px 20px 0;
}

.exp-company {
  grid-column: span 5;
}

.exp-phone {
  grid-column: span 2;
}

.exp-address {
  grid-column: span 3;
}

.exp-type {
  grid-column: span 2;
}

.exp-department,
.exp-city,
.exp-email,
.exp-position,
.exp-dependency {
  grid-column: span 4;
}

.exp-start,
.exp-end {
  grid-column: span 2;
}

.exp-current,
.exp-current-help,
.exp-support,
.exp-note,
.exp-actions {
  grid-column: 1 / -1;
}

.exp-current {
  justify-content: flex-start;
  margin-top: 2px;
}

.exp-current-help {
  margin-top: -12px;
}

.exp-support input[type="file"] {
  padding: 0;
  color: var(--muted);
}

.exp-support input[type="file"]::file-selector-button {
  min-height: 40px;
  margin-right: 12px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface-alt);
  font: inherit;
}

.exp-actions {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 14px;
  color: var(--surface);
  background: var(--ink);
  border-radius: var(--radius);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1500px) {
  .personal-form-grid {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
  }

  .personal-form-grid > .field {
    grid-column: auto;
  }

  .pf-address {
    grid-column: span 2;
  }

  .pf-support {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1180px) {
  .personal-form-grid,
  .higher-education-form,
  .experience-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .personal-form-grid > .field,
  .higher-education-form > .field,
  .experience-form > .field,
  .experience-form > .check-row,
  .experience-form > .field-help,
  .experience-form > .form-note,
  .higher-actions {
    grid-column: auto;
  }

  .pf-address,
  .pf-support,
  .higher-institution,
  .higher-title,
  .higher-support,
  .higher-actions,
  .exp-support,
  .exp-note,
  .exp-actions {
    grid-column: 1 / -1;
  }
}

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

  .dashboard-grid,
  .security-grid,
  .validation-layout {
    grid-template-columns: 1fr;
  }

  #view-validation .validation-layout > .panel:first-child {
    position: static;
  }

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

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

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 25;
    width: min(84vw, 300px);
    transform: translateX(-100%);
    transition: transform .18s ease;
    box-shadow: var(--shadow);
  }

  .app-shell.sidebar-collapsed .sidebar {
    padding: 18px;
    pointer-events: auto;
    border-right-color: var(--line);
  }

  .app-shell.sidebar-collapsed .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .menu-button {
    display: inline-flex;
  }

  .topbar {
    align-items: flex-start;
    padding: 12px 16px;
  }

  .topbar-left {
    flex: 1 1 220px;
  }

  .topbar-actions {
    width: 100%;
    gap: 8px;
    justify-content: flex-start;
  }

  .search-box {
    display: none;
  }

  .main-content {
    padding: 16px;
  }

  .view-head,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-bar,
  .form-grid,
  .legacy-form-grid,
  .higher-education-form,
  .experience-form,
  .validation-toolbar,
  .validation-item,
  .validation-readonly-grid {
    grid-template-columns: 1fr;
  }

  .col-1,
  .col-2,
  .col-3,
  .col-4,
  .col-5,
  .col-6,
  .col-12 {
    grid-column: auto;
  }

  .inline-support {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .span-2 {
    grid-column: auto;
  }

  .personal-form-grid > .field,
  .higher-education-form > .field,
  .experience-form > .field,
  .experience-form > .check-row,
  .experience-form > .field-help,
  .experience-form > .form-note,
  .higher-actions {
    grid-column: auto;
  }

  .exp-actions {
    grid-column: auto;
  }

  .form-actions {
    justify-content: stretch;
    flex-direction: column;
  }

  .form-actions .small-button,
  .form-actions .primary-action {
    width: 100%;
  }

  .resume-tabs {
    padding: 4px;
  }

  .resume-tab {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 12px;
  }
}

@media (max-width: 560px) {
  .login-screen {
    padding: 12px;
    align-items: start;
  }

  .login-card {
    padding: 20px;
    margin-top: 28px;
  }

  .metric-grid,
  .support-grid {
    grid-template-columns: 1fr;
  }

  .login-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }
}
