*{box-sizing:border-box}
body{margin:0;background:#f4f7fb;color:#172033;font-family:Arial,Helvetica,sans-serif}
.app-shell{min-height:100vh}
.topbar{background:#111827;color:#fff;padding:18px 5%;display:flex;align-items:center;justify-content:space-between;gap:20px}
.topbar h1{margin:0;font-size:24px}.topbar p{margin:4px 0 0;color:#cbd5e1;font-size:13px}
.topbar nav{display:flex;gap:8px}.topbar nav a{color:#cbd5e1;text-decoration:none;padding:10px 14px;border-radius:8px}
.topbar nav a.active,.topbar nav a:hover{background:#fff;color:#111827}
.container{width:min(1100px,92%);margin:30px auto}
.card{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:26px;box-shadow:0 8px 30px rgba(15,23,42,.06)}
.section-head{margin-bottom:22px}.section-head h2{margin:0 0 6px}.section-head p{margin:0;color:#64748b}
.info-box{background:#eff6ff;border:1px solid #bfdbfe;padding:14px;border-radius:10px;margin-bottom:18px}
.alert{padding:13px 15px;border-radius:9px;margin:12px 0}.alert.success{background:#ecfdf5;color:#047857}.alert.danger{background:#fef2f2;color:#b91c1c}
.upload-form{display:grid;gap:10px;max-width:600px;margin-top:20px}.upload-form label{font-weight:700}.upload-form input{padding:12px;border:1px solid #cbd5e1;border-radius:8px}
.btn{display:inline-block;border:0;border-radius:9px;padding:11px 16px;font-weight:700;cursor:pointer;text-decoration:none}.btn.primary{background:#2563eb;color:#fff}.btn.primary:hover{background:#1d4ed8}
.action-buttons{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.spec-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:24px}.spec-grid>div{background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:15px}.spec-grid span,.spec-grid small{display:block;color:#64748b}.spec-grid b{display:block;font-size:20px;margin:4px 0}
.scan-form{display:flex;gap:10px}.scan-form input{flex:1;font-size:24px;padding:15px;border:2px solid #cbd5e1;border-radius:10px;outline:none}.scan-form input:focus{border-color:#2563eb}
.scan-result{display:none;align-items:center;gap:16px;margin:20px 0;padding:18px;border-radius:12px;font-size:18px}.scan-result.show{display:flex}.result-ok{background:#ecfdf5;color:#047857;border:1px solid #a7f3d0}.result-bad{background:#fef2f2;color:#b91c1c;border:1px solid #fecaca}
.result-icon{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:#fff;font-size:34px;font-weight:900}
.table-wrap{overflow:auto;margin-top:24px}
table{width:100%;border-collapse:collapse}
th,td{padding:11px 12px;border-bottom:1px solid #e5e7eb;text-align:left;white-space:nowrap}
th{background:#f8fafc}
.status{font-weight:700}.status.ok{color:#059669}.status.bad{color:#dc2626}
code{font-family:Consolas,monospace}

.data-card{margin-top:24px}
.qr-data-table{width:100%!important}
.qr-data-table th{font-weight:700}
.secret-code{font-size:14px;color:#172033}
.batch-code{font-size:12px;color:#64748b}
.number-new{color:#047857}
.number-existing{color:#d97706}
.number-duplicate{color:#dc2626}

.qr-status{
    display:inline-block;
    font-weight:700;
    padding:4px 9px;
    border-radius:999px;
    font-size:13px;
}
.status-valid{
    color:#047857;
    background:#ecfdf5;
}
.status-used{
    color:#b45309;
    background:#fffbeb;
}
.status-disabled{
    color:#b91c1c;
    background:#fef2f2;
}
.status-unknown{
    color:#475569;
    background:#f1f5f9;
}

/* Penyesuaian tampilan DataTables agar menyatu dengan UI */
.dataTables_wrapper{
    width:100%;
    font-size:14px;
    color:#172033;
}

.dataTables_wrapper .dt-layout-row{
    margin:10px 0;
    gap:12px;
}

.dataTables_wrapper .dt-search input,
.dataTables_wrapper .dt-length select{
    border:1px solid #cbd5e1;
    border-radius:7px;
    padding:7px 9px;
    background:#fff;
    color:#172033;
    outline:none;
}

.dataTables_wrapper .dt-search input:focus,
.dataTables_wrapper .dt-length select:focus{
    border-color:#2563eb;
    box-shadow:0 0 0 2px rgba(37,99,235,.10);
}

table.dataTable thead th{
    background:#f8fafc!important;
    color:#172033;
    font-weight:700;
}

table.dataTable tbody td{
    vertical-align:middle;
}

.dataTables_wrapper .dt-paging .dt-paging-button{
    border-radius:7px!important;
}

.dataTables_wrapper .dt-paging .dt-paging-button.current{
    background:#2563eb!important;
    color:#fff!important;
    border-color:#2563eb!important;
}

.dataTables_wrapper .dt-paging .dt-paging-button:hover{
    background:#1d4ed8!important;
    color:#fff!important;
    border-color:#1d4ed8!important;
}

@media(max-width:700px){
    .topbar{align-items:flex-start;flex-direction:column}
    .spec-grid{grid-template-columns:1fr 1fr}
    .scan-form{flex-direction:column}
    .scan-form input{font-size:18px}
    .data-card{padding:18px}
}


/* =========================================================
   CAMERA QR SCANNER
   ========================================================= */
.camera-section{margin-top:20px;padding:18px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px}
.camera-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.camera-head h3{margin:0 0 5px;font-size:18px}
.camera-head p{margin:0;color:#64748b;font-size:13px}
.camera-button{flex:0 0 auto}
.camera-box{position:relative;width:100%;max-width:520px;min-height:280px;margin:0 auto;overflow:hidden;border-radius:14px;background:#0f172a;border:1px solid #cbd5e1;display:flex;align-items:center;justify-content:center}
.camera-box.camera-active{min-height:320px}
.qr-reader{width:100%;min-height:0}
.qr-reader video{width:100%!important;height:auto!important;max-height:520px;object-fit:cover;border-radius:12px}
.qr-reader__dashboard{display:none!important}
.qr-reader__scan_region img{display:none!important}
.camera-placeholder{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;color:#cbd5e1;text-align:center;padding:30px}
.camera-placeholder-icon{font-size:52px;line-height:1;margin-bottom:6px}
.camera-placeholder strong{color:#fff;font-size:18px}
.camera-placeholder span{color:#94a3b8;font-size:13px}
.camera-status{min-height:22px;margin-top:12px;text-align:center;color:#64748b;font-size:13px}
.camera-status.ready{color:#047857;font-weight:700}
.camera-status.loading{color:#2563eb;font-weight:700}
.camera-status.error{color:#dc2626;font-weight:700}
.camera-stop{display:block;margin:12px auto 0;background:#475569;color:#fff}
.camera-stop:hover{background:#334155}
.scan-divider{display:flex;align-items:center;gap:14px;margin:24px 0 18px;color:#94a3b8;font-size:13px}
.scan-divider::before,.scan-divider::after{content:"";height:1px;background:#e2e8f0;flex:1}
@media(max-width:700px){
    .camera-section{padding:14px}
    .camera-head{flex-direction:column;align-items:stretch}
    .camera-button{width:100%}
    .camera-box{min-height:260px}
    .camera-box.camera-active{min-height:280px}
    .camera-placeholder{padding:20px}
}
