:root {
  --navy: #0e3561;
  --navy-2: #17456f;
  --teal: #02aeac;
  --teal-ink: #067c7b;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #17202b;
  --muted: #5e6875;
  --line: #e1e6ec;
  --line-strong: #c9d0d9;
  --danger: #b42318;
  --ok: #067647;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .05);
  --font: "Inter", "Noto Sans Gurmukhi", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2 { margin: 0; font-weight: 700; line-height: 1.3; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.center { text-align: center; align-self: center; }
.splash { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- controls ---------- */
.inp {
  display: block; width: 100%; height: 42px; padding: 0 12px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px;
  transition: border-color .15s, box-shadow .15s;
}
.inp:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(14, 53, 97, .14); }
select.inp { cursor: pointer; }
.cs-wrap { position: relative; display: block; width: 100%; min-width: 0; }
.cs-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.cs-trigger.inp { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; font-weight: 500; white-space: nowrap; }
.cs-trigger:hover { border-color: #829aab; background: #fbfdfd; }
.cs-trigger.cs-open, .cs-trigger:focus-visible { outline: none; border-color: var(--teal-ink); box-shadow: 0 0 0 3px rgba(2, 174, 172, .15); }
.cs-trigger.cs-empty .cs-value { color: #71818e; }
.cs-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-value small { color: #667b89; font-size: .78em; font-weight: 400; margin-left: 5px; }
.cs-chevron { flex: none; width: 9px; height: 9px; border-right: 2px solid #557081; border-bottom: 2px solid #557081; transform: rotate(45deg) translateY(-2px); transition: transform .16s; }
.cs-open .cs-chevron { transform: rotate(225deg) translate(-2px, -1px); }
.cs-menu:popover-open { position: fixed; inset: auto; margin: 0; padding: 5px; overflow-y: auto; overscroll-behavior: contain; background: #fff; border: 1px solid #cbd9df; border-radius: 12px; box-shadow: 0 16px 42px rgba(14, 53, 97, .2); color: var(--text); }
.cs-option { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 9px 11px; border: 0; border-radius: 8px; background: transparent; color: #213b50; font: inherit; font-size: .9rem; text-align: left; line-height: 1.25; cursor: pointer; }
.cs-option small { color: #6b7e8b; font-size: .78rem; margin-top: 2px; }
.cs-option:hover, .cs-option:focus-visible { outline: none; background: #e9f5f4; }
.cs-option[aria-selected="true"] { color: #0e3561; background: #edf4f8; font-weight: 700; }
.cs-option:disabled { color: #8c9ba5; cursor: default; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px; white-space: nowrap; text-decoration: none;
  font: inherit; font-size: .9rem; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #f4f6f8; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn:focus-visible, .link:focus-visible, .card:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn.primary { color: #fff; background: var(--navy); border-color: var(--navy); }
.btn.primary:hover { background: var(--navy-2); }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: .82rem; }
.btn.wide { width: 100%; min-height: 46px; font-size: 1rem; }
.btn.ghost-light { color: #fff; background: transparent; border-color: rgba(255, 255, 255, .3); }
.btn.ghost-light:hover { background: rgba(255, 255, 255, .1); }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: .95rem; cursor: pointer; }
.icon-btn:hover { background: #f1f3f6; }
.link { background: none; border: 0; padding: 4px; font: inherit; font-size: .88rem; color: var(--navy); cursor: pointer; }
.link:hover { text-decoration: underline; }
label.fl { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; font-weight: 600; min-width: 0; }
.err { margin: 0; color: var(--danger); font-size: .88rem; }
.err:empty { display: none; }
.warn-text { color: #b54708; font-style: normal; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; padding: 30px 26px; background: var(--surface); border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.login-logo { width: 52px; height: 52px; object-fit: contain; }
.login-card h1 { font-size: 1.45rem; }
.login-card p { margin: 0; }
.demo-box { padding: 12px; border-radius: 10px; background: #fff8e6; color: #7a4d00; font-size: .84rem; }
.demo-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.demo-btns .btn { white-space: normal; line-height: 1.2; padding: 4px 8px; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.side { position: sticky; top: 0; width: 236px; height: 100vh; flex: none; display: flex; flex-direction: column; padding: 16px 12px; color: #fff; background: var(--navy); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
.side-brand img { width: 34px; height: 34px; padding: 3px; object-fit: contain; background: #fff; border-radius: 9px; }
.side-brand strong, .side-me strong { display: block; line-height: 1.25; }
.side-brand small, .side-me small { display: block; font-size: .76rem; color: rgba(255, 255, 255, .7); }
.side-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 9px; font-weight: 500; font-size: .92rem; text-decoration: none; color: rgba(255, 255, 255, .82); transition: background .15s; }
.side-nav a:hover { background: rgba(255, 255, 255, .08); }
.side-nav a.active { color: #fff; background: rgba(255, 255, 255, .14); box-shadow: inset 3px 0 0 var(--teal); }
svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-me { display: flex; flex-direction: column; gap: 10px; padding: 14px 6px 2px; border-top: 1px solid rgba(255, 255, 255, .15); }
.main { flex: 1; min-width: 0; }
.view { max-width: 1040px; margin: 0 auto; padding: 26px 26px 60px; }
.mobile-top, .bottom-nav { display: none; }
.demo-bar { padding: 7px 16px; background: #fff8e6; color: #7a4d00; font-size: .82rem; text-align: center; border-bottom: 1px solid #fbe3a8; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.page-head h1 { font-size: 1.45rem; }
.page-head p { margin: 3px 0 0; color: var(--muted); font-size: .9rem; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sec { font-size: 1.02rem; margin: 22px 0 10px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.panel h2 { font-size: 1rem; margin-bottom: 8px; }
.panel p { margin: 0; }
.panel.narrow { max-width: 460px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.panel.narrow .btn { align-self: flex-start; }
.panel.soon { border-style: dashed; box-shadow: none; background: transparent; }
.add-row { display: flex; flex-wrap: wrap; gap: 8px; }
.add-row .inp { flex: 1 1 220px; width: auto; }
.picker { max-width: 320px; margin-bottom: 14px; }

/* ---------- stats and cards ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat span { display: block; font-size: .84rem; font-weight: 600; color: var(--muted); }
.stat b { display: block; margin-top: 2px; font-size: 1.75rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.meter { height: 8px; margin-bottom: 7px; background: #e9edf2; border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
.meter.warn i { background: #dc6803; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--teal); box-shadow: 0 8px 22px rgba(16, 24, 40, .09); }
.card.off { opacity: .65; }
.card-title { font-weight: 700; font-size: 1.05rem; padding-right: 36px; }
.card-title small { font-weight: 500; color: var(--muted); }
.card-meta { font-size: .84rem; color: var(--muted); }
.card-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; padding-top: 10px; border-top: 1px solid #edf0f4; font-size: .8rem; color: var(--muted); }
.card-nums b { color: var(--navy); font-size: .95rem; }
.tag { position: absolute; top: 14px; right: 14px; padding: 1px 8px; border-radius: 6px; font-size: .72rem; font-weight: 600; background: #eef0f3; color: var(--muted); }

/* ---------- lists ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 12px 16px; }
.row + .row { border-top: 1px solid #edf0f4; }
.row.is-off { background: #fafbfc; }
.row.is-off .row-main { opacity: .6; }
.row-main { flex: 1 1 240px; min-width: 0; }
.row-main strong { display: block; font-weight: 600; }
.row.log .row-main strong { display: inline; }
.row-main small { display: block; font-size: .82rem; color: var(--muted); }
.row-main small.inline { display: inline; font-weight: 500; }
.row-main a { text-decoration: none; }
.row-main a:hover { text-decoration: underline; }
.row-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.count { min-width: 26px; padding: 1px 8px; text-align: center; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--navy); background: #e8eef5; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.tight { margin-top: 5px; }
.chip { padding: 2px 9px; border-radius: 6px; font-size: .78rem; font-weight: 500; color: var(--teal-ink); background: #e4f6f5; }
.badge { padding: 2px 9px; border-radius: 6px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.r-constituency_admin { color: #fff; background: var(--navy); }
.r-staff { color: #1849a9; background: #eaf1ff; }
.r-officer { color: var(--teal-ink); background: #e4f6f5; }
.r-main_admin { color: #fff; background: #111827; }
.dot { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #a0a9b5; }
.dot.on { color: var(--ok); }
.dot.on::before { background: #12b76a; }
.empty { text-align: center; padding: 34px 16px; }
.empty p { margin: 4px 0 14px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.filters .fl { flex: 1 1 150px; }
.filters .fl.grow { flex: 2 1 220px; }
.filters .picker { max-width: none; margin: 0; }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 18px; }
.details span { display: block; font-size: .8rem; color: var(--muted); }
.details b { font-weight: 600; }

/* ---------- dialog ---------- */
dialog { width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 16px; color: inherit; box-shadow: 0 24px 60px rgba(16, 24, 40, .3); }
dialog::backdrop { background: rgba(16, 24, 40, .45); }
.dlg { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.dlg header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dlg h2 { font-size: 1.05rem; }
.dlg-body { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; overflow-y: auto; }
.dlg-body p { margin: 0; }
.dlg footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #f8f9fb; }
.checks { margin: 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.checks legend { padding: 0 5px; font-size: .86rem; font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: .9rem; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--navy); }
.cred { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 12px 14px; background: #f4f6f9; border-radius: 10px; }
.cred span { color: var(--muted); font-size: .86rem; }
.cred b { font-family: ui-monospace, Consolas, monospace; font-size: 1rem; user-select: all; word-break: break-all; }
.warn-box { padding: 9px 12px; border-radius: 8px; font-size: .86rem; color: #7a4d00; background: #fff8e6; }

.toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: calc(100% - 24px); }
.toast { padding: 10px 15px; border-radius: 9px; font-size: .88rem; color: #fff; background: #17202b; box-shadow: 0 8px 24px rgba(16, 24, 40, .22); transition: opacity .3s; }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }
.toast.out { opacity: 0; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .side { display: none; }
  .mobile-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .mobile-top img { width: 30px; height: 30px; object-fit: contain; }
  .mobile-top div { flex: 1; min-width: 0; }
  .mobile-top strong { display: block; font-size: .95rem; line-height: 1.2; }
  .mobile-top small { display: block; font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .view { padding: 16px 12px 88px; }
  .page-head h1 { font-size: 1.28rem; }
  .head-actions, .head-actions .btn { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat b { font-size: 1.45rem; }
  .cards { grid-template-columns: 1fr; }
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
    padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line);
  }
  .bottom-nav a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; font-size: .66rem; font-weight: 500; text-decoration: none; color: var(--muted); }
  .bottom-nav a span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bottom-nav a.active { color: var(--navy); font-weight: 700; box-shadow: inset 0 2px 0 var(--teal); }
  .row-btns { width: 100%; }
  .row-btns .btn { flex: 1 1 auto; }
  .add-row .btn { width: 100%; }
  .filters .fl { flex: 1 1 40%; }
  .filters .fl.grow, .filters .picker { flex: 1 1 100%; }
  dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: 16px 16px 0 0; }
}
/* ---------- Punjabi with English sub-line ---------- */
.pa { font-weight: inherit; }
.en { font-size: .82em; font-weight: 400; color: var(--muted); }
h1 .en, h2 .en, .stack .en, .stat .en, .tile .en { display: block; font-size: .78em; }
h1 .en { font-size: .6em; margin-top: 1px; }
h2 .en { font-size: .78em; font-weight: 400; }
label.fl .en { margin-left: 2px; }
.btn .en { font-size: .8em; opacity: .85; color: inherit; font-weight: 400; }
.btn.primary .en { color: #fff; }
.side-nav .nav-label { display: flex; flex-direction: column; line-height: 1.2; }
.side-nav .en { font-size: .7rem; color: rgba(255, 255, 255, .6); }
.side-nav a.active .en { color: rgba(255, 255, 255, .85); }
.bottom-nav .nav-label { display: flex; flex-direction: column; align-items: center; line-height: 1.15; max-width: 100%; }
.bottom-nav .pa { font-size: .74rem; }
.bottom-nav .en { font-size: .58rem; }
.badge .en { color: inherit; opacity: .8; }
.dot .en { color: inherit; opacity: .8; }
.row-link { text-decoration: none; color: inherit; }
.row-link:hover strong { text-decoration: underline; }
.link-row { text-decoration: none; color: inherit; transition: background .15s; }
.link-row:hover { background: #f7f9fb; }

/* ---------- applications ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-bottom: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 11px; text-align: left; cursor: pointer;
  font: inherit; font-size: .84rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); transition: border-color .15s, background .15s;
}
.tile:hover { border-color: var(--line-strong); }
.tile b { font-size: 1.35rem; font-weight: 700; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile.on { border-color: var(--navy); background: #eef3f9; box-shadow: 0 0 0 1px var(--navy); }
.tile:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.result-count { margin: 0 2px 8px; }
.app-row { align-items: flex-start; }
.app-no { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .03em; color: var(--teal-ink); font-variant-numeric: tabular-nums; }
.app-text { margin: 4px 0 0; font-size: .86rem; color: #3a4552; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; text-align: right; }
.app-side small { font-size: .74rem; color: var(--muted); }
.chip.warn { color: #b54708; background: #fef4e6; }
.chip.plain { color: #344054; background: #eef1f4; }
.st { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.st .en { color: inherit; opacity: .8; margin-left: 2px; }
.st-new { color: #b54708; background: #fef4e6; }
.st-assigned { color: #1849a9; background: #eaf1ff; }
.st-in_progress { color: #5925dc; background: #f1edff; }
.st-solved { color: #067647; background: #e7f8ef; }
.st-closed { color: #475467; background: #eef1f4; }
.st-returned { color: #b42318; background: #fdeceb; }
.mini-counts { display: flex; gap: 12px; }
.mc { display: flex; flex-direction: column; align-items: center; min-width: 44px; line-height: 1.15; }
.mc b { font-size: 1.05rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.mc small { font-size: .66rem; color: var(--muted); white-space: nowrap; }
.card-big { font-size: .82rem; color: var(--muted); }
.card-big b { font-size: 1.5rem; font-weight: 700; color: var(--navy); margin-right: 3px; }
.back { display: inline-block; margin-bottom: 10px; font-size: .88rem; font-weight: 600; color: var(--navy); text-decoration: none; }
.back:hover { text-decoration: underline; }

/* ---------- one application ---------- */
.stepper { display: flex; list-style: none; margin: 0 0 14px; padding: 14px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stepper li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; font-size: .78rem; color: var(--muted); }
.stepper li::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line-strong); }
.stepper li:first-child::before { display: none; }
.stepper i { position: relative; z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-style: normal; font-size: .8rem; font-weight: 700; color: var(--muted); background: #eef1f4; }
.stepper li.done { color: var(--text); }
.stepper li.done i { color: #fff; background: var(--teal); }
.stepper li.done::before, .stepper li.now::before { background: var(--teal); }
.stepper li.now { color: var(--navy); font-weight: 700; }
.stepper li.now i { color: #fff; background: var(--navy); box-shadow: 0 0 0 4px #dfe8f2; }
.stepper.back-state li.now i { background: var(--danger); box-shadow: 0 0 0 4px #fdeceb; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; margin-top: 14px; }
.details.one { grid-template-columns: 1fr; }
.details .en { display: inline; }
.details a { text-decoration: none; color: var(--navy); }
.details a:hover { text-decoration: underline; }
.top-gap { margin-top: 12px; padding-top: 12px; border-top: 1px solid #edf0f4; }
.pre { white-space: pre-wrap; word-break: break-word; margin: 0; }
.timeline { list-style: none; margin: 4px 0 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: -2px; width: 2px; background: var(--line); }
.tl-dot { flex: none; width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; border: 3px solid currentColor; background: #fff !important; }
.timeline p { margin: 5px 0 2px; font-size: .9rem; }
.timeline small { display: block; font-size: .76rem; color: var(--muted); }
.usage { margin-top: 16px; }
.usage p { font-size: .84rem; }
.check .stack .en { font-size: .74rem; }

@media (max-width: 980px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .tile { padding: 8px 9px; font-size: .78rem; }
  .tile b { font-size: 1.15rem; }
  .bottom-nav { overflow-x: auto; scrollbar-width: none; }
  .bottom-nav::-webkit-scrollbar { display: none; }
  .bottom-nav a { flex: 1 0 66px; }
  .bottom-nav .nav-label { overflow: hidden; }
  .bottom-nav .nav-label .en, .bottom-nav .nav-label .pa { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app-row .app-side { flex-direction: row; justify-content: space-between; align-items: center; width: 100%; }
  .stepper { padding: 12px 2px; }
  .stepper li { font-size: .68rem; }
  .stepper i { width: 24px; height: 24px; }
  .stepper li::before { top: 11px; }
  .checks { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- application form ---------- */
.req { color: var(--danger); font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; margin-bottom: 14px; }
.app-form > .fl { margin-bottom: 14px; }
.portal { margin-left: 6px; font-size: .78rem; font-weight: 600; color: #b42318; }
.fixed { display: flex; flex-direction: column; justify-content: center; min-height: 42px; padding: 4px 12px; border-radius: 9px; background: #f1f4f8; font-weight: 600; }
.rt-wrap { border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; }
.rt-wrap:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(14, 53, 97, .14); }
.rt-bar { display: flex; gap: 2px; padding: 5px; background: #f4f6f9; border-bottom: 1px solid var(--line); }
.rt-bar button { min-width: 36px; height: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: none; font: inherit; font-size: .88rem; cursor: pointer; }
.rt-bar button:hover { background: #fff; border-color: var(--line-strong); }
.rt { min-height: 150px; padding: 10px 12px; font-weight: 400; font-size: 16px; line-height: 1.55; outline: none; }
.rich { line-height: 1.6; word-break: break-word; }
.rich ul, .rich ol, .rt ul, .rt ol { margin: 4px 0; padding-left: 22px; }
.rich p { margin: 0 0 6px; }
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; font-weight: 400; }
.slots.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.slot { position: relative; display: grid; place-items: center; height: 104px; overflow: hidden; text-align: center; color: var(--muted); font-size: .84rem; background: #f8f9fb; border: 1.5px dashed var(--line-strong); border-radius: 10px; cursor: pointer; }
.slot:hover { border-color: var(--navy); }
.slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2; }
.slot-empty .en { display: block; }
.slot-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.form-end { display: flex; justify-content: flex-end; margin-top: 8px; }
.btn.big { min-height: 48px; padding: 0 30px; font-size: 1rem; }
.done-card { text-align: center; padding: 34px 18px; }
.done-tick { width: 58px; height: 58px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; font-size: 1.6rem; color: #fff; background: var(--ok); }
.done-card h1 { font-size: 1.3rem; }
.app-no.big { font-size: 1.15rem; margin: 10px 0 2px; }
.done-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
textarea.inp.area { height: auto; min-height: 92px; padding: 9px 12px; resize: vertical; line-height: 1.5; }

/* ---------- actions, images, nav count ---------- */
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.action-bar .warn-box { flex: 1 1 100%; margin: 0; }
.btn.danger { color: var(--danger); border-color: #f0b9b4; }
.btn.danger:hover { background: #fdeceb; }
.officer-lines { display: flex; flex-direction: column; gap: 3px; }
.wa { margin-left: 4px; padding: 1px 7px; border-radius: 5px; font-size: .72rem; font-weight: 600; color: #067647 !important; background: #e7f8ef; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.thumbs.small { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); margin: 6px 0; }
.thumb { padding: 0; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f1f4f8; cursor: zoom-in; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.viewer img { display: block; max-width: 100%; max-height: calc(100dvh - 90px); margin: auto; object-fit: contain; }
.st-note { color: #475467; background: #eef1f4; }
.chip.late { color: #b42318; background: #fdeceb; }
.nb { min-width: 19px; padding: 0 5px; margin-left: auto; text-align: center; border-radius: 999px; font-size: .7rem; font-weight: 700; line-height: 19px; color: #fff; background: #dc6803; }
.bottom-nav a { position: relative; }
.bottom-nav .nb { position: absolute; top: 3px; right: 10px; margin: 0; line-height: 16px; min-width: 16px; font-size: .62rem; }

/* ---------- reports and lists ---------- */
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 12px; background: #e9edf2; border-radius: 10px; width: fit-content; max-width: 100%; }
.seg button { padding: 6px 12px; border: 0; border-radius: 7px; background: none; font: inherit; font-size: .86rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { color: var(--navy); background: var(--surface); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.days { flex: 0 1 110px !important; }
.setting { margin-top: 14px; }
.sec-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin: 18px 0 8px; }
.sec-row .sec { margin: 0; }
.top-note { margin: 10px 2px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.report { width: 100%; border-collapse: collapse; font-size: .86rem; }
.report th { padding: 9px 12px; text-align: left; font-size: .8rem; font-weight: 600; white-space: nowrap; background: #f8f9fb; border-bottom: 1px solid var(--line); }
.report th .en { display: block; font-size: .72rem; }
.report td { padding: 9px 12px; border-bottom: 1px solid #edf0f4; }
.report tr:last-child td { border-bottom: 0; }
.report .num { text-align: right; font-variant-numeric: tabular-nums; }
.report td.late { font-weight: 700; color: var(--danger); }

@media (max-width: 760px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-end .btn { width: 100%; }
  .action-bar .btn { flex: 1 1 auto; }
  .seg { width: 100%; }
  .seg button { flex: 1 1 auto; }
  .done-btns .btn { flex: 1 1 100%; }
}

/* ---------- top section buttons ---------- */
.section-bar { position: sticky; top: 0; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 26px; background: rgba(244, 246, 249, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.section-tabs { display: flex; gap: 4px; padding: 4px; background: #e6ebf1; border-radius: 12px; }
.section-tabs a { display: flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 9px; text-decoration: none; font-weight: 600; font-size: .95rem; color: var(--muted); transition: background .2s, color .2s, box-shadow .2s, transform .15s; }
.section-tabs a:active { transform: scale(.97); }
.section-tabs a span { line-height: 1.15; }
.section-tabs .en { display: block; font-size: .7rem; font-weight: 400; color: inherit; opacity: .85; }
.section-tabs a.on { color: #fff; background: var(--navy); box-shadow: 0 2px 8px rgba(14, 53, 97, .3); }
.section-tabs a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.top-search { flex: 1 1 220px; max-width: 420px; margin-left: auto; }
.top-search .inp { height: 40px; }

/* ---------- things that open ---------- */
button.stat, a.stat { display: block; width: 100%; font: inherit; text-align: left; color: inherit; text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
button.stat:hover, a.stat:hover { transform: translateY(-3px); border-color: var(--teal); box-shadow: 0 10px 24px rgba(16, 24, 40, .1); }
button.stat:active, a.stat:active, .card:active, .tile:active, .alert:active { transform: scale(.98); }
button.stat:focus-visible, a.stat:focus-visible, .alert:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.stat span .en { display: block; font-size: .76rem; font-weight: 400; }
.alert-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.alert { flex: 1 1 220px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; text-align: left; font: inherit; font-size: .9rem; font-weight: 600; border: 1px solid; border-radius: 10px; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.alert b { font-size: 1.35rem; }
.alert .en { display: block; font-size: .74rem; font-weight: 400; color: inherit; opacity: .85; }
.alert:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(16, 24, 40, .1); }
.alert.late { color: #b42318; background: #fdeceb; border-color: #f6c7c3; }
.alert.due { color: #93530b; background: #fef4e6; border-color: #f8dcb4; }
.clicky { cursor: pointer; transition: background .15s; }
.clicky:hover { background: #f4f7fa; }
.chip-btn { border: 0; font: inherit; font-size: .84rem; padding: 5px 12px; cursor: pointer; transition: transform .15s; }
.chip-btn:hover { transform: translateY(-1px); }

/* ---------- application rows ---------- */
.app-row, .feed-row { cursor: pointer; transition: background .15s; }
.app-row:hover, .feed-row:hover { background: #f7f9fb; }
.app-row.picked { background: #eef4fb; box-shadow: inset 3px 0 0 var(--navy); }
.app-row .app-no { text-decoration: none; }
.pick { flex: none; display: flex; align-items: flex-start; padding: 2px 4px 8px 0; cursor: pointer; }
.pick input { width: 19px; height: 19px; margin: 0; accent-color: var(--navy); cursor: pointer; }
.app-text.one { -webkit-line-clamp: 1; }
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 2px 6px; }
.result-bar .result-count { margin: 0; }
.filter-tag { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 12px; margin-bottom: 8px; font-size: .86rem; border-radius: 9px; background: #e8eef5; }
.pickbar { position: sticky; bottom: 12px; z-index: 12; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-top: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--navy); border-radius: 12px; box-shadow: 0 10px 28px rgba(16, 24, 40, .2); animation: slideUp .25s ease both; }
.pickbar strong { color: var(--navy); font-size: .92rem; }
.pick-btns { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- animation ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulseRing { 0%, 100% { box-shadow: 0 0 0 4px #dfe8f2; } 50% { box-shadow: 0 0 0 7px #eef3f8; } }
@keyframes badgePop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes grow { from { width: 0; } }
.view.enter > * { animation: rise .35s ease both; }
.view.enter > *:nth-child(2) { animation-delay: .04s; }
.view.enter > *:nth-child(3) { animation-delay: .08s; }
.view.enter > *:nth-child(4) { animation-delay: .12s; }
.view.enter > *:nth-child(n+5) { animation-delay: .16s; }
.view.enter .stats > *, .view.enter .cards > *, .view.enter .tiles > *, .view.enter .list > * { animation: rise .35s ease both; }
.view.enter .stats > *:nth-child(2), .view.enter .cards > *:nth-child(2), .view.enter .tiles > *:nth-child(2), .view.enter .list > *:nth-child(2) { animation-delay: .05s; }
.view.enter .stats > *:nth-child(3), .view.enter .cards > *:nth-child(3), .view.enter .tiles > *:nth-child(3), .view.enter .list > *:nth-child(3) { animation-delay: .1s; }
.view.enter .stats > *:nth-child(4), .view.enter .cards > *:nth-child(4), .view.enter .tiles > *:nth-child(4), .view.enter .list > *:nth-child(4) { animation-delay: .15s; }
.view.enter .stats > *:nth-child(n+5), .view.enter .cards > *:nth-child(n+5), .view.enter .tiles > *:nth-child(n+5), .view.enter .list > *:nth-child(n+5) { animation-delay: .2s; }
dialog[open] { animation: pop .22s ease both; }
dialog[open]::backdrop { animation: fade .22s ease both; }
.toast { animation: slideUp .25s ease both; }
.nb { animation: badgePop .3s ease both; }
.btn { transition: background .15s, border-color .15s, transform .12s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.meter i { animation: grow .7s ease both; }
.stepper li.now i { animation: pulseRing 2s ease-in-out infinite; }
.stepper.back-state li.now i { animation: none; }
.side-nav a { transition: background .15s, transform .15s; }
.side-nav a:hover { transform: translateX(2px); }
.bottom-nav a { transition: color .15s; }
.bottom-nav a svg { transition: transform .15s; }
.bottom-nav a.active svg { transform: translateY(-1px) scale(1.08); }

@media (max-width: 760px) {
  .section-bar { position: static; padding: 8px 12px; gap: 8px; }
  .section-tabs { flex: 1 1 100%; }
  .section-tabs a { flex: 1; justify-content: center; padding: 7px 8px; }
  .top-search { flex: 1 1 100%; max-width: none; margin: 0; }
  .pickbar { bottom: 66px; }
  .pick-btns { width: 100%; }
  .pick-btns .btn { flex: 1 1 auto; }
  .app-row .pick { padding-top: 0; }
  .app-row .row-main { flex: 1 1 200px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- shared finish and accessible controls ---------- */
:root {
  --navy: #123b62;
  --navy-2: #1b527f;
  --teal: #0a9f9b;
  --teal-ink: #087b78;
  --bg: #f0f4f7;
  --text: #1b3042;
  --muted: #526778;
  --line: #dce6ec;
  --line-strong: #bccbd5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 59, 98, .04), 0 7px 22px rgba(18, 59, 98, .045);
}
body { line-height: 1.55; }
button, input, select, textarea { font-family: var(--font); }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, .slot:focus-within { outline: 3px solid var(--teal); outline-offset: 2px; }
.inp { min-height: 46px; height: 46px; border-radius: 10px; }
.inp::placeholder { color: #718391; }
.btn { min-height: 44px; border-radius: 10px; }
.btn.sm { min-height: 36px; }
.btn.primary { box-shadow: 0 3px 9px rgba(18, 59, 98, .13); }
.btn:disabled { box-shadow: none; }
.icon-btn { width: 40px; height: 40px; }
.page-head { align-items: center; gap: 14px; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(1.35rem, 1.7vw, 1.7rem); letter-spacing: -.018em; }
.page-head p { font-size: .91rem; }
.view { max-width: 1160px; padding: 28px 30px 64px; }
.side { width: 250px; padding: 20px 13px 14px; background: linear-gradient(165deg, #123b62 0%, #102e4d 100%); }
.side-brand { padding: 3px 9px 23px; }
.side-brand img { width: 39px; height: 39px; }
.side-nav { gap: 3px; }
.side-nav a { min-height: 48px; padding: 9px 12px; border-radius: 11px; }
.side-nav a.active { background: rgba(255, 255, 255, .15); box-shadow: inset 3px 0 0 #40c8c3; }
.side-nav .en { color: rgba(255, 255, 255, .7); }
.side-me { padding: 16px 9px 3px; }
.section-bar { background: rgba(240, 244, 247, .94); padding: 10px 30px; }
.section-tabs { background: #dfe8ee; }
.section-tabs a:not(.on):hover { background: #fff; color: var(--navy); }
.top-search .inp { height: 44px; }
.panel, .stat, .card, .list, .table-wrap { border-color: var(--line); }
.stat { padding: 17px 18px; }
.stat b { letter-spacing: -.035em; }
.row { padding: 14px 17px; }
.row + .row { border-top-color: #e8eef2; }
.row-main strong { line-height: 1.4; }
.row-main small { line-height: 1.45; }
.link-row:hover, .app-row:hover, .feed-row:hover { background: #f3f8fa; }
.card:focus-visible, .tile:focus-visible, .link-row:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.filters { gap: 12px; }
.filters .fl { min-width: 0; }
.empty { padding: 42px 20px; }
.empty p { max-width: 48ch; margin: 5px auto 15px; }
.login { background: radial-gradient(circle at 12% 10%, rgba(10, 159, 155, .11), transparent 30%), radial-gradient(circle at 92% 92%, rgba(18, 59, 98, .1), transparent 35%), var(--bg); }
.login-card { max-width: 430px; gap: 16px; padding: 34px; border-radius: 20px; box-shadow: 0 16px 50px rgba(18, 59, 98, .09); }
.login-logo { width: 56px; height: 56px; }
.login-card h1 { font-size: 1.6rem; color: var(--navy); }
.login-card > .stack { color: var(--muted); }
.password-field { position: relative; display: block; }
.password-field .inp { padding-right: 112px; }
.password-toggle { position: absolute; top: 4px; right: 4px; min-height: 38px; max-width: 108px; padding: 0 8px; border: 0; border-radius: 7px; color: var(--navy); background: transparent; font-size: .76rem; font-weight: 700; cursor: pointer; }
.password-toggle:hover { background: #eaf1f5; }
.password-toggle:focus-visible { outline-offset: -2px; }
.mobile-menu-open, .mobile-more { display: none; }

@media (max-width: 760px) {
  .view { padding: 18px 14px calc(96px + env(safe-area-inset-bottom)); }
  .mobile-top { min-height: 58px; padding: 8px 14px; box-shadow: 0 2px 10px rgba(18, 59, 98, .04); }
  .mobile-top img { width: 34px; height: 34px; }
  .mobile-menu-open { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); cursor: pointer; }
  .mobile-menu-open svg { width: 22px; height: 22px; }
  .section-bar { padding: 9px 14px; }
  .section-tabs { width: 100%; }
  .section-tabs a { min-height: 44px; }
  .top-search .inp { height: 46px; }
  .page-head { align-items: stretch; }
  .head-actions .btn { min-height: 46px; }
  .stats { gap: 9px; }
  .stat { padding: 14px; }
  .row { padding: 13px 14px; }
  .bottom-nav { min-height: 62px; overflow: visible; box-shadow: 0 -5px 22px rgba(18, 59, 98, .09); }
  .bottom-nav a, .bottom-nav .mobile-more { flex: 1 1 0; min-width: 0; min-height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 5px 2px; border: 0; border-radius: 0; background: transparent; color: var(--muted); text-decoration: none; font: inherit; font-weight: 600; cursor: pointer; }
  .bottom-nav a svg, .bottom-nav .mobile-more svg { width: 20px; height: 20px; }
  .bottom-nav .mobile-more span { font-size: .72rem; }
  .bottom-nav a.active, .bottom-nav .mobile-more.active { color: var(--navy); background: #edf5f7; box-shadow: inset 0 3px 0 var(--teal); }
  .bottom-nav a:focus-visible, .bottom-nav .mobile-more:focus-visible { outline-offset: -4px; }
  .bottom-nav .pa { font-size: .7rem; }
  .bottom-nav .en { font-size: .55rem; }
  .bottom-nav .nb { top: 2px; right: 7px; }
  .mobile-menu[open] { width: min(440px, 100%); max-height: min(82dvh, 740px); margin: auto 0 0 auto; padding: 0 0 env(safe-area-inset-bottom); border-radius: 18px 18px 0 0; background: #fff; }
  .mobile-menu-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 17px; background: #fff; border-bottom: 1px solid var(--line); }
  .mobile-menu-head strong { font-size: 1.08rem; color: var(--navy); }
  .mobile-menu-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: calc(82dvh - 142px); padding: 14px; overflow-y: auto; }
  .mobile-menu-links a { display: flex; align-items: center; gap: 10px; min-height: 57px; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
  .mobile-menu-links a.active { border-color: #90cfcc; background: #e9f7f6; color: var(--navy); }
  .mobile-menu-links .nav-label { min-width: 0; line-height: 1.2; }
  .mobile-menu-links .pa { display: block; font-size: .81rem; font-weight: 700; }
  .mobile-menu-links .en { display: block; margin-top: 2px; font-size: .67rem; }
  .mobile-menu-links .nb { display: none; }
  .mobile-menu-logout { width: calc(100% - 28px); margin: 0 14px 14px; }
  .pickbar { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .login-card { padding: 28px 22px; }
}
