/* ============================================================
   app.css — TraffCo (tampilan profesional)
   Palet terang default + mode gelap, aksen biru korporat.
   ============================================================ */

/* ===== 1. DESIGN TOKENS (LIGHT DEFAULT) ===== */
:root{
  --bg:#F4F6FA;
  --surface:#FFFFFF;
  --surface-2:#F0F3F8;
  --text:#15202E;
  --text-2:#4A5A6E;
  --muted:#7A8A9E;
  --border:#E2E8F1;
  --border-strong:#CBD5E1;

  --accent:#2456DB;
  --accent-hover:#1C46B8;
  --accent-soft:rgba(36,86,219,.09);
  --accent-contrast:#FFFFFF;

  --danger:#D92D20;
  --danger-soft:rgba(217,45,32,.08);
  --success:#12805C;
  --success-soft:rgba(18,128,92,.10);
  --warning:#B45309;
  --warning-soft:rgba(180,83,9,.10);

  --shadow-sm:0 1px 2px rgba(16,24,40,.05);
  --shadow-md:0 4px 14px rgba(16,24,40,.08);
  --shadow-lg:0 14px 34px rgba(16,24,40,.16);

  --radius-sm:8px;
  --radius:12px;
  --radius-lg:16px;

  --font:'Inter','Segoe UI',system-ui,-apple-system,Roboto,'Helvetica Neue',Arial,sans-serif;
  --mono:'Cascadia Mono','Consolas','SF Mono',ui-monospace,monospace;

  --header-h:56px;
}

/* ===== 2. MODE GELAP ===== */
body:not(.light-theme){
  --bg:#0D1420;
  --surface:#141D2B;
  --surface-2:#1B2636;
  --text:#E8EEF6;
  --text-2:#B4C2D4;
  --muted:#8494A8;
  --border:#263346;
  --border-strong:#33445C;

  --accent:#4C7DFF;
  --accent-hover:#6B95FF;
  --accent-soft:rgba(76,125,255,.14);

  --danger:#EF6B66;
  --danger-soft:rgba(239,107,102,.14);
  --success:#3BB88C;
  --success-soft:rgba(59,184,140,.14);
  --warning:#E8A23F;
  --warning-soft:rgba(232,162,63,.14);

  --shadow-sm:0 1px 2px rgba(0,0,0,.3);
  --shadow-md:0 4px 14px rgba(0,0,0,.35);
  --shadow-lg:0 14px 34px rgba(0,0,0,.5);
}

/* ===== 3. BASE ===== */
*{ margin:0; padding:0; box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  font-family:var(--font);
  font-size:15px;
  line-height:1.5;
  color:var(--text);
  background:var(--bg);
  min-height:100dvh;
  -webkit-font-smoothing:antialiased;
  transition:background .25s ease, color .25s ease;
}
button{ font-family:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent; }
input, select{ font-family:inherit; }
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
::selection{ background:var(--accent-soft); }

/* ikon svg utilitas */
.ic{
  width:18px; height:18px;
  flex:0 0 auto;
  stroke:currentColor; fill:none;
  stroke-width:1.8;
  stroke-linecap:round; stroke-linejoin:round;
}
.ic-fill{ fill:currentColor; stroke:none; }
.ic-sm{ width:15px; height:15px; }
.ic-lg{ width:22px; height:22px; }

/* ===== 4. APP SHELL ===== */
.app{
  max-width:600px;
  margin:0 auto;
  padding-bottom:40px;
}

/* ===== 5. TOPBAR ===== */
.topbar{
  position:sticky; top:0; z-index:40;
  display:flex; align-items:center; gap:10px;
  height:calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding:env(safe-area-inset-top, 0px) 14px 0;
  background:var(--surface);
  border-bottom:1px solid var(--border);
}
.topbar-title{ flex:1; min-width:0; }
.topbar-title strong{
  display:block;
  font-size:15px; font-weight:650;
  letter-spacing:-.01em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.topbar-title small{
  display:block;
  font-size:11px; font-weight:500;
  color:var(--muted);
  letter-spacing:.02em;
}

/* tombol ikon */
.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px;
  border:none; border-radius:10px;
  background:transparent;
  color:var(--text-2);
}
.icon-btn:hover{ background:var(--surface-2); color:var(--text); }

/* badge koneksi */
.conn{
  display:inline-flex; align-items:center; gap:6px;
  height:28px; padding:0 11px;
  border-radius:999px;
  font-size:12px; font-weight:600;
  letter-spacing:.01em;
  background:var(--surface-2);
  color:var(--text-2);
  border:1px solid var(--border);
  white-space:nowrap;
}
.conn-dot{
  width:7px; height:7px; border-radius:50%;
  background:var(--muted);
}
.conn.online{ background:var(--success-soft); color:var(--success); border-color:transparent; }
.conn.online .conn-dot{ background:var(--success); }
.conn.syncing{ background:var(--warning-soft); color:var(--warning); border-color:transparent; }
.conn.syncing .conn-dot{ background:var(--warning); animation:pulse 1.1s ease-in-out infinite; }
.conn.offline{ background:var(--danger-soft); color:var(--danger); border-color:transparent; }
.conn.offline .conn-dot{ background:var(--danger); }
.conn.lokal{ background:var(--surface-2); color:var(--muted); }
@keyframes pulse{ 0%,100%{ opacity:1 } 50%{ opacity:.35 } }

/* ===== 6. MENU ===== */
.menu-panel{
  position:fixed; z-index:80;
  top:calc(var(--header-h) + env(safe-area-inset-top, 0px) + 6px);
  left:12px;
  min-width:190px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow-lg);
  padding:6px;
  opacity:0; visibility:hidden;
  transform:translateY(-6px);
  transition:opacity .18s ease, transform .18s ease, visibility .18s;
}
.menu-panel.open{ opacity:1; visibility:visible; transform:translateY(0); }
.menu-item{
  display:flex; align-items:center; gap:10px;
  width:100%;
  padding:9px 12px;
  border:none; border-radius:9px;
  background:transparent;
  color:var(--text);
  font-size:14px; font-weight:500;
  text-align:left;
}
.menu-item:hover{ background:var(--surface-2); }
.menu-item .ic{ color:var(--muted); }
.menu-item:hover .ic{ color:var(--accent); }

/* ===== 7. TIMER STRIP ===== */
.timer-strip{
  text-align:center;
  padding:12px 16px 2px;
}
.timer-label{
  font-size:10px; font-weight:650;
  letter-spacing:.10em; text-transform:uppercase;
  color:var(--muted);
}
.timer-value{
  font-family:var(--mono);
  font-size:32px; font-weight:600;
  letter-spacing:.04em;
  color:var(--text);
  font-variant-numeric:tabular-nums;
  margin-top:2px;
}

/* ===== 8. PANEL / KARTU ===== */
.panel{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
  margin:14px 12px;
  padding:16px;
}

/* ===== 9. FORM ===== */
.field{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.field-label{
  font-size:10px; font-weight:650;
  letter-spacing:.07em; text-transform:uppercase;
  color:var(--muted);
}
.input, .controls input{
  height:36px;
  padding:0 11px;
  font-size:14px;
  color:var(--text);
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--radius);
  width:100%;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder, .controls input::placeholder{ color:var(--muted); }
.input:focus, .controls input:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-soft);
  background:var(--surface);
}

/* ===== 10. TOMBOL ===== */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  height:36px; padding:0 12px;
  font-size:13px; font-weight:600;
  letter-spacing:.01em;
  border-radius:10px;
  border:1px solid transparent;
  transition:background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
  white-space:nowrap;
}
.btn .ic{ width:16px; height:16px; }
.btn:active{ transform:translateY(1px); }
.btn-primary{
  background:var(--accent); color:var(--accent-contrast);
  box-shadow:0 1px 2px rgba(16,24,40,.12);
}
.btn-primary:hover{ background:var(--accent-hover); }
.btn-secondary{
  background:var(--surface); color:var(--text);
  border-color:var(--border-strong);
}
.btn-secondary:hover{ background:var(--surface-2); }
.btn-danger{
  background:var(--surface); color:var(--danger);
  border-color:var(--danger);
}
.btn-danger:hover{ background:var(--danger-soft); }
.btn-outline{
  background:var(--surface); color:var(--accent);
  border-color:var(--accent);
  width:100%;
}
.btn-outline:hover{ background:var(--accent-soft); }
.btn-outline.export-red{
  color:var(--danger); border-color:var(--danger);
}
.btn-outline.export-red:hover{ background:var(--danger-soft); }

/* ===== 11. CONTROLS ===== */
.controls{
  display:flex; flex-direction:column; gap:9px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
  margin:10px 12px;
  padding:12px;
  transition:border-color .2s ease, box-shadow .2s ease;
}
.controls.running{
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-soft), var(--shadow-sm);
}
.btn-row{
  display:grid;
  grid-template-columns:1.3fr 1fr 1fr;
  gap:7px;
}
.field-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
}
.controls .kode-desk{
  letter-spacing:.04em;
  text-transform:lowercase;
}

/* custom select */
.custom-select{ position:relative; }
.custom-select .selected{
  display:flex; align-items:center; justify-content:space-between;
  height:36px; padding:0 11px;
  font-size:14px; color:var(--text);
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--radius);
  cursor:pointer;
  user-select:none;
}
.custom-select .selected::after{
  content:'';
  width:7px; height:7px;
  border-right:1.8px solid var(--muted);
  border-bottom:1.8px solid var(--muted);
  transform:rotate(45deg) translateY(-2px);
  transition:transform .15s ease;
}
.custom-select.open .selected{
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-soft);
}
.custom-select.open .selected::after{ transform:rotate(225deg) translateY(-2px); }
.custom-select .options{
  position:absolute; z-index:70;
  top:calc(100% + 5px); left:0; right:0;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow-lg);
  padding:5px;
  display:none;
}
.custom-select.open .options{ display:block; }
.custom-select .options div{
  padding:9px 11px;
  border-radius:8px;
  font-size:14px; color:var(--text);
  cursor:pointer;
}
.custom-select .options div:hover{ background:var(--surface-2); }

/* ===== 12. TILE KENDARAAN ===== */
.tile-grid{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:12px;
  padding:6px 12px 12px;
}
.tile{
  display:flex; flex-direction:column; gap:12px;
  padding:16px;
  min-height:138px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
  text-align:left;
  transition:transform .06s ease, border-color .15s ease, box-shadow .15s ease, opacity .2s ease;
  user-select:none;
  touch-action:manipulation;
}
.tile:hover{ border-color:var(--border-strong); box-shadow:var(--shadow-md); }
.tile:active{ transform:scale(.975); }
.tile.disabled{ opacity:.5; pointer-events:none; }

.tile-top{
  display:flex; align-items:center; justify-content:space-between;
}
.tile-icon{
  display:flex; align-items:center; justify-content:center;
  width:52px; height:52px;
  border-radius:var(--radius);
  background:var(--tint-bg);
  color:var(--tint);
}
.tile-icon .ic{ width:30px; height:30px; }
.tile-count{
  font-size:38px; font-weight:700;
  line-height:1;
  letter-spacing:-.02em;
  color:var(--text);
  font-variant-numeric:tabular-nums;
}
.tile-label{
  display:flex; align-items:center; gap:8px;
  min-width:0;
}
.tile-label .code{
  font-size:12px; font-weight:700;
  letter-spacing:.06em;
  color:var(--tint);
  background:var(--tint-bg);
  padding:3px 9px;
  border-radius:7px;
  flex:0 0 auto;
}
.tile-label .fullname{
  font-size:13px; font-weight:500;
  color:var(--muted);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* warna per jenis kendaraan */
.tile.sm{  --tint:#2456DB; --tint-bg:rgba(36,86,219,.10); }
.tile.mp{  --tint:#0E8C7F; --tint-bg:rgba(14,140,127,.11); }
.tile.ks{  --tint:#C2740B; --tint-bg:rgba(194,116,11,.11); }
.tile.bb{  --tint:#7C4DD3; --tint-bg:rgba(124,77,211,.11); }
.tile.tb{  --tint:#D33B5C; --tint-bg:rgba(211,59,92,.10); }
.tile.ktb{ --tint:#12805C; --tint-bg:rgba(18,128,92,.11); }
.tile.pk{  --tint:#0B75B5; --tint-bg:rgba(11,117,181,.11); grid-column:1 / -1; }
body:not(.light-theme) .tile.sm{  --tint:#6B95FF; --tint-bg:rgba(107,149,255,.16); }
body:not(.light-theme) .tile.mp{  --tint:#3CBFB0; --tint-bg:rgba(60,191,176,.15); }
body:not(.light-theme) .tile.ks{  --tint:#E8A23F; --tint-bg:rgba(232,162,63,.15); }
body:not(.light-theme) .tile.bb{  --tint:#A98BF0; --tint-bg:rgba(169,139,240,.16); }
body:not(.light-theme) .tile.tb{  --tint:#F0798F; --tint-bg:rgba(240,121,143,.15); }
body:not(.light-theme) .tile.ktb{ --tint:#3BB88C; --tint-bg:rgba(59,184,140,.15); }
body:not(.light-theme) .tile.pk{  --tint:#4FA8DE; --tint-bg:rgba(79,168,222,.15); }

/* ===== 13. HALAMAN FULLSCREEN ===== */
.history-page, .help-page, .about-page, .settings-page{
  position:fixed; inset:0; z-index:90;
  display:flex !important;
  flex-direction:column;
  background:var(--bg);
  opacity:0; visibility:hidden;
  transform:translateY(8px);
  transition:opacity .18s ease, transform .18s ease, visibility .18s;
}
.history-page.open, .help-page.open, .about-page.open, .settings-page.open{
  opacity:1; visibility:visible; transform:translateY(0);
}

.page-header{
  display:flex; align-items:center; gap:8px;
  height:calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding:env(safe-area-inset-top, 0px) 12px 0;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  flex:0 0 auto;
}
.page-header .title{
  flex:1; min-width:0;
  font-size:15px; font-weight:650;
  letter-spacing:-.01em;
}
.page-body{
  flex:1; overflow-y:auto;
  padding:14px 12px 32px;
  max-width:600px;
  width:100%;
  margin:0 auto;
}

/* tombol aksi header history */
.action-btn{
  height:34px; padding:0 13px;
  font-size:13px; font-weight:600;
  border-radius:9px;
  border:1px solid var(--border-strong);
  background:var(--surface);
  color:var(--text);
}
.action-btn:hover{ background:var(--surface-2); }
.action-btn.primary{
  background:var(--accent); color:var(--accent-contrast);
  border-color:var(--accent);
}
.action-btn.primary:hover{ background:var(--accent-hover); }
.action-btn.danger{
  background:var(--danger-soft); color:var(--danger);
  border-color:transparent;
}

/* ===== 14. HISTORY ===== */
.history-toolbar{
  display:flex; flex-direction:column; gap:9px;
  margin-bottom:13px;
}
.history-search{
  height:42px;
  padding:0 13px 0 38px;
  font-size:14px;
  color:var(--text);
  background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237A8A9E' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center;
  border:1px solid var(--border);
  border-radius:var(--radius);
  width:100%;
}
.history-search:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-soft);
}
.history-filters{
  display:flex; align-items:center; gap:10px;
}
.history-filters .custom-select{ flex:1; }
.history-select-all{
  display:flex; align-items:center; gap:7px;
  font-size:12.5px; color:var(--text-2);
  white-space:nowrap;
  cursor:pointer;
}
.history-select-all input{ accent-color:var(--accent); width:16px; height:16px; }

.save-list{
  display:flex; flex-direction:column; gap:9px;
}
.save-item{
  display:flex; align-items:center; gap:12px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:12px 14px;
  box-shadow:var(--shadow-sm);
}
.save-item.archived{ opacity:.62; }
.save-item .info{ flex:1; min-width:0; }
.save-item .title{
  font-size:14px; font-weight:600;
  color:var(--text);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.save-item .meta{
  font-size:12px; color:var(--muted);
  margin-top:2px;
}
.save-item .actions{
  display:flex; gap:7px; flex:0 0 auto;
}
.preview-btn, .download-btn{
  display:inline-flex; align-items:center; gap:5px;
  height:32px; padding:0 11px;
  font-size:12.5px; font-weight:600;
  border-radius:8px;
  border:1px solid var(--border-strong);
  background:var(--surface);
  color:var(--text-2);
}
.preview-btn:hover, .download-btn:hover{
  background:var(--surface-2); color:var(--text);
}
.download-btn{
  color:var(--accent); border-color:transparent;
  background:var(--accent-soft);
}
.download-btn:hover{ background:var(--accent-soft); color:var(--accent-hover); }
.save-item .check input{ accent-color:var(--accent); width:17px; height:17px; cursor:pointer; }

/* ===== 15. SETTINGS ===== */
.settings-body, .help-body, .about-body{
  display:flex; flex-direction:column; gap:11px;
  max-width:600px; margin:0 auto;
}
.setting-item{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:13px 15px;
}
.setting-label{
  font-size:14px; font-weight:600;
  color:var(--text);
}
.setting-item select{
  height:38px;
  min-width:110px;
  padding:0 10px;
  font-size:14px;
  color:var(--text);
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:9px;
}
.setting-item select:focus{ outline:none; border-color:var(--accent); }
.setting-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.setting-btn{
  height:36px; padding:0 13px;
  font-size:13px; font-weight:600;
  border-radius:9px;
  border:1px solid var(--border-strong);
  background:var(--surface);
  color:var(--text);
}
.setting-btn:hover{ background:var(--surface-2); }
.setting-danger{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  height:42px;
  font-size:14px; font-weight:600;
  border-radius:var(--radius);
  border:1px solid transparent;
  background:var(--danger-soft);
  color:var(--danger);
  margin-top:6px;
}
.setting-danger:hover{ border-color:var(--danger); }
.setting-check{
  display:flex; align-items:center; gap:8px;
  font-size:13.5px; color:var(--text-2);
  cursor:pointer;
}
.setting-check input{ accent-color:var(--accent); width:16px; height:16px; }
.setting-item.col{
  flex-direction:column; align-items:flex-start; gap:11px;
}
.setting-checks{
  display:flex; flex-direction:column; gap:9px;
}

/* switch tema */
.theme-toggle{ position:relative; display:inline-flex; cursor:pointer; }
.theme-toggle input{ position:absolute; opacity:0; inset:0; cursor:pointer; }
.theme-track{
  display:flex; align-items:center; justify-content:space-between;
  width:64px; height:32px;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:999px;
  padding:0 6px;
  transition:background .2s ease;
}
.theme-thumb{
  position:absolute; top:4px; left:4px;
  width:24px; height:24px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:50%;
  box-shadow:var(--shadow-sm);
  display:flex; align-items:center; justify-content:center;
  transition:transform .2s ease;
  z-index:2;
}
.theme-toggle input:checked ~ .theme-thumb{ transform:translateX(32px); }
.theme-icon{
  display:flex; align-items:center; justify-content:center;
  width:24px; height:22px;
  font-size:12px;
  z-index:1;
}
.theme-icon .ic{ width:13px; height:13px; color:var(--muted); }

/* ===== 16. HELP & ABOUT ===== */
.help-card, .about-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:17px 18px;
  box-shadow:var(--shadow-sm);
}
.help-card h4, .about-card h4{
  font-size:14px; font-weight:650;
  letter-spacing:-.01em;
  margin-bottom:8px;
}
.about-logo{
  display:block;
  width:64px; height:64px;
  border-radius:16px;
  margin-bottom:12px;
  box-shadow:var(--shadow-sm);
}
.help-card ul{ list-style:none; display:flex; flex-direction:column; gap:7px; }
.help-card li{
  position:relative;
  padding-left:17px;
  font-size:13.5px; color:var(--text-2);
}
.help-card li::before{
  content:'';
  position:absolute; left:2px; top:8px;
  width:5px; height:5px; border-radius:50%;
  background:var(--accent);
}
.about-card p{
  font-size:13.5px; color:var(--text-2);
  margin-bottom:9px;
}
.about-dev{ font-weight:600; color:var(--text) !important; }
.about-meta{
  display:inline-flex; align-items:center; gap:6px;
  margin-top:6px;
  padding:4px 10px;
  background:var(--surface-2);
  border-radius:999px;
  font-size:11.5px; font-weight:600;
  color:var(--muted);
  letter-spacing:.03em;
}

/* ===== 17. MODAL DIALOG ===== */
.confirm-modal, .preview-modal{
  position:fixed; inset:0; z-index:120;
  display:flex !important;
  align-items:center; justify-content:center;
  padding:18px;
  background:rgba(9,14,22,.5);
  backdrop-filter:blur(3px);
  opacity:0; visibility:hidden;
  transition:opacity .18s ease, visibility .18s;
}
.confirm-modal.open, .preview-modal.open{ opacity:1; visibility:visible; }
.confirm-card, .preview-card{
  width:100%; max-width:380px;
  max-height:82dvh; overflow-y:auto;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lg);
  padding:20px;
}
.confirm-card{
  display:flex; flex-direction:column; gap:16px;
  font-size:15px; font-weight:600;
  text-align:center;
}
.confirm-card .buttons{
  display:grid; grid-template-columns:1fr 1fr; gap:9px;
}
.btn-cancel{
  height:40px;
  font-size:14px; font-weight:600;
  border-radius:10px;
  border:1px solid var(--border-strong);
  background:var(--surface);
  color:var(--text);
}
.btn-delete{
  height:40px;
  font-size:14px; font-weight:600;
  border-radius:10px;
  border:1px solid var(--danger);
  background:var(--danger);
  color:#fff;
}

.preview-card h3{
  font-size:16px; font-weight:650;
  letter-spacing:-.01em;
}
.preview-meta{
  font-size:12px; color:var(--muted);
  margin:4px 0 14px;
}
.preview-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-bottom:16px;
}
.pv-cell{
  display:flex; align-items:center; justify-content:space-between;
  padding:9px 12px;
  background:var(--surface-2);
  border-radius:9px;
  font-size:13px;
  color:var(--text-2);
}
.pv-cell b{
  font-size:15px; font-weight:700;
  color:var(--text);
  font-variant-numeric:tabular-nums;
}
.close-btn{
  width:100%; height:40px;
  font-size:14px; font-weight:600;
  border-radius:10px;
  border:1px solid var(--border-strong);
  background:var(--surface);
  color:var(--text);
}
.close-btn:hover{ background:var(--surface-2); }

/* ===== 17b. REFRESH WARNING OVERLAY ===== */
#refreshWarn{
  position:fixed; inset:0; z-index:150;
  display:none;
  align-items:center; justify-content:center;
  padding:18px;
  background:rgba(9,14,22,.5);
  backdrop-filter:blur(3px);
}

/* ===== 18. CONFIRM OVERLAY (EKSPOR) ===== */
.confirm-overlay{
  position:fixed; inset:0; z-index:130;
  display:flex; align-items:center; justify-content:center;
  padding:18px;
  background:rgba(9,14,22,.5);
  backdrop-filter:blur(3px);
  opacity:0; visibility:hidden;
  transition:opacity .18s ease, visibility .18s;
}
.confirm-overlay.show{ opacity:1; visibility:visible; }
.confirm-dialog{
  width:100%; max-width:330px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lg);
  padding:24px 22px;
  text-align:center;
}
.confirm-icon{
  display:flex; align-items:center; justify-content:center;
  width:52px; height:52px;
  margin:0 auto 13px;
  border-radius:50%;
  background:var(--accent-soft);
  color:var(--accent);
}
.confirm-icon .ic{ width:24px; height:24px; }
.confirm-title{
  font-size:16px; font-weight:650;
  letter-spacing:-.01em;
}
.confirm-message{
  font-size:13px; color:var(--muted);
  margin-top:5px;
}
.confirm-buttons{
  display:grid; grid-template-columns:1fr 1fr; gap:9px;
  margin-top:19px;
}
.confirm-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  height:40px;
  font-size:14px; font-weight:600;
  border-radius:10px;
  border:1px solid var(--border-strong);
  background:var(--surface);
  color:var(--text);
}
.confirm-yes{
  background:var(--accent); color:var(--accent-contrast);
  border-color:var(--accent);
}
.confirm-yes:hover{ background:var(--accent-hover); }
.confirm-no:hover{ background:var(--surface-2); }

/* ===== 19. TOAST NOTIFIKASI ===== */
.notification-popup{
  position:fixed; z-index:140;
  left:50%; bottom:22px;
  transform:translate(-50%, 16px);
  display:flex; align-items:center; gap:11px;
  min-width:280px; max-width:calc(100vw - 32px);
  padding:13px 16px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow-lg);
  opacity:0; visibility:hidden;
  transition:opacity .22s ease, transform .22s ease, visibility .22s;
}
.notification-popup.show{
  opacity:1; visibility:visible;
  transform:translate(-50%, 0);
}
.notification-icon{
  display:flex; align-items:center; justify-content:center;
  width:38px; height:38px;
  border-radius:10px;
  background:var(--success-soft);
  color:var(--success);
  flex:0 0 auto;
}
.notification-title{
  font-size:13.5px; font-weight:650;
  color:var(--text);
}
.notification-message{
  font-size:12px; color:var(--muted);
}

/* ===== 20. REFRESH WARNING ===== */
.refresh-warn-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lg);
  padding:24px;
  text-align:center;
  max-width:300px;
}
.refresh-warn-card h3{
  font-size:16px; font-weight:650;
  margin-bottom:6px;
}
.refresh-warn-card p{
  font-size:13.5px; color:var(--muted);
}
.refresh-warn-card .btn{
  margin-top:16px;
  min-width:130px;
}

/* ===== 21. RESPONSIVE ===== */
@media (max-width:420px){
  .tile-grid{ gap:10px; padding:6px 10px 12px; }
  .tile{ padding:13px; min-height:118px; gap:10px; }
  .tile-icon{ width:44px; height:44px; }
  .tile-icon .ic{ width:25px; height:25px; }
  .tile-count{ font-size:31px; }
  .timer-value{ font-size:28px; }
}
@media (min-width:620px){
  .panel{ margin:16px auto; }
  .tile-grid{ padding:6px 16px 12px; }
}
