/* King's Training · Hub de clases flexibles
   Sistema visual: DM Sans + azul marino de marca. Contrastes verificados para WCAG 2.1 AA. */

@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/dm-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/dm-sans-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/dm-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/dm-sans-latin-700-normal.woff2') format('woff2'); }

:root {
  --navy-950: #0b1a3a;
  --navy-900: #0e2149;
  --navy-800: #112954;
  --navy-700: #19326b;
  --navy-600: #24438a;
  --blue-700: #2448ae;
  --blue-600: #2f55c4;
  --blue-500: #3859d0;
  --blue-100: #dbe4fa;
  --blue-50: #eef2fc;
  --cyan-500: #01c2cb;
  --cyan-700: #00777d;
  --cyan-50: #e2f8f9;
  --ink-900: #0f1b33;
  --ink-700: #33415c;
  --ink-500: #56627c;
  --ink-400: #7a859c;
  --line: #dde3ee;
  --line-strong: #c4ccdc;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --green-700: #0f6b45;
  --green-100: #d3f0e1;
  --green-50: #e9f7f0;
  --amber-700: #7f5300;
  --amber-100: #ffe7b3;
  --amber-50: #fff6e0;
  --red-700: #b42318;
  --red-100: #fbd5d1;
  --red-50: #fdeeec;
  --violet-700: #5b3fc4;
  --violet-50: #f1edfd;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 51, 0.06);
  --shadow: 0 1px 3px rgba(15, 27, 51, 0.06), 0 6px 18px rgba(15, 27, 51, 0.06);
  --shadow-lg: 0 18px 50px rgba(11, 26, 58, 0.18);
  --focus: 0 0 0 3px #ffffff, 0 0 0 5px var(--blue-600);
  --sidebar-w: 256px;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--blue-700); text-underline-offset: 2px; }
a:hover { color: var(--navy-700); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; color: var(--ink-900); letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: 0.875rem; }
.muted { color: var(--ink-500); }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--navy-700); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 700; }
.skip-link:focus { top: 12px; color: #fff; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

/* ------------------------------ App layout ------------------------------ */

.app { min-height: 100vh; display: flex; }
@media (min-width: 1024px) { .app { background: linear-gradient(90deg, var(--navy-950) 0, var(--navy-950) var(--sidebar-w), var(--bg) var(--sidebar-w)); } }
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-950) 100%);
  color: #dbe4fa;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar__brand { padding: 24px 22px 18px; display: block; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar__brand img { width: 150px; height: auto; }
.sidebar__brand span { display: block; margin-top: 8px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan-500); font-weight: 700; }
.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav__label { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: #8fa2cf; padding: 14px 12px 6px; font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 8px;
  color: #dbe4fa; text-decoration: none; font-weight: 500; font-size: 0.95rem;
}
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav a[aria-current='page'] { background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: inset 3px 0 0 var(--cyan-500); }
.nav a .count { margin-left: auto; background: var(--cyan-500); color: var(--navy-950); font-size: 0.75rem; font-weight: 700; border-radius: 99px; padding: 1px 8px; }
.nav a .icon { opacity: 0.9; }
.sidebar__cta { margin: 6px 12px 0; }
.sidebar__user { margin-top: auto; padding: 16px 18px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; align-items: center; gap: 12px; }
.sidebar__user .who { min-width: 0; flex: 1; }
.sidebar__user strong { display: block; color: #fff; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user small { color: #a9b8dd; }
.sidebar__user form { margin: 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 8px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue-100); color: var(--navy-700); font-weight: 700; font-size: 0.85rem;
}
.sidebar .avatar { background: var(--cyan-500); color: var(--navy-950); }
.avatar--lg { width: 56px; height: 56px; font-size: 1.1rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 36px 64px; }
.content--narrow { max-width: 880px; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-header h1 { margin: 0; }
.page-header p { margin: 6px 0 0; color: var(--ink-500); }
.page-header__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--cyan-700); font-weight: 700; margin-bottom: 6px; display: block; }
.breadcrumbs { font-size: 0.875rem; margin-bottom: 10px; color: var(--ink-500); }
.breadcrumbs a { color: var(--ink-500); }

@media (max-width: 1023px) {
  .app { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(11, 26, 58, 0.45); z-index: 40; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 30;
    background: var(--navy-800); color: #fff; padding: 10px 16px;
  }
  .topbar img { width: 120px; }
  .content { padding: 22px 16px 56px; }
  h1 { font-size: 1.45rem; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* -------------------------------- Buttons ------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px;
  border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 0.95rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--blue-600); color: #fff;
}
.btn:hover { background: var(--blue-700); color: #fff; }
.btn--secondary { background: var(--surface); color: var(--navy-700); border-color: var(--line-strong); }
.btn--secondary:hover { background: var(--blue-50); color: var(--navy-700); border-color: var(--blue-100); }
.btn--ghost { background: transparent; color: var(--blue-700); }
.btn--ghost:hover { background: var(--blue-50); color: var(--navy-700); }
.btn--danger { background: var(--red-700); }
.btn--danger:hover { background: #8f1c13; }
.btn--danger-outline { background: var(--surface); color: var(--red-700); border-color: #efb4ad; }
.btn--danger-outline:hover { background: var(--red-50); color: var(--red-700); }
.btn--accent { background: var(--cyan-500); color: var(--navy-950); }
.btn--accent:hover { background: #00aab2; color: var(--navy-950); }
.btn--sm { min-height: 34px; padding: 6px 12px; font-size: 0.875rem; }
.btn--lg { min-height: 50px; padding: 12px 24px; font-size: 1.02rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-row--end { justify-content: flex-end; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--blue-700); text-decoration: underline; cursor: pointer; }
.inline-form { display: inline; margin: 0; }

/* -------------------------------- Cards --------------------------------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card__body { padding: 24px; }
.card__header { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card__header h2, .card__header h3 { margin: 0; }
.card__footer { padding: 16px 24px; border-top: 1px solid var(--line); background: #fafbfe; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.stack > * + * { margin-top: 20px; }
.grid > * + * { margin-top: 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main-side { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .card__body { padding: 18px; } .card__header { padding: 14px 18px; } }

.stat { padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.stat__label { color: var(--ink-500); font-size: 0.875rem; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat__value { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__meta { font-size: 0.85rem; color: var(--ink-500); }
.stat__icon { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--blue-50); color: var(--blue-700); }
.stat__icon--cyan { background: var(--cyan-50); color: var(--cyan-700); }
.stat__icon--green { background: var(--green-50); color: var(--green-700); }
.stat__icon--amber { background: var(--amber-50); color: var(--amber-700); }

/* -------------------------------- Badges -------------------------------- */

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 0.8rem; font-weight: 700; line-height: 1.4; white-space: nowrap; background: var(--blue-50); color: var(--navy-700); }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge--plain::before { display: none; }
.badge--green { background: var(--green-50); color: var(--green-700); }
.badge--amber { background: var(--amber-50); color: var(--amber-700); }
.badge--red { background: var(--red-50); color: var(--red-700); }
.badge--grey { background: #eef0f4; color: var(--ink-700); }
.badge--violet { background: var(--violet-50); color: var(--violet-700); }
.badge--cyan { background: var(--cyan-50); color: var(--cyan-700); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; background: #eef0f4; color: var(--ink-700); font-size: 0.82rem; font-weight: 500; }

/* -------------------------------- Tables -------------------------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th { text-align: left; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-500); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fafbfe; white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbff; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
a.row-link { color: var(--ink-900); font-weight: 700; text-decoration: none; }
a.row-link:hover { color: var(--blue-700); text-decoration: underline; }
a.badge { text-decoration: none; }
a.badge:hover { filter: brightness(0.96); }
.cell-person { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.cell-person small { display: block; color: var(--ink-500); }
@media (max-width: 760px) {
  .table--stack thead { display: none; }
  .table--stack tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table--stack td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  .table--stack td::before { content: attr(data-label); font-weight: 700; color: var(--ink-500); font-size: 0.8rem; text-align: left; }
  .table--stack td.cell-main { display: block; text-align: left; }
  .table--stack td.cell-main::before { display: none; }
}

/* --------------------------------- Forms -------------------------------- */

.form { display: grid; gap: 18px; }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid, .form-grid--3 { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 700; font-size: 0.92rem; color: var(--ink-900); }
.field .req { color: var(--red-700); margin-left: 2px; }
.hint { font-size: 0.85rem; color: var(--ink-500); }
.field-error { font-size: 0.86rem; color: var(--red-700); font-weight: 500; display: flex; gap: 6px; align-items: flex-start; }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink-900);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 10px 12px; min-height: 44px;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2356627c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-400); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(47, 85, 196, 0.22); }
.input[aria-invalid='true'], .select[aria-invalid='true'], .textarea[aria-invalid='true'] { border-color: var(--red-700); }
.input--code { font-size: 1.4rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--blue-600); flex: none; }
.check small { display: block; color: var(--ink-500); font-weight: 400; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.form-section { padding-top: 6px; }
.form-section + .form-section { border-top: 1px solid var(--line); padding-top: 22px; }
.form-section__title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.form-section__title h2, .form-section__title h3 { margin: 0; }

.choice-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .choice-cards { grid-template-columns: 1fr; } }
.choice-card { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card__dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; margin-top: 2px; }
.choice-card strong { display: block; }
.choice-card small { color: var(--ink-500); }
.choice-card:hover { border-color: var(--blue-500); }
.choice-card:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); }
.choice-card:has(input:checked) .choice-card__dot { border-color: var(--blue-600); background: radial-gradient(circle, var(--blue-600) 45%, transparent 50%); }
.choice-card:has(input:focus-visible) { box-shadow: var(--focus); }

.rows { display: grid; gap: 10px; }
.row-item { display: grid; grid-template-columns: 28px repeat(2, minmax(0, 1fr)) 40px; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcff; }
.row-item > .field:nth-of-type(3) { grid-column: 2 / 4; grid-row: 2; }
.row-item > .row-item__remove { grid-column: 4; grid-row: 1; }
.row-item__n { width: 28px; height: 28px; border-radius: 50%; background: var(--blue-50); color: var(--navy-700); font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; margin-top: 30px; }
.row-item .field > label { font-size: 0.82rem; font-weight: 500; color: var(--ink-500); }
.row-item .input { min-height: 40px; padding: 8px 10px; font-size: 0.95rem; }
.row-item__remove { margin-top: 26px; color: var(--ink-500); }
.row-item__remove:hover { color: var(--red-700); background: var(--red-50); }
@media (max-width: 760px) {
  .row-item { grid-template-columns: 1fr; }
  .row-item > .field:nth-of-type(3), .row-item > .row-item__remove { grid-column: auto; grid-row: auto; }
  .row-item__n { margin-top: 0; }
  .row-item__remove { margin-top: 0; justify-self: end; }
}

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fafbfe; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.filters .field { min-width: 150px; flex: 1 1 150px; }
.filters .field--search { flex: 2 1 240px; }
.filters .field > label { font-size: 0.8rem; color: var(--ink-500); font-weight: 700; }
.filters .input, .filters .select { min-height: 40px; padding-top: 8px; padding-bottom: 8px; font-size: 0.95rem; }
.filters .btn-row { flex: 0 0 auto; }
.search-input { position: relative; }
.search-input .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-400); pointer-events: none; }
.search-input .input { padding-left: 40px; }

/* ----------------------------- Flash & notes ---------------------------- */

.flash-stack { display: grid; gap: 10px; margin-bottom: 20px; }
.flash { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; border: 1px solid; font-weight: 500; }
.flash .icon { margin-top: 1px; }
.flash--success { background: var(--green-50); border-color: #a8dcc2; color: var(--green-700); }
.flash--error { background: var(--red-50); border-color: #f2b8b1; color: var(--red-700); }
.flash--info { background: var(--blue-50); border-color: var(--blue-100); color: var(--navy-700); }
.flash--warning { background: var(--amber-50); border-color: #f2d48a; color: var(--amber-700); }
.flash p { margin: 0; }
.note { padding: 14px 16px; border-radius: 10px; background: var(--blue-50); color: var(--navy-700); font-size: 0.93rem; }
.note--amber { background: var(--amber-50); color: var(--amber-700); }
.note--internal { background: var(--violet-50); color: var(--violet-700); border-left: 4px solid var(--violet-700); }

.empty { text-align: center; padding: 48px 20px; color: var(--ink-500); }
.empty .icon { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--ink-400); }
.empty strong { display: block; color: var(--ink-900); font-size: 1.05rem; margin-bottom: 4px; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--ink-500); flex-wrap: wrap; }

/* ------------------------------- Key/value ------------------------------ */

.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 10px 20px; margin: 0; }
.kv dt { color: var(--ink-500); font-weight: 500; font-size: 0.92rem; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-divided > li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-divided > li:last-child { border-bottom: 0; }
.list-plain.card__body { padding: 6px 24px; }
@media (max-width: 760px) { .list-plain.card__body { padding: 4px 18px; } }
.list-divided > li.flex-between { flex-wrap: nowrap; align-items: flex-start; }
.list-divided > li.flex-between > :first-child { flex: 1; min-width: 0; }
.list-divided > li.flex-between > :last-child { flex: none; }

/* -------------------------------- Meter --------------------------------- */

.meter { display: grid; gap: 8px; }
.meter__bar { height: 10px; background: #e7ebf3; border-radius: 99px; overflow: hidden; }
.meter__fill { height: 100%; background: linear-gradient(90deg, var(--blue-600), var(--cyan-500)); border-radius: 99px; width: 0; }
.meter__fill--amber { background: linear-gradient(90deg, #d68a00, #f2b233); }
.meter__fill--red { background: var(--red-700); }
.meter__legend { display: flex; justify-content: space-between; font-size: 0.86rem; color: var(--ink-500); }
.meter__big { font-size: 2.1rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }

/* -------------------------------- Tabs ---------------------------------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--ink-500); font-weight: 700; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--navy-700); }
.tabs a[aria-current='page'] { color: var(--navy-700); border-bottom-color: var(--blue-600); }

.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--surface); }
.segmented a, .segmented button { padding: 7px 14px; font: inherit; font-weight: 700; font-size: 0.88rem; color: var(--ink-500); text-decoration: none; border: 0; background: none; cursor: pointer; }
.segmented [aria-current='true'], .segmented [aria-pressed='true'] { background: var(--navy-700); color: #fff; }

/* ------------------------------- Auth pages ----------------------------- */

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth__brand {
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 600px at -10% 110%, rgba(1, 194, 203, 0.28), transparent 60%), linear-gradient(160deg, var(--navy-700), var(--navy-950));
  color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth__brand img { width: 190px; }
.auth__brand h2 { color: #fff; font-size: 2.3rem; line-height: 1.12; max-width: 14ch; margin: 0 0 16px; letter-spacing: -0.02em; }
.auth__brand p { color: #c8d4f2; max-width: 44ch; font-size: 1.05rem; }
.auth__features { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.auth__features li { display: flex; gap: 12px; align-items: flex-start; color: #e3eaff; }
.auth__features .icon { color: var(--cyan-500); margin-top: 2px; }
.auth__brand small { color: #8fa2cf; }
.auth__panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.auth__box { width: 100%; max-width: 420px; }
.auth__box h1 { font-size: 1.7rem; margin-bottom: 6px; }
.auth__box > p { color: var(--ink-500); }
.auth__logo-mobile { display: none; }
.auth__switch { display: flex; justify-content: flex-end; margin-bottom: 28px; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
  .auth__logo-mobile { display: block; width: 160px; margin-bottom: 28px; }
  .auth__panel { align-items: flex-start; padding-top: 32px; }
}
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--ink-400); font-size: 0.85rem; margin: 22px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; border-top: 1px solid var(--line); }

.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 28px; counter-reset: step; }
.steps li { flex: 1; font-size: 0.8rem; font-weight: 700; color: var(--ink-400); padding-top: 10px; border-top: 3px solid var(--line); }
.steps li[aria-current='step'] { color: var(--navy-700); border-color: var(--blue-600); }
.steps li.done { color: var(--green-700); border-color: var(--green-700); }

.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 8px; background: #f7f9fd; font-weight: 500; }
.checks .ok { color: var(--green-700); }
.checks li > span:first-child { flex: none; display: inline-flex; }
.checks .ko { color: var(--red-700); }

.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f3f5fa; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 12px 14px; overflow-wrap: anywhere; font-size: 0.92rem; }
.qr { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }

/* ---------------------------- Report preview ---------------------------- */

.report { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 36px 40px; box-shadow: var(--shadow); }
.report__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 3px solid var(--navy-700); padding-bottom: 18px; margin-bottom: 22px; }
.report__head img { width: 150px; }
.report__title { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--navy-700); margin: 0; }
.report__meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.report__meta div { background: var(--blue-50); border-radius: 10px; padding: 10px 14px; }
.report__meta dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-500); font-weight: 700; }
.report__meta dd { margin: 2px 0 0; font-weight: 700; }
.report h2 { font-size: 1.02rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--navy-700); margin: 28px 0 10px; display: flex; align-items: center; gap: 10px; }
.report h2::before { content: ''; width: 4px; height: 18px; background: var(--cyan-500); border-radius: 2px; }
.report .table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; border-collapse: separate; border-spacing: 0; }
.report .table th { background: var(--navy-700); color: #fff; }
.report .table td { vertical-align: top; }
.report .wrong { color: var(--red-700); text-decoration: line-through; text-decoration-thickness: 1px; }
.report .right { color: var(--green-700); font-weight: 700; }
.report .why { display: block; color: var(--ink-500); font-size: 0.87rem; margin-top: 4px; }
.report .prompt { font-style: italic; background: var(--cyan-50); border-left: 4px solid var(--cyan-500); padding: 14px 16px; border-radius: 0 10px 10px 0; color: var(--ink-900); }
.report .rating-row { display: flex; gap: 10px; flex-wrap: wrap; }
.report .pillset span, .rating-row a, .rating-row span { display: inline-block; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line-strong); font-weight: 700; font-size: 0.9rem; text-decoration: none; color: var(--navy-700); }
.rating-row .is-selected { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }
.report .tasks { margin: 0; padding-left: 20px; }
@media (max-width: 760px) {
  .report .table thead { display: none; }
  .report .table, .report .table tbody, .report .table tr, .report .table td { display: block; width: 100%; }
  .report .table tr { border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .report .table tr:last-child { border-bottom: 0; }
  .report .table td { border: 0; padding: 2px 0; }
}
@media (max-width: 760px) { .report { padding: 22px 18px; } .report__meta { grid-template-columns: 1fr; } .report__head { flex-direction: column-reverse; } }

/* -------------------------------- Timeline ------------------------------ */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline > li { position: relative; padding: 0 0 22px 48px; }
.timeline__dot { position: absolute; left: 6px; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--blue-600); border: 4px solid var(--blue-100); }
.timeline__dot--amber { background: #d68a00; border-color: var(--amber-100); }
.timeline__dot--grey { background: var(--ink-400); border-color: #e4e8f0; }
.timeline__head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; }
.timeline__head strong { font-size: 1rem; }
.timeline__body { margin-top: 8px; padding: 14px 16px; background: #fafbfe; border: 1px solid var(--line); border-radius: 10px; font-size: 0.94rem; }
.timeline__body p:last-child { margin-bottom: 0; }

/* -------------------------------- Charts -------------------------------- */

.chart { width: 100%; height: auto; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--ink-500); }
.chart .bar { fill: var(--blue-600); }
.chart .bar--alt { fill: var(--cyan-500); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .value { fill: var(--ink-700); font-weight: 700; }
.legend { display: flex; gap: 16px; font-size: 0.85rem; color: var(--ink-500); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--blue-600); display: inline-block; }
.legend i.alt { background: var(--cyan-500); }

.ratings { display: grid; gap: 10px; }
.ratings__row { display: grid; grid-template-columns: 110px 1fr 44px; gap: 10px; align-items: center; font-size: 0.9rem; }
.ratings__bar { height: 8px; border-radius: 99px; background: #e7ebf3; overflow: hidden; }
.ratings__bar span { display: block; height: 100%; background: var(--blue-600); border-radius: 99px; width: 0; }
.ratings__row:nth-child(1) .ratings__bar span { background: var(--green-700); }
.ratings__row:nth-child(2) .ratings__bar span { background: var(--cyan-500); }
.ratings__row:nth-child(3) .ratings__bar span { background: #e0a100; }
.ratings__row:nth-child(4) .ratings__bar span { background: var(--red-700); }

/* ------------------------------- Errors --------------------------------- */

.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.error-page .card { max-width: 520px; width: 100%; text-align: center; }
.error-page__logo { margin: 0 auto 20px; }
.btn-row--center { justify-content: center; }
.error-page .code { font-size: 3.2rem; font-weight: 700; color: var(--blue-600); line-height: 1; margin-bottom: 8px; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 16px; }
.text-right { text-align: right; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hidden { display: none !important; }

@media print {
  .sidebar, .topbar, .page-header__actions, .no-print { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .report { border: 0; box-shadow: none; padding: 0; }
}
.choice-cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pre-line { white-space: pre-line; }
.rating-row .btn.is-selected { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }
.wrong-inline { color: var(--red-700); text-decoration: line-through; }
.right-inline { color: var(--green-700); }
details > summary { cursor: pointer; }
details > summary.btn { list-style: none; }
details > summary.btn::-webkit-details-marker { display: none; }
.field--internal .textarea { border-color: #cbbcf3; background: #fcfbff; }
.list-edit { flex: 1; min-width: 0; flex-wrap: wrap; }
.list-edit .input[type='number'] { width: 76px; }
.list-edit .input:not([type='number']) { flex: 1; min-width: 180px; }
.list-edit .select { width: auto; min-width: 140px; }

.input[type='file'] { padding: 8px; }
.content--narrow { max-width: 960px; }
.content--form { max-width: 1080px; }
.doc-card__text { align-items: flex-start; flex: 1; min-width: 260px; }
.doc-card__text .stat__icon { flex: none; margin-top: 2px; }
@media (max-width: 760px) {
  .doc-card .btn-row { width: 100%; }
  .doc-card .btn { width: 100%; white-space: normal; justify-content: flex-start; text-align: left; }
}
