/* ==========================================================================
   Taekwondo Recognition Admin — design tokens
   Geometry and palette derived from the Codia layer trace of the six
   1440x900 source frames (nodes 1:2, 1:196, 1:348, 1:562, 1:738, 1:904).
   ========================================================================== */
:root {
  color-scheme: light;

  /* brand */
  --forest: #04362e;
  --forest-hover: #0a4a3f;
  --forest-nav: #14514a;
  --forest-line: rgb(255 255 255 / 11%);
  --mint: #5cc2a7;

  /* surfaces */
  --page: #f8f9f9;
  --paper: #ffffff;
  --line: #e6e8ea;
  --line-soft: #eff1f2;
  --head: #f9fafb;
  --inset: #f5f7f7;

  /* text */
  --ink: #14181b;
  --ink-2: #39434c;
  --muted: #6b7280;
  --muted-2: #9aa3ad;
  --on-forest: #ffffff;
  --on-forest-dim: #c3d5d0;

  /* status */
  --green: #12775c;
  --green-bg: #e7f4ef;
  --green-line: #cfe7dd;
  --blue: #106eaf;
  --blue-bg: #eaf2fa;
  --blue-line: #d3e3f2;
  --amber: #b06d09;
  --amber-bg: #fdf4e3;
  --amber-line: #f6e3bd;
  --amber-dot: #e89116;
  --red: #c4402e;
  --red-bg: #fdeceb;
  --red-line: #f7d6d2;
  --red-dot: #f66a57;

  /* metrics */
  --sidebar-w: 224px;
  --topbar-h: 90px;
  --pad: 24px;
  --gap: 16px;
  --r: 6px;
  --r-sm: 4px;
  --ctrl-h: 44px;
  --ctrl-h-sm: 36px;

  font-family: Pretendard, "Pretendard Variable", "Noto Sans KR", "Apple SD Gothic Neo", system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  letter-spacing: 0;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; letter-spacing: 0; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; letter-spacing: 0; }
p { margin: 0; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.ta-r { text-align: right; }
.ta-c { text-align: center; }

/* ==========================================================================
   Icons — monochrome CSS shapes (no raster, no ad-hoc SVG)
   ========================================================================== */
.ico {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  vertical-align: -4px;
  color: inherit;
}
.ico::before, .ico::after { content: ""; position: absolute; box-sizing: border-box; }

/* 2x2 grid (dashboard) */
.ico-grid::before {
  left: 1px; top: 1px; width: 6.5px; height: 6.5px; border-radius: 1.5px;
  background: currentColor;
  box-shadow: 9px 0 0 currentColor, 0 9px 0 currentColor, 9px 9px 0 currentColor;
}
/* person (students / audience) */
.ico-users::before { left: 5.5px; top: 1.5px; width: 7px; height: 7px; border: 1.6px solid currentColor; border-radius: 50%; }
.ico-users::after { left: 2px; bottom: 1.5px; width: 14px; height: 7px; border: 1.6px solid currentColor; border-bottom: 0; border-radius: 7px 7px 0 0; }
/* bar chart (scores) */
.ico-chart::before { left: 1.5px; bottom: 1.5px; width: 15px; height: 12px; border-left: 2.6px solid currentColor; border-right: 2.6px solid currentColor; }
.ico-chart::after { left: 7.7px; bottom: 1.5px; width: 2.6px; height: 7.5px; background: currentColor; }
/* speech board (notices) */
.ico-board::before { left: 1px; top: 2px; width: 16px; height: 11.5px; border: 1.6px solid currentColor; border-radius: 3px; }
.ico-board::after { left: 4.5px; bottom: 0.5px; width: 4px; height: 4px; background: currentColor; transform: skewX(-24deg); }
/* document (score records) */
.ico-doc::before { left: 3px; top: 1px; width: 12px; height: 16px; border: 1.6px solid currentColor; border-radius: 2px; }
.ico-doc::after {
  left: 6px; top: 5.4px; width: 6px; height: 1.5px; background: currentColor; border-radius: 1px;
  box-shadow: 0 3.5px 0 currentColor, 0 7px 0 currentColor;
}
/* phone (linked app / devices) */
.ico-phone::before { left: 4px; top: 1px; width: 10px; height: 16px; border: 1.6px solid currentColor; border-radius: 2.5px; }
.ico-phone::after { left: 7.4px; top: 13.6px; width: 3.2px; height: 1.6px; background: currentColor; border-radius: 1px; }
/* bell (push) */
.ico-bell::before { left: 3px; top: 1.5px; width: 12px; height: 11px; border: 1.6px solid currentColor; border-radius: 6px 6px 1.5px 1.5px; }
.ico-bell::after {
  left: 1.5px; top: 12.5px; width: 15px; height: 1.6px; background: currentColor; border-radius: 1px;
  box-shadow: 5.7px 3px 0 -0.2px currentColor;
}
/* magnifier */
.ico-search::before { left: 1px; top: 1px; width: 12px; height: 12px; border: 1.7px solid currentColor; border-radius: 50%; }
.ico-search::after { right: 1.5px; bottom: 1.5px; width: 6px; height: 1.8px; background: currentColor; border-radius: 1px; transform: rotate(45deg); transform-origin: right center; }
/* sign out */
.ico-exit::before { left: 0.5px; top: 1.5px; width: 9px; height: 15px; border: 1.7px solid currentColor; border-right: 0; border-radius: 2px 0 0 2px; }
.ico-exit::after {
  right: 1px; top: 5.5px; width: 7px; height: 7px;
  border-top: 1.7px solid currentColor; border-right: 1.7px solid currentColor;
  transform: rotate(45deg) scale(0.72); transform-origin: center;
}
/* shield-check */
.ico-shield::before { left: 2px; top: 1px; width: 14px; height: 15px; border: 1.7px solid currentColor; border-radius: 3px 3px 7px 7px; }
.ico-shield::after { left: 5px; top: 6.5px; width: 7px; height: 3.5px; border-left: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: rotate(-45deg); }
/* eye */
.ico-eye::before { left: 0.5px; top: 3.5px; width: 17px; height: 11px; border: 1.7px solid currentColor; border-radius: 50%; }
.ico-eye::after { left: 6.5px; top: 6.5px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
/* calendar */
.ico-calendar::before { left: 1px; top: 2.5px; width: 16px; height: 14.5px; border: 1.6px solid currentColor; border-radius: 2.5px; }
.ico-calendar::after {
  left: 4.5px; top: 0.5px; width: 1.6px; height: 4px; background: currentColor; border-radius: 1px;
  box-shadow: 7px 0 0 currentColor, -2.5px 6.5px 0 currentColor, 4.5px 6.5px 0 currentColor;
}
/* download */
.ico-download::before { left: 8.1px; top: 1px; width: 1.8px; height: 9px; background: currentColor; border-radius: 1px; }
.ico-download::after {
  left: 5px; top: 6px; width: 8px; height: 8px;
  border-bottom: 1.8px solid currentColor; border-right: 1.8px solid currentColor;
  transform: rotate(45deg) scale(0.62); transform-origin: center;
}
/* send (arrowhead) */
.ico-send::before {
  left: 2px; top: 2px; width: 0; height: 0;
  border-left: 14px solid currentColor;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}
.ico-send::after { content: none; }
/* alert */
.ico-alert::before { left: 1px; top: 1px; width: 16px; height: 16px; border: 1.7px solid currentColor; border-radius: 50%; }
.ico-alert::after {
  left: 8.1px; top: 4px; width: 1.8px; height: 6px; background: currentColor; border-radius: 1px;
  box-shadow: 0 8px 0 currentColor;
}
/* info */
.ico-info::before { left: 1px; top: 1px; width: 16px; height: 16px; border: 1.5px solid currentColor; border-radius: 50%; }
.ico-info::after {
  left: 8.3px; top: 7.5px; width: 1.5px; height: 6px; background: currentColor; border-radius: 1px;
  box-shadow: 0 -3.5px 0 currentColor;
}
/* reset (circular arrow) */
.ico-reset::before {
  left: 1.5px; top: 1.5px; width: 15px; height: 15px; border-radius: 50%;
  border: 1.7px solid currentColor; border-top-color: transparent;
}
.ico-reset::after {
  right: 0.5px; top: 0.5px; width: 0; height: 0;
  border-right: 5px solid currentColor; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent;
}
/* globe / lock — notice visibility */
.ico-globe::before { left: 1px; top: 1px; width: 16px; height: 16px; border: 1.6px solid currentColor; border-radius: 50%; }
.ico-globe::after {
  left: 1px; top: 8.2px; width: 16px; height: 1.6px; background: currentColor;
}
.ico-lock::before { left: 2px; bottom: 1px; width: 14px; height: 9.5px; border: 1.6px solid currentColor; border-radius: 2px; }
.ico-lock::after { left: 5px; top: 1.5px; width: 8px; height: 8px; border: 1.6px solid currentColor; border-bottom: 0; border-radius: 4px 4px 0 0; }
/* pin */
.ico-pin::before { left: 6px; top: 1px; width: 6px; height: 9px; background: currentColor; border-radius: 3px 3px 0 0; }
.ico-pin::after { left: 8.2px; top: 9px; width: 1.6px; height: 8px; background: currentColor; }
/* pencil — single clipped shape so the body and tip rotate as one */
.ico-pencil::before {
  left: 6.2px; top: 1.2px; width: 5.6px; height: 15.6px;
  background: currentColor;
  border-radius: 1.5px 1.5px 0 0;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
  transform: rotate(45deg); transform-origin: center;
}
.ico-pencil::after { content: none; }
/* trash */
.ico-trash::before { left: 3px; top: 4.5px; width: 12px; height: 12.5px; border: 1.6px solid currentColor; border-radius: 1.5px 1.5px 3px 3px; }
.ico-trash::after {
  left: 1px; top: 2.5px; width: 16px; height: 1.6px; background: currentColor; border-radius: 1px;
  box-shadow: 4.5px -1.4px 0 0 currentColor;
}
/* chevron right */
.ico-next::before {
  left: 4px; top: 5px; width: 7px; height: 7px;
  border-top: 1.9px solid currentColor; border-right: 1.9px solid currentColor;
  transform: rotate(45deg);
}
.ico-next::after { content: none; }

.chev { position: relative; display: inline-block; width: 12px; height: 12px; flex: 0 0 auto; }
.chev::before {
  content: ""; position: absolute; top: 2.5px; width: 7px; height: 7px;
  border-top: 1.6px solid currentColor; border-right: 1.6px solid currentColor;
}
.chev-right::before { left: 1.5px; transform: rotate(45deg); }
.chev-left::before { left: 3.5px; transform: rotate(-135deg); }

.plus { position: relative; display: inline-block; width: 13px; height: 13px; flex: 0 0 auto; vertical-align: -1px; }
.plus::before, .plus::after { content: ""; position: absolute; left: 0; top: 5.5px; width: 13px; height: 2px; background: currentColor; border-radius: 1px; }
.plus::after { transform: rotate(90deg); }

.caret { position: relative; display: inline-block; width: 10px; height: 10px; flex: 0 0 auto; }
.caret::before {
  content: ""; position: absolute; left: 1px; top: 1px; width: 6px; height: 6px;
  border-bottom: 1.6px solid currentColor; border-right: 1.6px solid currentColor; transform: rotate(45deg);
}

/* crest — brand mark drawn from concentric rings */
.crest {
  position: relative; display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 50%;
  background: #ffffff;
}
.crest i { width: 20px; height: 20px; border-radius: 50%; background: var(--forest); }
.crest::after {
  content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 2.5px solid var(--forest);
}
.crest.sm { width: 26px; height: 26px; }
.crest.sm i { width: 12px; height: 12px; }
.crest.sm::after { inset: 3px; border-width: 2px; }

/* ==========================================================================
   Buttons & controls
   ========================================================================== */
.primary-button, .secondary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--ctrl-h); padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r);
  font-size: 14px; font-weight: 700; white-space: nowrap;
}
.primary-button { color: #fff; background: var(--forest); }
.primary-button:hover { background: var(--forest-hover); }
.secondary-button { color: var(--ink-2); background: var(--paper); border-color: var(--line); font-weight: 600; padding: 0 14px; }
.secondary-button:hover { background: var(--inset); }
.primary-button.block, .secondary-button.block { width: 100%; }

.link-button {
  padding: 2px 0; border: 0; background: transparent;
  color: var(--green); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.link-button:hover { text-decoration: underline; }

.icon-button {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: var(--ctrl-h); height: var(--ctrl-h);
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--paper); color: var(--muted); font-size: 18px;
}
.icon-button:hover { background: var(--inset); color: var(--ink-2); }

.row-action {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); color: var(--muted);
}
.row-action:hover { background: var(--inset); color: var(--ink); }
.row-action.danger:hover { color: var(--red); border-color: var(--red-line); background: var(--red-bg); }

input, textarea, select {
  width: 100%; min-height: var(--ctrl-h);
  padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--paper); color: var(--ink);
  outline: none;
}
input::placeholder, textarea::placeholder { color: #b6bcc2; }
textarea { min-height: 0; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgb(4 54 46 / 10%); }
input[type="checkbox"] { width: 17px; height: 17px; min-height: 0; padding: 0; accent-color: var(--forest); }

.select-field { position: relative; display: inline-flex; align-items: center; }
.select-field select {
  appearance: none; padding-right: 34px; font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.select-field::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px;
  margin-top: -5px; border-bottom: 1.6px solid var(--muted); border-right: 1.6px solid var(--muted);
  transform: rotate(45deg); pointer-events: none;
}
.select-field.block { display: flex; width: 100%; }
.select-field.block > .ico { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.select-field.block > .ico ~ select { padding-left: 39px; }
.select-field.sm select { min-height: var(--ctrl-h-sm); padding: 0 32px 0 12px; font-size: 13px; }
.select-field.sm::after { right: 12px; }

.search-field { position: relative; display: flex; align-items: center; flex: 1 1 260px; min-width: 180px; }
.search-field.narrow { flex: 0 1 300px; }
.search-field > .ico { position: absolute; left: 14px; color: var(--muted-2); pointer-events: none; }
.search-field > .ico.suffix { left: auto; right: 14px; }
.search-field input { padding-left: 42px; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field:has(> .ico.suffix) input { padding-left: 14px; padding-right: 42px; }

.date-field {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: var(--ctrl-h); padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--paper);
}
.date-field > .ico { color: var(--muted); }
.date-field input {
  width: 92px; min-height: 0; padding: 0; border: 0; background: transparent;
  font-size: 13px; color: var(--ink-2);
}
.date-field input::-webkit-calendar-picker-indicator { padding: 0; margin: 0; opacity: .45; }
.date-field input:focus { box-shadow: none; }
.date-sep { color: var(--muted-2); }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.check input { flex: 0 0 auto; }

.segmented { display: inline-flex; gap: 6px; }
.seg {
  min-height: var(--ctrl-h); padding: 0 22px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--paper); color: var(--ink-2); font-size: 14px; font-weight: 600;
}
.seg:hover { background: var(--inset); }
.seg.active { color: #fff; background: var(--forest); border-color: var(--forest); font-weight: 700; }

.form-error { min-height: 17px; color: var(--red); font-size: 12px; font-weight: 600; }

/* ==========================================================================
   Login
   ========================================================================== */
.login-view { min-height: 100vh; display: grid; grid-template-columns: 719fr 721fr; }

.login-brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 32px; color: #fff; background: var(--forest);
}
.login-brand > :not(.login-mat) { position: relative; }

/* Dojang mat boundary. Fitted to the 719x900 login frame by scanning every
   reference row for line crossings: two nested hexagons drawn in perspective
   (bottom edge wider than the top, so each is an irregular hexagon rather
   than a regular one) plus two dashed guide diagonals crossing at (355, 418).
   Bounding boxes in frame px — outer x -276..995 / y 59..840, inner
   x -216..896 / y 95..788. Every line is white at 7% over the forest fill,
   which is what the reference decodes to (#1b433c over #023830). Drawn as
   geometry so it stays crisp at any DPI. */
.login-mat { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.mat-hex, .mat-diag { position: absolute; }
.mat-hex { background: rgb(255 255 255 / 7%); clip-path: var(--hex); }
.mat-hex i { position: absolute; inset: 2px; background: var(--forest); clip-path: var(--hex); }
.mat-hex-outer {
  --hex: polygon(38.71% 0, 61.76% 0, 100% 49.46%, 62.47% 100%, 35.72% 100%, 0 47.02%);
  left: -38.39%; top: 6.56%; width: 176.77%; height: 86.72%;
}
.mat-hex-inner {
  --hex: polygon(40.2% 0, 63.22% 0, 100% 47.19%, 65.29% 100%, 37.32% 100%, 0 46.75%);
  left: -30.04%; top: 10.56%; width: 154.66%; height: 77%;
}
.mat-diag {
  left: 49.39%; top: 46.39%; width: 2px; height: 132%;
  background: repeating-linear-gradient(180deg, rgb(255 255 255 / 7%) 0 18px, transparent 18px 25.5px);
}
.mat-diag-a { transform: translate(-50%, -50%) rotate(-20.2deg); }
.mat-diag-b { transform: translate(-50%, -50%) rotate(21.8deg); }

/* Ring + kicking figure, node 1:947 exported as a 164x166 transparent cutout
   (white art only — no baked background), so it composites over the mat. */
.login-crest {
  width: 164px; height: 166px;
  background: url("assets/codia-v2/brand-mark.png") center / contain no-repeat;
}
.login-brand-title { margin-top: 25px; font-size: 46px; font-weight: 800; line-height: 1.16; color: #eef3f1; }
.login-brand-system { margin-top: 8px; font-size: 24px; font-weight: 600; color: var(--mint); }
.login-rule { width: 32px; height: 3px; margin: 20px 0 0; border-radius: 2px; background: var(--mint); }
.login-tagline { margin-top: 21px; font-size: 17px; font-weight: 500; color: #b9cdc7; }
.login-features {
  display: flex; align-items: center; gap: 0;
  margin: 84px 0 0; padding: 0; list-style: none;
}
.login-features li {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  min-width: 118px; padding: 0 28px;
  font-size: 16px; font-weight: 600; color: #b9cdc7;
}
.login-features li + li { border-left: 1px solid rgb(255 255 255 / 18%); }
.login-features .ico { width: 18px; height: 18px; margin: 6px 0 10px; transform: scale(1.75); transform-origin: center; }

.login-side { position: relative; display: grid; place-items: center; padding: 40px; background: #f7f8f7; }
.login-secure {
  position: absolute; top: 44px; right: 46px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: #3f7f6d;
}
.login-panel { width: min(478px, 100%); }
.login-panel h1 { font-size: 34px; font-weight: 800; line-height: 1.25; color: var(--ink); }
.login-subtitle { margin-top: 13px; font-size: 15px; color: #8a8f92; }
.login-form { margin-top: 43px; display: grid; gap: 22px; }
.login-form .field { display: grid; gap: 9px; }
.login-form label { font-size: 15px; font-weight: 700; color: #4b5054; }
.login-form input { min-height: 58px; padding: 0 16px; border-radius: var(--r); background: #fbfbfb; font-size: 15px; }
.input-affix { position: relative; display: flex; }
.input-affix input { padding-right: 52px; }
.affix-button {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted-2);
}
.affix-button:hover { color: var(--ink-2); background: var(--inset); }
.affix-button[aria-pressed="true"] { color: var(--forest); }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -4px; }
.login-row .check { font-size: 14px; color: #7b8083; }
.login-row .link-button { font-size: 15px; color: #3f7f6d; }
.login-form .primary-button { min-height: 63px; font-size: 19px; font-weight: 700; }
.login-form .form-error { min-height: 0; margin-top: -6px; }
.login-form .form-error:empty { display: none; }
.login-foot { margin-top: 26px; text-align: center; font-size: 14px; color: #a2a6a9; }

/* ==========================================================================
   Shell
   ========================================================================== */
.admin-view { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.sidebar-scrim { display: none; }

.sidebar {
  position: sticky; top: 0; z-index: 20;
  height: 100vh; display: flex; flex-direction: column;
  padding: 22px 12px 18px;
  color: var(--on-forest); background: var(--forest);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
.sidebar-brand-text { display: grid; min-width: 0; }
.sidebar-brand-text strong { font-size: 16px; font-weight: 700; white-space: nowrap; }
.sidebar-brand-text small { margin-top: 2px; font-size: 13px; color: #8fa8a2; }

.main-nav { display: grid; gap: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 14px;
  height: 48px; padding: 0 16px;
  border: 0; border-radius: var(--r);
  color: #a9c0ba; background: transparent;
  text-align: left; font-size: 15px; font-weight: 600; white-space: nowrap;
}
.nav-item:hover { color: #fff; background: rgb(255 255 255 / 7%); }
.nav-item.active { color: #fff; background: var(--forest-nav); font-weight: 700; }

.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--forest-line); }
.sidebar-account { display: flex; align-items: center; gap: 11px; padding: 4px 8px 16px; min-width: 0; }
.sidebar-account-text { display: grid; min-width: 0; }
.sidebar-account-text strong { font-size: 13px; font-weight: 700; color: #dbe7e3; }
.sidebar-account-text small { font-size: 12px; color: #86a09a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-button {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 42px;
  border: 1px solid var(--forest-line); border-radius: var(--r);
  color: #dbe7e3; background: transparent; font-size: 14px; font-weight: 600;
}
.logout-button:hover { background: rgb(255 255 255 / 8%); color: #fff; }

.avatar {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--green-bg); color: var(--forest);
  font-size: 13px; font-weight: 700;
}
.avatar-dark { background: rgb(255 255 255 / 13%); color: #fff; width: 36px; height: 36px; }

.workspace { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 12;
  height: var(--topbar-h); flex: 0 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 0 var(--pad);
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.menu-button { display: none; }
.topbar-title { min-width: 0; }
.topbar-title p { font-size: 13px; font-weight: 600; color: var(--muted); }
.topbar-title h1 { margin-top: 3px; font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--ink); white-space: nowrap; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 20px; }

/* Fixed reporting window shown in the dashboard topbar (Codia 1:162 — a
   147x41 chip with a calendar glyph, label and chevron). The dashboard API
   always aggregates the trailing 7 days, so this is a display control: it
   states the window rather than offering to change it. */
.date-chip {
  display: none; align-items: center; gap: 12px;
  width: 147px; height: 41px; padding: 0 19px;
  border: 1px solid #e4e5e7; border-radius: var(--r-sm); background: var(--paper);
  font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.date-chip .ico { transform: scale(0.9); color: var(--ink-2); }
.date-chip .caret { margin-left: auto; color: var(--ink-2); }
.workspace.is-dashboard .date-chip { display: inline-flex; }

.status-dot { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.status-dot i { width: 9px; height: 9px; border-radius: 50%; background: #16a34a; }
.bell { position: relative; display: inline-grid; place-items: center; width: 24px; height: 24px; color: var(--ink-2); }
.bell .ico { transform: scale(1.2); }
.bell-badge {
  position: absolute; top: -5px; right: -7px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 9px;
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
}
.account { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.account .caret { color: var(--muted); }

.content { flex: 1 1 auto; padding: var(--pad); display: flex; flex-direction: column; }
.page-view { min-width: 0; }
#view-notices, #view-push { flex: 1 1 auto; display: flex; flex-direction: column; }

/* ==========================================================================
   Panels & tables
   ========================================================================== */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.panel-head {
  min-height: 52px; display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 16px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.panel-head > .link-button, .panel-head > .panel-metric { margin-left: auto; }
.panel-metric { font-size: 13px; color: var(--muted); white-space: nowrap; }
.panel-metric strong { margin-left: 4px; font-size: 20px; font-weight: 700; color: var(--ink); }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 0 16px; text-align: left; white-space: nowrap; }
.data-table th.ta-c, .data-table td.ta-c { text-align: center; }
.data-table th.ta-r, .data-table td.ta-r { text-align: right; }
.data-table th {
  height: 44px; background: var(--head);
  border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.data-table td { height: 52px; border-bottom: 1px solid var(--line-soft); font-size: 14px; color: var(--ink-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fbfcfc; }
.data-table td strong { font-weight: 700; color: var(--ink); }
.data-table .sub { display: block; margin-top: 2px; font-size: 12px; color: var(--muted-2); font-weight: 400; }
.data-table .cell-main { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
.data-table .num { font-variant-numeric: tabular-nums; }
.data-table .col-check { width: 46px; }
.data-table .col-pin { width: 62px; }
.data-table .empty-cell { height: 220px; text-align: center; color: var(--muted-2); }

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; height: 28px; padding: 0 10px;
  border-radius: var(--r); border: 1px solid transparent;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.pill-green { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
.pill-blue { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-line); }
.pill-amber { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-line); }
.pill-red { color: var(--red); background: var(--red-bg); border-color: var(--red-line); }
.pill-grey { color: var(--muted); background: var(--inset); border-color: var(--line); }
.score-text { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-text.is-good { color: var(--green); }
.score-text.is-mid { color: var(--amber-dot); }
.score-text.is-low { color: var(--red); }

.status-inline { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
.status-inline .ico { transform: scale(0.9); color: var(--muted); }

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

.table-foot {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px; border-top: 1px solid var(--line);
}
.foot-count { flex: 1 1 auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.foot-count strong { color: var(--ink); font-weight: 700; }
.pagination { display: flex; justify-content: center; gap: 6px; }
.pagination.pagination-start { justify-content: flex-start; }
.pagination button {
  min-width: 34px; height: 34px; padding: 0 8px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink-2); font-size: 13px; font-weight: 600;
}
.pagination button:hover:not(:disabled) { background: var(--inset); }
.pagination button.active { color: #fff; background: var(--forest); border-color: var(--forest); font-weight: 700; }
.pagination button:disabled { color: #c9ced2; cursor: default; }
.table-foot > .select-field { flex: 0 0 auto; }
.table-foot > .foot-count.ta-r { text-align: right; }

.empty { padding: 56px 20px; color: var(--muted-2); text-align: center; font-size: 14px; }

/* ==========================================================================
   Toolbar
   ========================================================================== */
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: var(--gap); }
.toolbar .select-field select { min-width: 120px; max-width: 144px; text-overflow: ellipsis; }
.toolbar-end { margin-left: auto; }
.toolbar-note { font-size: 14px; color: var(--muted); white-space: nowrap; }
.toolbar-note strong { color: var(--forest); font-weight: 700; }
.toolbar-inset { padding: 14px 20px 0; margin-bottom: 14px; }
.toolbar-banner { align-items: stretch; }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  position: relative; min-height: 146px;
  display: grid; grid-template-columns: 65px minmax(0, 1fr); grid-template-rows: auto auto;
  align-content: center; gap: 6px 18px;
  padding: 22px 24px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  border-top: 3px solid var(--stat-accent, var(--green));
}
.stat-icon {
  grid-row: 1 / 3; align-self: start;
  display: grid; place-items: center; width: 65px; height: 65px; border-radius: 50%;
  background: var(--stat-soft, var(--green-bg)); color: var(--stat-accent, var(--green));
}
.stat-icon .ico { transform: scale(1.55); }
.stat-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat-value { align-self: start; font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--ink); }
.stat-value em { font-style: normal; font-size: 18px; font-weight: 600; margin-left: 2px; }
.stat-foot {
  grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px;
  margin-top: 12px; font-size: 13px; color: var(--muted-2);
}
.stat-foot b { color: var(--stat-accent, var(--green)); font-size: 14px; font-weight: 700; }
.stat-a { --stat-accent: var(--green); --stat-soft: var(--green-bg); }
.stat-b { --stat-accent: var(--blue); --stat-soft: var(--blue-bg); }
.stat-c { --stat-accent: var(--amber-dot); --stat-soft: var(--amber-bg); }
.stat-d { --stat-accent: var(--red-dot); --stat-soft: var(--red-bg); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 723fr) minmax(0, 421fr); gap: 18px; margin-bottom: 16px; }
.legend { display: flex; align-items: center; gap: 18px; font-size: 13px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend-line::before { content: ""; width: 16px; height: 3px; border-radius: 2px; background: var(--green); }
.legend-bar::before { content: ""; width: 13px; height: 13px; border-radius: 2px; background: #cde5da; }

.chart { padding: 16px 20px 12px; }
.chart-cap { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted-2); }
.chart-body { display: grid; grid-template-columns: 34px minmax(0, 1fr) 26px; gap: 8px; margin-top: 8px; }
.chart-axis { display: flex; flex-direction: column; justify-content: space-between; height: 178px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-axis span { line-height: 1; transform: translateY(-50%); }
.chart-axis.right { text-align: right; }
.chart-plot { position: relative; height: 178px; }
.chart-plot .gl { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed #e9ecee; }
.chart-cols { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.chart-col { position: relative; flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-col .bar { width: 26px; min-height: 1px; border-radius: 2px 2px 0 0; background: #cde5da; }
.chart-col .bar-value { position: absolute; left: 0; right: 0; text-align: center; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart-col .dot { position: absolute; left: 50%; width: 8px; height: 8px; margin-left: -4px; margin-bottom: -4px; border-radius: 50%; background: var(--green); }
.chart-col .dot-value { position: absolute; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.chart-line-seg { position: absolute; height: 2.5px; border-radius: 2px; background: var(--green); transform-origin: left center; }
.chart-xl { display: flex; margin: 10px 0 0 42px; padding-right: 34px; }
.chart-xl span { flex: 1 1 0; text-align: center; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.mode-list { padding: 6px 20px; }
.mode-row { display: flex; align-items: center; gap: 18px; padding: 17px 0; border-bottom: 1px solid var(--line-soft); }
.mode-row:last-child { border-bottom: 0; }
.mode-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--mode-soft, var(--green-bg)); color: var(--mode-accent, var(--green)); }
.mode-icon .ico { transform: scale(1.45); }
.mode-name { flex: 1 1 auto; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.mode-figure { text-align: right; }
.mode-figure strong { display: block; font-size: 20px; font-weight: 700; color: var(--ink); }
.mode-figure span { display: block; margin-top: 3px; font-size: 14px; font-weight: 600; color: var(--mode-accent, var(--green)); }
.mode-row.tone-a { --mode-accent: var(--green); --mode-soft: var(--green-bg); }
.mode-row.tone-b { --mode-accent: var(--blue); --mode-soft: var(--blue-bg); }
.mode-row.tone-c { --mode-accent: var(--amber-dot); --mode-soft: var(--amber-bg); }
.mode-row.tone-d { --mode-accent: var(--red-dot); --mode-soft: var(--red-bg); }

/* ==========================================================================
   Students
   ========================================================================== */
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: var(--gap); }
.mini-stats.push-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mini-stat {
  min-height: 88px; display: flex; align-items: center; gap: 22px;
  padding: 18px 24px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
}
.mini-stat .mini-icon {
  display: grid; place-items: center; width: 53px; height: 53px; border-radius: 12px;
  background: var(--stat-soft, var(--green-bg)); color: var(--stat-accent, var(--green));
}
.mini-icon .ico { transform: scale(1.35); }
.mini-text { display: grid; gap: 4px; min-width: 0; }
.mini-text span { font-size: 13px; font-weight: 600; color: var(--muted); }
.mini-text strong { font-size: 21px; font-weight: 700; color: var(--ink); }
.mini-text strong em { font-style: normal; font-size: 15px; font-weight: 600; margin-left: 2px; }

.students-table td { height: 96px; }
.students-table .student-cell { display: flex; align-items: center; gap: 16px; }
.students-table .avatar { width: 44px; height: 44px; font-size: 17px; }
.students-table .avatar.tone-b { background: var(--blue-bg); color: #3b5b86; }

/* ==========================================================================
   Scores
   ========================================================================== */
.scores-layout { display: grid; grid-template-columns: minmax(0, 1fr) 273px; gap: 18px; align-items: start; }
.scores-main { min-width: 0; display: grid; gap: var(--gap); align-content: start; }
.scores-main > .toolbar { margin-bottom: 0; }
.summary-card {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
}
.summary-item { display: flex; align-items: center; gap: 20px; padding: 26px 24px; }
.summary-item + .summary-item { border-left: 1px solid var(--line-soft); }
.summary-item .mini-icon {
  display: grid; place-items: center; width: 51px; height: 51px; border-radius: 13px;
  background: var(--stat-soft, var(--green-bg)); color: var(--stat-accent, var(--green));
}
.scores-table td { height: 56px; }
.scores-table tbody tr.is-active td { background: var(--green-bg); }
.scores-table tbody tr.is-active:hover td { background: var(--green-bg); }

.detail-panel {
  position: sticky; top: var(--topbar-h);
  display: grid; gap: 14px; align-content: start;
  margin: calc(var(--pad) * -1) calc(var(--pad) * -1) calc(var(--pad) * -1) 0;
  padding: var(--pad) var(--pad) var(--pad) 20px;
  min-height: calc(100vh - var(--topbar-h));
  background: var(--paper); border-left: 1px solid var(--line);
}
.detail-empty { padding: 40px 4px; text-align: center; font-size: 13px; color: var(--muted-2); line-height: 1.7; }
.detail-head { display: flex; align-items: flex-start; gap: 12px; }
.detail-head h3 { flex: 1 1 auto; font-size: 16px; font-weight: 700; color: var(--ink); }
.detail-head .icon-button { width: 30px; height: 30px; border: 0; font-size: 20px; background: transparent; }
.detail-time { margin-top: 6px; font-size: 13px; color: var(--muted-2); }
.detail-total {
  padding: 20px; text-align: center;
  background: var(--inset); border: 1px solid var(--line); border-radius: var(--r);
}
.detail-total span { font-size: 15px; font-weight: 600; color: var(--muted); }
.detail-total strong { display: block; margin-top: 6px; font-size: 42px; font-weight: 800; line-height: 1.1; color: var(--green); }
.detail-total strong em { font-style: normal; font-size: 24px; font-weight: 700; }
.detail-triple, .detail-double { display: grid; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.detail-triple { grid-template-columns: repeat(3, 1fr); }
.detail-double { grid-template-columns: repeat(2, 1fr); }
.detail-cell { padding: 16px 8px; text-align: center; }
.detail-cell + .detail-cell { border-left: 1px solid var(--line-soft); }
.detail-cell span { font-size: 13px; font-weight: 600; color: var(--muted); }
.detail-cell strong { display: block; margin-top: 8px; font-size: 20px; font-weight: 700; color: var(--ink); }
.detail-cell strong em { font-style: normal; font-size: 14px; font-weight: 600; }
.detail-cell.tone-a strong { color: var(--green); }
.detail-cell.tone-b strong { color: var(--blue); }
.detail-cell.tone-c strong { color: var(--amber-dot); }
.detail-chart-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.detail-chart { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; }
.detail-chart .chart-axis { height: 170px; }
.detail-bars { position: relative; height: 170px; display: flex; align-items: flex-end; gap: 12px; }
.detail-bars .detail-bar { position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.detail-bars i { width: 26px; min-height: 1px; border-radius: 2px 2px 0 0; background: var(--green); }
.detail-bar.tone-b i { background: var(--blue); }
.detail-bar.tone-c i { background: var(--amber-dot); }
.detail-bar.tone-d i { background: var(--red-dot); }
.detail-bars b { position: absolute; bottom: 0; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.detail-xl { display: flex; gap: 12px; margin-left: 38px; }
.detail-xl span { flex: 1 1 0; text-align: center; font-size: 12px; color: var(--muted); }
.detail-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted-2); }
.detail-note .ico { transform: scale(0.85); }

/* ==========================================================================
   Notices
   ========================================================================== */
.notices-layout { display: grid; grid-template-columns: minmax(0, 742fr) minmax(0, 433fr); gap: 18px; flex: 1 1 auto; }
.notices-table td { height: 88px; vertical-align: middle; }
.notices-table tbody tr.is-active td { background: #f1f7f6; }
.notices-table tbody tr.is-active td:first-child { box-shadow: inset 4px 0 0 var(--green); }
.notice-title { display: flex; align-items: center; gap: 10px; }
.notice-title strong { font-size: 15px; font-weight: 700; color: var(--ink); }
.notice-title .pill { min-width: 0; height: 24px; font-size: 11px; }
.notice-sub { display: block; margin-top: 5px; font-size: 13px; color: var(--muted-2); }
.data-table .date-cell { line-height: 1.4; }
.data-table .date-cell small { display: block; color: var(--muted-2); font-size: 13px; }
.pin-on { color: var(--green); }
.pin-off { color: #cbd1d5; }

.preview-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; }
.preview-body { padding: 20px; }

/* Phone carousel (Codia 1:590). The sheet is 282x404 with 22px gutters, the
   step controls are 37px discs sitting 11px clear of each edge at 60% height,
   and the dot rail is pinned 26px above the bottom. */
.phone-stage {
  position: relative; display: flex; justify-content: center;
  width: 378px; max-width: 100%; margin: 0 auto; padding: 0 48px;
}
.phone {
  display: flex; flex-direction: column;
  width: 282px; max-width: 100%; min-height: 404px;
  padding: 27px 22px 26px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
  box-shadow: 0 6px 18px rgb(20 40 34 / 6%);
}
.phone-step {
  position: absolute; top: 60%; transform: translateY(-50%);
  display: grid; place-items: center; width: 37px; height: 37px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink-2);
}
.phone-step:hover:not(:disabled) { background: var(--inset); }
.phone-step:disabled { color: #c9ced2; cursor: default; }
.phone-step[data-step="-1"] { left: 0; }
.phone-step[data-step="1"] { right: 0; }
.phone-top { display: flex; align-items: center; justify-content: space-between; }
.phone-top .pill { height: 23px; min-width: 0; font-size: 11px; }
.phone-index { font-size: 12px; color: var(--muted-2); }
.phone h4 { margin: 22px 0 0; font-size: 18px; font-weight: 700; color: var(--ink); }
.phone-meta { display: flex; align-items: center; gap: 8px; margin-top: 15px; font-size: 14px; color: var(--muted); }
.phone-meta .ico { transform: scale(0.85); }
.phone-rule { height: 1px; margin: 15px 0 22px; background: var(--line-soft); }
.phone-text { font-size: 13px; color: var(--ink-2); line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
/* Calendar/clock line art, node 1:596 exported as a 130x123 transparent cutout. */
.phone-art {
  width: 130px; height: 123px; margin: 38px auto 0; flex: 0 0 auto;
  background: url("assets/codia-v2/notice-calendar.png") center / contain no-repeat;
}
.phone-dots { display: flex; justify-content: center; gap: 12px; margin-top: auto; padding-top: 23px; }
.phone-dot { width: 8px; height: 8px; border-radius: 50%; background: #d8dada; }
.phone-dot.is-on { background: var(--green); }
.preview-meta { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r); }
.preview-meta div { display: flex; align-items: center; gap: 12px; padding: 12px 16px; font-size: 13px; }
.preview-meta div + div { border-top: 1px solid var(--line-soft); }
.preview-meta .ico { transform: scale(0.9); color: var(--muted-2); }
.preview-meta span { color: var(--muted); }
.preview-meta strong { margin-left: auto; font-weight: 600; color: var(--ink-2); }
.preview-log {
  display: flex; gap: 10px; margin-top: 14px; padding: 14px 16px;
  background: #f0f7f6; border: 1px solid var(--green-line); border-radius: var(--r);
  font-size: 13px; color: var(--ink-2);
}
.preview-log .ico { color: var(--green); }
.preview-log b { display: block; font-weight: 600; color: var(--muted); }

/* ==========================================================================
   Push
   ========================================================================== */
.provider-state {
  flex: 1 1 auto; display: flex; align-items: center; gap: 12px;
  min-height: var(--ctrl-h); padding: 12px 20px;
  border: 1px solid var(--amber-line); border-radius: var(--r);
  background: #fdf9ed; color: var(--amber);
  font-size: 14px; font-weight: 600;
}
.provider-state.ready { border-color: var(--green-line); background: var(--green-bg); color: var(--green); }
.push-layout { display: grid; grid-template-columns: minmax(0, 716fr) minmax(0, 460fr); gap: 18px; flex: 1 1 auto; }
.notices-layout > *, .push-layout > * { display: flex; flex-direction: column; min-height: 0; }
.notices-layout .table-wrap, .push-layout .table-wrap { flex: 1 1 auto; }
.notices-layout .table-foot, .push-layout .table-foot { margin-top: auto; }
.push-table td { height: 76px; vertical-align: middle; }
.compose-panel .compose-body { display: grid; gap: 14px; padding: 18px 20px; align-content: start; }
.compose-body .field { display: grid; gap: 8px; }
.compose-body label, .compose-body .field-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.counted { position: relative; display: block; }
.counted input, .counted textarea { padding-right: 74px; }
.counted textarea { padding-bottom: 26px; }
.counted b {
  position: absolute; right: 14px; bottom: 12px;
  font-size: 12px; font-weight: 500; color: var(--muted-2);
}
.counted:has(input) b { top: 50%; bottom: auto; transform: translateY(-50%); }
.push-preview {
  display: flex; gap: 12px; padding: 16px;
  background: #fafafa; border: 1px solid var(--line); border-radius: 10px;
}
.push-preview .crest { background: var(--forest); }
.push-preview .crest i { background: #fff; }
.push-preview .crest::after { border-color: #fff; }
.push-preview-body { min-width: 0; display: grid; gap: 5px; }
.push-preview-app { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.push-preview-app b { margin-left: auto; font-weight: 500; color: var(--muted-2); font-size: 12px; }
.push-preview-body strong { font-size: 14px; font-weight: 700; color: var(--ink); word-break: break-word; }
.push-preview-body span { font-size: 14px; color: var(--ink-2); word-break: break-word; }
.compose-note { display: flex; gap: 8px; font-size: 12px; color: var(--muted-2); line-height: 1.5; }
.compose-note .ico { transform: scale(0.85); flex: 0 0 auto; }
.compose-body .form-error { min-height: 0; }
.compose-body .form-error:empty { display: none; }

/* ==========================================================================
   Dialogs & toast
   ========================================================================== */
.modal {
  width: min(620px, calc(100vw - 28px)); max-height: calc(100vh - 28px);
  padding: 0; border: 0; border-radius: 8px;
  color: var(--ink); background: var(--paper);
  box-shadow: 0 24px 80px rgb(13 29 23 / 28%);
}
.modal::backdrop { background: rgb(18 31 27 / 54%); }
.modal form, .detail-modal { padding: 22px; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.modal-heading p { font-size: 12px; font-weight: 700; color: var(--green); }
.modal-heading h2 { margin-top: 5px; font-size: 18px; font-weight: 700; }
.modal-heading .icon-button { width: 34px; height: 34px; border: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid label { display: grid; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.wide { grid-column: 1 / -1; }
.toggle-label { display: flex; align-items: center; gap: 8px; min-height: var(--ctrl-h); }
.check-row { display: flex; gap: 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.detail-grid .detail-cell { min-height: 74px; padding: 12px; text-align: left; background: var(--inset); border-radius: var(--r-sm); border: 0; }
.detail-grid .detail-cell + .detail-cell { border-left: 0; }
.detail-grid .detail-cell span { font-size: 11px; }
.detail-grid .detail-cell strong { margin-top: 8px; font-size: 15px; }

.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  max-width: min(360px, calc(100vw - 40px));
  padding: 13px 16px; border-radius: var(--r);
  color: #fff; background: var(--forest);
  box-shadow: 0 10px 32px rgb(0 0 0 / 18%);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1280px) {
  .scores-layout { grid-template-columns: minmax(0, 1fr) 270px; }
}

@media (max-width: 1180px) {
  .login-brand-title { font-size: 38px; }
  .login-features { margin-top: 48px; }
}

@media (max-width: 980px) {
  :root { --pad: 16px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .scores-layout, .notices-layout, .push-layout { grid-template-columns: minmax(0, 1fr); }
  .mini-stats, .mini-stats.push-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-item:nth-child(3) { border-left: 0; }
  .summary-item:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
  .detail-panel { position: static; }
  .login-view { grid-template-columns: minmax(0, 1fr); }
  .login-brand { padding: 44px 24px; }
  .login-crest { width: 117px; height: 118px; }
  .login-brand-title { font-size: 32px; }
  .login-side { padding: 32px 20px 48px; }
  .login-secure { position: static; margin: 0 0 22px auto; }
}

@media (max-width: 720px) {
  .admin-view { display: block; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 40;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim {
    display: block; position: fixed; inset: 0; z-index: 30;
    border: 0; padding: 0; background: rgb(10 24 20 / 45%);
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .sidebar.open ~ .sidebar-scrim, .sidebar-scrim.open { opacity: 1; pointer-events: auto; }
  .menu-button { display: inline-grid; }
  .topbar { height: 68px; gap: 12px; }
  .topbar-title h1 { font-size: 19px; }
  .topbar-title p { font-size: 12px; }
  .topbar-tools { gap: 14px; }
  .status-dot, .account .caret { display: none; }
  .workspace.is-dashboard .date-chip { display: none; }
  .phone-stage { padding: 0 44px; }
  .stat-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .stat { min-height: 0; padding: 18px 20px; }
  .mini-stats, .mini-stats.push-stats, .summary-card { grid-template-columns: minmax(0, 1fr); }
  .summary-item + .summary-item { border-left: 0; border-top: 1px solid var(--line-soft); }
  .toolbar { gap: 8px; }
  .toolbar .search-field, .toolbar .select-field, .toolbar .date-field { flex: 1 1 100%; }
  .toolbar .select-field select { width: 100%; }
  .toolbar-end { margin-left: 0; }
  .toolbar .primary-button, .toolbar .secondary-button { flex: 1 1 auto; }
  .segmented { flex: 1 1 100%; }
  .seg { flex: 1 1 0; padding: 0 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .table-foot { flex-wrap: wrap; }
  .foot-count { flex: 1 1 100%; text-align: left; }
  .login-features { flex-wrap: wrap; justify-content: center; gap: 20px 0; }
  .login-panel h1 { font-size: 27px; }
  .login-form input { min-height: 50px; }
  .login-form .primary-button { min-height: 54px; font-size: 17px; }
}
