/* ==========================================================================
   1. GLOBAL VARIABLES & BASE STYLES
   ========================================================================== */
:root {
    --bg: #111827;
    --card: #1f2937;
    --card2: #374151;
    --text: #f9fafb;
    --muted: #9ca3af;
    --accent: #3b82f6;
    --active: #16a34a;
    --border: #4b5563;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 24px;
}

.container {
    max-width: 1000px;
    margin: auto;
}

h1 {
    margin: 0 0 16px;
}

.small {
    color: var(--muted);
    font-size: 0.9rem;
}

/* MONOSPACE TIMING ALIGNMENTS */
.time,
.clock {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ==========================================================================
   2. DASHBOARD FLEXBOX HEADER CONTAINER
   ========================================================================== */
.dashboard-header {
    display: flex;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 24px;
    width: 100%;
}

/* LEFT ELEMENT: STATUS BAR EXPANDS TO TAKE MAX SPACE */
.dashboard-status-panel {
    background: var(--card);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    flex: 1;
}

/* RIGHT ELEMENT: COMPACT FIXED CONTROLS COLUMN */
.controls-panel {
    background: var(--card);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    min-width: 200px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    box-sizing: border-box;
}

select {
    background: var(--card2);
    color: white;
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
}

/* Responsive collapse on mobile view screens */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
    }
    .status-divider {
        margin: 0 12px !important;
    }
}

/* ==========================================================================
   3. INLINE STATUS DATA CORES
   ========================================================================== */
.status-row {
    display: flex;
    align-items: center;
    width: 100%;
}

.status-section {
    flex: 1;
}

.status-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
    margin: 0 24px;
}

.small-label {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-text {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 4px;
}

#clock {
    font-size: 1.75rem;
    color: var(--text);
    margin-top: 2px;
    line-height: 1.1;
}

#nextBellCountdown {
    color: var(--accent);
}

/* PROGRESS METRIC TRACKER BAR */
.progress-container {
    width: 100%;
    background: transparent;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    transition: background 0.3s ease;
}

.progress-container.active-period {
    background: var(--card2);
}

.progress-bar {
    height: 100%;
    background: var(--active);
    width: 0%;
    opacity: 0;
    transition: width 0.4s ease, opacity 0.3s ease;
}

.progress-container.active-period .progress-bar {
    opacity: 1;
}

/* ==========================================================================
   4. SCHEDULE DATA DISPLAY TABLE
   ========================================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
}

th {
    background: var(--card2);
    text-align: left;
    padding: 12px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: var(--muted);
}

td {
    padding: 12px;
    border-top: 1px solid var(--border);
    background: var(--card);
}

tr.active td {
    background: rgba(22, 163, 74, 0.25);
}

/* ==========================================================================
   5. TEACHER OVERLAYS & MODAL INTERFACES
   ========================================================================== */
.modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 170px;
    z-index: 1000;
}

.modal-close-btn {
    width: auto;
    color: var(--muted);
    padding: 4px 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close-btn:hover {
    background: var(--muted);
    color: var(--text);
}

.modal {
    background: var(--card);
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    padding: 16px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.modal-body {
    overflow-y: auto;
    flex: 1;
}

.tabs {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.tab {
    padding: 8px 12px;
    background: var(--card2);
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
}

.tab.active {
    background: var(--accent);
}

.search {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 10px 0;
    background: #111;
    color: white;
    box-sizing: border-box;
}

.list {
    max-height: 400px;
    overflow: auto;
}

.row {
    padding: 10px;
    border-bottom: 1px solid var(--border);
}

.badge {
    background: var(--accent);
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: bold;
}

.lunch-indent {
    padding-left: 32px;
    opacity: 0.92;
}