/* ── Metrc Dashboard — dark data-dense theme ─────────────────── */

:root {
    /* Canonical OperatorIQ palette. Shared verbatim with the showcase pages
       and Growth Intelligence so the whole suite reads as one product. */
    --bg:           #ffffff;
    --bg-1:         #f8f9fa;
    --bg-2:         #ffffff;
    --bg-3:         #f1f3f4;
    --surface:      #ffffff;
    --surface-hover:#f8f9fa;
    --border:       #dadce0;
    --border-strong:#c4c8cd;

    --text:         #202124;
    --text-2:       #5f6368;
    --text-3:       #80868b;

    --accent:       #1a73e8;   /* primary action / brand */
    --accent-ink:   #ffffff;   /* text drawn on top of --accent */
    --accent-2:     #1a73e8;
    --ok:           #188038;   /* semantic "healthy", not the brand color */
    --blue:         #1a73e8;
    --purple:       #9334e6;
    --orange:       #e8710a;
    --red:          #d93025;
    --yellow:       #f9ab00;

    --radius:       10px;
    --radius-lg:    14px;
    --shadow:       0 1px 2px rgba(60,64,67,.20), 0 1px 3px 1px rgba(60,64,67,.10);
    --font-mono:    ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    font-size: 14px;
    height: 100%;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.hidden { display: none !important; }
.subtle { color: var(--text-2); font-size: 12px; }
.mono   { font-family: var(--font-mono); }
.muted  { color: var(--text-3); }

.app {
    display: grid;
    grid-template-columns: 240px 1fr;
    height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    background: var(--bg-1);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid var(--border);
}

.brand-mark {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 9px;
    display: grid; place-items: center;
    color: var(--accent-ink);
    font-weight: 800;
    font-size: 18px;
}

.brand-title { font-weight: 700; font-size: 15px; }
.brand-sub   { color: var(--text-3); font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; }

.nav {
    padding: 12px 8px;
    flex: 1;
}

.nav-section {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-3);
    padding: 14px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    color: var(--text-2);
    cursor: pointer;
    font-size: 13px;
}

.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.nav-item.active {
    background: rgba(26, 115, 232, 0.12);
    color: var(--accent);
}

.nav-item .material-symbols-outlined {
    font-size: 18px;
}

.sidebar-footer {
    padding: 12px 16px 18px;
    border-top: 1px solid var(--border);
    font-size: 12px;
}

.conn { display: flex; align-items: center; gap: 8px; }
.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-3);
    box-shadow: 0 0 0 3px rgba(128, 134, 139, 0.18);
}
.dot.ok  { background: var(--ok);  box-shadow: 0 0 0 3px rgba(24, 128, 56, 0.18); }
.dot.bad { background: var(--red);     box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.18); }

.lic {
    margin-top: 6px;
    color: var(--text-3);
    font-family: var(--font-mono);
    font-size: 11px;
}

/* ── Main / topbar ───────────────────────────────────────────── */
.main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.topbar-left h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.topbar-right { display: flex; gap: 8px; }

.btn-icon {
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    background: var(--bg-1);
    color: var(--text-2);
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.15s;
}
.btn-icon:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }
.btn-icon .material-symbols-outlined { font-size: 18px; }

.content {
    padding: 24px 28px;
    overflow-y: scroll;        /* always show — long pages get a draggable bar */
    flex: 1;
}

/* Wide, always-visible scrollbar — easier to grab and drag through long pages */
.content,
.table-wrap,
.sidebar {
    scrollbar-width: thin;             /* Firefox */
    scrollbar-color: var(--bg-3) var(--bg);  /* thumb / track */
}

.content::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}
.content::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
    background: var(--bg);
}
.content::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
    background: var(--bg-3);
    border: 3px solid var(--bg);       /* gives the thumb breathing room */
    border-radius: 999px;
    min-height: 40px;
}
.content::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}
.content::-webkit-scrollbar-thumb:active,
.table-wrap::-webkit-scrollbar-thumb:active,
.sidebar::-webkit-scrollbar-thumb:active {
    background: var(--accent);
}

/* Floating "back to top" button — appears on long pages */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 28px;
    width: 40px;
    height: 40px;
    background: var(--bg-1);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    color: var(--accent);
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 50;
}
.back-to-top.visible {
    opacity: 0.9;
    pointer-events: auto;
}
.back-to-top:hover { opacity: 1; transform: translateY(-2px); }

/* ── Hover tooltips on metric headers ────────────────────── */
[data-tip] { position: relative; cursor: help; }
[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-1);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    text-transform: none;
    letter-spacing: 0;
    width: max-content;
    max-width: 380px;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
    z-index: 50;
    white-space: pre-wrap;
}
[data-tip]::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--border-strong);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}
[data-tip]:hover::after,
[data-tip]:hover::before { opacity: 1; }

/* When tooltip would clip off the top, anchor below instead */
[data-tip-below]::after { bottom: auto; top: calc(100% + 8px); }
[data-tip-below]::before {
    bottom: auto; top: calc(100% + 2px);
    border-top-color: transparent; border-bottom-color: var(--border-strong);
}

/* Indicator dot next to tooltipped headers (subtle hint that it's clickable) */
th[data-tip] { padding-right: 18px !important; }
th[data-tip]::after { max-width: 340px; }

/* Subtle visual hint that an element has a tooltip (underline + help cursor) */
.kpi-label[data-tip] {
    text-decoration: underline dotted var(--text-2);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/* ── Global window pill + popover ────────────────────────── */
.window-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-1);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    margin-right: 6px;
    transition: background 0.15s, border-color 0.15s;
}
.window-pill:hover {
    background: var(--bg-2);
    border-color: var(--text-3);
}
.window-popover {
    position: absolute;
    top: 60px;
    right: 230px;
    background: var(--bg-1);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
    z-index: 200;
    min-width: 360px;
}
.window-popover.open { display: block !important; }
.popover-section { margin-bottom: 14px; }
.popover-section:last-child { margin-bottom: 0; }
.popover-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-2);
    margin-bottom: 8px;
}
.popover-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.popover-presets button {
    padding: 6px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.popover-presets button:hover { background: var(--bg-3); }
.popover-presets button.active {
    background: rgba(26, 115, 232, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}
.popover-custom {
    display: flex;
    align-items: center;
    gap: 8px;
}
.popover-custom input { width: 150px; }

/* ── Topbar live-pulse indicator ──────────────────────────── */
.live-pulse {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-2);
    margin-right: 6px;
    cursor: default;
    user-select: none;
    transition: background 0.2s, color 0.2s;
}
.live-pulse .live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-3);
    flex-shrink: 0;
    transition: background 0.2s, box-shadow 0.2s;
}
.live-pulse.is-live {
    color: var(--text);
    border-color: rgba(26, 115, 232, 0.4);
    background: rgba(26, 115, 232, 0.06);
}
.live-pulse.is-live .live-dot {
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.8);
    animation: live-dot-pulse 1.8s ease-out infinite;
}
.live-pulse.is-stale {
    color: var(--yellow);
    border-color: rgba(249, 171, 0, 0.4);
}
.live-pulse.is-stale .live-dot { background: var(--yellow); }
.live-pulse.is-error {
    color: #ef4444;
    border-color: rgba(217, 48, 37, 0.4);
}
.live-pulse.is-error .live-dot { background: #ef4444; }
@keyframes live-dot-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(26, 115, 232, 0.7); }
    70%  { box-shadow: 0 0 0 8px rgba(26, 115, 232, 0);   }
    100% { box-shadow: 0 0 0 0   rgba(26, 115, 232, 0);   }
}

/* ── Top loading progress bar ─────────────────────────────── */
.top-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: transparent;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.top-progress.active { opacity: 1; }
.top-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 50%, var(--purple) 100%);
    background-size: 200% 100%;
    transition: width 0.4s ease-out;
    box-shadow: 0 0 10px rgba(26,115,232,0.6);
    animation: shimmer 2.5s linear infinite;
}
@keyframes shimmer {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
.top-progress-label {
    position: fixed;
    top: 8px;
    right: 16px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.2s;
}
.top-progress.active .top-progress-label { opacity: 0.85; }

/* ── Floating AI assistant ─────────────────────────────────── */
.ai-fab {
    position: fixed;
    bottom: 24px;
    right: 80px;
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 20px rgba(26,115,232,0.45);
    z-index: 60;
    color: var(--accent-ink);
    transition: transform 0.15s, box-shadow 0.2s;
}
.ai-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(26,115,232,0.65); }
.ai-fab .material-symbols-outlined { font-size: 26px; }

.ai-panel {
    position: fixed;
    top: 0; right: 0;
    width: 420px; max-width: 95vw;
    height: 100vh;
    background: var(--bg-1);
    border-left: 1px solid var(--border);
    display: none;
    flex-direction: column;
    z-index: 100;
    box-shadow: -8px 0 32px rgba(60,64,67,0.18);
}
.ai-panel.open { display: flex; }
.ai-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ai-msg {
    padding: 10px 14px;
    border-radius: 10px;
    line-height: 1.5;
    font-size: 13px;
    max-width: 92%;
    white-space: pre-wrap;
    word-break: break-word;
}
.ai-msg.user { background: var(--bg-3); color: var(--text); align-self: flex-end; }
.ai-msg.bot  { background: rgba(26,115,232,0.08); color: var(--text); border-left: 3px solid var(--accent); }
.ai-msg.meta { background: transparent; color: var(--text-3); font-size: 11px; align-self: center; padding: 4px 0; }
.ai-input {
    border-top: 1px solid var(--border);
    padding: 12px;
    display: flex;
    gap: 8px;
}
.ai-input textarea {
    flex: 1;
    background: var(--bg-1);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    outline: none;
}
.ai-input textarea:focus { border-color: var(--accent); }
.ai-input .btn { align-self: flex-end; }

.error-banner, .warning-banner {
    padding: 12px 28px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
.error-banner   { background: rgba(217, 48, 37, 0.10); color: #a50e0e; }
.warning-banner { background: rgba(249, 171, 0, 0.10); color: #7a5900; }

.loading { color: var(--text-3); padding: 20px; }

/* ── KPI cards ───────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    transition: border-color 0.15s;
}
.kpi:hover { border-color: var(--border-strong); }

.kpi-label {
    color: var(--text-3);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 26px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.kpi-sub {
    color: var(--text-2);
    font-size: 12px;
    margin-top: 6px;
}

.kpi.green  .kpi-value { color: var(--accent); }
.kpi.blue   .kpi-value { color: var(--blue); }
.kpi.purple .kpi-value { color: var(--purple); }
.kpi.orange .kpi-value { color: var(--orange); }
.kpi.red    .kpi-value { color: var(--red); }
.kpi.cyan   .kpi-value { color: var(--accent-2); }

/* ── Sections ────────────────────────────────────────────────── */
.section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 20px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-title h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.section-title .count {
    color: var(--text-3);
    font-size: 12px;
}

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.tab {
    padding: 8px 14px;
    background: transparent;
    border: none;
    color: var(--text-2);
    cursor: pointer;
    font-size: 13px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── Tables ──────────────────────────────────────────────────── */
/* IMPORTANT: tables don't get wrapped in overflow-x:auto by default,
   because that creates a clipping context that traps the sticky header.
   Wide tables that need horizontal scroll opt in via .table-wrap--scroll-x.
   For tables with their own bounded scroll (max-height), the header sticks
   inside that scroll context. For everything else, the header sticks to the
   page's main scroll container (.content). */
/* Every data table scrolls inside its own wrapper with a bounded height, so the
   column-title header row ALWAYS stays frozen at the top while you scroll the rows
   (works on every tab regardless of page-level scroll or ancestor clipping). Short
   tables that fit within the height show no scrollbar and look unchanged. */
.table-wrap {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    max-height: 70vh;
    overflow: auto;
}
.table-wrap--scroll-x {
    overflow: auto;
}

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

thead th {
    background: var(--bg-1);
    color: var(--text-3);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.6px;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    /* Sticky relative to the nearest scrolling ancestor.
       Top: 0 inside a max-height-bounded wrap; for unbounded tables this sticks
       to the top of the .content scroll viewport (page-level scroll). */
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 1px 0 var(--border);
}

tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(60,64,67,0.04); }

td.mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }
td.num  { font-variant-numeric: tabular-nums; text-align: right; }

.empty {
    padding: 36px;
    text-align: center;
    color: var(--text-3);
    font-size: 13px;
}

/* ── Pills / badges ──────────────────────────────────────────── */
.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-3);
    color: var(--text-2);
}
.pill.green  { background: rgba(26, 115, 232, 0.15); color: var(--accent); }
.pill.blue   { background: rgba(26, 115, 232, 0.15); color: var(--blue); }
.pill.purple { background: rgba(147, 52, 230, 0.15); color: var(--purple); }
.pill.orange { background: rgba(232, 113, 10, 0.15); color: var(--orange); }
.pill.red    { background: rgba(217, 48, 37, 0.15); color: var(--red); }
.pill.yellow { background: rgba(249, 171, 0, 0.15); color: var(--yellow); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-grid {
    display: grid;
    gap: 14px;
    max-width: 640px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
    font-size: 12px;
    color: var(--text-2);
    font-weight: 500;
}
.field .hint { color: var(--text-3); font-size: 11px; }

.input, .select, textarea {
    background: var(--bg-1);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.btn {
    background: var(--accent);
    color: var(--accent-ink);
    border: none;
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.btn:hover { opacity: 0.9; }
.btn.secondary {
    background: var(--bg-3);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn.secondary:hover { background: var(--surface-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.form-actions { display: flex; gap: 10px; margin-top: 4px; }

/* ── Charts ──────────────────────────────────────────────────── */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.chart-card h3 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-wrap {
    position: relative;
    height: 260px;
}

/* ── Misc ────────────────────────────────────────────────────── */
.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.search {
    flex: 1;
    min-width: 200px;
}

.scroll-x { overflow-x: auto; }

/* ── Hub sub-navigation (child tabs of the active hub) ───────── */
.subnav {
    display: flex;
    gap: 2px;
    padding: 0 24px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: thin;
}
.subnav::-webkit-scrollbar { height: 0; }
.subnav-item {
    padding: 11px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-3);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s;
}
.subnav-item:hover { color: var(--text-1); }
.subnav-item.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── Day × hour heatmap (Sales) ──────────────────────────────── */
.heatmap-table { border-collapse: separate; border-spacing: 2px; width: auto; }
.heatmap-table thead th {
    background: transparent; border: none; box-shadow: none; position: static;
    font-size: 9px; color: var(--text-3); text-align: center; padding: 2px 0; font-weight: 500;
}
.heatmap-table .hm-day {
    background: transparent; border: none; box-shadow: none; position: static;
    font-size: 11px; color: var(--text-2); font-weight: 600; text-align: right;
    padding-right: 8px; text-transform: none; letter-spacing: 0;
}
.heatmap-table .hm-cell {
    width: 26px; height: 22px; border: 1px solid var(--border);
    border-radius: 3px; padding: 0; cursor: default;
}
.heatmap-table .hm-cell:hover { outline: 2px solid var(--accent); }

/* ── Promo Calendar — month grid ─────────────────────────────── */
.cal-months { display: flex; flex-direction: column; gap: 22px; }
.cal-month-title {
    font-size: 15px; font-weight: 700; color: var(--text);
    margin: 0 0 10px; letter-spacing: 0.3px;
}
.cal-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.cal-dow {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--text-3); text-align: center; padding: 2px 0;
}
.cal-cell {
    min-height: 118px; background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 6px 7px; display: flex; flex-direction: column;
    gap: 3px;
}
.cal-cell.blank { background: transparent; border: none; }
.cal-cell.past { opacity: 0.32; }
.cal-cell.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cal-daynum { font-size: 12px; font-weight: 700; color: var(--text-2); line-height: 1; }
.cal-cell.today .cal-daynum { color: var(--accent); }
.cal-theme { font-size: 10px; font-weight: 600; color: var(--text-2); line-height: 1.2; }
.cal-event {
    font-size: 10px; font-weight: 700; line-height: 1.2; color: #fff;
    background: var(--blue); border-radius: 5px; padding: 2px 5px;
    cursor: default; word-break: break-word;
}
.cal-event.big   { background: var(--red); }
.cal-event.major { background: var(--orange); color: #111; }
.cal-deal {
    font-size: 9.5px; line-height: 1.25; color: var(--text-3);
    word-break: break-word;
}
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--text-2); margin: 0 0 14px; }
.cal-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
