/* ============================================================
   KEYSTONE COMMAND — dark cinematic theme
   navy #1F3A52 base · gold #C9A227 accents · blueprint motifs
   ============================================================ */

:root {
  --bg: #0A121D;
  --bg-2: #0D1826;
  --surface: #10203380;
  --surface-solid: #102033;
  --raise: #16283E;
  --navy: #1F3A52;
  --line: #24405C;
  --line-soft: #1A3049;
  --gold: #C9A227;
  --gold-hi: #E9C64F;
  --ink: #E8EDF4;
  --muted: #8CA0B8;
  --dim: #5E7288;
  --good: #3FBF7F;
  --bad: #E4534F;
  --warn: #E8A33D;
  --info: #4FA3E0;
  --display: 'Anton', 'Arial Narrow', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --side-w: 232px;
  --r: 10px;
  --glow-gold: 0 0 18px rgba(201, 162, 39, .28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-color: var(--navy) var(--bg); }
body {
  font-family: var(--sans);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(31, 58, 82, .55), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(31, 58, 82, .35), transparent 55%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* blueprint grid texture */
.grid-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(79, 130, 176, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 130, 176, .045) 1px, transparent 1px),
    linear-gradient(rgba(79, 130, 176, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 130, 176, .08) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px;
}

.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .22em; color: var(--gold); }
.accent { color: var(--gold); }

/* ---------------- layout ---------------- */
.sidebar {
  position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; width: var(--side-w);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(16, 32, 51, .92), rgba(10, 18, 29, .96));
  border-right: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
  padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 4px 8px 18px; }
.brand-mark { width: 30px; height: 30px; color: var(--gold); flex: none; }
.brand-name { font-family: var(--display); font-size: 19px; letter-spacing: .04em; text-transform: uppercase; }
.brand-name em { font-style: normal; color: var(--gold); }

.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; text-decoration: none;
  color: var(--muted); font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent; transition: all .18s ease;
}
.side-nav a .nv-ico { width: 17px; height: 17px; flex: none; opacity: .8; }
.side-nav a:hover { color: var(--ink); background: rgba(31, 58, 82, .35); }
.side-nav a.active {
  color: var(--gold-hi); background: linear-gradient(90deg, rgba(201, 162, 39, .14), rgba(201, 162, 39, .03));
  border-color: rgba(201, 162, 39, .3);
}
.side-nav .nav-sep { margin: 10px 10px 6px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em; color: var(--dim); }
.badge-dot { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: #241d04; font-family: var(--mono); font-size: 10.5px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }

.side-foot { border-top: 1px solid var(--line-soft); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.user-chip { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.user-chip b { color: var(--ink); display: block; font-size: 13px; }
.user-chip .role-tag { color: var(--gold); font-family: var(--mono); font-size: 10px; letter-spacing: .15em; }

.main-col { margin-left: var(--side-w); position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px; border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 18, 29, .82); backdrop-filter: blur(10px);
}
.page-title { font-family: var(--display); font-size: 24px; letter-spacing: .05em; text-transform: uppercase; font-weight: 400; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.clock { color: var(--dim); }
.content { padding: 24px 26px 90px; max-width: 1340px; width: 100%; }

.nav-toggle { display: none; background: none; border: 0; width: 34px; height: 34px; cursor: pointer; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); }

.tabbar { display: none; }

/* ---------------- buttons & inputs ---------------- */
.btn {
  font-family: var(--sans); font-weight: 600; font-size: 13px;
  border-radius: 8px; border: 1px solid transparent; cursor: pointer;
  padding: 9px 16px; transition: all .18s ease; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-wide { width: 100%; justify-content: center; }
.btn-solid { background: var(--gold); color: #1c1503; }
.btn-solid:hover { background: var(--gold-hi); box-shadow: var(--glow-gold); }
.btn-gold { background: linear-gradient(135deg, rgba(201,162,39,.18), rgba(201,162,39,.06)); color: var(--gold-hi); border-color: rgba(201,162,39,.45); }
.btn-gold:hover { box-shadow: var(--glow-gold); border-color: var(--gold); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--muted); }
.btn-danger { background: transparent; color: var(--bad); border-color: rgba(228,83,79,.4); }
.btn-danger:hover { background: rgba(228,83,79,.12); }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--muted); width: 30px; height: 30px; border-radius: 8px; font-size: 17px; cursor: pointer; line-height: 1; }
.icon-btn:hover { color: var(--ink); border-color: var(--muted); }

input, select, textarea {
  font-family: var(--sans); font-size: 13.5px; color: var(--ink);
  background: rgba(10, 18, 29, .7); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; width: 100%; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.12); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238CA0B8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }
label.field { display: flex; flex-direction: column; gap: 6px; }
label.field > span { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: var(--muted); }

/* ---------------- cards / panels ---------------- */
.panel {
  background: linear-gradient(160deg, rgba(22, 40, 62, .55), rgba(13, 24, 38, .65));
  border: 1px solid var(--line-soft); border-radius: var(--r);
  padding: 18px 20px; position: relative; overflow: hidden;
}
.panel::before {
  content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,162,39,.35), transparent);
}
.panel-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-title { font-family: var(--display); font-size: 16px; letter-spacing: .07em; text-transform: uppercase; font-weight: 400; }
.panel-head .spacer { flex: 1; }
.section-index { font-family: var(--mono); font-size: 10px; color: var(--gold); letter-spacing: .2em; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* stat blocks */
.stat {
  padding: 16px 18px; border: 1px solid var(--line-soft); border-radius: var(--r);
  background: linear-gradient(160deg, rgba(31,58,82,.35), rgba(13,24,38,.5));
  position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -22px; top: -22px; width: 74px; height: 74px;
  border: 1px solid rgba(201,162,39,.16); transform: rotate(12deg);
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%);
}
.stat-value { font-family: var(--display); font-size: 32px; letter-spacing: .02em; color: var(--ink); line-height: 1.05; }
.stat-value .unit { font-size: 18px; color: var(--gold); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-note { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; color: var(--dim); margin-top: 7px; display: block; }
.stat.alert { border-color: rgba(228,83,79,.5); box-shadow: 0 0 16px rgba(228,83,79,.15) inset; }
.stat.alert .stat-value { color: var(--bad); }

/* status pills + glows */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { color: var(--good); border-color: rgba(63,191,127,.4); background: rgba(63,191,127,.08); }
.pill.bad { color: var(--bad); border-color: rgba(228,83,79,.45); background: rgba(228,83,79,.1); box-shadow: 0 0 12px rgba(228,83,79,.25); }
.pill.warn { color: var(--warn); border-color: rgba(232,163,61,.45); background: rgba(232,163,61,.09); }
.pill.info { color: var(--info); border-color: rgba(79,163,224,.4); background: rgba(79,163,224,.08); }
.pill.gold { color: var(--gold-hi); border-color: rgba(201,162,39,.5); background: rgba(201,162,39,.1); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--r); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
table.data th {
  text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  color: var(--dim); text-transform: uppercase; font-weight: 500;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft);
  background: rgba(16, 32, 51, .6); white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid rgba(26, 48, 73, .5); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .15s; cursor: pointer; }
table.data tbody tr:hover { background: rgba(31, 58, 82, .28); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: rgba(13, 24, 38, .55); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 12px; min-height: 200px; }
.kcol-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 0 2px; }
.kcol-title { font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; color: var(--gold); text-transform: uppercase; }
.kcount { font-family: var(--mono); font-size: 10px; color: var(--dim); }
.kcard {
  background: linear-gradient(150deg, rgba(31,58,82,.45), rgba(16,32,51,.65));
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px; margin-bottom: 10px;
  cursor: pointer; transition: all .18s ease;
}
.kcard:hover { border-color: rgba(201,162,39,.45); transform: translateY(-1px); }
.kcard h4 { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.kcard .meta { font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.kcard .next { font-size: 11.5px; margin-top: 8px; color: var(--muted); border-top: 1px dashed rgba(36,64,92,.7); padding-top: 7px; }
.kcard.overdue { border-color: rgba(228,83,79,.65); box-shadow: 0 0 14px rgba(228,83,79,.28); animation: pulse-red 2.4s ease-in-out infinite; }
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 8px rgba(228,83,79,.18); }
  50% { box-shadow: 0 0 20px rgba(228,83,79,.4); }
}

/* brief */
.brief-panel { border-color: rgba(201,162,39,.35); }
.brief-body { font-size: 13.5px; line-height: 1.65; color: var(--ink); }
.brief-body strong { color: var(--gold-hi); }
.brief-body ul { margin: 6px 0 12px 18px; }
.brief-cash { margin-top: 14px; border-top: 1px dashed rgba(201,162,39,.35); padding-top: 12px; font-size: 13px; color: var(--muted); }
.brief-cash .mono { color: var(--gold); display: block; margin-bottom: 5px; }

/* chat panel */
.chat-panel {
  position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(430px, 100vw);
  background: linear-gradient(180deg, #0F1D2E, #0A121D);
  border-left: 1px solid var(--line); display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .28s cubic-bezier(.22,.8,.3,1);
  box-shadow: -20px 0 60px rgba(0,0,0,.5);
}
.chat-panel.open { transform: translateX(0); }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; border-bottom: 1px solid var(--line-soft); }
.chat-title { font-family: var(--display); font-size: 20px; letter-spacing: .06em; text-transform: uppercase; font-weight: 400; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 92%; padding: 10px 13px; border-radius: 10px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; }
.chat-msg.user { align-self: flex-end; background: rgba(201,162,39,.14); border: 1px solid rgba(201,162,39,.35); }
.chat-msg.assistant { align-self: flex-start; background: rgba(31,58,82,.4); border: 1px solid var(--line-soft); }
.chat-msg.thinking { color: var(--dim); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; }
.chat-input-row { display: flex; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line-soft); }
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(4, 8, 14, .6); opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.show { opacity: 1; pointer-events: auto; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 70; display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal.open { display: flex; }
.modal-card {
  width: 100%; max-width: 520px; background: linear-gradient(170deg, #14263C, #0D1826);
  border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), var(--glow-gold);
  animation: modal-in .22s ease;
}
@keyframes modal-in { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h2 { font-family: var(--display); font-size: 18px; letter-spacing: .06em; text-transform: uppercase; font-weight: 400; }
#modalForm { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
#modalForm .full { grid-column: 1 / -1; }
#modalForm .form-actions { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

/* charts */
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg text { font-family: var(--mono); font-size: 9px; fill: var(--dim); letter-spacing: .05em; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .1em; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* week view */
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.wday { border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px; min-height: 120px; background: rgba(13,24,38,.5); }
.wday.today { border-color: rgba(201,162,39,.55); box-shadow: 0 0 12px rgba(201,162,39,.15); }
.wday-head { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; color: var(--dim); margin-bottom: 6px; text-transform: uppercase; }
.wday.today .wday-head { color: var(--gold); }
.witem { font-size: 11px; padding: 5px 7px; border-radius: 6px; margin-bottom: 5px; background: rgba(31,58,82,.5); border-left: 2px solid var(--gold); cursor: pointer; line-height: 1.35; }
.witem.cat-payment { border-left-color: var(--bad); }
.witem.cat-meeting { border-left-color: var(--info); }
.witem.cat-site-visit { border-left-color: var(--good); }
.witem.cat-deadline { border-left-color: var(--warn); }
.witem.cat-personal { border-left-color: #B08FE0; }
.witem.done { opacity: .38; text-decoration: line-through; }

/* radar cards */
.op-card { display: flex; gap: 14px; align-items: flex-start; padding: 15px 16px; border: 1px solid var(--line-soft); border-radius: var(--r); background: linear-gradient(155deg, rgba(31,58,82,.35), rgba(13,24,38,.55)); margin-bottom: 12px; }
.op-card.dismissed { opacity: .4; }
.op-card.accepted { border-color: rgba(63,191,127,.4); }
.op-kind { width: 40px; height: 40px; flex: none; border-radius: 9px; border: 1px solid rgba(201,162,39,.4); display: flex; align-items: center; justify-content: center; font-size: 17px; background: rgba(201,162,39,.08); }
.op-body { flex: 1; min-width: 0; }
.op-body h4 { font-size: 14px; margin-bottom: 3px; }
.op-body .meta { font-size: 12px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.op-body .details { font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.op-actions { display: flex; flex-direction: column; gap: 7px; flex: none; }

/* deal analyzer */
.deal-grid { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.deal-out { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.deal-metric { border: 1px solid var(--line-soft); border-radius: 8px; padding: 11px 13px; background: rgba(13,24,38,.55); }
.deal-metric .mono { display: block; margin-bottom: 4px; font-size: 9.5px; }
.deal-metric b { font-family: var(--display); font-weight: 400; font-size: 19px; letter-spacing: .02em; }
.deal-metric.hero { grid-column: 1 / -1; border-color: rgba(201,162,39,.4); background: linear-gradient(135deg, rgba(201,162,39,.1), rgba(13,24,38,.55)); }
.deal-metric.hero b { font-size: 28px; color: var(--gold-hi); }
.deal-metric b.neg { color: var(--bad); }
.deal-metric b.pos { color: var(--good); }

/* property cards */
.prop-card { border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; background: linear-gradient(165deg, rgba(31,58,82,.4), rgba(13,24,38,.6)); cursor: pointer; transition: all .18s; }
.prop-card:hover { border-color: rgba(201,162,39,.45); transform: translateY(-2px); }
.prop-top { padding: 14px 16px 10px; border-bottom: 1px dashed rgba(36,64,92,.6); display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.prop-top h4 { font-size: 14px; line-height: 1.35; }
.prop-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(26,48,73,.6); }
.prop-num { background: rgba(13,24,38,.85); padding: 9px 14px; }
.prop-num .mono { font-size: 9px; display: block; }
.prop-num b { font-size: 14px; font-variant-numeric: tabular-nums; }
.prop-notes { padding: 10px 16px 13px; font-size: 12px; color: var(--muted); }

/* acquisitions desk */
.acq-nums { display: flex; gap: 8px 22px; flex-wrap: wrap; margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 8px; background: rgba(13,24,38,.5); font-size: 13px; }
.acq-nums i { font-style: normal; margin-right: 6px; font-size: 9.5px; }
.steps-row { display: flex; flex-direction: column; gap: 7px; }
.step-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step.done { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step.done .mono { font-size: 10px; }

/* empty state */
.empty { padding: 34px; text-align: center; color: var(--dim); font-size: 13px; border: 1px dashed var(--line); border-radius: var(--r); }

/* toast */
.toast {
  position: fixed; z-index: 90; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #14263C; border: 1px solid var(--gold); color: var(--ink); border-radius: 10px;
  padding: 11px 20px; font-size: 13px; opacity: 0; transition: all .3s ease; box-shadow: var(--glow-gold);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--bad); box-shadow: 0 0 18px rgba(228,83,79,.3); }

/* view transitions */
.view-anim { animation: view-in .3s ease; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- login ---------------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { position: relative; z-index: 1; width: min(400px, 92vw); text-align: center; padding: 40px 0; }
.login-keystone { width: 110px; color: var(--gold); opacity: .8; margin-bottom: 18px; }
.login-title { font-family: var(--display); font-size: 46px; line-height: 1.02; letter-spacing: .04em; text-transform: uppercase; font-weight: 400; margin: 10px 0 28px; }
.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-error { color: var(--bad); font-size: 13px; min-height: 18px; text-align: center; }
.login-foot { margin-top: 26px; }

/* ---------------- responsive ---------------- */
@media (max-width: 1080px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .deal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --side-w: 0px; }
  .sidebar { transform: translateX(-105%); transition: transform .25s ease; width: 250px; }
  .sidebar.open { transform: none; box-shadow: 30px 0 60px rgba(0,0,0,.5); }
  .main-col { margin-left: 0; }
  .nav-toggle { display: flex; }
  .content { padding: 18px 14px 96px; }
  .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: repeat(2, 1fr); }
  .page-title { font-size: 19px; }
  .clock { display: none; }
  .tabbar {
    display: flex; position: fixed; z-index: 40; bottom: 0; left: 0; right: 0;
    background: rgba(10, 18, 29, .95); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line-soft); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--dim); font-family: var(--mono); font-size: 8.5px; letter-spacing: .08em; padding: 4px 8px; border-radius: 8px; }
  .tabbar a svg { width: 20px; height: 20px; }
  .tabbar a.active { color: var(--gold); }
}
@media (max-width: 480px) {
  .grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 25px; }
  #modalForm { grid-template-columns: 1fr; }
}
