:root {
  --bg:#f4f1ec; --card:#fff; --ink:#22262b; --muted:#666d75; --line:#dcd5ca;
  --accent:#2f5d50; --accent-soft:#e6f1ec; --warn:#a3392c; --warn-soft:#fbe9e6; --amber:#8a5a00; --amber-soft:#fdf1d8;
}
* { box-sizing:border-box; }
body { margin:0; font:15px/1.5 system-ui, "Segoe UI", sans-serif; background:var(--bg); color:var(--ink); }
[hidden] { display:none !important; }
h1 { font-size:1.3rem; margin:0 0 4px; }
h2 { font-size:1.05rem; margin:24px 0 10px; }
p { margin:0 0 10px; }
.muted { color:var(--muted); }
.small { font-size:.87rem; }

/* layout */
.shell { display:grid; grid-template-columns:230px 1fr; min-height:100vh; }
nav { background:#23302c; color:#dfe7e3; padding:16px 0; }
nav .brand { font-weight:700; font-size:1.15rem; padding:0 18px 4px; color:#fff; }
nav .who { padding:0 18px 14px; font-size:.82rem; color:#a9b8b2; border-bottom:1px solid #35443f; margin-bottom:8px; }
nav button { display:block; width:100%; text-align:left; background:none; border:0; color:inherit; font:inherit; padding:9px 18px; cursor:pointer; border-left:3px solid transparent; }
nav button:hover { background:#2c3c37; }
nav button.on { background:#2c3c37; border-left-color:#8fc7b3; color:#fff; }
nav .sep { height:1px; background:#35443f; margin:8px 0; }
main { padding:22px 26px 60px; min-width:0; }
@media (max-width:760px) {
  .shell { grid-template-columns:1fr; }
  nav { display:flex; flex-wrap:wrap; padding:8px; gap:2px; }
  nav .brand, nav .who, nav .sep { display:none; }
  nav button { width:auto; padding:7px 10px; border-left:0; border-radius:6px; }
  main { padding:16px; }
}

/* controls */
button, .btn { font:inherit; padding:8px 14px; border-radius:8px; border:1px solid var(--line); background:#fff; color:var(--ink); cursor:pointer; }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; font-weight:600; }
button.danger { color:var(--warn); border-color:#e2b7b0; }
button.tiny { padding:3px 9px; font-size:.84rem; }
button:disabled { opacity:.55; cursor:default; }
input, select, textarea { font:inherit; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:#fff; color:inherit; width:100%; }
input[type=checkbox] { width:18px; height:18px; accent-color:var(--accent); flex:none; }
.toolbar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:14px 0; }
.toolbar input, .toolbar select { width:auto; min-width:170px; }
.toolbar .grow { flex:1; }

/* tables and cards */
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; margin-bottom:14px; }
.tablewrap { background:var(--card); border:1px solid var(--line); border-radius:12px; overflow-x:auto; }
table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:9px 12px; border-bottom:1px solid var(--line); vertical-align:top; }
th { font-size:.8rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); font-weight:600; white-space:nowrap; }
tr:last-child td { border-bottom:0; }
tbody tr.click { cursor:pointer; }
tbody tr.click:hover { background:#faf8f4; }
.empty { padding:26px; text-align:center; color:var(--muted); }
.badge { display:inline-block; padding:1px 9px; border-radius:99px; font-size:.8rem; font-weight:600; white-space:nowrap; }
.badge.applied { background:var(--amber-soft); color:var(--amber); }
.badge.verified { background:#e3ecf8; color:#27508a; }
.badge.active { background:var(--accent-soft); color:var(--accent); }
.badge.suspended, .badge.rejected, .badge.inactive { background:var(--warn-soft); color:var(--warn); }
.tiles { display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:12px; }
.tile { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px; cursor:pointer; }
.tile b { display:block; font-size:1.7rem; line-height:1.2; }
.actions { display:flex; flex-wrap:wrap; gap:6px; }

/* forms */
.fields { display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); gap:12px 16px; }
.field label { display:block; font-size:.84rem; color:var(--muted); margin-bottom:3px; }
.field.wide { grid-column:1 / -1; }
.field.check { display:flex; gap:9px; align-items:center; align-self:end; padding-bottom:8px; cursor:pointer; }
dialog { border:0; border-radius:14px; padding:0; width:min(860px, 94vw); max-height:92vh; box-shadow:0 20px 60px rgb(0 0 0 / .3); }
dialog::backdrop { background:rgb(20 26 24 / .5); }
.dlg-head { display:flex; justify-content:space-between; align-items:center; padding:14px 20px; border-bottom:1px solid var(--line); position:sticky; top:0; background:#fff; z-index:2; }
.dlg-head h2 { margin:0; }
.dlg-body { padding:18px 20px; }
.dlg-foot { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; padding:14px 20px; border-top:1px solid var(--line); position:sticky; bottom:0; background:#fff; }
.error { color:var(--warn); margin:10px 0 0; }
.ok { color:var(--accent); margin:10px 0 0; }
.map { height:300px; border:1px solid var(--line); border-radius:10px; margin-top:8px; }
.map.big { height:calc(100vh - 210px); min-height:380px; }
.legend { display:flex; flex-wrap:wrap; gap:14px; font-size:.87rem; }
.dot { display:inline-block; width:11px; height:11px; border-radius:50%; margin-right:5px; vertical-align:-1px; }
.rules { white-space:pre-wrap; background:#faf8f4; border:1px solid var(--line); border-radius:10px; padding:14px; }

/* login and gates */
.center { max-width:440px; margin:8vh auto; padding:0 16px; }
.center .card { padding:24px; }
.center .field { margin-bottom:12px; }
.center .brandline { font-size:1.5rem; font-weight:700; color:var(--accent); margin-bottom:2px; }
