/* 星斗 · 全局样式（移动优先，桌面侧栏 / 手机底部导航） */

:root {
  --paper: #F7F4EC; --card: #FFFFFF; --sidebar: #FFFFFF;
  --ink: #16283D; --ink2: #33465C; --muted: #5A6470; --faint: #8A918C;
  --line: #E4DFD3; --line2: #EFEBE1;
  --accent: #B5413A; --accent-soft: #FBEFEC;
  --gold: #B08D45; --gold-soft: #F8F2E4;
  --blue: #2C5F86; --blue-soft: #EDF3F8;
  --green: #3F7358; --green-soft: #EDF5EF;
  --shadow: 0 2px 16px rgba(22, 40, 61, .06);
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
[data-theme="dark"] {
  --paper: #101C2B; --card: #182A3E; --sidebar: #152437;
  --ink: #F1EDE3; --ink2: #D8D2C4; --muted: #A3ADB5; --faint: #7C8892;
  --line: #2C3F55; --line2: #24374B;
  --accent: #D9705F; --accent-soft: #3A2530;
  --gold: #C9A961; --gold-soft: #25344A;
  --blue: #7FB2DA; --blue-soft: #1D3448;
  --green: #7FC4A0; --green-soft: #1B3A2D;
  --shadow: 0 2px 16px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
h1, h2, h3, h4 { margin: 0 0 10px; font-weight: 600; }
h3 { font-size: 16px; }
h4 { font-size: 13.5px; color: var(--ink2); }
p { margin: 8px 0; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 238px; flex: 0 0 238px; position: sticky; top: 0; height: 100vh; background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 24px 20px 18px; border-bottom: 1px solid var(--line); }
.brand img { width: 42px; height: 42px; flex: 0 0 42px; }
.brand-txt b { display: block; font-family: var(--serif); font-size: 22px; letter-spacing: .12em; line-height: 1.2; }
.brand-txt small { color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.sidebar-nav { padding: 14px 10px; flex: 1; overflow-y: auto; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 3px; background: none; border: 0; border-radius: 9px; text-align: left; font-size: 14px; color: var(--ink2); }
.nav-item:hover { background: var(--line2); }
.nav-item.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.nav-icon { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; font-family: var(--serif); font-size: 13px; }
.nav-item.active .nav-icon { border-color: var(--blue); }
.sidebar-foot { padding: 16px 20px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint); line-height: 1.6; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 62px; flex: 0 0 62px; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 20; }
#menuBtn { display: none; width: 38px; height: 38px; border: 1px solid var(--line); background: var(--card); border-radius: 9px; font-size: 17px; }
.topbar-title { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: .06em; }
.topbar-spacer { flex: 1; }
.topbar-meta { font-size: 12px; color: var(--muted); }
.view { width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 24px 60px; }
.disclaimer { margin: 22px 0 0; padding: 12px 16px; background: var(--gold-soft); border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; font-size: 12.5px; color: var(--muted); }
.tabbar { display: none; }
.drawer-mask { position: fixed; inset: 0; background: rgba(10, 20, 32, .4); z-index: 25; }

/* ---------- 卡片与网格 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line2); }
.card-hd h3 { margin: 0; }
.card-bd { padding: 18px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid .card { margin-bottom: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line2); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv-k { color: var(--muted); flex: 0 0 auto; }
.kv-v { text-align: right; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

/* ---------- 按钮与表单 ---------- */
.btn { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 13.5px; transition: .15s; }
.btn:hover { border-color: var(--gold); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
[data-theme="dark"] .btn-primary { background: var(--gold); color: #101C2B; border-color: var(--gold); }
.btn-primary:hover { opacity: .88; }
.btn-ghost { background: transparent; }
.btn-mini { padding: 5px 11px; font-size: 12px; }
.btn-danger { color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 14px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); outline: none; }
.field input:focus, .field select:focus { border-color: var(--gold); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.tag { display: inline-block; padding: 2px 9px; margin: 2px 4px 2px 0; border-radius: 20px; background: var(--line2); color: var(--ink2); font-size: 11.5px; line-height: 1.6; white-space: nowrap; }
.tag-good { background: var(--green-soft); color: var(--green); }
.tag-warn { background: var(--accent-soft); color: var(--accent); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line2); text-align: left; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 12px; }
.tbl tr:last-child td { border-bottom: 0; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); }

/* ---------- 首页 ---------- */
.hero { display: flex; gap: 20px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.hero-main { flex: 1; min-width: 0; }
.hero-date { font-family: var(--serif); font-size: 27px; letter-spacing: .04em; }
.hero-lunar { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.hero-chips { margin: 12px 0 4px; }
.hero-moon { flex: 0 0 130px; text-align: center; }
.moon-cap { display: grid; gap: 1px; font-size: 11.5px; color: var(--muted); }
.moon-cap b { color: var(--ink); font-size: 13px; }
.report-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--gold-soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; }
.report-cta b { font-family: var(--serif); font-size: 16px; }
.report-cta p { margin: 2px 0 0; }
.weather-main { display: flex; align-items: center; gap: 20px; }
.weather-temp { font-family: var(--serif); font-size: 44px; line-height: 1; }
.weather-text { font-size: 17px; font-weight: 600; }
.forecast { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 8px; }
.forecast-item { flex: 1; min-width: 90px; background: var(--line2); border-radius: 8px; padding: 8px 10px; font-size: 12px; display: flex; justify-content: space-between; gap: 6px; }
.source-note { font-size: 11.5px; color: var(--faint); border-top: 1px dashed var(--line2); padding-top: 9px; line-height: 1.6; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick { display: flex; align-items: center; gap: 11px; text-align: left; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.quick:hover { border-color: var(--gold); background: var(--gold-soft); }
.quick-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-family: var(--serif); font-size: 16px; }
.quick b { display: block; font-size: 13.5px; }
.quick small { color: var(--muted); font-size: 11px; }
.planet-row { margin: 10px 0; }

/* ---------- 起卦 ---------- */
.cast-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cast-hex { text-align: center; padding: 12px; border: 1px solid var(--line2); border-radius: 10px; }
.hex-label { font-size: 12px; color: var(--muted); }
.hex-name { font-family: var(--serif); font-size: 19px; margin-top: 6px; }
.classic { background: var(--gold-soft); border-radius: 10px; padding: 12px 16px; margin: 16px 0; font-family: var(--serif); }
.classic p { margin: 4px 0; }
.derived { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; }
.manual-yao { display: grid; gap: 6px; background: var(--line2); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.yao-row { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.yao-row > span:first-child { width: 42px; font-family: var(--serif); }
.yao-row label { display: flex; align-items: center; gap: 4px; }

/* ---------- 择日 / 合参 / 方位 / 面相 ---------- */
.day-item { border: 1px solid var(--line2); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.day-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.day-tags { margin: 6px 0; }
.reasons { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); }
.reasons li { margin: 2px 0; }
.tendency { display: flex; align-items: baseline; gap: 12px; background: var(--blue-soft); border-radius: 9px; padding: 10px 14px; margin-bottom: 12px; }
.tendency b { font-family: var(--serif); font-size: 19px; color: var(--blue); }
.tendency span { font-size: 13px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.compass-wrap { display: flex; justify-content: center; }
.face-group { margin-bottom: 16px; }
.face-group h4 { border-bottom: 1px solid var(--line2); padding-bottom: 6px; }
.face-item { margin-bottom: 10px; }
.face-q { font-size: 13.5px; margin-bottom: 5px; }
.face-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 12px; border: 1px solid var(--line); background: var(--card); border-radius: 20px; font-size: 12.5px; }
.chip:hover { border-color: var(--gold); }
.chip-on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }

/* ---------- 档案 / 设置 ---------- */
.archive-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.archive-item:last-child { border-bottom: 0; }
.archive-item .row-actions { margin: 0; }
.sync-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.about-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.about-brand p { margin: 0; }
.about-brand ul { padding-left: 20px; }

/* ---------- 弹窗 / 提示 ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(10, 20, 32, .5); }
.modal-box { position: relative; width: min(620px, calc(100vw - 32px)); max-height: 82vh; overflow-y: auto; background: var(--card); border-radius: 14px; padding: 22px 24px; box-shadow: 0 18px 60px rgba(0, 0, 0, .28); }
.modal-close { position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; border: 0; background: var(--line2); border-radius: 50%; font-size: 16px; }
.copy-area { width: 100%; height: 280px; margin-top: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 12.5px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 80; background: var(--ink); color: var(--paper); padding: 10px 20px; border-radius: 24px; font-size: 13.5px; box-shadow: 0 6px 24px rgba(0, 0, 0, .2); max-width: min(90vw, 520px); text-align: center; }
.toast[hidden] { display: none; }
.toast-warn { background: var(--accent); color: #fff; }

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 30px rgba(0, 0, 0, .18); }
  .sidebar.open { transform: translateX(0); }
  #menuBtn { display: block; }
  .topbar { padding: 0 16px; }
  .topbar-meta { display: none; }
  .view { padding: 16px 16px 100px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 28; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tab { flex: 1; background: none; border: 0; display: grid; justify-items: center; gap: 1px; color: var(--muted); font-size: 17px; }
  .tab small { font-size: 10.5px; }
  .tab.active { color: var(--blue); }
  .toast { bottom: 84px; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .hero { flex-direction: column; align-items: stretch; padding: 18px; }
  .hero-moon { display: flex; align-items: center; justify-content: center; gap: 14px; }
  .hero-date { font-size: 23px; }
  .g2, .g3, .form-grid, .kv-grid, .cast-grid, .quick-grid { grid-template-columns: 1fr; }
  .report-cta { flex-direction: column; align-items: stretch; }
  .card-hd { flex-wrap: wrap; }
  .weather-temp { font-size: 36px; }
  .tbl { display: block; overflow-x: auto; }
  .archive-item { flex-direction: column; align-items: flex-start; }
  .modal-box { padding: 18px 16px; }
}

/* ---------- v0.3 登录注册 / 个人中心 / 后台 ---------- */
.nav-group { margin-bottom: 16px; }
.nav-group-title { font-size: 11px; letter-spacing: .14em; color: var(--faint); padding: 4px 14px 8px; }
body[data-auth-page="1"] .sidebar,
body[data-auth-page="1"] .tabbar,
body[data-auth-page="1"] .topbar { display: none !important; }
body[data-auth-page="1"] .view { max-width: none; padding: 0; }
body[data-auth-page="1"] .main { min-height: 100vh; }

/* 管理后台模式：蓝色调 + 顶栏底线，与用户端（纸色底）在视觉上明确区分，强化角色边界 */
body[data-mode="admin"] .topbar { background: var(--blue-soft); box-shadow: inset 0 -2px 0 var(--blue); }
body[data-mode="admin"] .topbar-title { color: var(--blue); }
body[data-mode="admin"] .nav-group-title { color: var(--blue); }
body[data-mode="admin"] .sidebar-foot { color: var(--blue); }

.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px 24px; }
.auth-card { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 28px 28px 24px; }
.auth-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line2); margin-bottom: 18px; }
.auth-brand b { font-family: var(--serif); font-size: 22px; letter-spacing: .12em; display: block; }
.auth-brand small { color: var(--muted); font-size: 11px; letter-spacing: .06em; }
.auth-card h2 { font-family: var(--serif); font-size: 24px; margin: 0 0 2px; }
.auth-card > p.muted { margin: 0 0 18px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 6px; padding: 10px 16px; }
.auth-alert { background: var(--accent-soft); color: var(--accent); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; }
.notice-ok { background: var(--green-soft); color: var(--green); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin: 14px 0 4px; }
.link-btn { background: none; border: 0; color: var(--blue); padding: 0 2px; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }
.auth-or { text-align: center; position: relative; margin: 14px 0 10px; color: var(--faint); font-size: 12px; }
.auth-or:before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line2); }
.auth-or span { position: relative; background: var(--card); padding: 0 10px; }
.agree-row { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--muted); margin: 6px 0 12px; }
.agree-row input { margin-top: 4px; }
.pw-hint { display: block; margin-top: 4px; font-size: 11.5px; color: var(--green); }
.pw-weak { color: var(--accent); }
.auth-legal { width: min(440px, 100%); text-align: center; margin-top: 20px; }
.auth-legal-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px; }
.legal-link { background: none; border: 0; color: var(--blue); font-size: 12.5px; padding: 3px 6px; }
.legal-link:hover { text-decoration: underline; }
.legal-sep { color: var(--faint); font-size: 12px; }
.auth-legal-note { font-size: 11px; color: var(--faint); margin: 4px 0; line-height: 1.6; }
.auth-inline-links { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 10px; border-top: 1px dashed var(--line2); padding-top: 8px; }
.legal-doc h4 { margin: 16px 0 4px; }
.legal-doc p { font-size: 13px; line-height: 1.8; }
.callout.gold { border-left: 3px solid var(--gold); background: var(--gold-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; }
.gate-page { display: grid; place-items: center; min-height: 60vh; }
.gate-card { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 32px; max-width: 460px; }
.gate-card .btn { margin: 4px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 4px 0 12px; }
.page-head h2 { font-family: var(--serif); font-size: 24px; margin: 0; }
.page-head p { margin: 2px 0 0; font-size: 13px; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat-grid-lg { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: 24px; }
.stat span { font-size: 11.5px; color: var(--muted); }
.account-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.account-avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-family: var(--serif); font-size: 22px; }

.filter-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; align-items: end; }
.filter-bar-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-bottom: 12px; grid-column: 1 / -1; }
.tbl-wrap { overflow-x: auto; }
.tbl .ops { display: flex; flex-wrap: wrap; gap: 4px; min-width: 230px; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--line2); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.data-item { border: 1px solid var(--line2); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; }
.data-item-hd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.payload { margin-top: 6px; }
.payload summary { cursor: pointer; font-size: 12px; color: var(--blue); }
.payload pre, .json-pre { background: var(--line2); border-radius: 8px; padding: 10px; font-size: 11.5px; overflow-x: auto; max-height: 280px; white-space: pre-wrap; word-break: break-word; }
.timeline-item { padding: 7px 0; border-bottom: 1px dashed var(--line2); font-size: 12.5px; }
.rules { padding-left: 20px; font-size: 13.5px; }
.state-block { padding: 26px; text-align: center; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.state-error { color: var(--accent); }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.temp-pw { display: flex; align-items: center; gap: 10px; background: var(--gold-soft); padding: 12px; border-radius: 8px; margin: 12px 0; }
.temp-pw code { font-size: 16px; letter-spacing: .08em; word-break: break-all; }
.modal-confirm p { font-size: 14px; }

@media (max-width: 1000px) {
  .stat-grid-lg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-bar, .filter-bar-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .auth-card { padding: 20px 18px; }
  .stat-grid, .stat-grid-lg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar, .filter-bar-wide { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .gate-card { padding: 22px; }
}
