:root{
  --bg:#f6f8fb;
  --card:#ffffff;
  --text:#14213d;
  --muted:#667085;
  --line:#e6eaf0;
  --primary:#2563eb;
  --primary-dark:#1d4ed8;
  --soft:#eef4ff;
  --danger:#b42318;
  --success:#047857;
  --sidebar:#0f172a;
  --sidebar-soft:#1e293b;
  --shadow:0 10px 30px rgba(16,24,40,.08);
  --radius:18px;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:14px}
a{color:inherit;text-decoration:none}
button,input,select{font:inherit}
button:disabled{opacity:.6;cursor:not-allowed}
label{font-weight:700;font-size:12px;color:#344054;display:block;margin-bottom:6px}
input,select{width:100%;border:1px solid var(--line);border-radius:12px;background:#fff;padding:11px 12px;outline:none}
input:focus,select:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.hidden{display:none!important}
.muted{color:var(--muted)}
.center{text-align:center}
body.modal-open{overflow:hidden}

.topbar{display:flex;justify-content:space-between;align-items:center;padding:18px 26px;background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20;box-shadow:0 4px 18px rgba(16,24,40,.04)}
.topbar h1{margin:0;font-size:22px;line-height:1.15;letter-spacing:-.02em}
.topbar-subtitle{margin:5px 0 0;color:var(--muted);font-size:13px}
.user-box{display:flex;align-items:center;gap:10px;background:#f8fafc;border:1px solid var(--line);padding:8px 10px;border-radius:16px}
.user-box span{font-weight:800}
.user-box small{color:var(--muted);font-size:11px}

.app-shell{display:grid;grid-template-columns:260px minmax(0,1fr);min-height:calc(100vh - 78px)}
.sidebar{background:linear-gradient(180deg,#0f172a,#111827);color:#e5e7eb;padding:18px 14px;position:sticky;top:78px;height:calc(100vh - 78px);overflow:auto;border-right:1px solid rgba(255,255,255,.08)}
.sidebar-title{display:flex;align-items:center;gap:11px;padding:10px 10px 18px;border-bottom:1px solid rgba(255,255,255,.10);margin-bottom:14px}
.sidebar-logo{width:40px;height:40px;border-radius:15px;display:grid;place-items:center;background:rgba(37,99,235,.22);border:1px solid rgba(147,197,253,.28)}
.sidebar-title strong{display:block;font-size:15px}
.sidebar-title small{display:block;color:#94a3b8;font-size:12px;margin-top:2px}
.sidebar-nav{display:grid;gap:12px}
.side-group{border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.035);border-radius:18px;overflow:hidden}
.side-accordion{width:100%;border:0;background:transparent;color:#e5e7eb;padding:13px 12px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:9px;cursor:pointer;text-align:left}
.side-accordion strong{font-size:13px}
.side-accordion em{font-style:normal;color:#94a3b8;transition:transform .18s ease}
.side-accordion.is-open em{transform:rotate(180deg)}
.side-submenu{display:none;padding:0 9px 10px}
.side-submenu.is-open{display:grid;gap:7px}
.side-link{width:100%;border:1px solid transparent;border-radius:13px;background:transparent;color:#cbd5e1;padding:10px 11px;cursor:pointer;text-align:left;font-weight:700;font-size:13px;display:flex;align-items:center;justify-content:space-between}
.side-link:hover{background:rgba(255,255,255,.07);color:#fff}
.side-link.active{background:#2563eb;color:#fff;border-color:rgba(255,255,255,.14);box-shadow:0 10px 20px rgba(37,99,235,.25)}

.content-area{padding:22px;min-width:0}
.page-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:16px}
.page-head h2{margin:0 0 4px;font-size:24px;letter-spacing:-.02em}
.page-head p{margin:0}

.stats-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}
.stat-card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:17px 18px}
.stat-card span{display:block;color:var(--muted);font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.02em}
.stat-card strong{display:block;margin-top:6px;font-size:29px;line-height:1.1}

.panel{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px;margin-bottom:18px}
.panel-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;margin-bottom:16px}
.panel-head.compact{margin-bottom:12px}
.panel h2,.panel h3{margin:0 0 4px;font-size:18px;letter-spacing:-.01em}
.panel h3{font-size:17px}
.panel p{margin:0}
.panel-actions{display:flex;gap:10px;align-items:center;justify-content:flex-end}

.dashboard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.chart-panel{min-height:440px;display:flex;flex-direction:column}
.chart-filters{display:grid;grid-template-columns:1.3fr 1fr 1fr;gap:10px;margin:12px 0 12px}
.chart-summary{display:flex;align-items:center;justify-content:space-between;background:#f8fafc;border:1px solid var(--line);border-radius:14px;padding:11px 13px;margin-bottom:12px}
.chart-summary span{font-size:12px;text-transform:uppercase;font-weight:800;color:var(--muted);letter-spacing:.02em}
.chart-summary strong{font-size:22px;color:#0f172a}
.chart-box{border:1px solid var(--line);border-radius:16px;background:#fbfdff;padding:14px;min-height:250px;overflow:auto;flex:1}
.bar-chart{display:grid;gap:12px;min-width:360px}
.bar-row{display:grid;grid-template-columns:88px minmax(120px,1fr) 46px;align-items:center;gap:10px}
.bar-label{font-size:12px;color:#475467;font-weight:800;text-transform:capitalize;white-space:nowrap}
.bar-track{height:28px;background:#eef2f7;border-radius:999px;overflow:hidden;border:1px solid #e6eaf0}
.bar-fill{height:100%;border-radius:999px;background:linear-gradient(90deg,#2563eb,#60a5fa);box-shadow:inset 0 -1px 0 rgba(0,0,0,.08)}
.bar-value{text-align:right;font-weight:900;color:#111827;font-size:13px}
.empty-state{height:220px;display:grid;place-items:center;color:var(--muted);font-weight:700;text-align:center}

.form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.wide{grid-column:1/-1}
.action-row{display:flex;gap:12px;align-items:center}
.btn{border:1px solid var(--line);border-radius:12px;padding:10px 14px;background:#fff;cursor:pointer;font-weight:800;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.btn:hover{filter:brightness(.98)}
.btn.primary{background:var(--primary);border-color:var(--primary);color:#fff}
.btn.primary:hover{background:var(--primary-dark)}
.btn.secondary{background:var(--soft);border-color:#c7d7fe;color:#1d4ed8}
.btn.danger-outline{background:#fff;border-color:#fecaca;color:#b42318}
.btn.danger-outline:hover{background:#fff5f5}
.btn.ghost{background:#fff}
.btn.full{width:100%;margin-top:12px}
.icon-btn.large{width:42px;height:42px;font-size:18px;border-radius:12px}

.filters{display:grid;grid-template-columns:2fr 1fr 1fr;gap:10px;margin-bottom:12px}
.document-filters{grid-template-columns:2fr 1fr 1fr}
.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:14px;max-height:62vh;background:#fff}
table{width:100%;border-collapse:separate;border-spacing:0;min-width:980px}
th,td{padding:11px 12px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
th{position:sticky;top:0;background:#f9fafb;font-size:12px;text-transform:uppercase;color:#475467;z-index:1}
tbody tr:hover{background:#fbfdff}
.badge{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;font-size:12px;font-weight:900;background:var(--soft);color:#1d4ed8}
.badge.voucher{background:#ecfdf3;color:#047857}
.file-name{max-width:260px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#475467}
.pager{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin-top:12px}
.alert{padding:10px 12px;border-radius:12px;margin:10px 0}
.alert.danger{background:#fef3f2;color:var(--danger);border:1px solid #fecdca}
.alert.success{background:#ecfdf3;color:var(--success);border:1px solid #abefc6}

.login-page{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#eff6ff,#f8fafc)}
.login-card{width:min(410px,92vw);background:#fff;border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow);padding:28px}
.login-card h1{margin:8px 0 4px}
.brand-badge{width:54px;height:54px;display:grid;place-items:center;border-radius:16px;background:var(--primary);color:#fff;font-weight:900}

.modal{position:fixed;inset:0;background:rgba(15,23,42,.56);display:grid;place-items:center;z-index:50;padding:18px}
.modal-card{width:min(1040px,96vw);height:min(760px,92vh);background:#fff;border-radius:18px;box-shadow:0 24px 80px rgba(0,0,0,.25);display:flex;flex-direction:column;overflow:hidden}
.modal-head{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding:12px 14px}
.modal-body{padding:16px;overflow:auto}
.modal iframe{border:0;width:100%;height:100%;background:#f4f4f5}
.icon-actions{display:flex;gap:8px}
.icon-btn{width:34px;height:34px;border-radius:10px;border:1px solid var(--line);display:grid;place-items:center;background:#fff;cursor:pointer}
.icon-btn:hover{background:var(--soft)}

/* Popup Upload Scan Baru */
#uploadModal{padding:22px;background:rgba(15,23,42,.58);backdrop-filter:blur(3px);align-items:start;overflow:auto}
#uploadModal .upload-modal-card{width:min(780px,94vw)!important;height:auto!important;max-height:none!important;margin:24px auto;background:#fff;border-radius:24px;box-shadow:0 28px 90px rgba(15,23,42,.28);overflow:hidden;display:flex;flex-direction:column}
#uploadModal .modal-head{padding:18px 22px;border-bottom:1px solid #edf1f7;background:linear-gradient(180deg,#ffffff,#fbfdff);gap:14px}
#uploadModal .modal-head strong{display:flex;align-items:center;gap:10px;font-size:18px;font-weight:900;color:#13213b;letter-spacing:-.01em}
#uploadModal .modal-head strong::before{content:'⬆️';width:36px;height:36px;border-radius:14px;display:grid;place-items:center;background:#eef4ff;border:1px solid #dbe7ff;font-size:17px}
#uploadModal #closeUploadModal{min-width:42px;height:42px;padding:0 14px;border-radius:14px;border-color:#e5eaf2;background:#fff;color:#111827;box-shadow:0 4px 12px rgba(16,24,40,.05)}
#uploadModal .modal-body{padding:22px;background:#fff;max-height:calc(100vh - 155px);overflow:auto}
#uploadModal .form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 18px}
#uploadModal .wide{grid-column:1/-1}
#uploadModal label{font-size:12px;font-weight:800;color:#344054;margin-bottom:7px;letter-spacing:.01em}
#uploadModal input,#uploadModal select{height:44px;border-radius:14px;border-color:#e2e8f0;background:#fff;padding:10px 13px;color:#101828;box-shadow:0 1px 2px rgba(16,24,40,.03)}
#uploadModal input:focus,#uploadModal select:focus{border-color:#2563eb;box-shadow:0 0 0 4px rgba(37,99,235,.12)}
#uploadModal input[type="file"]{height:auto;min-height:58px;padding:15px;border:1px dashed #b7c7e6;background:#f8fbff;cursor:pointer}
#uploadModal input[type="file"]::file-selector-button{border:0;border-radius:11px;background:#2563eb;color:#fff;font-weight:800;padding:9px 13px;margin-right:12px;cursor:pointer}
#uploadModal input[type="file"]::-webkit-file-upload-button{border:0;border-radius:11px;background:#2563eb;color:#fff;font-weight:800;padding:9px 13px;margin-right:12px;cursor:pointer}
#uploadModal small.muted{display:block;margin-top:7px;font-size:12px;line-height:1.45;color:#667085}
#uploadModal .action-row{margin-top:4px;padding-top:16px;border-top:1px solid #eef2f7;display:flex;justify-content:space-between;align-items:center;gap:14px}
#uploadModal .action-row .btn.primary{min-height:46px;border-radius:14px;padding:11px 18px;font-size:14px;box-shadow:0 10px 20px rgba(37,99,235,.20)}
#uploadModal #uploadInfo{font-size:12px;text-align:right;flex:1}

@media(max-width:1100px){
  .app-shell{grid-template-columns:230px minmax(0,1fr)}
  .dashboard-grid{grid-template-columns:1fr}
  .chart-filters{grid-template-columns:1fr 1fr 1fr}
}
@media(max-width:900px){
  .topbar{position:static;flex-direction:column;align-items:flex-start;gap:12px}
  .topbar h1{font-size:20px}
  .user-box{width:100%;justify-content:space-between;flex-wrap:wrap}
  .app-shell{display:block;min-height:auto}
  .sidebar{position:static;width:100%;height:auto;border-right:0;border-bottom:1px solid rgba(255,255,255,.10)}
  .sidebar-nav{grid-template-columns:1fr 1fr}
  .content-area{padding:16px}
  .stats-grid,.form-grid,.filters{grid-template-columns:1fr}
  .document-filters{grid-template-columns:1fr}
  .chart-filters{grid-template-columns:1fr}
  .table-wrap{max-height:none}
  .panel-head{flex-direction:column}
  .panel-actions{width:100%;justify-content:flex-start}
  .action-row{flex-direction:column;align-items:stretch}
  .page-head{flex-direction:column}
}
@media(max-width:720px){
  .sidebar-nav{grid-template-columns:1fr}
  .stats-grid{grid-template-columns:1fr}
  .bar-chart{min-width:0}
  .bar-row{grid-template-columns:76px minmax(80px,1fr) 42px;gap:8px}
  .bar-label,.bar-value{font-size:11px}
  #uploadModal{padding:10px;align-items:start}
  #uploadModal .upload-modal-card{width:100%!important;margin:10px auto;border-radius:20px}
  #uploadModal .modal-head{padding:14px 16px}
  #uploadModal .modal-body{padding:16px;max-height:calc(100vh - 110px)}
  #uploadModal .form-grid{grid-template-columns:1fr;gap:13px}
  #uploadModal .action-row{align-items:stretch;flex-direction:column}
  #uploadModal #uploadInfo{text-align:left}
  #uploadModal .action-row .btn.primary{width:100%}
}

/* Popup Progress Sinkron Drive */
#syncModal{padding:18px;background:rgba(15,23,42,.58);backdrop-filter:blur(3px)}
#syncModal .sync-modal-card{width:min(560px,94vw)!important;height:auto!important;max-height:none!important;border-radius:24px;overflow:hidden}
#syncModal .modal-head{padding:17px 20px;background:linear-gradient(180deg,#ffffff,#fbfdff)}
#syncModal .modal-head strong{display:flex;align-items:center;gap:10px;font-size:17px;font-weight:900;color:#13213b}
#syncModal .modal-head strong::before{content:'🔁';width:36px;height:36px;border-radius:14px;display:grid;place-items:center;background:#eef4ff;border:1px solid #dbe7ff;font-size:16px}
.sync-modal-body{text-align:center;padding:24px!important}
.sync-status-icon{width:58px;height:58px;border-radius:20px;display:grid;place-items:center;background:#f0f6ff;border:1px solid #dbe7ff;margin:0 auto 12px;font-size:26px}
.sync-modal-body h3{margin:0 0 6px;font-size:20px;letter-spacing:-.02em;color:#111827}
.sync-modal-body p{margin:0 auto 18px;max-width:440px;line-height:1.5}
.sync-progress-wrap{width:100%;height:16px;border-radius:999px;background:#eef2f7;border:1px solid #e2e8f0;overflow:hidden;box-shadow:inset 0 1px 2px rgba(16,24,40,.06)}
.sync-progress-bar{height:100%;border-radius:999px;background:linear-gradient(90deg,#2563eb,#60a5fa);transition:width .25s ease}
.sync-progress-text{display:flex;justify-content:space-between;align-items:center;margin-top:9px;color:#475467;font-size:12px;font-weight:900}
.sync-control-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding:12px;border:1px solid #eef2f7;background:#fbfdff;border-radius:15px;text-align:left}
.sync-control-row .btn{white-space:nowrap;min-width:128px}
.sync-control-row small{line-height:1.4;font-size:12px}
.sync-result-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:14px}
.sync-result-grid div{background:#f8fafc;border:1px solid #e6eaf0;border-radius:15px;padding:12px 8px}
.sync-result-grid span{display:block;color:#667085;font-size:11px;text-transform:uppercase;font-weight:900;letter-spacing:.02em;min-height:26px}
.sync-result-grid strong{display:block;margin-top:4px;color:#111827;font-size:20px;line-height:1}
@media(max-width:620px){
  .sync-modal-body{padding:18px!important}
  .sync-control-row{flex-direction:column;align-items:stretch}
  .sync-control-row .btn{width:100%}
  .sync-result-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Update responsive dashboard, sidebar toggle, dan mode scan HP */
.topbar-left{display:flex;align-items:center;gap:12px;min-width:0}
.sidebar-toggle{width:42px;height:42px;border:1px solid var(--line);border-radius:14px;background:#fff;color:#0f172a;font-size:20px;font-weight:900;display:grid;place-items:center;cursor:pointer;box-shadow:0 4px 14px rgba(16,24,40,.05)}
.sidebar-toggle:hover{background:var(--soft)}
.sidebar-overlay{display:none}
.mobile-home-web{display:none}
body.sidebar-hidden .app-shell{grid-template-columns:0 minmax(0,1fr)}
body.sidebar-hidden .sidebar{width:0;padding:0;border:0;overflow:hidden}

.document-filters{grid-template-columns:2fr 1fr}
.dashboard-grid{align-items:start}
.chart-panel{height:430px;min-height:0;overflow:hidden}
.branch-panel{height:485px}
.scrollable-chart{min-height:190px;max-height:230px;overflow:auto;overscroll-behavior:contain}
.branch-chart-box{min-height:245px;max-height:300px;overflow:auto;overscroll-behavior:contain}
.chart-box::-webkit-scrollbar,.table-wrap::-webkit-scrollbar,.modal-body::-webkit-scrollbar{height:8px;width:8px}
.chart-box::-webkit-scrollbar-thumb,.table-wrap::-webkit-scrollbar-thumb,.modal-body::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px}
.chart-box::-webkit-scrollbar-track,.table-wrap::-webkit-scrollbar-track,.modal-body::-webkit-scrollbar-track{background:#f1f5f9;border-radius:999px}
.branch-chart{display:grid;gap:10px;min-width:620px;padding:2px}
.branch-row{display:grid;grid-template-columns:175px minmax(260px,1fr) 60px;align-items:center;gap:12px;padding:8px;border:1px solid #eef2f7;border-radius:14px;background:#fff}
.branch-label{min-width:0}
.branch-label strong{display:block;font-size:12px;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-transform:uppercase;letter-spacing:.01em}
.branch-label span{display:block;font-size:11px;color:var(--muted);font-weight:800;margin-top:2px;text-transform:capitalize}
.branch-track{height:28px;background:#eef2f7;border-radius:999px;overflow:hidden;border:1px solid #e6eaf0}
.branch-fill{height:100%;border-radius:999px;background:linear-gradient(90deg,#16a34a,#86efac);box-shadow:inset 0 -1px 0 rgba(0,0,0,.08)}
.branch-value{text-align:right;font-weight:900;color:#111827;font-size:13px}

.mobile-start-screen,.mobile-scan-screen{display:none}
.mobile-start-card,.mobile-scan-card{width:min(430px,92vw);margin:auto;background:#fff;border:1px solid var(--line);border-radius:26px;box-shadow:0 24px 80px rgba(16,24,40,.16);padding:24px}
.mobile-start-card{text-align:center}
.mobile-brand-icon{width:66px;height:66px;border-radius:23px;background:var(--primary);color:#fff;display:grid;place-items:center;font-size:30px;margin:0 auto 14px;box-shadow:0 12px 24px rgba(37,99,235,.22)}
.mobile-start-card h1,.mobile-scan-head h1{margin:0;color:#0f172a;letter-spacing:-.03em;line-height:1.12}
.mobile-start-card p,.mobile-scan-head p{margin:7px 0 0;color:var(--muted);line-height:1.45}
.mobile-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:22px 0 16px}
.mobile-choice-btn{border:1px solid #dce6f5;background:#f8fbff;border-radius:22px;min-height:145px;padding:16px 10px;display:grid;place-items:center;gap:8px;color:#0f172a;font-weight:900;cursor:pointer;box-shadow:0 8px 22px rgba(16,24,40,.06)}
.mobile-choice-btn span{width:58px;height:58px;border-radius:20px;background:#eef4ff;border:1px solid #dbe7ff;display:grid;place-items:center;font-size:30px}
.mobile-choice-btn:hover{border-color:#93c5fd;transform:translateY(-1px)}
.mobile-logout{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:14px;padding:10px 14px;font-weight:800;color:#475467;background:#fff}
.mobile-scan-screen{padding:14px;background:linear-gradient(135deg,#eff6ff,#f8fafc);min-height:100vh}
.mobile-scan-card{padding:18px;width:min(520px,94vw)}
.mobile-scan-head{display:flex;align-items:flex-start;gap:12px;margin-bottom:16px}
.mobile-scan-head .icon-btn{width:42px;height:42px;font-size:28px;line-height:1;flex:0 0 auto}
.mobile-scan-form{display:grid;gap:12px}
.mobile-scan-form input,.mobile-scan-form select{height:46px;border-radius:15px}
.mobile-scan-form input[type="file"]{height:auto;min-height:74px;border:1px dashed #b7c7e6;background:#f8fbff;padding:14px}
.mobile-scan-form input[type="file"]::file-selector-button{border:0;border-radius:12px;background:#2563eb;color:#fff;font-weight:900;padding:10px 13px;margin-right:10px}
.mobile-upload-info{display:block;min-height:18px;text-align:center;font-size:12px;font-weight:700}

@media(max-width:1180px){
  .dashboard-grid{grid-template-columns:1fr}
  .chart-panel,.branch-panel{height:auto;min-height:0}
  .scrollable-chart{max-height:260px}
  .branch-chart-box{max-height:330px}
}

@media(max-width:1024px){
  .topbar{position:sticky;top:0;padding:14px 16px;gap:12px}
  .topbar h1{font-size:19px}
  .topbar-subtitle{font-size:12px}
  .app-shell{display:block;min-height:calc(100vh - 72px)}
  .content-area{padding:16px}
  .sidebar{position:fixed!important;top:0!important;left:0;bottom:0;width:280px!important;height:100vh!important;z-index:70;transform:translateX(-105%);transition:transform .22s ease;padding:18px 14px!important;border-right:1px solid rgba(255,255,255,.08)!important}
  body.sidebar-drawer-open .sidebar{transform:translateX(0)}
  body.sidebar-drawer-open .sidebar-overlay{display:block;position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:60;backdrop-filter:blur(2px)}
  body.sidebar-hidden .sidebar{width:280px!important;padding:18px 14px!important;border-right:1px solid rgba(255,255,255,.08)!important}
  body.sidebar-hidden .app-shell{display:block}
  .sidebar-nav{grid-template-columns:1fr!important}
  .stats-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .chart-filters{grid-template-columns:1fr 1fr 1fr}
  .table-wrap{max-height:65vh}
}

@media(max-width:760px){
  .topbar{align-items:flex-start}
  .topbar-left{width:100%}
  .user-box{width:100%;justify-content:space-between;flex-wrap:wrap}
  .mobile-home-web{display:inline-flex}
  .stats-grid,.chart-filters,.document-filters,.filters{grid-template-columns:1fr!important}
  .content-area{padding:12px}
  .panel{padding:14px;border-radius:16px}
  .panel-head{gap:10px}
  .page-head h2{font-size:20px}
  .stat-card strong{font-size:24px}
  .chart-panel,.branch-panel{height:auto}
  .scrollable-chart{max-height:245px;min-height:180px}
  .branch-chart-box{max-height:310px;min-height:220px}
  .bar-chart{min-width:440px}
  .branch-chart{min-width:520px}
  .branch-row{grid-template-columns:140px minmax(210px,1fr) 52px;gap:9px}
  .table-wrap{max-height:60vh}
}

@media(max-width:720px){
  body.phone-entry,body.phone-scan{background:#f6f8fb}
  body.phone-entry .topbar,body.phone-entry .app-shell,body.phone-entry .sidebar-overlay,body.phone-entry #mobileScanScreen{display:none!important}
  body.phone-entry #mobileStartScreen{display:grid!important;min-height:100vh;padding:18px;background:linear-gradient(135deg,#eff6ff,#f8fafc)}
  body.phone-scan .topbar,body.phone-scan .app-shell,body.phone-scan .sidebar-overlay,body.phone-scan #mobileStartScreen{display:none!important}
  body.phone-scan #mobileScanScreen{display:grid!important}
  .mobile-choice-grid{grid-template-columns:1fr 1fr}
}

@media(max-width:420px){
  .mobile-start-card,.mobile-scan-card{border-radius:22px;padding:18px;width:94vw}
  .mobile-choice-grid{gap:10px}
  .mobile-choice-btn{min-height:128px;border-radius:20px}
  .mobile-choice-btn span{width:52px;height:52px;font-size:26px}
}

/* Penyempurnaan Grafik Progress Cabang: cabang sebagai baris, bulan dari kiri ke kanan */
.branch-month-chart{
  --month-count:1;
  min-width:max(560px, calc(210px + (var(--month-count) * 116px)));
  display:grid;
  gap:0;
  padding:2px;
}
.branch-month-head,
.branch-month-row{
  display:grid;
  grid-template-columns:minmax(170px,210px) repeat(var(--month-count), minmax(108px,1fr));
  align-items:stretch;
}
.branch-month-head{
  position:sticky;
  top:0;
  z-index:2;
  background:#fbfdff;
  border-bottom:1px solid #e6eaf0;
  padding-bottom:6px;
  margin-bottom:6px;
}
.branch-month-row{
  border:1px solid #eef2f7;
  border-radius:15px;
  background:#fff;
  overflow:hidden;
  margin-bottom:8px;
}
.branch-month-row:last-child{margin-bottom:0}
.branch-sticky{
  position:sticky;
  left:0;
  z-index:3;
  background:#fff;
  border-right:1px solid #eef2f7;
}
.branch-title{
  background:#f8fafc;
  color:#475467;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.03em;
  padding:11px 12px;
  border:1px solid #eef2f7;
  border-radius:13px 0 0 13px;
}
.month-head{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:9px 10px;
  background:#f8fafc;
  border:1px solid #eef2f7;
  border-left:0;
  color:#475467;
  font-size:12px;
  font-weight:900;
  text-transform:capitalize;
  white-space:nowrap;
}
.branch-month-head .month-head:last-child{border-radius:0 13px 13px 0}
.branch-name{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:3px;
  padding:11px 12px;
  min-width:0;
}
.branch-name strong{
  display:block;
  color:#111827;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.branch-name span{
  color:#667085;
  font-size:11px;
  font-weight:800;
}
.month-cell{
  position:relative;
  min-height:54px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:9px 10px;
  border-left:1px solid #f1f5f9;
  overflow:hidden;
}
.month-cell::before{
  content:'';
  position:absolute;
  inset:8px;
  border-radius:12px;
  background:#f8fafc;
  border:1px solid #edf2f7;
}
.month-cell.has-value::before{background:#eef4ff;border-color:#dbe7ff}
.month-cell-bar{
  position:absolute;
  left:10px;
  top:50%;
  transform:translateY(-50%);
  height:28px;
  border-radius:999px;
  background:linear-gradient(90deg,#2563eb,#93c5fd);
  opacity:.82;
  max-width:calc(100% - 20px);
  z-index:1;
}
.month-cell strong,
.month-cell span{
  position:relative;
  z-index:2;
  color:#0f172a;
  font-size:13px;
  font-weight:900;
}
.month-cell.is-empty span{color:#98a2b3}
.branch-chart-box{overflow:auto}

@media(max-width:760px){
  .branch-month-chart{min-width:max(520px, calc(160px + (var(--month-count) * 104px)))}
  .branch-month-head,.branch-month-row{grid-template-columns:minmax(135px,160px) repeat(var(--month-count), minmax(98px,1fr))}
  .branch-title,.branch-name{padding-left:10px;padding-right:10px}
  .month-head{font-size:11px;padding-left:8px;padding-right:8px}
  .month-cell{min-height:50px;padding:8px}
}

/* Update 2026-05-17: tampilan kaku, profesional, sederhana, tanpa gradasi */
:root{
  --bg:#f3f4f6;
  --card:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --line:#d1d5db;
  --primary:#1f4e79;
  --primary-dark:#163a5a;
  --soft:#eef2f6;
  --sidebar:#111827;
  --sidebar-soft:#1f2937;
  --shadow:none;
  --radius:8px;
}
body{background:var(--bg);color:var(--text);font-weight:400;line-height:1.45}
strong,b,h1,h2,h3,h4,label,th,.btn,.side-link,.side-accordion strong,.stat-card span,.stat-card strong,.chart-summary span,.chart-summary strong,.bar-label,.bar-value,.badge,.user-box span,.sidebar-title strong,.empty-state,.sync-progress-text,.sync-result-grid span,.sync-result-grid strong{font-weight:500!important}
*{text-shadow:none!important}
.topbar,.panel,.stat-card,.chart-box,.table-wrap,.modal-card,.login-card,.user-box,.side-group,.side-link,.btn,.icon-btn,input,select,.chart-summary,.alert,#uploadModal .upload-modal-card,#syncModal .sync-modal-card,.mobile-start-card,.mobile-scan-card,.mobile-choice-btn{box-shadow:none!important;border-radius:8px!important}
.sidebar,#uploadModal .modal-head,#syncModal .modal-head,.login-page,.mobile-scan-screen,body.phone-entry #mobileStartScreen,.bar-fill,.sync-progress-bar,.branch-fill,.month-cell-bar,.mobile-brand-icon{background-image:none!important}
.topbar{padding:14px 22px;border-bottom:1px solid var(--line)}
.topbar h1{font-size:20px;letter-spacing:0}.topbar-subtitle{font-size:12px}
.app-shell{grid-template-columns:250px minmax(0,1fr)}
.sidebar{background:#111827!important;color:#e5e7eb;border-right:1px solid #374151}
.sidebar-title{border-bottom:1px solid #374151}.sidebar-logo{background:#1f2937;border-color:#374151;border-radius:6px!important}
.side-group{background:#111827;border-color:#374151}.side-accordion{color:#e5e7eb}.side-link{color:#d1d5db}.side-link:hover{background:#1f2937}.side-link.active{background:#1f4e79;color:#fff;border-color:#1f4e79}
.content-area{padding:18px}.page-head h2{font-size:21px;letter-spacing:0}.panel h2,.panel h3{letter-spacing:0}.panel h3{font-size:16px}
.stat-card,.panel{border-color:#d1d5db}.stat-card strong{font-size:26px}.chart-panel{height:420px}.branch-panel{height:520px}
input,select{border-radius:6px!important}.btn{border-radius:6px!important}.icon-btn{border-radius:6px!important}.badge{border-radius:4px!important;background:#eef2f6;color:#1f4e79}.badge.voucher{background:#ecfdf5;color:#047857}
.btn.primary,.btn.secondary{background:#1f4e79;border-color:#1f4e79;color:#fff}.btn.primary:hover,.btn.secondary:hover{background:#163a5a}.btn.ghost{background:#fff}.btn.danger-outline{background:#fff;color:#991b1b;border-color:#fca5a5}
.chart-summary{background:#f9fafb}.chart-box{background:#ffffff}.bar-fill,.sync-progress-bar{background:#1f4e79!important}.bar-track,.sync-progress-wrap{border-radius:3px!important;background:#e5e7eb}.bar-fill,.sync-progress-bar{border-radius:3px!important}
#uploadModal,#syncModal{backdrop-filter:none!important;background:rgba(17,24,39,.55)}
#uploadModal .modal-head,#syncModal .modal-head{background:#fff!important}.sync-status-icon,#uploadModal .modal-head strong::before,#syncModal .modal-head strong::before{border-radius:6px!important;background:#eef2f6!important}.mobile-start-screen,.mobile-scan-screen{background:#f3f4f6!important}

/* Grafik progress cabang model batang vertikal seperti contoh */
.branch-chart-box{min-height:270px;max-height:335px;overflow:auto;background:#fff;padding:12px}
.vertical-branch-chart{--bar-count:1;min-width:max(620px, calc((var(--bar-count) * 58px) + 130px));display:grid;grid-template-columns:44px minmax(0,1fr);grid-template-rows:260px auto;gap:0 10px;align-items:stretch;padding:2px 4px 8px}
.vbc-axis{grid-row:1;grid-column:1;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end;color:#4b5563;font-size:12px;padding:0 6px 23px 0}
.vbc-plot{grid-row:1;grid-column:2;position:relative;min-height:260px;border-left:1px solid #9ca3af;border-bottom:1px solid #9ca3af;overflow:visible}
.vbc-grid{position:absolute;inset:0 0 23px 0;background:repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), #9ca3af calc(25% - 1px), #9ca3af 25%);opacity:.75;pointer-events:none}
.vbc-bars{position:relative;z-index:1;height:100%;display:flex;align-items:stretch;gap:18px;padding:0 14px 0 14px}
.vbc-period{height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:0;flex:0 0 auto}
.vbc-period-bars{height:237px;display:flex;align-items:flex-end;gap:8px;padding-top:18px}
.vbc-bar-item{height:100%;width:42px;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;position:relative;gap:4px}
.vbc-value{font-size:11px;color:#374151;line-height:1;min-height:12px;white-space:nowrap}
.vbc-bar{width:100%;min-height:5px;background:#1f4e79;border:1px solid rgba(31,78,121,.35);border-radius:2px 2px 0 0}
.vbc-bar.tone-1,.vbc-legend .tone-1{background:#1f4e79}.vbc-bar.tone-2,.vbc-legend .tone-2{background:#5b8db8}.vbc-bar.tone-3,.vbc-legend .tone-3{background:#2f5f7f}.vbc-bar.tone-4,.vbc-legend .tone-4{background:#9bb8d6}.vbc-bar.tone-5,.vbc-legend .tone-5{background:#6fb9c8}.vbc-bar.tone-6,.vbc-legend .tone-6{background:#4f9ed1}
.vbc-branch{font-size:10px;color:#4b5563;line-height:1.05;max-width:48px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:12px}
.vbc-period-label{font-size:11px;color:#111827;line-height:1.2;margin-top:8px;white-space:nowrap;text-align:center;border-top:1px solid #d1d5db;padding-top:5px;width:100%}
.vbc-legend{grid-column:2;grid-row:2;display:flex;flex-wrap:wrap;gap:8px 14px;padding-top:10px;color:#4b5563;font-size:11px}
.vbc-legend span{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}.vbc-legend i{display:inline-block;width:10px;height:10px;border:1px solid rgba(0,0,0,.12)}

@media(max-width:1180px){.branch-panel{height:auto}.branch-chart-box{max-height:355px}.vertical-branch-chart{grid-template-rows:250px auto}.vbc-plot{min-height:250px}.vbc-period-bars{height:227px}}
@media(max-width:760px){.content-area{padding:12px}.panel{padding:12px}.chart-panel,.branch-panel{height:auto}.branch-chart-box{max-height:330px}.vertical-branch-chart{min-width:max(560px, calc((var(--bar-count) * 52px) + 112px));grid-template-columns:38px minmax(0,1fr);grid-template-rows:235px auto}.vbc-plot{min-height:235px}.vbc-period-bars{height:212px}.vbc-bars{gap:14px;padding-left:10px;padding-right:10px}.vbc-bar-item{width:38px}.vbc-branch{font-size:9px}}

/* Pembatas bulan pada Grafik Progress Cabang */
.vbc-period{position:relative;padding:0 12px}
.vbc-period::before{content:"";position:absolute;left:0;top:0;bottom:24px;border-left:1px solid #cbd5e1;pointer-events:none}
.vbc-period:last-child::after{content:"";position:absolute;right:0;top:0;bottom:24px;border-right:1px solid #cbd5e1;pointer-events:none}
.vbc-period-label{background:#f8fafc;border:1px solid #cbd5e1;border-top:1px solid #cbd5e1;margin-top:7px;padding:5px 8px;width:100%;box-sizing:border-box}
input[readonly][type="date"]{background:#f8fafc;color:#475467;border-style:solid;cursor:not-allowed}
@media(max-width:760px){.vbc-period{padding:0 9px}}

/* Modul User Setting */
.user-setting-grid{display:grid;grid-template-columns:minmax(280px,360px) minmax(0,1fr);gap:16px;align-items:start}
.user-create-panel,.user-list-panel{margin-bottom:0}
.user-form-grid{display:grid;grid-template-columns:1fr;gap:12px}
.user-form-grid .full{margin-top:0}
.user-setting-info{min-height:20px;margin-top:8px;font-size:12px}
.user-table-wrap{max-height:60vh;overflow:auto}
.user-table{min-width:720px}
.user-table th,.user-table td{padding:10px 11px}
.user-name-cell{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;font-size:13px}
.user-role-badge{background:#eef2f6!important;color:#1f4e79!important;border-radius:4px!important}
.user-actions .icon-btn{width:32px;height:32px}
.reset-note{margin:10px 0 0;font-size:12px}
.user-edit-modal-card{width:min(520px,94vw)!important;height:auto!important;max-height:90vh!important}
#editUserModal .modal-body{padding:16px}
#editUserModal .action-row{justify-content:flex-start;align-items:center}

@media(max-width:980px){
  .user-setting-grid{grid-template-columns:1fr}
  .user-table-wrap{max-height:55vh}
}


/* Update 2026-05-18: login logo tengah, toggle password, dan logout icon */
.login-card .login-logo,
.login-card .brand-badge{
  margin:0 auto 20px;
}
.login-card form{
  margin-top:0;
}
.password-field{
  position:relative;
  display:flex;
  align-items:center;
  width:100%;
}
.password-field input{
  padding-right:48px;
}
.password-toggle{
  position:absolute;
  right:7px;
  top:50%;
  transform:translateY(-50%);
  width:36px;
  height:36px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  color:#4b5563;
  display:grid;
  place-items:center;
  cursor:pointer;
}
.password-toggle:hover{
  background:#f3f4f6;
  color:#1f4e79;
}
.password-toggle .icon-eye-off{display:none}
.password-toggle.is-visible .icon-eye{display:none}
.password-toggle.is-visible .icon-eye-off{display:block}
.user-box{
  gap:8px;
}
.user-identity{
  display:grid;
  gap:1px;
  min-width:0;
}
.user-display-name{
  max-width:190px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.logout-icon-btn{
  width:38px;
  height:38px;
  min-width:38px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  color:#1f2937;
  display:inline-grid;
  place-items:center;
  cursor:pointer;
}
.logout-icon-btn:hover{
  background:#f3f4f6;
  color:#b42318;
  border-color:#d1d5db;
}
.mobile-user-exit{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin-top:2px;
}
.mobile-user-exit span{
  max-width:210px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#475467;
  font-size:13px;
}
@media(max-width:760px){
  .user-box{width:auto;max-width:100%;margin-left:auto}
  .user-display-name{max-width:140px}
  .logout-icon-btn{width:36px;height:36px;min-width:36px}
}


/* Update 2026-05-18: penyempurnaan tampilan login pastel dan copyright */
body.login-page{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:14px;
  padding:22px 14px;
  background:#eaf4f8!important;
  color:#172033;
}
.login-card{
  width:min(410px,92vw);
  background:#fffaf2!important;
  border:1px solid #b8d7e6!important;
  border-top:5px solid #7fb7d6!important;
  border-radius:14px!important;
  box-shadow:0 18px 50px rgba(60,96,128,.16)!important;
  padding:30px 28px 28px!important;
}
.login-card .login-logo,
.login-card .brand-badge{
  width:64px;
  height:64px;
  margin:0 auto 22px!important;
  border-radius:14px!important;
  background:#6fa8c7!important;
  border:1px solid #5f9ab8!important;
  color:#ffffff!important;
  font-size:15px;
  letter-spacing:.04em;
  box-shadow:none!important;
}
.login-card label{
  color:#334155;
  font-size:12px;
  font-weight:600;
  margin-top:12px;
}
.login-card input{
  height:44px;
  border-radius:8px!important;
  border-color:#c8d7e1!important;
  background:#ffffff!important;
  color:#172033;
}
.login-card input:focus{
  border-color:#7fb7d6!important;
  box-shadow:0 0 0 3px rgba(127,183,214,.20)!important;
}
.login-card .btn.primary.full{
  width:100%;
  margin-top:18px;
  border-radius:8px!important;
  background:#6fa8c7!important;
  border-color:#6fa8c7!important;
  color:#ffffff!important;
  box-shadow:none!important;
  font-weight:600;
}
.login-card .btn.primary.full:hover{
  background:#5f9ab8!important;
  border-color:#5f9ab8!important;
}
.login-card .alert{
  border-radius:8px!important;
  margin:0 0 14px;
}
.login-card .password-toggle{
  border-color:#c8d7e1!important;
  background:#f8fbfc!important;
  color:#4b6475;
  border-radius:7px!important;
}
.login-card .password-toggle:hover{
  background:#edf6fa!important;
  color:#245b78;
}
.login-copyright{
  width:min(410px,92vw);
  text-align:center;
  color:#516173;
  font-size:12px;
  line-height:1.45;
  background:#ffffffa8;
  border:1px solid #d8e6ed;
  border-radius:10px;
  padding:9px 12px;
}
@media(max-width:520px){
  body.login-page{padding:16px 12px;gap:12px}
  .login-card{padding:26px 20px 22px!important}
  .login-copyright{font-size:11px;padding:8px 10px}
}

/* Update 2026-05-18: scan foto multi halaman menjadi 1 PDF */
.scan-pages-block{
  display:grid;
  gap:10px;
}
.scan-page-list{
  display:grid;
  gap:9px;
}
.scan-page-item{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) 34px;
  align-items:center;
  gap:8px;
  padding:8px;
  border:1px solid #d1d5db;
  background:#f9fafb;
  border-radius:8px;
}
.scan-page-number{
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border:1px solid #cbd5e1;
  background:#fff;
  border-radius:6px;
  color:#1f4e79;
  font-weight:700;
  font-size:12px;
}
.scan-page-item input[type="file"]{
  width:100%;
  min-width:0;
}
.scan-page-item .icon-btn{
  width:32px;
  height:32px;
  color:#991b1b;
  border-color:#fca5a5;
  background:#fff;
  font-size:18px;
  line-height:1;
}
.scan-page-item .icon-btn:disabled{
  color:#9ca3af;
  border-color:#e5e7eb;
  background:#f9fafb;
}
.scan-page-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.scan-page-toolbar .btn{
  min-height:38px;
  padding:8px 12px;
}
.pdf-action-row{
  flex-wrap:wrap;
}
.pdf-result-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.pdf-result-actions .btn{
  min-height:40px;
}
#mobilePdfResultActions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:10px;
}
#mobilePdfResultActions.hidden{
  display:none!important;
}
#mobilePdfResultActions .btn{
  width:100%;
  margin-top:0;
}
@media(max-width:720px){
  .scan-page-item{
    grid-template-columns:30px minmax(0,1fr) 32px;
    gap:7px;
    padding:7px;
  }
  .scan-page-toolbar{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .scan-page-toolbar .btn{
    width:100%;
    font-size:12px;
    padding-left:8px;
    padding-right:8px;
  }
  .pdf-result-actions{
    width:100%;
  }
  .pdf-result-actions .btn{
    flex:1 1 130px;
  }
}
