:root {
  --navy: #343a4b;
  --navy-2: #2a2f3e;
  --yellow: #f9dc6b;
  --yellow-2: #f3cf47;
  --ink: #1b1f6e;
  --text: #1f2433;
  --label: #3d4f6e;
  --muted: #6b7385;
  --line: #e3e6ec;
  --soft: #e9edf3;
  --bg: #f3f4f6;
  --row1: #f1f1f1; --row2: #e4e4e4;
  --green: #1e8e5a; --red: #c93c37;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
a { color: var(--label); }
h1 { font-size: 26px; font-weight: 700; color: var(--ink); margin: 2px 0 0; line-height: 1.25; }
h2 { font-size: 19px; font-weight: 600; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; font-weight: 300; }
.mt { margin-top: 16px; }
.mb0 { margin-bottom: 0 !important; }
.hidden { display: none !important; }
.inline { display: inline; margin: 0; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }

/* ===== Topbar ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy); height: 76px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; text-decoration: none; }
.logo {
  width: 52px; height: 52px; border-radius: 50%; background: var(--yellow); color: var(--ink);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: 0 0 auto;
}
.logo img { display: block; width: 70%; height: auto; }
.app-name { color: #fff; font-size: 20px; font-weight: 600; white-space: nowrap; }
.ic { flex: 0 0 auto; display: block; }

/* Desktop nav: Home · Assessments ▾ · Students · Settings */
.nav { display: flex; gap: 26px; height: 100%; align-items: stretch; }
.nav > a, .tab-toggle {
  color: #d9dce4; text-decoration: none; font: inherit; font-size: 15.5px; font-weight: 500; white-space: nowrap;
  display: flex; align-items: center; gap: 6px; background: none; padding: 0; cursor: pointer;
  border: 0; border-top: 3px solid transparent; border-bottom: 3px solid transparent;
}
.nav > a:hover, .tab-toggle:hover { color: #fff; }
.nav > a.active, .tab-group.active > .tab-toggle { color: #fff; font-weight: 600; border-bottom-color: var(--yellow); }
.tab-toggle .ic { transition: transform .15s; }
.tab-group { position: relative; display: flex; }
.tab-group.open > .tab-toggle .ic { transform: rotate(180deg); }
.dropdown {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%); min-width: 250px; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px;
  box-shadow: 0 14px 34px rgba(27, 31, 46, .18); display: none;
}
.tab-group:hover .dropdown, .tab-group.open .dropdown { display: block; }
.dropdown a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px; white-space: nowrap;
}
.dropdown a:hover { background: var(--soft); }
.dropdown a.active { background: var(--yellow); color: var(--ink); font-weight: 600; }
.dropdown .ico { width: 32px; height: 32px; border-radius: 9px; background: var(--navy); color: var(--yellow); display: grid; place-items: center; flex: 0 0 auto; }
.dropdown .sep { height: 1px; background: var(--line); margin: 6px 6px; }

/* Hamburger (mobile only) */
.hamburger {
  display: none; width: 44px; height: 44px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .2);
  background: transparent; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; flex: 0 0 auto;
}
.hamburger span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
body.nav-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .hamburger span:nth-child(2) { opacity: 0; }
body.nav-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Home ===== */
.home-hello { color: var(--muted); margin: -12px 0 22px; }
.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.home-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px;
  display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--text); min-height: 196px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.home-card:hover { border-color: var(--navy); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(27, 31, 46, .1); }
.home-card .tile { width: 46px; height: 52px; border-radius: 12px; background: var(--navy); color: var(--yellow); display: grid; place-items: center; }
.home-card .ht { font-size: 19px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.home-card .hs { color: var(--muted); font-size: 14px; line-height: 1.45; }
.home-card .hb { display: flex; gap: 6px; flex-wrap: wrap; }
.home-card .go { margin-top: auto; display: flex; align-items: center; gap: 6px; color: var(--label); font-weight: 600; font-size: 14px; }


/* ===== Main ===== */
.main { max-width: 1440px; margin: 0 auto; padding: 32px 28px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; min-width: 0; }
.page-head h1 { flex: 1 1 auto; min-width: 0; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head .back {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; border: 1px solid #d6dbe3; background: #fff;
  display: grid; place-items: center; text-decoration: none; color: var(--label); font-size: 18px; font-weight: 600;
}
.page-head .back:hover { background: var(--soft); }
.page-meta { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; }
.page-head-right { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; }
.eyebrow { font-size: 13px; text-transform: uppercase; letter-spacing: 1.8px; font-weight: 600; color: var(--muted); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; margin-bottom: 22px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.card-head .hint { color: var(--muted); font-size: 13.5px; }
.info { background: var(--soft); border-radius: 12px; padding: 14px 18px; color: var(--label); font-size: 14px; }
.info.dashed { border: 1px dashed #cdd3dd; }

.split-side { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 36px; align-items: start; }
.split-side > .sticky { position: sticky; top: 100px; }

/* ===== Forms ===== */
label, .label { display: block; color: var(--label); font-size: 14.5px; font-weight: 500; margin-bottom: 7px; }
.field { margin-bottom: 18px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=month], input[type=search], select, textarea {
  width: 100%; border: 1px solid #dadfe7; border-radius: 10px; padding: 12px 14px;
  font: inherit; font-size: 15.5px; color: var(--text); background: #fff; outline: none;
  -webkit-appearance: none; appearance: none; min-height: 48px;
}
textarea { min-height: 90px; resize: vertical; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23343a4b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}
input:focus, select:focus, textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(249, 220, 107, .55); }
.field-err { color: var(--red); font-size: 13.5px; margin-top: 6px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; padding: 11px 18px; font: inherit; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; min-height: 46px;
  background: var(--yellow); color: var(--ink);
}
.btn:hover { background: var(--yellow-2); }
.btn.dark { background: var(--navy); color: #fff; }
.btn.dark:hover { background: var(--navy-2); }
.btn.ghost { background: #fff; border-color: #d6dbe3; color: var(--label); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { background: #fff; border-color: #f0c4c1; color: var(--red); }
.btn.sm { padding: 7px 12px; font-size: 13.5px; min-height: 36px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.link { border: 0; background: none; padding: 4px 2px; color: var(--label); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--red); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.sticky-actions {
  position: sticky; bottom: 0; padding: 26px 0 16px; margin-top: 4px;
  background: linear-gradient(to bottom, rgba(243, 244, 246, 0), var(--bg) 40%);
  display: flex; justify-content: flex-end; gap: 10px; z-index: 5;
}

/* ===== Tables (invoice style) ===== */
.table-wrap { overflow-x: auto; border-radius: 12px; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  background: var(--yellow); color: var(--ink); font-weight: 600; font-size: 15px;
  padding: 13px 14px; text-align: left; white-space: nowrap; border-right: 2px solid #fff;
}
.tbl td { padding: 12px 14px; border-right: 2px solid #fff; vertical-align: middle; }
.tbl th:last-child, .tbl td:last-child { border-right: 0; }
.tbl tbody tr:nth-child(odd) td { background: var(--row1); }
.tbl tbody tr:nth-child(even) td { background: var(--row2); }
.tbl .sub { display: block; color: var(--muted); font-size: 13px; font-weight: 300; }
.tbl td.num, .tbl th.num { text-align: center; }
.rc-stamps { display: inline-flex; gap: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 6px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tbl td.num > .rc-total { display: flex; justify-content: center; }
.lit-stamp { display: inline-flex; align-items: center; gap: 4px; color: var(--green); }
.rc-total { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.rc-total .rc-x { color: var(--muted); font-size: 13px; }
.rc-total b { font-size: 16px; color: var(--ink); min-width: 14px; text-align: left; }
.rc-total.dark .rc-total.dark .rc-x { color: #c7cbd5; }
.rc-total.dark b { color: #fff; }
.rc-total.dark.hl b { color: var(--yellow); }
.tbl .sub.pct-ok { color: var(--green); font-weight: 500; }
.tbl .sub.pct-low { color: var(--red); font-weight: 500; }
.tbl tfoot td { background: var(--navy); color: #fff; font-weight: 600; }

/* ===== Summary band ===== */
.band { background: var(--navy); border-radius: var(--radius); padding: 20px 26px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.band6 { grid-template-columns: repeat(6, 1fr); }
.band .k { color: #c7cbd5; font-size: 13px; }
.band .v { color: #fff; font-size: 28px; font-weight: 600; line-height: 1.2; }
.band .v.hl { color: var(--yellow); }
.band .v.alert { color: #ff9b94; }

/* ===== Badges & chips ===== */
.badge { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge.green { background: #dff3e8; color: var(--green); }
.badge.red { background: #fbe1df; color: var(--red); }
.badge.yellow { background: var(--yellow); color: var(--ink); }
.badge.gray { background: #d9dde5; color: #4b5366; }
.badge.navy { background: var(--navy); color: #fff; }
.badge.outline { border: 1px solid #d6dbe3; color: var(--label); }
.count-pill { background: var(--navy); color: #fff; border-radius: 999px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; }
.group-h { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; font-size: 17px; font-weight: 600; }
.group-h .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--yellow); }
.group-h .dot.green { background: var(--green); }
.group-h .dot.gray { background: #b8bfcc; }

/* ===== Toggle ===== */
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.check-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; margin: 0;
}
.check-item .nm { font-weight: 600; color: var(--text); font-size: 15px; }
.check-item .fn { font-weight: 300; font-size: 12.5px; color: var(--muted); }
.switch { position: relative; width: 44px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #cfd5df; border-radius: 999px; transition: .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + span { background: var(--navy); }
.switch input:checked + span::after { left: 23px; background: var(--yellow); }
.check-item:has(input:checked) { border-color: var(--navy); }

/* ===== Session tap screen ===== */
.tap-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.tap-tools input[type=search] { flex: 1; }
.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kid {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 14px 12px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  min-height: 86px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  -webkit-tap-highlight-color: transparent; transition: transform .08s, box-shadow .15s;
  width: 100%;
}
.kid:active { transform: scale(.97); }
.kid .nick { font-size: 18px; font-weight: 600; line-height: 1.2; word-break: break-word; }
.kid .full { font-size: 12.5px; font-weight: 300; color: var(--muted); line-height: 1.3; }
.kid .state { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kid .time { font-size: 13px; font-weight: 600; color: var(--label); }
.kid.st-ontime, .kid.st-yes, .kid.st-present { border: 2px solid var(--green); background: #f4fbf7; }
.kid.st-late, .kid.st-no { border: 2px solid var(--red); background: #fdf5f4; }
.kid.busy { opacity: .55; pointer-events: none; }
.kid .food-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.kid .food-btns .btn { min-height: 40px; padding: 6px 4px; font-size: 13.5px; }
.kid.st-yes .food-btns, .kid.st-no .food-btns { display: none; }
div.kid { cursor: default; }
div.kid.st-yes, div.kid.st-no { cursor: pointer; }
.empty-list { color: var(--muted); font-size: 14px; padding: 8px 2px; }

/* Bottom sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(27, 31, 46, .45); z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg[hidden] { display: none; }
.sheet { background: #fff; width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; padding: 22px 22px calc(22px + env(safe-area-inset-bottom)); animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-title { font-size: 20px; font-weight: 600; color: var(--ink); }
.sheet-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
.sheet .actions { justify-content: stretch; }
.sheet .actions .btn { flex: 1; }
.seg { display: flex; background: var(--soft); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 18px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 10px 8px; font: inherit; font-weight: 500; color: var(--label); cursor: pointer; }
.seg button.on { background: var(--navy); color: #fff; }

/* ===== Live clock (Coming on Time) ===== */
.live-clock {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #fff; border: 1px solid var(--line); border-left: 6px solid #b8bfcc; border-radius: var(--radius);
  padding: 16px 22px; margin-bottom: 16px; transition: border-color .3s;
}
.live-clock.is-ontime { border-left-color: var(--green); }
.live-clock.is-late { border-left-color: var(--red); }
.lc-time { font-size: 44px; font-weight: 700; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.lc-info { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; min-width: 0; }
.lc-badge { font-size: 14px; padding: 5px 14px; }
.lc-note { color: var(--muted); font-size: 13.5px; }
.live-clock.compact { padding: 10px 14px; margin: 14px 0 0; border-radius: 12px; border-left-width: 4px; background: var(--bg); }
.live-clock.compact .lc-time { font-size: 24px; }
.live-clock.compact .lc-badge { font-size: 12.5px; padding: 3px 10px; }
.live-clock.compact .lc-note { font-size: 12px; }

/* ===== Stamp marker (same size for every state) ===== */
.sticon { display: inline-grid; place-items: center; flex: none; line-height: 0; vertical-align: middle; }
.sticon-got { color: var(--green); }
.sticon-got svg { transform: rotate(-12deg); }
.sticon-none { color: #c3c9d4; }
.sticon-pending { color: #a9b0bd; }
.rc-total.dark .sticon-got { color: var(--yellow); }
.tbl td.num > .sticon, .tbl td.num > .rc-stamps { display: flex; width: max-content; margin: 0 auto; }
.pp-box .bd > .sticon { margin: 2px 0; }

/* ===== Session list ===== */
.sess-list { display: grid; gap: 10px; }
.sess {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; text-decoration: none; color: var(--text);
}
.sess:hover { border-color: var(--navy); }
.sess .d { font-weight: 600; }
.sess .meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.month-group { margin-bottom: 10px; }
.month-group > summary {
  list-style: none; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px;
}
.month-group > summary::-webkit-details-marker { display: none; }
.month-group > summary:hover { border-color: var(--navy); }
.month-group[open] > summary { background: var(--navy); border-color: var(--navy); }
.month-group[open] > summary .mg-title { color: #fff; }
.month-group[open] > summary .ic { color: var(--yellow); transform: rotate(180deg); }
.month-group[open] > summary .small.muted { color: #c7cbd5; }
.month-group[open] > summary .count-pill { background: var(--yellow); color: var(--ink); }
.mg-title { font-weight: 600; font-size: 16px; color: var(--ink); }
.mg-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.mg-meta .ic { color: var(--muted); transition: transform .15s; }
.month-group > .sess-list, .month-group > .table-wrap { margin-top: 10px; }
.month-h { margin: 20px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 1.6px; font-weight: 600; color: var(--muted); }

/* ===== Passport ===== */
.passport { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin-bottom: 22px; }
.passport-title { text-align: center; font-size: 26px; letter-spacing: 14px; font-weight: 700; margin: 4px 0 6px; color: var(--ink); padding-left: 14px; }
.passport-title span:nth-child(odd) { color: #d9a43a; }
.pp-cat { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 18px; align-items: center; padding: 22px 0; border-top: 1px dashed #d6dbe3; }
.pp-cat:first-of-type { border-top: 0; }
.pp-label { font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: 1px; font-size: 14px; }
.pp-label .rule { display: block; font-weight: 300; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: 12px; margin-top: 4px; }
.pp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0 1px 1px 0; max-width: 640px; }
.pp-box { border: 1px solid var(--navy); display: flex; flex-direction: column; margin: 0 -1px -1px 0; min-width: 0; }
.pp-points { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.pp-box .mh { background: var(--yellow); color: var(--ink); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; text-align: center; height: 24px; line-height: 24px; white-space: nowrap; overflow: hidden; }
.pp-box .bd { height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 4px; text-align: center; overflow: hidden; }
.pp-box .info-l { font-size: 12px; color: var(--muted); line-height: 1.3; white-space: nowrap; }
.pp-box .sub-l { font-size: 11px; }
.pp-box.future .bd { background: #fafbfc; }
.pp-pickers { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.pp-pickers > div { flex: 1; min-width: 160px; max-width: 360px; }
.pp-legend { justify-content: center; margin: 12px 0 4px; font-size: 12.5px; color: var(--muted); }
.stamps { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.pp-box.current { background: #fffbea; }
.cell-pending { color: var(--muted); font-size: 12.5px; font-weight: 500; }

/* ===== PDF sheet (Save as PDF on the passport page) =====
   May use several A4 pages (14mm margins); boxes and stamps keep the same size as on screen.
   A4 (210mm) minus 2 x 14mm margins ≈ 688px; the sheet is 664px so nothing can be cut off on the right
   (Windows display scaling / browser zoom can change the render width slightly). The layout below is forced to the wide version
   with selectors that beat the mobile media queries, so a PDF saved from a phone looks the same. */
.pdf-sheet { width: 664px; box-sizing: border-box; background: #fff; color: var(--text); font-family: 'Lexend', system-ui, sans-serif; }
.pdf-sheet .pdf-head { display: flex; align-items: center; gap: 14px; padding: 0 0 14px; margin-bottom: 16px; border-bottom: 2px solid var(--yellow); }
.pdf-sheet .pdf-head .logo { width: 44px; height: 44px; font-size: 11.5px; }
.pdf-sheet .pdf-app { font-size: 12px; text-transform: uppercase; letter-spacing: 1.6px; font-weight: 600; color: var(--muted); }
.pdf-sheet .pdf-name { font-size: 20px; font-weight: 700; color: var(--ink); }
.pdf-sheet .pdf-head-text { min-width: 0; }
.pdf-sheet .pdf-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pdf-sheet .band.band6 { grid-template-columns: repeat(6, 1fr); gap: 10px; padding: 14px 16px; margin-bottom: 16px; border-radius: 12px; }
.pdf-sheet .band .k { font-size: 10.5px; line-height: 1.3; }
.pdf-sheet .band .v { font-size: 22px; }
.pdf-sheet .passport { border: 1px solid var(--line); margin: 0; padding: 14px 20px; border-radius: 12px; }
.pdf-sheet .passport-title { font-size: 22px; letter-spacing: 12px; padding-left: 12px; }
.pdf-sheet .pp-cat { grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 14px 0; break-inside: avoid; }
.pdf-sheet .pp-legend { display: flex; }
.pdf-sheet .pp-box .bd { height: 84px; }

/* ===== Empty / misc ===== */
.card.empty { text-align: center; padding: 40px 26px; }
.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.login-wrap { min-height: calc(100vh - 76px - 92px); display: grid; place-items: center; }
.login-card { width: 100%; max-width: 420px; }
.menu-list { display: grid; gap: 10px; }
.menu-list a, .menu-list button {
  display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px; text-decoration: none; color: var(--text); font: inherit; font-weight: 500; width: 100%; cursor: pointer; text-align: left;
}
.menu-list a::after { content: '›'; color: var(--muted); font-size: 22px; line-height: 1; }

/* ===== Toast & modal ===== */
.toast-init { display: none; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--navy); color: #fff; border-radius: 12px; padding: 12px 18px; font-size: 14.5px; z-index: 200;
  transition: .2s; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.toast b { color: var(--yellow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); }
.toast.err b { color: #fff; }
.modal-bg { position: fixed; inset: 0; background: rgba(27, 31, 46, .45); z-index: 150; display: grid; place-items: center; padding: 20px; }
.modal-bg[hidden] { display: none; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 400px; }
.modal-title { font-size: 19px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.modal-text { color: var(--muted); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ===== Responsive ===== */
@media (max-width: 1180px) {
  .nav { gap: 20px; }
}
@media (max-width: 1080px) {
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-side { grid-template-columns: minmax(0, 1fr); }
  .split-side > .sticky { position: static; }
  .band { grid-template-columns: repeat(2, 1fr); }
  .band6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .topbar { position: relative; height: 64px; padding: 0 16px; gap: 12px; }
  .brand { gap: 10px; }
  .logo { width: 40px; height: 40px; font-size: 11px; }
  .app-name { font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
  .hamburger { display: flex; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0; z-index: 80; height: auto;
    flex-direction: column; gap: 2px; background: var(--navy); padding: 8px 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 18px 30px rgba(27, 31, 46, .35);
    max-height: calc(100vh - 64px); overflow-y: auto;
  }
  body.nav-open .nav { display: flex; }
  .nav > a { height: 48px; padding: 0 12px; border: 0; border-radius: 10px; font-size: 16px; }
  .nav > a.active { background: rgba(255, 255, 255, .08); box-shadow: inset 3px 0 0 var(--yellow); }
  .tab-group { flex-direction: column; }
  .tab-toggle, .tab-group.active > .tab-toggle {
    height: 34px; padding: 10px 12px 0; border: 0; cursor: default; color: #8f96a8; font-weight: 600;
    font-size: 12px; text-transform: uppercase; letter-spacing: 1.6px;
  }
  .tab-toggle .ic { display: none; }
  .dropdown, .tab-group:hover .dropdown {
    display: block; position: static; transform: none; min-width: 0; background: transparent;
    border: 0; box-shadow: none; padding: 4px 0 6px;
  }
  .dropdown a { color: #d9dce4; padding: 8px 12px; font-size: 16px; }
  .dropdown a:hover { background: rgba(255, 255, 255, .06); }
  .dropdown a.active { background: var(--yellow); color: var(--ink); }
  .dropdown .ico { width: 30px; height: 30px; background: rgba(255, 255, 255, .08); }
  .dropdown a.active .ico { background: var(--navy); }
  .dropdown .sep { background: rgba(255, 255, 255, .1); }
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .home-card { padding: 16px 14px 14px; min-height: 172px; gap: 10px; }
  .home-card .tile { width: 40px; height: 44px; }
  .home-card .ht { font-size: 16px; }
  .home-card .hs { font-size: 13px; }
      .main { padding: 20px 14px 60px; }
  h1 { font-size: 20px; }
  .page-head { gap: 10px; margin-bottom: 18px; }
  .page-head .back { width: 36px; height: 36px; }
  .card { padding: 20px 18px; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .band { padding: 16px 18px; gap: 12px; }
  .band .v { font-size: 24px; }
  .band6 .k { font-size: 12px; line-height: 1.3; }
  .kid-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .live-clock { padding: 14px 16px; gap: 10px; }
  .lc-time { font-size: 36px; }
  .kid .nick { font-size: 17px; }
  .pp-cat { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .passport { padding: 18px 14px; }
  .passport-title { font-size: 20px; letter-spacing: 8px; padding-left: 8px; }
  .tbl th, .tbl td { padding: 10px 10px; font-size: 14px; }
}

/* ===== Print ===== */
@media print {
  .topbar, .no-print, .toast { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; max-width: none; }
  .passport { border: 0; padding: 0; }
  .pp-cat { break-inside: avoid; }
  .pp-box .mh { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
