/* KnoxGate dashboard. Brand: navy #0B2B50, teal #17B8CC (from the KnoxGate logo). */
:root {
  --navy-950: #061a33;
  --navy-900: #082240;
  --navy-800: #0b2b50;
  --navy-700: #123a66;
  --navy-600: #1b4a7e;
  --teal: #17b8cc;
  --teal-700: #0b7c8b;
  --teal-50: #e6f8fa;
  --slate-900: #0f1b2b;
  --slate-700: #33445a;
  --slate-600: #4a5a6e;
  --slate-500: #5b6b7f;
  --slate-400: #8796a8;
  --slate-300: #c3cdd8;
  --slate-200: #dce3ea;
  --slate-100: #edf1f5;
  --slate-50: #f6f8fa;
  --bg: #f2f5f8;
  --card: #ffffff;
  --line: #e2e8ef;
  --text: #0f1b2b;
  --muted: #5b6b7f;
  --green: #12805c;
  --green-50: #e5f5ee;
  --amber: #a8650f;
  --amber-50: #fdf3e1;
  --red: #c2362f;
  --red-50: #fbe9e8;
  --blue: #1e5fb4;
  --blue-50: #e8f0fb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 43, 80, 0.05), 0 6px 20px rgba(11, 43, 80, 0.06);
  --shadow-lg: 0 2px 4px rgba(11, 43, 80, 0.06), 0 14px 36px rgba(11, 43, 80, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "Roboto Mono", monospace;
  --brand-font: "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal-700); }
h1, h2, h3 { color: var(--navy-800); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; flex: none; }
.dim { color: var(--muted); }
.nowrap { white-space: nowrap; }
.sm { font-size: 12.5px; }
.link { font-weight: 600; text-decoration: none; font-size: 13px; }
.link:hover { text-decoration: underline; }

/* ---------- boot */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-spin, .spin {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--slate-200); border-top-color: var(--teal);
  animation: rot 0.8s linear infinite;
}
.spin { width: 16px; height: 16px; border-width: 2px; display: inline-block; vertical-align: -3px; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- brand */
.mark { display: block; flex: none; }
.wm { font-family: var(--brand-font); font-weight: 800; letter-spacing: 0.01em; line-height: 1; white-space: nowrap; }
.wm b { font-weight: 800; color: var(--navy-800); }
.wm b.t { color: var(--teal); }
.wm-tag { display: block; font-size: 8.5px; letter-spacing: 0.24em; font-weight: 700; color: var(--slate-500); margin-top: 6px; white-space: nowrap; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--navy-800);
  font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.btn:hover { border-color: var(--slate-300); background: var(--slate-50); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--navy-800); border-color: var(--navy-800); color: #fff; box-shadow: 0 1px 2px rgba(11, 43, 80, 0.25); }
.btn-primary:hover { background: var(--navy-700); border-color: var(--navy-700); }
.btn-teal { background: var(--teal); border-color: var(--teal); color: #03252b; }
.btn-teal:hover { background: #2cc4d6; border-color: #2cc4d6; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-50); border-color: #f1c7c4; }
.btn-danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-solid:hover { background: #a92c26; border-color: #a92c26; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-block { width: 100%; height: 44px; }
.btn[disabled], .btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn.busy { pointer-events: none; opacity: 0.8; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--slate-600); cursor: pointer;
}
.icon-btn:hover { background: var(--slate-100); color: var(--navy-800); }

/* ---------- form fields */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .field-label { font-size: 12.5px; font-weight: 650; color: var(--slate-700); }
.input {
  width: 100%; height: 40px; border: 1px solid var(--slate-300); border-radius: 10px;
  padding: 0 12px; background: #fff; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(23, 184, 204, 0.18); outline: none; }
.input:disabled { background: var(--slate-50); color: var(--slate-600); }
.input.mono { font-family: var(--mono); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.input::placeholder { color: var(--slate-400); text-transform: none; letter-spacing: normal; font-family: var(--font); font-weight: 400; }
.hint { font-size: 12px; color: var(--muted); margin: -6px 0 14px; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
.span-2 { grid-column: 1 / -1; }

.choice { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.choice label {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  border: 1.5px solid var(--slate-200); border-radius: 12px; padding: 10px 12px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.choice label:hover { border-color: var(--slate-300); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice b { font-size: 13.5px; color: var(--navy-800); }
.choice small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.choice label:has(input:checked) { border-color: var(--teal); background: var(--teal-50); }
.choice label:has(input:focus-visible) { outline: 2px solid var(--teal); outline-offset: 2px; }
.choice label:has(input:disabled) { cursor: default; }
.choice.pills { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice.pills label { padding: 8px 10px; align-items: center; text-align: center; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; }
.alert .ic { width: 17px; height: 17px; margin-top: 1px; }
.alert.err { background: var(--red-50); color: #8f241f; }
.alert.warn { background: var(--amber-50); color: #7a4a0c; }
.alert.ok { background: var(--green-50); color: #0b5e43; }
.alert.info { background: var(--blue-50); color: #174a8c; }
.form-error { margin-bottom: 14px; }

/* ---------- login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: #fff; }
.login-art {
  position: relative; overflow: hidden; color: #fff; padding: 44px 56px; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 520px at -10% -20%, rgba(23, 184, 204, 0.18) 0%, transparent 60%),
    linear-gradient(160deg, #0b2b50 0%, #061a33 100%);
}
.login-brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.login-brand .wm { font-size: 26px; }
.login-brand .wm b:first-child { color: #fff; }
.login-brand .wm-tag { color: #8fa5bd; font-size: 9.5px; }
.login-copy { margin-top: auto; position: relative; z-index: 1; max-width: 520px; }
.login-copy h1 { color: #fff; font-size: 40px; line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 14px; }
.login-copy p { color: #b9c8d8; font-size: 16px; margin: 0 0 26px; max-width: 440px; }
.login-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.login-points li { display: flex; gap: 12px; align-items: center; color: #dbe6f1; font-weight: 500; }
.login-points .ic { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: rgba(23, 184, 204, 0.18); color: var(--teal); }
.login-gate { position: absolute; top: 13%; right: -50px; width: min(520px, 68%); opacity: 0.12; pointer-events: none; }
.login-form-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.01em; }
.login-card > p { margin: 0 0 26px; color: var(--muted); }
.login-foot { margin-top: 40px; color: var(--slate-400); font-size: 12px; text-align: center; }

/* ---------- app shell */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px;
  background: linear-gradient(180deg, #061a33 0%, #0a2545 100%); color: #b9c8d8; overflow-y: auto;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.side-brand .wm { font-size: 19px; }
.side-brand .wm b:first-child { color: #fff; }
.side-brand .wm-tag { color: #6f86a0; font-size: 7.4px; letter-spacing: 0.12em; margin-top: 5px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.14em; color: #5f7690; margin: 16px 12px 6px; font-weight: 700; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #b9c8d8; text-decoration: none; font-weight: 600; transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav a.on { background: rgba(23, 184, 204, 0.13); color: #fff; }
.nav a.on .ic { color: var(--teal); }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal); }
.side-foot { margin-top: auto; padding-top: 16px; }
.me {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.07); color: #fff; text-align: left;
}
.me:hover { background: rgba(255, 255, 255, 0.09); }
.me-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.me-text b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: #8fa5bd; font-size: 12px; }
.me .ic { color: #6f86a0; width: 16px; height: 16px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--teal); color: #03252b; font-weight: 800; font-size: 13px;
}
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 16px 32px;
  background: rgba(242, 245, 248, 0.88); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { min-width: 0; }
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: -0.015em; line-height: 1.2; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
.menu-btn { display: none; }
.content { padding: 24px 32px 56px; width: 100%; max-width: 1320px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--slate-100); }
.card-head h3 { margin: 0; font-size: 15px; letter-spacing: -0.005em; }
.card-body { padding: 16px 18px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; }

/* ---------- overview */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hello h2 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.hello p { margin: 2px 0 0; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; padding: 18px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  color: inherit; text-decoration: none; transition: transform 0.15s, box-shadow 0.15s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700); margin-bottom: 8px; }
.kpi-value { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; color: var(--navy-800); line-height: 1.05; }
.kpi-label { font-weight: 650; color: var(--slate-700); }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi.hero { background: linear-gradient(140deg, #0b2b50 0%, #123a66 100%); border-color: transparent; color: #fff; }
.kpi.hero .kpi-icon { background: rgba(23, 184, 204, 0.2); color: var(--teal); }
.kpi.hero .kpi-value { color: #fff; }
.kpi.hero .kpi-label { color: #e3edf6; }
.kpi.hero .kpi-sub { color: #9fb4ca; }
.kpi-art { position: absolute; right: -18px; bottom: -22px; width: 130px; opacity: 0.16; pointer-events: none; }

.attention { display: flex; flex-direction: column; gap: 10px; }
.att {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: inherit;
  border: 1px solid var(--line); transition: border-color 0.15s, background 0.15s;
}
a.att:hover { border-color: var(--slate-300); background: var(--slate-50); }
.att-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.att.warn .att-icon { background: var(--amber-50); color: var(--amber); }
.att.ok .att-icon { background: var(--green-50); color: var(--green); }
.att-text { flex: 1; min-width: 0; }
.att-text b { color: var(--navy-800); }
.att-text p { margin: 1px 0 0; color: var(--muted); font-size: 12.5px; }
.att-go { color: var(--teal-700); font-weight: 650; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.att-go .ic { width: 15px; height: 15px; }

.imp-last { display: flex; gap: 14px; align-items: flex-start; }
.imp-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--navy-800); color: var(--teal); display: grid; place-items: center; flex: none; }
.imp-last b { display: block; color: var(--navy-800); word-break: break-all; }
.imp-last p { margin: 2px 0 4px; color: var(--slate-600); font-size: 13px; }
.imp-last small { color: var(--muted); font-size: 12px; }
.start { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.start p { margin: 0; color: var(--slate-600); }

.feed { list-style: none; margin: 0; padding: 4px 0; }
.feed li { display: flex; gap: 12px; padding: 11px 18px; align-items: flex-start; }
.feed li + li { border-top: 1px solid var(--slate-100); }
.feed-dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.feed-dot .ic { width: 15px; height: 15px; }
.feed-dot.create { background: var(--teal-50); color: var(--teal-700); }
.feed-dot.update { background: var(--blue-50); color: var(--blue); }
.feed-dot.delete { background: var(--red-50); color: var(--red); }
.feed-dot.import { background: var(--navy-800); color: var(--teal); }
.feed-text { min-width: 0; flex: 1; }
.feed-text p { margin: 0; color: var(--slate-900); overflow-wrap: anywhere; }
.feed-meta { font-size: 12px; color: var(--muted); }
.feed-empty { padding: 26px 18px; color: var(--muted); }

.gate-steps { list-style: none; margin: 0; padding: 8px 18px 16px; display: grid; gap: 4px; counter-reset: g; }
.gate-steps li { display: flex; gap: 14px; padding: 10px 0; position: relative; }
.gate-steps li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 48px; bottom: -6px; width: 2px; background: var(--slate-100); }
.gate-steps .gs-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--slate-100); color: var(--navy-800); flex: none; }
.gate-steps li:nth-child(3) .gs-icon { background: var(--teal-50); color: var(--teal-700); }
.gate-steps li:nth-child(4) .gs-icon { background: var(--amber-50); color: var(--amber); }
.gate-steps b { color: var(--navy-800); }
.gate-steps p { margin: 1px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- chips and plates */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--slate-100); color: var(--slate-600);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.plain::before { display: none; }
.chip.green { background: var(--green-50); color: var(--green); }
.chip.blue { background: var(--blue-50); color: var(--blue); }
.chip.teal { background: var(--teal-50); color: var(--teal-700); }
.chip.red { background: var(--red-50); color: var(--red); }
.chip.amber { background: var(--amber-50); color: var(--amber); }
.chip.navy { background: var(--navy-800); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.plate {
  display: inline-flex; align-items: center; gap: 7px; padding: 2px 8px; border-radius: 6px;
  font-family: var(--mono); font-weight: 700; font-size: 13px; letter-spacing: 0.07em; line-height: 1.45; white-space: nowrap;
  color: var(--navy-800); background: #fff; border: 1.5px solid var(--navy-800); box-shadow: inset 0 -2px 0 rgba(23, 184, 204, 0.45);
}
.plate small { font-family: var(--font); font-size: 9.5px; font-weight: 800; letter-spacing: 0.05em; color: var(--teal-700); }
.plate.off { border-color: var(--slate-300); color: var(--slate-400); box-shadow: none; }
.plate.lg { font-size: 18px; padding: 4px 12px; border-width: 2px; }
.plate-none { display: inline-block; color: var(--slate-400); font-size: 12.5px; border: 1.5px dashed var(--slate-300); border-radius: 6px; padding: 1px 8px; white-space: nowrap; }
.mono-id { font-family: var(--mono); font-weight: 650; letter-spacing: 0.02em; color: var(--navy-800); white-space: nowrap; }
.mono-id.sm { font-size: 12.5px; }
.clip { display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* ---------- lists */
.toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--slate-100); flex-wrap: wrap; }
.search { position: relative; display: flex; align-items: center; flex: 1 1 260px; max-width: 380px; min-width: 0; }
.search .ic { position: absolute; left: 12px; color: var(--slate-400); width: 17px; height: 17px; pointer-events: none; }
.search input { width: 100%; height: 38px; border: 1px solid var(--slate-300); border-radius: 10px; padding: 0 12px 0 38px; background: #fff; }
.search input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(23, 184, 204, 0.18); outline: none; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--slate-100); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  border: 0; background: transparent; height: 30px; padding: 0 11px; border-radius: 8px; white-space: nowrap;
  font-weight: 650; font-size: 13px; color: var(--slate-500); cursor: pointer;
}
.seg button:hover { color: var(--navy-800); }
.seg button.on { background: #fff; color: var(--navy-800); box-shadow: 0 1px 2px rgba(11, 43, 80, 0.12); }
.seg button .n { color: var(--slate-400); font-weight: 600; margin-left: 4px; }
.toolbar-end { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; }
.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; color: var(--slate-500);
  padding: 10px 16px; background: var(--slate-50); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl th .sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.tbl th .sort:hover, .tbl th .sort.on { color: var(--navy-800); }
.tbl th .sort:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.tbl th .arrow { font-size: 12px; color: var(--teal-700); min-width: 8px; }
.tbl td { padding: 11px 16px; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl.click tbody tr { cursor: pointer; transition: background 0.12s; }
.tbl.click tbody tr:hover { background: #f7fafc; }
.tbl tbody tr:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.tbl tr.flash td { animation: flash 1.8s ease; }
@keyframes flash { 0%, 30% { background: var(--teal-50); } 100% { background: transparent; } }
#list-body.busy { opacity: 0.55; transition: opacity 0.15s; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--slate-100); color: var(--muted); font-size: 13px; }
.pager div { display: flex; gap: 6px; }

.sk { height: 13px; border-radius: 6px; background: linear-gradient(90deg, #edf1f5 25%, #f6f8fa 50%, #edf1f5 75%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.sk-row td { padding: 16px; }

.empty { padding: 56px 24px; text-align: center; }
.empty-icon { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700); }
.empty-icon .ic { width: 28px; height: 28px; }
.empty h3 { margin: 0 0 6px; font-size: 17px; }
.empty p { margin: 0 auto 18px; max-width: 440px; color: var(--muted); }
.row-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- modal */
dialog {
  border: 0; padding: 0; border-radius: 18px; width: min(580px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  box-shadow: 0 24px 70px rgba(6, 26, 51, 0.32); color: var(--text); background: #fff; overflow: hidden;
}
dialog::backdrop { background: rgba(6, 26, 51, 0.5); backdrop-filter: blur(2px); }
dialog[open] { animation: pop 0.18s ease; }
@keyframes pop { from { transform: translateY(10px) scale(0.98); opacity: 0; } }
.mform { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 8px; }
.modal-head h2 { margin: 2px 0 0; font-size: 19px; letter-spacing: -0.01em; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal-700); }
.modal-body { padding: 12px 22px 4px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px 18px; border-top: 1px solid var(--slate-100); }
.modal-foot .left { margin-right: auto; }
.meta { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
dialog.confirm { width: min(420px, calc(100vw - 32px)); }
.confirm-body { padding: 24px 24px 8px; display: flex; gap: 14px; }
.confirm-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--red-50); color: var(--red); }
.confirm-body h2 { margin: 0 0 4px; font-size: 17px; }
.confirm-body p { margin: 0; color: var(--slate-600); }
.acct { display: flex; gap: 14px; align-items: center; padding: 6px 0 18px; border-bottom: 1px solid var(--slate-100); margin-bottom: 16px; }
.acct b { display: block; color: var(--navy-800); font-size: 16px; }
.acct span { color: var(--muted); font-size: 13px; }
.section-title { font-size: 13px; font-weight: 750; color: var(--navy-800); margin: 0 0 10px; }

/* ---------- import */
.steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; color: var(--slate-400); font-weight: 650; font-size: 13px; }
.step i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--slate-200); color: var(--slate-500); font-size: 12px; font-weight: 800; }
.step.on { color: var(--navy-800); }
.step.on i { background: var(--navy-800); color: #fff; }
.step.done { color: var(--slate-600); }
.step.done i { background: var(--teal); color: #03252b; }
.step-line { width: 34px; height: 2px; background: var(--slate-200); border-radius: 2px; }
.import-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 330px;
  padding: 36px 24px; border: 2px dashed var(--slate-300); border-radius: 18px; cursor: pointer;
  background: linear-gradient(180deg, #fff 0%, #f7f9fb 100%); transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.over { border-color: var(--teal); background: var(--teal-50); }
.drop:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.drop-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 16px; background: var(--navy-800); color: var(--teal); box-shadow: 0 10px 24px rgba(11, 43, 80, 0.25); }
.drop-icon .ic { width: 28px; height: 28px; }
.drop h3 { margin: 0 0 4px; font-size: 18px; }
.drop p { margin: 0 0 14px; color: var(--slate-600); }
.drop p u { color: var(--teal-700); text-underline-offset: 3px; font-weight: 600; }
.drop.busy { pointer-events: none; }
.mini { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; margin-bottom: 14px; }
.mini th { font-family: var(--font); background: var(--navy-800); color: #fff; text-align: left; padding: 7px 10px; font-size: 12px; }
.mini th:first-child { border-radius: 8px 0 0 0; }
.mini th:last-child { border-radius: 0 8px 0 0; }
.mini td { padding: 7px 10px; border-bottom: 1px solid var(--slate-100); color: var(--navy-800); }
.ticks { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 9px; }
.ticks li { display: flex; gap: 9px; color: var(--slate-600); font-size: 13.5px; }
.ticks .ic { color: var(--teal-700); width: 16px; height: 16px; margin-top: 2px; }
.file-line { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-line > div { min-width: 0; }
.file-line b { display: block; color: var(--navy-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-badge { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--navy-800); color: var(--teal); flex: none; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; background: #fff; }
.tile .n { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; color: var(--navy-800); line-height: 1.1; }
.tile span:last-child { color: var(--slate-600); font-size: 13px; font-weight: 600; }
.tile.ready { background: linear-gradient(140deg, #0b2b50, #123a66); border-color: transparent; }
.tile.ready .n { color: #fff; }
.tile.ready span:last-child { color: #a9bfd4; }
.tile.problem { background: var(--red-50); border-color: #f4cfcc; }
.tile.problem .n { color: var(--red); }
.tile.problem.zero { background: #fff; border-color: var(--line); }
.tile.problem.zero .n { color: var(--navy-800); }
.will { margin-top: 14px; color: var(--slate-700); }
.will b { color: var(--navy-800); }
.cols { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.col-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 8px; background: var(--slate-100); font-size: 12px; color: var(--slate-600); }
.col-chip b { color: var(--navy-800); }
.res-problem { color: var(--red); font-size: 13px; }
.res-warn { color: var(--amber); font-size: 12.5px; margin-top: 4px; }
.res-skip { color: var(--slate-500); font-size: 13px; }
.import-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--slate-100); flex-wrap: wrap; position: sticky; bottom: 0; background: rgba(255, 255, 255, 0.96); border-radius: 0 0 var(--radius) var(--radius); }
.import-bar .alert { flex: 1 1 320px; }
.imp-raw { font-family: var(--mono); font-size: 13px; color: var(--navy-800); }
.done-card { padding: 44px 24px; text-align: center; }
.done-icon { width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: var(--teal); color: #03252b; box-shadow: 0 12px 30px rgba(23, 184, 204, 0.35); }
.done-icon .ic { width: 32px; height: 32px; stroke-width: 3; }
.done-card h2 { margin: 0 0 6px; font-size: 22px; }
.done-card p { margin: 0 0 20px; color: var(--muted); }
.done-stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.done-stat { min-width: 120px; padding: 12px 16px; border-radius: 12px; background: var(--slate-50); border: 1px solid var(--line); }
.done-stat b { display: block; font-size: 22px; color: var(--navy-800); }
.done-stat span { color: var(--muted); font-size: 12.5px; }

/* ---------- responsive */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .import-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-art { padding: 26px 20px 28px; }
  .login-copy { margin-top: 26px; }
  .login-copy h1 { font-size: 27px; }
  .login-copy p { font-size: 14.5px; margin-bottom: 0; }
  .login-points, .login-gate { display: none; }
  .login-form-wrap { justify-content: flex-start; padding: 28px 16px 32px; }
  .login-foot { margin-top: 28px; }

  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 60; transform: translateX(-102%); transition: transform 0.25s ease; box-shadow: 0 0 40px rgba(0, 0, 0, 0.3); }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(6, 26, 51, 0.45); }
  .menu-btn { display: inline-grid; margin-left: -6px; }
  .topbar { padding: 10px 16px; gap: 8px; }
  .topbar h1 { font-size: 18px; }
  .topbar p { display: none; }
  .content { padding: 16px 16px 40px; gap: 14px; }
  .toolbar-end > .dim { display: none; }
}
@media (max-width: 560px) {
  .btn .lbl { display: none; }
  .topbar-actions .btn { width: 38px; padding: 0; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 26px; }
  .kpi-icon { width: 32px; height: 32px; margin-bottom: 4px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .choice.pills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { flex-basis: 100%; max-width: none; }
  .toolbar-end { margin-left: 0; }
  .pager { flex-wrap: wrap; }
  .hello h2 { font-size: 18px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .modal-foot { flex-wrap: wrap; }
}
/* Lists turn into stacked cards on phones. Cell roles: m-main (title), m-end (top right), m-lab (labelled),
   m-wide (own line), m-sub (small), m-hide. */
@media (max-width: 640px) {
  .tbl.cards { min-width: 0; }
  .tbl.cards thead { display: none; }
  .tbl.cards tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; border-bottom: 1px solid var(--slate-100); }
  .tbl.cards tbody tr:last-child { border-bottom: 0; }
  .tbl.cards tbody tr::after { content: ""; order: 1; flex-basis: 100%; height: 0; }
  .tbl.cards td { padding: 0; border: 0; min-width: 0; }
  .tbl.cards td.m-main { order: 0; flex: 1 1 auto; font-weight: 650; }
  .tbl.cards td.m-end { order: 0; margin-left: auto; }
  .tbl.cards td.m-lab, .tbl.cards td.m-sub, .tbl.cards td.m-wide { order: 2; }
  .tbl.cards td.m-lab::before {
    content: attr(data-label); display: block; margin-bottom: 3px;
    font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate-400);
  }
  .tbl.cards td.m-wide { flex-basis: 100%; color: var(--slate-600); font-size: 13px; }
  .tbl.cards td.m-sub { font-size: 12.5px; color: var(--muted); }
  .tbl.cards td.m-hide { display: none; }
  .tbl.cards td:not(.m-main):not(.m-end):has(> .nil:only-child) { display: none; }
  .tbl.cards .clip { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
