:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --sidebar-bg: #1e293b;
    --sidebar-text: #cbd5e1;
    --sidebar-muted: #94a3b8;
    --sidebar-active: #3b82f6;
    --page-bg: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-secondary: #64748b;
}

body.app-body {
    margin: 0;
    background: var(--page-bg);
    color: var(--text-main);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 1.25rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width 0.2s ease;
}

.sidebar.is-collapsed {
    width: 84px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.15);
    color: #bfdbfe;
    border-radius: 12px;
    font-weight: 700;
}

.text-sidebar-muted {
    color: var(--sidebar-muted);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    border-radius: 0.75rem;
    color: var(--sidebar-text);
    text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(59, 130, 246, 0.16);
    color: #eff6ff;
}

.sidebar.is-collapsed .sidebar-brand > div,
.sidebar.is-collapsed .sidebar-link span {
    display: none;
}

.app-main {
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 72px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.content-area {
    padding: 1.5rem;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #dbeafe;
    color: var(--primary-dark);
    font-weight: 700;
}

.notification-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #dc2626;
}

.notification-count-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-menu {
    width: 360px;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}

.notification-menu-header,
.notification-menu-footer {
    padding: 0.9rem 1rem;
    background: #fff;
}

.notification-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.notification-menu-footer {
    border-top: 1px solid var(--border-color);
}

.notification-menu-list {
    max-height: 420px;
    overflow: auto;
    background: #f8fafc;
}

.notification-menu-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.notification-item {
    display: block;
    padding: 0.9rem 1rem;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
}

.notification-item:hover {
    background: #eff6ff;
}

.notification-item.is-unread {
    background: #eff6ff;
}

.notification-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-item-message,
.notification-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.notification-meta {
    margin-top: 0.35rem;
}

.notification-page-card {
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1rem;
    background: #fff;
    margin-bottom: 0.9rem;
}

.notification-card-unread {
    border-color: #93c5fd;
    background: #eff6ff;
}

.report-chart-card {
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: #fff;
    padding: 1rem;
    min-height: 320px;
}

.timeline-log {
    display: grid;
    gap: 1rem;
}

.timeline-log-item {
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: #fff;
    padding: 1rem;
}

.staff-log-pre {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.75rem;
    font-size: 0.8rem;
    overflow: auto;
    margin-bottom: 0.5rem;
}

.maintenance-list {
    display: grid;
    gap: 1rem;
}

.maintenance-card {
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: #fff;
    padding: 1rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.maintenance-priority-urgent {
    border-left: 4px solid #dc2626;
}

.maintenance-priority-high {
    border-left: 4px solid #f59e0b;
}

.maintenance-priority-medium {
    border-left: 4px solid #2563eb;
}

.maintenance-priority-low {
    border-left: 4px solid #94a3b8;
}

.maintenance-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.maintenance-gallery a {
    display: block;
}

.maintenance-gallery img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 28%),
        radial-gradient(circle at bottom right, rgba(30, 41, 59, 0.10), transparent 32%),
        var(--page-bg);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

.dashboard-card,
.placeholder-card {
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: var(--card-bg);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.04);
}

.room-card {
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: #fff;
    padding: 1rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    border-top-width: 4px;
}

.room-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.room-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.room-number {
    font-size: 1.15rem;
    font-weight: 700;
}

.room-tenant {
    min-height: 24px;
    font-weight: 600;
}

.room-status-available {
    border-top-color: #16a34a;
}

.room-status-occupied {
    border-top-color: #dc2626;
}

.room-status-reserved {
    border-top-color: #d97706;
}

.room-status-maintenance {
    border-top-color: #94a3b8;
}

.room-status-cleaning {
    border-top-color: #0284c7;
}

.stat-card {
    padding: 1rem 1.25rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-value-suffix {
    font-size: 1rem;
    color: var(--text-secondary);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(255, 255, 255, 0.7);
}

.stat-card-occupied {
    background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
}

.stat-card-revenue {
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.stat-card-pending {
    background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
}

.stat-card-maintenance {
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.dashboard-chart-wrap {
    position: relative;
    min-height: 320px;
}

.dashboard-action-list {
    display: grid;
    gap: 0.85rem;
}

.dashboard-action-item {
    border: 1px solid var(--border-color);
    border-radius: 0.9rem;
    padding: 0.95rem 1rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dashboard-action-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
    border-color: #bfdbfe;
}

.dashboard-room-summary {
    display: grid;
    gap: 1rem;
}

.dashboard-room-summary-row {
    padding-bottom: 0.25rem;
}

.dashboard-progress {
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.dashboard-progress-bar {
    height: 100%;
    border-radius: 999px;
}

.room-progress-available {
    background: #16a34a;
}

.room-progress-occupied {
    background: #dc2626;
}

.room-progress-reserved {
    background: #d97706;
}

.room-progress-maintenance {
    background: #94a3b8;
}

.room-progress-cleaning {
    background: #0284c7;
}

.dashboard-mini-panel {
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1rem;
    background: #fff;
    height: 100%;
}

.dashboard-mini-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.dashboard-list-item {
    padding: 0.75rem 0;
    border-top: 1px solid #f1f5f9;
}

.dashboard-list-item:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.dashboard-empty {
    color: var(--text-secondary);
    padding: 1rem 0;
}

.dashboard-kpi-stack {
    display: grid;
    gap: 0.85rem;
}

.dashboard-kpi-item {
    border: 1px solid var(--border-color);
    border-radius: 0.9rem;
    padding: 1rem;
    background: #fff;
}

.booking-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
}

.booking-calendar-head {
    padding: 0.85rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    text-align: center;
    color: var(--text-secondary);
}

.booking-calendar-cell {
    min-height: 152px;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.booking-calendar-cell:nth-child(7n) {
    border-right: 0;
}

.booking-calendar-cell.is-muted {
    background: #fbfcfd;
}

.booking-calendar-cell.is-today {
    background: #eff6ff;
}

.booking-calendar-date {
    font-weight: 700;
}

.booking-calendar-items {
    display: grid;
    gap: 0.35rem;
}

.booking-calendar-empty,
.booking-calendar-more {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.booking-chip {
    border: 0;
    border-radius: 0.75rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.8rem;
    text-align: left;
    color: #fff;
    cursor: pointer;
}

.booking-chip.status-pending,
.booking-chip.status-confirmed {
    background: #d97706;
}

.booking-chip.status-checked_in {
    background: #16a34a;
}

.booking-chip.status-checked_out {
    background: #64748b;
}

.booking-chip.status-cancelled,
.booking-chip.status-no_show {
    background: #dc2626;
}

.alert-floating {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
    min-width: 280px;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        z-index: 1040;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .content-area,
    .topbar {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .booking-calendar {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .booking-calendar-head {
        display: none;
    }

    .booking-calendar-cell {
        min-height: 0;
        border-right: 0;
    }
}
