:root {
    --ink: #172033;
    --muted: #667085;
    --line: #e5e7eb;
    --surface: #ffffff;
    --canvas: #f6f8fb;
    --navy: #172554;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --teal: #0f766e;
    --sidebar: 248px;
}

* { box-sizing: border-box; }

body { display: flex; flex-direction: column; min-height: 100vh; }

body {
    background: var(--canvas);
    color: var(--ink);
    font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
}

.btn { border-radius: 8px; font-weight: 600; }
.form-control, .form-select { border-color: #d8dee9; border-radius: 8px; min-height: 42px; }
.form-control:focus, .form-select:focus { border-color: #7aa2f7; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .13); }
.card, .surface { border: 1px solid var(--line); border-radius: 12px; }
.table { --bs-table-bg: var(--surface); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .75rem .8rem; border-color: var(--line); }
.table thead th { color: #344054; font-size: .78rem; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }

/* Shared admin shell */
.admin-shell { display: flex; flex: 1; min-height: 100vh; }
.admin-sidebar {
    background: var(--navy);
    min-height: 100vh;
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    z-index: 10;
}
.admin-brand { color: #fff; font-weight: 700; padding: 22px 22px 20px; border-bottom: 1px solid rgba(255,255,255,.12); }
.admin-brand small { color: #b9c4df; font-weight: 500; }
.admin-brand-lockup, .brand-lockup { align-items: center; display: flex; gap: 10px; min-width: 0; }
.brand-lockup { color: inherit; text-decoration: none; }
.app-logo { border-radius: 50%; flex: 0 0 auto; height: 48px; object-fit: contain; width: 48px; }
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { color: #fff; font-size: .95rem; font-weight: 750; }
.brand-copy small { color: #b9c4df; font-size: .72rem; font-weight: 500; }
.admin-brand .current-time { display: block; margin-top: 12px; }
.admin-nav { padding: 14px 10px; }
.admin-nav-group { margin-bottom: 14px; }
.admin-nav-group-title { color: #8fa1cb; display: block; font-size: .68rem; font-weight: 700; padding: 8px 13px 5px; text-transform: uppercase; }
.admin-nav a { color: #c7d2fe; display: block; padding: 11px 13px; border-radius: 8px; text-decoration: none; font-size: .92rem; margin-bottom: 3px; }
.admin-nav a:hover, .admin-nav a.active { background: #27356f; color: #fff; }
.admin-nav a.text-danger { color: #fda4af !important; margin-top: 18px; }
.admin-content { display: flex; flex: 1; flex-direction: column; margin-left: var(--sidebar); min-height: 100vh; padding: 32px; }
.page-heading { align-items: center; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 24px; }
.page-heading h4, .page-heading h5 { font-weight: 700; margin: 0; }
.report-heading { border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.report-form { border: 1px solid var(--line); border-radius: 8px; max-width: 620px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; height: 100%; }
.stat-card h2 { color: var(--navy); font-size: 2rem; margin: 8px 0; }

/* Guest shell */
.guest-nav { align-items: center; background: var(--navy); box-shadow: 0 2px 12px rgba(23, 37, 84, .14); flex-wrap: wrap; gap: 12px; }
.guest-brand-group { align-items: center; display: flex; gap: 14px; margin-right: auto; min-width: 0; }
.guest-brand-group .app-logo { height: 48px; width: 48px; }
.guest-brand-group .brand-copy strong { font-size: .95rem; }
.current-time { color: #bfdbfe; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.guest-nav .nav-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.guest-nav .btn { margin: 0 !important; }
.guest-content { flex: 1; padding: 32px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); flex-shrink: 0; font-size: .8rem; margin-top: auto; padding: 14px 20px; text-align: center; }
.pagination { gap: 8px; margin: 18px 0 0; }
.pagination > li { display: flex; }
.pagination > li > a {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    display: inline-flex;
    font-size: .88rem;
    font-weight: 700;
    justify-content: center;
    min-height: 40px;
    min-width: 40px;
    padding: 0 12px;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.pagination > li > a:hover, .pagination > li > a:focus-visible {
    background: #e8f1ff;
    border-color: #93c5fd;
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .13);
    color: var(--navy);
}
.pagination > li.active > a { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination > li.disabled > a { background: #f2f4f7; color: #98a2b3; pointer-events: none; }
.public-intro { background: linear-gradient(120deg, #172554, #1e3a8a); border-radius: 14px; color: #fff; padding: 28px 32px; }
.public-intro h1 { font-size: clamp(1.65rem, 3vw, 2.35rem); font-weight: 750; margin-bottom: 10px; }
.public-intro p:last-child { color: #dbeafe; max-width: 720px; }
.eyebrow { color: #93c5fd; font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.schedule-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(16, 24, 40, .05); padding: 16px; }
.schedule-table { min-width: 840px; }
.cell-box { font-size: .75rem; min-height: 52px; min-width: 74px; text-align: center; vertical-align: middle; }
.schedule-instructor-name { font-size: .62rem; font-weight: 500; line-height: 1.2; overflow-wrap: anywhere; }
.cell-outside { box-shadow: inset 0 0 0 2px rgba(15, 118, 110, .45); }
.outside-label { color: #344054; font-size: .62rem; font-weight: 700; letter-spacing: .02em; margin-top: 3px; text-transform: uppercase; }
.online-label { color: #fff; background: #198754; border-radius: 4px; display: inline-block; font-size: .58rem; font-weight: 700; line-height: 1.4; margin-top: 3px; padding: 1px 4px; }
.cell-empty { background: #fbfcfe !important; cursor: pointer; }
.cell-empty:hover { background: #e8f1ff !important; }
.cell-empty::after { color: #98a2b3; content: "+"; font-size: 1.1rem; }
.monitoring-heading { align-items: center; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; margin-bottom: 22px; }
.monitoring-heading h1 { font-size: 1.65rem; font-weight: 750; margin: 0 0 4px; }
.monitoring-heading .eyebrow { color: var(--blue); font-size: .7rem; letter-spacing: .1em; }
.monitoring-room-switch { display: inline-flex; gap: 8px; }
.monitoring-controls { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 14px; padding: 14px; }
.monitoring-controls .form-label { font-size: .82rem; font-weight: 650; margin-bottom: 5px; }
.monitoring-summary { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 14px; padding: 10px 14px; }
.monitoring-summary > span { align-items: center; display: inline-flex; font-size: .86rem; font-weight: 650; gap: 7px; }
.monitoring-summary .monitoring-period { color: var(--muted); font-weight: 500; margin-left: auto; }
.monitoring-dot { border: 1px solid rgba(0,0,0,.12); border-radius: 50%; display: inline-block; height: 12px; width: 12px; }
.monitoring-dot.is-online { background: #00b45a; }
.monitoring-dot.is-offline { background: #f20d18; }
.monitoring-floor-scroll { overflow-x: auto; padding-bottom: 4px; }
.computer-floor { display: grid; gap: 7px; margin: 0 auto; min-width: 640px; }
.computer-floor.lab-one { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(20px, .35fr) repeat(5, minmax(0, 1fr)); max-width: 1180px; min-width: 780px; }
.computer-floor.lab-two { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(20px, .35fr) repeat(3, minmax(0, 1fr)); max-width: 980px; }
.computer-tile { align-items: center; aspect-ratio: 1.35; border: 1px solid rgba(0,0,0,.65); color: #07140c; display: flex; flex-direction: column; justify-content: center; min-width: 0; overflow: hidden; padding: 5px 3px; text-align: center; }
.computer-tile.is-online { background: #00b45a; }
.computer-tile.is-offline { background: #f20d18; }
.computer-number { font-size: clamp(1rem, 2vw, 1.45rem); line-height: 1.1; }
.computer-hostname { font-size: .62rem; font-weight: 700; overflow-wrap: anywhere; }
.computer-detail { font-size: .68rem; line-height: 1.25; overflow-wrap: anywhere; }
.computer-ip-address { font-size: .56rem; line-height: 1.15; }
.computer-aisle { border-left: 2px dashed #cbd5e1; grid-row: auto; }
.monitoring-note { color: var(--muted); font-size: .8rem; margin-top: 12px; }

/* Login */
.login-page { align-items: center; background: #eef3ff; display: flex; min-height: 100vh; padding: 24px; position: relative; }
.login-page::before { background: var(--navy); content: ""; height: 100%; left: 0; position: absolute; top: 0; width: 42%; }
.login-shell { margin: 0 auto; max-width: 980px; position: relative; width: 100%; }
.login-intro { color: #fff; padding: 40px 48px 40px 0; }
.login-logo { background: #fff; border: 4px solid rgba(255,255,255,.5); border-radius: 50%; display: block; height: 88px; margin-bottom: 26px; object-fit: contain; padding: 4px; width: 88px; }
.login-intro h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 750; line-height: 1.08; }
.login-intro p { color: #c7d2fe; max-width: 330px; }
.login-card { background: var(--surface); border: 1px solid rgba(23, 37, 84, .08); border-radius: 16px; box-shadow: 0 18px 50px rgba(23, 37, 84, .16); padding: 34px; }
.login-card h2 { font-size: 1.45rem; font-weight: 700; }
.btn-google { align-items: center; background: #fff; border: 1px solid #d0d5dd; color: #344054; display: inline-flex; font-weight: 650; gap: 10px; justify-content: center; min-height: 44px; }
.btn-google:hover { background: #f8fafc; border-color: #98a2b3; color: #172033; }
.google-mark { color: #4285f4; font-size: 1.2rem; font-weight: 800; }

@media (max-width: 767.98px) {
    :root { --sidebar: 0px; }
    .admin-sidebar { min-height: auto; position: static; width: 100%; }
    .admin-brand { padding: 16px 18px; }
    .admin-nav { display: block; padding: 10px; }
    .admin-nav-group { display: grid; gap: 0 4px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 3px; }
    .admin-nav-group-title { grid-column: 1 / -1; padding: 5px 10px 2px; }
    .admin-nav a { margin-bottom: 0; padding: 8px 10px; font-size: .86rem; }
    .admin-nav a.text-danger { margin-top: 0; }
    .admin-content, .guest-content { padding: 20px 14px; }
    .admin-content > .d-flex.justify-content-between.align-items-center.mb-3 { align-items: flex-start !important; flex-direction: column; gap: 12px; }
    .admin-content form.d-flex, .guest-content form.d-flex { flex-wrap: wrap; max-width: 100%; }
    .public-intro { padding: 24px 20px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .guest-brand-group { gap: 10px; margin-bottom: 2px; width: 100%; }
    .guest-brand-group .app-logo { height: 40px; width: 40px; }
    .guest-brand-group .brand-copy strong { font-size: .88rem; }
    .guest-nav .current-time { margin: 0 0 2px; width: 100%; }
    .guest-nav .nav-actions { width: 100%; }
    .guest-nav .nav-actions .btn { flex: 1 1 auto; font-size: .78rem; }
    .monitoring-heading { align-items: flex-start; flex-direction: column; }
    .monitoring-room-switch { width: 100%; }
    .monitoring-room-switch .btn { flex: 1; }
    .monitoring-summary .monitoring-period { margin-left: 0; }
    .computer-floor { margin-left: 0; }
    .login-page { padding: 16px; }
    .login-page::before { height: 37%; width: 100%; }
    .login-intro { padding: 22px 12px 68px; }
    .login-logo { height: 72px; margin-bottom: 18px; width: 72px; }
    .login-intro h1 { font-size: 2rem; }
    .login-card { padding: 24px 20px; }
}
