/* ==========================================================================
   Theme: design tokens, base elements and small shared primitives
   ========================================================================== */

:root {
    --bg: #F4F6FA;
    --panel: #FFFFFF;
    --line: #E1E6EF;
    --text: #1B2433;
    --muted: #7C8AA3;
    --green: #1FAE68;
    --green-bg: #E6F7EE;
    --amber: #C98A1D;
    --amber-bg: #FBF1DE;
    --red: #E14D63;
    --red-bg: #FCE9EC;
    --blue: #3B6FE0;
    --navy: #0F1D3E;
}

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

html, body {
    margin: 0;
    height: 100%;
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
}

html { background: var(--bg); }

body {
    background:
        radial-gradient(1100px 520px at 88% -12%, rgba(91,140,255,.18), transparent 60%),
        radial-gradient(900px 520px at -8% 112%, rgba(31,174,104,.10), transparent 60%),
        linear-gradient(180deg, #EDF1FA 0%, #F5F7FC 100%);
    background-attachment: fixed;
}

a { color: var(--blue); }

.num { font-variant-numeric: tabular-nums; font-family: "SF Mono", Consolas, monospace; }

/* Chip (header meta) */
.chip {
    display: inline-block;
    background: #FFFFFF;
    border: 1px solid #E3E8F2;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(20,30,50,.05);
}
.chip.live { color: var(--text); }
.chip.live::before {
    content: "";
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    margin-right: 8px;
    vertical-align: 1px;
    animation: livePulse 2s ease-out infinite;
}

/* Status pill: g = running, a = idle, r = alarm/hold, n = neutral, b = info */
.status-pill {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 9px; font-weight: 600;
    padding: 2px 6px; border-radius: 20px;
    white-space: nowrap;
}
.status-pill.g { background: var(--green-bg); color: var(--green); }
.status-pill.a { background: var(--amber-bg); color: var(--amber); }
.status-pill.r { background: var(--red-bg); color: var(--red); animation: alarmPulse 1.6s ease-out infinite; }
.status-pill.n { background: #EDF1F7; color: var(--muted); }
.status-pill.b { background: #EAF0FE; color: var(--blue); }

/* Thin progress bar */
.qbar { height: 4px; border-radius: 3px; background: #EDF1F7; margin-top: 3px; overflow: hidden; }
.qbar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #3B6FE0, #7AA2FF); }
.qbar i.done { background: linear-gradient(90deg, #1FAE68, #5FD99A); }
.qbar i.hold { background: linear-gradient(90deg, #E14D63, #FF8FA0); }

/* Placeholder page content */
.empty-state {
    max-width: 520px;
    margin: 40px auto;
    padding: 28px 30px;
    text-align: center;
    background: rgba(255,255,255,.9);
    border: 1px dashed #C9D3E6;
    border-radius: 14px;
    color: var(--muted);
}
.empty-state h2 { margin: 0 0 6px; font-size: 17px; color: var(--text); }
.empty-state p { margin: 0; font-size: 13px; }

@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(31,174,104,.45); }
    100% { box-shadow: 0 0 0 7px rgba(31,174,104,0); }
}
@keyframes alarmPulse {
    0% { box-shadow: 0 0 0 0 rgba(225,77,99,.45); }
    100% { box-shadow: 0 0 0 6px rgba(225,77,99,0); }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
