/* =========================================
   THEME TOKENS (SIRIUS OS INSPIRED)
   ========================================= */
:root, [data-theme="sirius-orange"] {
  --primary: #FF6B00;
  --primary-2: #FF9A3C;
  --primary-soft: rgba(255, 107, 0, 0.12);
  --bg-grad: linear-gradient(135deg, #FFF7F0 0%, #FFE8D6 50%, #FFFFFF 100%);
  --surface: rgba(255, 255, 255, 0.84);
  --surface-solid: #FFFFFF;
  --border: rgba(255, 107, 0, 0.16);
  --text: #1E293B;
  --text-muted: #64748B;
  --shadow: 0 12px 32px -8px rgba(255, 107, 0, 0.14);
}

[data-theme="ocean-glass"] {
  --primary: #0284C7;
  --primary-2: #38BDF8;
  --primary-soft: rgba(2, 132, 199, 0.12);
  --bg-grad: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 50%, #FFFFFF 100%);
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #FFFFFF;
  --border: rgba(2, 132, 199, 0.18);
  --text: #0F172A;
  --text-muted: #64748B;
  --shadow: 0 12px 32px -8px rgba(2, 132, 199, 0.15);
}

[data-theme="emerald-mint"] {
  --primary: #059669;
  --primary-2: #34D399;
  --primary-soft: rgba(5, 150, 105, 0.12);
  --bg-grad: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 50%, #FFFFFF 100%);
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #FFFFFF;
  --border: rgba(5, 150, 105, 0.18);
  --text: #064E3B;
  --text-muted: #475569;
  --shadow: 0 12px 32px -8px rgba(5, 150, 105, 0.14);
}

[data-theme="royal-violet"] {
  --primary: #7C3AED;
  --primary-2: #A78BFA;
  --primary-soft: rgba(124, 58, 237, 0.12);
  --bg-grad: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 50%, #FFFFFF 100%);
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #FFFFFF;
  --border: rgba(124, 58, 237, 0.18);
  --text: #1E1B4B;
  --text-muted: #64748B;
  --shadow: 0 12px 32px -8px rgba(124, 58, 237, 0.15);
}

[data-theme="midnight-dark"] {
  --primary: #FF7A1A;
  --primary-2: #FFB067;
  --primary-soft: rgba(255, 122, 26, 0.18);
  --bg-grad: linear-gradient(135deg, #0B1120 0%, #111827 60%, #1E293B 100%);
  --surface: rgba(30, 41, 59, 0.78);
  --surface-solid: #1E293B;
  --border: rgba(255, 255, 255, 0.1);
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --shadow: 0 14px 36px -8px rgba(0, 0, 0, 0.45);
}

:root {
  --ok: #10B981;
  --ok-bg: rgba(16, 185, 129, 0.12);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --warn: #F59E0B;
  --warn-bg: rgba(245, 158, 11, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.25s ease;
}

.hidden { display: none !important; }

/* =========================================
   GLASS CARDS & ANIMATIONS
   ========================================= */
.glass {
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.fade-up {
  animation: fadeUp 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 var(--primary-soft); }
  70% { box-shadow: 0 0 0 10px rgba(255, 107, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0); }
}

/* =========================================
   LOGIN VIEW
   ========================================= */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 410px;
  padding: 32px 26px;
  text-align: center;
}

.brand-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 18px;
  margin: 0 auto 12px;
  display: block;
  background: #fff;
  padding: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.login-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; }
.login-sub { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 24px; }

/* =========================================
   APP SHELL & NAVBAR
   ========================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 0 0 20px 20px;
  border-top: none;
}

.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-logo { width: 38px; height: 38px; border-radius: 10px; object-fit: contain; background: #fff; padding: 3px; flex-shrink: 0; }
.topbar-info { min-width: 0; }
.topbar-title { font-size: 0.95rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-badge { font-size: 0.72rem; color: var(--primary); font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 14px 96px;
}

/* Bottom Navigation (Mobile & Desktop Floating Dock) */
.bottom-nav {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  width: min(94vw, 520px);
  justify-content: space-around;
}

.nav-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s ease;
}

.nav-btn svg { width: 20px; height: 20px; transition: transform 0.22s ease; }
.nav-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #FFFFFF;
  box-shadow: 0 6px 16px -4px var(--primary);
}
.nav-btn.active svg { transform: scale(1.1); }

/* =========================================
   FORM HEADER & SECTIONS
   ========================================= */
.form-hero {
  text-align: center;
  padding: 24px 18px;
  margin-bottom: 16px;
}

.form-hero .brand-logo { width: 84px; height: 84px; }
.form-hero h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; }
.form-hero p { font-size: 0.86rem; color: var(--text-muted); margin-top: 2px; }
.store-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.section-card { padding: 18px; margin-bottom: 16px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}

.section-title-wrap { display: flex; align-items: center; gap: 10px; }
.sec-num {
  width: 30px; height: 30px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 800; font-size: 0.85rem;
  display: grid; place-items: center; flex-shrink: 0;
}
.sec-title { font-size: 1rem; font-weight: 800; }
.sec-sub { font-size: 0.75rem; color: var(--text-muted); }

/* =========================================
   INPUTS, GRIDS & BUTTONS
   ========================================= */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }

@media (max-width: 600px) {
  .grid-2.stack-sm { grid-template-columns: 1fr; }
  /* grid-2 TANPA stack-sm tetap kiri-kanan di HP (untuk Tanggal & Hari, PIC, dll) */
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; text-align: left; }
.field label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); display: flex; align-items: center; justify-content: space-between; }

input[type="text"], input[type="password"], input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

textarea { resize: vertical; min-height: 92px; white-space: pre-wrap; }

.input-icon-wrap { position: relative; display: flex; align-items: center; }
.input-icon-wrap input { padding-right: 42px; }
.icon-eye-btn {
  position: absolute; right: 10px; background: none; border: none;
  color: var(--text-muted); cursor: pointer; display: grid; place-items: center; padding: 4px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: var(--radius-sm); border: none;
  font-weight: 700; font-size: 0.86rem; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #FFFFFF; box-shadow: 0 6px 18px -5px var(--primary);
}
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-ok { background: var(--ok-bg); color: var(--ok); }
.btn-sm { padding: 7px 11px; font-size: 0.78rem; border-radius: 10px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; }
.w-full { width: 100%; }

/* Info SVG Trigger */
.info-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  border: none; display: grid; place-items: center; cursor: pointer;
  animation: pulseRing 2.6s infinite;
}

/* =========================================
   CHIPS, MULTI-SHIFT & ZONES
   ========================================= */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--surface-solid);
  color: var(--text); font-size: 0.82rem; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.2s;
}
.chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; border-color: transparent;
}

.staff-summary-bar {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 10px;
}
.stat-mini {
  padding: 10px; border-radius: var(--radius-sm);
  background: var(--primary-soft); text-align: center;
}
.stat-mini .val { font-size: 1.2rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.stat-mini .lbl { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); margin-top: 2px; }

.zone-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-solid); border: 1.5px solid var(--border);
  margin-bottom: 8px;
}
.zone-meta { min-width: 0; }
.zone-name { font-size: 0.88rem; font-weight: 800; }
.zone-count { font-size: 0.75rem; color: var(--text-muted); }
.zone-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* =========================================
   KPI CARDS
   ========================================= */
.kpi-box {
  padding: 14px; border-radius: var(--radius-sm);
  background: var(--surface-solid); border: 1.5px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.kpi-box-head { display: flex; justify-content: space-between; align-items: center; }
.kpi-title { font-size: 0.84rem; font-weight: 800; }
.kpi-tag { font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }

.kpi-result {
  padding: 8px 10px; border-radius: 10px; font-size: 0.78rem; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.kpi-result.good { background: var(--ok-bg); color: var(--ok); }
.kpi-result.bad { background: var(--danger-bg); color: var(--danger); }
.kpi-result.neutral { background: var(--primary-soft); color: var(--text-muted); }

.ideal-note {
  padding: 10px 12px; border-radius: 10px;
  background: var(--warn-bg); color: var(--text);
  font-size: 0.76rem; line-height: 1.45;
}

/* =========================================
   SIGNATURE CANVAS
   ========================================= */
.sig-wrap {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  overflow: hidden;
  position: relative;
}
#sigCanvas { width: 100%; height: 170px; display: block; touch-action: none; cursor: crosshair; }

/* =========================================
   TABLES & LISTS (HISTORY, MONITORING, STAFF)
   ========================================= */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; background: var(--surface-solid); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); background: var(--primary-soft); }

.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 800;
}
.status-pill.ok { background: var(--ok-bg); color: var(--ok); }
.status-pill.no { background: var(--danger-bg); color: var(--danger); }

/* =========================================
   MODALS & TOAST
   ========================================= */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-card {
  width: 100%; max-width: 500px; max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--surface-solid); border-radius: 20px;
  border: 1px solid var(--border); overflow: hidden;
  animation: fadeUp 0.25s ease;
}
.modal-head {
  padding: 16px 18px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
}
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.select-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--border);
  margin-bottom: 8px; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.select-item:hover, .select-item.selected { border-color: var(--primary); background: var(--primary-soft); }

.toast-box {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 200; padding: 11px 18px; border-radius: 999px;
  background: #0F172A; color: #FFFFFF; font-size: 0.84rem; font-weight: 700;
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
  animation: fadeUp 0.25s ease;
}

.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.theme-swatch {
  padding: 12px; border-radius: 14px; border: 2px solid var(--border);
  background: var(--surface-solid); cursor: pointer; text-align: center; font-size: 0.78rem; font-weight: 700;
}
.theme-swatch .dot { width: 28px; height: 28px; border-radius: 50%; margin: 0 auto 6px; }
.theme-swatch.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
