/* Zonate Client Portal (09-Oct-2026) -- phone first, desktop from 900px */
:root {
  --navy: #13294B; --navy-2: #34507A; --ink: #1A2433; --ink-2: #3D4757; --muted: #5B6576;
  --bg: #F2F4F7; --card: #FFFFFF; --line: #DDE2EA; --field: #C5CCD8;
  --accent: #F2A93B; --blue: #2563A8; --green: #1E7F4F; --warn: #A6510A; --red: #A12A20;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; font-size: 16px; color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%; }
a { color: var(--navy); }
h1, h2 { margin: 0; line-height: 1.2; }
h2 { font-size: 17px; }
[hidden] { display: none !important; }
.sr { position: absolute; left: -9999px; }
.muted { color: var(--muted); } .small { font-size: 13.5px; } .strong { font-weight: 600; } .big { font-size: 16.5px; }
.center { text-align: center; } .grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.c-blue { color: var(--blue); } .c-green { color: var(--green); } .c-warn { color: var(--warn); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- buttons, fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 0; font: inherit; font-weight: 600; font-size: 16.5px; text-decoration: none; cursor: pointer; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14.5px; border-radius: 10px; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.accent { background: var(--accent); color: var(--navy); }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.full { width: 100%; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid var(--field); border-radius: 12px; padding: 12px 14px; min-height: 48px; width: 100%; }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--ink-2); }
.check input { width: 20px; min-height: 20px; height: 20px; }
.note { border-radius: 12px; padding: 12px 14px; font-size: 14.5px; line-height: 1.45; }
.note.ok { background: #E3F3EA; color: #14543A; }
.note.bad { background: #FDECEA; color: var(--red); }
.pill { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.st-process { background: #E6EFFA; color: #1D4F86; }
.st-ready { background: #E3F3EA; color: #15623C; }
.st-done { background: #E9ECF1; color: var(--ink-2); }
.st-warn { background: #FDF0E1; color: #8A4308; }
.st-cancel { background: #FDECEA; color: var(--red); }

/* ---------- login / signup ---------- */
body.auth { background: var(--navy); min-height: 100vh; display: flex; flex-direction: column; }
.auth-top { padding: calc(56px + var(--safe-t)) 24px 30px; color: #fff; display: flex; flex-direction: column; gap: 10px; max-width: 480px; width: 100%; margin: 0 auto; }
.auth-top.slim { padding-top: calc(20px + var(--safe-t)); }
.auth-top h1 { font-size: 28px; }
.auth-top p { margin: 0; color: #C9D3E3; line-height: 1.45; }
.auth-top .back { color: #fff; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: flex-start; }
.auth-logo { border-radius: 16px; background: #fff; }
.auth-card { flex: 1 0 auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 26px 20px calc(26px + var(--safe-b)); display: flex; flex-direction: column; gap: 16px; max-width: 480px; width: 100%; margin: 0 auto; }
.auth-card h2 { font-size: 21px; }
.auth-card p { margin: 0; }
.install { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; align-items: center; gap: 12px; color: var(--navy); margin-top: auto; }
.install.inline { margin-top: 14px; }

/* ---------- logged-in app shell ---------- */
.topbar { background: var(--navy); color: #fff; padding-top: var(--safe-t); position: sticky; top: 0; z-index: 10; }
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 18px; }
.brand { display: none; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 19px; }
.brand img { border-radius: 9px; background: #fff; }
.topnav, .topuser { display: none; }
.mtitle { font-size: 19px; font-weight: 700; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 16px 16px calc(96px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: var(--safe-b); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; color: var(--muted); text-decoration: none; font-size: 12px; }
.tabbar a.on { color: var(--navy); font-weight: 700; }

.hello h1 { font-size: 22px; }
.bigcta { min-height: 62px; border-radius: 16px; background: var(--accent); color: var(--navy); text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 18.5px; font-weight: 700; box-shadow: 0 6px 18px rgba(19, 41, 75, 0.16); }
.panel { background: var(--card); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.center-panel { align-items: center; text-align: center; padding: 28px 18px; gap: 12px; }
.center-panel p { margin: 0; line-height: 1.5; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-between > div { min-width: 0; }
.row-between > .btn { flex: 0 0 auto; white-space: nowrap; }
.line { padding-top: 10px; border-top: 1px solid var(--line); }
.dash-grid { display: flex; flex-direction: column; gap: 14px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.stat b { font-size: 26px; font-variant-numeric: tabular-nums; color: var(--navy); }
.stat b.c-blue { color: var(--blue); } .stat b.c-green { color: var(--green); }
.stat span { font-size: 14px; color: var(--muted); }
.help { text-align: center; font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.linklist { display: flex; flex-direction: column; }
.linklist a { padding: 12px 0; border-top: 1px solid var(--line); font-weight: 600; text-decoration: none; }
.linklist a:first-child { border-top: 0; }

/* ---------- applications ---------- */
.filters { display: flex; gap: 8px; }
.filters input { flex: 1 1 auto; min-width: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--field); background: #fff; color: var(--ink-2); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.datebox { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; background: #fff; border-radius: var(--radius); padding: 12px; }
.datebox .btn { grid-column: 1 / -1; }
.count { margin: 0; }
.cards-list { display: flex; flex-direction: column; gap: 12px; }
.appcard { background: var(--card); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.appcard .top { align-items: flex-start; }
.kv { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.kv.one { grid-template-columns: 1fr; }
.kv div { min-width: 0; }
.kv dt { font-size: 12.5px; color: var(--muted); }
.kv dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.authrow { border-top: 1px dashed var(--field); padding-top: 10px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.table-wrap { display: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .tabbar, .mtitle { display: none; }
  .brand, .topnav { display: flex; }
  .topnav { gap: 4px; flex: 1 1 auto; }
  .topnav a { color: #DCE4F0; text-decoration: none; padding: 8px 14px; border-radius: 10px; font-size: 15px; }
  .topnav a.on, .topnav a:hover { background: var(--navy-2); color: #fff; }
  .topuser { display: block; font-size: 14px; color: #C9D3E3; white-space: nowrap; }
  .topuser a { color: #fff; }
  .wrap { padding: 24px 24px 40px; gap: 18px; }
  .bigcta { max-width: 360px; }
  .dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { max-width: 560px; }
  .cards-list { display: none; }
  .table-wrap { display: block; overflow-x: auto; background: var(--card); border-radius: var(--radius); }
  .apptable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
  .apptable th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 11px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
  .apptable th:first-child, .apptable td:first-child { padding-left: 14px; }
  .apptable td { padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
  .apptable td:nth-child(3) { white-space: normal; min-width: 140px; }
  .apptable .pill { font-size: 11.5px; padding: 3px 8px; }
  .apptable tr.auth-tr td { background: #F7F9FC; color: var(--ink-2); font-size: 13.5px; }
  .datebox { max-width: 560px; grid-template-columns: 1fr 1fr auto; }
  .datebox .btn { grid-column: auto; }
  body.auth { justify-content: center; align-items: center; padding: 40px 16px; }
  .auth-top, .auth-card { border-radius: 0; }
  .auth-top { border-radius: 20px 20px 0 0; background: var(--navy); padding: 32px 28px 24px; }
  .auth-card { border-radius: 0 0 20px 20px; flex: 0 0 auto; padding: 26px 28px 28px; }
  .install { margin-top: 0; }
}
