:root {
    --bg-primary: #020617;
    --bg-secondary: #0f172a;
    --bg-tertiary: #1e1b4b;
    --surface: rgba(15, 23, 42, 0.68);
    --surface-strong: rgba(15, 23, 42, 0.92);
    --border: rgba(148, 163, 184, 0.2);
    --text-primary: #e2e8f0;
    --text-muted: #94a3b8;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-soft: 0 16px 30px rgba(2, 6, 23, 0.48);
    --shadow-glow: 0 0 0 1px rgba(96, 165, 250, 0.25), 0 0 24px rgba(96, 165, 250, 0.32);
    --kpi-blue-purple: linear-gradient(135deg, #2563eb, #7c3aed);
    --kpi-green-teal: linear-gradient(135deg, #16a34a, #0d9488);
    --kpi-orange-pink: linear-gradient(135deg, #f97316, #ec4899);
    --kpi-red-magenta: linear-gradient(135deg, #dc2626, #db2777);
}

* { box-sizing: border-box; }

body,
.app-body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    margin: 0;
    color: var(--text-primary);
    background:
        radial-gradient(1100px 580px at 10% -15%, rgba(124, 58, 237, 0.22), transparent 65%),
        radial-gradient(900px 450px at 90% -5%, rgba(14, 165, 233, 0.2), transparent 60%),
        linear-gradient(160deg, var(--bg-primary), var(--bg-secondary) 55%, var(--bg-tertiary));
    min-height: 100vh;
}

a { color: #93c5fd; }
a:hover { color: #c4b5fd; }

.top-navbar {
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(71, 85, 105, 0.34);
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.5);
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #f8fafc !important;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.nav-logo i {
    font-size: 1.2rem;
    color: #a78bfa;
    text-shadow: 0 0 14px rgba(167, 139, 250, 0.64);
}

.nav-menu-center .nav-link {
    color: #cbd5e1;
    font-weight: 500;
    border-radius: 999px;
    padding: 0.52rem 1rem !important;
    transition: all 0.2s ease;
}

.nav-menu-center .nav-link:hover,
.nav-menu-center .nav-link.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.26);
    box-shadow: 0 0 16px rgba(129, 140, 248, 0.42);
}

.nav-actions .btn-ghost {
    background: rgba(30, 41, 59, 0.68);
    color: #cbd5e1;
    border: 1px solid rgba(100, 116, 139, 0.35);
    border-radius: 12px;
}

.nav-actions .btn-ghost:hover {
    color: #fff;
    border-color: rgba(96, 165, 250, 0.75);
    box-shadow: var(--shadow-glow);
}

.btn-icon-glow {
    width: 40px;
    height: 40px;
}

.btn-profile {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(30, 41, 59, 0.74);
    color: #fff;
}

.btn-profile:hover {
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.dropdown-menu {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(71, 85, 105, 0.45);
    box-shadow: var(--shadow-soft);
}

.dropdown-item,
.dropdown-item-text {
    color: #cbd5e1;
}

.dropdown-item:hover {
    color: #fff;
    background: rgba(59, 130, 246, 0.24);
}

.app-content {
    animation: fadeInPage 0.4s ease;
}

.alert {
    border: 1px solid transparent;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.75);
    color: #e2e8f0;
}

.alert-success { border-color: rgba(16, 185, 129, 0.35); }
.alert-danger { border-color: rgba(244, 63, 94, 0.35); }
.alert-info { border-color: rgba(56, 189, 248, 0.35); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
}

.card-header {
    background: rgba(15, 23, 42, 0.72) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}

.form-control,
.form-select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(100, 116, 139, 0.4);
    color: #e2e8f0;
}

.form-control::placeholder { color: #64748b; }

.form-control:focus,
.form-select:focus {
    color: #fff;
    background: rgba(15, 23, 42, 0.96);
    border-color: rgba(96, 165, 250, 0.75);
    box-shadow: var(--shadow-glow);
}

.btn {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    border: 0;
    background: var(--kpi-blue-purple);
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.26), 0 12px 22px rgba(67, 56, 202, 0.38);
}

.btn-success {
    border: 0;
    background: var(--kpi-green-teal);
}

.btn-danger {
    border: 0;
    background: var(--kpi-red-magenta);
}

.btn-outline-primary,
.btn-outline-success,
.btn-outline-danger {
    border-width: 1px;
}

.kpi-card {
    position: relative;
    overflow: hidden;
    border: 0;
    color: #fff;
    border-radius: var(--radius-lg);
    min-height: 145px;
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.48);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    animation: cardRise 0.45s ease both;
}

.kpi-card::after {
    content: "";
    position: absolute;
    inset: -25% -25% auto auto;
    width: 130px;
    height: 130px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    filter: blur(2px);
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 0 1px rgba(226, 232, 240, 0.2), 0 0 28px rgba(168, 85, 247, 0.45);
}

.kpi-blue-purple { background: var(--kpi-blue-purple); }
.kpi-green-teal { background: var(--kpi-green-teal); }
.kpi-orange-pink { background: var(--kpi-orange-pink); }
.kpi-red-magenta { background: var(--kpi-red-magenta); }

.kpi-label { opacity: 0.9; font-weight: 600; font-size: 0.9rem; }
.kpi-value { font-size: clamp(1.45rem, 2.3vw, 2rem); font-weight: 800; letter-spacing: -0.02em; }
.kpi-trend { font-size: 0.8rem; opacity: 0.9; }
.kpi-icon { font-size: 1.9rem; opacity: 0.95; }

.room-grid {
    display: grid;
    gap: 0.95rem;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.room-tile {
    position: relative;
    padding: 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(15, 23, 42, 0.72);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    animation: cardRise 0.35s ease both;
}

.room-grid .room-tile:nth-child(4n+1) { animation-delay: 0.02s; }
.room-grid .room-tile:nth-child(4n+2) { animation-delay: 0.06s; }
.room-grid .room-tile:nth-child(4n+3) { animation-delay: 0.1s; }
.room-grid .room-tile:nth-child(4n+4) { animation-delay: 0.14s; }

.room-tile:hover {
    transform: translateY(-4px);
}

.status-clean {
    border-color: rgba(34, 197, 94, 0.7);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.status-dirty {
    border-color: rgba(244, 63, 94, 0.7);
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.3);
}

.status-progress {
    border-color: rgba(249, 115, 22, 0.75);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.28);
}

.status-progress::after,
.status-dirty::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    animation: tilePulse 2.2s ease-in-out infinite;
}

.status-dirty::after {
    box-shadow: inset 0 0 0 1px rgba(244, 63, 94, 0.36), 0 0 0 rgba(244, 63, 94, 0.2);
}

.status-progress::after {
    box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.34), 0 0 0 rgba(249, 115, 22, 0.18);
}

.status-ooo {
    border-color: rgba(100, 116, 139, 0.6);
    box-shadow: 0 0 16px rgba(100, 116, 139, 0.28);
    opacity: 0.85;
}

.room-no { font-weight: 800; font-size: 1.1rem; }
.room-meta { color: var(--text-muted); font-size: 0.8rem; }

.table {
    --bs-table-bg: transparent;
    --bs-table-color: #e2e8f0;
    --bs-table-border-color: rgba(100, 116, 139, 0.3);
}

.table thead th {
    background: rgba(15, 23, 42, 0.94);
    color: #cbd5e1;
    border-bottom: 1px solid rgba(100, 116, 139, 0.45);
}

.table tbody tr:hover {
    background: rgba(59, 130, 246, 0.12);
}

.badge {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.room-status-badge {
    font-size: 0.72rem;
    padding: 0.34rem 0.6rem;
    border: 1px solid transparent;
}

.badge-vc {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: rgba(34, 197, 94, 0.78);
    color: #f8fafc;
}

.badge-oc {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    border-color: rgba(59, 130, 246, 0.78);
    color: #f8fafc;
}

.badge-vd {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: rgba(239, 68, 68, 0.8);
    color: #fff5f5;
}

.badge-od {
    background: linear-gradient(135deg, #be123c, #e11d48);
    border-color: rgba(225, 29, 72, 0.78);
    color: #fff1f2;
}

.badge-oos {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    border-color: rgba(249, 115, 22, 0.78);
    color: #fff7ed;
}

.badge-ooo {
    background: linear-gradient(135deg, #64748b, #475569);
    border-color: rgba(100, 116, 139, 0.75);
    color: #f1f5f9;
}

.badge-neutral {
    background: linear-gradient(135deg, #334155, #1e293b);
    border-color: rgba(100, 116, 139, 0.55);
    color: #e2e8f0;
}

.fancy-date-badge {
    padding: 0.48rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #f8fafc;
    border: 1px solid rgba(167, 139, 250, 0.7);
    background: linear-gradient(135deg, #2563eb, #7c3aed, #ec4899);
    box-shadow: 0 0 18px rgba(124, 58, 237, 0.5);
}

.attendant-list .list-group-item {
    background: rgba(15, 23, 42, 0.45);
    color: #e2e8f0;
    border-color: rgba(100, 116, 139, 0.28);
}

.raw-data-card,
.raw-data-card .card-body,
.raw-data-card .form-label,
.raw-data-card .form-text,
.raw-data-card strong,
.raw-data-card small {
    color: #f8fafc;
}

.raw-data-table,
.raw-data-table th,
.raw-data-table td {
    color: #f8fafc !important;
}

.raw-data-table thead th {
    background: rgba(15, 23, 42, 0.96);
}

.raw-data-table tbody tr {
    background: rgba(15, 23, 42, 0.62);
}

.raw-data-table tbody tr:nth-child(odd) {
    background: rgba(30, 41, 59, 0.58);
}

.raw-data-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.16);
}

.raw-data-table td.remarks-wrap {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-width: 260px;
    max-width: 520px;
}

.modal-content {
    border-radius: 14px;
    border: 1px solid rgba(100, 116, 139, 0.4);
    background: rgba(15, 23, 42, 0.96);
    color: #e2e8f0;
}

.ajax-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(2, 6, 23, 0.52);
    display: grid;
    place-items: center;
}

.toast-container .toast {
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(100, 116, 139, 0.4);
    color: #e2e8f0;
    box-shadow: var(--shadow-soft);
}

.toast .toast-header {
    color: #fff;
    background: rgba(30, 41, 59, 0.9);
    border-bottom: 1px solid rgba(100, 116, 139, 0.34);
}

@keyframes fadeInPage {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cardRise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tilePulse {
    0% { opacity: 0.25; }
    50% { opacity: 0.65; }
    100% { opacity: 0.25; }
}

@media (max-width: 991.98px) {
    .nav-menu-center {
        margin-top: 0.7rem;
        margin-bottom: 0.7rem;
    }

    .nav-menu-center .nav-link {
        display: inline-block;
        margin-right: 0.4rem;
        margin-bottom: 0.4rem;
    }

    .nav-actions {
        margin-top: 0.75rem;
    }
}

@media (max-width: 767.98px) {
    .room-grid {
        grid-template-columns: 1fr 1fr;
    }

    .table-mobile-cards thead {
        display: none;
    }

    .table-mobile-cards tbody tr {
        display: block;
        border: 1px solid rgba(100, 116, 139, 0.3);
        border-radius: 14px;
        margin-bottom: 0.85rem;
        padding: 0.5rem;
        background: rgba(15, 23, 42, 0.82);
    }

    .table-mobile-cards tbody td {
        display: flex;
        justify-content: space-between;
        gap: 0.75rem;
        border: none;
        padding: 0.4rem 0.2rem;
    }

    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        min-width: 128px;
        color: #94a3b8;
        font-weight: 600;
    }
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: clamp(16px, 3vw, 40px);
    background:
        linear-gradient(120deg, rgba(2, 6, 23, 0.5), rgba(30, 27, 75, 0.35)),
        url("../image/login.png") center/cover no-repeat;
    border-radius: 0;
    border: 0;
}

.auth-card {
    width: min(100%, 560px);
    margin-inline: auto;
    background: rgba(15, 23, 42, 0.16);
    border: 1px solid rgba(129, 140, 248, 0.35);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.14), 0 0 24px rgba(79, 70, 229, 0.18);
}

.auth-logo {
    max-width: 98px;
    max-height: 98px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 20px rgba(99, 102, 241, 0.45));
}

.auth-link {
    color: #93c5fd;
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    color: #c4b5fd;
    text-decoration: underline;
}

.auth-footer-note {
    text-align: center;
}

.auth-page-login {
    align-items: center;
    justify-content: flex-end;
    min-height: 100vh;
    padding: 24px 48px 24px 24px;
}

@media (max-width: 991.98px) {
    .auth-page {
        align-items: center;
        justify-content: center;
        padding: 16px;
    }

    .auth-page-login {
        align-items: center;
        justify-content: center;
        padding: 16px;
    }
}
