/* ================================================================
   MONA — Dashboard Monitoring Antrean
   Combined CSS (style-mona.css) — v7.0
   Merged from: style-mona.css, mona-flat-header.css, polish-mona-v2.css, fonts.css
   ================================================================ */

/* ── FONTS ──────────────────────────────────────────────────────── */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(/fonts/gf-20.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url(/fonts/gf-20.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url(/fonts/gf-20.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400; font-display: swap; src: url(/fonts/gf-36.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-display: swap; src: url(/fonts/gf-36.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-display: swap; src: url(/fonts/gf-36.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-display: swap; src: url(/fonts/gf-36.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }

/* ── CSS VARIABLES ──────────────────────────────────────────────── */
:root {
  --bg-color: #eef2f6;
  --text-color: #1e293b;
  --text-secondary: #64748b;
  --primary-navy: #1b264f;
  --primary-dark: #0f1737;
  --accent-gold: #fcd251;
  --accent-gold-hover: #e3bd46;
  --header-bg: rgba(27, 38, 79, 0.98);
  --header-text: #fff;
  --card-bg: hsla(0, 0%, 100%, 0.95);
  --card-border: #fff;
  --card-shadow: 0 10px 30px -10px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --hover-bg: #ebf2fe;
  --hover-text: #1e3a8a;
  --border-light: #e2e8f0;
  --radius: 18px;
  --radius-sm: 12px;
  --font-main: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, monospace;
  --gap: 24px;
  --card-padding: 24px;
  --c-ok: #22c55e;
  --c-warn: #f59e0b;
  --c-error: #ef4444;
  --c-offline: #94a3b8;
}

/* ── RESET ──────────────────────────────────────────────────────── */
*, *::after, *::before { margin: 0; padding: 0; box-sizing: border-box; outline: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  color: var(--text-color);
  background: radial-gradient(circle at top left, #f1f5f9, #e2e8f0);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  padding-bottom: 60px;
  overflow-anchor: none;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4, .section-title, .num, .num-bold, tfoot td { font-variant-numeric: tabular-nums; }

/* ── NOISE OVERLAY ──────────────────────────────────────────────── */
.noise {
  position: fixed; inset: 0; z-index: 0; opacity: 0.04; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── SCROLLBAR ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(226,232,240,.5); border-radius: 5px; }
::-webkit-scrollbar-thumb { background-color: rgba(27,38,79,.35); border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--primary-navy); }

/* ── HEADER (floating pill — matching index.php style) ─────────── */
.dashboard-header {
  position: fixed !important; top: 15px; left: 50%; transform: translateX(-50%);
  width: 95%; max-width: 1450px; height: 64px;
  padding: 0 24px; border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.15);
  border-top: 1px solid hsla(0,0%,100%,.2);
  border-bottom: 1px solid rgba(0,0,0,.1);
  background: linear-gradient(135deg, rgba(15,23,55,0.88) 0%, rgba(27,38,79,0.85) 40%, rgba(22,32,68,0.85) 65%, rgba(13,26,58,0.88) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--header-shadow);
  z-index: 2000; overflow: hidden;
}
/* Shimmer overlay */
.dashboard-header::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(
    105deg,
    transparent 0%, transparent 35%,
    rgba(252,210,81,.06) 45%,
    rgba(252,210,81,.12) 50%,
    rgba(252,210,81,.06) 55%,
    transparent 65%, transparent 100%
  );
  background-size: 250% 100%;
  animation: headerShimmer 8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes headerShimmer {
  0%, 100% { background-position: 200% center; }
  50% { background-position: -50% center; }
}
/* Ensure children above shimmer */
.dashboard-header > * { position: relative; z-index: 1; }
.header-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.brand-section { display: flex; align-items: center; gap: 15px; margin: 0; }
.logo-img {
  height: 36px; width: auto; flex-shrink: 0;
  filter: brightness(0) invert(1) drop-shadow(0 0 6px rgba(252,210,81,.35));
  transition: transform .3s, filter .3s;
}
.logo-img:hover {
  transform: scale(1.08);
  filter: brightness(0) invert(1) drop-shadow(0 0 12px rgba(252,210,81,.6)) drop-shadow(0 0 24px rgba(252,210,81,.2));
}
.header-title h1 {
  font-size: 1.05rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  margin: 0; color: var(--accent-gold);
  text-shadow: 0 1px 8px rgba(252,210,81,.25);
}
.header-title p { font-size: .75rem; opacity: .9; margin: 0; color: rgba(255,255,255,.85); }

.user-info { display: flex; flex-direction: row; align-items: center; gap: 16px; }
.update-badge {
  display: flex; align-items: center; font-size: .75rem; font-weight: 700;
  background: rgba(255,255,255,.08); backdrop-filter: blur(6px);
  padding: 4px 12px; border-radius: 8px; gap: 6px;
  border: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.9);
}
.logout-btn {
  font-size: .72rem; font-weight: 800; color: #fca5a5; text-decoration: none;
  text-transform: uppercase; letter-spacing: 1px; border: none; background: none;
  padding: 0; cursor: pointer; transition: color .2s;
}
.logout-btn:hover { color: #fff; }

/* ── CONTAINER ──────────────────────────────────────────────────── */
.container { max-width: 1450px; margin: 0 auto; position: relative; z-index: 1; padding: 100px 40px 50px; }

/* ── GREETING ───────────────────────────────────────────────────── */
.greeting-block { margin-bottom: var(--gap); }
.greeting-card {
  background: linear-gradient(135deg, rgba(27,38,79,.06) 0%, rgba(252,210,81,.08) 50%, rgba(27,38,79,.04) 100%);
  border: 1px solid rgba(27,38,79,.08);
  border-radius: var(--radius); padding: 24px 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.greeting-card::before {
  content: ""; position: absolute; top: -50%; right: -10%; width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(252,210,81,.12), transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.greeting-text { flex: 1; min-width: 250px; position: relative; z-index: 1; }
.greeting-text h2 {
  font-size: 1.7rem; font-weight: 800; color: var(--primary-navy); margin-bottom: 4px;
  background: linear-gradient(135deg, var(--primary-navy), #2a3b80);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.greeting-text p { font-size: .88rem; line-height: 1.5; margin-top: 6px; color: var(--text-secondary); }
.greeting-meta {
  font-size: .78rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  position: relative; z-index: 1;
}
.greeting-clock {
  font-size: 1.8rem; font-weight: 800; font-family: var(--font-mono);
  color: var(--primary-navy); letter-spacing: 1px;
  background: rgba(27,38,79,.04); padding: 8px 16px; border-radius: 12px;
  border: 1px solid rgba(27,38,79,.08);
  position: relative; z-index: 1;
}
.kbd-hint {
  display: inline-block; padding: 2px 6px; background: rgba(0,0,0,0.06);
  border-radius: 4px; font-size: .8rem; font-family: var(--font-mono); margin: 0 2px;
}

/* ── SYNC MONITOR ───────────────────────────────────────────────── */
.sync-badge {
  padding: 6px 14px; font-size: .8rem; font-weight: 800; text-transform: uppercase;
  border-radius: 20px; flex-shrink: 0;
}
.sync-badge.ok { background: #dcfce7; color: #15803d; }
.sync-badge.warning { background: #fef9c3; color: #92400e; }
.sync-badge.error { background: #fee2e2; color: #b91c1c; }
.sync-badge.offline { background: #f1f5f9; color: #64748b; }
.sync-badge.unknown { background: #f1f5f9; color: #64748b; }

.sync-monitor-card {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px;
  background: var(--card-bg); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); margin-bottom: var(--gap);
}
.sync-status-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.sync-status-dot.ok { background: var(--c-ok); box-shadow: 0 0 8px rgba(34,197,94,.4); }
.sync-status-dot.warning { background: var(--c-warn); box-shadow: 0 0 8px rgba(245,158,11,.4); }
.sync-status-dot.error { background: var(--c-error); box-shadow: 0 0 8px rgba(239,68,68,.4); }
.sync-status-dot.offline { background: var(--c-offline); }
.sync-info { flex: 1; }
.sync-info-title { font-size: .72rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; }
.sync-info-value { font-size: 1rem; font-weight: 700; color: var(--primary-navy); }
.sync-info-sub { font-size: .75rem; color: var(--text-secondary); }
.sync-flag-warn { padding: 6px 14px; font-size: .8rem; font-weight: 700; color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 10px; }

/* ── MATRIX CARD / SECTION CONTAINERS ───────────────────────────── */
.matrix-card, .chart-card, .libur-section {
  background: var(--card-bg); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: var(--card-padding);
  box-shadow: var(--card-shadow); margin-bottom: var(--gap);
  transition: height .3s ease;
}
.chart-card--full { overflow: hidden; position: relative; height: 480px; }

.section-title {
  font-weight: 700; font-size: 1.1rem; margin: 0 0 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 8px;
  color: var(--primary-navy); user-select: none; cursor: pointer;
}
.section-title .badge-count {
  background: var(--primary-navy); color: #fff; font-size: .7rem;
  font-weight: 800; padding: 2px 8px; border-radius: 20px; margin-left: 4px;
}

/* Collapsible arrows */
.section-title::after {
  content: "▾"; font-size: .85rem; font-weight: 800; color: var(--primary-navy);
  background: var(--accent-gold); width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(252,210,81,0.45); line-height: 1; transition: transform .2s;
}
.section-title:hover::after { transform: scale(1.12); }
.matrix-card.collapsed .section-title::after,
.chart-card.collapsed .section-title::after,
.libur-section.collapsed .section-title::after { content: "▸"; }
.matrix-card.collapsed > .section-title ~ *,
.chart-card.collapsed > .section-title ~ *,
.libur-section.collapsed > .section-title ~ * { display: none; }
.chart-card.collapsed { height: auto !important; min-height: 0 !important; padding-bottom: 6px; }
@media print {
  .section-title::after { display: none; }
  .matrix-card.collapsed > *, .chart-card.collapsed > *, .libur-section.collapsed > * { display: block !important; }
}

/* ── FLEX HELPERS ───────────────────────────────────────────────── */
.flex-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.flex-gap { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.flex-center { display: flex; align-items: center; gap: 12px; }

/* ── SUMMARY GRID (3-col stats) ─────────────────────────────────── */
.summary-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--gap); margin-bottom: var(--gap);
}
.summary-card {
  background: rgba(255,255,255,.65); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: var(--radius); padding: var(--card-padding);
  box-shadow: var(--card-shadow), inset 0 1px 0 rgba(255,255,255,.7), inset 0 -1px 0 rgba(0,0,0,.02);
  position: relative; overflow: hidden;
  transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s, border-color .3s;
}
.summary-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(27,38,79,.12), inset 0 1px 0 rgba(255,255,255,.8);
  border-color: rgba(252,210,81,.5);
}
.summary-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: var(--radius);
  padding: 1px; background: linear-gradient(135deg, transparent, rgba(252,210,81,0), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none; transition: background .3s;
}
.summary-card:hover::before {
  background: linear-gradient(135deg, rgba(252,210,81,.5), rgba(27,38,79,.15), rgba(252,210,81,.5));
}
.summary-card.accent { border-left: 4px solid var(--accent-gold); }
.s-label { font-size: .75rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; }
.s-value { font-size: 1.9rem; font-weight: 800; color: var(--primary-navy); margin-top: 2px; line-height: 1.1; }
.s-sub { font-size: .72rem; color: var(--text-secondary); margin-top: 2px; }

/* Sparkline */
.summary-spark { display: block; width: 100%; height: 34px; margin-top: 10px; }
.summary-spark polyline { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.summary-spark .spark-area { fill: currentColor; opacity: .12; }

/* Stat VS badge */
.stat-vs { font-weight: 700; font-size: .75rem; margin-top: 6px; display: inline-block; padding: 2px 8px; border-radius: 20px; }
.stat-vs.naik { background: #dcfce7; color: #15803d; }
.stat-vs.turun { background: #fee2e2; color: #b91c1c; }
.stat-vs.sama { background: #f1f5f9; color: #64748b; }

/* ── STATS GRID (4-col) ─────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap); margin-bottom: var(--gap);
}
.stat-card {
  background: rgba(255,255,255,.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 20px; padding: var(--card-padding);
  box-shadow: var(--card-shadow), inset 0 1px 0 rgba(255,255,255,.8), inset 0 -1px 0 rgba(0,0,0,.02);
  overflow: hidden; position: relative;
  display: flex; flex-direction: column;
  transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s, border-color .3s;
}
.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px rgba(27,38,79,.12), inset 0 1px 0 rgba(255,255,255,.9);
}
.stat-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 20px;
  padding: 1px; background: linear-gradient(135deg, transparent, rgba(252,210,81,0), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none; transition: background .3s;
}
.stat-card:hover::before {
  background: linear-gradient(135deg, rgba(252,210,81,.6), rgba(27,38,79,.12), rgba(252,210,81,.6));
}
.stat-card.highlight {
  background: rgba(255,255,255,.7); border-color: rgba(252,210,81,.4);
}
.stat-card.highlight::after { content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--accent-gold); }
.stat-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.stat-icon {
  width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center;
  justify-content: center; font-size: 1.4rem; background: #f8fafc;
  box-shadow: inset 0 2px 5px rgba(0,0,0,.03); color: var(--primary-navy);
}
.stat-card.highlight .stat-icon { background: rgba(252,210,81,.15); color: #b48e00; }
.stat-label { font-size: .8rem; color: var(--text-secondary); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.stat-value {
  font-size: 2.2rem; font-weight: 800; color: var(--primary-navy); line-height: 1; margin-bottom: 4px;
  transition: color .3s;
}
.stat-value.text-fit { font-size: 1.4rem; line-height: 1.3; }
/* Number update pulse */
.stat-value.pulse {
  animation: numPulse .5s cubic-bezier(.22,1,.36,1);
}
@keyframes numPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.08); color: var(--accent-gold); }
  100% { transform: scale(1); }
}
.s-value.pulse {
  animation: numPulse .5s cubic-bezier(.22,1,.36,1);
}

/* ── ANALYTICS CONTAINER (3-col) ────────────────────────────────── */
.analytics-container { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--gap); margin-bottom: var(--gap); }
.analytics-card {
  background: #fff; border-radius: 18px; border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow); padding: 20px; transition: transform .2s, box-shadow .2s;
}
.clickable-card { cursor: pointer; }
.clickable-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,.1); border-color: #93c5fd; }
.analytics-header { font-size: 1.1rem; font-weight: 700; color: var(--primary-navy); margin-bottom: 15px; display: flex; align-items: center; gap: 8px; }
.big-number-box { text-align: center; padding: 10px 0; }
.big-number { font-size: 2.5rem; font-weight: 800; color: var(--accent-gold); line-height: 1; }
.big-label { font-size: .85rem; color: var(--text-secondary); font-weight: 600; margin-top: 5px; }
.progress-bar-container { background: #f1f5f9; border-radius: 10px; height: 12px; overflow: hidden; display: flex; margin-top: 15px; }
.progress-mobile { background: #3b82f6; height: 100%; }
.progress-desktop { background: #1e3a8a; height: 100%; }
.country-list { list-style: none; padding: 0 5px 0 0; margin: 0; max-height: 200px; overflow-y: auto; }
.country-list::-webkit-scrollbar { width: 6px; }
.country-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.country-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border-light); font-size: .9rem; font-weight: 600; color: var(--primary-navy); }
.country-list li:last-child { border-bottom: none; }
.click-hint {
  font-size: .75rem; color: #3b82f6; font-weight: 700; display: flex; justify-content: center;
  align-items: center; gap: 5px; margin-top: 10px; background: #eff6ff; padding: 4px 10px; border-radius: 20px;
}

/* ── TABLES ──────────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; }
.table-scroll[style*="max-height"] { overflow-y: auto; }
.table-scroll[style*="max-height"] thead th { position: sticky; top: 0; z-index: 3; background: var(--primary-navy); color: #fff; }
.table-scroll tbody tr:nth-child(even) { background: rgba(33,44,95,.03); }
.table-scroll tbody tr:hover { background: rgba(252,210,81,.09); }
.clickable-row { cursor: pointer; transition: .2s; }

thead th {
  background: var(--primary-navy); color: #fff; text-align: center;
  padding: 12px 14px; font-size: .8rem; font-weight: 700; white-space: nowrap;
}
td { padding: 10px 14px; font-size: .85rem; border-bottom: 1px solid var(--border-light); }
.num { text-align: center; font-weight: 600; }
.num-bold { text-align: center; font-weight: 800; color: var(--primary-navy); }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: .85rem; }

/* ── HEATMAP TABLE ──────────────────────────────────────────────── */
.matrix-scroll { overflow-x: auto; }
.matrix-table { width: 100%; border-collapse: collapse; }
.matrix-table th, .matrix-table td { padding: 10px 8px; text-align: center; font-size: .82rem; }
.loket-col { text-align: left; font-weight: 600; min-width: 160px; color: var(--primary-navy); }

/* Heatmap intensity levels */
.heatmap-0  { background: #f8fafc; }
.heatmap-1  { background: #eff6ff; }
.heatmap-2  { background: #dbeafe; }
.heatmap-3  { background: #bfdbfe; }
.heatmap-4  { background: #93c5fd; }
.heatmap-5  { background: #60a5fa; color: #fff; }
.heatmap-6  { background: #3b82f6; color: #fff; }
.heatmap-7  { background: #2563eb; color: #fff; }
.heatmap-8  { background: #1d4ed8; color: #fff; }
.heatmap-9  { background: #1e40af; color: #fff; }
.heatmap-10 { background: #1e3a8a; color: #fff; }

.val-today { font-weight: 700; }
.val-yesterday { display: block; font-size: .65rem; color: #94a3b8; font-weight: 400; margin-top: 1px; }
.total-col { font-weight: 800; color: var(--primary-navy); }

.jam-aktif-cell { background: #fef3c7 !important; border-left: 3px solid #f59e0b; border-right: 3px solid #f59e0b; }
.jam-aktif-head { color: #fcd34d !important; }

/* Mini-bar chart (peak hours) */
.mini-bar {
  border-radius: 3px 3px 0 0;
  transition: height .4s cubic-bezier(.22,1,.36,1), background .2s;
  position: relative;
}
.mini-bar:hover {
  background: var(--accent-gold) !important;
  box-shadow: 0 0 8px rgba(252,210,81,.5);
  transform: scaleY(1.1);
  transform-origin: bottom;
}

/* Traffic light */
.traffic-cell { text-align: center; font-weight: 600; font-size: .8rem; border-radius: 8px; }
.traffic-red    { background: #fee2e2; color: #b91c1c; animation: trafficPulse 2s infinite; }
.traffic-yellow { background: #fef9c3; color: #92400e; }
.traffic-green  { background: #dcfce7; color: #15803d; }
.traffic-gray   { background: #f1f5f9; color: #64748b; }
.traffic-pct { display: block; font-size: .65rem; font-weight: 400; opacity: .7; }

@keyframes trafficPulse {
  0%, 100% { box-shadow: inset 0 0 0 rgba(239,68,68,0); }
  50% { box-shadow: inset 0 0 12px rgba(239,68,68,.15); }
}

/* Heatmap cell hover glow */
.matrix-table td:not(.loket-col):not(.traffic-cell):hover {
  box-shadow: inset 0 0 12px rgba(59,130,246,.25);
  transform: scale(1.05);
  z-index: 2;
  position: relative;
  transition: transform .15s, box-shadow .15s;
}

/* ── FILTER BUTTONS (Loket) ─────────────────────────────────────── */
.loket-filter-btn {
  font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 20px;
  border: 1px solid #cbd5e1; background: #fff; color: var(--primary-navy); cursor: pointer;
  transition: .2s;
}
.loket-filter-btn.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.loket-filter-btn:hover { background: var(--hover-bg); }

/* ── CONTROLS / FILTER BAR ──────────────────────────────────────── */
.controls-wrapper {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: rgba(255,255,255,.65); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.6); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: var(--gap);
  box-shadow: var(--card-shadow), inset 0 1px 0 rgba(255,255,255,.7);
}
.filter-group { display: flex; gap: 12px; align-items: center; }

select {
  padding: 10px 40px 10px 16px; border: 1px solid #cbd5e1; border-radius: var(--radius-sm);
  background-color: #fff; font-weight: 600; font-size: .9rem; font-family: var(--font-main);
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231e293b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  transition: .2s; min-width: 140px; box-shadow: 0 2px 5px rgba(0,0,0,.02); color: var(--text-color);
}
select:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
select:focus { border-color: var(--accent-gold); box-shadow: 0 0 0 3px rgba(252,210,81,.2); }

/* ── BUTTONS ─────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; cursor: pointer;
  background: linear-gradient(135deg, var(--primary-navy), #2a3b80); color: #fff;
  border: none; padding: 10px 24px; border-radius: var(--radius-sm); font-weight: 600;
  font-size: .9rem; gap: 8px; font-family: var(--font-main);
  box-shadow: 0 4px 15px rgba(33,44,95,.25); transition: .3s cubic-bezier(.25,.8,.25,1);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(33,44,95,.35); }
.btn-primary:active { transform: translateY(1px) scale(.97); box-shadow: 0 2px 8px rgba(33,44,95,.2); transition: .1s; }

.btn-icon {
  display: inline-flex; align-items: center; cursor: pointer;
  background: #fff; border: 1px solid var(--border-light); width: 36px; height: 36px;
  border-radius: 10px; color: var(--text-secondary); padding: 0; justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,.05); transition: .2s;
}
.btn-icon:hover { background: var(--primary-navy); color: #fff; border-color: var(--primary-navy); }
.btn-icon:active { transform: scale(.9); background: #0f1737; transition: .1s; }

/* All clickable buttons/links generic press */
button:active, a.btn-primary:active { transition: .1s !important; }

/* ── FORMS ───────────────────────────────────────────────────────── */
.form-libur {
  display: flex; gap: 20px; align-items: flex-end; background: #f8fafc;
  padding: 25px; border-radius: 16px; border: 1px solid var(--border-light);
  flex-wrap: wrap; margin-bottom: 25px;
}
.form-group { display: flex; flex-direction: column; flex: 1; min-width: 220px; }
.form-group label { font-size: .8rem; font-weight: 700; color: var(--primary-navy); margin-bottom: 8px; }
.form-group input {
  width: 100%; padding: 12px 16px; border-radius: 10px; border: 1px solid #cbd5e1;
  font-size: .95rem; color: var(--text-color); background: #fff; font-family: var(--font-main);
  transition: .2s; box-sizing: border-box;
}
.form-group input:focus { border-color: var(--accent-gold); box-shadow: 0 0 0 3px rgba(252,210,81,.2); }
.form-libur .btn-primary { height: 46px; padding: 0 25px; white-space: nowrap; flex-shrink: 0; }

input[type="text"], input[type="number"], input[type="date"], textarea {
  font-family: var(--font-main); color: var(--text-color);
  transition: border-color .3s, box-shadow .3s, transform .2s;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="date"]:focus, textarea:focus {
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 0 3px rgba(252,210,81,.15), 0 2px 8px rgba(252,210,81,.1) !important;
  transform: translateY(-1px);
}
input[type="text"]:not(:focus):not(:placeholder-shown),
input[type="number"]:not(:focus),
input[type="date"]:not(:focus),
textarea:not(:focus):not(:placeholder-shown) {
  border-color: rgba(27,38,79,.15);
}
.label-row { min-width: 200px; font-weight: 600; padding: 8px 10px 8px 0; }
.block-label { display: block; margin-bottom: 16px; }
.font-semibold { font-weight: 600; }
.p-8 { padding: 8px; }
.mt-12 { margin-top: 12px; }
.mt-8 { margin-top: 8px; }

/* ── MODALS ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.7); z-index: 9999;
  display: flex; justify-content: center; align-items: center;
  opacity: 0; visibility: hidden; transition: .3s ease-in-out;
  backdrop-filter: blur(4px); padding: 16px; box-sizing: border-box;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
  background: var(--card-bg); border-radius: 20px; width: 100%; max-width: 95vw;
  max-height: 90vh; padding: 30px; position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,.3); transform: translateY(20px);
  transition: transform .3s ease-in-out; display: flex; flex-direction: column; box-sizing: border-box;
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding-bottom: 15px; border-bottom: 2px solid var(--border-light); flex-shrink: 0;
}
.modal-title { font-size: 1.3rem; font-weight: 800; color: var(--primary-navy); margin: 0; }
.modal-close { font-size: 1.8rem; color: #94a3b8; line-height: 1; transition: .2s; margin-left: 12px; cursor: pointer; border: none; background: none; }
.modal-close:hover { color: #ef4444; }
.modal-body { overflow-y: auto; overflow-x: auto; flex-grow: 1; padding-right: 5px; -webkit-overflow-scrolling: touch; overflow-anchor: none; }
.modal-body table { width: 100%; min-width: 600px; border-collapse: collapse; }

/* ── TOAST ───────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; right: 24px; bottom: 80px; display: flex; flex-direction: column-reverse;
  gap: 8px; z-index: 10000; pointer-events: none;
}
.toast {
  padding: 14px 20px; border-radius: 14px; font-weight: 700; font-size: .88rem;
  color: #fff; box-shadow: 0 10px 25px rgba(0,0,0,.15);
  animation: toastIn .4s ease, toastOut .4s ease 2.6s forwards;
  pointer-events: auto; max-width: 360px;
}
.toast.success { background: linear-gradient(135deg, #15803d, #22c55e); }
.toast.warning { background: linear-gradient(135deg, #d97706, #f59e0b); }
.toast.error   { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.toast.default { background: linear-gradient(135deg, #334155, #475569); }

@keyframes toastIn { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* ── REFRESH BAR ─────────────────────────────────────────────────── */
.refresh-bar {
  position: fixed; right: 24px; bottom: 24px; display: flex; align-items: center;
  gap: 10px; padding: 10px 16px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.7);
  font-size: .8rem; font-weight: 700; color: var(--text-secondary); z-index: 900;
  transition: opacity .3s, transform .3s;
}
.refresh-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--c-ok);
  box-shadow: 0 0 8px rgba(34,197,94,.5);
  animation: pulse 2s infinite;
}
.refresh-bar progress {
  width: 80px; height: 4px; border-radius: 4px; appearance: none; overflow: hidden;
}
.refresh-bar progress::-webkit-progress-bar { background: rgba(27,38,79,.08); border-radius: 4px; }
.refresh-bar progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--primary-navy), var(--accent-gold));
  border-radius: 4px; transition: width 1s linear;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.85); } }

/* ── CALENDAR ────────────────────────────────────────────────────── */
#calendar-legend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .75rem; color: var(--text-secondary); }
#calendar-legend span { display: inline-block; width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.cal-header-row { margin-bottom: 6px; display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-header-day { text-align: center; font-size: .72rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; padding: 4px 0; }
.cal-scroll-wrapper { width: 100%; overflow-x: auto; border-radius: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  border-radius: 10px; padding: 8px 6px; min-height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  font-size: .78rem; border: 1px solid transparent; transition: transform .15s, box-shadow .15s;
  cursor: default; position: relative; overflow: hidden; word-break: break-word; min-width: 0;
}
.cal-cell.has-data:hover { transform: scale(1.04); box-shadow: 0 4px 12px rgba(0,0,0,.12); z-index: 10; cursor: pointer; }
.cal-date-num { font-weight: 800; font-size: .9rem; line-height: 1; margin-bottom: 4px; }
.cal-val { font-size: .75rem; font-weight: 700; margin-top: auto; }
.cal-empty { background: none; border: none; min-height: 64px; }
.cal-libur { background: #f8fafc !important; border: 1px dashed #cbd5e1 !important; color: #94a3b8 !important; }
.cal-libur .cal-date-num { color: #94a3b8; }
.cal-today { border: 2px solid #f59e0b !important; }
.cal-libur-badge { font-size: .6rem; color: #64748b; text-align: center; line-height: 1.2; margin-top: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── MINI BARS (Peak Hour) ──────────────────────────────────────── */
.mini-bar { flex: 1; border-radius: 3px 3px 0 0; transition: opacity .2s; cursor: default; }

/* ── ANOMALY ALERTS ─────────────────────────────────────────────── */
.anomaly-alert { border-radius: 14px; padding: 14px 18px; margin-bottom: 10px; border-left: 5px solid; animation: .4s slideInAlert; }
.anomaly-warning  { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
.anomaly-critical { background: #fff1f2; border-color: #ef4444; color: #b91c1c; animation: .4s slideInAlert, 2s .5s infinite pulseAlert; }
@keyframes slideInAlert { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseAlert { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.15); } 50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } }

/* ── TOOLTIP ─────────────────────────────────────────────────────── */
#heatmap-tooltip {
  display: none; position: fixed; z-index: 9999; background: #1e293b; color: #fff;
  border-radius: 10px; padding: 10px 14px; font-size: .78rem; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); pointer-events: none; max-width: 200px; line-height: 1.6;
}

/* ── KUOTA PROGRESS ──────────────────────────────────────────────── */
.kuota-progress {
  height: 8px; border-radius: 20px; background: rgba(33,44,95,.08);
  margin-top: 8px; overflow: hidden; position: relative;
}
.kuota-progress > div {
  height: 100%; border-radius: 20px;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transition: width .6s cubic-bezier(.22,1,.36,1);
  position: relative;
}
.kuota-progress > div::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.3) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: progressShimmer 2s ease-in-out infinite;
}
@keyframes progressShimmer {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.kuota-progress.warn > div { background: linear-gradient(90deg, #f59e0b, #d97706); }
.kuota-progress.danger > div { background: linear-gradient(90deg, #ef4444, #dc2626); }
.kuota-progress.danger { animation: kuotaPulse 1.5s ease-in-out infinite; }
@keyframes kuotaPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(239,68,68,0); }
  50% { box-shadow: 0 0 10px rgba(239,68,68,.3); }
}

/* ── EMPTY STATE ─────────────────────────────────────────────────── */
.empty-state {
  padding: 36px 16px; text-align: center; color: var(--text-secondary); font-size: .9rem;
  background: linear-gradient(135deg, rgba(241,245,249,.5), rgba(226,232,240,.3));
  border-radius: 12px; border: 1px dashed rgba(27,38,79,.12);
  margin: 8px 0;
}
.empty-state .empty-icon {
  font-size: 2.5rem; margin-bottom: 10px; opacity: .5;
  animation: emptyBounce 2s ease-in-out infinite;
}
@keyframes emptyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.empty-state p { margin: 0; line-height: 1.5; }

/* ── BLACKOUT TABLE ──────────────────────────────────────────────── */
.form-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }

/* ── SCROLL TO TOP ──────────────────────────────────────────────── */
.scroll-top-btn {
  position: fixed; bottom: 80px; right: 24px; z-index: 1500; /* above refresh bar */
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-navy), #2a3b80);
  color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; box-shadow: 0 4px 15px rgba(27,38,79,.3);
  opacity: 0; visibility: hidden; transform: translateY(16px) scale(.8);
  transition: all .3s cubic-bezier(.22,1,.36,1);
}
.scroll-top-btn.visible {
  opacity: 1; visibility: visible; transform: translateY(0) scale(1);
}
.scroll-top-btn:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 25px rgba(27,38,79,.4);
  background: linear-gradient(135deg, #2a3b80, var(--accent-gold));
}
.scroll-top-btn:active { transform: translateY(1px) scale(.95); }

/* ── JUMP NAV ────────────────────────────────────────────────────── */
.mona-jumpnav {
  position: sticky; top: 84px; z-index: 60; display: flex; gap: 6px;
  overflow-x: auto; padding: 8px 10px; margin: 0 0 16px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(33,44,95,.10);
  border-radius: 14px; scrollbar-width: none;
}
.mona-jumpnav::-webkit-scrollbar { display: none; }
.mona-jumpnav a {
  white-space: nowrap; font-size: .74rem; font-weight: 700; color: var(--primary-navy);
  text-decoration: none; padding: 6px 12px; border-radius: 20px;
  border: 1px solid rgba(33,44,95,.14); transition: all .2s ease; background: rgba(255,255,255,.6);
}
.mona-jumpnav a:hover { background: var(--accent-gold); color: #1b264f; transform: translateY(-1px); }
.mona-jumpnav a.active { background: var(--primary-navy); color: #fff; border-color: var(--primary-navy); }

/* ── ANIMATIONS ──────────────────────────────────────────────────── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ================================================================
   DARK MODE
   ================================================================ */
body.dark-mode {
  --bg-color: #0b1220; --text-color: #e5e7eb; --text-secondary: #9ca3af;
  --card-bg: #111827; --card-border: #1f2937; --border-light: #1f2937;
  --hover-bg: #1e293b; --hover-text: #fcd251;
  background: radial-gradient(circle at top left, #0f172a, #0b1220);
}

/* Card containers */
body.dark-mode .matrix-card, body.dark-mode .chart-card,
body.dark-mode .libur-section, body.dark-mode .summary-card,
body.dark-mode .stat-card, body.dark-mode .sync-monitor-card,
body.dark-mode .table-scroll, body.dark-mode .modal-content,
body.dark-mode .analytics-card, body.dark-mode .controls-wrapper,
body.dark-mode .form-libur {
  background: #111827 !important; border-color: #1f2937 !important; color: #e5e7eb;
}
body.dark-mode .summary-card, body.dark-mode .stat-card {
  background: rgba(17,24,39,.72) !important;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-color: rgba(255,255,255,.06) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.05);
}
body.dark-mode .modal-overlay { background: rgba(0,0,0,.65); }
body.dark-mode .modal-header { border-bottom-color: #1f2937 !important; }

/* Text overrides */
body.dark-mode .section-title, body.dark-mode .s-label, body.dark-mode .s-value,
body.dark-mode .s-sub, body.dark-mode .stat-label, body.dark-mode .stat-value,
body.dark-mode .modal-title, body.dark-mode .modal-body,
body.dark-mode .empty-state, body.dark-mode .kbd-hint,
body.dark-mode .update-badge, body.dark-mode .badge-count,
body.dark-mode .sync-info-title, body.dark-mode .sync-info-sub,
body.dark-mode .loket-col, body.dark-mode .greeting-block h2,
body.dark-mode .analytics-header, body.dark-mode .country-list li {
  color: #e5e7eb !important;
}
body.dark-mode .greeting-card {
  background: linear-gradient(135deg, rgba(255,255,255,.03) 0%, rgba(252,210,81,.04) 50%, rgba(255,255,255,.02) 100%);
  border-color: rgba(255,255,255,.06);
}
body.dark-mode .greeting-card::before { background: radial-gradient(circle, rgba(252,210,81,.06), transparent 70%); }
body.dark-mode .greeting-text h2 {
  background: linear-gradient(135deg, #e5e7eb, #fcd251);
  -webkit-background-clip: text; background-clip: text;
}
body.dark-mode .greeting-clock {
  color: #fcd251; background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.06);
}
body.dark-mode .empty-state {
  background: linear-gradient(135deg, rgba(31,41,55,.5), rgba(17,24,39,.3));
  border-color: rgba(255,255,255,.06);
}

/* Tables */
body.dark-mode .table-scroll td { color: #d1d5db !important; }
body.dark-mode .table-scroll th { color: #e5e7eb !important; }
body.dark-mode .table-scroll thead th { color: #fff !important; }
body.dark-mode .num, body.dark-mode .num-bold, body.dark-mode tfoot td { color: #f3f4f6 !important; }
body.dark-mode .sticky-date { color: #fcd251 !important; }
body.dark-mode .clickable-row:hover { background: rgba(252,210,81,.10) !important; }
body.dark-mode tbody tr:nth-child(even) { background: rgba(255,255,255,.03); }
body.dark-mode tbody tr:nth-child(2n) { background-color: #1a2332 !important; }
body.dark-mode tbody tr:nth-child(2n) td.sticky-date { background-color: #1a2332 !important; }
body.dark-mode tbody tr:hover td { background-color: #1e293b !important; color: #e5e7eb !important; }
body.dark-mode tbody tr:hover td.num, body.dark-mode tbody tr:hover td.num-bold { color: #fcd251 !important; }
body.dark-mode tbody td.sticky-date { background: #0f172a !important; color: #fcd251 !important; box-shadow: 4px 0 10px -2px rgba(0,0,0,.5); }

/* Inputs */
body.dark-mode input, body.dark-mode select, body.dark-mode textarea {
  background: #0f172a !important; color: #e5e7eb !important; border-color: #1f2937 !important;
}

/* Jump nav dark */
body.dark-mode .mona-jumpnav { background: rgba(17,24,39,.88); border-color: #1f2937; }
body.dark-mode .mona-jumpnav a { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.12); color: #e5e7eb; }
body.dark-mode .mona-jumpnav a.active { background: var(--primary-navy); color: #fff; }

/* Heatmap dark */
body.dark-mode .heatmap-loket tfoot td { background: #0f172a !important; }
body.dark-mode .heatmap-loket tfoot td.loket-col { background: #111827 !important; }
body.dark-mode .heatmap-loket td.total-col, body.dark-mode .heatmap-loket .heatmap-0 { background: #0f172a !important; }
body.dark-mode .heatmap-loket td.total-col { color: #fcd251 !important; }
body.dark-mode .heatmap-loket tbody tr:hover .loket-col { background-color: #1e293b !important; }

/* Footer dark */
body.dark-mode #monitoring-table tfoot td { background-color: #0f172a !important; color: #fcd251 !important; }
body.dark-mode tfoot td { background-color: #0f172a !important; }
body.dark-mode td.num-bold { background: #1e293b !important; color: #fcd251 !important; }

/* Misc dark */
body.dark-mode .kuota-progress { background: rgba(255,255,255,.10); }
body.dark-mode .summary-spark polyline { opacity: .95; }
body.dark-mode .mini-bar { background: #60a5fa !important; }
body.dark-mode .sync-info-value { color: #fcd251 !important; }
body.dark-mode .stat-card.highlight { background: rgba(30,41,59,.8) !important; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
body.dark-mode .refresh-bar { background: #111827; border-color: #1f2937; }
body.dark-mode .header-title p { color: rgba(255,255,255,.75); }
body.dark-mode .dashboard-header {
  background: linear-gradient(135deg, rgba(6,10,24,0.85) 0%, rgba(15,23,55,0.8) 40%, rgba(10,18,40,0.8) 65%, rgba(5,8,16,0.85) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-color: hsla(0,0%,100%,0.08);
  box-shadow: 0 10px 40px -5px rgba(0,0,0,0.7);
}
body.dark-mode .cal-empty { background: transparent; }
body.dark-mode #settings-section .table-scroll { border-color: #1f2937; }
body.dark-mode #settings-section .table-scroll table td { border-bottom-color: #1f2937; }
body.dark-mode [style*="color:var(--primary-navy)"] { color: #e5e7eb !important; }
body.dark-mode [style*="background:#fff"] { background: #1f2937 !important; border-color: #374151 !important; }

/* Settings section */
#settings-section .table-scroll { border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden; }
#settings-section .table-scroll table td { padding: 12px 14px !important; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
#settings-section .table-scroll tbody tr:last-child td { border-bottom: none !important; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .analytics-container { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --card-padding: 16px; --gap: 16px; }
  .container { padding: 90px 16px 20px; }
  .dashboard-header { width: 96%; top: 10px; height: 56px; padding: 0 14px; }
  .header-left { padding-left: 0; }
  .header-title h1 { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .header-title p { display: none; }
  .logo-img { height: 22px; }
  .user-info { gap: 10px; }
  .update-badge { display: none; }
  .summary-grid { grid-template-columns: 1fr; gap: 12px; }
  .analytics-container { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .greeting-card { padding: 18px 16px; gap: 12px; }
  .greeting-text { min-width: 0; width: 100%; }
  .greeting-text h2 { font-size: 1.15rem; }
  .greeting-text p { font-size: .78rem; margin-top: 4px; }
  .greeting-meta { gap: 4px; font-size: .7rem; }
  .greeting-clock { font-size: 1.3rem; padding: 6px 14px; width: 100%; text-align: center; }
  .sync-monitor-card { padding: 12px 16px; gap: 12px; }
  .matrix-card, .chart-card, .libur-section { padding: var(--card-padding); }
  .section-title { font-size: .95rem; margin-bottom: 12px; padding-bottom: 8px; }
  .stat-value { font-size: 1.8rem; }
  .s-value { font-size: 1.5rem; }
  .stat-icon { width: 40px; height: 40px; border-radius: 10px; font-size: 1rem; }
  .form-libur { padding: 14px; gap: 10px; }
  .form-group { min-width: 140px; }
  .cal-header-row { font-size: .65rem; }
}

@media (max-width: 480px) {
  :root { --card-padding: 14px; --gap: 12px; }
  .container { padding: 78px 12px 16px; }
  .greeting-card { padding: 14px 12px; }
  .greeting-text h2 { font-size: 1rem; }
  .greeting-clock { font-size: 1.1rem; padding: 5px 12px; }
  .stats-grid { grid-template-columns: 1fr; gap: 10px; }
  .summary-grid { gap: 10px; }
  .stat-value { font-size: 1.5rem; }
  .s-value { font-size: 1.3rem; }
  .sync-monitor-card { padding: 10px 12px; gap: 10px; font-size: .8rem; }
}

/* ── LOADING SKELETON SHIMMER ───────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.wide { width: 80%; }
.skeleton-text.short { width: 40%; }
.skeleton-number { height: 32px; width: 100px; margin: 4px 0; }
.skeleton-circle { width: 48px; height: 48px; border-radius: 14px; }
.skeleton-line { height: 8px; width: 60%; margin-top: 6px; }

@keyframes shimmer {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}
body.dark-mode .skeleton {
  background: linear-gradient(90deg, #1f2937 25%, #2d3748 50%, #1f2937 75%);
  background-size: 200% 100%;
}

/* ── SCROLL ENTRANCE ANIMATIONS ──────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .6s cubic-bezier(.22,1,.36,1), transform .6s cubic-bezier(.22,1,.36,1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
/* staggered children inside grids */
.reveal.revealed .summary-card,
.reveal.revealed .stat-card,
.reveal.revealed .analytics-card {
  opacity: 0;
  animation: cardIn .5s cubic-bezier(.22,1,.36,1) forwards;
}
.reveal.revealed .summary-card:nth-child(1),
.reveal.revealed .stat-card:nth-child(1),
.reveal.revealed .analytics-card:nth-child(1) { animation-delay: .08s; }
.reveal.revealed .summary-card:nth-child(2),
.reveal.revealed .stat-card:nth-child(2),
.reveal.revealed .analytics-card:nth-child(2) { animation-delay: .16s; }
.reveal.revealed .summary-card:nth-child(3),
.reveal.revealed .stat-card:nth-child(3),
.reveal.revealed .analytics-card:nth-child(3) { animation-delay: .24s; }
.reveal.revealed .stat-card:nth-child(4) { animation-delay: .32s; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* respect user preference */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .reveal.revealed .summary-card,
  .reveal.revealed .stat-card,
  .reveal.revealed .analytics-card { animation: none; opacity: 1; }
}

/* ================================================================
   LOGIN PAGE — Glassmorphism + Animated Waves
   Inspired by erte.pajakbantul.com
   ================================================================ */

.login-body {
  background: linear-gradient(180deg, #08203e 0%, #133b5c 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  padding: 20px 0;
}

/* Animated waves at bottom */
.login-waves {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20vh;
  min-height: 100px;
  max-height: 200px;
  margin-bottom: -7px;
  z-index: 1;
}
.login-waves .parallax > use {
  animation: moveWave 25s cubic-bezier(.55,.5,.45,.5) infinite;
}
.login-waves .parallax > use:nth-child(1) { animation-delay: -2s; animation-duration: 7s; }
.login-waves .parallax > use:nth-child(2) { animation-delay: -3s; animation-duration: 10s; }
.login-waves .parallax > use:nth-child(3) { animation-delay: -4s; animation-duration: 13s; }
.login-waves .parallax > use:nth-child(4) { animation-delay: -5s; animation-duration: 20s; }
@keyframes moveWave {
  0% { transform: translate3d(-90px, 0, 0); }
  100% { transform: translate3d(85px, 0, 0); }
}

/* Login container */
.login-container {
  width: 100%;
  max-width: 400px;
  padding: 15px;
  position: relative;
  z-index: 10;
  animation: loginSlideUp 0.8s ease-out;
  margin: auto;
}
@keyframes loginSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Glassmorphism card */
.login-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

/* Login header */
.login-header {
  text-align: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(242, 201, 76, 0.2);
}

/* Logo */
.logo-container {
  display: inline-block;
  margin-bottom: 4px;
}
.logo-container img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

/* Title */
.login-title {
  color: var(--primary-navy);
  font-size: 21px;
  font-weight: 700;
  margin: 0;
}

/* Welcome text */
.login-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--primary-navy);
  font-weight: 600;
  margin-bottom: 14px;
}

/* Input groups */
.login-input-group {
  margin-bottom: 12px;
  position: relative;
}
.login-input-group label {
  display: block;
  color: var(--primary-navy);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
  margin-left: 5px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--primary-navy) !important;
  font-size: 15px;
  z-index: 2;
  opacity: 1;
  line-height: 1;
  pointer-events: none;
}

.login-input {
  width: 100%;
  padding: 10px 15px 10px 40px;
  border: 2px solid #e0e6ed;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-main);
  background: #f8f9fa;
  color: var(--text-color);
  transition: all 0.3s ease;
  outline: none;
}
.login-input::placeholder {
  color: #adb5bd;
  font-weight: 400;
}
.login-input:focus {
  border-color: var(--accent-gold);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.1);
}

/* Toggle password */
.toggle-password {
  position: absolute;
  right: 15px;
  color: var(--primary-navy) !important;
  cursor: pointer;
  font-size: 15px;
  z-index: 2;
  opacity: 0.85;
  background: none;
  border: none;
  padding: 4px;
  transition: opacity 0.2s;
}
.toggle-password:hover {
  opacity: 1;
}

/* Error message */
.error-message {
  border-radius: 10px;
  padding: 10px 15px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 15px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  animation: loginShake 0.4s ease;
}
@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Login button */
.login-btn {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, var(--accent-gold) 0%, #e6b93d 100%);
  border: none;
  border-radius: 10px;
  color: var(--primary-navy);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(242, 201, 76, 0.3);
}
.login-btn:active {
  transform: translateY(0) scale(0.98);
}
.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
.btn-loading { display: none; }
.login-btn.loading .btn-text,
.login-btn.loading i:not(.fa-eye):not(.fa-eye-slash):not(.fa-exclamation-circle) { display: none; }
.login-btn.loading .btn-loading { display: inline-flex; align-items: center; gap: 8px; }
.login-btn.loading {
  pointer-events: none;
}
.login-btn.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10, 46, 82, 0.3);
  border-top-color: var(--primary-navy);
  border-radius: 50%;
  animation: loginSpin 0.8s linear infinite;
  margin-right: 4px;
}
@keyframes loginSpin {
  to { transform: rotate(360deg); }
}

/* Footer */
.login-footer {
  text-align: center;
  margin-top: 14px;
  color: #6c757d;
  font-size: 11px;
  font-weight: 500;
}

/* CAPTCHA */
.captcha-group {
  margin-bottom: 18px;
}
.captcha-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.captcha-question {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #08203e 0%, #133b5c 100%);
  color: #fcd251;
  font-size: 16px;
  font-weight: 700;
  padding: 0 16px;
  border-radius: 10px;
  white-space: nowrap;
  letter-spacing: 1px;
  min-width: 110px;
  text-align: center;
  user-select: none;
  border: 1.5px solid rgba(252, 210, 81, 0.3);
}
.captcha-input-wrapper {
  flex: 1;
  min-width: 0;
}
.captcha-input-wrapper .login-input {
  width: 100%;
  box-sizing: border-box;
}

/* Responsive */
@media (max-width: 480px) {
  .login-container { padding: 10px; }
  .login-card { padding: 18px; }
  .login-title { font-size: 18px; }
}

/* ================================================================
   PRINT
   ================================================================ */
@media print {
  .dashboard-header { position: static !important; height: auto !important; padding: 10px !important; border-radius: 0 !important; }
  .container { padding-top: 10px !important; }
  .no-print, .refresh-bar, #toast-container, .mona-jumpnav { display: none !important; }
  .matrix-card, .chart-card, .libur-section { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
  .modal-overlay { display: none !important; }
  body { background: #fff; padding-bottom: 0; }
  .noise { display: none; }
}
