
    :root {
        /* Premium Blue Palette */
        --nav: #0b1f3a;          /* Deep Navy */
        --accent: #2563eb;      /* Royal Blue */
        --accent-soft: #3b82f6;
        --bg: #f4f7fb;          /* Clean light background */
        --border: #dbe3f0;
        --text-main: #0f172a;
        --text-muted: #64748b;
    }

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        font-family: 'Segoe UI', sans-serif;
    }

    body {
        background: var(--bg);
        color: var(--text-main);
    }

    /* Layouts */
    /* Sidebar Container */
.sidebar {
    width: 260px; /* Sedikit lebih lebar agar lega */
    background: linear-gradient(180deg, #0f172a, #1e293b); /* Warna slate gelap yang modern */
    height: 100vh;
    position: fixed;
    color: #f8fafc;
    
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0,0,0,0.2);
    font-family: 'Inter', sans-serif; /* Pastikan font bersih */
}

/* Header & Logo */
.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    width: 220px; /* Sesuaikan ukuran logo */
    height: auto;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.2));
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
}

    .main-admin {
        margin-left: 240px;
        padding: 25px;
        
    }

    .driver-app {
        max-width: 500px;
        margin: 0 auto;
        min-height: 100vh;
        background: #ffffff;
        
        padding-bottom: 80px;
        box-shadow: 0 0 30px rgba(15,23,42,0.08);
    }

    /* Components */
    .card {
        background: white;
        border-radius: 12px;
        padding: 20px;
        border: 1px solid var(--border);
        margin-bottom: 20px;
        box-shadow: 0 6px 18px rgba(37,99,235,0.06);
    }

    .btn {
        padding: 8px 14px;
        border-radius: 8px;
        border: none;
        cursor: pointer;
        font-size: 13px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        transition: all 0.2s ease;
    }

    .btn-primary {
        background: linear-gradient(135deg, #2563eb, #3b82f6);
        color: white;
    }

    .btn-primary:hover {
        box-shadow: 0 4px 12px rgba(37,99,235,0.35);
    }

    .btn-success { background: #16a34a; color: white; }
    .btn-danger { background: #dc2626; color: white; }

    .btn-outline {
        background: white;
        border: 1px solid var(--accent);
        color: var(--accent);
    }

    /* Dashboard Cards */
    .dash-card {
        cursor: pointer;
        transition: transform 0.25s ease, box-shadow 0.25s ease;
    }

    .dash-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 25px rgba(37,99,235,0.18);
        border-color: var(--accent);
    }

   /* Container Detail Pekerjaan */
.job-detail {
    background: #ffffff;
    padding: 20px;
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #f1f5f9;
}

/* Info Section (Customer & Alamat) */
.info-box {
    margin-bottom: 15px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
}

.info-label {
    display: flex;
    align-items: center;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 700;
}

.info-value {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.5;
    margin: 0;
}

/* List Item Barang */
.item-list {
    list-style: none;
    margin: 20px 0;
    padding: 0;
}

.item-card {
    padding: 12px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.item-card:last-child {
    border-bottom: none;
}

.item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #0f172a;
    font-size: 14px;
}

.item-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
    display: block;
}

.qty-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
}

/* Button Premium */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.btn-premium {
    height: 48px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.btn-premium:active {
    transform: scale(0.96);
}

    /* Tables & Inputs */
    table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
    }

    th {
        background: #eef4ff;
        padding: 10px;
        text-align: left;
        border-bottom: 2px solid var(--border);
        color: #1e3a8a;
    }

    td {
        padding: 10px;
        border-bottom: 1px solid #e5edfa;
    }

    input, select, textarea {
        width: 100%;
        padding: 10px;
        border: 1px solid var(--border);
        border-radius: 8px;
        margin: 5px 0 15px 0;
        transition: border 0.2s ease, box-shadow 0.2s ease;
    }

    input:focus, select:focus, textarea:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
    }

    /* Filter Bar */
    .filter-bar {
        display: flex;
        gap: 10px;
        margin-bottom: 20px;
        flex-wrap: wrap;
        background: white;
        padding: 15px;
        border-radius: 12px;
        border: 1px solid var(--border);
        box-shadow: 0 6px 14px rgba(15,23,42,0.05);
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 12px;
        border: 1px solid var(--border);
        background: #f8fbff;
        border-radius: 6px;
        text-decoration: none;
        color: #1e293b;
    }

    .filter-btn.active {
        background: var(--accent);
        color: white;
        border-color: var(--accent);
    }

    /* Sidebar Links */
    .sidebar-link {
        padding: 15px 20px;
        color: #c7d2fe;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 14px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .sidebar-link:hover,
    .sidebar-link.active {
        background: rgba(59,130,246,0.18);
        color: white;
        border-left: 4px solid var(--accent);
    }

   /* Modal Wrapper */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 15px;
    backdrop-filter: blur(4px);
}

/* Modal Box - KUNCI PERBAIKAN DI SINI */
.modal-box,
.modal-content {
    background: white;
    width: 100%;
    /* Ubah max-width menjadi lebih lebar agar muat 3 kolom */
    max-width: 800px; 
    /* Tambahkan max-height agar tidak terpotong di layar kecil */
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px; /* Dikurangi sedikit agar lebih padat */
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
    position: relative;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #1e3a8a;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
    font-size: 1.25rem;
}

/* Label dibuat lebih padat */
.modal-content label {
    display: block;
    margin-top: 8px; /* Dikurangi dari 12px ke 8px agar lebih rapat */
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

/* Input & Select Global Style dalam Modal */
.modal-content input, 
.modal-content select, 
.modal-content textarea {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box; /* Sangat penting agar padding tidak merusak lebar */
}

.modal-content input[readonly] {
    background-color: #f1f5f9;
    color: #94a3b8;
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Button Styles */
.btn-save {
    flex: 2;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.btn-cancel {
    flex: 1;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}

    /* Driver Specific */
    .driver-header {
        background: linear-gradient(135deg, #0b1f3a, #1e40af);
        color: white;
        padding: 25px 20px;
        border-radius: 0 0 28px 28px;
        margin-bottom: 20px;
        box-shadow: 0 8px 20px rgba(15,23,42,0.25);
    }
.input[readonly] {
    cursor: not-allowed;
    border-color: #e2e8f0;
    color: #64748b;
}
    .bottom-nav {
        position: fixed;
        bottom: 0;
        width: 100%;
        max-width: 500px;
        background: white;
        display: flex;
        justify-content: space-around;
        padding: 15px;
        border-top: 1px solid var(--border);
        z-index: 99;
        box-shadow: 0 -6px 20px rgba(15,23,42,0.08);
    }
    
    .driver-app{
    background:#f8fafc;
    min-height:100vh;
    font-family: 'Inter', system-ui, sans-serif;
}

.driver-header{
    background:linear-gradient(135deg,#1e293b,#0f172a);
    color:#fff;
    padding:16px;
    border-radius:0 0 16px 16px;
    box-shadow:0 8px 24px rgba(15,23,42,.25);
}

.job-card{
    background:#fff;
    border-radius:14px;
    margin-bottom:14px;
    border:1px solid #e5e7eb;
    overflow:hidden;
    box-shadow:0 6px 18px rgba(15,23,42,.06);
}

.job-head{
    padding:14px 16px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    cursor:pointer;
}

.job-head:hover{
    background:#f1f5f9;
}

.job-detail{
    padding:16px;
    border-top:1px solid #e5e7eb;
    background:#fafafa;
}

.btn{
    border-radius:10px;
    padding:10px;
    font-weight:600;
    font-size:13px;
    border:none;
    cursor:pointer;
}

.btn-primary{
    background:linear-gradient(135deg,#4f46e5,#6366f1);
    color:#fff;
}

.btn-success{
    background:linear-gradient(135deg,#16a34a,#22c55e);
    color:#fff;
}

.btn-danger{
    background:linear-gradient(135deg,#dc2626,#ef4444);
    color:#fff;
}

.btn:hover{
    opacity:.9;
}

.status-pending{
    background:#fef3c7;
    color:#92400e;
}

.status-aktif{
    background:#dcfce7;
    color:#166534;
}

/* Tambahan CSS agar layout grid konsisten */
    .dashboard-grid {
        display: grid; 
        /* Memaksa 5 kolom pada layar desktop/lebar */
        grid-template-columns: repeat(5, 1fr); 
        gap: 12px; 
        margin-bottom: 25px;
    }

    /* Responsif: Jika layar kekecilan (Tablet/HP), otomatis jadi 2 atau 1 kolom */
    @media (max-width: 992px) {
        .dashboard-grid { grid-template-columns: repeat(3, 1fr); }
    }
    @media (max-width: 600px) {
        .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    }
    
    .dash-card {
        cursor: pointer;
        transition: transform 0.2s, box-shadow 0.2s;
        min-height: 100px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 15px !important;
    }
    
    .dash-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .dash-card h5 { margin: 0 0 8px 0; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
    .dash-card h2 { margin: 0; font-size: 1.8rem; }
    
    
/* Sembunyikan dari layar monitor */
/* Sembunyikan area cetak saat di layar monitor agar tidak mengganggu UI */

#printArea { display: none; }

@media print {
    /* 1. Kunci ukuran dasar */
    html, body {
        width: 210mm; /* Lebar fisik A4 */
        height: 297mm; /* Tinggi fisik A4 */
        margin: 0 !important;
        padding: 0 !important;
        background: #fff;
        overflow: visible !important;
    }

    /* 2. Sembunyikan elemen non-cetak */
    body > *:not(#printArea) { 
        display: none !important; 
    }

    /* 3. Container Utama */
    #printArea {
        display: block !important;
        width: 210mm !important; /* Pas dengan lebar kertas */
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 4. Area Konten Per Halaman */
    .print-page {
        display: block !important;
        width: 210mm !important;
        padding: 10mm 15mm !important; /* Margin dalam kertas: 10mm atas/bawah, 15mm kiri/kanan */
        box-sizing: border-box !important; /* PENTING: Padding tidak menambah lebar total */
        page-break-after: always !important;
        overflow: visible !important;
    }

    .print-page:last-child {
        page-break-after: auto !important;
    }

    /* 5. Tabel: Kunci agar tidak melebihi 100% dari parent (210mm - padding) */
    .table-print {
        width: 100% !important; 
        max-width: 100% !important;
        border-collapse: collapse !important;
        table-layout: fixed !important; /* WAJIB: Kunci kolom agar tidak mendorong lebar tabel */
        margin-top: 10px;
        word-wrap: break-word !important;
    }

        /* 5. Tabel: Kunci agar tidak melebihi 100% dari parent (210mm - padding) */
.table-print {
    width: 100% !important; 
    max-width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important; /* WAJIB: Kunci kolom agar tidak mendorong lebar tabel */
    margin-top: 10px;
    word-wrap: break-word !important;
}

/* Header & isi tabel */
.table-print th,
.table-print td {
    border: 1px solid #000 !important;
    padding: 5px 3px !important;
    font-size: 9pt !important;
    vertical-align: middle !important; /* dari top → middle agar rapi */
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    text-align: center !important; /* 🔑 CENTER JUDUL & ISI */
}

/* Mencegah baris hilang/terpotong di tengah halaman */
.table-print tr {
    page-break-inside: avoid !important;
}

/* Atur lebar kolom secara spesifik agar total pas 100% */
.col-no { 
    width: 25px; 
}

.col-do { 
    width: 90px; 
}

.col-item { 
    width: auto; /* Biarkan sisa ruang untuk kolom deskripsi */
}

.col-qty {
    width: 60px !important;   /* ideal untuk angka + satuan */
    text-align: center !important;
}



    /* Mencegah baris hilang/terpotong di tengah halaman */
    .table-print tr {
        page-break-inside: avoid !important;
    }

    /* Atur lebar kolom secara spesifik agar total pas 100% */
    /* Contoh: */
    .col-no { width: 25px; }
    .col-do { width: 90px; }
    .col-item { width: auto; } /* Biarkan sisa ruang untuk kolom deskripsi */

    @page {
        size: A4 portrait;
        margin: 0; /* Margin dikontrol oleh padding .print-page untuk akurasi */
    }
}


/* Style untuk tombol panah download */
.card-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.05); /* Sedikit gelap agar terlihat di background putih */
    border: 1px solid rgba(0,0,0,0.1);
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

/* Hover effect */
.card-action-btn:hover {
    background: #2563eb;
    color: white;
    transform: scale(1.1);
    border-color: #2563eb;
}

/* Pastikan card relative agar tombol bisa di pojok kanan atas */
.dash-card {
    position: relative; 
}

/* Container untuk tombol dan dropdown */
.filter-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 5px;
}

/* Menu Dropdown */
.filter-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 100;
    padding: 10px;
    border-radius: 4px;
    font-weight: normal;
    text-align: left;
}

/* Menampilkan dropdown saat class 'show' aktif */
.filter-content.show {
    display: block;
}

.filter-content select {
    width: 100%;
    padding: 5px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.btn-filter-ok { background: #22c55e; color: white; border: none; padding: 4px 8px; cursor: pointer; border-radius: 3px; font-size: 11px; }
.btn-filter-reset { background: #ef4444; color: white; border: none; padding: 4px 8px; cursor: pointer; border-radius: 3px; font-size: 11px; }

#m_issue_driver {
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.5); 
    z-index: 9999; /* Pastikan di atas segalanya */
    justify-content: center; 
    align-items: center;
}

#salesTable th:first-child, 
#salesTable td:first-child {
    position: sticky;
    left: 0;
    background-color: white; /* Harus ada background agar tidak transparan saat ditumpuk */
    z-index: 2;
    border-right: 2px solid #e2e8f0;
}

