:root {
    --bg: #F8F9FB;
    --bg-darker: #FFFFFF;
    --sidebar-bg: #FFFFFF;
    --card-bg: #FFFFFF;
    --glass-border: #E2E8F0;
    --accent: #020617; /* Slate 950 / Black */
    --accent-glow: rgba(2, 6, 23, 0.05);
    --text: #0F172A; /* Slate 900 */
    --text-muted: #64748B; /* Slate 500 */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --r: 8px;
    --t: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--glass-border);
    height: 100vh;
    position: fixed;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2.5rem;
    padding: 0 1rem;
    text-decoration: none;
    color: var(--text);
}

.logo-icon {
    width: 32px;
    height: 32px;
    fill: var(--accent);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-menu {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-category {
    font-size: 0.65rem;
    font-weight: 800;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1.5rem 1rem 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: var(--r);
    transition: var(--t);
    font-weight: 500;
}

.nav-link:hover, .nav-link.active {
    background: #F1F5F9;
    color: #020617;
}

.nav-link.active {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    font-weight: 600;
}

.nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2.5rem;
    max-width: 1400px;
    width: 100%;
}

header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.grad {
    color: #020617;
    font-weight: 800;
}

/* Glass Cards */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r);
    padding: 1.5rem;
    transition: var(--t);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.02);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.08);
}

/* Stat Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Table */
.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

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

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

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

/* Status Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-active { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-idle { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-maintenance { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* Buttons */
.btn {
    padding: 0.7rem 1.4rem;
    border-radius: var(--r);
    border: 1px solid var(--glass-border);
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    transition: var(--t);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    background: var(--accent);
    color: white;
}

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

.btn-primary:hover {
    box-shadow: 0 0 15px var(--accent-glow);
    filter: brightness(1.1);
}

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

.reveal {
    animation: fadeIn 0.6s ease forwards;
}

/* Responsive Mobile Optimization */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
        box-shadow: 20px 0 50px rgba(0,0,0,0.1);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
        padding-top: 5rem;
    }
    .mobile-header {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--glass-border);
        z-index: 11000; /* Increased to be above modals */
        padding: 0 1.5rem;
        align-items: center;
        justify-content: space-between;
    }
}

@media (max-width: 600px) {
    :root {
        --r: 6px;
    }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        height: auto;
    }
    
    .glass-card {
        padding: 1rem;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    header .btn {
        width: 100%;
        justify-content: center;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        backdrop-filter: blur(4px);
        z-index: 950;
    }
    .sidebar-overlay.active {
        display: block;
    }
}

/* Mobile Quick-Nav Bar */
.mobile-tab-nav {
    display: none;
    position: fixed;
    top: 56px; /* Adjusted to match mobile header height */
    left: 0;
    right: 0;
    height: 42px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 10999; /* Just below header but above content/modal */
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 0 1rem;
    gap: 0;
    align-items: center;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mobile-tab-nav::-webkit-scrollbar {
    display: none;
}

.mobile-tab-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748B;
    font-size: 0.72rem; /* Smaller font as requested */
    font-weight: 600;
    text-decoration: none;
    height: 100%;
    border-bottom: 2px solid transparent;
    transition: var(--t);
    padding: 0 12px;
    flex-shrink: 0;
}

.mobile-tab-link.active {
    color: #020617;
    border-bottom: 2px solid #020617;
}

@media (max-width: 1024px) {
    .mobile-tab-nav {
        display: flex;
    }
    .main-content {
        padding-top: 6.5rem !important; /* Adjusted for smaller navbar */
    }
}

.sidebar-overlay { display: none; }
