﻿/* ============================================================
   LuxeStay HMS — Core Stylesheet
   Dark / Light Theme + Full Layout — FIXED VERSION
   ============================================================ */

/* ── DARK THEME ───────────────────────────────────────────── */
[data-theme="dark"] {
    --bg-body: #0f1117;
    --bg-sidebar: #161b27;
    --bg-topbar: #161b27;
    --bg-card: #1e2334;
    --bg-card-hover: #252b3b;
    --bg-input: #252b3b;
    --bg-table-head: #1a2035;
    --bg-table-alt: #1a1f2e;
    --text-primary: #e8eaf0;
    --text-secondary: #8b92a5;
    --text-muted: #5a6077;
    --text-link: #6c9bff;
    --border-color: #2a3045;
    --border-subtle: #222840;
    --gold: #f0a500;
    --gold-subtle: rgba(240,165,0,0.12);
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
    --nav-hover: rgba(255,255,255,0.05);
}

/* ── LIGHT THEME ──────────────────────────────────────────── */
[data-theme="light"] {
    --bg-body: #f0f2f8;
    --bg-sidebar: #1e2334;
    --bg-topbar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f2f8;
    --bg-input: #f5f6fa;
    --bg-table-head: #f5f6fa;
    --bg-table-alt: #fafbfd;
    --text-primary: #1a1f2e;
    --text-secondary: #5a6077;
    --text-muted: #8b92a5;
    --text-link: #3b73e8;
    --border-color: #e0e4f0;
    --border-subtle: #eaecf5;
    --gold: #c47f0a;
    --gold-subtle: rgba(196,127,10,0.10);
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
    --nav-hover: rgba(0,0,0,0.04);
}

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    background: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    transition: background 0.3s, color 0.3s;
}

/* ── SIDEBAR ──────────────────────────────────────────────── */
.hms-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: #161b27;
    border-right: 1px solid rgba(255,255,255,0.06);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: width 0.25s ease, transform 0.25s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

    .hms-sidebar.collapsed {
        width: 64px;
    }

        .hms-sidebar.collapsed .hms-logo-text,
        .hms-sidebar.collapsed .hms-nav-label,
        .hms-sidebar.collapsed .hms-nav-link span,
        .hms-sidebar.collapsed .hms-badge {
            display: none;
        }

        .hms-sidebar.collapsed .hms-nav-link {
            justify-content: center;
            padding: 10px;
        }

.hms-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 17px;
    font-weight: 600;
    color: #f0a500;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

    .hms-sidebar-logo i {
        font-size: 22px;
        min-width: 24px;
    }

/* ── NAV ──────────────────────────────────────────────────── */
.hms-nav {
    padding: 12px 0 80px;
}

.hms-nav-section {
    margin-bottom: 4px;
}

.hms-nav-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.25);
    padding: 14px 20px 4px;
    white-space: nowrap;
}

.hms-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
    position: relative;
}

    .hms-nav-link i {
        font-size: 16px;
        min-width: 18px;
        text-align: center;
    }

    .hms-nav-link:hover {
        color: rgba(255,255,255,0.9);
        background: rgba(255,255,255,0.06);
    }

    .hms-nav-link.active {
        color: #f0a500;
        background: rgba(240,165,0,0.12);
        border-left: 3px solid #f0a500;
        padding-left: 17px;
    }

.hms-badge {
    margin-left: auto;
    background: #f0a500;
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

/* ── MAIN CONTENT ─────────────────────────────────────────── */
.hms-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
    background: var(--bg-body);
}

    .hms-main.expanded {
        margin-left: 64px;
    }

/* ── TOPBAR ───────────────────────────────────────────────── */
.hms-topbar {
    height: var(--topbar-height);
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: var(--shadow-sm);
    transition: background 0.3s, border-color 0.3s;
}

.hms-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hms-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hms-sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

    .hms-sidebar-toggle:hover {
        background: var(--bg-card);
        color: var(--text-primary);
    }

.hms-page-title h6 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* ── QUICK STATS ──────────────────────────────────────────── */
.hms-quick-stats {
    display: flex;
    gap: 6px;
    align-items: center;
}

.hms-stat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: background 0.3s, border-color 0.3s;
}

    .hms-stat-chip span {
        font-weight: 600;
        color: var(--text-primary);
        font-size: 13px;
    }

/* ── THEME TOGGLE ─────────────────────────────────────────── */
.hms-theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s;
}

    .hms-theme-toggle:hover {
        background: var(--gold-subtle);
        color: var(--gold);
        border-color: var(--gold);
    }

/* ── ICON BUTTON ──────────────────────────────────────────── */
.hms-icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    position: relative;
}

    .hms-icon-btn:hover {
        color: var(--text-primary);
        background: var(--bg-card-hover);
    }

.hms-notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: #e53e3e;
    border-radius: 50%;
    border: 2px solid var(--bg-topbar);
}

/* ── NOTIFICATION DROPDOWN ────────────────────────────────── */
.hms-notif-dropdown {
    width: 300px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}

.hms-notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.hms-notif-body {
    padding: 8px 0;
}

.hms-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    transition: background 0.15s;
    cursor: pointer;
}

    .hms-notif-item:hover {
        background: var(--bg-card-hover);
    }

    .hms-notif-item i {
        font-size: 18px;
        margin-top: 2px;
    }

.hms-notif-text {
    font-size: 12.5px;
    color: var(--text-primary);
}

.hms-notif-item small {
    color: var(--text-muted);
    font-size: 11px;
}

/* ── USER BUTTON ──────────────────────────────────────────── */
.hms-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
    font-size: 13px;
}

    .hms-user-btn:hover {
        background: var(--bg-card-hover);
    }

.hms-avatar {
    width: 28px;
    height: 28px;
    background: var(--gold);
    color: #000;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.hms-user-name {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
}

.hms-user-menu {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    min-width: 180px;
}

    .hms-user-menu .dropdown-item {
        color: var(--text-primary) !important;
        font-size: 13px;
        padding: 9px 16px;
        transition: background 0.15s;
    }

        .hms-user-menu .dropdown-item:hover {
            background: var(--bg-card-hover) !important;
            color: var(--text-primary) !important;
        }

/* ── PAGE CONTENT ─────────────────────────────────────────── */
.hms-content {
    flex: 1;
    padding: 24px;
    background: var(--bg-body);
    transition: background 0.3s;
}

/* ── FOOTER ───────────────────────────────────────────────── */
.hms-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-top: 1px solid var(--border-color);
    font-size: 11.5px;
    color: var(--text-muted);
    background: var(--bg-topbar);
    transition: background 0.3s;
}

/* ── CARDS ────────────────────────────────────────────────── */
.hms-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: box-shadow 0.2s, background 0.3s, border-color 0.3s;
}

    .hms-card:hover {
        box-shadow: var(--shadow-sm);
    }

.hms-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* ── KPI CARDS ────────────────────────────────────────────── */
.hms-kpi {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: background 0.3s, border-color 0.3s;
}

.hms-kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hms-kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 6px 0;
}

.hms-kpi-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 28px;
    opacity: 0.12;
}

.hms-kpi-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── TABLES ───────────────────────────────────────────────── */
.hms-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: background 0.3s;
}

.hms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .hms-table thead th {
        background: var(--bg-table-head);
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        padding: 12px 16px;
        border-bottom: 1px solid var(--border-color);
        white-space: nowrap;
        transition: background 0.3s;
    }

    .hms-table tbody td {
        padding: 11px 16px;
        border-bottom: 1px solid var(--border-subtle);
        color: var(--text-primary);
        vertical-align: middle;
        transition: background 0.15s, color 0.3s;
    }

    .hms-table tbody tr:last-child td {
        border-bottom: none;
    }

    .hms-table tbody tr:nth-child(even) td {
        background: var(--bg-table-alt);
    }

    .hms-table tbody tr:hover td {
        background: var(--bg-card-hover);
    }

/* ── STATUS BADGES ────────────────────────────────────────── */
.hms-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

    .hms-status.confirmed {
        background: rgba(59,130,246,0.15);
        color: #3b82f6;
    }

    .hms-status.checkedin {
        background: rgba(34,197,94,0.15);
        color: #16a34a;
    }

    .hms-status.checkedout {
        background: rgba(107,114,128,0.15);
        color: #6b7280;
    }

    .hms-status.cancelled {
        background: rgba(239,68,68,0.15);
        color: #dc2626;
    }

    .hms-status.noshow {
        background: rgba(234,179,8,0.15);
        color: #ca8a04;
    }

/* Light mode status — more visible */
[data-theme="light"] .hms-status.confirmed {
    color: #1d4ed8;
}

[data-theme="light"] .hms-status.checkedin {
    color: #15803d;
}

[data-theme="light"] .hms-status.checkedout {
    color: #374151;
}

[data-theme="light"] .hms-status.cancelled {
    color: #b91c1c;
}

[data-theme="light"] .hms-status.noshow {
    color: #92400e;
}

/* Room Status */
.room-vc {
    background: rgba(34,197,94,0.15);
    color: #15803d;
}

.room-vd {
    background: rgba(234,179,8,0.15);
    color: #92400e;
}

.room-oc {
    background: rgba(59,130,246,0.15);
    color: #1d4ed8;
}

.room-od {
    background: rgba(168,85,247,0.15);
    color: #7e22ce;
}

.room-ooo {
    background: rgba(239,68,68,0.15);
    color: #b91c1c;
}

.room-oos {
    background: rgba(107,114,128,0.15);
    color: #374151;
}

[data-theme="dark"] .room-vc {
    color: #4ade80;
}

[data-theme="dark"] .room-vd {
    color: #fbbf24;
}

[data-theme="dark"] .room-oc {
    color: #60a5fa;
}

[data-theme="dark"] .room-od {
    color: #c084fc;
}

[data-theme="dark"] .room-ooo {
    color: #f87171;
}

[data-theme="dark"] .room-oos {
    color: #9ca3af;
}

/* ── FORMS ────────────────────────────────────────────────── */
.form-control,
.form-select {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 8px;
    font-size: 13.5px;
    padding: 8px 12px;
    transition: border-color 0.2s, background 0.3s, color 0.3s;
}

    .form-control:focus,
    .form-select:focus {
        background: var(--bg-input) !important;
        border-color: var(--gold) !important;
        color: var(--text-primary) !important;
        box-shadow: 0 0 0 3px var(--gold-subtle) !important;
    }

    .form-control::placeholder {
        color: var(--text-muted);
    }

.form-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn-hms-primary {
    background: var(--gold);
    color: #000;
    border: none;
    font-weight: 600;
    font-size: 13px;
    border-radius: 8px;
    padding: 8px 18px;
    transition: all 0.2s;
}

    .btn-hms-primary:hover {
        background: #e09400;
        color: #000;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px var(--gold-subtle);
    }

.btn-hms-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-size: 13px;
    border-radius: 8px;
    padding: 8px 18px;
    transition: all 0.2s;
}

    .btn-hms-outline:hover {
        background: var(--bg-card-hover);
        color: var(--text-primary);
        border-color: var(--text-secondary);
    }

/* ── DROPDOWN ─────────────────────────────────────────────── */
.dropdown-menu {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    font-size: 13px;
}

.dropdown-item {
    color: var(--text-primary) !important;
    padding: 8px 14px;
    transition: background 0.15s;
}

    .dropdown-item:hover {
        background: var(--bg-card-hover) !important;
        color: var(--text-primary) !important;
    }

.dropdown-divider {
    border-color: var(--border-color) !important;
}

/* ── ALERTS ───────────────────────────────────────────────── */
.hms-alerts .alert {
    font-size: 13px;
    border-radius: 8px;
    border: none;
}

/* ── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .hms-sidebar {
        transform: translateX(-100%);
    }

        .hms-sidebar.mobile-open {
            transform: translateX(0);
        }

    .hms-main {
        margin-left: 0;
    }

    .hms-quick-stats {
        display: none !important;
    }
}
