/* ===== GLOBAL SVG SIZE GUARD (mencegah icon raksasa) ===== */
svg {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: middle;
}
.icon svg, .nav-item svg, .badge svg, .delta svg, .ic svg,
.quick .ic svg, .stat .badge svg {
  width: 100%;
  height: 100%;
}
.nav-item .icon { width: 18px; height: 18px; flex: 0 0 18px; display: inline-flex; }
.nav-item .icon svg { width: 18px; height: 18px; }
#trenChart svg, #harianChart svg { width: 100% !important; height: 100% !important; }

/* ============================================
   MAHAINTRA POS — Light Blue Professional
   Food & Drinks · Clean · Glitter · Gradient
   ============================================ */

:root {
  /* Brand · Light Blue Palette */
  --blue-900: #0c4a6e;
  --blue-800: #075985;
  --blue-700: #0369a1;
  --blue-600: #0284c7;
  --blue-500: #0ea5e9;
  --blue-400: #38bdf8;
  --blue-300: #7dd3fc;
  --blue-200: #bae6fd;
  --blue-100: #e0f2fe;
  --blue-50:  #f0f9ff;

  --cyan-400: #22d3ee;
  --cyan-300: #67e8f9;

  --gold-700: #a37c1a;
  --gold-500: #d4a72c;
  --gold-400: #e5b94a;
  --gold-300: #f3d27a;
  --gold-200: #fce8a9;

  /* Surface */
  --bg-0: #eaf4ff;
  --bg-1: #f0f7ff;
  --card: #ffffff;
  --card-soft: #f8fbff;
  --line: rgba(14, 165, 233, 0.12);
  --line-2: rgba(14, 165, 233, 0.22);

  /* Text */
  --tx-0: #0c4a6e;
  --tx-1: #1e3a5f;
  --tx-2: #5b7a9b;
  --tx-3: #94a8c0;
  --tx-4: #b8c5d6;

  /* Status */
  --green: #10b981;
  --red:   #ef4444;
  --amber: #f59e0b;

  /* Effects */
  --shadow-sm: 0 2px 6px rgba(14, 116, 165, 0.06);
  --shadow:    0 8px 28px rgba(14, 116, 165, 0.12), 0 2px 6px rgba(14, 116, 165, 0.06);
  --shadow-lg: 0 16px 48px rgba(14, 116, 165, 0.18), 0 4px 12px rgba(14, 116, 165, 0.08);

  --glow-blue: 0 0 18px rgba(56, 189, 248, 0.45);
  --glow-gold: 0 0 18px rgba(229, 185, 74, 0.4);

  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html, body { overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, 'Inter', system-ui, sans-serif;
  font-weight: 400;
  color: var(--tx-1);
  background: var(--bg-0);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

/* Light cloudy background */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 15% 5%,  rgba(125, 211, 252, 0.45), transparent 60%),
    radial-gradient(ellipse 60% 60% at 85% 90%, rgba(186, 230, 253, 0.55), transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 40%, rgba(224, 242, 254, 0.7),  transparent 70%),
    linear-gradient(180deg, #eaf4ff 0%, #f0f9ff 50%, #e0f2fe 100%);
}
.aurora::before, .aurora::after {
  content: '';
  position: absolute; inset: -20%;
  background:
    radial-gradient(circle at 20% 25%, rgba(56, 189, 248, 0.18) 0, transparent 35%),
    radial-gradient(circle at 78% 70%, rgba(34, 211, 238, 0.16) 0, transparent 35%);
  filter: blur(50px);
  animation: drift 28s ease-in-out infinite alternate;
}
.aurora::after {
  background:
    radial-gradient(circle at 65% 20%, rgba(125, 211, 252, 0.16) 0, transparent 40%),
    radial-gradient(circle at 30% 80%, rgba(186, 230, 253, 0.3)  0, transparent 40%);
  animation-duration: 38s; animation-direction: alternate-reverse;
}
@keyframes drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(4%, -3%) rotate(8deg); }
}

/* Glitter / sparkle */
.glitter {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 22%, rgba(255,255,255,0.95) 0, transparent 100%),
    radial-gradient(1px 1px at 38% 11%, rgba(56,189,248,0.95) 0, transparent 100%),
    radial-gradient(1.2px 1.2px at 65% 38%, rgba(255,255,255,0.95) 0, transparent 100%),
    radial-gradient(1.6px 1.6px at 82% 65%, rgba(125,211,252,0.95) 0, transparent 100%),
    radial-gradient(1px 1px at 23% 78%, rgba(255,255,255,0.95) 0, transparent 100%),
    radial-gradient(1.2px 1.2px at 51% 89%, rgba(229,185,74,0.85) 0, transparent 100%),
    radial-gradient(1.4px 1.4px at 7% 55%, rgba(255,255,255,0.85) 0, transparent 100%),
    radial-gradient(1px 1px at 91% 24%, rgba(56,189,248,0.9) 0, transparent 100%),
    radial-gradient(1px 1px at 44% 47%, rgba(255,255,255,0.85) 0, transparent 100%),
    radial-gradient(1.2px 1.2px at 73% 13%, rgba(255,255,255,0.9) 0, transparent 100%),
    radial-gradient(1px 1px at 5% 35%, rgba(255,255,255,0.7) 0, transparent 100%),
    radial-gradient(1px 1px at 95% 75%, rgba(229,185,74,0.8) 0, transparent 100%);
  animation: twinkle 6s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Gradient neon border via mask */
.neon-border {
  position: relative;
  border-radius: var(--radius);
}
.neon-border::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg,
    rgba(56, 189, 248, 0.95) 0%,
    rgba(229, 185, 74, 0.7) 35%,
    rgba(125, 211, 252, 0.9) 65%,
    rgba(34, 211, 238, 0.7) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.neon-border.glow::after {
  content: '';
  position: absolute; inset: -1px;
  border-radius: inherit;
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.28), 0 0 44px rgba(125, 211, 252, 0.18);
  pointer-events: none;
}

/* White glass card */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(248, 251, 255, 0.92) 100%);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* App layout */
.app { position: relative; z-index: 2; display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 250px; flex: 0 0 250px;
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid rgba(229,185,74,0.2);
  background: linear-gradient(160deg, #0a2a4a 0%, #0d3660 50%, #122f55 100%);
  backdrop-filter: blur(14px);
  position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  z-index: 30;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 10px 18px 10px;
  border-bottom: 1px solid rgba(229,185,74,0.25);
  margin-bottom: 8px;
}
.sidebar .brand .logo-wrap {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 50%; padding: 2px;
  background: conic-gradient(from 0deg, #38bdf8, #e5b94a, #7dd3fc, #f3d27a, #38bdf8);
  box-shadow: 0 4px 14px rgba(56,189,248,0.4);
}
.sidebar .brand .logo-wrap img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; background: #fff; }
.sidebar .brand .brand-name { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif; font-weight: 700; font-size: 13px; letter-spacing: 0.12em; color: #fff; }
.sidebar .brand .brand-sub { font-size: 9.5px; letter-spacing: 0.28em; color: var(--gold-400); margin-top: 2px; font-weight: 600; }

.nav-section {
  font-size: 9.5px; letter-spacing: 0.22em; color: rgba(229,185,74,0.6);
  text-transform: uppercase; padding: 14px 12px 6px 12px;
  font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  position: relative;
  transition: all 0.18s ease;
}
.nav-item .icon { width: 18px; height: 18px; flex: 0 0 18px; color: rgba(255,255,255,0.45); }
.nav-item:hover {
  background: rgba(229, 185, 74, 0.12);
  color: var(--gold-300);
}
.nav-item:hover .icon { color: var(--gold-400); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(229, 185, 74, 0.22) 0%, rgba(56, 189, 248, 0.12) 100%);
  color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(229, 185, 74, 0.4), 0 4px 12px rgba(229, 185, 74, 0.15);
}
.nav-item.active .icon { color: var(--gold-400); }
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--gold-400), var(--blue-400));
  box-shadow: var(--glow-gold);
}

/* Mobile sidebar */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; background: rgba(12, 74, 110, 0.35);
  backdrop-filter: blur(4px); z-index: 25;
}
.sidebar-backdrop.show { display: block; }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .greet { font-size: 12px; color: var(--tx-3); }
.topbar h1 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 20px; font-weight: 600; color: var(--tx-0);
  margin: 2px 0 0 0; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar .spacer { flex: 1; min-width: 0; }
.hamburger {
  display: none;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--line-2);
  color: var(--blue-700);
  cursor: pointer; flex: 0 0 38px;
}
.hamburger svg { width: 18px; height: 18px; }

.search {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  background: rgba(240, 249, 255, 0.9);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  min-width: 240px;
  color: var(--tx-2); font-size: 13px;
}
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--tx-1); font: inherit; }
.search .kbd { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: rgba(56,189,248,0.12); color: var(--blue-700); font-weight: 600; }

.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line-2);
  color: var(--blue-700);
  cursor: pointer;
  position: relative;
  flex: 0 0 38px;
}
.icon-btn:hover { color: var(--blue-500); border-color: rgba(56, 189, 248, 0.5); }
.icon-btn svg { width: 16px; height: 16px; }
.dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold-500);
  box-shadow: 0 0 8px var(--gold-500);
}

.avatar {
  display: flex; align-items: center; gap: 10px;
  padding: 3px 12px 3px 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line-2);
}
.avatar .ring {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%;
  background: conic-gradient(from 0deg, #38bdf8, #e5b94a, #38bdf8);
  padding: 2px;
}
.avatar .ring .face {
  width: 100%; height: 100%; border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 12px;
}
.avatar .meta { font-size: 12px; line-height: 1.2; min-width: 0; }
.avatar .meta strong { color: var(--tx-0); font-weight: 600; }
.avatar .meta span { color: var(--tx-3); font-size: 11px; }

.content { padding: 22px 24px; flex: 1; min-width: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 11px;
  font-family: inherit; font-weight: 600; font-size: 13px;
  cursor: pointer; border: 0;
  letter-spacing: 0.01em;
  transition: transform .12s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; flex: 0 0 14px; }
.btn-primary {
  background: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-400) 50%, var(--blue-300) 100%);
  color: white;
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.32), inset 0 1px 0 rgba(255,255,255,0.45);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(14, 165, 233, 0.42); transform: translateY(-1px); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-400) 50%, var(--gold-300) 100%);
  color: #4a3208;
  box-shadow: 0 6px 18px rgba(229, 185, 74, 0.32), inset 0 1px 0 rgba(255,255,255,0.55);
}
.btn-gold:hover { box-shadow: 0 10px 26px rgba(229, 185, 74, 0.45); transform: translateY(-1px); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line-2);
  color: var(--blue-700);
}
.btn-ghost:hover { border-color: rgba(56, 189, 248, 0.5); color: var(--blue-600); background: rgba(240, 249, 255, 0.95); }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tx-3); font-weight: 600; }
.input, .select, .textarea {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line-2);
  border-radius: 11px;
  padding: 11px 14px;
  color: var(--tx-1);
  font: inherit; font-size: 14px;
  outline: none;
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

/* Tables */
.table-card { padding: 0; overflow: hidden; border-radius: 12px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.tbl thead th {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--tx-3); font-weight: 700;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  background: rgba(240, 249, 255, 0.7);
  white-space: nowrap;
}
.tbl tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--tx-1);
  vertical-align: middle;
}
.tbl tbody tr:hover td { background: rgba(56, 189, 248, 0.05); }
.tbl tbody tr:last-child td { border-bottom: 0; }

/* Status pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.pill .dotty { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; }
.pill.green { background: rgba(16, 185, 129, 0.12); color: #047857; }
.pill.green .dotty { background: var(--green); box-shadow: 0 0 6px var(--green); }
.pill.amber { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.pill.amber .dotty { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.pill.red { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.pill.red .dotty { background: var(--red); box-shadow: 0 0 6px var(--red); }
.pill.blue { background: rgba(56, 189, 248, 0.14); color: var(--blue-700); }
.pill.blue .dotty { background: var(--blue-500); box-shadow: 0 0 6px var(--blue-500); }
.pill.gold { background: rgba(229, 185, 74, 0.16); color: var(--gold-700); }
.pill.gold .dotty { background: var(--gold-500); box-shadow: 0 0 6px var(--gold-500); }

/* Mono */
.mono { font-family: 'Courier New', Courier, ui-monospace, monospace; font-variant-numeric: tabular-nums; }

/* Section heading */
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px 0; flex-wrap: wrap; }
.section-title h2 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 15px; font-weight: 600; color: var(--tx-0); margin: 0;
  letter-spacing: -0.005em;
}
.section-title .sub { font-size: 12px; color: var(--tx-3); }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.stat .label { font-size: 11px; color: var(--tx-3); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.stat .value {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 26px; font-weight: 700; color: var(--tx-0);
  margin: 8px 0 6px 0; letter-spacing: -0.02em;
  word-break: break-word;
}
.stat .delta { font-size: 11.5px; color: var(--green); display: flex; align-items: center; gap: 6px; }
.stat .delta.down { color: var(--red); }
.stat .delta svg { width: 13px; height: 13px; flex: 0 0 13px; }
.stat .badge {
  position: absolute; top: 18px; right: 18px;
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(56,189,248,0.16), rgba(229,185,74,0.16));
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--blue-600);
}
.stat .badge svg { width: 18px; height: 18px; }

/* Utility */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.gap-sm { gap: 6px; } .gap-md { gap: 14px; } .gap-lg { gap: 22px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--tx-3); }
.text-gold { color: var(--gold-700); }
.text-blue { color: var(--blue-600); }

.gold-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
  opacity: 0.7;
}

/* Login centered */
.center-stage {
  position: relative; z-index: 2;
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(56, 189, 248, 0.28); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(56, 189, 248, 0.45); }

/* Kicker */
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(56,189,248,0.14), rgba(229,185,74,0.14));
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--blue-700); font-weight: 700;
  white-space: nowrap;
}
.kicker .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue-500); flex: 0 0 6px;
  box-shadow: 0 0 10px var(--blue-500);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; height: 100vh;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 0 0 50px rgba(12, 74, 110, 0.25);
    width: 260px; flex: 0 0 260px;
  }
  .app.sidebar-open .sidebar { transform: translateX(0); }
  .hamburger { display: inline-flex; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar h1 { font-size: 17px; }
  .topbar .greet { font-size: 11px; }
  .search { display: none; }
  .avatar .meta { display: none; }
  .avatar { padding: 3px; }
  .kicker { display: none; }
  .content { padding: 16px; }
}
@media (max-width: 540px) {
  .stat-grid { grid-template-columns: 1fr; gap: 12px; }
  .stat { padding: 16px; }
  .stat .value { font-size: 22px; }
  .btn { padding: 9px 14px; font-size: 12.5px; }
  .topbar { padding: 10px 12px; }
  .icon-btn:not(.always-show) { display: none; }
  .topbar h1 { font-size: 15px; }
  .content { padding: 12px; }
}
