/* MARS HOTEL MANAGEMENT - PROFESSIONAL CORE STYLES */
:root {
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --dark: #1e293b;
    --dark-deep: #0f172a;
    --light: #f8fafc;
    --border: #e2e8f0;
    --header-height: 60px;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --bottom-nav-height: 65px;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    margin: 0;
    background-color: #f1f5f9;
    color: var(--dark);
    line-height: 1.5;
}

/* 1. CORE LAYOUT (The Foundation) */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-deep);
    color: white;
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    z-index: 1010;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding-top: var(--header-height);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 25px;
    transition: all 0.3s;
    width: calc(100% - var(--sidebar-width));
}

/* 2. DESKTOP STATES */
@media (min-width: 769px) {
    body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); }
    body.sidebar-collapsed .sidebar span, 
    body.sidebar-collapsed .has-children > a::after { display: none; }
    body.sidebar-collapsed .main-content { 
        margin-left: var(--sidebar-collapsed-width); 
        width: calc(100% - var(--sidebar-collapsed-width));
    }
}

/* 3. MOBILE STATES (DRAWER) */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); padding-top: 20px; }
    .sidebar.sidebar-open { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; padding: 15px; padding-bottom: 100px; }
    .header-datetime { display: none; }
}

/* 4. NAVIGATION UI */
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar ul li { position: relative; }
.sidebar ul li a {
    color: #94a3b8;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    border-left: 4px solid transparent;
}
.sidebar ul li a i { width: 24px; margin-right: 12px; font-size: 1.1rem; text-align: center; }
.sidebar ul li.active > a, .sidebar ul li a:hover { background: rgba(255,255,255,0.05); color: white; }
.sidebar ul li.active > a { border-left: 4px solid var(--primary); background: rgba(37, 99, 235, 0.1); }

/* Sub-menu styling and animation */
.sub-menu { 
    display: none; 
    background: rgba(0,0,0,0.15); 
    list-style: none; 
    padding: 5px 0;
    overflow: hidden;
}
.sidebar ul li.active > .sub-menu { 
    display: block;
    animation: slideDown 0.3s ease-out forwards;
}
.sub-menu li a { 
    padding: 10px 20px 10px 56px; 
    font-size: 0.85rem; 
    border-left: none !important;
}
.sub-menu li a:hover {
    background: rgba(255,255,255,0.08);
}

.has-children > a::after {
    content: '\f105';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: auto;
    transition: transform 0.3s;
}
.has-children.active > a::after {
    transform: rotate(90deg);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 5. COMPONENTS */
.card-container, .card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

/* 6. RESPONSIVE TABLES (The "Collapsing" Fix) */
.data-table-container { overflow-x: auto; width: 100%; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: #f8fafc; padding: 12px 15px; text-align: left; font-size: 0.75rem; color: var(--secondary); text-transform: uppercase; border-bottom: 1px solid var(--border); }
.data-table td { padding: 15px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }

@media (max-width: 1024px) {
    .data-table, .data-table thead, .data-table tbody, .data-table th, .data-table td, .data-table tr { display: block; }
    .data-table thead { display: none; }
    .data-table tr { margin-bottom: 15px; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; background: white; }
    .data-table td { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f1f5f9; padding: 10px 5px; text-align: right; }
    .data-table td:last-child { border-bottom: 0; }
    .data-table td::before { content: attr(data-label); font-weight: 700; color: var(--secondary); font-size: 0.7rem; text-transform: uppercase; text-align: left; flex: 1; }
}

/* 7. APP ELEMENTS */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-height);
    background: white;
    border-top: 1px solid var(--border);
    z-index: 1005;
    justify-content: space-around;
    align-items: center;
}
@media (max-width: 768px) { .bottom-nav { display: flex; } }

.nav-item { display: flex; flex-direction: column; align-items: center; color: var(--secondary); text-decoration: none; font-size: 0.65rem; gap: 4px; }
.nav-item.active { color: var(--primary); }
.nav-item i { font-size: 1.2rem; }

/* Sidebar Sub-menu Hover Effect (Optional UX Enhancement) */
.sidebar ul li.has-children:hover > a {
    color: white;
    background: rgba(255,255,255,0.05);
}

/* Floating Action Button (FAB) Alignment & Style */
.floating-fab {
    position: fixed;
    bottom: 30px; 
    right: 30px;
    width: 60px; 
    height: 60px;
    background: var(--primary);
    color: white !important;
    border-radius: 50%;
    display: flex;
    align-items: center; 
    justify-content: center;
    box-shadow: 0 10px 25px rgba(37,99,235,0.4);
    z-index: 1050;
    font-size: 1.5rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}

.floating-fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 15px 30px rgba(37,99,235,0.5);
    background: #1d4ed8;
}

@media (max-width: 768px) { 
    .floating-fab { bottom: 85px; right: 20px; width: 56px; height: 56px; } 
}

/* Ensure sub-menus are visible when active */
.sidebar ul li.active > .sub-menu {
    display: block !important;
    max-height: 1000px; /* Large enough to fit any sub-menu */
    transition: max-height 0.5s ease-in;
}

/* 8. BUTTONS & FORMS */
.btn { 
    height: 44px; padding: 0 20px; border-radius: 10px; font-weight: 600; 
    display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer;
    text-decoration: none; font-size: 0.9rem; transition: 0.2s;
}
.btn-primary { background: var(--primary); color: white !important; }
.btn-success { background: var(--success); color: white !important; }
.btn-danger { background: var(--danger); color: white !important; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.85rem; color: var(--secondary); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; font-size: 1rem;
}

/* 9. UTILITIES */
.horizontal-scroll { display: flex; overflow-x: auto; gap: 15px; padding-bottom: 10px; scrollbar-width: none; }
.horizontal-scroll::-webkit-scrollbar { display: none; }
.scroll-card { flex: 0 0 220px; }

.badge { padding: 4px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 700; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }

/* Modal Overlay */
.main-content-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1009;
}
.sidebar.sidebar-open ~ .main-content-overlay { display: block; }
