@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --black: #0b0d0b;
    --charcoal: #181713;
    --green: #12352a;
    --green-soft: #245244;
    --gold: #c8a35f;
    --gold-soft: #f3dfb4;
    --ivory: #fbf8ef;
    --stone: #e8e1d4;
    --gray: #766f64;
    --white: #ffffff;
    --shadow: 0 14px 45px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--ivory);
    color: var(--charcoal);
    min-height: 100vh;
    display: flex;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: var(--green);
    color: var(--white);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.sidebar::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
}

.sidebar .logo img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.sidebar .logo div {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--gold-soft);
    text-transform: uppercase;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.72);
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sidebar a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar a:hover, .sidebar a.active {
    background: rgba(200, 163, 95, 0.15);
    color: var(--gold-soft);
    font-weight: 600;
    transform: translateX(4px);
}

.sidebar a.active {
    border-left: 3px solid var(--gold);
}

/* Sidebar Collapsible Sections */
.sidebar-section-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-top: 14px;
    font-weight: 600;
    font-size: 14px;
    color: var(--gold-soft);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    user-select: none;
}

.sidebar-section-hdr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-section-hdr span {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-section-hdr span i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-section-hdr .toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.sidebar-section-hdr.expanded .toggle-icon {
    transform: rotate(180deg);
}

.sidebar-section-content {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding-left: 12px;
    margin-top: 4px;
}

.sidebar-section-content.show {
    display: flex;
}

/* Sidebar Submenu Collapsible Rules */
.nav-submenu-group {
    margin: 4px 0;
}

.nav-submenu-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
}

.nav-submenu-hdr:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
}

.nav-submenu-hdr .toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-submenu-hdr.expanded .toggle-icon {
    transform: rotate(90deg);
}

.nav-submenu-items {
    display: none !important;
    flex-direction: column !important;
    gap: 4px !important;
    padding-left: 18px !important;
    margin-top: 4px !important;
}

.nav-submenu-items.show {
    display: flex !important;
}

.nav-submenu-items a {
    padding: 8px 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    border-radius: 6px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.nav-submenu-items a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-submenu-items a.active {
    background: var(--gold);
    color: var(--charcoal);
    font-weight: 700;
}

/* Main Content Area */
.content {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
    animation: popupFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes popupFade {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Area */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--stone);
    padding: 18px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.header h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    color: var(--green);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-menu span {
    font-weight: 600;
    color: var(--green-soft);
    font-size: 14px;
}

.user-menu a {
    color: var(--gray);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.user-menu a:hover {
    color: var(--gold);
}

/* Buttons */
.btn, button.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--green);
    color: var(--white);
    border: 1px solid var(--green);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(18, 53, 42, 0.15);
}

/* Action Buttons for tables */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--green);
    color: var(--white);
    border: 1px solid var(--green);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-right: 4px;
}

/* Status badges used in tables */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    color: var(--white);
}
.status-badge.pending { background: var(--gold-soft); }
.status-badge.submitted { background: var(--green-soft); }
.status-badge.verified { background: var(--green); }
.status-badge.completed { background: var(--stone); }
.status-badge.active { background: var(--green); }
.status-badge.inactive { background: var(--stone); }
.status-badge.suspended { background: #a03030; }
.status-badge.uploaded { background: var(--gold-soft); }
.status-badge.rejected { background: #a03030; }
.status-badge.in_progress { background: var(--green-soft); }
.status-badge.confirmed { background: var(--green); }
.status-badge.cancelled { background: #a03030; }
.status-badge.expired { background: var(--stone); }
.status-badge.reviewed { background: var(--green-soft); }
.status-badge.responded { background: var(--green); }
.status-badge.bronze { background: #cd7f32; }
.status-badge.silver { background: #8a8a8a; }
.status-badge.gold { background: var(--gold); }
.status-badge.platinum { background: #5a6e7f; }

/* Action button hover (restored) */
.btn-action:hover {
    background: var(--green-soft);
    border-color: var(--green-soft);
}

/* Responsive table wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
}

.btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(200, 163, 95, 0.2);
}

.btn.active:hover {
    background: #b69252;
    border-color: #b69252;
}

/* Summary Cards / Grid */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.card {
    background: var(--white);
    border: 1px solid var(--stone);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    border-left: 5px solid var(--green);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.08);
}

.card.blue { border-left-color: var(--green-soft); }
.card.gold { border-left-color: var(--gold); }
.card.green { border-left-color: #2b7a5a; }
.card.purple { border-left-color: #5c357d; }

.card strong {
    font-size: 14px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.card .value {
    font-size: 36px;
    font-weight: 700;
    color: var(--green);
    margin: 12px 0 6px;
    font-family: 'Cormorant Garamond', serif;
}

.card small {
    color: var(--gray);
    font-size: 12px;
}

/* Sections & Tables */
.admin-section {
    background: var(--white);
    border: 1px solid var(--stone);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 32px;
}

.admin-section h4, .admin-section h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    color: var(--green);
    margin-bottom: 24px;
    border-bottom: 1px solid var(--stone);
    padding-bottom: 12px;
}

.rooms-table-container, .report-section {
    background: var(--white);
    border: 1px solid var(--stone);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 32px;
}

.rooms-table-container h4, .report-section h4 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    color: var(--green);
    margin-bottom: 20px;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

table th, table td {
    padding: 16px 20px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid var(--stone);
}

table th {
    background: var(--ivory);
    font-weight: 600;
    color: var(--green);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

table tbody tr {
    transition: background 0.2s ease;
}

table tbody tr:hover {
    background: rgba(200, 163, 95, 0.04);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
}

.status-badge.open, .status-badge.active, .status-badge.confirmed, .status-badge.paid {
    background: rgba(43, 122, 90, 0.12);
    color: #2b7a5a;
}

.status-badge.booked, .status-badge.pending, .status-badge.partially {
    background: rgba(200, 163, 95, 0.15);
    color: #b59251;
}

.status-badge.cancelled, .status-badge.unavailable, .status-badge.unpaid {
    background: rgba(184, 43, 43, 0.1);
    color: #b82b2b;
}

.status-badge.completed, .status-badge.checked-out, .status-badge.checked_out {
    background: rgba(118, 111, 100, 0.12);
    color: var(--gray);
}

.status-badge.checked_in, .status-badge.checked-in {
    background: rgba(43, 85, 184, 0.12);
    color: #2b55b8;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--green-soft);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control, input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], input[type="url"], input[type="search"], select, textarea {
    padding: 12px 16px;
    border: 1px solid var(--stone);
    border-radius: 8px;
    font-size: 14px;
    background: var(--ivory);
    color: var(--charcoal);
    transition: all 0.3s ease;
    width: 100%;
}

.form-control:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 163, 95, 0.15);
    background: var(--white);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Login Page Specific Layout */
.login-register-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, var(--green-soft) 0%, var(--black) 100%);
    padding: 20px;
}

.login-register-body .card {
    max-width: 440px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
    border-left: none;
    border-top: 5px solid var(--gold);
    animation: popupFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-register-body .card-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-register-body .card-header img {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
}

.login-register-body .card-header h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    color: var(--green);
    margin-bottom: 8px;
}

.login-register-body .card-header p {
    font-size: 13px;
    color: var(--gray);
}

.login-register-body .btn {
    width: 100%;
    justify-content: center;
    padding: 14px;
    margin-top: 10px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 13, 11, 0.6);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--stone);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.15);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
    display: flex;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-content h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    color: var(--green);
    margin-bottom: 16px;
}

/* Actions Section */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

/* Notice notifications */
.notice {
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    border-left: 4px solid;
}

.notice.success {
    background: rgba(43, 122, 90, 0.1);
    color: #2b7a5a;
    border-left-color: #2b7a5a;
}

.notice.warning {
    background: rgba(200, 163, 95, 0.1);
    color: #b59251;
    border-left-color: #b59251;
}

.notice.error {
    background: rgba(184, 43, 43, 0.1);
    color: #b82b2b;
    border-left-color: #b82b2b;
}

/* Filter Grid & Bar Layout (matching bookings.php & rooms.php) */
.filter-form, .filter-bar, .filter-box, .date-filter-form {
    background: var(--white);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.filter-grid {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-end !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
    width: 100% !important;
}

.filter-grid .form-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin-bottom: 0 !important;
    flex: 1 1 160px !important;
    min-width: 150px !important;
}

.filter-grid .form-group label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: var(--green) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 0 !important;
}

.filter-grid input[type="text"],
.filter-grid input[type="search"],
.filter-grid input[type="date"],
.filter-grid select {
    height: 42px !important;
    padding: 8px 14px !important;
    border: 1px solid var(--stone) !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background: var(--white) !important;
    color: var(--charcoal) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    margin: 0 !important;
}

.filter-grid .btn {
    height: 42px !important;
    padding: 0 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* Universal Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
    border: 1px solid transparent;
}
.status-badge.bronze { background: #fdf6ec; color: #b87333; border-color: #f5d6b3; }
.status-badge.silver { background: #f1f3f5; color: #495057; border-color: #ced4da; }
.status-badge.gold { background: #fff8e7; color: #b58a27; border-color: #eedc9a; }
.status-badge.platinum { background: #eef2ff; color: #3b82f6; border-color: #c7d2fe; }
.status-badge.active, .status-badge.verified, .status-badge.completed, .status-badge.confirmed, .status-badge.seated, .status-badge.public { background: #e8f5e9; color: #2b7a5a; border-color: #a5d6a7; }
.status-badge.inactive, .status-badge.cancelled, .status-badge.urgent, .status-badge.expired { background: #ffebee; color: #c62828; border-color: #ef9a9a; }
.status-badge.pending, .status-badge.submitted, .status-badge.in_progress, .status-badge.medium, .status-badge.high, .status-badge.specific { background: #fff8e7; color: #b58a27; border-color: #eedc9a; }

/* Universal Table Action Buttons */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    background: #eef2ff;
    color: #2563eb;
    border-color: #c7d2fe;
}
.btn-action.btn-view { background: #eef2ff; color: #2563eb; border-color: #c7d2fe; }
.btn-action.btn-edit { background: #e8f5e9; color: #2b7a5a; border-color: #a5d6a7; }
.btn-action.btn-allot, .btn-action.btn-password { background: #fff8e7; color: #b58a27; border-color: #eedc9a; }
.btn-action.btn-delete { background: #ffebee; color: #c62828; border-color: #ef9a9a; }
.btn-action:hover { opacity: 0.85; transform: translateY(-1px); }

/* Universal Modal Overlay & Dialog Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active {
    display: flex;
}
.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.modal-content h3 {
    color: var(--green);
    margin-bottom: 16px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
}

/* Responsive Grid / Shell */
@media (max-width: 1024px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .content {
        padding: 24px;
    }
}
