:root {
  --navy: #0F2739;
  --navy-2: #163349;
  --paper: #FAF7F2;
  --ink: #0F2739;
  --muted: #4A5D72;
  --soft: #7B8BA0;
  --line: rgba(15, 39, 57, .08);
  --line-2: rgba(15, 39, 57, .14);
  --accent: #3D5AFE;
  --accent-ink: #2B44D6;
  --accent-soft: rgba(61, 90, 254, .09);
  --green: #1C8A5E; --green-soft: rgba(28, 138, 94, .1);
  --amber: #A86B00; --amber-soft: rgba(214, 150, 20, .14);
  --red: #C93838; --red-soft: rgba(201, 56, 56, .1);
  --blue-soft: rgba(61, 90, 254, .1);
  --gray-soft: rgba(15, 39, 57, .06);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 39, 57, .05);
  --shadow-lg: 0 24px 64px rgba(15, 39, 57, .18);
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/24px Manrope, system-ui, -apple-system, Segoe UI, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.tiny { font-size: 13px; line-height: 20px; }
.center { text-align: center; }
.accent { color: var(--accent); }
.red { color: var(--red); }
.green { color: var(--green); }
.amber { color: var(--amber); }
.grow { flex: 1; min-width: 0; }
.ic { flex: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--gray-soft); padding: 2px 6px; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 14px; line-height: 20px; white-space: nowrap; transition: transform .15s var(--ease), background-color .15s, box-shadow .15s, opacity .15s; text-decoration: none !important; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(61, 90, 254, .3); }
.btn-primary:hover:not(:disabled) { background: var(--accent-ink); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
.btn-ghost { background: #fff; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--paper); border-color: rgba(15, 39, 57, .22); }
.btn-ghost.danger { color: var(--red); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #B02E2E; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-xl { min-height: 56px; font-size: 17px; border-radius: 14px; width: 100%; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); transition: background-color .15s, color .15s; }
.icon-btn:hover { background: var(--gray-soft); color: var(--ink); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 4px; }
.link-btn:hover { text-decoration: underline; }
.link { font-weight: 600; font-size: 14px; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-blue { background: var(--blue-soft); color: var(--accent-ink); }
.pill-gray { background: var(--gray-soft); color: var(--muted); }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gray-soft); font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 4px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; gap: 40px; position: relative; overflow: hidden; }
.login-art::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(closest-side, rgba(61, 90, 254, .35), transparent); }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand b { display: block; font-size: 17px; }
.login-brand span { font-size: 13px; opacity: .7; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); flex: none; }
.login-hero { max-width: 460px; margin-top: auto; }
.login-hero h1 { font-size: 36px; line-height: 44px; letter-spacing: -.01em; }
.login-hero p { margin-top: 16px; font-size: 16px; line-height: 26px; opacity: .78; }
.login-ill { width: 100%; max-width: 420px; position: relative; z-index: 1; margin-bottom: auto; }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; gap: 24px; }
.login-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: 0 8px 32px rgba(15, 39, 57, .06); display: flex; flex-direction: column; gap: 16px; }
.login-card h2 { font-size: 24px; line-height: 32px; }
.login-card .login-brand { color: var(--ink); }
.login-card .login-brand span { color: var(--muted); opacity: 1; }
.mobile-only { display: none !important; }
.role-cards { display: grid; gap: 8px; }
.role-card { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; min-height: 56px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; transition: border-color .15s, background-color .15s, transform .15s var(--ease); }
.role-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.role-card:active { transform: scale(.99); }
.role-card b { display: block; font-size: 14px; line-height: 20px; }
.role-card small { color: var(--muted); font-size: 13px; line-height: 18px; }
.rc-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: none; }
.login-form { display: grid; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.login-form[hidden] { display: none; }
.form-err { color: var(--red); font-size: 13px; font-weight: 600; }
.foot-note { opacity: .8; }

/* ---------- fields ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
input:not([type=checkbox]), select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, select:disabled { background: var(--paper); color: var(--muted); }
textarea { resize: vertical; line-height: 22px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%234A5D72' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.pw { position: relative; }
.pw input { padding-right: 48px; }
.pw-eye { position: absolute; right: 2px; top: 2px; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; border-radius: 8px; }
.pw-eye:hover { color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.span2 { grid-column: span 2; }
.form { display: grid; gap: 16px; }
.form h4, .modal h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 8px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid rgba(15, 39, 57, .3); color: transparent; flex: none; transition: background-color .15s, border-color .15s; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); color: #fff; }
.check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check input:disabled ~ span { opacity: .8; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--navy) 248px, var(--paper) 248px); }
.side { width: 248px; flex: none; background: var(--navy); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 24px 16px 24px 24px; }
.side-brand b { display: block; font-size: 16px; line-height: 22px; }
.side-brand span { font-size: 12px; opacity: .65; }
.side-close { display: none; color: #fff; margin-left: auto; }
.side-close:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-nav { display: grid; gap: 2px; padding: 0 12px; overflow-y: auto; flex: 1; align-content: start; }
.side-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 10px; color: rgba(255, 255, 255, .78); font-weight: 500; font-size: 14px; text-decoration: none; transition: background-color .15s, color .15s; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.side-foot { padding: 16px 24px 24px; display: grid; gap: 8px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-foot p { font-size: 12px; opacity: .5; }
.side-out { display: flex; align-items: center; gap: 12px; background: none; border: 0; color: rgba(255, 255, 255, .78); padding: 8px 0; min-height: 44px; font-weight: 500; font-size: 14px; }
.side-out:hover { color: #fff; }
.side-kids { display: grid; gap: 2px; font-size: 12px; opacity: .65; }
.scrim { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.strip { display: flex; align-items: center; gap: 8px; padding: 6px 16px 6px 32px; background: #FFF4D6; color: #6B4B00; font-size: 13px; line-height: 20px; border-bottom: 1px solid rgba(168, 107, 0, .15); }
.strip span { flex: 1; }
.strip .link-btn { color: #6B4B00; text-decoration: underline; font-size: 13px; }
.strip-x { width: 32px; height: 32px; color: #6B4B00; }
.top { display: flex; align-items: center; gap: 16px; padding: 16px 32px; background: rgba(250, 247, 242, .92); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); }
.top h1 { font-size: 24px; line-height: 32px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.burger { display: none; color: var(--ink); }
.top-search { position: relative; width: 280px; }
.top-search > span { position: absolute; left: 12px; top: 12px; color: var(--soft); pointer-events: none; display: flex; }
.top-search input { padding-left: 40px; background: #fff; }
.gs-drop { position: absolute; top: 52px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.gs-drop a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.gs-drop a:hover { background: var(--paper); }
.gs-drop small { display: block; color: var(--muted); font-size: 12px; line-height: 16px; }
.gs-drop b { font-size: 14px; font-weight: 600; }
.gs-none { padding: 8px; font-size: 14px; }
.chip { display: flex; align-items: center; gap: 8px; }
.chip-txt b { display: block; font-size: 14px; line-height: 18px; font-weight: 600; }
.chip-txt small { font-size: 12px; color: var(--muted); line-height: 16px; }
.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 14px; flex: none; }
.avatar.f { background: rgba(214, 90, 140, .12); color: #A3366A; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }
.avatar.warn { background: var(--amber-soft); color: var(--amber); }
.content { padding: 24px 32px 48px; display: grid; gap: 24px; align-content: start; max-width: 1360px; width: 100%; }

/* ---------- cards ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; min-width: 0; }
.card.slim { padding: 12px 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h3 { font-size: 17px; line-height: 24px; display: flex; align-items: center; gap: 4px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.kpis.inset { margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: grid; gap: 4px; color: var(--ink); text-decoration: none !important; transition: transform .2s var(--ease), box-shadow .2s; min-width: 0; }
a.kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 39, 57, .08); }
.kpi span { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi b { font-size: 26px; line-height: 34px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi small { font-size: 13px; line-height: 18px; color: var(--muted); }
.kpi small.red { color: var(--red); font-weight: 600; }
.card .kpis .kpi { box-shadow: none; background: var(--paper); border-color: transparent; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 32px 16px; color: var(--soft); text-align: center; }
.empty p { color: var(--muted); font-size: 14px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); }
.banner span { flex: 1; color: var(--ink); }
.banner.warn { background: var(--amber-soft); color: var(--amber); }
.note-box { display: flex; gap: 12px; padding: 16px; margin-top: 16px; border-radius: 12px; background: var(--paper); color: var(--accent); }
.note-box p { color: var(--muted); font-size: 14px; line-height: 22px; margin-top: 4px; }
.note-box b { color: var(--ink); }
.note-box.warn { color: var(--amber); margin-top: 0; }
.tot-row { display: flex; justify-content: space-between; padding: 12px 12px 0; margin-top: 4px; border-top: 1px solid var(--line); }
.list-meta { margin-bottom: 8px; }
.more { display: flex; justify-content: center; padding-top: 16px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; color: var(--muted); }
.back:hover { color: var(--ink); text-decoration: none; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a.on .count { background: var(--accent-soft); color: var(--accent); }
.tabs.inner { margin: 16px 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -8px; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 20px; }
.tbl th { position: sticky; top: 0; background: #fff; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; z-index: 1; }
.tbl td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background-color .12s; }
.tbl tbody tr:hover { background: rgba(250, 247, 242, .8); }
.tbl-click tbody tr { cursor: pointer; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub { display: block; font-size: 12px; color: var(--muted); line-height: 16px; }
.sub.red { color: var(--red); font-weight: 600; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * + *, .row-actions .cv > * + * { margin-left: 4px; }
.cv { min-width: 0; }
.tbl td.row-actions { display: table-cell; }
.who { display: flex; align-items: center; gap: 12px; }
.col-on { background: var(--accent-soft); }
.w-n { width: 32px; color: var(--soft); }
.g-in { width: 76px !important; min-height: 40px !important; text-align: right; padding: 8px !important; font-weight: 600; }
.g-in.bad { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.sel-sm { min-height: 36px !important; padding: 6px 32px 6px 10px !important; font-size: 14px !important; max-width: 240px; }
.tbl tfoot td { font-weight: 700; }
.fee-edit input { width: 120px; text-align: right; }

/* ---------- filters ---------- */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card.slim .filters { margin-bottom: 0; }
.filters select { width: auto; min-width: 160px; }
.search-in { position: relative; flex: 1; min-width: 220px; }
.search-in > .ic { position: absolute; left: 12px; top: 13px; color: var(--soft); }
.search-in input { padding-left: 40px; }

/* ---------- mini lists ---------- */
.mini-list { display: grid; }
.mini-list > a, .mini-list > button, .mini-list > div { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; color: var(--ink); text-decoration: none; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); min-height: 52px; width: 100%; }
.mini-list > :last-child { border-bottom: 0; }
.mini-list > a:hover, .mini-list > button:hover { background: var(--paper); }
.mini-list b { display: block; font-weight: 600; font-size: 14px; line-height: 20px; }
.mini-list small { display: block; color: var(--muted); font-size: 13px; line-height: 18px; }
.mini-list .n { width: 24px; color: var(--soft); font-size: 13px; text-align: right; flex: none; }
.mini-list .time { width: 76px; flex: none; font-weight: 700; font-size: 13px; color: var(--accent-ink); font-variant-numeric: tabular-nums; }

/* ---------- chart ---------- */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: rgba(15, 39, 57, .07); }
.chart .axis { fill: var(--soft); font-size: 12px; font-family: Manrope, sans-serif; }
.legend { display: flex; gap: 16px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg i { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }

/* ---------- sections ---------- */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.sec-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; color: var(--ink); display: grid; gap: 16px; text-decoration: none !important; transition: transform .2s var(--ease), box-shadow .2s; }
.sec-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 39, 57, .08); }
.sec-top { display: flex; align-items: center; gap: 12px; }
.sec-top b { display: block; font-size: 16px; }
.sec-top small { color: var(--muted); font-size: 13px; }
.sec-badge { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; flex: none; }
.sec-badge.lg { width: 64px; height: 64px; font-size: 20px; border-radius: 16px; }
.sec-lines { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.sec-lines div { display: flex; align-items: center; gap: 8px; }
.sec-foot { display: flex; align-items: center; justify-content: space-between; color: var(--soft); }
.hero-card { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.hero-l { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 260px; }
.hero-l h2 { font-size: 22px; line-height: 30px; }
.hero-stats { display: flex; gap: 24px; }
.hero-stats div { display: grid; }
.hero-stats span { font-size: 12px; color: var(--muted); font-weight: 600; }
.hero-stats b { font-size: 18px; font-variant-numeric: tabular-nums; }

/* ---------- info ---------- */
.info { display: grid; }
.info > div { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.info > div:last-child { border-bottom: 0; }
.info span { color: var(--muted); }
.info b { font-weight: 600; }
.info small { display: block; font-weight: 400; color: var(--muted); }
.card .card-head + .req-list, .info + .card-head { margin-top: 16px; }
.req-list { display: grid; gap: 0; }
.req-list.cols { grid-template-columns: 1fr 1fr; column-gap: 16px; }
.req-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.req-card { display: grid; gap: 12px; }
.req-top { display: flex; align-items: center; gap: 12px; }
.req-top b { display: block; color: var(--ink); }
.req-top small { color: var(--muted); font-size: 13px; }
.req-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pay-now { margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: var(--paper); }

/* fee box */
.fee-box { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; background: var(--paper); border-radius: 12px; padding: 16px; }
.lines { display: grid; }
.lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; }
.lines > div b { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.lines .tot { border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 10px; }
.lines .tot b { font-size: 16px; font-weight: 700; color: var(--accent-ink); }
.fee-sched { display: grid; gap: 2px; font-size: 13px; align-content: start; }
.fee-sched b { margin-bottom: 4px; font-size: 13px; }
.fee-sched div { display: flex; justify-content: space-between; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- attendance ---------- */
.att-controls { display: grid; grid-template-columns: minmax(200px, 280px) minmax(160px, 220px) 1fr; gap: 16px; align-items: end; }
.att-status { display: flex; justify-content: flex-end; padding-bottom: 10px; }
.att-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0 16px; }
.att-sum div { background: var(--paper); border-radius: 12px; padding: 12px 16px; display: grid; }
.att-sum span { font-size: 12px; color: var(--muted); font-weight: 600; }
.att-sum b { font-size: 22px; line-height: 30px; }
.att-bulk { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.att-list { display: grid; }
.att-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-bottom: 1px solid var(--line); }
.att-row .n { width: 24px; text-align: right; color: var(--soft); font-size: 13px; }
.att-row b { font-weight: 600; font-size: 15px; }
.seg { display: inline-flex; gap: 6px; }
.seg button { width: 48px; height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font-weight: 700; color: var(--muted); transition: background-color .12s, color .12s, border-color .12s, transform .12s var(--ease); }
.seg button:active { transform: scale(.95); }
.seg button:hover { border-color: rgba(15, 39, 57, .3); }
.seg .seg-P[aria-checked=true] { background: var(--green); border-color: var(--green); color: #fff; }
.seg .seg-L[aria-checked=true] { background: #D69614; border-color: #D69614; color: #fff; }
.seg .seg-A[aria-checked=true] { background: var(--red); border-color: var(--red); color: #fff; }
.att-save { display: flex; justify-content: flex-end; align-items: center; gap: 16px; padding-top: 16px; position: sticky; bottom: 0; background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0)); }
.today-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-s { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; text-decoration: none !important; min-height: 28px; }
.chip-s.ok { background: var(--green-soft); color: var(--green); }
.chip-s.wait { background: var(--amber-soft); color: var(--amber); }

.ga-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 16px; }
.ga-row > div { background: var(--paper); border-radius: 12px; padding: 12px 16px; display: grid; }
.ga-row span { font-size: 12px; font-weight: 600; color: var(--muted); }
.ga-row b { font-size: 18px; font-variant-numeric: tabular-nums; }
.ga-row small { font-size: 12px; color: var(--muted); }
.ga-row .hl { background: var(--accent-soft); }
.ga-row .hl b { color: var(--accent-ink); }

/* payments */
.picker { position: relative; }
.pk-list { position: absolute; left: 0; right: 0; top: 48px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 280px; overflow: auto; z-index: 5; padding: 4px; }
.pk-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; border-radius: 8px; min-height: 44px; }
.pk-list button:hover { background: var(--paper); }
.pk-list b { display: block; font-size: 14px; font-weight: 600; }
.pk-list small { color: var(--muted); font-size: 12px; }
.pay-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; background: var(--paper); border-radius: 12px; padding: 12px 16px; margin: 12px 0 16px; }
.pay-sum > div { display: grid; }
.pay-sum span { font-size: 12px; font-weight: 600; color: var(--muted); }
.pay-sum b { font-size: 15px; font-variant-numeric: tabular-nums; }
.pay-sum p { grid-column: 1 / -1; }

/* tutorial */
.sess { flex-wrap: wrap; }
.sess-act { display: flex; gap: 6px; }
.seg-tabs { display: inline-flex; background: var(--paper); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.seg-tabs button { border: 0; background: none; padding: 8px 16px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); min-height: 40px; }
.seg-tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.modal .grid2 { margin-top: 16px; }

/* announcements */
.ann { display: grid; gap: 12px; }
.ann.pinned { border-color: rgba(61, 90, 254, .3); }
.ann-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ann h3 { font-size: 17px; line-height: 24px; display: flex; gap: 6px; align-items: center; }
.ann small { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font-size: 13px; }
.ann p { color: var(--ink); font-size: 15px; line-height: 24px; }
.pin { color: var(--accent); display: inline-flex; }
.ann-mini { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.ann-mini:last-child { border-bottom: 0; }
.ann-mini b { display: flex; gap: 6px; align-items: center; }
.ann-mini p { color: var(--muted); font-size: 14px; line-height: 22px; margin-top: 4px; }

/* reports */
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dl { display: flex; gap: 16px; align-items: flex-start; padding: 16px; border-radius: 12px; background: var(--paper); }
.dl > div:first-child { color: var(--accent); padding-top: 2px; }
.dl b { display: block; }
.dl small { display: block; color: var(--muted); font-size: 13px; line-height: 20px; }
.dl-f { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.dl-f input, .dl-f select { width: auto; min-height: 40px; background-color: #fff; }
.demo-by { margin-top: 24px; font-size: 13px; color: var(--soft); }
.pw-change { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); gap: 8px; }

/* parent */
.kid-switch { display: flex; gap: 8px; flex-wrap: wrap; }
.kid-switch button { display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; text-align: left; min-height: 48px; transition: border-color .15s, background-color .15s; }
.kid-switch button.on { border-color: var(--accent); background: var(--accent-soft); }
.kid-switch b { display: block; font-size: 14px; line-height: 18px; }
.kid-switch small { color: var(--muted); font-size: 12px; line-height: 16px; }
#pp, #p-body, #pay-body, #t-body, #en-body, #an-list { display: grid; gap: 24px; min-width: 0; }
@media (max-width: 900px) { #pp, #p-body, #pay-body, #t-body, #en-body, #an-list { gap: 16px; } }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(15, 39, 57, .4); display: grid; place-items: center; padding: 24px; z-index: 100; opacity: 0; transition: opacity .2s var(--ease); }
.modal-wrap.show { opacity: 1; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 560px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.98); transition: transform .25s var(--ease); }
.modal-wrap.show .modal { transform: none; }
.modal-wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 12px; }
.modal-head h2 { font-size: 20px; line-height: 28px; }
.modal-body { padding: 8px 24px 16px; overflow-y: auto; display: grid; gap: 12px; }
.modal-body .form { gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--line); }

/* ---------- toast ---------- */
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 200; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.toast.show { opacity: 1; transform: none; }
.toast-ok .ic { color: #7DE0B5; }
.toast-warn .ic { color: #FFC857; }

/* ---------- printable docs ---------- */
.paper-doc { background: #fff; color: #0F2739; font-size: 13px; line-height: 19px; }
.modal .paper-doc { border: 1px solid var(--line); border-radius: 12px; padding: 32px; }
.paper-doc.inline { padding: 0; }
.doc-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); margin-bottom: 16px; }
.doc-head b { display: block; font-size: 16px; }
.doc-head span { font-size: 12px; color: var(--muted); }
.doc-head > div:nth-child(2) { flex: 1; }
.doc-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); text-align: right; }
.doc-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; margin-bottom: 16px; }
.doc-meta span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.doc-meta b { font-weight: 600; }
.paper-doc h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; }
.doc-tbl { width: 100%; border-collapse: collapse; }
.doc-tbl th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line-2); padding: 6px; }
.doc-tbl td { padding: 6px; border-bottom: 1px solid var(--line); }
.doc-tbl tr.tot td { font-weight: 700; border-top: 1px solid var(--ink); }
.doc-tbl tr.due td { color: var(--red); font-weight: 700; }
.att-tbl th, .att-tbl td { padding: 4px; }
.doc-note { margin-top: 12px; color: var(--muted); font-size: 12px; }
.sign { display: flex; gap: 32px; margin-top: 40px; }
.sign > div { flex: 1; text-align: center; font-size: 12px; font-weight: 600; }
.sign span { display: block; border-top: 1px solid var(--ink); margin-bottom: 4px; }
.sign small { display: block; font-weight: 400; color: var(--muted); }
#print-root { display: none; }

@media print {
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  #print-root .paper-doc { padding: 0; border: 0; }
  body { background: #fff; }
  @page { margin: 14mm; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .top-search { width: 220px; }
  .chip-txt { display: none; }
}
@media (max-width: 1020px) {
  .row-2 { grid-template-columns: 1fr; }
  .dl-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { background: var(--paper); }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .mobile-only { display: flex !important; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); width: 280px; }
  .side.open { transform: none; }
  .side-close { display: grid; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 39, 57, .4); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .burger { display: grid; margin-left: -8px; }
  .top { padding: 12px 16px; gap: 8px; flex-wrap: wrap; }
  .top h1 { font-size: 20px; line-height: 28px; }
  .top-search { order: 5; width: 100%; }
  .strip { padding: 6px 8px 6px 16px; }
  .content { padding: 16px 16px 48px; gap: 16px; }
  .card { padding: 16px; }
  .att-controls { grid-template-columns: 1fr 1fr; }
  .att-status { grid-column: 1 / -1; justify-content: flex-start; padding: 0; }
}
@media (max-width: 760px) {
  .kpis, .kpis-3 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 16px; }
  .kpi b { font-size: 20px; line-height: 28px; }
  .grid2, .grid3, .fee-box, .req-list.cols { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .filters { gap: 8px; }
  .filters select { flex: 1 1 140px; min-width: 0; }
  .search-in { min-width: 100%; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .req-grid, .sec-grid { grid-template-columns: 1fr; }
  .hero-card { gap: 16px; }
  .hero-stats { width: 100%; justify-content: space-between; }
  .hero-card .actions { width: 100%; }
  .hero-card .actions .btn { flex: 1; }
  .ga-row { grid-template-columns: 1fr 1fr; }
  .ga-row .hl { grid-column: 1 / -1; }
  .att-sum { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .att-sum div { padding: 8px; }
  .att-sum b { font-size: 18px; }
  .att-row { padding: 8px 0; gap: 8px; }
  .att-row .avatar { display: none; }
  .att-row b { font-size: 14px; line-height: 18px; }
  .seg { gap: 4px; }
  .seg button { width: 44px; }
  .info > div { grid-template-columns: 1fr; gap: 2px; }
  .pay-sum { grid-template-columns: 1fr; gap: 6px; }
  .pay-sum > div { display: flex; justify-content: space-between; }
  .doc-meta { grid-template-columns: 1fr 1fr; }
  .doc-head { flex-wrap: wrap; }
  .doc-title { width: 100%; text-align: left; }
  .paper-doc { font-size: 12px; line-height: 17px; overflow-x: auto; }
  .doc-tbl th, .doc-tbl td { padding: 5px 3px; }
  .kpis-3 > .kpi:nth-child(3) { grid-column: 1 / -1; }
  .modal .paper-doc { padding: 16px; }
  .modal-wrap { padding: 0; align-items: end; }
  .modal { max-height: 92vh; border-radius: 20px 20px 0 0; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .modal-foot .btn { flex: 1; }
  .sess-act { width: 100%; padding-left: 88px; }
  .sess-act .btn { flex: 1; }
  .tabs a { padding: 8px 12px; }
  .tbl-keep th, .tbl-keep td { padding-left: 6px; padding-right: 6px; }
  .dl { flex-wrap: wrap; }
  .dl .btn { width: 100%; }
  .card-head .actions { width: 100%; }
  .card-head .actions .btn { flex: 1; }
  .kid-switch button { flex: 1; }
  .banner { flex-wrap: wrap; }

  /* tables become stacked cards */
  .table-wrap { margin: 0; overflow: visible; }
  .tbl:not(.tbl-keep) thead { display: none; }
  .tbl:not(.tbl-keep), .tbl:not(.tbl-keep) tbody, .tbl:not(.tbl-keep) tr, .tbl:not(.tbl-keep) td { display: block; width: 100%; }
  .tbl:not(.tbl-keep) tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; background: #fff; }
  .tbl:not(.tbl-keep) td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border: 0; text-align: right; min-height: 32px; }
  .tbl:not(.tbl-keep) td > * { min-width: 0; }
  .tbl:not(.tbl-keep) td > .cv { text-align: right; }
  .tbl:not(.tbl-keep) td:first-child > .cv, .tbl:not(.tbl-keep) td.w-n + td > .cv { text-align: left; }
  .tbl:not(.tbl-keep) td::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; flex: none; max-width: 45%; }
  .tbl:not(.tbl-keep) td[data-label=""]::before { display: none; }
  .tbl:not(.tbl-keep) td:first-child { text-align: left; justify-content: flex-start; font-size: 15px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  .tbl:not(.tbl-keep) td:first-child::before { display: none; }
  .tbl:not(.tbl-keep) td.row-actions { justify-content: flex-end; padding-top: 8px; }
  .tbl:not(.tbl-keep) td.w-n { display: none; }
  .tbl:not(.tbl-keep) td.w-n + td { text-align: left; justify-content: flex-start; font-size: 15px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  .tbl:not(.tbl-keep) td.w-n + td::before { display: none; }
  .tbl:not(.tbl-keep) .sub { text-align: right; }
  .tbl:not(.tbl-keep) td:first-child .sub, .who .sub { text-align: left; }
  .col-on { background: none; }
  .fee-edit input { width: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Shared demo strip colours: identical on every EulClavie demo */
.strip { background: #FFF6E5; color: #6B4A00; border-bottom: 1px solid rgba(183, 121, 31, .22); font-size: 13px; line-height: 20px; font-weight: 500; }
.strip .ic, .strip > svg { color: #6B4A00; }
.strip .link-btn { color: #6B4A00; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; background: none; }
.strip .link-btn:hover { background: rgba(183, 121, 31, .12); }
.strip .strip-x { color: #6B4A00; text-decoration: none; background: none; }
.strip .strip-x:hover { background: rgba(183, 121, 31, .14); color: #6B4A00; }
