/* ═══════════════════════════════════════════════════════════
   KalRecycle Green Hospital — Design System v3
   Trust & Authority · Healthcare ops · 8pt grid
   See: design-system/MASTER.md
═══════════════════════════════════════════════════════════ */
:root {
  /* Brand — teal healthcare + eco green accent */
  --brand: #0F766E;
  --brand-hover: #0D9488;
  --brand-press: #115E59;
  --brand-soft: #CCFBF1;
  --brand-muted: #F0FDFA;
  --accent: #15803D;
  --accent-soft: #DCFCE7;

  /* Semantic */
  --danger: #B91C1C;
  --danger-soft: #FEE2E2;
  --warn: #B45309;
  --warn-soft: #FEF3C7;
  --info: #0369A1;
  --info-soft: #E0F2FE;
  --success: #15803D;
  --success-soft: #DCFCE7;

  /* Neutrals */
  --text: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #F1F5F9;

  /* Shell */
  --sidebar-bg: #0B1220;
  --sidebar-elev: #111827;
  --sidebar-text: #E2E8F0;
  --sidebar-muted: #94A3B8;
  --sidebar-hover: rgba(255,255,255,.06);
  --sidebar-active: #0F766E;
  --sidebar-w: 268px;
  --topbar-h: 64px;

  /* Shape & motion */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --shadow-xs: 0 1px 2px rgba(15,23,42,.05);
  --shadow-sm: 0 4px 12px rgba(15,23,42,.06);
  --shadow-md: 0 10px 28px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 48px rgba(15,23,42,.12);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --transition: .18s cubic-bezier(.4,0,.2,1);
  --ring: 0 0 0 3px rgba(15,118,110,.18);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
  overflow-x: hidden;
  min-width: 0;
  max-width: 100vw;
}
img, video, canvas, svg { max-width: 100%; height: auto; display: block; }
iframe { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ── Typography ── */
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; border: 1px solid transparent;
  cursor: pointer; transition: var(--transition); white-space: nowrap; line-height: 1.2;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary, .btn-green {
  background: var(--brand); color: #fff;
  box-shadow: 0 2px 8px rgba(15,118,110,.28);
}
.btn-primary:hover, .btn-green:hover { background: var(--brand-hover); color: #fff; }
.btn-primary:active, .btn-green:active { background: var(--brand-press); }
.btn-outline {
  background: var(--surface); color: var(--text-secondary);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-muted); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: none; }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn i, .btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 7px;
}
.form-label .req { color: var(--danger); }
.form-control, .form-select {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px;
  transition: var(--transition); outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand); box-shadow: var(--ring);
}
.form-control:read-only, .form-control[readonly] {
  background: var(--surface-2); color: var(--text-secondary);
}
.form-control::placeholder { color: var(--text-muted); }
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: 0; }
.input-group-addon {
  display: flex; align-items: center; padding: 0 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
}
.file-upload {
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  padding: 20px; text-align: center; cursor: pointer; transition: var(--transition);
  background: var(--surface-2);
}
.file-upload:hover { border-color: var(--brand); background: var(--brand-muted); }
.file-upload input { display: none; }

/* ── Alerts ── */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 20px; border: 1px solid;
}
.alert i, .alert svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--brand-muted); border-color: #99F6E4; color: #115E59; }
.alert-danger { background: var(--danger-soft); border-color: #FECACA; color: #991B1B; }
.alert-info { background: var(--info-soft); border-color: #BAE6FD; color: #0C4A6E; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
}
.badge-green { background: var(--brand-soft); color: #0F766E; }
.badge-red { background: var(--danger-soft); color: #991B1B; }
.badge-yellow, .badge-amber { background: var(--warn-soft); color: #92400E; }
.badge-blue { background: var(--info-soft); color: #075985; }
.badge-purple { background: #F3E8FF; color: #6B21A8; }
.badge-gray { background: var(--surface-3); color: var(--text-secondary); }

/* ══════════════════════════════════════
   PUBLIC PAGES (Input Sumber / Olahan)
══════════════════════════════════════ */
.pub-body { background: var(--surface-2); min-height: 100vh; }

.pub-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.88); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
}
.pub-header-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.pub-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-with-logo { gap: 0; line-height: 0; }
/* Brand logo — white plate, size by width so mark stays large */
.brand-logo-plate {
  display: inline-flex; align-items: center; justify-content: center;
  background: #ffffff; border-radius: 12px; padding: 8px 12px; line-height: 0;
}
.app-logo-img {
  height: auto; width: auto; max-height: 52px; max-width: min(240px, 50vw);
  object-fit: contain; display: block; background: #ffffff; border-radius: 0; padding: 0;
}
.app-logo-img-sm {
  max-height: 40px; max-width: min(180px, 46vw);
}
.pub-user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  background: var(--surface-2, #f1f5f9); border: 1px solid var(--border-light, #e2e8f0);
  max-width: 200px;
}
.pub-user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #4ADE80, var(--brand, #16a34a));
  color: #fff; font-size: 11px; font-weight: 800;
  display: grid; place-items: center; flex-shrink: 0;
}
.pub-user-meta { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.pub-user-meta strong { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-user-meta small { font-size: 10px; color: var(--text-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* Brand di sidebar: logo + tagline (override di .dash-sidebar-brand) */
.dash-brand-logo {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-decoration: none;
  background: transparent; border-radius: 0; padding: 0;
  box-sizing: border-box; line-height: 1.2;
}

/* Ops workbar — fitur scan/kerja selalu kelihatan */
.ops-workbar {
  max-width: 1100px; margin: 0 auto 16px; padding: 12px 16px;
  background: #fff; border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 14px; box-shadow: 0 4px 16px rgba(15,23,42,.04);
}
.ops-workbar-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.ops-workbar-label i { width: 14px; height: 14px; }
.ops-workbar-items { display: flex; flex-wrap: wrap; gap: 8px; }
.ops-workbar-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--surface-2, #f1f5f9); color: var(--text-secondary);
  border: 1px solid transparent; text-decoration: none; transition: .15s;
}
.ops-workbar-item i { width: 14px; height: 14px; }
.ops-workbar-item:hover { background: var(--brand-muted, #dcfce7); color: var(--brand, #16a34a); }
.ops-workbar-item.active {
  background: var(--brand, #16a34a); color: #fff; border-color: var(--brand, #16a34a);
}
@media (max-width: 768px) {
  .ops-workbar { margin: 0 12px 12px; }
  .pub-user-meta { display: none; }
}
.pub-brand-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #4ADE80, var(--brand));
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(22,163,74,.3);
}
.pub-brand-icon svg { width: 22px; height: 22px; color: #fff; }
.pub-brand-text { line-height: 1.2; }
.pub-brand-text strong { display: block; font-size: 15px; font-weight: 800; color: var(--text); }
.pub-brand-text span { font-size: 11px; color: var(--text-muted); font-weight: 500; }

.pub-nav { display: flex; gap: 4px; }
.pub-nav a {
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  transition: var(--transition);
}
.pub-nav a:hover { background: var(--surface-3); color: var(--text); }
.pub-nav a.active { background: var(--brand-muted); color: var(--brand); }

.pub-main { max-width: 1100px; margin: 0 auto; padding: 32px 24px 48px; }

.page-hero { margin-bottom: 28px; }
.page-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-soft); padding: 6px 12px;
  border-radius: 999px; margin-bottom: 12px;
}
.page-hero h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 800; letter-spacing: -.02em; margin: 0 0 8px; }
.page-hero p { color: var(--text-secondary); font-size: 15px; margin: 0; max-width: 560px; }

.form-shell {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.form-shell-header {
  padding: 24px 28px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.form-shell-body { padding: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 320px; gap: 32px; }
@media (max-width: 860px) { .form-grid { grid-template-columns: 1fr; } }

.qr-card {
  background: linear-gradient(160deg, var(--brand-muted), var(--surface));
  border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 24px; text-align: center;
}
.qr-card-img {
  width: 148px; height: 148px; margin: 0 auto 16px;
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 10px; box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
}
.qr-card-code { font-size: 13px; font-weight: 700; color: var(--brand); font-family: ui-monospace, monospace; }
.qr-card-desc { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.tong-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.tong-kuning { background: var(--warn-soft); color: #92400E; }
.tong-hijau { background: var(--brand-soft); color: #166534; }

.demo-qr-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.empty-state {
  text-align: center; padding: 48px 24px;
}
.empty-state-icon {
  width: 64px; height: 64px; margin: 0 auto 16px;
  background: var(--brand-muted); border-radius: 50%;
  display: grid; place-items: center; color: var(--brand);
}
.empty-state-icon svg { width: 28px; height: 28px; }

/* ══════════════════════════════════════
   LOGIN
══════════════════════════════════════ */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .login-page { grid-template-columns: 1fr; } }

.login-brand {
  background: linear-gradient(150deg, #042F2E 0%, #0F766E 48%, #115E59 100%);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
@media (max-width: 900px) { .login-brand { display: none; } }
.login-brand::before {
  content: ''; position: absolute; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(45,212,191,.18), transparent 70%);
  top: -120px; right: -80px; pointer-events: none;
}
.login-brand::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.18));
  pointer-events: none;
}
.login-brand-inner { position: relative; z-index: 1; max-width: 420px; }
.login-brand h2 { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: 0 0 16px; }
.login-brand p { font-size: 16px; color: rgba(255,255,255,.75); line-height: 1.7; margin: 0 0 32px; }
.login-features { display: flex; flex-direction: column; gap: 14px; }
.login-feature {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: rgba(255,255,255,.85);
}
.login-feature-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,.1); display: grid; place-items: center; flex-shrink: 0;
}
.login-feature-icon svg { width: 18px; height: 18px; }

.login-form-side {
  display: flex; align-items: center; justify-content: center;
  padding: 32px 24px; background: var(--surface);
}
.login-form-wrap { width: min(400px, 100%); }
.login-form-wrap .mobile-brand { display: none; margin-bottom: 32px; }
@media (max-width: 900px) { .login-form-wrap .mobile-brand { display: flex; } }
.login-logo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  min-width: 0;
}
.login-logo-row.sm { margin-bottom: 0; gap: 12px; }
.login-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.login-brand-name {
  color: #ffffff !important;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  white-space: normal;
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.login-brand-tag {
  display: block;
  color: rgba(255,255,255,.78);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
}
/* SIRS tagline — bold & warna */
.login-brand-sirs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.login-brand-sirs b {
  font-weight: 800;
  font-style: normal;
}
.login-brand-sirs .sirs-p1 {
  color: #5eead4;
  text-shadow: 0 0 18px rgba(94,234,212,.45);
}
.login-brand-sirs .sirs-p2 {
  color: #fde68a;
  text-shadow: 0 0 14px rgba(253,230,138,.35);
}
.login-brand-sirs .sirs-p3 {
  color: #86efac;
  text-shadow: 0 0 14px rgba(134,239,172,.4);
}
.login-brand-sirs .sirs-sep {
  font-style: normal;
  font-weight: 700;
  color: rgba(255,255,255,.45);
  font-size: 12px;
}
.login-brand-sirs.mobile {
  font-size: 11.5px;
  gap: 4px 6px;
}
.login-brand-sirs.mobile .sirs-p1 { color: #0f766e; text-shadow: none; }
.login-brand-sirs.mobile .sirs-p2 { color: #b45309; text-shadow: none; }
.login-brand-sirs.mobile .sirs-p3 { color: #15803d; text-shadow: none; }
.login-brand-sirs.mobile .sirs-sep { color: #94a3b8; }
.login-brand-name.mobile {
  color: var(--brand, #0F766E) !important;
  font-size: 18px;
  text-shadow: none;
}
.login-logo-wrap {
  margin-bottom: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #ffffff; border-radius: 16px; padding: 10px 12px;
  line-height: 0;
  flex-shrink: 0;
}
.login-logo-wrap.sm { margin-bottom: 0; padding: 8px 10px; border-radius: 12px; }
.login-logo-img {
  height: auto; width: auto; max-width: 96px; max-height: 96px;
  object-fit: contain; display: block; background: #ffffff; padding: 0;
}
.login-logo-img.sm {
  max-width: 64px; max-height: 64px;
}
.login-form-wrap h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.login-form-wrap .subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }
.login-footer-links {
  margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border-light);
  display: flex; justify-content: center; gap: 20px; font-size: 13px;
}
.login-footer-links a { color: var(--text-muted); font-weight: 500; transition: var(--transition); }
.login-footer-links a:hover { color: var(--brand); }

/* ══════════════════════════════════════
   DASHBOARD SHELL
══════════════════════════════════════ */
.dash-body { background: var(--surface-2); }
.dash-app { display: flex; min-height: 100vh; }

.dash-sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
  transition: transform var(--transition);
  color: var(--sidebar-text);
}
.dash-sidebar-brand {
  min-height: 88px; height: auto; padding: 14px 12px;
  display: flex; align-items: center; justify-content: stretch;
  border-bottom: 1px solid rgba(255,255,255,.08); flex-shrink: 0;
  background: #020617;
}
.dash-sidebar-brand .pub-brand-icon { width: 36px; height: 36px; border-radius: 10px; }
.dash-sidebar-brand .pub-brand-icon svg { width: 20px; height: 20px; }
.dash-brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-decoration: none;
  min-width: 0;
}
.dash-brand-logo img,
.dash-logo-img {
  background: #ffffff !important;
  border-radius: 10px !important;
  padding: 5px !important;
  width: auto !important;
  height: auto !important;
  max-width: 56px !important;
  max-height: 56px !important;
  object-fit: contain !important;
  display: block !important;
  box-shadow: none !important;
  margin: 0;
  flex-shrink: 0;
}
/* Lambang RS (logors.jpg) — proporsi kotak di kiri teks */
.dash-logo-rs {
  max-width: 52px !important;
  max-height: 52px !important;
  border-radius: 10px !important;
  padding: 4px !important;
}
.dash-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #f8fafc;
}
.dash-brand-rs {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
}
.dash-brand-sub {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #cbd5e1;
  line-height: 1.3;
}
.dash-brand-text em,
.dash-brand-sub em {
  font-style: normal;
  color: #5eead4;
  font-weight: 800;
}
/* Public header brand (scan guest / header ops) */
.pub-brand.brand-with-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}
.pub-brand .brand-logo-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
  flex-shrink: 0;
  line-height: 0;
}
.pub-brand .app-logo-img {
  width: auto !important;
  height: auto !important;
  max-width: 44px !important;
  max-height: 44px !important;
  object-fit: contain !important;
  display: block !important;
  background: #fff !important;
}
.pub-brand .app-logo-img-sm {
  max-width: 36px !important;
  max-height: 36px !important;
}
.pub-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.2;
}
.pub-brand-rs {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.pub-brand-sub {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.pub-brand-sub em {
  font-style: normal;
  color: var(--brand);
  font-weight: 800;
}
.login-logo-rs {
  width: auto !important;
  max-width: 96px !important;
  max-height: 96px !important;
  object-fit: contain !important;
}
.login-logo-rs.sm {
  max-width: 64px !important;
  max-height: 64px !important;
}
.dash-content-lead {
  margin: 0 0 16px; font-size: 13.5px; color: var(--text-muted); font-weight: 500;
  max-width: 720px; line-height: 1.5;
}
.dash-user-chevron {
  width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0;
}
.dash-user-menu a svg, .dash-user-menu a i {
  width: 16px; height: 16px; flex-shrink: 0;
}
.role-pill svg, .role-pill i { width: 12px; height: 12px; }

.dash-nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.dash-nav-section {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sidebar-muted); padding: 14px 12px 8px;
}
.dash-nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--sidebar-muted); font-weight: 600; font-size: 13.5px;
  transition: var(--transition); margin-bottom: 2px;
}
.dash-nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.dash-nav-link.active {
  background: linear-gradient(90deg, var(--sidebar-active), #0D9488);
  color: #fff;
  box-shadow: 0 4px 14px rgba(15,118,110,.35);
}
.dash-nav-link i, .dash-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }
.dash-sidebar-footer {
  padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.08);
  color: var(--sidebar-muted); font-size: 11px; line-height: 1.4;
  background: var(--sidebar-elev);
}
.dash-sidebar-footer strong { color: #F8FAFC; font-weight: 700; }

.dash-main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.dash-topbar {
  height: var(--topbar-h); background: rgba(255,255,255,.92); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(15,23,42,.02);
}
.dash-topbar-left { display: flex; align-items: center; gap: 16px; }
.dash-menu-btn {
  display: none; width: 40px; height: 40px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); cursor: pointer;
  align-items: center; justify-content: center;
}
.dash-menu-btn svg { width: 20px; height: 20px; }
.dash-page-title { font-size: 18px; font-weight: 800; letter-spacing: -.025em; margin: 0; color: var(--text); }
.dash-page-sub { font-size: 13px; color: var(--text-muted); margin: 3px 0 0; font-weight: 500; }
.dash-breadcrumb { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.dash-breadcrumb a { color: var(--text-secondary); font-weight: 600; }
.dash-breadcrumb a:hover { color: var(--brand); }
.dash-breadcrumb .sep { margin: 0 6px; opacity: .45; }
.dash-breadcrumb .current { color: var(--text-muted); }
.dash-page-sub { font-size: 13px; color: var(--text-muted); margin: 0; }

.dash-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 6px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-light); background: var(--surface);
  cursor: pointer; transition: var(--transition); position: relative;
}
.dash-user:hover { border-color: var(--border); box-shadow: var(--shadow-xs); }
.dash-user-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}
.dash-user-info { line-height: 1.2; }
.dash-user-info strong { display: block; font-size: 13px; font-weight: 600; }
.dash-user-info span { font-size: 11px; color: var(--text-muted); }
.dash-user-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 180px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 6px; z-index: 60;
}
.dash-user-menu.open { display: block; }
.dash-user-menu a, .dash-user-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px; border: none; background: none; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; text-align: left;
}
.dash-user-menu a:hover, .dash-user-menu button:hover { background: var(--surface-2); color: var(--text); }
.dash-user-menu .danger { color: var(--danger); }

.dash-content { padding: 24px 28px 40px; max-width: 1400px; }
.dash-content-header { margin-bottom: 20px; }
.dash-topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.dash-topbar-left > div { min-width: 0; }
.dash-page-title {
  font-size: 17px; font-weight: 800; letter-spacing: -.02em;
  margin: 0; color: var(--text); line-height: 1.25;
  max-width: min(520px, 48vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── KPI Cards ── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
@media (max-width: 640px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi-card {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: flex-start;
  box-shadow: var(--shadow-xs); transition: var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow-sm); border-color: #CBD5E1; }
.kpi-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-icon.green { background: var(--brand-soft); color: var(--brand); }
.kpi-icon.blue { background: var(--info-soft); color: var(--info); }
.kpi-icon.amber { background: var(--warn-soft); color: var(--warn); }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: var(--text); line-height: 1.15; margin-top: 2px; }
.kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; display: flex; align-items: center; gap: 4px; }

.kpi-card {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 22px 24px;
  display: flex; align-items: flex-start; gap: 16px;
  box-shadow: var(--shadow-xs); transition: var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border); }
.kpi-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; flex-shrink: 0;
}
.kpi-icon svg { width: 24px; height: 24px; }
.kpi-icon.green { background: var(--brand-soft); color: var(--brand); }
.kpi-icon.blue { background: var(--info-soft); color: var(--info); }
.kpi-icon.amber { background: var(--warn-soft); color: var(--warn); }
.kpi-body { min-width: 0; }
.kpi-label { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.kpi-trend-up { color: var(--brand); font-weight: 600; }

/* ── Panels ── */
.panel-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; margin-bottom: 20px; }
.panel-grid-2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
@media (max-width: 1024px) { .panel-grid, .panel-grid-2 { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius); box-shadow: var(--shadow-xs); overflow: hidden;
}
.panel-head {
  padding: 18px 22px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.panel-head h3 { font-size: 15px; font-weight: 700; margin: 0; }
.panel-head span { font-size: 12px; color: var(--text-muted); }
.panel-body { padding: 22px; }
.panel-body.chart-body { padding: 16px 20px 20px; }

/* ── Data Table ── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 11px 16px; font-size: 11px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 13px 16px; border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary); vertical-align: middle;
}
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .mono { font-family: ui-monospace, monospace; font-size: 12px; }
.rank-badge {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--surface-3); font-size: 12px; font-weight: 700;
  display: grid; place-items: center; color: var(--text-secondary);
}
.rank-badge.top { background: var(--brand-soft); color: var(--brand); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.ok { background: var(--brand); }
.status-dot.no { background: var(--danger); }

/* ── Export cards ── */
.export-grid { display: flex; flex-direction: column; gap: 12px; }
.export-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-light); background: var(--surface-2);
  transition: var(--transition); cursor: pointer;
}
.export-card:hover { border-color: var(--brand); background: var(--brand-muted); transform: translateY(-1px); }
.export-card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0;
}
.export-card-icon svg { width: 22px; height: 22px; }
.export-card-icon.excel { background: var(--brand-soft); color: var(--brand); }
.export-card-icon.pdf { background: var(--danger-soft); color: var(--danger); }
.export-card-text strong { display: block; font-size: 14px; font-weight: 700; }
.export-card-text span { font-size: 12px; color: var(--text-muted); }

/* ── Install page ── */
.install-page {
  min-height: 100vh; display: grid; place-items: center;
  padding: 32px 24px; background: var(--surface-2);
}
.install-card {
  width: min(520px, 100%); background: var(--surface);
  border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.install-card-head {
  padding: 32px 32px 24px; text-align: center;
  background: linear-gradient(180deg, var(--brand-muted), var(--surface));
}
.install-card-body { padding: 28px 32px 32px; }

/* ── Overlay ── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.4); z-index: 150;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .dash-sidebar { transform: translateX(-100%); }
  .dash-sidebar.open { transform: translateX(0); }
  .dash-main { margin-left: 0; }
  .dash-menu-btn { display: flex; }
  .pub-nav { display: none; }
  .dash-content { padding: 20px 16px; }
  .dash-topbar { padding: 0 16px; }
}
@media (max-width: 640px) {
  .pub-main { padding: 20px 16px 32px; }
  .form-shell-body { padding: 20px; }
  .form-shell-header { padding: 20px; }
}

/* Bootstrap overrides when loaded */
.container { max-width: 1100px; }
.row { display: flex; flex-wrap: wrap; margin: 0 -12px; }
.col-md-7, .col-md-5, .col-lg-7, .col-lg-5, .col-lg-8, .col-lg-4, .col-md-4 {
  padding: 0 12px; flex: 1 1 100%;
}
@media (min-width: 768px) {
  .col-md-7 { flex: 0 0 58.33%; max-width: 58.33%; }
  .col-md-5 { flex: 0 0 41.67%; max-width: 41.67%; }
  .col-md-4 { flex: 0 0 33.33%; max-width: 33.33%; }
}
@media (min-width: 992px) {
  .col-lg-7 { flex: 0 0 58.33%; max-width: 58.33%; }
  .col-lg-5 { flex: 0 0 41.67%; max-width: 41.67%; }
  .col-lg-8 { flex: 0 0 66.67%; max-width: 66.67%; }
  .col-lg-4 { flex: 0 0 33.33%; max-width: 33.33%; }
}
.g-3 > *, .g-4 > * { margin-bottom: 16px; }
.g-4 > * { margin-bottom: 20px; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-3 { margin-bottom: 16px; }
.mt-3 { margin-top: 16px; }
.w-100 { width: 100%; }
.fw-bold { font-weight: 700; }
.small { font-size: 13px; }
.text-center { text-align: center; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.btn-outline-success { background: var(--surface); border: 1px solid var(--brand); color: var(--brand); padding: 7px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; display: inline-flex; }
.btn-outline-success:hover { background: var(--brand-muted); }
.btn-outline-secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary); padding: 7px 14px; border-radius: var(--radius-sm); font-size: 13px; }
details summary { cursor: pointer; font-weight: 600; color: var(--text-secondary); }

/* ── Table toolbar, filter, pagination ── */
.table-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border-light);
  background: var(--surface-2);
}
.table-toolbar-client { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.table-toolbar-search {
  flex: 1; min-width: 200px; position: relative; display: flex; align-items: center;
}
.table-toolbar-search > i, .table-toolbar-search > svg {
  position: absolute; left: 12px; width: 18px; height: 18px; color: var(--text-muted); pointer-events: none;
}
.table-search-input {
  width: 100%; padding: 10px 12px 10px 40px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; background: var(--surface); outline: none;
}
.table-search-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22,163,74,.1); }
.table-toolbar-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.table-filter-select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--surface); color: var(--text-secondary); cursor: pointer;
}
.table-pagination {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-top: 1px solid var(--border-light); background: var(--surface-2);
}
.table-pagination-info { font-size: 13px; color: var(--text-muted); }
.table-pagination-nav { display: flex; gap: 4px; align-items: center; }
.page-btn {
  min-width: 36px; height: 36px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); font-size: 13px; font-weight: 600;
  color: var(--text-secondary); cursor: pointer; transition: var(--transition);
  text-decoration: none;
}
.page-btn:hover { border-color: var(--brand); color: var(--brand); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(15,118,110,.25); }
.page-btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* Panel polish */
.panel {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(180deg, #fff, var(--surface-2));
}
.panel-head h3 { font-size: 15px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.panel-body { padding: 18px; }

/* Data table polish */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; padding: 11px 14px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary); vertical-align: middle;
}
.data-table tbody tr:hover td { background: var(--brand-muted); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.page-btn svg { width: 16px; height: 16px; }

/* ── Password toggle ── */
.password-wrap { position: relative; display: flex; align-items: stretch; }
.password-wrap .form-control {
  padding-right: 48px; border-radius: var(--radius-sm);
}
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: none; background: transparent;
  border-radius: 8px; cursor: pointer; color: var(--text-muted);
  display: grid; place-items: center; transition: var(--transition);
}
.pw-toggle:hover { background: var(--surface-3); color: var(--text); }
.pw-toggle svg { width: 18px; height: 18px; }

/* ── WYSIWYG Quill ── */
.wysiwyg-wrap { margin-bottom: 4px; }
.wysiwyg-editor { min-height: 140px; font-size: 14px; }
.wysiwyg-wrap .ql-toolbar.ql-snow {
  border: 1px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--surface-2); font-family: var(--font);
}
.wysiwyg-wrap .ql-container.ql-snow {
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--surface); min-height: 120px;
}
.wysiwyg-wrap .ql-editor { min-height: 120px; }
textarea.wysiwyg { display: none !important; }

/* ══════════════════════════════════════
   VISUAL LAYER — pattern, ilustrasi, depth
══════════════════════════════════════ */
.page-backdrop {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.page-backdrop .bg-pattern { width: 100%; height: 100%; opacity: 1; }
.pub-body, .dash-body, .login-body { position: relative; }
.pub-body > *:not(.page-backdrop),
.dash-body > *:not(.page-backdrop),
.login-body > *:not(.page-backdrop) { position: relative; z-index: 1; }

/* Login atmosphere */
.login-blob {
  position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none;
}
.login-blob-a { width: 320px; height: 320px; background: rgba(74,222,128,.18); top: -80px; right: -60px; }
.login-blob-b { width: 260px; height: 260px; background: rgba(14,165,233,.12); bottom: -40px; left: -40px; }
.login-hero-wrap { margin-top: 36px; opacity: .95; }
.login-hero-art { width: 100%; max-width: 380px; height: auto; display: block; }

/* Public hero split */
.page-hero-split {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center;
  margin-bottom: 28px;
}
@media (max-width: 768px) {
  .page-hero-split { grid-template-columns: 1fr; }
  .page-hero-visual { display: none; }
}
.page-hero-visual {
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(240,253,244,.95));
  border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.page-hero-visual .empty-illus { width: 100%; max-width: 220px; height: auto; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.85); border: 1px solid var(--border-light);
  color: var(--text-secondary); box-shadow: var(--shadow-xs);
}
.hero-chip svg { width: 14px; height: 14px; color: var(--brand); }

/* Olahan hero icons */
.olah-icon-stack { display: flex; gap: 12px; align-items: flex-end; }
.olah-icon-card {
  width: 72px; height: 72px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border-light);
  display: grid; place-items: center; color: var(--brand);
  box-shadow: var(--shadow-sm); transition: transform .3s ease;
}
.olah-icon-card:nth-child(2) { transform: translateY(-12px); }
.olah-icon-card.accent { background: linear-gradient(135deg, var(--brand-muted), #fff); border-color: #BBF7D0; }
.olah-icon-card svg { width: 32px; height: 32px; }

/* Empty state illustration */
.empty-state-visual { margin: 0 auto 20px; max-width: 200px; }
.empty-state-visual .empty-illus { width: 100%; height: auto; }

/* Dashboard welcome banner */
.dash-welcome {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 26px; margin-bottom: 24px;
  background: linear-gradient(120deg, #fff 0%, var(--brand-muted) 55%, #ECFDF5 100%);
  border: 1px solid #BBF7D0; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden; position: relative;
}
.dash-welcome::before {
  content: ''; position: absolute; top: -40px; right: 120px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(74,222,128,.25), transparent 70%);
  pointer-events: none;
}
.dash-welcome-greet { font-size: 20px; font-weight: 800; letter-spacing: -.02em; display: block; margin-bottom: 4px; }
.dash-welcome-text p { margin: 0; font-size: 14px; color: var(--text-secondary); }
.dash-banner-art { width: 160px; height: auto; flex-shrink: 0; opacity: .9; }
@media (max-width: 640px) { .dash-welcome-art { display: none; } }

/* KPI decorative accent */
.kpi-card { position: relative; overflow: hidden; }
.kpi-card::after {
  content: ''; position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: radial-gradient(circle, var(--brand-soft), transparent 70%);
  opacity: .5; pointer-events: none;
}

/* Panels subtle top accent */
.panel { position: relative; }
.panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), #2DD4BF, transparent);
  border-radius: var(--radius) var(--radius) 0 0; opacity: .7;
  pointer-events: none;
}

/* QR card illustration bg */
.qr-card {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--brand-muted) 0%, var(--surface) 50%, #F0F9FF 100%);
}
.qr-card::before {
  content: ''; position: absolute; bottom: -30px; left: -30px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(15,118,110,.08);
}

/* Form shell elevation */
.form-shell {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

/* Dark sidebar — full height, never white hybrid */
.dash-sidebar {
  background: #0B1220 !important;
  color: #E2E8F0 !important;
  box-shadow: 4px 0 32px rgba(2, 6, 23, .22);
  border-right: 1px solid rgba(255,255,255,.06) !important;
}
.dash-sidebar-brand {
  position: relative;
  background: #020617 !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
}
.dash-sidebar-brand::after {
  content: ''; position: absolute; bottom: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(45,212,191,.4), transparent);
}
.dash-nav {
  background: transparent !important;
}
.dash-nav-link {
  color: #94A3B8 !important;
}
.dash-nav-link:hover {
  background: rgba(255,255,255,.07) !important;
  color: #F8FAFC !important;
}
.dash-nav-link.active {
  background: linear-gradient(90deg, #0F766E, #0D9488) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(15,118,110,.4), inset 3px 0 0 #5EEAD4 !important;
  border-color: transparent !important;
}
.dash-nav-link.active svg,
.dash-nav-link.active i { opacity: 1 !important; color: #fff !important; }
.dash-nav-section {
  color: #64748B !important;
  font-size: 10px !important;
  letter-spacing: .08em !important;
}
.dash-sidebar-footer {
  background: #020617 !important;
  color: #94A3B8 !important;
  border-top: 1px solid rgba(255,255,255,.08) !important;
}
.dash-sidebar-footer strong {
  display: block !important;
  color: #F8FAFC !important;
  font-size: 12px !important;
  margin-bottom: 4px !important;
}
.dash-sidebar-footer span {
  display: block;
  font-size: 11px;
  line-height: 1.4;
  opacity: .9;
}

/* Pub header glass */
.pub-header {
  background: rgba(255,255,255,.9);
  box-shadow: 0 1px 0 var(--border-light);
}
/* ══════════════════════════════════════
   WORKSTATION STANDARD (all ops roles)
══════════════════════════════════════ */
.ws-kpi{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}
@media(max-width:1100px){.ws-kpi{grid-template-columns:1fr 1fr}}
@media(max-width:640px){.ws-kpi{grid-template-columns:1fr}}
.ws-kpi-card{display:flex;align-items:center;gap:12px;padding:14px 16px;background:var(--surface);border:1px solid var(--border-light);border-radius:14px;box-shadow:var(--shadow-xs)}
.ws-kpi-card.warn{border-color:#fcd34d;background:linear-gradient(135deg,#fffbeb,#fff)}
.ws-kpi-card.ok{border-color:#86efac;background:linear-gradient(135deg,#f0fdf4,#fff)}
.ws-kpi-ico{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:var(--surface-2);color:var(--brand);flex-shrink:0}
.ws-kpi-ico.green{background:#dcfce7;color:#16a34a}
.ws-kpi-ico.amber{background:#fef3c7;color:#d97706}
.ws-kpi-ico.blue{background:#dbeafe;color:#2563eb}
.ws-kpi-ico.red{background:#fee2e2;color:#dc2626}
.ws-kpi-ico.purple{background:#f3e8ff;color:#7c3aed}
.ws-kpi-ico i,.ws-kpi-ico svg{width:20px;height:20px}
.ws-kpi-label{font-size:11px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.03em}
.ws-kpi-val{font-size:26px;font-weight:800;color:var(--text);line-height:1.15;margin-top:2px}
.ws-kpi-val.sm{font-size:18px}

.ws-tabs{display:flex;gap:8px;margin-bottom:16px;flex-wrap:wrap}
.ws-tab{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;border-radius:999px;font-size:13px;font-weight:700;background:var(--surface);border:1px solid var(--border-light);color:var(--text-secondary);text-decoration:none;transition:.15s}
.ws-tab i,.ws-tab svg{width:16px;height:16px}
.ws-tab:hover{border-color:var(--brand);color:var(--brand)}
.ws-tab.active{background:var(--brand);border-color:var(--brand);color:#fff}
.ws-tab-badge{min-width:22px;height:22px;padding:0 7px;border-radius:999px;background:rgba(0,0,0,.12);font-size:11px;display:inline-flex;align-items:center;justify-content:center}
.ws-tab.active .ws-tab-badge{background:rgba(255,255,255,.22)}
.ws-tab-badge.muted{background:var(--surface-2);color:var(--text-muted)}

.ws-bench{display:grid;grid-template-columns:1.15fr .95fr;gap:16px;align-items:start}
.ws-bench.form-left{grid-template-columns:.95fr 1.15fr}
@media(max-width:1100px){.ws-bench,.ws-bench.form-left{grid-template-columns:1fr}}
.ws-sub{margin:4px 0 0;font-size:12px;color:var(--text-muted);font-weight:500}

.ws-queue{display:flex;flex-direction:column;min-height:480px}
.ws-queue-list{padding:12px;display:flex;flex-direction:column;gap:10px;max-height:520px;overflow:auto;flex:1}
.ws-queue-item{text-align:left;border:1.5px solid var(--border-light);background:var(--surface);border-radius:14px;padding:12px 14px;cursor:pointer;transition:.15s;font:inherit;color:inherit;width:100%}
.ws-queue-item:hover{border-color:#86efac;background:#f0fdf4;box-shadow:0 4px 14px rgba(22,163,74,.08)}
.ws-queue-item.selected{border-color:var(--brand);background:linear-gradient(135deg,#f0fdf4,#fff);box-shadow:0 0 0 3px rgba(22,163,74,.12)}
.ws-qi-top{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:6px}
.ws-qi-time{font-size:11px;color:var(--text-muted)}
.ws-qi-title{font-size:14px;font-weight:800;color:var(--text)}
.ws-qi-meta{display:flex;flex-wrap:wrap;gap:10px;margin-top:8px;font-size:12px;color:var(--text-secondary)}
.ws-qi-meta span{display:inline-flex;align-items:center;gap:4px}
.ws-qi-meta i,.ws-qi-meta svg{width:13px;height:13px}
.ws-qi-selected{margin-top:8px;font-size:11px;font-weight:700;color:#15803d;display:inline-flex;align-items:center;gap:4px}
.ws-qi-selected i,.ws-qi-selected svg{width:13px;height:13px}
.ws-empty{padding:40px 20px;text-align:center;color:var(--text-muted);display:flex;flex-direction:column;align-items:center;gap:6px}
.ws-empty i,.ws-empty svg{width:36px;height:36px;opacity:.5}
.ws-empty strong{color:var(--text);font-size:14px}
.ws-empty span{max-width:340px;line-height:1.45;font-size:13px}

/* Panduan workstation / field terkunci */
.ws-guide{
  margin:0 0 16px;padding:12px 14px;border-radius:12px;
  background:linear-gradient(135deg,#f0fdfa,#ecfeff);
  border:1px solid #99f6e4;color:#134e4a;font-size:13px;
}
.ws-guide-warn{background:linear-gradient(135deg,#fffbeb,#fef3c7);border-color:#fcd34d;color:#78350f}
.ws-guide-ok{background:linear-gradient(135deg,#f0fdf4,#dcfce7);border-color:#86efac;color:#14532d}
.ws-guide-head{display:flex;align-items:center;gap:8px;margin-bottom:8px;font-size:13px}
.ws-guide-head i,.ws-guide-head svg{width:18px;height:18px;flex-shrink:0}
.ws-guide-steps{margin:0;padding-left:1.25rem;line-height:1.5}
.ws-guide-steps li{margin:4px 0}
.ws-locked-hint{
  display:flex;gap:10px;align-items:flex-start;
  margin:10px 0 14px;padding:12px 14px;border-radius:12px;
  background:#fff7ed;border:1px solid #fdba74;color:#9a3412;font-size:13px;
}
.ws-locked-hint i,.ws-locked-hint svg{width:18px;height:18px;flex-shrink:0;margin-top:2px;color:#ea580c}
.ws-locked-hint strong{display:block;font-size:13px;margin-bottom:4px;color:#c2410c}
.ws-locked-hint p{margin:0;line-height:1.45}
.ws-locked-how{margin-top:6px !important;font-size:12px}
.ws-locked-how span{font-weight:700}
.form-hint{display:flex;align-items:flex-start;gap:6px;margin:6px 0 0;font-size:12px;color:var(--text-muted);line-height:1.4}
.form-hint i,.form-hint svg{width:14px;height:14px;flex-shrink:0;margin-top:1px}
.form-hint-must{color:#b45309}
.form-hint-lock{color:#c2410c}
.btn[disabled],.btn:disabled{cursor:not-allowed;opacity:.55}
.btn-disabled-wrap{display:flex;flex-direction:column;gap:8px;width:100%}
[data-theme="dark"] .ws-guide{background:rgba(15,118,110,.15);border-color:rgba(45,212,191,.35);color:#ccfbf1}
[data-theme="dark"] .ws-guide-warn{background:rgba(180,83,9,.2);border-color:rgba(251,191,36,.35);color:#fde68a}
[data-theme="dark"] .ws-locked-hint{background:rgba(154,52,18,.2);border-color:rgba(251,146,60,.4);color:#fed7aa}

/* Dock panduan — melayang kanan bawah; mobile mudah ditutup */
.ws-help-dock{
  position:fixed !important;
  z-index:99950 !important;
  right:18px !important;
  left:auto !important;
  bottom:18px !important;
  width:min(380px, calc(100vw - 28px)) !important;
  max-height:min(55vh, 420px);
  display:flex !important;
  flex-direction:column;
  background:#fff !important;
  border:1px solid #99f6e4 !important;
  border-radius:16px;
  box-shadow:0 16px 48px rgba(15,23,42,.28), 0 0 0 1px rgba(15,118,110,.08);
  overflow:hidden;
  pointer-events:auto !important;
}
.ws-help-dock-bar{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:10px 12px;background:linear-gradient(135deg,#0f766e,#0d9488);color:#fff;
  flex-shrink:0;position:relative;z-index:2;
}
.ws-help-dock-title{
  display:flex;align-items:center;gap:8px;font-size:13px;font-weight:800;
  min-width:0;flex:1;overflow:hidden;
}
.ws-help-dock-title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ws-help-dock-title i,.ws-help-dock-title svg{width:16px;height:16px;flex-shrink:0}
.ws-help-dock-actions{
  display:flex;align-items:center;gap:6px;flex-shrink:0;position:relative;z-index:3;
}
.ws-help-dock-min,.ws-help-dock-close{
  min-width:40px;min-height:40px;width:40px;height:40px;border:0;border-radius:10px;
  cursor:pointer;background:rgba(255,255,255,.22);color:#fff;
  font-size:20px;line-height:1;font-weight:700;padding:0;
  display:inline-flex;align-items:center;justify-content:center;
  touch-action:manipulation;-webkit-tap-highlight-color:transparent;
  pointer-events:auto !important;
}
.ws-help-dock-close{
  min-width:auto;width:auto;padding:0 12px;font-size:13px;font-weight:800;
}
.ws-help-dock-min:hover,.ws-help-dock-close:hover,
.ws-help-dock-min:active,.ws-help-dock-close:active{background:rgba(255,255,255,.4)}
.ws-help-dock-body{
  overflow:auto;padding:12px 14px;display:flex;flex-direction:column;gap:12px;
  max-height:min(42vh, 340px);flex:1;min-height:0;
  -webkit-overflow-scrolling:touch;
}
.ws-help-dock-body .ws-guide,
.ws-help-dock-body .ws-locked-hint{margin:0;font-size:12.5px}
.ws-help-dock-body .ws-guide-steps{font-size:12.5px}
.ws-help-dock-foot{
  margin:0;padding:8px 14px 12px;font-size:11px;color:#64748b;line-height:1.4;flex-shrink:0;
  border-top:1px solid #e2e8f0;background:#f8fafc;
}
.ws-help-dock-dismiss{
  flex-shrink:0;margin:0;padding:10px 12px 12px;background:#f8fafc;
  border-top:1px solid #e2e8f0;
}
.ws-help-dock-dismiss-btn{
  width:100%;min-height:44px;border:0;border-radius:12px;cursor:pointer;
  background:#0f766e;color:#fff;font-weight:800;font-size:14px;font-family:inherit;
  touch-action:manipulation;-webkit-tap-highlight-color:transparent;
  pointer-events:auto !important;
}
.ws-help-dock-dismiss-btn:active{filter:brightness(.95)}
.ws-help-dock.is-min{max-height:none !important}
.ws-help-dock.is-min .ws-help-dock-body,
.ws-help-dock.is-min .ws-help-dock-foot,
.ws-help-dock.is-min .ws-help-dock-dismiss{display:none !important}

.ws-help-reopen{
  position:fixed !important;z-index:99949 !important;
  right:18px !important;left:auto !important;bottom:18px !important;
  display:inline-flex !important;align-items:center;gap:8px;
  padding:12px 16px;border-radius:999px;border:0;min-height:44px;
  background:linear-gradient(135deg,#0f766e,#0d9488);color:#fff !important;
  font-weight:800;font-size:13px;cursor:pointer;
  box-shadow:0 10px 28px rgba(15,118,110,.45);font-family:inherit;
  touch-action:manipulation;
}
.ws-help-reopen i,.ws-help-reopen svg{width:16px;height:16px}
.ws-help-reopen:hover{filter:brightness(1.08)}

@media (max-width:640px){
  .ws-help-dock{
    left:8px !important;
    right:8px !important;
    bottom:max(8px, env(safe-area-inset-bottom, 0px)) !important;
    width:auto !important;
    max-width:none !important;
    max-height:min(70vh, 520px) !important;
  }
  .ws-help-dock-body{max-height:min(48vh, 360px)}
  .ws-help-dock-title{font-size:12.5px}
  .ws-help-reopen{
    right:10px !important;
    bottom:max(10px, env(safe-area-inset-bottom, 0px)) !important;
  }
}
[data-theme="dark"] .ws-help-dock{background:#1e293b !important;border-color:#334155 !important}
[data-theme="dark"] .ws-help-dock-foot,
[data-theme="dark"] .ws-help-dock-dismiss{color:#94a3b8;border-color:#334155;background:#0f172a}
[data-theme="dark"] .ws-help-dock-dismiss-btn{background:#14b8a6}

.ws-form{position:sticky;top:84px}
.ws-form-grid{display:flex;flex-direction:column;gap:4px}
.ws-form-section{padding:4px 0 12px;border-bottom:1px solid var(--border-light);margin-bottom:8px}
.ws-form-section:last-of-type{border-bottom:0}
.ws-form-section-title{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);margin-bottom:10px}
.ws-hasil-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.ws-hasil-grid.cols-3{grid-template-columns:1fr 1fr 1fr}
.ws-hasil-grid.cols-pilah{grid-template-columns:1fr 1fr;gap:10px}
@media(min-width:720px){.ws-hasil-grid.cols-pilah{grid-template-columns:1fr 1fr}}
@media(max-width:520px){.ws-hasil-grid,.ws-hasil-grid.cols-3,.ws-hasil-grid.cols-pilah{grid-template-columns:1fr}}
.ws-note{display:flex;align-items:flex-start;gap:6px;font-size:12px;color:var(--text-muted);margin:4px 0 0}
.ws-note i,.ws-note svg{width:14px;height:14px;flex-shrink:0;margin-top:1px}
.ws-form-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:12px;flex-wrap:wrap}
.ws-form-actions .btn-lg{min-width:180px}

.ws-pick-grid{display:grid;grid-template-columns:1fr;gap:8px}
.ws-pick{display:flex;align-items:center;gap:10px;padding:12px 14px;border:1.5px solid var(--border-light);border-radius:12px;cursor:pointer;font-weight:600;font-size:13px;transition:.15s;background:var(--surface);position:relative}
.ws-pick input{position:absolute;opacity:0;pointer-events:none;width:0;height:0}
.ws-pick i,.ws-pick svg{width:18px;height:18px;color:var(--brand);flex-shrink:0}
.ws-pick:hover,.ws-pick:has(input:checked),.ws-pick.active{border-color:var(--brand);background:#f0fdf4;box-shadow:0 0 0 3px rgba(34,197,94,.12)}
.ws-pick:has(input:checked)::after{content:"";width:10px;height:10px;border-radius:50%;background:var(--brand);margin-left:auto;flex-shrink:0;box-shadow:0 0 0 3px rgba(15,118,110,.2)}
.ws-pick:has(input[type=checkbox]:checked)::after{border-radius:3px}
.ws-pick:has(input:disabled){opacity:.55;cursor:not-allowed}
.ws-toggle-2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.ws-toggle-2 input{display:none}
.ws-toggle-card{display:flex;align-items:center;justify-content:center;gap:8px;padding:14px;border-radius:12px;border:1.5px solid var(--border-light);font-weight:600;font-size:13px;cursor:pointer;background:var(--surface)}
.ws-toggle-2 input:checked + .ws-toggle-card.ok{border-color:#16a34a;background:#f0fdf4;color:#15803d}
.ws-toggle-2 input:checked + .ws-toggle-card.bad{border-color:#dc2626;background:#fef2f2;color:#b91c1c}
.ws-toggle-card i,.ws-toggle-card svg{width:16px;height:16px}

.ws-chip-row{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
/* ══════════════════════════════════════
   RESPONSIVE SYSTEM — all breakpoints
   phone · phablet · tablet · desktop
══════════════════════════════════════ */
.dash-app,.dash-main,.dash-content,.login-page,.pub-main,.panel,.form-shell {
  min-width: 0;
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  max-width: 100%;
}
.data-table { min-width: 640px; }
.btn, .page-btn, .ws-tab, .quick-action, .login-demo-chip {
  touch-action: manipulation;
}

/* —— Large tablet / small laptop —— */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ws-queue { min-height: 0; }
  .ws-queue-list { max-height: min(48vh, 420px); }
}

/* —— Tablet (sidebar collapses) —— */
@media (max-width: 1024px) {
  .dash-content { padding: 16px 14px 28px; }
  .dash-topbar { padding: 8px 12px; gap: 8px; }
  .dash-topbar-left { gap: 10px; min-width: 0; flex: 1; }
  .dash-page-title {
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-size: 16px;
    line-height: 1.3;
  }
  .dash-breadcrumb { display: none; }
  .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 12px 14px;
  }
  .panel-body { padding: 14px; }
  .ws-form { position: static; top: auto; }
  .export-card { padding: 14px; }
  .export-card-text span { display: block; }
  .quick-actions { gap: 8px; }
  .quick-action { padding: 10px 12px; font-size: 12.5px; }
  .login-form-side { padding: 24px 18px max(24px, env(safe-area-inset-bottom)); }
  .login-brand-name { font-size: 22px; }
}

/* —— Phone landscape / large phone —— */
@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .kpi-card { padding: 14px; gap: 12px; }
  .kpi-value { font-size: 22px; }
  .kpi-icon { width: 40px; height: 40px; border-radius: 12px; }
  .kpi-icon svg { width: 20px; height: 20px; }
  .ws-kpi { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ws-kpi-val { font-size: 22px; }
  .ws-kpi-val.sm { font-size: 16px; }
  .panel-grid, .panel-grid-2 { grid-template-columns: 1fr; gap: 14px; }
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 10px;
  }
  .table-toolbar-search { min-width: 0; width: 100%; }
  .table-toolbar-filters {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .table-filter-select { width: 100%; min-width: 0; }
  .table-pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }
  .table-pagination-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  .data-table { min-width: 560px; font-size: 12.5px; }
  .data-table th, .data-table td { padding: 10px 12px; }
  .ws-form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .ws-form-actions .btn,
  .ws-form-actions .btn-lg {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }
  .btn-block, .btn-lg.btn-block { width: 100%; }
  .login-footer-links { flex-wrap: wrap; gap: 12px; }
  .dash-welcome { flex-direction: column; align-items: flex-start; }
  .pub-header-inner { padding: 0 12px; gap: 10px; }
  .pub-brand-text { max-width: 42vw; }
  .ops-workbar { margin: 0 12px 12px; }
  .form-shell-header, .form-shell-body { padding: 16px; }
  .ui-modal-overlay { padding: 12px; align-items: flex-end; }
  .ui-modal { width: 100%; max-height: min(92vh, 100%); border-radius: 16px 16px 12px 12px; }
}

/* —— Compact phone —— */
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .ws-kpi { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ws-kpi-card { padding: 12px; }
  .ws-kpi-label { font-size: 10px; }
  .ws-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 6px;
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
    padding-right: 4px;
    scrollbar-width: none;
  }
  .ws-tabs::-webkit-scrollbar { display: none; }
  .ws-tab { flex-shrink: 0; padding: 10px 14px; min-height: 42px; }
  .dash-content { padding: 12px 10px 88px; } /* space for help chip */
  .dash-page-title { font-size: 15px; max-width: calc(100vw - 140px); }
  .dash-menu-btn { width: 42px; height: 42px; flex-shrink: 0; }
  .dash-user { padding: 4px; border: 0; background: transparent; }
  .dash-user-chevron { display: none; }
  .panel-head h3 { font-size: 14px; line-height: 1.3; }
  .panel-head > div { min-width: 0; flex: 1; }
  .export-grid { max-width: none !important; }
  .export-card { flex-wrap: wrap; }
  .ws-queue-list { max-height: min(42vh, 360px); padding: 10px; }
  .ws-queue-item { padding: 12px; }
  .ws-qi-title { font-size: 13.5px; }
  .login-logo-row { gap: 12px; margin-bottom: 20px; }
  .login-brand-name { font-size: 20px; white-space: normal; }
  .login-brand-name.mobile { font-size: 16px; }
  .login-form-wrap h1 { font-size: 22px; }
  .login-form-wrap .subtitle { margin-bottom: 20px; }
  .login-form-side { padding: 20px 14px max(20px, env(safe-area-inset-bottom)); }
  .table-toolbar-filters { grid-template-columns: 1fr; }
  .ws-toggle-2 { grid-template-columns: 1fr; }
  .ws-hasil-grid, .ws-hasil-grid.cols-3, .ws-hasil-grid.cols-pilah { grid-template-columns: 1fr; }
  .ws-chip-row { gap: 6px; }
  .page-hero h1 { font-size: 22px; }
  .pub-main { padding: 16px 12px 28px; }
  /* charts */
  .panel-body.chart-body,
  .chart-body { overflow-x: auto; }
  canvas { max-width: 100% !important; }
}

/* —— Very small phones (≤380px) —— */
@media (max-width: 380px) {
  .ws-kpi { grid-template-columns: 1fr; }
  .kpi-value { font-size: 20px; }
  .dash-content { padding: 10px 8px 96px; }
  .login-brand-name { font-size: 17px; }
  .ws-tab { padding: 9px 12px; font-size: 12.5px; }
  .btn-lg { padding: 12px 14px; font-size: 14px; }
  .data-table { min-width: 520px; font-size: 12px; }
}

/* —— Short height (landscape phone) —— */
@media (max-height: 480px) and (orientation: landscape) {
  .ws-help-dock { max-height: 85vh !important; }
  .ws-help-dock-body { max-height: 50vh !important; }
  .login-page { min-height: 100dvh; }
  .login-form-side { align-items: flex-start; padding-top: 16px; }
  .ws-queue-list { max-height: 50vh; }
}

/* —— Prefer dynamic viewport units when supported —— */
@supports (height: 100dvh) {
  .login-page { min-height: 100dvh; }
  .dash-app { min-height: 100dvh; }
  .install-page { min-height: 100dvh; }
}

/* Safe areas (notch / home indicator) */
.dash-sidebar {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.dash-topbar {
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
}
.dash-content {
  padding-bottom: max(40px, calc(24px + env(safe-area-inset-bottom, 0px)));
}
@media (max-width: 640px) {
  .dash-content {
    padding-bottom: max(88px, calc(72px + env(safe-area-inset-bottom, 0px)));
  }
}

/* Prevent iOS zoom-on-focus for inputs < 16px */
@media (max-width: 640px) {
  .form-control, .form-select, .table-search-input, .table-filter-select,
  input[type="text"], input[type="password"], input[type="number"],
  input[type="search"], input[type="email"], select, textarea {
    font-size: 16px !important;
  }
}

/* Print: hide chrome */
@media print {
  .dash-sidebar, .dash-topbar, .ws-help-dock, .ws-help-reopen,
  .sidebar-overlay, .sirs-tour, .page-backdrop { display: none !important; }
  .dash-main { margin-left: 0 !important; }
  .dash-content { padding: 0 !important; max-width: none !important; }
}
