:root {
    --bg: #4e2430;
    --bg-deep: #3d1c26;
    --panel: #1b2430;
    --panel-alt: #151c26;
    --line: rgba(255, 255, 255, 0.06);
    --ticker: #0c6b73;
    --text: #f4f1ee;
    --muted: rgba(255, 255, 255, 0.62);
    --etd: #f0a04b;
    --open: #2f9e44;
    --inclass: #0e8a92;
    --dismissed: #d32f2f;
    --remark: #3d8bfd;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    font-family: Inter, "Segoe UI", sans-serif;
    background: radial-gradient(1200px 600px at 10% -10%, #6a3342, transparent 55%), var(--bg);
    color: var(--text);
    overflow: hidden;
}

.board {
    min-height: 100vh;
    height: 100vh;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    padding: 16px 24px 8px;
}

.board-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 0 4px 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.brand-logo {
    width: clamp(64px, 8vw, 92px);
    height: clamp(64px, 8vw, 92px);
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
}

.eyebrow {
    margin: 0 0 2px;
    font-size: 13px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 700;
}

.school-name {
    margin: 0;
    line-height: 0.92;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.school-main {
    display: block;
    font-size: clamp(34px, 4.4vw, 64px);
}

.school-last {
    display: block;
    font-size: clamp(22px, 2.6vw, 36px);
    font-weight: 800;
    letter-spacing: 0.01em;
}

.clock-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: right;
}

.clock-time {
    font-family: Oswald, Inter, sans-serif;
    font-size: clamp(42px, 7vw, 88px);
    font-weight: 700;
    line-height: 0.8;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.clock-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-top: 6px;
    gap: 2px;
}

.clock-wib {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.clock-date {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    text-transform: capitalize;
}

.clock-weather {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    margin-top: 4px;
}

.weather-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--muted);
    text-transform: uppercase;
}

.weather-now {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 8px;
    color: #fff;
    font-weight: 800;
    line-height: 1.15;
}

.weather-temp {
    font-family: Oswald, Inter, sans-serif;
    font-size: 22px;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.weather-desc {
    font-size: 13px;
    font-weight: 700;
    text-transform: capitalize;
}

.ticker {
    background: var(--ticker);
    color: #fff;
    border-radius: 2px;
    overflow: hidden;
    height: 42px;
    display: flex;
    align-items: center;
    margin: 4px 0 18px;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}

.ticker-track {
    display: flex;
    gap: 80px;
    white-space: nowrap;
    animation: ticker 28s linear infinite;
    min-width: 200%;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0 20px;
}

.ticker-item i {
    width: 8px;
    height: 8px;
    background: #fff;
    display: inline-block;
}

@keyframes ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.status-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.status-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 10px;
}

.status-head h2 {
    margin: 0;
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 800;
}

.slide-label {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: 700;
}

.status-meta {
    text-align: right;
}

.time-range {
    font-size: 18px;
    font-weight: 800;
    color: #d9d3cc;
}

.count-line {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

.slide-dots {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 8px;
}

.slide-dots span {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.28);
    transition: 0.25s ease;
}

.slide-dots span.is-active {
    width: 28px;
    background: #fff;
}

.table-wrap {
    flex: 1;
    min-height: 0;
    background: var(--panel);
    border-radius: 4px;
    overflow: auto;
    position: relative;
}

.status-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.status-table thead th {
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    padding: 12px 22px;
    background: #121820;
    border-bottom: 1px solid var(--line);
}

.status-table tbody tr {
    animation: row-in 0.45s ease both;
}

.status-table tbody tr:nth-child(odd) { background: #1b2430; }
.status-table tbody tr:nth-child(even) { background: #151c26; }

.status-table td {
    padding: 11px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: clamp(15px, 1.45vw, 21px);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-room { width: 12%; }
.col-class { width: 28%; }
.col-etd { width: 12%; }
.col-status { width: 18%; }
.col-remark { width: 30%; }

.etd-cell { color: var(--etd); font-variant-numeric: tabular-nums; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 108px;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 99px;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.badge-dismissed { background: var(--dismissed); }
.badge-in_classroom { background: var(--inclass); }
.badge-open { background: var(--open); }

.remark-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #dce7f5;
    font-weight: 600;
}

.remark-cell i {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: #2ea3c7;
    flex: none;
}

.empty-state {
    position: absolute;
    inset: 48px 0 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 22px;
    text-align: center;
}

.board-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 4px 4px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 22px;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.legend small {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.48);
    margin-left: 4px;
}

.legend .dot {
    width: 9px;
    height: 18px;
    border-radius: 2px;
    display: inline-block;
}

.dot.etd { background: var(--etd); }
.dot.in-class { background: var(--inclass); }
.dot.dismissed { background: var(--dismissed); }
.dot.open { background: var(--open); }
.dot.remark { background: var(--remark); }

.year-line { opacity: 0.55; font-weight: 700; }

@keyframes row-in {
    from { opacity: 0; transform: translateX(18px); }
    to { opacity: 1; transform: none; }
}

.scale-compact td { font-size: 15px; padding-top: 8px; padding-bottom: 8px; }
.scale-large td { font-size: 24px; padding-top: 16px; padding-bottom: 16px; }

body.theme-chalkboard {
    --bg: #2a2a2a;
    --bg-deep: #1a1a1a;
    --panel: #243126;
    --panel-alt: #1d281f;
    --ticker: #355e3b;
    background: #1c1c1c;
    font-family: "Patrick Hand", Inter, cursive;
}

body.theme-modern {
    --bg: #0f172a;
    --panel: rgba(15, 23, 42, 0.72);
    --ticker: #2563eb;
    background: radial-gradient(ellipse at top left, rgba(63, 106, 216, 0.35), transparent 45%),
        linear-gradient(160deg, #0f172a 0%, #1e293b 55%, #0b1220 100%);
}

body.theme-dark {
    --bg: #050505;
    --panel: #0a0a0a;
    --ticker: #111;
    background: #000;
}

[hidden] { display: none !important; }
