* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background: #f0f2f5; color: #333; }
[hidden] { display: none !important; }

.header { background: #1e3a8a; color: #fff; padding: 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,.1); flex-wrap: wrap; gap: 10px; }
.header h1 { font-size: 24px; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.header a, .btn-logout { color: #fff; text-decoration: none; background: #ef4444; padding: 8px 15px; border-radius: 5px; font-weight: bold; border: 0; cursor: pointer; font-size: 14px; transition: .3s; }
.header a:hover, .btn-logout:hover { background: #b91c1c; }

.container { padding: 20px; max-width: 1200px; margin: auto; }
.cards { display: flex; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.card { background: #fff; padding: 20px; border-radius: 8px; flex: 1; min-width: 220px; box-shadow: 0 2px 4px rgba(0,0,0,.05); border-left: 5px solid #3b82f6; }
.card.green { border-left-color: #10b981; }
.card.amber { border-left-color: #f59e0b; }
.card h3 { color: #6b7280; font-size: 14px; text-transform: uppercase; margin-bottom: 10px; letter-spacing: .5px; }
.card p { font-size: 32px; font-weight: bold; color: #1f2937; }
.card p .text-muted { font-size: 14px; font-weight: normal; }

/* Panel WhatsApp */
.wa-panel { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,.05); border-left: 5px solid #10b981; margin-bottom: 20px; display: flex; gap: 30px; flex-wrap: wrap; align-items: flex-start; }
.wa-info { flex: 1; min-width: 260px; }
.wa-info h3 { color: #6b7280; font-size: 14px; text-transform: uppercase; margin-bottom: 10px; letter-spacing: .5px; }
.status-text { font-size: 24px; font-weight: bold; }
.status-text.ok { color: #10b981; }
.status-text.bad { color: #ef4444; }
.wa-nomor { margin-top: 8px; font-size: 15px; }
.wa-error { margin-top: 8px; font-size: 14px; color: #991b1b; background: #fee2e2; padding: 8px 10px; border-radius: 5px; }
.wa-hint { margin-top: 8px; font-size: 13px; }
.wa-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.wa-qr { text-align: center; max-width: 290px; }
.wa-qr img { border: 1px solid #e5e7eb; border-radius: 8px; padding: 6px; background: #fff; }
.wa-qr p { margin-top: 8px; }

.section-title { margin: 30px 0 15px; font-size: 20px; color: #1e3a8a; border-bottom: 2px solid #cbd5e1; padding-bottom: 8px; }
.section-title.warn { color: #d97706; }
.section-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.section-row .section-title { flex: 1; min-width: 240px; }
.btn-download { display: inline-block; margin-bottom: 15px; background: #1e3a8a; color: #fff; text-decoration: none; padding: 9px 16px; border-radius: 5px; font-size: 14px; font-weight: bold; }
.btn-download:hover { background: #172554; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,.05); margin-bottom: 20px; }
table.pending { border: 2px solid #f59e0b; }
th, td { padding: 14px 15px; text-align: left; border-bottom: 1px solid #e5e7eb; font-size: 15px; }
th { background: #f8fafc; color: #475569; font-weight: 600; text-transform: uppercase; font-size: 13px; }
tr:hover { background: #f1f5f9; }
td.empty { text-align: center; color: #6b7280; }
td.strong { font-weight: bold; color: #1f2937; }
.duta-name { color: #1e3a8a; font-weight: 500; }

.badge { padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: bold; display: inline-block; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.text-success { color: #10b981; font-weight: bold; }
.text-danger { color: #ef4444; }
.text-muted { color: #6b7280; font-size: 12px; }

form.inline { display: inline; }
.btn-acc, .btn-rej, .btn-warn { color: #fff; padding: 8px 14px; border: 0; border-radius: 4px; font-size: 13px; font-weight: bold; cursor: pointer; }
.btn-acc { background: #10b981; }
.btn-rej { background: #ef4444; margin-left: 5px; }
.btn-warn { background: #d97706; }
.btn-warn:hover { background: #b45309; }
.btn-warn:disabled { background: #9ca3af; cursor: not-allowed; }
.mt-sm { margin-top: 10px; }
.mt { margin-top: 20px; }

/* Halaman login */
.center-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card { background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,.1); width: 100%; max-width: 380px; text-align: center; }
.login-card h2 { color: #333; margin-bottom: 20px; }
.login-card label { display: block; text-align: left; font-size: 14px; color: #475569; margin: 12px 0 4px; }
.login-card input[type=text], .login-card input[type=password] { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 5px; font-size: 15px; }
.btn-primary { width: 100%; margin-top: 20px; padding: 12px; background: #007bff; color: #fff; border: 0; border-radius: 5px; font-size: 16px; font-weight: bold; cursor: pointer; }
.btn-primary:hover { background: #0056b3; }
.alert { background: #fee2e2; color: #991b1b; padding: 10px; border-radius: 5px; font-size: 14px; }

@media (max-width: 700px) { th, td { padding: 10px 8px; font-size: 13px; } .header h1 { font-size: 18px; } }

/* ===== Navigasi, form, filter, laporan ===== */
.nav { background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; gap: 4px; padding: 0 20px; overflow-x: auto; }
.nav a { padding: 14px 16px; color: #475569; text-decoration: none; font-weight: 600; font-size: 15px; border-bottom: 3px solid transparent; white-space: nowrap; }
.nav a:hover { color: #1e3a8a; background: #f8fafc; }
.nav a.active { color: #1e3a8a; border-bottom-color: #1e3a8a; }

a { color: #1d4ed8; }
.card-link { text-decoration: none; display: block; color: inherit; }
.card-link:hover { box-shadow: 0 4px 10px rgba(0,0,0,.12); }
.card.warn { border-left-color: #f59e0b; background: #fffbeb; }

.flash { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.flash-ok { background: #d1fae5; color: #065f46; }
.flash-err { background: #fee2e2; color: #991b1b; }
.flash pre { margin-top: 8px; background: #fff; padding: 8px; border-radius: 4px; overflow-x: auto; font-size: 12px; color: #333; }

.table-wrap { overflow-x: auto; margin-bottom: 20px; }
.table-wrap table { margin-bottom: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

.panel { background: #fff; padding: 16px 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,.05); margin-bottom: 20px; }
.panel p { margin-bottom: 6px; }
.panel summary { cursor: pointer; font-weight: 600; color: #1e3a8a; }
.panel details[open] summary, details.panel[open] summary { margin-bottom: 12px; }
.sub-title { margin: 24px 0 10px; font-size: 16px; color: #1e3a8a; }
.sub-title.danger { color: #b91c1c; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters label { font-size: 14px; color: #475569; display: flex; gap: 6px; align-items: center; }
input[type=text], input[type=date], select, textarea { padding: 9px 10px; border: 1px solid #cbd5e1; border-radius: 5px; font-size: 14px; background: #fff; max-width: 100%; }
textarea { width: 100%; font-family: inherit; }
.filters input[type=text] { min-width: 220px; }
.btn-sec { background: #475569; color: #fff; padding: 9px 14px; border: 0; border-radius: 4px; font-size: 13px; font-weight: bold; cursor: pointer; }
.btn-sec:hover { background: #334155; }
.btn-link { background: none; border: 0; color: #6b7280; cursor: pointer; text-decoration: underline; font-size: 14px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: end; }
.form-grid label, .form-stack label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: #475569; }
.form-stack { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.inline-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.inline-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: #475569; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0 24px; font-size: 14px; }
.pager-total { margin-bottom: 20px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-print { border: 0; cursor: pointer; font-family: inherit; }

.bar { display: inline-block; vertical-align: middle; width: 140px; height: 12px; background: #e5e7eb; border-radius: 6px; overflow: hidden; margin-right: 8px; }
.bar span { display: block; height: 100%; background: #3b82f6; }
.bar-alt span { background: #10b981; }
.w-label { width: 70px; color: #6b7280; }
.bar-cell { white-space: nowrap; }

.print-only { display: none; }
@media print {
    .header, .nav, .no-print, .btn-download, .flash { display: none !important; }
    .print-only { display: block; }
    .print-head { margin-bottom: 16px; border-bottom: 2px solid #333; padding-bottom: 8px; }
    .print-head h1 { font-size: 22px; }
    body { background: #fff; }
    .container { padding: 0; max-width: none; }
    table, .card, .panel { box-shadow: none; }
    .card { border: 1px solid #ccc; }
    tr, .card { break-inside: avoid; }
    a { color: inherit; text-decoration: none; }
}
