/* ============================================================
   INVENTORY & ROOM BOOKING MANAGEMENT SYSTEM
   Modern Minimalist Blue Theme
   ============================================================ */

:root {
    --primary: #2563EB;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #16a34a;
    --warning: #ca8a04;
    --danger: #dc2626;
    --info: #0891b2;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    --border-radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* Dark Mode */
[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-light: #1e293b;
    --secondary: #64748b;
    --dark: #f1f5f9;
    --light: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
}

[data-theme="dark"] body {
    background: #0f172a;
    color: #e2e8f0;
}

[data-theme="dark"] .card,
[data-theme="dark"] .navbar,
[data-theme="dark"] .modal-content {
    background: #1e293b;
    color: #e2e8f0;
}

[data-theme="dark"] .table { color: #e2e8f0; }
[data-theme="dark"] .table-light { background: #334155; color: #e2e8f0; }
[data-theme="dark"] .table-light th { background: #334155; color: #e2e8f0; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-100);
    color: var(--gray-700);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    z-index: 1040;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--gray-600); border-radius: 4px; }

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-brand i { font-size: 1.5rem; color: var(--primary); }
.sidebar-brand:hover { color: var(--primary); }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-user img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.sidebar-user strong { display: block; font-size: 13px; }
.sidebar-user small { font-size: 11px; color: var(--gray-400); }

.sidebar-nav { padding: 10px 0; }

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-divider {
    padding: 8px 20px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gray-500);
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--gray-400);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-size: 14px;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.nav-link.active {
    color: #fff;
    background: rgba(37,99,235,0.15);
    border-left-color: var(--primary);
}

.nav-link i { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-link .badge { font-size: 10px; padding: 3px 6px; }

/* Submenu */
.nav-parent.active > .nav-link {
    color: #fff;
    background: rgba(255,255,255,0.05);
}
.nav-parent.active > .nav-link .sub-arrow {
    transform: rotate(180deg);
}
.sub-arrow {
    transition: transform 0.3s ease;
    font-size: 12px !important;
    width: auto !important;
}
.nav-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.nav-submenu.show {
    max-height: 300px;
}
.nav-submenu .nav-link {
    padding: 8px 20px 8px 50px;
    font-size: 13px;
    border-left: none;
}
.nav-submenu .nav-link i {
    font-size: 0.9rem;
    width: 16px;
}
.nav-submenu .nav-link.active {
    border-left: none;
    border-left: 3px solid var(--primary);
}
.sidebar.collapsed .nav-submenu,
.sidebar.collapsed .sub-arrow {
    display: none;
}

/* Main Content */
#main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

.content-wrapper {
    background: var(--gray-100);
    min-height: calc(100vh - var(--header-height));
}

/* Navbar */
.navbar { height: var(--header-height); }

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    padding: 15px 20px;
    font-weight: 600;
}

/* Stat Cards */
.stat-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.stat-info span {
    font-size: 12px;
    color: var(--gray-500);
    display: block;
}

.stat-card.blue .stat-icon { background: #dbeafe; color: #2563EB; }
.stat-card.blue h3 { color: #2563EB; }

.stat-card.warning .stat-icon { background: #fef3c7; color: #ca8a04; }
.stat-card.warning h3 { color: #ca8a04; }

.stat-card.success .stat-icon { background: #dcfce7; color: #16a34a; }
.stat-card.success h3 { color: #16a34a; }

.stat-card.danger .stat-icon { background: #fee2e2; color: #dc2626; }
.stat-card.danger h3 { color: #dc2626; }

.stat-card.info .stat-icon { background: #cffafe; color: #0891b2; }
.stat-card.info h3 { color: #0891b2; }

.stat-card.orange .stat-icon { background: #ffedd5; color: #ea580c; }
.stat-card.orange h3 { color: #ea580c; }

.stat-card.purple .stat-icon { background: #ede9fe; color: #7c3aed; }
.stat-card.purple h3 { color: #7c3aed; }

.stat-card.teal .stat-icon { background: #ccfbf1; color: #0d9488; }
.stat-card.teal h3 { color: #0d9488; }

.stat-card.dark .stat-icon { background: #e2e8f0; color: #1e293b; }
.stat-card.dark h3 { color: #1e293b; }

/* Dashboard Card */
.dashboard-card { border-radius: var(--border-radius); }
.dashboard-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    padding: 15px 20px;
}
.dashboard-card .card-header h5 { font-size: 14px; font-weight: 600; }

/* Tables */
.table {
    margin-bottom: 0;
    font-size: 14px;
}

.table thead th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
    padding: 12px 15px;
}

.table td { padding: 12px 15px; vertical-align: middle; }

.table-hover tbody tr:hover { background: var(--gray-100); }

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 8px 16px;
    font-size: 14px;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid var(--gray-200);
    padding: 8px 12px;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-label {
    font-weight: 500;
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 4px;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 15px 20px;
}

.modal-header .modal-title { font-weight: 600; font-size: 16px; }

.modal-body { padding: 20px; }

/* Pagination */
.pagination .page-link {
    border: none;
    color: var(--gray-600);
    border-radius: 8px;
    margin: 0 2px;
    padding: 6px 12px;
    font-size: 13px;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    color: #fff;
}

/* SweetAlert2 Custom */
.swal2-popup { border-radius: var(--border-radius) !important; }

/* Loading Spinner */
.spinner-border { vertical-align: middle; }

/* Toast */
.toast-container { z-index: 9999; }

/* Items List */
.item-list .item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

.item-list .item:last-child { border-bottom: none; }

/* Badge */
.badge { font-weight: 500; padding: 4px 8px; border-radius: 6px; font-size: 11px; }

/* Responsive tables - horizontal scroll */
.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 991.98px) {
    .table-responsive > .table {
        min-width: 700px;
        table-layout: auto;
    }
    .table-responsive > .table td,
    .table-responsive > .table th {
        white-space: nowrap;
    }
    .content-wrapper .card-body {
        padding: 10px !important;
    }
    .card-footer {
        flex-direction: column;
        gap: 8px;
    }
    .content-wrapper .table code {
        font-size: 11px;
    }
}

/* Responsive */
/* Sidebar collapse on desktop */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}
.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .sidebar-user div,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-divider,
.sidebar.collapsed .nav-link .badge,
.sidebar.collapsed .sub-arrow,
.sidebar.collapsed .nav-submenu {
    display: none;
}
.sidebar.collapsed .sidebar-user img {
    width: 32px;
    height: 32px;
}
.sidebar.collapsed .sidebar-header {
    padding: 16px 10px;
    justify-content: center;
}
.sidebar.collapsed .sidebar-user {
    padding: 15px 10px;
    justify-content: center;
}
.sidebar.collapsed .nav-link {
    padding: 10px 0;
    justify-content: center;
    border-left: none;
}
.sidebar.collapsed .nav-link.active {
    border-left: none;
    border-left: 3px solid transparent;
}
.sidebar.collapsed .nav-link i {
    font-size: 1.3rem;
    width: auto;
}
#main-content.collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    /* Reset collapsed on mobile */
    .sidebar.collapsed {
        width: var(--sidebar-width);
    }
    .sidebar.collapsed .sidebar-brand span,
    .sidebar.collapsed .sidebar-user div,
    .sidebar.collapsed .nav-link span,
    .sidebar.collapsed .nav-divider,
    .sidebar.collapsed .nav-link .badge {
        display: revert;
    }
    .sidebar.collapsed .sidebar-user img { width: 36px; height: 36px; }
    .sidebar.collapsed .sidebar-header { padding: 16px 20px; justify-content: space-between; }
    .sidebar.collapsed .sidebar-user { padding: 15px 20px; justify-content: flex-start; }
    .sidebar.collapsed .nav-link { padding: 10px 20px; justify-content: flex-start; }
    #main-content.collapsed {
        margin-left: 0;
    }
    #main-content {
        margin-left: 0;
    }
    #sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1035;
    }
    #sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 576px) {
    .stat-card { padding: 15px; }
    .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
    .stat-info h3 { font-size: 1.2rem; }
    .stat-info span { font-size: 11px; }
    .content-wrapper { padding: 12px !important; }
    .table { font-size: 12px; }
    .table td, .table th { padding: 8px 10px; }
    .card-body { padding: 15px; }
}

/* Print */
@media print {
    .sidebar, .navbar, .btn, form, .no-print { display: none !important; }
    #main-content { margin-left: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* Label Barcode Print */
.label-print {
    width: 2.25in;
    height: 1.25in;
    padding: 8px;
    border: 1px dashed #ccc;
    display: inline-block;
    margin: 4px;
    text-align: center;
    vertical-align: top;
    page-break-inside: avoid;
}

.label-print img { max-height: 50px; }
.label-print .label-text { font-size: 11px; font-weight: 600; margin-top: 2px; }
.label-print .label-code { font-size: 10px; color: #666; }

/* Calendar */
.table-bordered td { cursor: default; }
.table-bordered td.table-success { background: #dcfce7 !important; }
.table-bordered td.table-danger { background: #fee2e2 !important; }
.table-bordered td.table-warning { background: #fef3c7 !important; }
