:root { --primary: #2c3e50; --sec: #34495e; --accent: #3498db; --bg: #f4f6f9; }
body { font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; margin: 0; background: var(--bg); display: flex; color: #333; -webkit-font-smoothing: antialiased; }

/* Admin Nav & Layout */
nav { width: 240px; background: var(--primary); color: #fff; height: 100vh; position: fixed; overflow-y: auto; z-index: 100; }
nav h2 { text-align: center; padding: 25px 0; border-bottom: 1px solid rgba(255,255,255,0.1); margin: 0; font-size: 1.4rem; letter-spacing: 1px; font-weight: 700; }
nav a { display: block; color: #bdc3c7; padding: 15px 25px; text-decoration: none; border-left: 4px solid transparent; transition: all 0.3s; font-size: 14px; }
nav a:hover, nav a.active { background: var(--sec); color: #fff; border-left-color: var(--accent); }
main { margin-left: 240px; padding: 30px; width: calc(100% - 240px); transition: margin 0.3s, width 0.3s; }
h1, h2, h3, h4 { margin-top: 0; }
.card { background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.03); margin-bottom: 30px; border: 1px solid #f0f0f0; }

/* Components */
.chart-container { position: relative; height: 350px; width: 100%; }
table { width: 100%; border-collapse: collapse; margin-top: 15px; font-size: 14px; }
th, td { padding: 12px 15px; border-bottom: 1px solid #eee; text-align: left; vertical-align: middle; }
th { background: #f8f9fa; font-weight: 600; color: var(--sec); border-bottom: 2px solid #e9ecef; }
tr:hover { background-color: #f1f1f1; }
.btn { padding: 9px 18px; border: none; border-radius: 6px; cursor: pointer; text-decoration: none; color: white; display: inline-block; font-size: 13px; margin-right: 5px; font-weight: 600; transition: background 0.2s; }
.btn-blue { background: var(--accent); } .btn-blue:hover { background: #2980b9; }
.btn-green { background: #27ae60; } .btn-green:hover { background: #219150; }
.btn-purple { background: #9b59b6; } .btn-purple:hover { background: #8e44ad; }
.btn-red { background: #e74c3c; } .btn-red:hover { background: #c0392b; }
.btn-orange { background: #f39c12; } .btn-orange:hover { background: #d35400; }
.btn-grey { background: #95a5a6; } .btn-grey:hover { background: #7f8c8d; }
.badge { padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: bold; color: white; display: inline-block; min-width: 80px; text-align: center; }
.bg-lunas { background: #27ae60; } .bg-belum { background: #e74c3c; } .bg-telat { background: #e74c3c; } .bg-aktif { background: #3498db; } .bg-selesai { background: #95a5a6; }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; margin-bottom: 15px; font-family: inherit; font-size: 14px; transition: border 0.3s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
.row { display: flex; gap: 25px; } .col { flex: 1; }
.img-bukti { max-width: 200px; border: 1px solid #ddd; padding: 5px; border-radius: 4px; margin-top: 10px; }
.filter-box { display: flex; gap: 10px; margin-bottom: 20px; background: #fff; padding: 20px; border-radius: 8px; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.02); border: 1px solid #eee; }
.filter-box input, .filter-box select { margin-bottom: 0; flex: 1; }
.filter-box button { height: 42px; }

/* --- DASHBOARD STATISTIK (REVISI) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-box {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-left: 6px solid var(--accent);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Typography Stats */
.stat-box h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 15px 0;
}

.stat-box h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #2c3e50;
    margin: 0;
    line-height: 1.1;
}

.stat-box small {
    display: block;
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    opacity: 0.8;
}

/* Color Variants for Stats */
.stat-green { border-left-color: #27ae60; }
.stat-green h1 { color: #27ae60; }
.stat-green small { color: #27ae60; }

.stat-orange { border-left-color: #f39c12; }
.stat-orange h1 { color: #f39c12; }
.stat-orange small { color: #f39c12; }

.stat-purple { border-left-color: #9b59b6; }
.stat-purple h1 { color: #9b59b6; }
.stat-purple small { color: #9b59b6; }

.stat-red { border-left-color: #e74c3c; }

/* Landing Page Cards */
.landing-header { background: #2c3e50; color: white; padding: 60px 20px; text-align: center; margin-bottom: 40px; }
.landing-header h1 { font-size: 3rem; margin-bottom: 10px; letter-spacing: 1px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px 40px; }
.grid-barang { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.item-card { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); transition: transform 0.3s, box-shadow 0.3s; border: 1px solid #f0f0f0; display: flex; flex-direction: column; }
.item-card:hover { transform: translateY(-8px); box-shadow: 0 15px 40px rgba(0,0,0,0.1); }
.item-img-box { width: 100%; height: 220px; background: #f9f9f9; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; }
.item-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.item-card:hover .item-img { transform: scale(1.05); }
.no-img { color: #ccc; font-size: 3rem; }
.item-body { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.item-title { font-size: 1.3rem; font-weight: 700; color: #2c3e50; margin-bottom: 10px; }
.item-desc { font-size: 0.95rem; color: #666; margin-bottom: 20px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item-meta { margin-top: auto; border-top: 1px solid #eee; padding-top: 15px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.price-tag { color: #e74c3c; font-weight: bold; font-size: 1.2rem; }
.stock-badge { background: #ecf0f1; color: #7f8c8d; padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.btn-request { background: #25D366; color: white; text-decoration: none; padding: 12px; border-radius: 8px; text-align: center; font-weight: bold; display: block; box-shadow: 0 4px 6px rgba(37, 211, 102, 0.2); transition: background 0.2s; }
.btn-request:hover { background: #128C7E; }
.login-btn { position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,0.2); border: 1px solid white; color: white; padding: 8px 20px; border-radius: 30px; text-decoration: none; font-size: 14px; backdrop-filter: blur(5px); }
.login-btn:hover { background: white; color: #2c3e50; }

/* KTP Gallery */
.ktp-gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.ktp-item { position: relative; width: 150px; height: 100px; border-radius: 8px; overflow: hidden; border: 1px solid #ddd; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.ktp-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.ktp-item:hover .ktp-img { transform: scale(1.1); }
.btn-del-img { position: absolute; top: 5px; right: 5px; background: rgba(231, 76, 60, 0.9); color: white; border: none; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; font-size: 12px; line-height: 20px; text-align: center; text-decoration: none; }

/* --- INVOICE PROFESSIONAL STYLE (LETTER SIZE) --- */
.invoice-paper {
    max-width: 800px; /* Default for screen */
    margin: 0 auto;
    background: white;
    padding: 50px;
    box-shadow: 0 0 25px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    color: #444;
    line-height: 1.5;
}

/* Watermark Besar & Transparan */
.watermark-large {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-size: 8rem; /* Adjusted for Letter */
    font-weight: 900;
    text-transform: uppercase;
    border: 8px solid currentColor;
    padding: 10px 30px;
    border-radius: 15px;
    opacity: 0.12; 
    pointer-events: none; 
    z-index: 0;
    white-space: nowrap;
    user-select: none;
}
.wm-lunas { color: #27ae60; }
.wm-belum { color: #e74c3c; }
.wm-sj { color: #7f8c8d; border-color: #7f8c8d; font-size: 7rem; }

.inv-top { display: flex; justify-content: space-between; border-bottom: 3px solid #2c3e50; padding-bottom: 20px; margin-bottom: 25px; position: relative; z-index: 1; }
.inv-brand h1 { font-size: 26px; color: #2c3e50; margin: 0; text-transform: uppercase; letter-spacing: 1px; font-weight: 800; }
.inv-brand p { margin: 5px 0 0; font-size: 13px; color: #7f8c8d; }
.inv-meta { text-align: right; }
.inv-meta h2 { font-size: 36px; color: #bdc3c7; margin: 0 0 5px; font-weight: 300; }
.inv-meta p { margin: 0; font-size: 14px; font-weight: 500; }

.inv-address { display: flex; justify-content: space-between; margin-bottom: 35px; position: relative; z-index: 1; }
.inv-to, .inv-from { width: 48%; }
.inv-to h4, .inv-from h4 { font-size: 11px; color: #95a5a6; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; border-bottom: 1px solid #eee; padding-bottom: 5px; font-weight: 700; }
.inv-to p, .inv-from p { margin: 2px 0; font-weight: 600; color: #2c3e50; font-size: 14px; }

.inv-items { width: 100%; border-collapse: collapse; margin-bottom: 30px; position: relative; z-index: 1; }
.inv-items th { background: #2c3e50; color: white; padding: 12px 15px; text-transform: uppercase; font-size: 11px; letter-spacing: 1px; }
.inv-items td { padding: 12px 15px; border-bottom: 1px solid #eee; font-size: 13px; }
.inv-items tr:last-child td { border-bottom: 3px solid #2c3e50; }
.text-right { text-align: right; }
.text-center { text-align: center; }

.inv-total { display: flex; justify-content: flex-end; position: relative; z-index: 1; margin-top: 15px; }
.inv-total table { width: 45%; border-collapse: collapse; }
.inv-total td { padding: 8px 0; font-size: 13px; border: none; }
.inv-total .grand-total { font-size: 20px; font-weight: 800; color: #2c3e50; border-top: 2px solid #eee; padding-top: 15px; margin-top: 5px; }

.inv-footer { margin-top: 50px; padding-top: 20px; border-top: 1px solid #eee; font-size: 12px; color: #95a5a6; text-align: center; position: relative; z-index: 1; }
.public-notice { background: #f39c12; color: white; text-align: center; padding: 10px; margin-bottom: 20px; border-radius: 4px; font-size: 13px; font-weight: 600; }
.btn-edit-status { background: none; border: none; cursor: pointer; color: #3498db; font-size: 0.9em; text-decoration: underline; margin-left: 5px; }

/* SIGNATURE BOX (Khusus Surat Jalan) */
.signature-box { display: flex; justify-content: space-between; margin-top: 60px; text-align: center; }
.sig-block { width: 30%; }
.sig-line { margin-top: 70px; border-top: 1px solid #000; font-weight: bold; padding-top: 5px; font-size: 13px; }

/* === SETTINGAN PRINT LETTER === */
@media print {
    @page { 
        size: letter; /* Kertas Letter (8.5in x 11in) */
        margin: 0.3in; /* Margin minimal */
    }
    body { 
        margin: 0; 
        padding: 0; 
        background: white; 
        -webkit-print-color-adjust: exact; 
        print-color-adjust: exact;
    }
    nav, .no-print, .btn, .filter-box { display: none !important; }
    main { margin: 0; padding: 0; width: 100%; max-width: 100%; }
    .card { box-shadow: none; border: none; padding: 0; margin: 0; }
    
    .invoice-paper { 
        box-shadow: none; 
        margin: 0; 
        width: 100%; 
        max-width: 100%; 
        padding: 0; 
        border: none;
    }
    
    .watermark-large {
        opacity: 0.1 !important; 
        border-width: 5px; 
    }
    
    table { page-break-inside: auto; }
    tr { page-break-inside: avoid; page-break-after: auto; }
}

.select2-container .select2-selection--single { height: 38px !important; border: 1px solid #ddd !important; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 38px !important; }