
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-color: #F4F7FE;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --primary: #4318FF;
    --primary-hover: #3311DB;
    --accent: #E31A1A;
    --text-main: #2B3674;
    --text-muted: #A3AED0;
    --border-color: #E2E8F0;
    --success: #05CD99;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    padding: 2.5rem 0 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 14px 17px 40px 4px rgba(112, 144, 176, 0.08);
    z-index: 100;
}

.brand {
    padding: 0 2rem;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.brand i { color: var(--primary); }

.nav-item {
    padding: 1rem 2rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border-right: 4px solid transparent;
}

.nav-item:hover {
    color: var(--primary);
    background-color: #F4F7FE;
    border-right: 4px solid var(--primary);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

header {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(244, 247, 254, 0.5);
    backdrop-filter: blur(10px);
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-main);
    font-weight: 700;
    background: white;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(112, 144, 176, 0.1);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

main {
    padding: 1rem 2rem 3rem 2rem;
    max-width: 1600px;
}

.card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0px 10px 30px rgba(112, 144, 176, 0.15);
    border: none;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}
.filters-sidebar {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
    overflow-y: auto;
    flex: 1;
}
.main-dashboard-content {
    flex: 1;
    min-width: 0;
}

/* Filters */
.filters-sidebar h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}
.filter-group {
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px dashed var(--border-color);
}
.filter-group h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    letter-spacing: 0.5px;
}
.checkbox-list {
    max-height: 150px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-list label {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
}

.checkbox-list input { display: none; }
.custom-chk {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.checkbox-list input:checked + .custom-chk {
    background-color: var(--primary);
    border-color: var(--primary);
}
.checkbox-list input:checked + .custom-chk::after {
    content: "✓";
    color: white;
    font-size: 11px;
}

/* Action bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-wrap {
    display: flex;
    align-items: center;
    background-color: #F4F7FE;
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    flex: 1;
    max-width: 600px;
}

.search-wrap i {
    color: var(--primary);
    margin-right: 0.8rem;
    font-size: 1.1rem;
}

.search-wrap input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    flex: 1;
    outline: none;
}
.search-wrap input::placeholder { color: var(--text-muted); }

.action-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge-count {
    background: #E9EDF7;
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    padding: 0.7rem 1.2rem;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
}

.full-width { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.3rem; }

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary.shadow-glow:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(67, 24, 255, 0.3);
}

.btn-outline {
    background-color: #F4F7FE;
    color: var(--primary);
}
.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}
.text-accent { color: var(--accent); }

/* Table */
.table-container {
    overflow-x: auto;
    padding: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background-color: #F8FAFC; }

.badge-accent {
    background-color: rgba(67, 24, 255, 0.1);
    color: var(--primary);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-weight: 700;
}

.tag-subtle {
    background: #E9EDF7;
    color: var(--text-main);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.eq-brand { color: var(--text-muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.eq-model { font-weight: 800; color: var(--text-main); }
.text-mono { font-family: 'Courier New', monospace; font-weight: 700; color: var(--text-main); background: #F4F7FE; padding: 0.2rem 0.5rem; border-radius: 4px; }
.text-sm { font-size: 0.8rem; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

.service-text {
    color: var(--success);
    font-weight: 600;
}

.slide-up {
    animation: slideUp 0.4s ease forwards;
}

@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ==================== FORMS ==================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.form-group label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-main);
}
.form-group input, .form-group select {
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: #F8FAFC;
    transition: border-color 0.3s;
}
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background-color: white;
}
.form-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ==================== MOBILE RESPONSIVENESS ==================== */
@media screen and (max-width: 900px) {
    body {
        flex-direction: column;
        overflow: auto;
        height: auto;
    }
    .sidebar {
        width: 100%;
        height: auto;
        padding: 1rem 0;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
        z-index: 100;
        position: relative;
    }
    .brand {
        margin-bottom: 0.5rem;
        justify-content: center;
    }
    nav {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        padding: 0 1rem 0.5rem 1rem;
        -webkit-overflow-scrolling: touch;
    }
    .nav-item {
        padding: 0.5rem 1rem;
        border-right: none;
        border-bottom: 3px solid transparent;
        font-size: 0.9rem;
    }
    .nav-item:hover {
        border-right: none;
        border-bottom: 3px solid var(--primary);
        background-color: transparent;
    }
    .dashboard-layout {
        flex-direction: column;
        gap: 0;
    }
    .filters-sidebar {
        border-top: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 250px;
        padding: 1rem;
        margin-top: 0;
    }
    header {
        position: relative;
        padding: 1rem;
        height: auto;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .user-profile { margin: 0 auto; }
    main { padding: 1rem; }
    .action-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }
    .search-wrap { max-width: 100%; }
    .action-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    .form-grid { grid-template-columns: 1fr; }
    table { min-width: 800px; /* Force scroll on small screens */ }
}

/* ==================== PRINT STYLES ==================== */
.print-only { display: none; }

@media print {
    @page {
        size: landscape;
        margin: 1cm;
    }
    
    body {
        background-color: white !important;
        color: black !important;
        height: auto;
        overflow: visible;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .sidebar, header, .no-print {
        display: none !important;
    }
    
    .main-content {
        overflow: visible !important;
        height: auto;
    }
    
    main {
        padding: 0 !important;
        max-width: 100% !important;
    }
    
    .dashboard-layout, .main-dashboard-content {
        display: block !important;
    }
    
    .card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    .print-header {
        text-align: center;
        margin-bottom: 2rem;
        border-bottom: 2px solid #ccc;
        padding-bottom: 1rem;
    }
    
    .print-header h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }
    
    th, td {
        border: 1px solid #ddd !important;
        padding: 8px !important;
        color: black !important;
    }
    
    th {
        background-color: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
    }

    .badge-accent, .tag-subtle, .text-mono {
        background: transparent !important;
        padding: 0 !important;
    }
    
    .slide-up {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
