/* ═══════════════════════════════════════════════════════════════
   Green Energy Car Wash — Admin Dashboard (Maroon Refresh)
   Warm off-white + สีแดงเลือดหมู accent
═══════════════════════════════════════════════════════════════ */

:root {
    /* Surfaces — warm paper */
    --bg-0: #FBF8F5;
    --bg-1: #F5EFE9;
    --bg-2: #FFFFFF;
    --bg-3: #F2ECE6;

    /* Ink */
    --ink: #1F1A17;
    --ink-2: #3A322E;
    --ink-3: #6B6058;
    --muted: #8A7F76;
    --dim: #B3A89E;
    --faint: #DDD3C8;

    /* Lines */
    --line: #E8DFD6;
    --line-soft: #F0E8DF;
    --line-strong: #D9CEC2;

    /* Maroon */
    --maroon-50:  #FBEFEF;
    --maroon-100: #F6DDDD;
    --maroon-200: #E9B8B8;
    --maroon-300: #D68A8A;
    --maroon-400: #B85757;
    --maroon-500: #8B2E2E;
    --maroon-600: #722424;
    --maroon-700: #5B1B1B;
    --maroon-800: #421313;

    --accent: var(--maroon-500);
    --accent-hover: var(--maroon-600);
    --accent-soft: var(--maroon-100);
    --accent-tint: var(--maroon-50);

    /* Semantic */
    --ok: #2F7D5A;
    --ok-soft: #E4F0EA;
    --ok-ink: #1C5A3F;
    --warn: #B87A1F;
    --warn-soft: #FBEFD7;
    --warn-ink: #8C5A12;
    --danger: var(--maroon-500);
    --danger-soft: var(--maroon-100);
    --danger-ink: var(--maroon-700);

    /* Legacy aliases kept so old JS/HTML still matches */
    --bg: var(--bg-0);
    --sidebar: var(--maroon-700);
    --card: var(--bg-2);
    --card-border: var(--line);
    --primary: var(--maroon-500);
    --primary-light: var(--maroon-400);
    --primary-dark: var(--maroon-700);
    --success: var(--ok);
    --warning: var(--warn);
    --text: var(--ink);

    --font: 'Outfit', 'IBM Plex Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'Courier New', monospace;

    --sidebar-w: 252px;
    --radius: 14px;

    --shadow-xs: 0 1px 2px rgba(31, 26, 23, 0.04);
    --shadow: 0 2px 8px rgba(31, 26, 23, 0.05), 0 1px 2px rgba(31, 26, 23, 0.04);
    --shadow-md: 0 6px 18px rgba(31, 26, 23, 0.06), 0 2px 6px rgba(31, 26, 23, 0.04);
    --shadow-lg: 0 16px 40px rgba(31, 26, 23, 0.08), 0 4px 10px rgba(31, 26, 23, 0.04);
    --shadow-accent: 0 6px 18px rgba(139, 46, 46, 0.18);
    --shadow-hover: var(--shadow-md);

    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

body {
    background: var(--bg-0);
    color: var(--ink);
    font-family: var(--font);
    min-height: 100vh;
    display: flex;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 15px;
    line-height: 1.55;
}

/* ═══════ SIDEBAR (deep maroon) ═══════ */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--maroon-700);
    color: #F6DDDD;
    border-right: 1px solid var(--maroon-700);
    display: flex;
    flex-direction: column;
    padding: 1.4rem 0.9rem;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    box-shadow: 0 0 32px rgba(66, 19, 19, 0.18);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0 0.4rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.2rem;
}

.logo-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: url('/lite-logo.png') center/135% no-repeat;
    color: var(--maroon-600);
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.logo-title {
    font-weight: 700;
    font-size: 0.88rem;
    display: block;
    line-height: 1.15;
    color: #fff;
}

.logo-sub {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-top: 2px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s var(--ease);
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nav-item.active {
    background: #fff;
    color: var(--maroon-600);
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    border-left: none;
}

.nav-item i {
    width: 24px;
    text-align: center;
    font-size: 1.15rem;
    -webkit-text-stroke: 0.5px var(--maroon-700);
}

.nav-item.active i {
    -webkit-text-stroke: 0.5px #fff;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
}

.clock {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.clock-date {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.25rem;
}

/* ═══════ MAIN CONTENT ═══════ */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2rem 2.5rem;
    min-height: 100vh;
    background: var(--bg-0);
    position: relative;
    max-width: calc(var(--sidebar-w) + 1200px + 5rem);
}

.main-content::before { content: none; }

.content-section {
    display: none;
    position: relative;
    z-index: 1;
}

.content-section.active { display: block; }

/* ═══════ PAGE HEADER ═══════ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    background: linear-gradient(100deg, var(--maroon-600), var(--maroon-500));
    color: #fff;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(139, 46, 46, 0.22);
    position: relative;
    overflow: hidden;
    gap: 1rem;
}

.page-header > * { position: relative; z-index: 1; }

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.012em;
    color: #fff;
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    white-space: nowrap;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.35);
}

.btn-refresh:disabled {
    opacity: 0.7;
    cursor: progress;
}

.btn-refresh.is-refreshing i {
    animation: btn-refresh-spin 0.8s linear infinite;
}

@keyframes btn-refresh-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ═══════ STAT CARDS ═══════ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--maroon-500);
    transition: all 0.22s var(--ease);
    box-shadow: var(--shadow);
}

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

.stat-blue,
.stat-green,
.stat-purple,
.stat-amber {
    background: #fff;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    flex-shrink: 0;
    background: var(--maroon-50);
    color: var(--maroon-500);
}

.stat-blue .stat-icon  { background: var(--maroon-50); color: var(--maroon-500); }
.stat-green .stat-icon { background: var(--ok-soft); color: var(--ok); }
.stat-purple .stat-icon{ background: var(--bg-1); color: var(--ink-2); }
.stat-amber .stat-icon { background: var(--warn-soft); color: var(--warn-ink); }

.stat-body { min-width: 0; }

.stat-label {
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

/* ═══════ SECTION HEADER ═══════ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
    padding: 0.8rem 1rem;
    background: var(--maroon-50);
    border-left: 3px solid var(--maroon-500);
    border-radius: 10px;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.008em;
    color: var(--maroon-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.section-title i { color: var(--maroon-500); }

/* ═══════ BAY GRID ═══════ */
.bay-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.bay-card {
    border-radius: 16px;
    padding: 1.25rem 1.35rem 1.1rem;
    background: #fff;
    border: 1px solid var(--line);
    transition: all 0.22s var(--ease);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.bay-hero {
    margin: 0.45rem 0 0.85rem;
    padding: 1rem;
    background: linear-gradient(180deg, var(--bg-1), #fff);
    border: 1px solid var(--line);
    border-radius: 12px;
    text-align: center;
}

.bay-hero-label {
    font-size: 0.62rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.bay-hero-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.bay-card.busy .bay-hero {
    background: linear-gradient(180deg, var(--maroon-50), #fff);
    border-color: var(--maroon-200);
}

.bay-card.busy .bay-hero-value {
    color: var(--maroon-500);
}

.bay-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.bay-meta-tile {
    padding: 0.55rem 0.7rem;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.bay-meta-tile .label {
    font-size: 0.62rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.bay-meta-tile .value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.bay-card-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--line);
    font-size: 0.78rem;
    color: var(--ink-3);
    line-height: 1.55;
}

/* ═══════ Overview Insights Strip ═══════ */
.insights-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.insight-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow);
}

.insight-card h3 {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.insight-card h3 i { color: var(--maroon-500); }

.online-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    background: var(--bg-1);
    border: 1px solid var(--line);
    margin-bottom: 0.5rem;
    font-size: 0.86rem;
}

.online-bar .name {
    font-weight: 700;
    color: var(--ink);
    flex: 1;
    font-variant-numeric: tabular-nums;
}

.online-bar .badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
}

.online-bar .badge.on { background: var(--ok-soft); color: var(--ok-ink); }
.online-bar .badge.off { background: #FBEFEF; color: #B12626; }

.session-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0;
    border-bottom: 1px dashed var(--line);
    font-size: 0.85rem;
}

.session-row:last-child { border-bottom: none; }

.session-row .badge-bay {
    background: var(--maroon-500);
    color: #fff;
    padding: 0.18rem 0.55rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.empty-soft {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    padding: 1.5rem 0.5rem;
}

.bay-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.bay-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    transition: background 0.2s;
}

.bay-card.idle::before { background: var(--ok); }
.bay-card.busy::before { background: var(--maroon-500); }

.bay-card.busy {
    background: linear-gradient(180deg, var(--maroon-50), #fff 55%);
    border-color: var(--maroon-200);
}

.bay-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    margin-top: 2px;
}

.bay-name {
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--ink);
}

.bay-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
}

.pill-idle {
    background: var(--ok-soft);
    color: var(--ok-ink);
}

.pill-busy {
    background: var(--maroon-500);
    color: #fff;
}

.pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.pill-busy .pill-dot { animation: pulse-dot 1.8s ease-in-out infinite; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.bay-user-info {
    font-size: 0.78rem;
    color: var(--ink-3);
    line-height: 1.55;
}

.bay-user-info strong {
    color: var(--ink);
    font-weight: 600;
}

.bay-elapsed {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--maroon-50);
    border-radius: 6px;
    padding: 0.15rem 0.5rem;
    color: var(--maroon-500);
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
}

/* ═══════ CARD (general) ═══════ */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title i { color: var(--maroon-500); }

.control-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* ═══════ BAY SELECTOR ═══════ */
.bay-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.bay-tab {
    padding: 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-3);
    cursor: pointer;
    text-align: center;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s var(--ease);
}

.bay-tab:hover {
    background: var(--bg-1);
    color: var(--ink);
    border-color: var(--line-strong);
}

.bay-tab.selected {
    background: var(--maroon-50);
    border-color: var(--maroon-300);
    color: var(--maroon-600);
}

/* ═══════ CMD BUTTONS ═══════ */
.cmd-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.cmd-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.95rem 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    color: var(--ink);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
}

.cmd-btn i { font-size: 1.25rem; }

.cmd-btn:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
}

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

.cmd-btn.water i  { color: #4F7CAB; }
.cmd-btn.foam i   { color: #9B8AB5; }
.cmd-btn.air i    { color: #8A8A8A; }
.cmd-btn.wax i    { color: #B89B3E; }
.cmd-btn.tyre i   { color: #5E8A6B; }
.cmd-btn.stop i   { color: var(--maroon-500); }

.cmd-result {
    padding: 0.7rem 1rem;
    border-radius: 10px;
    background: var(--bg-1);
    border: 1px solid var(--line);
    font-size: 0.82rem;
    color: var(--ink-3);
    text-align: center;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ═══════ BAY CONTROL: STRIP + FOCUS ═══════ */
.bay-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.bay-strip-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.9rem 1rem 0.9rem 1.1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.22s var(--ease);
    color: var(--ink);
    font-family: var(--font);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.bay-strip-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    transition: background 0.2s;
}

.bay-strip-card.bsc-idle::before { background: var(--ok); }
.bay-strip-card.bsc-busy::before { background: var(--maroon-500); }

.bay-strip-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.bay-strip-card.bsc-selected {
    border-color: var(--maroon-300);
    box-shadow: 0 0 0 3px rgba(139, 46, 46, 0.1), var(--shadow);
}

.bs-row-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.bs-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.bsc-idle .bs-dot { background: var(--ok); }
.bsc-busy .bs-dot {
    background: var(--maroon-500);
    animation: pulse-dot 1.8s ease-in-out infinite;
}

.bs-name {
    font-weight: 700;
    font-size: 0.98rem;
    flex: 1;
    color: var(--ink);
}

.bs-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
}

.bsc-idle .bs-pill { background: var(--ok-soft); color: var(--ok-ink); }
.bsc-busy .bs-pill { background: var(--maroon-500); color: #fff; }

.bs-row-mid {
    font-size: 0.8rem;
    color: var(--ink-3);
    margin-bottom: 0.55rem;
    min-height: 1.2em;
}

.bs-user { color: var(--ink); font-weight: 600; }
.bs-user i { color: var(--maroon-500); margin-right: 0.3rem; }
.bs-idle { color: var(--muted); }

.bs-row-bot {
    display: flex;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line-soft);
}

.bs-metric {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.bs-metric em {
    font-size: 0.62rem;
    color: var(--muted);
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.bs-metric strong {
    font-size: 0.88rem;
    color: var(--ink);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ─── Focus Panel ─── */
.bay-focus-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.bay-focus-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.bay-focus-card.bfc-idle::before { background: var(--ok); }
.bay-focus-card.bfc-busy::before { background: var(--maroon-500); }

.bf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.bf-title {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.bf-title i {
    font-size: 1.4rem;
    color: var(--maroon-500);
}

.bf-title h2 {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.008em;
    color: var(--ink);
}

.bf-status {
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.bfc-idle .bf-status { background: var(--ok-soft); color: var(--ok-ink); }
.bfc-busy .bf-status { background: var(--maroon-500); color: #fff; }

.bf-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.bf-btn {
    padding: 0.55rem 1rem;
    border-radius: 10px;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid transparent;
}

.bf-btn-topup {
    border-color: var(--maroon-200);
    background: var(--maroon-50);
    color: var(--maroon-600);
}

.bf-btn-topup:hover {
    background: var(--maroon-100);
    color: var(--maroon-700);
}

.bf-btn-reset {
    border-color: var(--maroon-300);
    background: #fff;
    color: var(--maroon-500);
}

.bf-btn-reset:hover { background: var(--maroon-50); }

.bf-info {
    padding: 1rem 1.1rem;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 1.1rem;
}

.bf-idle-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ok-ink);
    font-weight: 600;
    font-size: 0.92rem;
}

.bf-idle-badge i { font-size: 1.05rem; color: var(--ok); }

.bf-user { display: flex; align-items: center; gap: 0.9rem; }

.bf-user-avatar {
    width: 44px; height: 44px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--maroon-400), var(--maroon-600));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.05rem;
    flex-shrink: 0;
}

.bf-user-body { flex: 1; min-width: 0; }
.bf-user-name { font-weight: 700; font-size: 1rem; margin-bottom: 0.2rem; color: var(--ink); }

.bf-user-meta {
    display: flex; gap: 1rem; flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--ink-3);
}

.bf-user-meta i { margin-right: 0.3rem; color: var(--muted); }
.bf-user-meta .cbc-elapsed {
    color: var(--maroon-500);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.bf-muted { color: var(--muted); font-size: 0.8rem; }

.bf-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-bottom: 1.4rem;
}

.bf-stat {
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bf-stat em {
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-style: normal;
    font-weight: 600;
}

.bf-stat strong {
    font-size: 1.15rem;
    color: var(--ink);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.bf-cmd-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    margin-bottom: 0.25rem;
}

.bf-cmd {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    color: var(--ink);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
}

.bf-cmd i { font-size: 1.35rem; }

.bf-cmd:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
}

.bf-cmd:active { transform: translateY(0) scale(0.97); }

.bf-cmd.ccb-water i    { color: #4F7CAB; }
.bf-cmd.ccb-foam i     { color: #9B8AB5; }
.bf-cmd.ccb-handwash i { color: #6A9CAB; }
.bf-cmd.ccb-air i      { color: #8A8A8A; }
.bf-cmd.ccb-air-fill i { color: #A79E94; }
.bf-cmd.ccb-vacuum i   { color: #A66B87; }
.bf-cmd.ccb-wax i      { color: #B89B3E; }
.bf-cmd.ccb-tyre i     { color: #5E8A6B; }

.bf-cmd.sending {
    opacity: 0.6;
    pointer-events: none;
    animation: cmd-pulse 0.6s ease-in-out;
}

@keyframes cmd-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.94); }
    100% { transform: scale(1); }
}

.bf-stop {
    margin-top: 0.75rem;
    width: 100%;
    padding: 0.95rem;
    border-radius: 12px;
    border: none;
    background: var(--maroon-500);
    color: #fff;
    cursor: pointer;
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.98rem;
    transition: all 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-accent);
}

.bf-stop i { font-size: 1rem; }

.bf-stop:hover { background: var(--maroon-600); }

.bf-stop.sending { opacity: 0.6; pointer-events: none; }

/* ═══════ Wash304 Command Grid (OPEN/CLOSE/+5฿/-5฿) ═══════ */
.wash304-cmd-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
}

.w304-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1.4rem 0.75rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    color: var(--ink);
    font-family: var(--font);
    font-weight: 600;
    box-shadow: var(--shadow);
}

.w304-btn i { font-size: 1.85rem; margin-bottom: 0.2rem; }
.w304-btn-label { font-size: 1rem; font-weight: 700; }
.w304-btn-sub   { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }

.w304-btn:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: 0 8px 22px rgba(31,26,23,0.12);
}

.w304-btn:active { transform: translateY(0) scale(0.97); }

.w304-btn.sending {
    opacity: 0.55;
    pointer-events: none;
    animation: cmd-pulse 0.6s ease-in-out;
}

.w304-open  { border-color: rgba(16,185,129,0.45); }
.w304-open  i { color: #10b981; }
.w304-open:hover { background: rgba(16,185,129,0.08); }

.w304-close { border-color: rgba(239,68,68,0.45); }
.w304-close i { color: #ef4444; }
.w304-close:hover { background: rgba(239,68,68,0.08); }

.w304-add  { border-color: rgba(59,130,246,0.45); }
.w304-add  i { color: #3b82f6; }
.w304-add:hover { background: rgba(59,130,246,0.08); }

.w304-sub  { border-color: rgba(234,179,8,0.45); }
.w304-sub  i { color: #d97706; }
.w304-sub:hover { background: rgba(234,179,8,0.08); }

@media (max-width: 480px) {
    .wash304-cmd-grid { grid-template-columns: 1fr; }
    .w304-btn { padding: 1.05rem 0.6rem; }
    .w304-btn i { font-size: 1.5rem; }
}

/* ═══════ Money Control Panel ═══════ */
.money-panel {
    margin-top: 1.25rem;
    padding: 1.35rem;
    background: linear-gradient(180deg, var(--bg-1), #fff);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.money-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

.mp-eyebrow {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.mp-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
}

.mp-pin-info {
    display: flex;
    gap: 0.4rem;
}

.pin-chip {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    background: var(--maroon-500);
    color: #fff;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.pin-chip.pin-chip-read {
    background: #fff;
    color: var(--maroon-500);
    border: 1px solid var(--maroon-200);
}

.money-quick {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.money-quick-btn {
    padding: 0.85rem 0.6rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-variant-numeric: tabular-nums;
}

.money-quick-btn:hover {
    background: var(--maroon-50);
    border-color: var(--maroon-300);
    color: var(--maroon-600);
    transform: translateY(-1px);
}

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

/* ═══════════════════════════════════════════════════════════
   NEW Bay Focus / Control GUI
   ═══════════════════════════════════════════════════════════ */

.bf-online-pill { font-size: 0.85rem; }

/* Hero balance card — โดดเด่น ดูชัดทันที */
.hero-balance-card {
    background: linear-gradient(135deg, #FBF6EC 0%, #F9EEDF 100%);
    border: 1px solid var(--maroon-200);
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    text-align: center;
    margin-bottom: 1.25rem;
}
.hero-label {
    font-size: 0.72rem;
    color: var(--ink-3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.hero-value {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--maroon-600);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}
.hero-pin {
    font-size: 0.75rem;
    color: var(--ink-3);
}
.hero-pin code {
    background: var(--maroon-500);
    color: #fff;
    padding: 0.08rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    margin: 0 0.15rem;
}

/* Action card */
.action-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.25rem;
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.action-card.mode-deduct {
    border-color: #FFD8BF;
    background: linear-gradient(180deg, #fff 0%, #FFFAF5 100%);
}

/* Mode toggle (เพิ่ม / ลด) */
.mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    background: #F1ECE5;
    padding: 0.3rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.mode-btn {
    background: transparent;
    border: none;
    padding: 0.7rem;
    border-radius: 9px;
    color: var(--ink-3);
    font-family: var(--font);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}
.mode-btn:hover:not(.active) { color: var(--ink-2); }
.mode-btn.active {
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    color: var(--maroon-600);
}
.mode-btn[data-mode="deduct"].active { color: #C2410C; }
.mode-btn i { margin-right: 0.4rem; }

/* Big amount input — ใหญ่ ตา ๆ */
.big-amount {
    background: #fff;
    border: 2px solid var(--line);
    border-radius: 14px;
    display: flex;
    align-items: center;
    padding: 0.85rem 1.25rem;
    margin-bottom: 0.85rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.big-amount:focus-within {
    border-color: var(--maroon-500);
    box-shadow: 0 0 0 3px rgba(139,46,46,0.12);
}
.action-card.mode-deduct .big-amount:focus-within {
    border-color: #C2410C;
    box-shadow: 0 0 0 3px rgba(194,65,12,0.12);
}
.big-prefix {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink-3);
    margin-right: 0.5rem;
}
.big-amount input {
    flex: 1;
    border: none;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ink);
    font-family: var(--font);
    outline: none;
    font-variant-numeric: tabular-nums;
    background: transparent;
    width: 100%;
    letter-spacing: -0.01em;
}
.big-amount input::placeholder { color: #C8BDB1; font-weight: 400; }

/* Quick chips (10/20/50/100/200) */
.quick-chips {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.chip {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.65rem 0.4rem;
    font-family: var(--font);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.15s var(--ease);
    font-variant-numeric: tabular-nums;
}
.chip:hover {
    background: var(--maroon-50);
    border-color: var(--maroon-300);
    color: var(--maroon-600);
    transform: translateY(-1px);
}
.action-card.mode-deduct .chip:hover {
    background: #FFF4ED;
    border-color: #FFD8BF;
    color: #C2410C;
}

/* Preview = ฿40 + ฿100 = ฿140 */
.preview {
    text-align: center;
    padding: 0.85rem;
    background: #F8F4EC;
    border-radius: 10px;
    color: var(--ink-3);
    font-size: 0.92rem;
    margin-bottom: 1rem;
    font-variant-numeric: tabular-nums;
    transition: background 0.2s;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.preview-active {
    background: #FFFBEB;
    color: var(--ink-2);
}
.preview .pv-now { color: var(--ink-3); }
.preview .pv-op { color: var(--maroon-500); margin: 0 0.25rem; font-weight: 700; }
.action-card.mode-deduct .preview .pv-op { color: #C2410C; }
.preview .pv-eq { color: var(--ink-3); margin: 0 0.25rem; }
.preview .pv-result {
    color: var(--maroon-600);
    font-size: 1.05rem;
    font-weight: 800;
}
.action-card.mode-deduct .preview .pv-result { color: #C2410C; }

/* Submit button — ใหญ่ ๆ */
.submit-btn {
    width: 100%;
    background: var(--maroon-500);
    color: #fff;
    border: none;
    padding: 1rem 1rem;
    border-radius: 12px;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    box-shadow: 0 6px 18px rgba(139,46,46,0.18);
    margin-bottom: 0.65rem;
    font-variant-numeric: tabular-nums;
}
.submit-btn i { margin-right: 0.45rem; }
.submit-btn:hover:not(:disabled) {
    background: var(--maroon-600);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(139,46,46,0.25);
}
.submit-btn:disabled {
    background: #D4CCC2;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    color: #fff;
}
.action-card.mode-deduct .submit-btn:not(:disabled) {
    background: #C2410C;
    box-shadow: 0 6px 18px rgba(194,65,12,0.18);
}
.action-card.mode-deduct .submit-btn:not(:disabled):hover {
    background: #9A3412;
    box-shadow: 0 8px 22px rgba(194,65,12,0.25);
}

/* Reset button — secondary, subtle */
.reset-btn {
    width: 100%;
    background: transparent;
    color: var(--ink-3);
    border: 1px dashed #D9CEC2;
    padding: 0.65rem;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.reset-btn i { margin-right: 0.3rem; }
.reset-btn:hover {
    background: #FBEFEF;
    border-color: #F6DDDD;
    border-style: solid;
    color: #B12626;
}

/* Offline warning — outside action card */
.offline-warning {
    margin-top: 0.85rem;
    padding: 0.75rem 1rem;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 10px;
    color: #B91C1C;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
}
.offline-warning i { margin-right: 0.4rem; }

/* Mobile */
@media (max-width: 768px) {
    .quick-chips { grid-template-columns: repeat(3, 1fr); }
    .hero-value { font-size: 2.2rem; }
    .big-amount input { font-size: 1.4rem; }
    .big-prefix { font-size: 1.3rem; }
}

.money-custom {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.money-custom input {
    flex: 1;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-family: var(--font);
    font-size: 0.95rem;
    outline: none;
    font-variant-numeric: tabular-nums;
}

.money-custom input:focus {
    border-color: var(--maroon-500);
    box-shadow: 0 0 0 3px rgba(139, 46, 46, 0.1);
}

.money-send-btn {
    padding: 0.85rem 1.4rem;
    border-radius: 12px;
    border: none;
    background: var(--maroon-500);
    color: #fff;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s var(--ease);
    box-shadow: 0 6px 18px rgba(139, 46, 46, 0.18);
    white-space: nowrap;
}

.money-send-btn:hover { background: var(--maroon-600); }

.money-hint {
    font-size: 0.78rem;
    color: var(--ink-3);
    line-height: 1.55;
    padding: 0.7rem 0.85rem;
    background: rgba(139, 46, 46, 0.04);
    border: 1px dashed var(--maroon-200);
    border-radius: 10px;
}

.money-hint i { color: var(--maroon-500); margin-right: 0.3rem; }

.money-hint code {
    background: var(--maroon-500);
    color: #fff;
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
}

@media (max-width: 900px) {
    .money-quick { grid-template-columns: repeat(3, 1fr); }
    .money-quick-deduct-row { grid-template-columns: repeat(3, 1fr); }
    .money-custom { flex-direction: column; }
    .money-send-btn { width: 100%; }
}

@media (max-width: 900px) {
    .bay-strip { grid-template-columns: repeat(2, 1fr); }
    .bf-stats, .bf-cmd-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .bay-strip { grid-template-columns: 1fr; }
    .bay-focus-card { padding: 1.2rem; }
    .bf-cmd-grid { grid-template-columns: 1fr; }
}

/* ═══════ USER TABLE ═══════ */
.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.user-table th {
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    padding: 0.75rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--bg-1);
}

.user-table td {
    padding: 0.8rem 0.75rem;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
    color: var(--ink);
}

.user-table tbody tr:last-child td { border-bottom: none; }

.user-table tbody tr:hover td {
    background: var(--maroon-50);
}

.table-empty {
    text-align: center;
    color: var(--muted);
    padding: 2rem !important;
}

.badge {
    display: inline-block;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-active {
    background: var(--ok-soft);
    color: var(--ok-ink);
}

.badge-pending {
    background: var(--bg-1);
    color: var(--muted);
}

.topup-inline {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.topup-inline input {
    width: 70px;
    padding: 0.35rem 0.55rem;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    color: var(--ink);
    font-family: var(--font);
    font-size: 0.82rem;
}

.topup-inline input:focus {
    outline: none;
    border-color: var(--maroon-400);
    box-shadow: 0 0 0 3px rgba(139, 46, 46, 0.1);
}

.topup-inline button {
    padding: 0.35rem 0.7rem;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s var(--ease);
}

.topup-inline button.add {
    background: var(--ok-soft);
    color: var(--ok-ink);
}

.topup-inline button.sub {
    background: var(--bg-1);
    color: var(--ink-3);
}

.topup-inline button:hover { filter: brightness(0.97); }

/* ═══════ FINANCE ═══════ */
.finance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 1.25rem;
}

/* ═══════ LOADING ═══════ */
.loading-state {
    grid-column: 1/-1;
    text-align: center;
    color: var(--muted);
    padding: 2.5rem;
    font-size: 0.88rem;
}

/* ═══════ TOAST ═══════ */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    padding: 0.8rem 1.35rem;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s, transform 0.3s;
    background: var(--ink);
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.toast.success {
    background: var(--ok);
    color: #fff;
}

.toast.error {
    background: var(--maroon-500);
    color: #fff;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
    pointer-events: none;
}

/* ═══════ HAMBURGER / OVERLAY ═══════ */
.hamburger {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    background: var(--maroon-500);
    border: none;
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.2s;
    box-shadow: var(--shadow-accent);
}

.hamburger:hover { background: var(--maroon-600); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(31, 26, 23, 0.42);
    z-index: 99;
}

.sidebar-overlay.show { display: block; }

/* ══════════ RESPONSIVE ══════════ */
@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .bay-grid { grid-template-columns: repeat(2, 1fr); }
    .finance-grid { grid-template-columns: repeat(2, 1fr); }
    .insights-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    :root { --sidebar-w: 64px; }

    .sidebar {
        padding: 1rem 0.5rem;
        align-items: center;
        overflow: hidden;
    }

    .sidebar-logo .logo-text,
    .nav-item span,
    .sidebar-footer .clock-date {
        display: none;
    }

    .sidebar-logo {
        justify-content: center;
        padding-bottom: 1rem;
    }

    .logo-icon { margin: 0; }

    .nav-item {
        justify-content: center;
        padding: 0.7rem;
        border-radius: 10px;
    }

    .nav-item i {
        width: auto;
        font-size: 1.2rem;
    }

    .sidebar-footer { text-align: center; }

    .clock {
        font-size: 0.72rem;
        letter-spacing: 1px;
    }

    .main-content { padding: 1.5rem 1.25rem; }

    .bay-grid { grid-template-columns: repeat(3, 1fr); }
    .finance-grid { grid-template-columns: 1fr; }

    .page-header {
        padding: 1rem 1.25rem;
    }
    .page-title { font-size: 1.25rem; }
}

@media (max-width: 600px) {
    :root { --sidebar-w: 0px; }

    .hamburger { display: inline-flex; align-items: center; gap: 0.4rem; }

    .sidebar {
        width: 240px;
        transform: translateX(-100%);
        transition: transform 0.28s var(--ease);
        z-index: 100;
        padding: 1.4rem 0.9rem;
    }

    .sidebar.open { transform: translateX(0); }

    .sidebar.open .logo-text,
    .sidebar.open .nav-item span,
    .sidebar.open .clock-date {
        display: block;
    }

    .sidebar.open .sidebar-logo { justify-content: flex-start; }

    .sidebar.open .nav-item {
        justify-content: flex-start;
        padding: 0.65rem 0.8rem;
    }

    .sidebar.open .nav-item i { width: 24px; font-size: 1.15rem; }

    .sidebar.open .clock {
        font-size: 1.25rem;
        letter-spacing: 2px;
    }

    .main-content {
        margin-left: 0;
        padding: 4.5rem 1rem 1.5rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem;
    }

    .page-subtitle { display: none; } /* Lean mobile view */

    .stat-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .stat-value { font-size: 1.4rem; }

    .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .bay-grid { grid-template-columns: 1fr; }
    .finance-grid { grid-template-columns: 1fr; }
    .cmd-grid { grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
    
    .bay-card { min-height: auto; padding: 1rem; }
    .bay-hero { padding: 0.8rem; margin: 0.2rem 0 0.6rem; }
    .bay-hero-value { font-size: 1.6rem; }

    .user-table { font-size: 0.78rem; }
    .user-table th,
    .user-table td { padding: 0.55rem; }

    .topup-inline { flex-wrap: wrap; }
    .topup-inline input { width: 60px; }

    .toast {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        transform: none;
        justify-content: center;
    }
    .toast.show { transform: none; }
    .toast.hidden { transform: translateY(10px); }
}

/* ═══════ BLYNK CLOUD DISPLAY ═══════ */
.bay-blynk-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    margin: 0.6rem 0;
    padding: 0.6rem;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.bbg-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0.2rem 0.1rem;
    border-radius: 6px;
}

.bbg-label {
    font-size: 0.62rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.bbg-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.blynk-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font);
}

.blynk-badge.blynk-on {
    background: var(--ok-soft);
    color: var(--ok-ink);
    border: 1px solid rgba(47, 125, 90, 0.25);
}

.blynk-badge.blynk-off {
    background: var(--maroon-50);
    color: var(--maroon-600);
    border: 1px solid var(--maroon-200);
}

@media (max-width: 640px) {
    .bay-blynk-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════ FORM ELEMENTS (generic) ═══════ */
input, textarea, select {
    font-family: var(--font);
}

/* Utility classes — for convenience on inline styles */
.t-eyebrow {
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
