/* ZRP Academy Registry — self-contained styles (no external fonts or CDNs) */
:root {
  --navy: #13294b; --navy-2: #1d3a66; --gold: #c9a227; --gold-soft: #f6efd6;
  --ink: #1b2330; --muted: #5b6575; --line: #dde2ea; --bg: #f4f6f9; --card: #fff;
  --ok: #1f7a4d; --ok-bg: #e3f4ea; --err: #a32020; --err-bg: #fbe5e5; --warn: #8a5a00; --warn-bg: #fff3d6;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.45; }
a { color: var(--navy-2); }
a:hover { color: var(--navy); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* header */
.topbar { background: var(--navy); color: #fff; border-bottom: 4px solid var(--gold); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand img { height: 52px; width: auto; }
.brand b { display: block; font-size: 1.05rem; letter-spacing: .02em; }
.brand span { display: block; font-size: .8rem; opacity: .8; }
.topnav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.topnav a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 6px; font-size: .92rem; }
.topnav a:hover, .topnav a.on { background: rgba(255,255,255,.12); }
.topnav .btn-login { background: var(--gold); color: var(--navy); font-weight: 600; }
.topnav form { display: inline; }
.topnav button.linklike { background: none; border: 0; color: #fff; padding: 8px 12px; font: inherit; cursor: pointer; border-radius: 6px; }
.topnav button.linklike:hover { background: rgba(255,255,255,.12); }

/* app shell */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 76px); }
.side { background: #fff; border-right: 1px solid var(--line); padding: 16px 10px; }
.side h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 10px 6px; }
.side a { display: block; padding: 7px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: .93rem; }
.side a:hover { background: var(--bg); }
.side a.on { background: var(--gold-soft); color: var(--navy); font-weight: 600; }
.main { padding: 22px 26px 60px; min-width: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.card-h a { font-size: .85rem; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.7rem; color: var(--navy); }
.stat span { color: var(--muted); font-size: .85rem; }

/* home */
.hero { background: linear-gradient(180deg, var(--navy-2), var(--navy)); color: #fff; padding: 22px 0 26px; }
.hero h1 { font-size: 1.5rem; margin-bottom: 4px; }
.hero .today { opacity: .85; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.hero .chip { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); padding: 6px 12px; border-radius: 999px; font-size: .88rem; }
.hero .chip b { color: var(--gold); }
.home { margin-top: -10px; }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); display: block; }
.tile:hover { border-color: var(--gold); }
.tile b { display: block; color: var(--navy); }
.tile span { font-size: .82rem; color: var(--muted); }
.tile i { display: block; font-style: normal; font-size: 1.4rem; margin-bottom: 4px; }

.notice { border-left: 4px solid var(--line); padding: 8px 12px; margin-bottom: 10px; background: #fafbfc; border-radius: 0 8px 8px 0; }
.notice.important { border-color: var(--gold); background: var(--gold-soft); }
.notice.urgent { border-color: var(--err); background: var(--err-bg); }
.notice b { display: block; }
.notice small { display: block; margin-top: 2px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.list li:last-child { border-bottom: 0; }
.list .when { min-width: 92px; font-weight: 600; color: var(--navy); font-size: .88rem; }

/* calendar */
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal th { font-size: .75rem; color: var(--muted); text-transform: uppercase; padding: 4px; }
.cal td { border: 1px solid var(--line); vertical-align: top; height: 64px; padding: 3px 4px; font-size: .78rem; background: #fff; }
.cal.big td { height: 104px; }
.cal td.blank { background: #f8f9fb; }
.cal td.today { outline: 2px solid var(--gold); outline-offset: -2px; background: var(--gold-soft); }
.cal .d { font-weight: 600; color: var(--muted); }
.ev { display: block; border-radius: 4px; padding: 1px 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #e8eef8; color: var(--navy); }
.ev.exam { background: #fbe1e1; color: #8a1c1c; } .ev.deadline { background: #fff1cc; color: #7a5200; }
.ev.board { background: #e6e0f8; color: #4b2f8f; } .ev.holiday { background: #e3f4ea; color: #1f6b44; }
.ev.parade { background: #f6efd6; color: #6b5310; } .ev.intake { background: #dff3f6; color: #145a66; }
.cal-nav { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 8px; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; font-size: .8rem; }

/* tables */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th, table.t td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.t th { background: #f7f8fa; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); position: sticky; top: 0; z-index: 1; }
table.t tr:hover td { background: #fbfcfe; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t.compact th, table.t.compact td { padding: 4px 6px; font-size: .82rem; }
table.t td.c, table.t th.c { text-align: center; }
.sticky-col { position: sticky; left: 0; background: #fff; z-index: 2; }

/* grades & statuses */
.g { display: inline-block; min-width: 24px; text-align: center; border-radius: 4px; padding: 1px 6px; font-weight: 700; font-size: .82rem; }
.g-d { background: #d9f2e3; color: #13603a; } .g-m { background: #e3eefb; color: #1d4f8f; }
.g-c { background: #fff5cc; color: #7a5a00; } .g-p { background: #eef0f3; color: #3b4452; } .g-f { background: #fbe1e1; color: #a32020; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.st-draft { background: #eef0f3; color: #3b4452; } .st-sub { background: #fff1cc; color: #7a5200; }
.st-app { background: #e3eefb; color: #1d4f8f; } .st-mod { background: #e6e0f8; color: #4b2f8f; } .st-lock { background: #d9f2e3; color: #13603a; }
.q-ok { color: var(--ok); font-weight: 600; } .q-fail { color: var(--err); font-weight: 600; }
.bar { height: 8px; background: #e9edf3; border-radius: 6px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--gold); }
.bar.navy > i { background: var(--navy-2); }
.stack { display: flex; height: 14px; border-radius: 4px; overflow: hidden; min-width: 140px; background: #eef0f3; }
.stack i { display: block; height: 100%; }
.stack .D { background: #3aa66b; } .stack .M { background: #4a86d4; } .stack .C { background: #e2b93b; } .stack .P { background: #a7afbb; } .stack .F { background: #d64545; }

/* forms */
label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.field small { display: block; font-weight: 400; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #c7cfdb; border-radius: 6px; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input, .inline select { width: auto; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: auto; }
.btn, button.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--navy); color: #fff; border: 1px solid var(--navy); padding: 8px 14px; border-radius: 6px; font: inherit; font-weight: 600; font-size: .9rem; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--navy-2); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.ghost { background: #fff; color: var(--navy); border-color: #c7cfdb; }
.btn.ghost:hover { background: var(--bg); color: var(--navy); }
.btn.danger { background: #fff; color: var(--err); border-color: #e6b3b3; }
.btn.sm { padding: 4px 10px; font-size: .82rem; }
form.inline-form { display: inline; }

/* marks grid */
.mk { width: 64px !important; padding: 4px 6px !important; text-align: right; font-variant-numeric: tabular-nums; }
.mk.saving { background: #fff8e1; } .mk.saved { background: #e6f6ec; } .mk.bad { background: #fde8e8; border-color: var(--err); }
.ro { color: var(--muted); }

/* flash */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cd; }
.flash.err { background: var(--err-bg); color: var(--err); border-color: #f0c2c2; }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: #f0dca6; }

.pager { display: flex; gap: 6px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.pager a, .pager span { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; background: #fff; font-size: .85rem; }
.pager span.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; padding-left: 34px; position: relative; margin-bottom: 10px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: .8rem; display: grid; place-items: center; }
.footer { color: var(--muted); font-size: .8rem; text-align: center; padding: 26px 0; }
details summary { cursor: pointer; font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: .86rem; }
.timeline li { padding: 6px 0 6px 14px; border-left: 2px solid var(--line); }

/* login */
.login { max-width: 400px; margin: 48px auto; }
.login .card { padding: 28px; }
.login img { display: block; height: 90px; margin: 0 auto 10px; }

/* kiosk */
body.kiosk { background: var(--navy); color: #fff; font-size: 20px; }
.kiosk .k-head { display: flex; align-items: center; gap: 18px; padding: 16px 28px; border-bottom: 4px solid var(--gold); }
.kiosk .k-head img { height: 72px; }
.kiosk .k-clock { margin-left: auto; text-align: right; font-size: 1.6rem; font-weight: 700; }
.kiosk .k-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; padding: 22px 28px; }
.kiosk .k-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.15); border-radius: 14px; padding: 18px 22px; }
.kiosk h2 { color: var(--gold); font-size: 1.3rem; }
.kiosk .notice { background: rgba(255,255,255,.08); color: #fff; }
.kiosk .notice.urgent { background: rgba(214,69,69,.3); }
.kiosk .list li { border-color: rgba(255,255,255,.15); }
.kiosk .list .when { color: var(--gold); }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: flex; flex-wrap: wrap; gap: 2px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side h4 { display: none; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar .wrap { flex-wrap: wrap; padding-bottom: 8px; }
}
@media print {
  .topbar, .side, .noprint, .pager, .footer, .actions, .flash { display: none !important; }
  .shell { display: block; } .main { padding: 0; }
  body { background: #fff; font-size: 11pt; }
  .card { box-shadow: none; border: 0; padding: 0; }
  table.t th { position: static; }
}
