:root{
  --bg:#F4F6FA; --surface:#FFFFFF; --surface-2:#F7F9FC; --ink:#16202E; --muted:#566678;
  --accent:#1E4D8C; --accent-soft:#DCE7F7;
  --gold:#8A6414; --gold-soft:#F3E9D2;
  --danger:#A5342A; --danger-soft:#F6E4E1;
  --warn:#9A6B08; --warn-soft:#F5E8C9;
  --good:#1E7A4C; --good-soft:#DCEEE1;
  --line:#C9D2DE;
}
/* The site now always shows the light theme by default, even if the
   visitor's phone or browser is set to dark mode — this used to switch
   automatically via prefers-color-scheme, but that made the background
   go dark unpredictably depending on the viewer's device settings.
   The rule below is kept so a manual light/dark toggle can be added
   later without redoing this — it only applies once something actually
   sets data-theme="dark" on <html>, which nothing does yet. */
:root[data-theme="dark"]{
  --bg:#0F1620; --surface:#17202C; --surface-2:#1D2733; --ink:#E8EDF4; --muted:#9AACC2;
  --accent:#6FA0E0; --accent-soft:#1F3350;
  --gold:#D8B45C; --gold-soft:#3A3016;
  --danger:#E2776A; --danger-soft:#3A2420;
  --warn:#E0B84D; --warn-soft:#3A2F12;
  --good:#5FC98A; --good-soft:#1B3A28;
  --line:#33445A;
}
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

*{box-sizing:border-box;}
body{ background:var(--bg); color:var(--ink); font-family:'Inter',system-ui,sans-serif; margin:0; }
a{ color:var(--accent); }

.topbar{
  background:#1B2836; color:#fff; padding:10px 20px; display:flex; align-items:center;
  justify-content:space-between; flex-wrap:wrap; gap:10px;
}
.topbar .brand{ font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:17px; letter-spacing:-.01em; color:#fff; text-decoration:none; }
.topbar .who{ font-size:13.5px; color:#C7D2E0; display:flex; align-items:center; gap:14px; }
.topbar .who a{ color:#fff; opacity:.85; text-decoration:none; }
.topbar .who a:hover{ opacity:1; }

.wrap{ max-width:1000px; margin:0 auto; padding:24px 16px 48px; }
.card{ background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:22px;
       box-shadow:0 1px 2px rgba(22,32,46,.04), 0 1px 0 rgba(22,32,46,.03); }
.login-wrap{ max-width:380px; margin:60px auto; }
.login-wrap h1{ font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:23px; letter-spacing:-.01em; margin:0 0 4px; }
.login-wrap p.sub{ color:var(--muted); font-size:14.5px; margin:0 0 20px; }

label{ display:block; font-size:13px; font-weight:700; color:var(--muted); margin-bottom:4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea{
  width:100%; padding:11px 12px; border:1px solid var(--line); border-radius:9px; font-size:16px; min-height:46px;
  background:var(--bg); color:var(--ink); margin-bottom:14px; font-family:inherit;
}
textarea{ min-height:84px; resize:vertical; }
button, .btn{
  font-family:'Inter',sans-serif; font-weight:700; font-size:15px; padding:11px 18px; min-height:44px; border-radius:10px; border:none;
  background:var(--accent); color:#fff; cursor:pointer; text-decoration:none; display:inline-block;
  transition:transform .1s ease, opacity .12s ease;
}
button:hover, .btn:hover{ opacity:.92; transform:translateY(-1px); }
.btn-secondary{
  background:var(--surface); color:var(--ink); border:1px solid var(--line);
  transition:transform .1s ease, background .12s ease;
}
.btn-secondary:hover{ transform:translateY(-1px); background:var(--surface-2); }
.error{ background:var(--danger-soft); color:var(--danger); border-radius:8px; padding:10px 14px; font-size:13.5px; margin-bottom:16px; }

.tiles{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:20px; }
.tile{ background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:14px 16px; box-shadow:0 1px 2px rgba(22,32,46,.04); }
.tile .n{ font-family:'Space Grotesk',sans-serif; font-size:28px; font-weight:700; letter-spacing:-.01em; }
.tile .l{ font-size:12.5px; color:var(--muted); margin-top:2px; }
.tile.danger .n{ color:var(--danger); } .tile.warn .n{ color:var(--warn); } .tile.good .n{ color:var(--good); }

.search-row{ margin-bottom:12px; }
.search-row input{ margin-bottom:0; background:var(--surface); }
.search-empty{ padding:28px; text-align:center; color:var(--muted); font-size:13.5px; margin:0; }
.dup-warning{ background:var(--danger-soft); color:var(--danger); border-radius:8px; padding:10px 14px; font-size:13px; margin:-6px 0 14px; }

.controls{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; align-items:center; justify-content:space-between; }
.chips{ display:flex; gap:6px; flex-wrap:wrap; }
.chip{
  font-size:14px; font-weight:600; padding:9px 14px; min-height:40px; display:inline-flex; align-items:center; border-radius:999px; border:1px solid var(--line);
  background:var(--surface); color:var(--muted); text-decoration:none;
}
.chip.on{ background:var(--accent-soft); color:var(--accent); border-color:var(--accent); }

table{ width:100%; border-collapse:collapse; font-size:14.5px; background:var(--surface); }
th{
  text-align:left; font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:.04em; text-transform:uppercase; color:var(--muted);
  padding:11px 14px; border-bottom:1px solid var(--line); background:var(--surface-2);
}
td{ padding:12px 14px; border-bottom:1px solid var(--line); vertical-align:middle; }
.tbl-wrap{ overflow-x:auto; border:1px solid var(--line); border-radius:12px; -webkit-overflow-scrolling:touch; }
.scroll-hint{ display:none; font-size:12px; color:var(--muted); margin:6px 2px 12px; }
.mono{ font-family:'IBM Plex Mono',monospace; font-size:13.5px; }
.pill{ display:inline-block; padding:4px 11px; border-radius:999px; font-size:12.5px; font-weight:700; white-space:nowrap; }
.pill-progress{ background:var(--accent-soft); color:var(--accent); }
.pill-good{ background:var(--good-soft); color:var(--good); }
.dl{ font-weight:600; }
.dl.danger{ color:var(--danger); } .dl.warn{ color:var(--warn); } .dl.muted{ color:var(--muted); font-weight:500; }
.empty{ padding:28px; text-align:center; color:var(--muted); }
.row-actions a{ font-size:12.5px; margin-right:10px; text-decoration:none; }

.note{ background:var(--gold-soft); border:1px dashed var(--gold); color:var(--gold); border-radius:10px; padding:12px 14px; font-size:13px; margin:0 0 16px; }
.escalate-note{ background:var(--warn-soft); border:1px dashed var(--warn); color:var(--warn); border-radius:10px; padding:12px 14px; font-size:13px; margin:6px 0 16px; }
.followup-row{ display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:10px; }
.followup-row label{ font-size:12.5px; }
.checkbox-row{ display:flex; align-items:center; gap:10px; font-size:15px; min-height:44px; color:var(--ink); margin:4px 0 14px; }
.checkbox-row input[type=checkbox]{ width:20px; height:20px; min-height:0; margin:0; flex:none; }
.section-lbl{ font-family:'Space Grotesk',sans-serif; font-size:13px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; margin:0 0 12px; }

.piecard{ margin-bottom:20px; }
.piecard h3{ font-family:'Space Grotesk',sans-serif; font-size:13px; margin:0 0 14px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.meter-stat{ font-size:15px; color:var(--ink); margin-bottom:10px; }
.meter-pct{ font-family:'Space Grotesk',sans-serif; font-size:32px; font-weight:700; letter-spacing:-.01em; color:var(--accent); margin-right:6px; }
.meter-track{ height:14px; border-radius:999px; background:var(--accent-soft); overflow:hidden; }
.meter-fill{ height:100%; border-radius:999px; background:var(--accent); }
.meter-caption{ margin-top:9px; font-size:12.5px; color:var(--muted); }
.meter-caption b{ color:var(--ink); font-weight:600; }
.hist{ font-size:13.5px; padding:6px 0; border-bottom:1px solid var(--line); color:var(--muted); }
.hist b{ color:var(--ink); }

.report-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; }
.print-only{ display:none; }
.email-preview{ padding:0; overflow:hidden; }
.email-meta{ background:var(--surface-2); border-bottom:1px solid var(--line); padding:16px 20px; font-size:13px; color:var(--muted); }
.email-meta div{ margin-bottom:3px; }
.email-meta b{ color:var(--ink); }
.email-body{ padding:20px; font-size:14px; line-height:1.6; }
.email-body p{ margin:0 0 12px; }
.print-fields{ width:100%; border-collapse:collapse; font-size:13.5px; }
.print-fields th{ text-align:left; font-weight:600; color:var(--muted); padding:7px 14px 7px 0; vertical-align:top; width:220px; white-space:nowrap; font-family:inherit; text-transform:none; letter-spacing:normal; background:transparent; border-bottom:none; }
.print-fields td{ padding:7px 0; border-bottom:1px solid var(--line); }

@media (max-width:640px){
  .tiles{ grid-template-columns:repeat(2,1fr); }
  .scroll-hint{ display:block; }
}
@media (max-width:480px){
  .followup-row{ grid-template-columns:1fr; }
  .two-col{ grid-template-columns:1fr !important; }
}

.site-footer{
  max-width:1000px; margin:32px auto 0; padding:16px; text-align:center;
  font-size:12.5px; color:var(--muted);
}

/* Login page: blurred SDO Caloocan building photo behind the sign-in card */
.login-page{ margin:0; }
.login-hero{
  position:relative; min-height:100vh; min-height:100dvh; overflow:hidden;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:40px 16px;
}
.login-hero::before{
  content:""; position:absolute; inset:-24px; z-index:0;
  background:url('assets/login-bg.jpg') center/cover no-repeat;
  filter:blur(7px) brightness(.5) saturate(1.05);
  transform:scale(1.08);
}
.login-hero > *{ position:relative; z-index:1; }
.login-hero-text{ text-align:center; color:#fff; margin-bottom:22px; }
.login-seal{ width:80px; height:80px; display:block; margin:0 auto 12px; filter:drop-shadow(0 2px 8px rgba(0,0,0,.4)); }
.login-hero-title{ font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:19px; letter-spacing:-.01em; }
.login-hero-sub{ font-size:13.5px; color:#D7E2F2; margin-top:3px; }
.login-hero .login-wrap{ margin:0 auto; width:100%; }
.login-hero .site-footer{ color:#C7D2E0; }
.login-links{ text-align:center; font-size:13px; margin-top:14px; }
.login-links a{ color:var(--muted); }


.aging-list{ list-style:none; margin:0; padding:0; }
.aging-list li{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:9px 0; border-bottom:1px solid var(--line); font-size:14.5px;
}
.aging-list li:last-child{ border-bottom:none; }
.aging-list a{ text-decoration:none; }
.aging-empty{ color:var(--muted); font-size:13.5px; padding:6px 0; }

.attach-list{ list-style:none; margin:0 0 12px; padding:0; }
.attach-list li{
  display:flex; align-items:center; gap:12px;
  padding:10px 0; border-bottom:1px solid var(--line); font-size:14.5px;
}
.attach-list li:last-child{ border-bottom:none; }
.attach-list .attach-meta{ color:var(--muted); font-size:12.5px; display:block; margin-top:2px; }
.attach-list .attach-del{ margin-left:auto; flex:none; }
.attach-empty{ color:var(--muted); font-size:13.5px; padding:4px 0 12px; }
.attach-upload-row{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.attach-upload-row input[type=file]{ flex:1; min-width:180px; margin-bottom:0; font-size:14px; }

/* School/Unit searchable picker (replaces the old plain <select>) */
.combo{ position:relative; margin-bottom:14px; }
.combo input.combo-input{ margin-bottom:0; padding-right:34px; }
.combo .combo-chev{ position:absolute; right:12px; top:15px; color:var(--muted); font-size:12px; pointer-events:none; }
.combo .combo-clear{ position:absolute; right:6px; top:6px; min-height:34px; transform:none; background:none; border:none; color:var(--muted); font-size:19px; cursor:pointer; padding:4px 6px; display:none; line-height:1; }
.combo.has-value .combo-clear{ display:block; }
.combo.has-value .combo-chev{ display:none; }
.combo-panel{
  position:absolute; left:0; right:0; top:calc(100% + 4px); z-index:30;
  background:var(--surface); border:1px solid var(--line); border-radius:10px;
  box-shadow:0 8px 24px rgba(22,32,46,.14); max-height:280px; overflow-y:auto; display:none;
}
.combo-panel.open{ display:block; }
.combo-group-head{
  font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--muted);
  background:var(--surface-2); padding:8px 12px; position:sticky; top:0;
}
.combo-opt{ padding:11px 12px; font-size:14.5px; cursor:pointer; display:flex; align-items:baseline; justify-content:space-between; gap:8px; }
.combo-opt:hover, .combo-opt.active{ background:var(--accent-soft); }
.combo-opt-sub{ font-size:11px; color:var(--muted); white-space:nowrap; }
.combo-opt mark{ background:var(--gold-soft); color:inherit; border-radius:2px; }
.combo-no-match{ padding:12px; font-size:13px; color:var(--muted); text-align:center; }


/* Save confirmation toast + disabled-field explainer */
.saved-toast{
  position:relative; margin:0 0 14px; background:var(--good-soft); color:var(--good); border:1px solid var(--good);
  border-radius:8px; padding:11px 14px; font-size:14.5px; font-weight:600; display:none;
}
.saved-toast.show{ display:block; }
.field-hint{ font-size:12.5px; color:var(--muted); font-style:italic; margin:-10px 0 14px; }

/* Mobile-friendly tables: below the breakpoint, each <tr> becomes a card
   instead of a row you have to scroll sideways through. Driven entirely by
   CSS off the same markup — add data-label="Column Name" to each <td>, plus
   "card-title" on the one cell that should read as the card's heading (no
   label, bigger) and "card-action" on the one that should become a
   full-width button. No JS, and desktop keeps the plain table it always had. */
@media (max-width:700px){
  .responsive-cards{ border:none; background:transparent; overflow:visible; }
  .responsive-cards table{ width:100%; }
  .responsive-cards thead{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
  .responsive-cards tbody{ display:block; }
  .responsive-cards tr{
    display:block; background:var(--surface); border:1px solid var(--line); border-radius:12px;
    padding:2px 14px; margin-bottom:10px; box-shadow:0 1px 2px rgba(22,32,46,.04);
  }
  .responsive-cards td{
    display:flex; justify-content:space-between; align-items:center; gap:12px;
    padding:8px 0; border-bottom:1px solid var(--line); text-align:right;
  }
  .responsive-cards td:last-child{ border-bottom:none; }
  .responsive-cards td[data-label]::before{
    content:attr(data-label); font-size:10.5px; font-weight:700; color:var(--muted);
    text-transform:uppercase; letter-spacing:.04em; flex-shrink:0; text-align:left;
  }
  .responsive-cards td.card-title{ font-size:14.5px; font-weight:700; padding-top:12px; justify-content:flex-start; }
  .responsive-cards td.card-title::before{ content:none; }
  .responsive-cards td.card-action{ padding-bottom:12px; }
  .responsive-cards td.card-action::before{ content:none; }
  .responsive-cards td.card-action a, .responsive-cards td.card-action button{
    display:block; width:100%; text-align:center; background:var(--accent); color:#fff;
    text-decoration:none; font-weight:700; padding:11px; min-height:44px; border-radius:8px;
  }
  .responsive-cards td.card-action form{ width:100%; }
  .responsive-cards td.card-action .btn-secondary{ background:var(--surface); color:var(--ink); border:1px solid var(--line); }
  .responsive-cards td.card-action .btn-danger-soft{ background:var(--danger-soft); color:var(--danger); border:1px solid #E5BDB8; }
  .responsive-cards td.empty{ display:block; text-align:center; border-bottom:none; padding:24px 0; }
  .responsive-cards + .scroll-hint{ display:none; }
}

/* =========================================================================
   v1.7 design pass
   ========================================================================= */
:focus-visible{ outline:3px solid rgba(30,77,140,.5); outline-offset:2px; border-radius:6px; }
input:focus-visible, select:focus-visible, textarea:focus-visible{ outline-offset:0; border-color:var(--accent); }
[hidden]{ display:none !important; }
.muted{ color:var(--muted); }

/* header + menu */
.topbar .brand small{ display:inline-block; font-family:'Inter',system-ui,sans-serif; font-weight:500; font-size:12.5px; color:#C7D2E0; margin-left:10px; }
.menu-wrap{ position:relative; }
.menu-btn{
  background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.3); color:#fff; font-size:14px; font-weight:600;
  padding:8px 14px; min-height:40px; border-radius:8px; cursor:pointer;
}
.menu-btn:hover{ background:rgba(255,255,255,.2); transform:none; }
.menu-pop{
  position:absolute; right:0; top:calc(100% + 6px); background:var(--surface); color:var(--ink); border:1px solid var(--line);
  border-radius:10px; box-shadow:0 10px 28px rgba(0,0,0,.25); min-width:200px; padding:6px; display:none; z-index:50;
}
.menu-pop.open{ display:block; }
.menu-pop a{ display:flex; align-items:center; min-height:44px; padding:0 12px; border-radius:7px; color:var(--ink); text-decoration:none; font-size:15px; }
.topbar .menu-pop a{ color:var(--ink); opacity:1; }
.topbar .menu-pop a:hover{ background:var(--accent-soft); color:var(--accent); }
.topbar .menu-pop a[aria-current]{ font-weight:700; color:var(--accent); }
.menu-pop .sep{ height:1px; background:var(--line); margin:5px 6px; }

/* page scaffolding */
.wrap-wide{ max-width:1200px; }
.page-h1{ font-family:'Space Grotesk',sans-serif; font-size:22px; font-weight:700; letter-spacing:-.01em; margin:0 0 4px; }
.card .page-h1{ font-size:19px; margin-bottom:12px; }
td.added{ white-space:nowrap; }
td .nm{ font-weight:600; }
.page-sub{ color:var(--muted); font-size:15px; margin:0 0 16px; }
.card-sub{ color:var(--muted); font-size:14.5px; margin:0 0 16px; line-height:1.5; }
.back-link{ margin:0 0 14px; font-size:15px; }
.back-link a{ font-weight:700; text-decoration:none; }
.btn-block{ display:block; width:100%; text-align:center; }
.btn-ghost{ background:var(--surface); color:var(--ink); border:1px solid var(--line); }
.btn-ghost:hover{ background:var(--surface-2); }
.btn-small{ min-height:40px; padding:8px 14px; font-size:14px; }
.btn-danger-soft{ background:var(--danger-soft); color:var(--danger); border:1px solid #E5BDB8; }
button:disabled{ opacity:.5; cursor:not-allowed; transform:none !important; }
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:6px; }

/* dashboard: tiles as filters, progress line, toolbar */
a.tile{ display:block; color:inherit; text-decoration:none; min-height:68px; }
a.tile:hover{ border-color:var(--accent); }
.tile.on{ border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-soft); background:#FBFDFF; }
.tile.t-over .n{ color:var(--danger); } .tile.t-soon .n{ color:var(--warn); } .tile.t-res .n{ color:var(--good); }
.tile .l{ font-size:13.5px; }
.tiles{ margin-bottom:10px; }
.progress-line{ display:flex; align-items:center; gap:12px; font-size:14px; color:var(--muted); margin:0 0 16px; }
.progress-line .bar{ flex:1; max-width:260px; height:8px; background:var(--accent-soft); border-radius:99px; overflow:hidden; }
.progress-line .bar i{ display:block; height:100%; background:var(--accent); }
.toolbar{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:12px; }
.toolbar .search-row{ flex:1; min-width:220px; margin:0; }
.toolbar .search-row input{ min-height:46px; }
.chips{ margin-bottom:12px; }
.chip:hover{ border-color:var(--accent); }
.chip-n{ font-weight:700; margin-left:6px; color:var(--ink); }
.chip.on .chip-n{ color:var(--accent); }
.search-row input{ font-size:16px; }

/* dashboard / archive table */
.dash-cards{ background:var(--surface); }
.dash-table .c-badge{ display:none; }
.dash-table .c-no{ white-space:nowrap; font-weight:600; }
.dash-table .cmp{ font-weight:600; line-height:1.35; }
.dash-table .cmp-sub{ color:var(--muted); font-size:13.5px; margin-top:2px; }
.dash-table .c-dl, .dash-table .c-fu{ white-space:nowrap; }
.dash-table .dl-date{ display:block; font-weight:600; }
.dash-table .dl-days{ display:block; font-weight:700; font-size:13px; margin-top:1px; }
.dash-table .dl-label{ display:block; font-size:13px; color:var(--muted); margin-top:1px; }
.c-dl.over .dl-days{ color:var(--danger); } .c-dl.soon .dl-days{ color:var(--warn); }
.c-dl.ok .dl-days, .c-dl.done .dl-days{ color:var(--muted); font-weight:500; }
.dash-table tbody tr:last-child td{ border-bottom:none; }
.dash-table tr.r-over td:first-child{ box-shadow:inset 4px 0 0 var(--danger); }
.dash-table tr.r-soon td:first-child{ box-shadow:inset 4px 0 0 #D9A62B; }
.dash-table tr.r-done td{ color:#5E6C7C; }
.dash-table tr.r-done td:first-child{ box-shadow:inset 4px 0 0 var(--good-soft); }
.open-link{
  display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:0 16px; border-radius:9px;
  border:1px solid var(--line); background:var(--surface); color:var(--accent); font-weight:700; text-decoration:none;
}
.open-link:hover{ background:var(--accent-soft); }
.btn-assign{
  display:inline-flex; align-items:center; justify-content:center; min-height:40px; padding:0 14px; border-radius:9px;
  background:var(--warn-soft); color:var(--warn); border:1px solid #E3CE97; font-weight:700; text-decoration:none;
}
.btn-assign:hover{ background:#F0DFB3; }
.m-only{ display:none; }
.fab{ display:none; }

/* users + settings */
.pill-good{ background:var(--good-soft); color:var(--good); }
.pill-warn{ background:var(--warn-soft); color:var(--warn); }
.pill-off{ background:#E6EAF0; color:#4A5868; }
.row-inactive td{ color:#5E6C7C; }
.row-inactive .nm{ text-decoration:line-through; text-decoration-color:rgba(0,0,0,.25); }
.you{ color:var(--muted); font-weight:500; }
.stepper-row{ display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.stepper-row input[type=number]{ width:84px; margin:0; text-align:center; }
.step-btn{ width:46px; padding:0; font-size:22px; line-height:1; background:var(--surface); color:var(--ink); border:1px solid var(--line); }
.step-btn:hover{ background:var(--surface-2); }
.preview-box{ background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:12px 14px; font-size:14.5px; line-height:1.6; }
.pv-head{ font-weight:700; margin-bottom:6px; }
.pv-row{ display:flex; justify-content:space-between; gap:10px; padding:4px 0; border-bottom:1px solid var(--line); }
.pv-sub{ color:var(--muted); }
.two-col{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }

/* login extras */
.remember-row{ margin:2px 0 0; min-height:44px; font-weight:600; }
.remember-hint{ font-size:13px; color:var(--muted); margin:0 0 14px 30px; }

/* ticket page */
.tk-head{ display:flex; flex-wrap:wrap; align-items:center; gap:12px; justify-content:space-between; margin-bottom:14px; }
.tk-title{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.back-link-inline{ font-weight:700; text-decoration:none; font-size:15px; display:inline-flex; align-items:center; min-height:44px; }
.tk-no{ font-size:22px; margin:0; font-weight:600; }
.badge{ font-weight:700; font-size:13.5px; padding:5px 12px; border-radius:999px; background:var(--surface-2); color:var(--muted); border:1px solid var(--line); }
.badge:empty{ display:none; }
.badge-over{ background:var(--danger-soft); color:var(--danger); border-color:#E5BDB8; }
.badge-soon{ background:var(--warn-soft); color:var(--warn); border-color:#E3CE97; }
.badge-done{ background:var(--good-soft); color:var(--good); border-color:#B9DCC6; }
.stepper{ list-style:none; display:flex; margin:0 0 18px; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:14px 16px; overflow-x:auto; }
.step{ flex:1; min-width:104px; text-align:center; position:relative; font-size:13px; color:var(--muted); font-weight:600; }
.step::before{ content:""; position:absolute; top:11px; left:-50%; width:100%; height:3px; background:var(--line); z-index:0; }
.step:first-child::before{ display:none; }
.step .dot{ position:relative; z-index:1; width:24px; height:24px; border-radius:50%; background:var(--surface); border:3px solid var(--line); margin:0 auto 6px; display:block; }
.step.done .dot{ background:var(--accent); border-color:var(--accent); }
.step.done::before, .step.cur::before{ background:var(--accent); }
.step.cur .dot{ border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-soft); }
.step.cur{ color:var(--accent); } .step.done{ color:var(--ink); }
.tk-grid{ display:grid; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr); gap:16px; align-items:start; }
.tk-col > .card + .card{ margin-top:16px; }
.complaint{ font-size:16.5px; line-height:1.55; overflow-wrap:anywhere; }
.facts{ display:grid; grid-template-columns:1fr 1fr; gap:10px 18px; margin-top:14px; padding-top:14px; border-top:1px solid var(--line); }
.facts .k{ font-size:12.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); font-weight:700; }
.facts .v{ font-weight:600; font-size:15.5px; }
.help{ font-size:13.5px; color:var(--muted); margin:-8px 0 14px; min-height:18px; }
.help:empty{ min-height:0; margin:0 0 6px; }
.field-hint.help{ font-style:italic; }
.fu{ display:flex; gap:8px; margin:2px 0 12px; }
.fu i{ flex:1; height:8px; border-radius:99px; background:var(--line); }
.fu i.on{ background:var(--warn); }
.hist{ position:relative; padding:9px 0 9px 16px; border-left:3px solid var(--line); margin-left:5px; border-bottom:none; }
.hist::before{ content:""; position:absolute; left:-8px; top:15px; width:11px; height:11px; border-radius:50%; background:var(--surface); border:3px solid var(--accent); }
.att-thumb{ flex:none; width:56px; height:56px; border-radius:8px; overflow:hidden; border:1px solid var(--line); background:var(--surface-2); display:block; }
.att-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.att-ico{ flex:none; width:56px; height:56px; border-radius:8px; border:1px solid var(--line); background:var(--surface-2); display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; color:var(--muted); letter-spacing:.04em; }
.att-main{ min-width:0; overflow-wrap:anywhere; }
.attach-upload-row button{ min-height:44px; }
.attach-upload-row + .help{ margin-top:10px; }
input[type=file]{ font-size:14px; color:var(--muted); }
input[type=file]::file-selector-button{
  font:inherit; font-weight:700; font-size:14px; padding:10px 14px; min-height:44px; margin-right:10px; border-radius:9px;
  border:1px solid var(--line); background:var(--surface); color:var(--ink); cursor:pointer;
}
input[type=file]::file-selector-button:hover{ background:var(--surface-2); }
.savebar{
  position:sticky; bottom:0; z-index:20; margin:18px -16px 0; padding:12px 16px; background:rgba(255,255,255,.96);
  border-top:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap:12px; backdrop-filter:blur(4px);
}
.savebar .st{ font-size:15px; color:var(--muted); }
.savebar .st.dirty{ color:var(--warn); font-weight:700; }
.savebar .st.ok{ color:var(--good); font-weight:700; }
.savebar-btns{ display:flex; gap:8px; }

/* photo lightbox */
body.lb-open{ overflow:hidden; }
.lb{ position:fixed; inset:0; z-index:100; background:rgba(10,16,24,.95); display:flex; align-items:center; justify-content:center; }
.lb-bar{ position:absolute; top:0; left:0; right:0; display:flex; align-items:center; gap:10px; padding:10px 14px; color:#fff; background:linear-gradient(rgba(0,0,0,.55),rgba(0,0,0,0)); z-index:2; }
.lb-name{ flex:1; min-width:0; font-weight:600; font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lb-count{ font-size:14px; color:#C7D2E0; white-space:nowrap; }
.lb-btn{
  display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:0 16px; border-radius:9px; font-size:15px; font-weight:700;
  background:rgba(255,255,255,.14); color:#fff; border:1px solid rgba(255,255,255,.35); text-decoration:none; cursor:pointer;
}
.lb-btn:hover{ background:rgba(255,255,255,.26); transform:none; }
.lb-stage{ position:absolute; inset:64px 0 0 0; display:flex; overflow:auto; padding:8px 72px 16px; cursor:zoom-in; }
.lb-stage img{ margin:auto; max-width:100%; max-height:100%; object-fit:contain; border-radius:4px; }
.lb-stage.zoom{ cursor:zoom-out; }
.lb-stage.zoom img{ max-width:none; max-height:none; }
.lb-nav{
  position:absolute; top:50%; transform:translateY(-50%); z-index:3; width:52px; height:72px; padding:0; border-radius:12px;
  background:rgba(255,255,255,.14); color:#fff; border:1px solid rgba(255,255,255,.3); font-size:40px; line-height:1;
}
.lb-nav:hover{ background:rgba(255,255,255,.26); transform:translateY(-50%); }
.lb-prev{ left:10px; } .lb-next{ right:10px; }

@media (max-width:760px){
  .tk-grid{ grid-template-columns:1fr; }
  .savebar{ margin-left:-16px; margin-right:-16px; }
  .lb-stage{ padding:8px 8px 16px; }
  .lb-nav{ top:auto; bottom:16px; transform:none; height:52px; }
  .lb-nav:hover{ transform:none; }
}
@media (max-width:640px){
  .topbar{ padding:10px 14px; }
  .topbar .brand small, .topbar .who-name{ display:none; }
  .wrap{ padding:16px 14px 96px; }
  .tiles{ display:grid; grid-auto-flow:column; grid-auto-columns:minmax(118px,1fr); grid-template-columns:none; overflow-x:auto; gap:8px; padding-bottom:4px; margin-right:-14px; padding-right:14px; }
  .tile{ padding:10px 14px; }
  .tile .n{ font-size:24px; }
  .toolbar .search-row{ flex-basis:100%; }
  .toolbar > .btn{ flex:1; }
  .savebar{ margin-left:-14px; margin-right:-14px; padding-left:14px; padding-right:14px; }
  .attach-upload-row input[type=file]{ flex-basis:100%; }
  .fab{
    display:flex; align-items:center; position:fixed; right:14px; bottom:16px; z-index:30; min-height:52px; padding:0 20px;
    border-radius:999px; background:var(--accent); color:#fff; font-weight:700; font-size:15px; text-decoration:none;
    box-shadow:0 6px 18px rgba(30,77,140,.45);
  }
  .two-col{ grid-template-columns:1fr; }
  .savebar{ flex-wrap:wrap; }
  .savebar-btns{ width:100%; } .savebar-btns .btn{ flex:1; }
  .facts{ grid-template-columns:1fr 1fr; }
  .stepper{ padding:12px 8px; }
  .step{ min-width:92px; font-size:12.5px; }
}

/* dashboard + archive as cards on phones */
@media (max-width:700px){
  .dash-cards{ border:none; background:transparent; overflow:visible; }
  .dash-table, .dash-table tbody{ display:block; width:100%; background:transparent; }
  .dash-table thead{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
  .dash-table tr{
    display:grid; grid-template-columns:1fr auto; grid-template-areas:"no badge" "cmp cmp" "status dl" "who who" "fu fu" "act act";
    align-items:center; gap:0 10px; background:var(--surface); border:1px solid var(--line); border-left-width:5px; border-radius:14px;
    padding:12px 14px; margin-bottom:10px; box-shadow:0 1px 2px rgba(22,32,46,.04);
  }
  .dash-table tr.r-over{ border-left-color:var(--danger); } .dash-table tr.r-soon{ border-left-color:#D9A62B; } .dash-table tr.r-done{ border-left-color:var(--good); }
  .dash-table tr.empty-row{ display:block; text-align:center; }
  .dash-table td{ display:block; padding:0; border-bottom:none; box-shadow:none !important; }
  .dash-table .c-no{ grid-area:no; font-size:14px; }
  .dash-table .c-badge{ grid-area:badge; display:block; font-weight:700; font-size:13.5px; text-align:right; color:var(--muted); }
  .dash-table .c-badge:empty{ display:none; }
  .dash-table .c-badge.over{ color:var(--danger); } .dash-table .c-badge.soon{ color:var(--warn); } .dash-table .c-badge.done{ color:var(--good); }
  .dash-table .c-cmp{ grid-area:cmp; margin:6px 0 10px; }
  .dash-table .cmp{ font-size:16px; }
  .dash-table .c-status{ grid-area:status; margin-bottom:10px; }
  .dash-table .c-dl{ grid-area:dl; text-align:right; margin-bottom:10px; font-size:14px; }
  .dash-table .dl-days{ display:none; }
  .dash-table .dl-label{ display:inline; margin-left:6px; }
  .dash-table .dl-date{ display:inline; }
  .dash-table .c-who{ grid-area:who; margin-bottom:10px; font-size:14.5px; color:var(--muted); }
  .dash-table .c-who .btn-assign{ display:flex; width:100%; min-height:44px; }
  .dash-table .c-who .m-only{ display:inline; white-space:pre; }
  .dash-table .c-fu{ grid-area:fu; margin-bottom:10px; font-size:14px; }
  .dash-table .c-act{ grid-area:act; }
  .dash-table .open-link{ display:flex; width:100%; background:var(--accent); color:#fff; border-color:var(--accent); }
  .dash-table tr.r-done .open-link{ background:var(--surface); color:var(--accent); border-color:var(--line); }
  .dash-table .empty{ padding:24px 0; }
}

@media print{
  .no-print{ display:none !important; }
  .print-only{ display:block; }
  body{ background:#fff; }
  .wrap{ max-width:none; padding:0; }
  .card{ border:none; padding:0; box-shadow:none; }
  .site-footer{ display:none; }
}
