@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #003178;
    --primary-container: #0d47a1;
    --on-primary: #ffffff;
    --secondary: #785900;
    --secondary-container: #fdc003;
    --on-secondary: #ffffff;

    --surface: #f8f9fa;
    --surface-low: #f3f4f5;
    --surface-container: #edeeef;
    --surface-high: #e7e8e9;
    --surface-highest: #e1e3e4;
    --surface-card: #ffffff;

    --on-surface: #191c1d;
    --on-surface-variant: #434652;
    --outline-soft: rgba(115, 119, 131, 0.18);
    --outline-ghost: rgba(195, 198, 212, 0.2);

    --error: #ba1a1a;
    --ok: #166534;
    --warn: #6c5000;
    --shadow-soft: 0 8px 24px -6px rgba(25, 28, 29, 0.08);
    --shadow-float: 0 12px 28px -10px rgba(0, 49, 120, 0.35);
}

* {
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: var(--on-surface);
    background:
        radial-gradient(circle at 0% 0%, rgba(13, 71, 161, 0.06), transparent 30%),
        radial-gradient(circle at 100% 0%, rgba(253, 192, 3, 0.1), transparent 28%),
        var(--surface);
}

body.auth-locked .layout {
    grid-template-columns: minmax(0, 1fr);
}

body.auth-locked .sidebar,
body.auth-locked .topbar,
body.auth-locked .workspace,
body.auth-locked #statusBanner,
body.auth-locked #latestAlertBanner,
body.auth-locked #toastStack,
body.auth-locked #notificationCenter,
body.auth-locked #output {
    display: none !important;
}

body.auth-locked .main {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

body.auth-locked #appRoot {
    width: 100%;
    max-width: 540px;
}

body.auth-locked #authPanel {
    display: block !important;
    margin: 0 !important;
    border-radius: 16px;
    box-shadow: var(--shadow-float);
}

body.auth-locked #authPanel h3 {
    margin-bottom: 14px;
}

body.auth-locked .auth-grid {
    grid-template-columns: 1fr;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-family: 'Work Sans', 'Segoe UI', sans-serif;
    letter-spacing: -0.015em;
}

.layout {
    display: grid;
    grid-template-columns: 256px minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    padding: 12px 12px 18px;
    background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-low) 100%);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 49, 120, 0.2);
}

.brand h1 {
    font-size: 28px;
    line-height: 1;
    color: var(--primary);
    font-weight: 800;
}

.brand p {
    margin: 2px 0 0;
    color: var(--on-surface-variant);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}

.side-hall {
    padding: 0 12px;
    margin-bottom: 14px;
}

.side-hall label {
    display: block;
    margin: 0 0 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--on-surface-variant);
    font-weight: 600;
}

.side-hall input {
    width: 100%;
    background: var(--surface-container);
    border: 0;
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--on-surface);
    font-family: inherit;
}

.side-hall select {
    width: 100%;
    background: var(--surface-container);
    border: 0;
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--on-surface);
    font-family: inherit;
    margin-bottom: 8px;
}

.side-hall input[type="date"] {
    margin-bottom: 2px;
}

.menu-title {
    margin: 2px 12px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--on-surface-variant);
    font-weight: 700;
}

.menu {
    display: grid;
    gap: 4px;
    padding: 0 6px;
    flex: none;
    min-height: auto;
    overflow: visible;
    align-content: start;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--on-surface-variant);
    padding: 11px 12px;
    border-radius: 10px;
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.menu .menu-icon {
    font-size: 18px;
    width: 20px;
    min-width: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    overflow: hidden;
    white-space: nowrap;
}

.menu a:hover {
    background: var(--surface-high);
    color: var(--primary);
}

.menu a.active {
    color: var(--primary);
    background: var(--surface-card);
}

.menu a.active::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    border-radius: 999px;
    background: var(--secondary);
}

.sidebar-footer {
    margin-top: auto;
    padding: 10px 6px 4px;
    display: grid;
    gap: 6px;
}

.sidebar-create-btn {
    margin-top: 0;
    width: 100%;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-container));
    color: var(--on-primary);
    box-shadow: var(--shadow-float);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    text-decoration: none;
    background: transparent;
    color: var(--on-surface-variant);
    border-radius: 10px;
    padding: 10px 12px;
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.sidebar-link:hover {
    background: var(--surface-high);
    color: var(--primary);
}

.sidebar-link-btn {
    margin-top: 0;
    justify-content: flex-start;
}

.main {
    padding: 14px 18px;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 64px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    border-radius: 12px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-soft);
}

.topbar h2 {
    color: var(--primary);
    font-size: 26px;
    font-weight: 800;
}

.top-title-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.top-title-stack h2 {
    margin: 0;
}

.top-title-stack p {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-low);
    border-radius: 999px;
    padding: 0 10px;
    min-width: 320px;
}

.top-search-wrap .material-symbols-outlined {
    color: var(--on-surface-variant);
    font-size: 18px;
}

#globalSearch {
    border: 0;
    background: transparent;
    min-height: 36px;
    width: 100%;
    outline: none;
}

.global-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 60;
    background: var(--surface-card);
    border: 1px solid var(--outline-soft);
    border-radius: 12px;
    box-shadow: var(--shadow-float);
    overflow: hidden;
    max-height: 320px;
    overflow-y: auto;
}

.global-search-item {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--outline-soft);
    background: transparent;
    text-align: left;
    padding: 10px 12px;
    display: grid;
    gap: 4px;
    cursor: pointer;
}

.global-search-item:last-child {
    border-bottom: 0;
}

.global-search-item strong {
    font-size: 13px;
    color: var(--on-surface);
}

.global-search-item span {
    font-size: 11px;
    color: var(--on-surface-variant);
}

.global-search-item:hover,
.global-search-item.is-active {
    background: var(--surface-low);
}

.icon-btn {
    margin-top: 0;
    border: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-low);
    color: var(--on-surface-variant);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.icon-btn:hover {
    background: var(--surface-high);
    color: var(--primary);
}

.has-badge {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-center {
    position: fixed;
    top: 84px;
    right: 24px;
    width: min(420px, 92vw);
    max-height: min(68vh, 560px);
    overflow: hidden;
    background: var(--surface-card);
    border-radius: 14px;
    box-shadow: var(--shadow-float);
    padding: 12px;
    z-index: 70;
    display: flex;
    flex-direction: column;
}

.notification-center-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.notification-center-head h3 {
    margin: 0;
    font-size: 16px;
    color: var(--primary);
}

.notification-center-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.notification-center-actions .slim {
    padding: 6px 10px;
    font-size: 12px;
}

.notification-list {
    display: grid;
    gap: 8px;
    overflow: auto;
    max-height: min(52vh, 430px);
    padding-right: 2px;
}

.notification-item {
    background: var(--surface-low);
    border-radius: 10px;
    padding: 10px;
}

.notification-item.unread {
    box-shadow: inset 0 0 0 1px rgba(0, 49, 120, 0.18);
}

.notification-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.notification-type {
    font-size: 10px;
    font-weight: 800;
    border-radius: 999px;
    padding: 2px 8px;
}

.notification-type.success { background: #dcfce7; color: #166534; }
.notification-type.error { background: #fee2e2; color: #991b1b; }
.notification-type.warning { background: #fef3c7; color: #92400e; }
.notification-type.info { background: #dbeafe; color: #1e40af; }

.notification-time {
    font-size: 11px;
    color: var(--on-surface-variant);
}

.notification-item p {
    margin: 0;
    font-size: 13px;
}

.workspace {
    display: grid;
    gap: 14px;
}

.panel {
    background: var(--surface-card);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow-soft);
    animation: riseIn 0.32s ease;
}

.panel h3 {
    margin: 0 0 12px;
    color: var(--primary);
    font-weight: 800;
    font-size: 22px;
}

.panel-grid-3 {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-grid-2 {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.banner {
    border-radius: 10px;
    padding: 10px 12px;
    margin: 0 0 12px;
    font-size: 14px;
    background: var(--surface-card);
    box-shadow: var(--shadow-soft);
    position: relative;
}

.banner.hidden {
    display: none;
}

.status-dock {
    position: fixed;
    right: 18px;
    top: 86px;
    width: min(360px, 34vw);
    z-index: 20;
    display: flex;
    gap: 8px;
    pointer-events: none;
    flex-direction: column;
}

.status-dock .banner {
    margin: 0;
    width: 100%;
    pointer-events: auto;
}

.toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, 92vw);
    pointer-events: none;
}

.notification-toast {
    pointer-events: auto;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
    border: 1px solid var(--outline-soft);
    background: var(--surface-card);
    color: var(--on-surface);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    animation: toastSlideIn 0.24s ease-out;
}

.notification-toast.success {
    border-color: #86efac;
    background: #ecfdf3;
    color: #166534;
}

.notification-toast.error {
    border-color: #fecaca;
    background: #fff2f2;
    color: #991b1b;
}

.notification-toast.warning {
    border-color: #fde68a;
    background: #fff8dc;
    color: #92400e;
}

.notification-toast.info {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
}

.notification-toast.closing {
    animation: toastSlideOut 0.2s ease-in forwards;
}

.toast-message {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.toast-close {
    margin-top: 0;
    width: auto;
    min-width: 26px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

.banner-close {
    position: absolute;
    top: 8px;
    right: 8px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
    cursor: pointer;
}

.latest-alert {
    color: var(--warn);
    background: #fff7dd;
}

.latest-alert.critical { color: #8b1f1f; background: #fff1f1; }
.latest-alert.warning { color: var(--warn); background: #fff7dd; }
.latest-alert.info { color: #0f3d75; background: #eef5ff; }

.countdown-badge {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    background: var(--surface-low);
    color: var(--on-surface-variant);
}

.ok {
    color: var(--ok);
    background: #ecfdf3;
}

.err {
    color: #9f1d1d;
    background: #fff2f2;
}

label {
    display: block;
    margin: 8px 0 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--on-surface-variant);
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 10px 11px;
    background: var(--surface-low);
    color: var(--on-surface);
    font-family: inherit;
}

button {
    margin-top: 10px;
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    color: var(--on-primary);
    background: linear-gradient(135deg, var(--primary), var(--primary-container));
    cursor: pointer;
    width: 100%;
    font-weight: 700;
    font-size: 13px;
    font-family: 'Work Sans', sans-serif;
}

button.secondary {
    background: var(--surface-high);
    color: var(--on-surface);
}

button.slim {
    width: auto;
    margin-top: 0;
    padding: 9px 13px;
}

button.action-loading {
    opacity: 0.9;
    cursor: wait;
}

button.action-success {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #f0fdf4;
}

.btn-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    animation: btnSpin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: -1px;
}

@keyframes btnSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-mini {
    width: auto;
    margin-top: 0;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 12px;
    background: var(--surface-high);
    color: var(--on-surface);
    font-weight: 600;
}

.btn-danger {
    background: var(--error);
    color: #fff;
}

.row-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    font-size: 13px;
}

th,
td {
    text-align: left;
    padding: 8px 8px;
    vertical-align: top;
}

th {
    background: transparent;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--on-surface-variant);
    font-family: 'Work Sans', sans-serif;
    font-weight: 700;
}

tbody tr {
    background: var(--surface-card);
}

tbody td:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

tbody td:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.stat {
    display: inline-flex;
    align-items: center;
    background: var(--surface-low);
    border-radius: 999px;
    padding: 7px 11px;
    margin: 5px 7px 0 0;
    font-size: 13px;
    font-weight: 600;
}

.user-chip {
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 13px;
    background: var(--surface-low);
    font-weight: 600;
    color: var(--primary);
}

.auth-panel {
    display: none;
}

.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: end;
}

.alert-box {
    margin-top: 8px;
    background: #fff7dd;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--warn);
}

.map-toolbar,
.full-map-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.rooms-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.rooms-summary-number {
    margin: 6px 0 0;
    font-size: 28px;
    font-family: 'Work Sans', sans-serif;
    font-weight: 800;
    color: var(--primary);
}

.rooms-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.rooms-row-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.rooms-table-wrap {
    max-height: 460px;
}

.rooms-admin-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.rooms-row-selected {
    box-shadow: inset 0 0 0 2px rgba(0, 49, 120, 0.2);
}

.rooms-audit-list {
    max-height: 360px;
    overflow: auto;
    display: grid;
    gap: 8px;
}

.rooms-audit-item {
    background: var(--surface-low);
    border-radius: 10px;
    padding: 9px 10px;
}

.rooms-audit-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}

.rooms-audit-filters {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 0.9fr;
    gap: 8px;
    margin-bottom: 8px;
}

.rooms-audit-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.rooms-audit-pager {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.map-toolbar input {
    max-width: 88px;
}

.full-map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 6px;
}

.full-seat-col,
.seat-col,
.planner-card,
.planner-table-wrap,
.checkin-selection {
    background: var(--surface-low);
    border-radius: 12px;
    padding: 8px;
}

.full-seat-col h4,
.seat-col h4 {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--on-surface-variant);
    font-family: 'Work Sans', sans-serif;
}

.full-seat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
}

.full-seat-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.full-seat-item,
.seat-item {
    border-radius: 8px;
    padding: 7px;
    font-size: 12px;
    line-height: 1.4;
}

.full-seat-item.is-clickable,
.seat-item.is-clickable {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.full-seat-item.is-clickable:hover,
.seat-item.is-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 2px rgba(0, 49, 120, 0.2);
}

.full-seat-item.selected,
.seat-item.selected {
    box-shadow: 0 0 0 2px rgba(120, 89, 0, 0.45);
}

.full-map-seat-actions {
    margin: 10px 0;
    border-radius: 12px;
    padding: 10px;
    background: var(--surface-low);
    display: grid;
    gap: 10px;
}

.full-map-seat-head {
    display: grid;
    gap: 6px;
}

.full-map-seat-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.full-map-seat-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.full-map-control-group {
    border: 1px solid var(--outline-soft);
    background: var(--surface-card);
    border-radius: 10px;
    padding: 10px;
    display: grid;
    gap: 10px;
}

.full-map-control-group h4 {
    margin: 0;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--primary);
}

.full-map-control-fields {
    display: grid;
    gap: 8px;
}

.full-map-control-fields input {
    width: 100%;
}

.full-map-control-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.full-seat-item.available,
.seat-item.available {
    background: var(--surface-highest);
    color: var(--on-surface-variant);
}

.full-seat-item.empty-seat,
.seat-item.empty-seat {
    background: #eef1f5;
    color: #5a6472;
    border: 1px dashed #c9d0da;
}

.full-seat-item.occupied,
.seat-item.occupied {
    background: var(--primary);
    color: var(--on-primary);
}

.full-seat-item.locked,
.seat-item.locked {
    background: #ffecec;
    color: #7d1f1f;
}

.full-seat-item.backup,
.seat-item.backup {
    background: var(--secondary-container);
    color: #5a4200;
}

.full-seat-item.subject-colored,
.seat-item.subject-colored,
.virtual-seat-item.subject-colored {
    background: var(--subject-bg);
    color: var(--subject-fg);
    border: 1px solid var(--subject-border);
}

.full-seat-item .seat-code,
.seat-item strong {
    font-weight: 700;
    display: block;
}

.full-seat-item .seat-student {
    font-size: 11px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    border-radius: 999px;
    padding: 5px 9px;
    background: var(--surface-low);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.seat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    max-height: 760px;
    overflow: auto;
    padding-right: 2px;
}

#seatViewArchitecture.is-active,
#seatViewVirtual.is-active {
    background: var(--primary);
    color: var(--on-primary);
}

.virtual-seat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
}

.virtual-seat-item {
    border-radius: 10px;
    min-height: 72px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    font-family: 'Work Sans', sans-serif;
}

.virtual-seat-item.available { background: var(--surface-highest); color: var(--on-surface-variant); }
.virtual-seat-item.occupied { background: var(--primary); color: var(--on-primary); }
.virtual-seat-item.backup { background: var(--secondary-container); color: #5a4200; }
.virtual-seat-item.locked { background: #ffecec; color: #8f1f1f; }
.virtual-seat-item.empty-seat { background: #eef1f5; color: #596476; border: 1px dashed #c9d0da; }

.virtual-seat-item .seat-code { font-weight: 800; font-size: 14px; }
.virtual-seat-item .seat-subject { font-size: 11px; }

.seat-col-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 6px;
}

.control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.muted {
    color: var(--on-surface-variant);
    font-size: 12px;
}

pre {
    background: #0f1720;
    color: #f1f6fc;
    border-radius: 11px;
    padding: 12px;
    overflow: auto;
    min-height: 160px;
    white-space: pre-wrap;
    word-break: break-word;
}

.scroll-table {
    overflow: auto;
}

.planner-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    grid-auto-rows: 1fr;
}

.planner-workflow-switch {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.planner-command-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-container));
    color: var(--on-primary);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 14px;
}

.planner-command-head h3 {
    margin: 4px 0 0;
    color: var(--on-primary);
}

.planner-command-kicker {
    margin: 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.86;
    font-weight: 700;
}

.planner-command-sub {
    margin: 6px 0 0;
    opacity: 0.92;
    color: var(--on-primary);
}

.planner-command-card .planner-workflow-switch {
    margin-bottom: 0;
}

.planner-command-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 10px 0 12px;
}

.planner-command-metrics > div {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    padding: 10px;
}

.planner-command-metrics p {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.9;
}

.planner-command-metrics strong {
    display: block;
    margin-top: 6px;
    font-size: 28px;
    line-height: 1;
    color: #fff;
}

.planner-command-util-track {
    margin-top: 8px;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    overflow: hidden;
}

.planner-command-util-fill {
    height: 100%;
    background: #ffe7a6;
    border-radius: 999px;
}

.planner-command-util span {
    display: inline-block;
    margin-top: 8px;
    font-weight: 700;
}

.planner-command-tip p {
    text-transform: none;
    letter-spacing: normal;
    margin-top: 6px;
    font-size: 12px;
}

.planner-capacity-warning {
    margin: -2px 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 154, 154, 0.7);
    background: rgba(116, 16, 16, 0.35);
    color: #ffe7e7;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 980px) {
    .planner-command-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .planner-command-metrics {
        grid-template-columns: 1fr;
    }
}

.planner-progress-wrap {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 12px;
}

.planner-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--on-primary);
}

.planner-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    overflow: hidden;
}

.planner-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ffe7a6, #ffd27d);
    transition: width 0.25s ease;
}

.planner-progress-fill.progress-flash {
    animation: progressPulse 0.45s ease-out;
}

@keyframes progressPulse {
    0% {
        filter: brightness(1);
        box-shadow: 0 0 0 rgba(34, 197, 94, 0);
    }
    45% {
        filter: brightness(1.32);
        box-shadow: 0 0 16px rgba(34, 197, 94, 0.35);
    }
    100% {
        filter: brightness(1);
        box-shadow: 0 0 0 rgba(34, 197, 94, 0);
    }
}

.planner-progress-steps {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.planner-progress-step {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #183153;
    background: rgba(255, 255, 255, 0.88);
}

.planner-progress-step.done {
    color: #14532d;
    background: #dcfce7;
}

.planner-workflow-switch .slim.is-active,
#roomsSimpleModeBtn.is-active,
#roomsAdvancedModeBtn.is-active {
    background: var(--primary);
    color: var(--on-primary);
}

.planner-command-card .planner-workflow-switch .slim {
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
}

.planner-command-card .planner-workflow-switch .slim.is-active {
    background: #fff;
    color: #163760;
    border-color: #fff;
}

.rooms-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.planner-card {
    min-height: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.planner-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.planner-card-head h3 {
    margin: 0;
    font-size: 16px;
}

.planner-chip {
    display: inline-flex;
    align-items: center;
    color: #6c5000;
    background: #ffe7a6;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.planner-inline-fields {
    display: grid;
    grid-template-columns: minmax(0, 180px);
    gap: 8px;
    margin-bottom: 6px;
}

.hall-layout-mode {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 6px 0 10px;
}

.hall-layout-option {
    display: block;
    cursor: pointer;
}

.hall-layout-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.hall-layout-body {
    display: grid;
    gap: 6px;
    border: 1px solid var(--outline-soft);
    border-radius: 12px;
    padding: 10px;
    background: var(--surface-high);
}

.hall-layout-option input:checked + .hall-layout-body {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(0, 49, 120, 0.25);
    background: rgba(0, 49, 120, 0.06);
}

.hall-mini-hall {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    padding: 6px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.04);
}

.hall-mini-hall span {
    height: 16px;
    border-radius: 4px;
    background: #bfd2ee;
}

.hall-mini-hall-single span {
    background: #9ac3ff;
}

.hall-mini-hall-triple span {
    background: #b7c7de;
}

.hall-mini-hall-triple span.center {
    background: #f0b16a;
}

.planner-table-wrap {
    min-height: 300px;
    max-height: 300px;
    flex: 1;
}

.planner-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.planner-divider {
    height: 1px;
    background: var(--outline-soft);
    margin: 14px 0;
}

.planner-last-btn {
    margin-top: auto;
}

.checkin-selection {
    margin: 8px 0 10px;
}

.checkin-selection.selected {
    box-shadow: inset 0 0 0 2px rgba(0, 49, 120, 0.2);
}

.checkin-selection-name {
    font-weight: 700;
    margin-bottom: 4px;
}

.checkin-selection-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--on-surface-variant);
    font-size: 12px;
}

.dashboard-calendar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-calendar-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.dashboard-exam-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.dashboard-exam-calendar-weekday {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--on-surface-variant);
    text-align: center;
    padding: 4px 0;
}

.dashboard-exam-calendar-day {
    min-height: 54px;
    border-radius: 10px;
    border: 1px solid var(--outline-soft);
    background: var(--surface);
    padding: 7px 6px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4px;
}

.dashboard-exam-calendar-day.is-padding {
    border: 1px dashed transparent;
    background: transparent;
}

.dashboard-exam-calendar-day.has-exam {
    background: linear-gradient(180deg, rgba(13, 71, 161, 0.1), rgba(13, 71, 161, 0.03));
    border-color: rgba(13, 71, 161, 0.35);
}

.dashboard-exam-calendar-day.is-selected {
    box-shadow: inset 0 0 0 2px rgba(253, 192, 3, 0.5);
}

.dashboard-exam-calendar-day .day-number {
    font-size: 13px;
    font-weight: 700;
    color: var(--on-surface);
}

.dashboard-exam-calendar-day .day-count {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kiosk-panel {
    background:
        radial-gradient(circle at top right, rgba(13, 71, 161, 0.08), transparent 40%),
        radial-gradient(circle at bottom left, rgba(253, 192, 3, 0.12), transparent 40%),
        var(--surface-card);
}

.nfc-guide-card {
    margin: 0 0 10px;
    background: var(--surface-low);
    border-radius: 12px;
    padding: 10px;
}

.nfc-guide-title {
    margin: 0 0 6px;
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nfc-guide-code {
    display: block;
    width: 100%;
    background: #0f1720;
    color: #dbeafe;
    border-radius: 10px;
    padding: 10px;
    font-size: 12px;
    overflow-x: auto;
}

.kiosk-checkin-stats {
    background: var(--surface-low);
    border-radius: 12px;
    padding: 12px;
}

.kiosk-checkin-stats-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.kiosk-checkin-stats-head p {
    margin: 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--on-surface-variant);
}

.kiosk-checkin-stats-head span {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.kiosk-checkin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.kiosk-checkin-stats-grid > div {
    background: var(--surface-card);
    border-radius: 10px;
    padding: 10px;
}

.kiosk-checkin-stats-grid strong {
    display: block;
    font-family: 'Work Sans', sans-serif;
    font-size: 28px;
    line-height: 1;
    color: var(--primary);
}

.kiosk-checkin-stats-grid span {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1080px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .menu {
        flex: none;
        min-height: auto;
        overflow: visible;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .sidebar-footer {
        margin-top: 10px;
        grid-template-columns: 1fr 1fr 1fr;
        align-items: center;
    }

    .panel-grid-3,
    .planner-layout,
    .planner-actions {
        grid-template-columns: 1fr;
    }

    .status-dock {
        position: static;
        width: 100%;
        pointer-events: auto;
        margin-bottom: 8px;
    }

    .top-search-wrap {
        min-width: 220px;
    }
}

@media (max-width: 860px) {
    .main {
        padding: 12px;
    }

    .topbar {
        height: auto;
        align-items: stretch;
        flex-direction: column;
        padding: 10px;
    }

    .top-actions {
        flex-wrap: wrap;
    }

    .top-search-wrap {
        width: 100%;
        min-width: 0;
        order: -1;
    }

    .kiosk-checkin-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }


@media (max-width: 560px) {
    .kiosk-checkin-stats-grid {
        grid-template-columns: 1fr;
    }
}
    .notification-center {
        right: 10px;
        left: 10px;
        width: auto;
        top: 76px;
    }

    .panel-grid-2,
    .control-grid,
    .auth-grid {
        grid-template-columns: 1fr;
    }

    .rooms-toolbar {
        grid-template-columns: 1fr;
    }

    .rooms-toolbar-actions {
        justify-content: flex-start;
    }

    .planner-progress-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .rooms-admin-grid {
        grid-template-columns: 1fr;
    }

    .rooms-audit-filters {
        grid-template-columns: 1fr;
    }

    .rooms-audit-presets {
        flex-direction: column;
    }

    .full-map-seat-controls {
        grid-template-columns: 1fr;
    }

    .full-map-control-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .full-map-control-fields input,
    .full-map-control-actions button {
        width: 100%;
    }

    .seat-grid {
        grid-template-columns: 1fr;
        max-height: 600px;
    }
}
