/* ═══════════════════════════════════════════════════════════
   l'Amicale du WiFi — Fully Coworking · CH-1926
   Design system v3 — modern, bold, Swiss-refined
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&family=Open+Sans:wght@300;400;600;700&display=swap');

:root {
  /* Brand palette — amicalewifi.ch · primary #007af5 */
  --prim:   #007af5;
  --prim-d: #0062c8;
  --prim-m: #3694f7;
  --prim-l: #ebf4ff;
  --prim-t: #93c4fd;

  /* Success green — emerald (distinct from blue) */
  --green:   #16a34a;
  --green-d: #15803d;
  --green-m: #22c55e;
  --green-l: #dcfce7;
  --green-t: #86efac;

  --orange:  #f59e0b;
  --orange-d:#d97706;
  --orange-l:#fffbeb;
  --orange-t:#fcd34d;

  --red:     #ef4444;
  --red-l:   #fee2e2;
  --red-t:   #fca5a5;

  --amber:   #d97706;
  --amber-l: #fffbeb;

  --blue:    #2563eb;
  --blue-l:  #eff6ff;

  --purple:  #7c3aed;
  --purple-l:#f5f3ff;

  /* Neutrals — matches amicalewifi.ch background */
  --bg:      #f7f8fc;
  --surf:    #ffffff;
  --surf-2:  #f1f4f8;
  --bdr:     #e4e7ec;
  --bdr-2:   #cdd2dc;
  --text:    #111827;
  --t2:      #374151;
  --t3:      #6b7280;
  --t4:      #9ca3af;

  /* Legacy aliases → brand primary */
  --gd:   var(--prim-d);
  --gl:   var(--prim-l);
  --gm:   var(--prim-m);
  --gt:   var(--prim-t);
  --od:   var(--orange-d);
  --ol:   var(--orange-l);
  --rl:   var(--red-l);
  --al:   var(--amber-l);
  --bl:   var(--blue-l);
  --pl:   var(--purple-l);
  --bdr2: var(--bdr-2);

  /* Spacing & shape */
  --r:    8px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 36px rgba(0,0,0,.13), 0 4px 10px rgba(0,0,0,.07);

  --font:         'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-heading: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--prim); text-decoration: none; }
a:hover { color: var(--prim-m); }

/* ── Layout ──────────────────────────────────────────── */

.layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #0c1222 0%, #111827 100%);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid rgba(0,0,0,.35);
  position: relative;
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,.04) 0%, transparent 100%);
  pointer-events: none;
}

.main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ── Sidebar ─────────────────────────────────────────── */

.brand {
  padding: 26px 22px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.brand-name {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.3px;
  line-height: 1.3;
}

.brand-sub {
  color: rgba(255,255,255,.50);
  font-size: 11px;
  margin-top: 3px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-family: var(--font-heading);
}

.nav-sec {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: rgba(255,255,255,.45);
  padding: 18px 22px 6px;
  font-family: var(--font-heading);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 16px;
  border-radius: var(--r);
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,.82);
  transition: all .18s ease;
  margin: 2px 10px;
  text-decoration: none;
  letter-spacing: -.1px;
}

.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
}

.nav-item.active {
  background: var(--prim);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,122,245,.40), inset 0 1px 0 rgba(255,255,255,.14);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: .72;
  transition: opacity .18s;
  flex-shrink: 0;
}

.nav-item.active svg { opacity: 1; }
.nav-item:hover svg { opacity: .9; }

.sb-footer {
  padding: 16px 22px;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: 12px;
  color: rgba(255,255,255,.26);
  margin-top: auto;
  line-height: 1.7;
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  margin-right: 5px;
  box-shadow: 0 0 8px rgba(74,222,128,.7);
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 6px rgba(74,222,128,.6); }
  50% { box-shadow: 0 0 12px rgba(74,222,128,.9); }
}

/* ── Topbar ──────────────────────────────────────────── */

.topbar {
  padding: 18px 32px;
  background: var(--surf);
  border-bottom: 1px solid var(--bdr);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 var(--bdr), 0 4px 24px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
}

.topbar-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--text);
  font-family: var(--font-heading);
  text-wrap: balance;
}

.topbar-sub {
  font-size: 13px;
  color: var(--t3);
  margin-top: 2px;
  font-weight: 400;
}

.topbar-r { display: flex; gap: 8px; align-items: center; }

.content { padding: 28px 32px; flex: 1; }

/* ── Flash messages ──────────────────────────────────── */

.flash {
  padding: 13px 18px;
  border-radius: var(--r-lg);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-xs);
}

.flash-ok  { background: var(--green-l); color: var(--green-d); border: 1px solid var(--green-t); border-left: 3px solid var(--green); }
.flash-err { background: var(--red-l);   color: var(--red);     border: 1px solid var(--red-t);   border-left: 3px solid var(--red); }

/* ── Notice ──────────────────────────────────────────── */

.notice {
  padding: 12px 16px;
  border-radius: var(--r);
  font-size: 13.5px;
  margin-bottom: 18px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.55;
}

.notice-g { background: var(--green-l); color: var(--green-d); border: 1px solid var(--green-t); border-left: 3px solid var(--green); }
.notice-o { background: var(--orange-l); color: var(--orange-d); border: 1px solid var(--orange-t); border-left: 3px solid var(--orange); }

/* ── Stats ───────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: var(--r-xl);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--prim);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.stat-lbl {
  font-size: 12px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  margin-bottom: 10px;
}

.stat-val {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1.5px;
  color: var(--text);
  font-family: var(--font-heading);
  font-variant-numeric: tabular-nums;
}

.stat-meta {
  font-size: 12px;
  color: var(--t3);
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.sdot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ── Grid layouts ────────────────────────────────────── */

.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Card ────────────────────────────────────────────── */

.card {
  background: var(--surf);
  border: 1px solid var(--bdr);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  transition: box-shadow .25s ease, transform .25s ease;
}

.card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.07), 0 12px 32px rgba(0,0,0,.09);
  transform: translateY(-1px);
}

.card-hdr {
  padding: 15px 22px;
  border-bottom: 1px solid var(--bdr);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surf-2);
}

.card-ttl {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -.1px;
  color: var(--text);
  font-family: var(--font-heading);
}

.card-body { padding: 18px 22px; }

/* ── Table ───────────────────────────────────────────── */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }

.table thead tr {
  background: var(--surf-2);
  border-bottom: 2px solid var(--bdr-2);
}

.table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 12px 18px;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 13px 18px;
  border-top: 1px solid var(--bdr);
  vertical-align: middle;
  color: var(--t2);
}

.table td:first-child { color: var(--text); font-weight: 500; }

.table tbody tr {
  transition: background .15s, border-left-color .15s;
  border-left: 3px solid transparent;
}

.table tbody tr:nth-child(even) td { background: rgba(0,0,0,.018); }

.table tbody tr:hover {
  border-left-color: var(--prim-t);
}

.table tbody tr:hover td { background: var(--prim-l) !important; }

/* ── Badges ──────────────────────────────────────────── */

.b {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}

.b-g  { background: var(--green-l);  color: var(--green-d); }
.b-o  { background: var(--orange-l); color: var(--orange-d); }
.b-r  { background: var(--red-l);    color: var(--red); }
.b-a  { background: var(--amber-l);  color: var(--amber); }
.b-bl { background: var(--blue-l);   color: var(--blue); }
.b-p  { background: var(--purple-l); color: var(--purple); }
.b-gr { background: var(--bg);       color: var(--t3); border: 1px solid var(--bdr-2); }

.cons { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.cons-full { background: var(--green-l);  color: var(--green-d); }
.cons-half { background: var(--orange-l); color: var(--orange-d); }

/* ── Buttons ─────────────────────────────────────────── */

.btn {
  padding: 9px 18px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--bdr-2);
  background: var(--surf);
  color: var(--text);
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .18s ease;
  text-decoration: none;
  letter-spacing: -.15px;
  box-shadow: var(--shadow-xs);
}

.btn:hover {
  background: var(--bg);
  border-color: var(--bdr-2);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

.btn-g {
  background: var(--prim);
  color: #fff;
  border-color: var(--prim-d);
  box-shadow: 0 2px 10px rgba(0,122,245,.30), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn-g:hover {
  background: var(--prim-d);
  color: #fff;
  box-shadow: 0 4px 18px rgba(0,122,245,.42), inset 0 1px 0 rgba(255,255,255,.18);
  transform: translateY(-1px);
}

.btn-o {
  background: linear-gradient(135deg, var(--orange) 0%, #f5922a 100%);
  color: #fff;
  border-color: var(--orange-d);
  box-shadow: 0 2px 10px rgba(240,124,44,.28);
}
.btn-o:hover {
  background: linear-gradient(135deg, #f5922a 0%, var(--orange) 100%);
  color: #fff;
  box-shadow: 0 5px 16px rgba(240,124,44,.38);
}

.btn-r {
  background: var(--red-l);
  color: var(--red);
  border-color: var(--red-t);
}
.btn-r:hover { background: var(--red); color: #fff; }

.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }

/* ── Action menu dropdown ───────────────────────────── */
.act-menu { position: relative; display: inline-block; }
.act-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surf);
  border: 1px solid var(--bdr-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  min-width: 210px;
  z-index: 200;
  overflow: hidden;
  animation: dropIn .14s ease;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.act-menu.open .act-dropdown { display: block; }
.act-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  text-decoration: none;
  letter-spacing: -.1px;
  transition: background .12s;
  white-space: nowrap;
}
.act-item:hover { background: var(--bg); color: var(--text); }
.act-item-r { color: var(--red); }
.act-item-r:hover { background: var(--red-l); color: var(--red); }
.act-sep { height: 1px; background: var(--bdr); margin: 4px 8px; }
.act-group-lbl { padding: 6px 15px 3px; font-size: 11px; font-weight: 600; color: var(--t3); text-transform: uppercase; letter-spacing: .06em; }

/* ── Pack bar ────────────────────────────────────────── */

.pack-bar {
  height: 7px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--bdr);
}

.pack-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--green), var(--green-m));
  transition: width .6s ease;
}

/* ── Timeline ────────────────────────────────────────── */

.tl-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--bdr);
  transition: background .15s;
}
.tl-item:last-child { border-bottom: none; }
.tl-item:hover { background: var(--surf-2); }

.tl-time {
  font-size: 12px;
  color: var(--t3);
  min-width: 44px;
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.tl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
  box-shadow: 0 0 0 3px rgba(255,255,255,.9);
}

.tl-body { flex: 1; min-width: 0; }
.tl-name { font-size: 14px; font-weight: 600; letter-spacing: -.1px; color: var(--text); }
.tl-desc { font-size: 12px; color: var(--t3); margin-top: 2px; }

/* ── Avatar ──────────────────────────────────────────── */

.av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: .5px;
}

/* ── Forms ───────────────────────────────────────────── */

.form-row { margin-bottom: 14px; }
.form-lbl {
  font-size: 13px;
  color: var(--t2);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
  letter-spacing: -.1px;
}

.form-in, .form-sel {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r);
  border: 1.5px solid var(--bdr-2);
  background: var(--surf);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-xs);
}

.form-in:focus, .form-sel:focus {
  outline: none;
  border-color: var(--prim);
  box-shadow: 0 0 0 4px rgba(39,52,139,.12);
  background: #fff;
}

.form-in::placeholder { color: var(--t4); }
.form-g { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Modal ───────────────────────────────────────────── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 12, .55);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(5px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surf);
  border-radius: var(--r-xl);
  border: 1px solid var(--bdr);
  padding: 30px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in .22s cubic-bezier(.16,1,.3,1);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-ttl { font-size: 20px; font-weight: 800; margin-bottom: 5px; letter-spacing: -.5px; font-family: var(--font-heading); text-wrap: balance; }
.modal-sub { font-size: 13px; color: var(--t2); margin-bottom: 22px; line-height: 1.5; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--bdr); }

/* ── Room slots ──────────────────────────────────────── */

.slot-row { display: flex; gap: 3px; flex-wrap: wrap; }
.slot     { width: 24px; height: 11px; border-radius: 3px; transition: transform .1s; }
.slot:hover { transform: scaleY(1.2); }
.slot-f   { background: var(--prim-l); border: 1px solid var(--prim-t); }
.slot-b   { background: #fde6e3; border: 1px solid #f0b0aa; }

/* ── Type card selector ──────────────────────────────── */

.type-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }

.type-card {
  border: 1.5px solid var(--bdr);
  border-radius: var(--r);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all .18s ease;
  background: var(--surf);
}

.type-card.sel {
  border-color: var(--prim);
  background: var(--prim-l);
  box-shadow: 0 0 0 3px rgba(39,52,139,.12);
}

.type-card:hover:not(.sel) { border-color: var(--prim-t); background: var(--surf-2); transform: translateY(-1px); }

/* ── Inactive member rows ────────────────────────────── */

tr.inactive-row td { opacity: .48; }
tr.inactive-row:hover td { opacity: .72; background: var(--bg); }

/* ── Printer status ──────────────────────────────────── */

.printer-status { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: var(--r-lg); font-size: 14px; font-weight: 600; }
.printer-online  { background: var(--green-l); color: var(--green-d); border: 1px solid var(--green-t); }
.printer-offline { background: var(--red-l);   color: var(--red);     border: 1px solid var(--red-t); }
.printer-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.printer-dot-on  { background: var(--green); box-shadow: 0 0 8px var(--green); }
.printer-dot-off { background: var(--red); }

/* ── Mobile responsive ───────────────────────────────── */

@media (max-width: 768px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .table th:nth-child(n+4), .table td:nth-child(n+4) { display: none; }
  .sidebar { width: 210px; }
  .content { padding: 18px; }
  .topbar { padding: 14px 18px; }
}


/* ── Search input ────────────────────────────────────── */

.search-wrap { position: relative; }
.search-wrap .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--t3);
  pointer-events: none;
  display: flex;
}
.search-in {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border-radius: var(--r);
  border: 1.5px solid var(--bdr-2);
  background: var(--surf);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-xs);
}
.search-in:focus {
  outline: none;
  border-color: var(--prim);
  box-shadow: 0 0 0 3px rgba(39,52,139,.10);
  background: #fff;
}
.search-in::placeholder { color: var(--t4); }

/* ── Scrollbar ───────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bdr-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--t3); }

/* ── Toggle switch ───────────────────────────────────── */
.sw { display:inline-block; position:relative; width:44px; height:24px; cursor:pointer; vertical-align:middle; }
.sw input { opacity:0; width:0; height:0; position:absolute; }
.sw-k { position:absolute; inset:0; background:var(--prim-m); border-radius:12px; transition:.25s; }
.sw-k::before { content:''; position:absolute; width:18px; height:18px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.25s; transform:translateX(20px); box-shadow:0 1px 3px rgba(0,0,0,.2); }
.sw input:not(:checked) + .sw-k { background:var(--t3); }
.sw input:not(:checked) + .sw-k::before { transform:translateX(0); }

/* ── Mobile app shell ────────────────────────────────── */

.app-topbar {
  background: linear-gradient(135deg, #0c1222 0%, #162040 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 20px rgba(0,0,0,.28);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.app-topbar-spread { justify-content: space-between; }

.app-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.3px;
}

.app-sub {
  font-size: 10px;
  opacity: .5;
  margin-top: 1px;
  font-weight: 600;
}

.app-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.section-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--t3);
  margin: 20px 0 10px;
}

/* ── Mobile bottom navigation ────────────────────────── */

.bottom-nav {
  display: flex;
  border-top: 1px solid var(--bdr);
  background: var(--surf);
  position: sticky;
  bottom: 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,.07);
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-btn {
  flex: 1;
  padding: 10px 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
  color: var(--t3);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: color .15s;
  position: relative;
}

.nav-btn svg {
  width: 20px;
  height: 20px;
  transition: transform .18s;
}

.nav-btn:hover { color: var(--t2); }

.nav-btn.active {
  color: var(--prim);
}

.nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--prim);
  border-radius: 0 0 4px 4px;
}

/* ── Dark-navy theme (mobile app) ────────────────────── */

body.dark {
  --bg:     #141929;
  --surf:   #1d2338;
  --surf-2: #252e46;
  --bdr:    #2e3a56;
  --bdr-2:  #3d4f6e;
  --text:   #e8edf5;
  --t2:     #b4bed4;
  --t3:     #788099;
  --t4:     #566178;

  --prim-l: rgba(0,122,245,.18);
  --prim-t: rgba(0,122,245,.45);
  --green-l: rgba(22,163,74,.18);
  --green-t: rgba(22,163,74,.45);
  --red-l:   rgba(239,68,68,.18);
  --red-t:   rgba(239,68,68,.45);
  --orange-l: rgba(245,158,11,.18);
  --orange-t: rgba(245,158,11,.45);
  --blue-l:  rgba(37,99,235,.18);
  --purple-l: rgba(124,58,237,.18);
  --amber-l: rgba(217,119,6,.18);

  --gl: var(--prim-l);
  --gt: var(--prim-t);
  --ol: var(--orange-l);
  --rl: var(--red-l);
  --al: var(--amber-l);
  --bl: var(--blue-l);
  --pl: var(--purple-l);
}

body.dark .flash-ok {
  background: rgba(22,163,74,.15);
  color: #4ade80;
  border-color: rgba(22,163,74,.35);
  border-left-color: var(--green);
}

body.dark .flash-err {
  background: rgba(239,68,68,.15);
  color: #f87171;
  border-color: rgba(239,68,68,.35);
  border-left-color: var(--red);
}

body.dark .bottom-nav {
  border-top-color: var(--bdr);
  background: #181e30;
}

body.dark .search-in { background: var(--surf-2); }
