/* assets/style.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #0a0f1d;
    --sidebar-bg: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --primary: #6366f1; /* Indigo */
    --primary-glow: rgba(99, 102, 241, 0.3);
    --secondary: #10b981; /* Emerald */
    --accent: #f43f5e; /* Rose */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-bright: #ffffff;
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.03);
    --input-bg: rgba(255, 255, 255, 0.05);
    --modal-bg: #0a0f1d;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);
    
    /* Semantic Status Variables */
    --status-active-bg: var(--success-bg);
    --status-active-text: var(--success);
    --status-inactive-bg: rgba(148, 163, 184, 0.1);
    --status-inactive-text: #94a3b8;
    
    --table-hover: rgba(255, 255, 255, 0.02);
    --hover-bg: rgba(255, 255, 255, 0.08);
    --text-dim: #64748b;
    --overlay-bg: rgba(0, 0, 0, 0.7);
}

.light-mode {
    color-scheme: light;
    --bg-color: #ffffff;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --primary: #4f46e5;
    --primary-glow: rgba(79, 70, 229, 0.2);
    --secondary: #059669;
    --accent: #e11d48;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-bright: #000000;
    --border: rgba(0, 0, 0, 0.1);
    --glass: rgba(255, 255, 255, 0.95);
    --input-bg: #ffffff;
    --modal-bg: #ffffff;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info-bg: rgba(59, 130, 246, 0.15);

    /* Semantic Status Overrides */
    --status-active-bg: rgba(16, 185, 129, 0.12);
    --status-active-text: #059669;
    --status-inactive-bg: rgba(100, 116, 139, 0.12);
    --status-inactive-text: #475569;

    --table-hover: rgba(0, 0, 0, 0.02);
    --hover-bg: rgba(0, 0, 0, 0.05);
    --text-dim: #475569;
    --overlay-bg: rgba(255, 255, 255, 0.7);
}

.light-mode .bg-gradient {
    display: none;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 16px;
}

/* Background Gradients */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background: var(--sidebar-bg); /* Solid background for sidebar */
    border-right: 1px solid var(--border);
    transition: all 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
}

.sidebar a {
    color: inherit;
    text-decoration: none !important;
}

/* Sidebar Navigation */
.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nav-item {
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    color: var(--text-main) !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 1rem;
    font-weight: 400;
}

.nav-item *, .nav-item .nav-label * {
    color: inherit !important;
}

.nav-item i:first-child, .nav-item .nav-label i:first-child {
    width: 24px; /* Increased slightly for better visual weight */
    text-align: center;
    font-size: 1.1rem;
    color: inherit;
}

.nav-item:hover {
    background: var(--glass);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.nav-item.has-submenu {
    justify-content: space-between;
}

.nav-item .nav-label {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    color: inherit !important;
    font-size: inherit;
    font-weight: inherit;
    flex: 1; /* Take up remaining space so chevron stays at the right */
}

.nav-item.has-submenu .chevron {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.nav-item.has-submenu.open .chevron {
    transform: rotate(90deg);
}

/* Sub-menu Styles */
.submenu {
    list-style: none;
    margin: 0.5rem 0 0.5rem 2.5rem;
    padding: 0;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    border-left: 1px solid var(--border);
}

.submenu.open {
    display: flex;
}

.submenu-item {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none !important;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.submenu-item i {
    font-size: 0.8rem;
    opacity: 0.7;
}

.submenu-item:hover, .submenu-item.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.submenu-item.active {
    font-weight: 600;
}



.sidebar .logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}



/* Main Content */
main {
    margin-left: 260px;
    padding: 2rem 3rem;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Mobile Toggle Header */
.mobile-header {
    display: none;
    padding: 1rem;
    background: var(--sidebar-bg);
    opacity: 0.95;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 999;
    justify-content: space-between;
    align-items: center;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

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

/* Data Table */
.table-container {
    width: 100%;
    overflow-x: auto;
    padding: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

tr:last-child td {
    border-bottom: none;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { opacity: 0.9; transform: scale(1.02); }

.btn-secondary { background: var(--secondary); color: white; }
.btn-accent { background: var(--accent); color: white; }
.btn.glass { color: var(--text-main) !important; border: 1px solid var(--border); }
.btn.glass:hover { background: var(--glass); border-color: var(--primary); }

/* Status Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-pending { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); }
.badge-locked { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.badge-completed { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.badge-info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info); }
.badge-active { background: var(--status-active-bg); color: var(--status-active-text); border: 1px solid var(--status-active-bg); }
.badge-inactive { background: var(--status-inactive-bg); color: var(--status-inactive-text); border: 1px solid var(--status-inactive-bg); }

/* Form Styles */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--primary);
    background: var(--hover-bg);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Ensure options are readable (some browsers use light background for options) */
select option {
    color: var(--text-main);
    background-color: var(--modal-bg);
}

/* Horizontal Form Row */
.form-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.form-row label {
    flex: 0 0 130px; /* Label width */
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0;
}

.form-row .input-wrapper {
    flex: 1;
}

.form-row input, 
.form-row select, 
.form-row textarea {
    width: 100%;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-bottom: 2rem;
}

.page-item, .page-link {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-item:hover, .page-link:hover {
    background: var(--hover-bg);
    border-color: var(--border);
    color: var(--primary);
}

.page-item.active, .page-link.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 15px var(--primary-glow);
    color: white;
}

.page-item.disabled, .page-link.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Filter Bar */
.filter-bar {
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.filter-group input, 
.filter-group select {
    padding: 0.6rem 1rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    min-width: 150px;
}

.filter-group input:focus, 
.filter-group select:focus {
    border-color: var(--primary);
    outline: none;
}

/* Multi-select Dropdown Simulation */
.multi-select-container {
    position: relative;
    display: inline-block;
}

.multi-select-display {
    padding: 0.6rem 1rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    cursor: pointer;
    min-width: 200px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: var(--modal-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 0.5rem;
    z-index: 100;
    display: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    padding: 0.5rem;
}

.multi-select-dropdown.show {
    display: block;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.multi-select-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.multi-select-option input[type="checkbox"] {
    min-width: unset;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

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

.animate-fade {
    animation: fadeIn 0.5s ease forwards;
}

/* Responsive Queries */
@media (max-width: 1024px) {
    main {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        left: -260px !important;
        transform: none !important;
    }
    
    .sidebar.active {
        left: 0 !important;
    }
    
    main {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 1rem !important;
    }
    
    .mobile-header {
        display: flex !important;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        margin: 0 -1rem;
        padding: 0 1rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
/* Alert Styles */
.alert {
    padding: 1rem 1.2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 1px solid transparent;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success);
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger);
}

/* Maintenance & Grid Layouts */
.maintenance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.maintenance-card { background: var(--glass); border: 1px solid var(--border); border-radius: 20px; padding: 1.5rem; display: flex; flex-direction: column; transition: transform 0.3s ease; }
.maintenance-card:hover { transform: translateY(-5px); }
.icon-box { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 1rem; }
.btn-maint { padding: 0.8rem; border-radius: 10px; cursor: pointer; font-weight: 600; margin-top: 0.5rem; border: 1px solid transparent; text-align: center; transition: 0.3s; width: 100%; }
.btn-danger-maint { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.btn-danger-maint:hover { background: var(--danger); color: white; }
.maint-input { background: var(--input-bg); border: 1px solid var(--border); color: var(--text-main); padding: 0.7rem; border-radius: 8px; width: 100%; margin-bottom: 0.8rem; outline: none; }

/* Generic Modals & Overlays */
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--overlay-bg); backdrop-filter: blur(8px); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.modal-card { background: var(--modal-bg); border: 1px solid var(--border); border-radius: 24px; padding: 2rem; width: 95%; max-width: 600px; max-height: 90vh; overflow-y: auto; color: var(--text-main); position: relative; }
