@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/ibm-plex-sans-arabic-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }

:root {
  --bg: #f3f6f4;
  --panel: #ffffff;
  --panel-2: #f7faf8;
  --ink: #16302d;
  --ink-2: #4a5d59;
  --ink-3: #7a8a86;
  --line: #dde6e2;
  --line-2: #ecf1ee;
  --brand: #10645f;
  --brand-2: #1a9466;
  --brand-soft: #e2f3ec;
  --grad: linear-gradient(90deg, #20ad65 0%, #1a9a72 55%, #117a7e 100%);
  --ok: #1c8a55;
  --ok-soft: #dff3e8;
  --wait: #b77a12;
  --wait-soft: #fbf0d9;
  --bad: #b5473a;
  --bad-soft: #f8e4e0;
  --off: #9aa19e;
  --off-soft: #eeeeeb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28, 36, 34, .05), 0 4px 16px rgba(28, 36, 34, .04);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.boot { padding: 80px 20px; text-align: center; color: var(--ink-3); }
.hidden { display: none !important; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login {
  width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 32px 28px; box-shadow: var(--shadow);
}
.login { position: relative; overflow: hidden; }
.login::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.login .logo { display: block; width: 150px; height: auto; margin: 0 auto 18px; }
.login h1, .login > p { text-align: center; }
.login h1 { margin: 0 0 4px; font-size: 21px; }
.login p { margin: 0 0 22px; color: var(--ink-3); font-size: 14px; }
.role-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.role-pick label {
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 6px; text-align: center; cursor: pointer;
  font-size: 14px; font-weight: 500; transition: .15s;
}
.role-pick input { display: none; }
.role-pick input:checked + span { color: var(--brand); }
.role-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  background: var(--panel); border-inline-end: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 3px;
}
.side::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.side .brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 20px; margin-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.side .brand img { width: 40px; height: auto; flex: none; }
.side .brand b { display: block; font-size: 15px; line-height: 1.3; color: var(--brand); }
.side .brand span { font-size: 12px; color: var(--ink-3); }
.nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--ink-2);
  padding: 9px 12px; border-radius: 8px; cursor: pointer; text-align: start; font-size: 14.5px; position: relative;
}
.nav-btn:hover { background: var(--panel-2); color: var(--ink); }
.nav-btn.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-btn.on::after { content: ""; position: absolute; right: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--grad); }
.nav-btn svg { width: 18px; height: 18px; flex: none; }
.nav-btn .count { margin-inline-start: auto; background: var(--bad); color: #fff; font-size: 11.5px; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.side .who { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink-3); }
.side .who b { color: var(--ink); font-weight: 600; }
.side .who button { background: none; border: 0; color: var(--bad); cursor: pointer; padding: 0; margin-top: 4px; font-size: 13px; }

.main { padding: 26px 30px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 23px; letter-spacing: -.2px; }
.page-head .sub { color: var(--ink-3); font-size: 14px; margin-top: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.topbar { display: none; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap;
  text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: #c3d2cc; background: var(--panel-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary { background-image: linear-gradient(90deg, #179a63, #10645f); border-color: #10645f; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: none; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.field > span i { font-style: normal; color: var(--bad); }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 11px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 74px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16, 100, 95, .14); }
input[type=date].input, input[type=month].input { direction: ltr; text-align: right; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14.5px; }
.check input { width: 18px; height: 18px; accent-color: var(--ok); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters .input { width: auto; min-width: 150px; }
.filters .search { flex: 1; min-width: 220px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 7px 13px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* ---------- cards / stats ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card h3 { margin: 0 0 12px; font-size: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 15px 16px; position: relative; overflow: hidden; }
.stat.lead::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); }
.stat .k { font-size: 13px; color: var(--ink-3); }
.stat .v { font-size: 28px; font-weight: 700; line-height: 1.25; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 15px; font-weight: 500; color: var(--ink-3); }
.stat .f { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.stat.alert .v { color: var(--bad); }

.dash-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }
.dash-grid > .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 1px 9px; border-radius: 99px; white-space: nowrap; line-height: 21px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.active { background: var(--ok-soft); color: var(--ok); }
.pill.stopped { background: var(--off-soft); color: #6b726f; }
.pill.upcoming { background: var(--wait-soft); color: var(--wait); }
.pill.archived { background: #ece7f3; color: #6a5a88; }
.pill.none { background: var(--off-soft); color: #6b726f; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; font-size: 13px; line-height: 24px; }
.chip em { font-style: normal; color: var(--ink-3); font-size: 12px; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--ink-3); direction: ltr; unicode-bidi: isolate; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: start; font-weight: 600; font-size: 12.5px; color: var(--ink-3); padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #f6faf8; }
.gov-row td { background: var(--panel-2); font-weight: 700; font-size: 13.5px; color: var(--brand); padding-top: 8px; padding-bottom: 8px; }

/* ---------- report grid ---------- */
.rgrid { border-collapse: separate; border-spacing: 0; font-size: 13.5px; width: 100%; }
.rgrid th, .rgrid td { border-bottom: 1px solid var(--line-2); padding: 6px 6px; text-align: center; }
.rgrid th { font-size: 12.5px; color: var(--ink-3); font-weight: 600; background: var(--panel-2); position: sticky; top: 0; z-index: 1; }
.rgrid th.name, .rgrid td.name { text-align: start; position: sticky; right: 0; background: #fff; z-index: 2; min-width: 200px; padding-inline: 14px; border-inline-start: 1px solid var(--line-2); }
.rgrid th.name { background: var(--panel-2); z-index: 3; }
.rgrid td.name b { font-weight: 600; }
.rgrid tr.gov td { background: var(--panel-2); color: var(--brand); font-weight: 700; text-align: start; padding-inline: 14px; position: static; }
.cell {
  width: 38px; height: 32px; border-radius: 7px; display: inline-grid; place-items: center; border: 1px solid transparent;
  cursor: pointer; font-weight: 700; font-size: 13px; background: none; padding: 0;
}
.cell.off { color: #c8ccc9; cursor: default; }
.cell.future { color: #d5d8d6; cursor: default; }
.cell.due { border: 1px dashed #e0a79e; color: var(--bad); background: #fdf6f4; }
.cell.open { border: 1px dashed var(--line); color: var(--ink-3); }
.cell.sent { background: var(--wait-soft); color: var(--wait); border-color: #f0d9a8; }
.cell.reviewed { background: var(--ok-soft); color: var(--ok); border-color: #bfe0c9; }
.cell:not(.off):not(.future):hover { outline: 2px solid var(--brand); outline-offset: 1px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin: 0 0 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .cell { width: 26px; height: 22px; cursor: default; font-size: 11px; }

/* ---------- tent detail ---------- */
.detail-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.detail-head h2 { margin: 0; font-size: 24px; }
.detail-head .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; color: var(--ink-2); font-size: 14px; }
.back { background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 0; margin-bottom: 8px; font-size: 14px; }
.back:hover { color: var(--brand); }
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.detail-grid > .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 11px 18px; border-bottom: 1px solid var(--line-2); display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.list > li:last-child { border-bottom: 0; }
.list .row-actions { display: flex; gap: 2px; flex: none; }
.empty { padding: 22px 18px; color: var(--ink-3); font-size: 14px; text-align: center; }

.person { display: flex; gap: 10px; align-items: flex-start; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 14px; }
.avatar.past { background: var(--off-soft); color: var(--off); }
.person b { font-weight: 600; }
.person .r { font-size: 13px; color: var(--ink-2); }
.person .d { font-size: 12.5px; color: var(--ink-3); }
.replace-note { font-size: 12.5px; color: var(--wait); }

.timeline { list-style: none; margin: 0; padding: 4px 18px 10px; }
.timeline li { position: relative; padding: 8px 18px 8px 0; border-inline-start: 2px solid var(--line); margin-inline-start: 6px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; right: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); }
.timeline li .when { color: var(--ink-3); font-size: 12px; }

.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { display: flex; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); font-size: 14px; align-items: flex-start; }
.alerts li:last-child { border-bottom: 0; }
.alerts .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; flex: none; }
.alerts .dot.bad { background: var(--bad); }
.alerts .dot.wait { background: var(--wait); }
.alerts .dot.info { background: var(--brand-2); }
.alerts a { cursor: pointer; text-decoration: none; font-weight: 600; }

.bars { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.bar-row { display: grid; grid-template-columns: 82px 1fr 64px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar { height: 10px; border-radius: 6px; background: var(--line-2); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.bar i.a { background: var(--brand); }
.bar i.s { background: #c9cdca; }
.bar-row .n { text-align: left; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* ---------- map ---------- */
.map { height: 560px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.map.small { height: 300px; }
.map.picker { height: 260px; margin-bottom: 6px; }
.leaflet-container { font-family: var(--font); }
.leaflet-popup-content { direction: rtl; text-align: right; margin: 12px 14px; font-size: 13.5px; line-height: 1.6; }
.leaflet-popup-content b { font-size: 14.5px; }
.pin { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.pin.active { background: var(--ok); }
.pin.stopped { background: var(--off); }
.pin.upcoming { background: var(--wait); }
.pin.archived { background: #8c7bab; }
.pin.sel { background: var(--bad); }
.map-legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); margin-top: 8px; flex-wrap: wrap; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend .pin { width: 12px; height: 12px; border-width: 2px; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 26, 24, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 24px; z-index: 1000; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head .x { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink-3); }
.modal-body { padding: 18px 22px 6px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-start; padding: 12px 22px 18px; flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
.note-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 14px; }
.section-label { font-size: 12.5px; font-weight: 700; color: var(--brand); margin: 6px 0 10px; letter-spacing: .2px; }
.divider { height: 1px; background: var(--line-2); margin: 6px 0 16px; }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
#toast div { background: var(--ink); color: #fff; padding: 9px 18px; border-radius: 9px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.2); animation: tin .2s ease; }
#toast div.err { background: var(--bad); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- audit ---------- */
.audit-item { display: grid; grid-template-columns: 130px 90px 1fr; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.audit-item .when { color: var(--ink-3); font-size: 12.5px; direction: ltr; text-align: right; }
.audit-item .who { color: var(--ink-2); font-weight: 600; font-size: 12.5px; }
.audit-item details { margin-top: 4px; }
.audit-item summary { cursor: pointer; color: var(--ink-3); font-size: 12.5px; }
.audit-item pre { white-space: pre-wrap; font-size: 12px; background: var(--panel-2); padding: 8px; border-radius: 6px; margin: 6px 0 0; direction: rtl; font-family: inherit; }

/* ---------- print header ---------- */
.print-head { display: none; align-items: center; gap: 12px; border-bottom: 2px solid var(--brand); padding-bottom: 10px; margin-bottom: 14px; }
.print-head img { width: 46px; }
.print-head b { display: block; font-size: 16px; color: var(--brand); }

/* ---------- print ---------- */
@media print {
  .print-head { display: flex !important; }
  .side, .topbar, .actions, .filters, .no-print, #toast, .btn { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  body { background: #fff; font-size: 12px; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  table.t td, table.t th { padding: 5px 7px; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-grid, .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { display: block; }
  .side {
    position: fixed; bottom: 0; top: auto; right: 0; left: 0; height: auto; z-index: 900; flex-direction: row;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); overflow-x: auto; gap: 2px;
  }
  .side .brand, .side .who { display: none; }
  .nav-btn { flex-direction: column; gap: 2px; font-size: 11.5px; padding: 6px 8px; min-width: 64px; align-items: center; text-align: center; position: relative; }
  .nav-btn .count { position: absolute; top: 2px; left: 8px; margin: 0; }
  .topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: 14px; position: relative; }
  .topbar::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); }
  .topbar .tb-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--brand); }
  .topbar .tb-brand img { width: 28px; }
  .topbar button { background: none; border: 0; color: var(--bad); font-size: 13px; cursor: pointer; }
  .side { border-top: 1px solid var(--line); border-inline-end: 0; }
  .side::before { display: none; }
  .nav-btn.on::after { display: none; }
  .main { padding: 18px 16px 100px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-head h2 { font-size: 20px; }
  .map { height: 420px; }
  .audit-item { grid-template-columns: 1fr; gap: 2px; }
  .kv { grid-template-columns: 100px 1fr; }
  .filters .input, .filters .search { min-width: 0; flex: 1 1 140px; }
  .list > li { flex-wrap: wrap; }
  .list .row-actions { margin-inline-start: auto; }
  .modal-bg { padding-top: 2vh; }
}
.leaflet-container { direction: ltr; }
