/* ============================================================
   Bitsolution Demo Portal — dark operations-console aesthetic
   Fonts: Inter (reading) · JetBrains Mono (labels & data)
   ============================================================ */

:root {
  --bg: #050810;
  --panel: #0c1220;
  --panel-2: #111a2b;
  --border: #1a2540;
  --border-soft: #141d33;
  --text: #e6ecf5;
  --muted: #8b97ad;
  --dim: #5f6c84;
  --accent: #22d3ee;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --side-w: 292px;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100dvh;
  background-image:
    radial-gradient(900px 480px at 85% -10%, rgba(34, 211, 238, 0.05), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(52, 211, 153, 0.04), transparent 60%);
  background-attachment: fixed;
}
body.no-scroll { overflow: hidden; }

::selection { background: rgba(34, 211, 238, 0.25); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.app { display: flex; min-height: 100dvh; }

/* ---------------- sidebar ---------------- */
.sidebar {
  width: var(--side-w);
  flex: 0 0 var(--side-w);
  background: #070d19;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  z-index: 30;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.brand-mark { display: flex; align-items: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong {
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.18em; font-weight: 700;
}
.brand-text span {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.3em; color: var(--muted);
}

.side-filter { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.side-filter input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  padding: 9px 12px;
  transition: border-color 0.15s ease;
}
.side-filter input::placeholder { color: var(--dim); }
.side-filter input:focus { outline: none; border-color: var(--accent); }

.side-nav { flex: 1; overflow-y: auto; padding: 8px 0 16px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.nav-group-label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.22em;
  color: var(--dim);
  padding: 16px 18px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px;
  border-left: 2px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.03); }
.nav-item.active {
  background: rgba(34, 211, 238, 0.13);
  border-left-color: var(--accent);
  box-shadow: inset 0 0 24px rgba(34, 211, 238, 0.07);
}
.nav-item.active .nav-label { color: var(--accent); font-weight: 700; }
.nav-item.active .nav-code { color: var(--accent); }
.nav-ic { display: flex; flex: 0 0 auto; opacity: 0.9; }
.nav-label { flex: 1; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-code { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; color: var(--dim); }
.hidden { display: none !important; }

.side-foot {
  border-top: 1px solid var(--border);
  padding: 12px 18px 14px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em;
}
.side-foot-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.side-foot .muted { color: var(--dim); }

/* status dots */
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot-live { background: var(--good); box-shadow: 0 0 8px rgba(52, 211, 153, 0.7); animation: pulse 1.6s ease-in-out infinite; }
.dot-warn { background: var(--warn); box-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }
.dot-good { background: var(--good); }
.dot-bad { background: var(--bad); }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---------------- main column ---------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 28px;
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.menu-btn {
  display: none;
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); padding: 8px; cursor: pointer;
  transition: border-color 0.15s ease;
}
.menu-btn:hover { border-color: var(--accent); }
.crumbs { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; display: flex; gap: 10px; align-items: center; min-width: 0; }
.crumb-root { color: var(--dim); }
.crumb-sep { color: var(--border); }
.crumb-here { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.db-pill, .live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; color: var(--muted); white-space: nowrap;
}
.live-pill { color: var(--good); border-color: rgba(52, 211, 153, 0.35); }
.clock { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }

.content { flex: 1; padding: 28px; max-width: 1280px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

/* ---------------- panels ---------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.panel-head h3 {
  margin: 0; font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.22em; color: var(--muted);
}
.panel-tag { font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; color: var(--dim); }

/* ---------------- hero / overview ---------------- */
.hero { padding: 34px 32px 30px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.hero-kicker {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em; color: var(--accent);
  margin-bottom: 14px;
}
.hero-title { margin: 0 0 12px; font-size: clamp(26px, 4vw, 40px); line-height: 1.15; font-weight: 800; letter-spacing: -0.015em; }
.hero-sub { margin: 0 0 26px; max-width: 68ch; color: var(--muted); font-size: 15px; }
.hero-stats { display: flex; gap: 0; border-top: 1px solid var(--border-soft); padding-top: 20px; flex-wrap: wrap; }
.hstat { padding: 0 34px 0 0; margin-right: 34px; border-right: 1px solid var(--border-soft); }
.hstat:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.hstat-num { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--text); }
.hstat-cap { font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; color: var(--dim); margin-top: 2px; }

.group-block { display: flex; flex-direction: column; gap: 12px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.group-head h2 { margin: 0; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.24em; color: var(--muted); }
.group-count { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em; color: var(--dim); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 12px; }
.mod-card {
  padding: 16px 18px 14px;
  display: flex; flex-direction: column; gap: 6px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.mod-card:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--panel-2); }
.mod-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.mod-ic { color: var(--accent); display: flex; }
.mod-code { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; color: var(--dim); }
.mod-name { font-weight: 700; font-size: 15.5px; letter-spacing: -0.01em; }
.mod-tag { color: var(--muted); font-size: 12.5px; line-height: 1.5; min-height: 2.6em; }
.mod-foot {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border-soft); padding-top: 10px; margin-top: 6px;
}
.mod-recs { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; color: var(--dim); }
.mod-go { color: var(--accent); display: flex; opacity: 0; transform: translateX(-4px); transition: opacity 0.15s ease, transform 0.15s ease; }
.mod-card:hover .mod-go { opacity: 1; transform: translateX(0); }

/* ---------------- contact strip ---------------- */
.contact { padding: 28px 32px; display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.contact-title { margin: 0; font-size: 19px; font-weight: 700; max-width: 52ch; line-height: 1.4; }
.contact-actions { display: flex; flex-direction: column; gap: 10px; min-width: 250px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 16px; color: var(--text); background: var(--panel-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.5); color: var(--accent); }
.btn-primary:hover { background: rgba(34, 211, 238, 0.2); }
.btn.block { width: 100%; justify-content: center; margin-top: 6px; }

/* ---------------- module page ---------------- */
.mod-head { padding: 28px 32px; border-top: 2px solid var(--accent); }
.mod-head-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.mod-ic.lg { color: var(--accent); }
.mod-group { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.22em; color: var(--dim); }
.mod-title { margin: 0 0 6px; font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -0.015em; }
.mod-tagline { margin: 0 0 12px; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; color: var(--accent); }
.mod-desc { margin: 0; max-width: 78ch; color: var(--muted); }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi { padding: 15px 18px 13px; }
.kpi-cap { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.2em; color: var(--dim); margin-bottom: 6px; }
.kpi-val-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.kpi-val { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spark { flex: 0 0 auto; opacity: 0.9; }

.charts-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
.chart-panel { padding-bottom: 10px; }
.chart-bars { display: block; width: 100%; height: auto; padding: 10px 14px 0; }
.chart-bars .grid { stroke: var(--border-soft); stroke-width: 1; }
.chart-bars .axis { fill: var(--dim); font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; }
.donut-wrap { display: flex; align-items: center; gap: 18px; padding: 16px 18px; flex-wrap: wrap; }
.chart-donut { flex: 0 0 auto; width: 168px; height: 168px; }
.donut-num { fill: var(--text); font-family: var(--mono); font-size: 26px; font-weight: 700; }
.donut-cap { fill: var(--dim); font-family: var(--mono); font-size: 8px; letter-spacing: 0.24em; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 140px; }
.legend li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.legend-n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text); }
.swatch { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto; }
.chart-empty { padding: 40px 18px; text-align: center; color: var(--dim); font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; }

.split-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
.features { list-style: none; margin: 0; padding: 8px 18px 16px; }
.features li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 0; font-size: 14px; color: var(--text);
  border-bottom: 1px solid var(--border-soft);
}
.features li:last-child { border-bottom: 0; }
.feat-tick { flex: 0 0 auto; transform: translateY(1.5px); }

.deploy-panel { padding-bottom: 18px; }
.deploy-list { margin: 0; padding: 8px 18px 14px; }
.deploy-list > div {
  display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--border-soft);
}
.deploy-list > div:last-of-type { border-bottom: 0; }
.deploy-list dt { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em; color: var(--dim); }
.deploy-list dd { margin: 0; font-size: 13px; text-align: right; color: var(--text); }
.deploy-panel .btn { margin: 4px 18px 0; width: calc(100% - 36px); }

/* ---------------- data table ---------------- */
.table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 700px; }
table.data th {
  text-align: left; font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.2em; color: var(--dim);
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015); white-space: nowrap;
}
table.data td { padding: 10px 16px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
table.data tbody tr { transition: background 0.12s ease; }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
table.data tbody tr:last-child td { border-bottom: 0; }
.mono { font-family: var(--mono); font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.dim { color: var(--muted); }

/* ---------------- table tabs ---------------- */
.table-tabs {
  display: flex; align-items: flex-end; gap: 2px; flex-wrap: wrap;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.012);
}
.tt-btn {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em;
  padding: 11px 13px 10px; cursor: pointer; white-space: nowrap;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.tt-btn:hover { color: var(--text); }
.tt-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em;
  padding: 4px 10px; border-radius: 999px; border: 1px solid;
}
.pill-good { color: var(--good); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.pill-warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.pill-bad  { color: var(--bad);  border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }
.pill-warn .dot { background: var(--warn); }

.table-note { margin: 0; padding: 11px 18px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; color: var(--dim); border-top: 1px solid var(--border-soft); }

.empty-state {
  margin: 18px; padding: 40px 20px; text-align: center;
  border: 1px dashed var(--border); border-radius: var(--radius); color: var(--dim);
  display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 13.5px;
}
.empty-state code { font-family: var(--mono); color: var(--accent); }

.footer {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 20px 6px 10px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em; color: var(--dim);
}

/* ---------------- interactive demo: flash, rows, modal ---------------- */
.flash {
  border: 1px solid rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.08);
  color: var(--accent);
  border-radius: var(--radius);
  padding: 11px 16px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
}

.panel-head-actions { display: flex; align-items: center; gap: 10px; }
.btn.sm { padding: 7px 12px; font-size: 10px; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--bad); border-color: rgba(248, 113, 113, 0.5); }

.own-row { background: rgba(34, 211, 238, 0.045); }
.own-row td:nth-child(2) { box-shadow: inset 2px 0 0 var(--accent); }
.send-col { width: 40px; text-align: center; }
.send-col .icon-btn { width: 26px; height: 26px; }
.badge-yours {
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em;
  color: var(--accent); border: 1px solid rgba(34, 211, 238, 0.45);
  border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px;
}

.row-actions { white-space: nowrap; }
.row-actions .inline-form { display: inline; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: none; border: 1px solid var(--border); border-radius: 5px;
  color: var(--muted); cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn.danger:hover { color: var(--bad); border-color: rgba(248, 113, 113, 0.5); }
.lock-cell { color: var(--dim); display: inline-flex; opacity: 0.7; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(2, 4, 9, 0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: 100%; max-width: 520px;
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.record-form { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.field-row { display: flex; gap: 12px; }
.field label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em; color: var(--dim);
}
.req { color: var(--bad); }
.field input, .field select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans); font-size: 14px;
  padding: 10px 12px;
  transition: border-color 0.15s ease;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field input[type="date"] { font-family: var(--mono); font-size: 12.5px; color-scheme: dark; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.form-note {
  margin: 0; text-align: center;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; color: var(--dim);
}

[hidden] { display: none !important; }

/* ---------------- record view modal ---------------- */
.rec-row { cursor: pointer; }
.rec-row:hover td { background: rgba(34, 211, 238, 0.03); }
.rec-row:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }

.view-pane { padding: 16px 18px 18px; }
.view-pane[hidden] { display: none; }
.view-ref-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.view-ref {
  font-family: var(--mono); font-size: 15px; font-weight: 700;
  letter-spacing: 0.06em; color: var(--text);
}
.view-dl { margin: 0; display: flex; flex-direction: column; }
.view-dl > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 8px 0; border-bottom: 1px dashed rgba(26, 37, 64, 0.7);
}
.view-dl > div:last-child { border-bottom: 0; }
.view-dl dt {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em; color: var(--dim);
  flex-shrink: 0;
}
.view-dl dd { margin: 0; font-size: 13.5px; text-align: right; overflow-wrap: anywhere; }
.view-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.view-nav { display: flex; align-items: center; gap: 8px; }
.view-ops { display: flex; align-items: center; gap: 8px; }
.btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }

/* ---------------- ID card view (HR) ---------------- */
.view-toggle {
  display: inline-flex; gap: 0; margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.vt-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; cursor: pointer;
  color: var(--muted); font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.16em; padding: 8px 16px;
  transition: background 0.12s ease, color 0.12s ease;
}
.vt-btn + .vt-btn { border-left: 1px solid var(--border); }
.vt-btn.active { background: rgba(34, 211, 238, 0.12); color: var(--accent); }

.idcard-stage { padding: 6px 0 2px; }
.idcard-stage[hidden] { display: none; }
.idcard {
  max-width: 400px; margin: 0 auto;
  background: linear-gradient(160deg, #101a30 0%, #0a1120 100%);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  aspect-ratio: 1.63;
  display: flex; flex-direction: column;
}
.idcard-top {
  display: flex; justify-content: space-between; align-items: baseline;
  background: rgba(56, 189, 248, 0.12);
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
  padding: 9px 14px;
}
.idcard-brand {
  font-family: var(--mono); font-weight: 700; font-size: 12px;
  letter-spacing: 0.22em; color: #7dd3fc;
}
.idcard-type { font-family: var(--mono); font-size: 7.5px; letter-spacing: 0.2em; color: var(--dim); }
.idcard-body { display: flex; gap: 14px; padding: 14px; flex: 1; min-height: 0; }
.idcard-photo {
  width: 84px; align-self: stretch;
  display: flex; align-items: center; justify-content: center;
  background: rgba(56, 189, 248, 0.08);
  border: 1px dashed rgba(56, 189, 248, 0.4); border-radius: 8px;
  font-family: var(--mono); font-weight: 700; font-size: 26px;
  letter-spacing: 0.06em; color: #7dd3fc;
}
.idcard-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.idcard-name { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.15; }
.idcard-role { font-size: 11.5px; color: #7dd3fc; margin-bottom: 4px; }
.idcard-row {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  font-size: 10.5px;
}
.idcard-row span { font-family: var(--mono); font-size: 7.5px; letter-spacing: 0.18em; color: var(--dim); flex-shrink: 0; }
.idcard-row b { font-weight: 500; color: var(--text); text-align: right; overflow-wrap: anywhere; }
.idcard-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border-top: 1px solid rgba(56, 189, 248, 0.2); padding: 8px 14px;
}
.idcard-barcode {
  height: 22px; flex: 1; max-width: 190px;
  background: repeating-linear-gradient(90deg,
    #c8d4e8 0 2px, transparent 2px 4px,
    #c8d4e8 4px 7px, transparent 7px 8px,
    #c8d4e8 8px 9px, transparent 9px 12px,
    #c8d4e8 12px 15px, transparent 15px 16px);
  opacity: 0.75;
}
#vRecordWrap[hidden] { display: none; }

/* ---------------- logo, counts, maps, calendar, media ---------------- */
.brand-mark img { display: block; width: 34px; height: 34px; }

.nav-count {
  margin-left: auto; margin-right: 8px;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.08em;
  color: var(--dim);
}
.nav-item.active .nav-count { color: var(--accent); }

.map-picker {
  height: 230px;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.view-map {
  height: 210px; margin-top: 12px;
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden;
}
.map-coords {
  margin-top: 6px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--cyan, #22d3ee);
}
.view-coords { margin-bottom: 4px; }
.map-dot span {
  display: block; width: 18px; height: 18px;
  border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}
.leaflet-container { background: #0a0f1a; font-family: var(--sans); }
.leaflet-bar a { background: #111a2b; color: #e6ecf5; border-color: #1a2540; }
.leaflet-bar a:hover { background: #1a2540; }
.leaflet-control-layers {
  background: #111a2b; color: #e6ecf5;
  border: 1px solid #1a2540; border-radius: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
}
.leaflet-control-attribution { background: rgba(5, 8, 16, 0.72); color: #5b6b85; font-size: 8.5px; }
.leaflet-control-attribution a { color: #7c8cab; }

.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-month { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em; color: var(--text); min-width: 130px; text-align: center; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  padding: 14px 18px 18px;
}
.cal-dow {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.18em;
  color: var(--dim); text-align: center; padding-bottom: 2px;
}
.cal-cell {
  position: relative; height: 46px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 6px 8px; color: var(--text);
  font: inherit; text-align: left;
}
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell.has { cursor: pointer; border-color: rgba(244, 114, 182, 0.45); }
.cal-cell.has:hover { border-color: #f472b6; background: rgba(244, 114, 182, 0.07); }
.cal-num { font-family: var(--mono); font-size: 11px; }
.cal-n { font-family: var(--mono); font-size: 9px; color: #f472b6; }
.cal-dot {
  position: absolute; left: 8px; bottom: 7px;
  width: 7px; height: 7px; border-radius: 50%; background: #f472b6;
}

.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 18px 16px; }
.media-box {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
}
.media-box-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  color: var(--text); margin-bottom: 8px;
}
.media-note { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.take { margin-top: 12px; }
.take-name {
  display: block; font-family: var(--mono); font-size: 8.5px;
  letter-spacing: 0.16em; color: var(--dim); margin-bottom: 4px;
}
.take audio { width: 100%; height: 34px; }
.take video { width: 100%; max-height: 220px; background: #000; border-radius: 6px; }

.send-msg {
  margin: 10px 0 0; text-align: center;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em;
  color: var(--accent);
}
.send-msg[hidden] { display: none; }

@media (max-width: 620px) {
  .media-grid { grid-template-columns: 1fr; }
  .cal-cell { height: 38px; padding: 4px 6px; }
}

@media (max-width: 620px) {
  .field-row { flex-direction: column; gap: 13px; }
  .panel-head { flex-wrap: wrap; }
  .view-actions { flex-direction: column; align-items: stretch; }
  .view-nav, .view-ops { justify-content: space-between; }
  .view-dl > div { flex-direction: column; gap: 3px; }
  .view-dl dd { text-align: left; }
}

/* ---------------- mobile ---------------- */
.scrim {
  position: fixed; inset: 0; background: rgba(2, 4, 9, 0.6);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 25;
}
.scrim.show { opacity: 1; pointer-events: auto; }

@media (max-width: 1100px) {
  .charts-row, .split-row { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    height: 100dvh;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0, 0, 0, 0.6); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 14px 22px; }
  .clock { display: none; }
  .hero, .mod-head, .contact { padding: 24px 20px; }
  .hstat { padding-right: 22px; margin-right: 22px; }
  .card-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .card-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 14px; }
  .hstat { border-right: 0; padding-right: 0; margin-right: 0; flex: 1 1 40%; }
  .db-pill { display: none; }
  .contact-actions { width: 100%; }
  .crumb-root, .crumb-sep { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------------- share bar + send box (v1.6.0) ---------------- */
.share-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}
.contact .share-row { flex-basis: 100%; }
.share-cap {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.22em;
  color: var(--dim); margin-right: 4px;
}
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--muted); cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}
.share-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.share-btn.copied { color: var(--good); border-color: rgba(52, 211, 153, 0.6); }

.send-box {
  margin-top: 14px; padding: 14px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 8px;
}
.send-box[hidden] { display: none; }
.send-box label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em; color: var(--dim);
}
.send-box-row { display: flex; gap: 8px; }
.send-box-row input {
  flex: 1; min-width: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--sans); font-size: 13.5px;
  padding: 9px 12px;
  transition: border-color 0.15s ease;
}
.send-box-row input:focus { outline: none; border-color: var(--accent); }

@media (max-width: 620px) {
  .send-box-row { flex-direction: column; }
}

/* ---------------- technology stack options (home) ---------------- */
.stack-panel { margin-top: 18px; }
.stack-lead {
  color: var(--muted); font-size: 13.5px; line-height: 1.55;
  margin: 0 0 16px; max-width: 78ch;
}
.stack-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px;
}
.stack-card {
  background: var(--panel-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 9px;
  transition: border-color 0.15s ease;
}
.stack-card:hover { border-color: var(--accent); }
.stack-card-head {
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.16em; color: var(--accent);
}
.stack-card p {
  margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--muted);
  flex: 1;
}
.stack-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.stack-tags span {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 3px 9px;
}
.mod-live { margin: 12px 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mod-live .muted { color: var(--dim); font-size: 11.5px; }
