﻿/* ============================================================================
   AREA 1: KONFIGURASI ROOT (VARIABLES)
   ========================================================================== */
:root {
  /* ===== WARNA TEMA (PLN Nusantara Power Services) ===== */
  /* Main Blue: #00AEEF */
  --primary-700: #008dbf;
  /* Darker shade for hover */
  --primary-600: #00AEEF;
  /* Main Brand Color */
  --primary-500: #33beff;
  /* Lighter shade */
  --primary-300: #a6dfff;
  --primary-200: #d6f0ff;
  --primary-100: #eaf8ff;
  --primary-50: #00A2B9;
  /* Using Secondary Teal for specific accents */

  /* ===== WARNA TIPOGRAFI BRAND ===== */
  --text-brand: #00A2B9;
  /* Corporate Teal */

  /* ===== WARNA DASAR ===== */
  --bg: #23d9e2fd;
  --surface: #ffffff;
  --surface-2: #f4f8ff;
  --line: #e6eefc;
  --text: #0b2545;
  --muted: #5f6b7a;

  /* ===== WARNA STATUS ===== */
  --success: #10b981;
  --warning: #FFF200;
  /* Brand Yellow */
  --danger: #ED1C24;
  /* Brand Red */

  /* ===== LAYOUT & EFEK ===== */
  --radius: 18px;
  --shadow: 0 10px 30px rgba(22, 64, 180, .10);
  --focus-ring: 0 0 0 3px rgba(43, 123, 255, .18);

  /* ===== KHUSUS ===== */
  --sky-200: #dbeafe;

  /* ===== BACKGROUND APLIKASI ===== */
  --app-gradient: linear-gradient(135deg, #f0f4f8 0%, #dbeafe 100%);
  /* Lighter base for better text contrast if bg image is light, or dark if image is dark. User image looks like a control room (likely cool tones). Use light base. */
  --bg-art-url: url('assets/bg-custom.jpg');
  --bg-art-opac: 0.15;
  /* Low opacity to keep text readable */
  --bg-art-pos: center;
  --bg-art-size: cover;
  --bg-art-pos-fs: center;
  --bg-art-size-fs: cover;

  /* ===== MINI CALENDAR (ukuran default) ===== */
  --cal-max-w: 420px;
  --cal-cols: 4;
  --cal-month-h: 44px;
  --cal-gap: 8px;
  --cal-radius: 10px;
  --cal-pad: 10px;

  /* ===== MINI CALENDAR (warna) ===== */
  --cal-card-bg: var(--surface);
  --cal-card-border: var(--line);
  --cal-chip-bg: var(--surface-2);
  --cal-chip-text: var(--text);
  --cal-chip-border: var(--line);
  --cal-chip-hover-bg: var(--primary-200);
  --cal-chip-active-bg: var(--primary-600);
  /* Strong active state */
  --cal-chip-active-text: #ffffff;
  --cal-chip-focus: var(--primary-500);

  /* ===== BESAR FOTO SCAN ===== */
  --scan-photo-size: 300px;

  /* ===== Transparansi panel (override di Area 13) ===== */
  --panel-alpha: .70;
  --panel-alpha-2: .62;
}

/* ============================================================================
   AREA 2: RESET GLOBAL & DASAR HALAMAN
   ========================================================================== */
* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
}

html {
  background: var(--app-gradient);
  background-attachment: fixed;
}

body {
  position: relative;
  z-index: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--bg-art-url) var(--bg-art-pos)/var(--bg-art-size) no-repeat;
  opacity: var(--bg-art-opac);
  pointer-events: none;
  z-index: -1;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(1000px 200px at 30% 0%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  z-index: -1;
}

/* ============================================================================
   AREA 3: LAYOUT UTAMA (Sidebar & Main)
   ========================================================================== */
.sidebar,
.main {
  position: relative;
  z-index: 1
}

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 280px;
  padding: 24px;
  background: url('assets/sidebar-bg-final.png') no-repeat center bottom;
  background-size: 100% 100%;
  border-right: none;
  /* Remove border as image defines edge */
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: var(--shadow);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  place-items: center;
  /* Brand Gradient: Blue to Teal */
  background: linear-gradient(135deg, var(--primary-600), var(--text-brand));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 6px 20px rgba(43, 123, 255, .35);
}

.brand-name {
  font-weight: 700
}

.brand-sub {
  color: rgba(255, 255, 255, 0.85);
  /* Light text for dark bg */
  font-size: .9rem
}

/* Nav */
.nav {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.navlink {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  color: #fff;
  /* White text */
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1rem;
}

.navlink:hover {
  background: rgba(255, 255, 255, 0.15);
  /* Glass effect */
}

.navlink.active {
  background: #fff;
  color: var(--primary-700);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  outline: none;
}

.sidebar-footer {
  margin-top: auto;
  color: rgba(255, 255, 255, 0.6);
  font-size: .9rem
}

/* Main */
.main {
  margin-left: 280px;
  padding: 24px;
  min-height: 100%
}

.topbar {
  display: none
}

.main {
  padding-top: 16px
}

/* ============================================================================
   AREA 4: KOMPONEN UMUM
   ========================================================================== */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 16px 0
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px
}

.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card.subtle {
  background: var(--surface-2)
}

.card-title {
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-brand);
  /* Brand identity on headers */
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(2, 6, 23, .12)
}

/* Toolbar & Inputs */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px
}

.toolbar .left {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.toolbar label {
  display: flex;
  align-items: center;
  gap: 6px
}

.search,
input,
select {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  outline: none;
  min-width: 260px;
  font-size: .95rem;
}

/* Buttons */
.btn {
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid var(--line);
  color: var(--text);
  background: #fff;
  font-weight: 600;
  transition: transform .12s ease, box-shadow .12s ease, background .2s ease;
}

.btn:hover {
  background: var(--primary-100);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(2, 6, 23, .08)
}

.btn.primary {
  color: #fff;
  border-color: var(--primary-600);
  background: linear-gradient(180deg, var(--primary-600), var(--primary-700));
  box-shadow: 0 6px 18px rgba(43, 123, 255, .25);
}

.btn.ghost {
  background: #fff
}

.btn.light {
  background: #fff;
  border: 1px solid var(--primary-300);
  color: var(--primary-700)
}

/* Tables */
.table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff
}

.table {
  width: 100%;
  border-collapse: collapse
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: .95rem;
  white-space: nowrap;
}

.table th {
  background: var(--primary-100);
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 1
}

.table tr:hover td {
  background: var(--primary-100)
}

/* Dialog (Modal) */
dialog::backdrop {
  background: rgba(7, 25, 69, .25)
}

.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  position: relative
}

.modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #334155;
}

/* Progress Bar */
.progress-bar {
  height: 12px;
  background: var(--primary-100);
  border-radius: 99px;
  border: 1px solid var(--primary-200);
  overflow: hidden
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-600), var(--primary-300));
  width: 0%;
  position: relative;
  transition: width .45s cubic-bezier(.22, 1, .36, 1);
  overflow: hidden;
}

.progress::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, .6) 50%, transparent 100%);
  animation: barShine 2.8s linear infinite;
}

@keyframes barShine {
  0% {
    transform: translateX(-120%)
  }

  100% {
    transform: translateX(120%)
  }
}

/* Bump angka statistik saat berubah */
.stat-value.changed {
  animation: bump .5s ease
}

@keyframes bump {
  0% {
    transform: scale(1)
  }

  35% {
    transform: scale(1.08)
  }

  100% {
    transform: scale(1)
  }
}

/* ============================================================================
   AREA 5: HALAMAN SCANNER (#route-scan)
   ========================================================================== */
#route-scan .scan-ui {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text)
}

#route-scan .scan-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 0;
  /* Prevent grid blowout */
}

#route-scan .scan-title {
  margin: 0
}

/* Kiri */
#route-scan .scan-hero-left {
  background: linear-gradient(135deg, var(--primary-100), #fff);
  border: 1px solid var(--primary-200);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}

#route-scan .scan-hello {
  font-weight: 700;
  color: var(--primary-600);
  margin-bottom: 6px
}

#route-scan .scan-sub {
  color: var(--muted)
}

.scan-input.light {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.06rem;
  background: #fff;
  border: 1px solid var(--primary-300);
  border-radius: 16px;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(43, 123, 255, .10) inset;
}

.scan-input.light:focus-visible {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(43, 123, 255, .25) inset;
  outline: none;
}

.hint.light {
  color: var(--muted);
  margin-top: 8px
}

/* Kanan */
#route-scan .scan-hero-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(135deg, #f5fffb, var(--primary-50));
  border: 1px solid var(--primary-200);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.scan-profile-card {
  display: grid;
  grid-template-columns: var(--scan-photo-size) 1fr;
  gap: 16px;
  align-items: center;
  width: 100%;
  min-width: 0;
  /* Important for grid child */
}

#route-scan .photo-big,
#scanPhoto {
  width: var(--scan-photo-size);
  height: var(--scan-photo-size);
  border-radius: 24px;
  background: #e6eefb center/cover no-repeat;
  border: 1px solid var(--primary-300);
  flex-shrink: 0;
}

#route-scan .info .name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--text);
  padding: 8px 12px;
  border: 1px solid var(--primary-300);
  border-radius: 14px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(43, 123, 255, .12);
  margin-bottom: 6px;
}

#route-scan .info {
  display: flex;
  flex-direction: column;
  gap: 10px
}

#route-scan .info .meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
}

#route-scan .info .meta span {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--primary-300);
  background: #fff;
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
  gap: 6px;
}

/* label meta */
#scanNID::before {
  content: "NID";
  font-size: 11px;
  letter-spacing: .03em;
  color: var(--muted);
  margin-right: 6px
}

#scanTitle::before {
  content: "JABATAN";
  font-size: 11px;
  letter-spacing: .03em;
  color: var(--muted);
  margin-right: 6px
}

#scanCompany::before {
  content: "PERUSAHAAN";
  font-size: 11px;
  letter-spacing: .03em;
  color: var(--muted);
  margin-right: 6px
}

#scanShift::before {
  content: "SHIFT";
  font-size: 11px;
  letter-spacing: .03em;
  color: var(--muted);
  margin-right: 6px
}

/* Pill status */
#route-scan .pill.light {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  margin-top: 10px;
  font-weight: 700;
  background: #ecfff6;
  border: 1px solid #bff3d9;
  color: #036a36;
}

#route-scan .pill.light.warn {
  background: #fff7e6;
  border-color: #ffe0a9;
  color: #7a4a00
}

#route-scan .pill.light.danger {
  background: #ffecec;
  border-color: #ffc6c6;
  color: #7a1a1a
}

#route-scan .ts {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 600
}

#route-scan .pill.light,
#route-scan .ts {
  align-self: flex-start
}

/* Presence bubbles (opsional) */
#scanPresence {
  margin-top: 12px
}

#scanPresenceBubbles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

.presence-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text);
}

.presence-bubble .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(16, 185, 129, .15)
}

.presence-bubble.off .dot {
  background: #94a3b8;
  box-shadow: none
}

.presence-bubble .count {
  font-variant-numeric: tabular-nums
}

/* Tabel riwayat */
#route-scan .scan-table.card-light {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow)
}

#route-scan .card-title-light {
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px
}

#route-scan .table-wrap.light {
  border: 1px solid var(--line);
  border-radius: 16px
}

#route-scan .table.light {
  color: var(--text)
}

#route-scan .table.light th {
  background: var(--primary-100);
  color: var(--text);
  border-bottom: 1px solid var(--line);
  font-weight: 700
}

#route-scan .table.light td {
  border-bottom: 1px solid var(--line)
}

#route-scan .table.light tr:hover td {
  background: var(--primary-100)
}

/* Statistik Kehadiran (Pie + Tabel) */
#route-scan .scan-stats {
  margin-top: 14px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--primary-200);
  border-radius: 16px;
  padding: 12px;
  backdrop-filter: blur(6px);
}

#route-scan .scan-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px
}

#route-scan .scan-stats-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 12px;
  align-items: center
}

#route-scan .scan-stats .chart-col {
  min-height: 260px;
  display: grid;
  place-items: center
}

#route-scan .scan-stats canvas {
  width: 100% !important;
  height: 260px !important
}

#route-scan .table.presence th,
#route-scan .table.presence td {
  white-space: nowrap
}

#route-scan .presence-bar {
  height: 8px;
  background: var(--primary-100);
  border: 1px solid var(--primary-200);
  border-radius: 999px;
  overflow: hidden
}

#route-scan .presence-bar>i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--success), #0670f3);
  width: 0%;
  transition: width .45s ease
}

/* =========================
   GEN 2 MOBILE UI REDESIGN
   ========================= */
:root {
  --mob-grad-1: #2563eb;
  /* Royal Blue */
  --mob-grad-2: #06b6d4;
  /* Cyan */
  --mob-bg-body: #f8fafc;
}

.mob-modern-wrapper {
  background: var(--mob-bg-body);
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  padding-bottom: 90px;
  /* Nav space */
}

/* 1. Header */
.mob-modern-header {
  background: linear-gradient(135deg, var(--mob-grad-1), var(--mob-grad-2));
  padding: 20px 24px 60px;
  /* Bottom padding for overlap */
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  color: #fff;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.25);
}

.mob-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.mob-brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 99px;
  backdrop-filter: blur(4px);
  width: fit-content;
  margin-bottom: 16px;
}

.mob-brand-mark img {
  height: 20px;
  width: auto;
}

.mob-brand-mark span {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.mob-greet h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

.mob-greet p {
  margin: 4px 0 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Profile Icon w/ Notification */
.mob-profile-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  padding: 2px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.mob-profile-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.mob-notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  height: 18px;
  min-width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 99px;
  border: 2px solid var(--mob-grad-1);
}

/* 2. Hero Card (Active On-Site) */
.mob-hero-container {
  padding: 0 24px;
  margin-top: -40px;
  /* Overlap */
  position: relative;
  z-index: 2;
}

.mob-hero-card {
  background: url('assets/bg-city-overlay.png'), linear-gradient(110deg, #3b82f6, #0ea5e9);
  background-size: cover;
  background-position: center;
  border-radius: 24px;
  padding: 20px;
  color: white;
  box-shadow: 0 15px 35px rgba(14, 165, 233, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

/* Shine Effect */
.mob-hero-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: skewX(-20deg);
  animation: shine 4s infinite;
}

@keyframes shine {
  0% {
    left: -100%;
  }

  20% {
    left: 200%;
  }

  100% {
    left: 200%;
  }
}

.mob-hero-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
  margin-bottom: 8px;
}

.mob-hero-title .dot {
  width: 8px;
  height: 8px;
  background: #bef264;
  /* Lime green */
  border-radius: 50%;
  box-shadow: 0 0 10px #bef264;
  animation: pulse 2s infinite;
}

.mob-hero-count {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  margin: 4px 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mob-hero-lbl {
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.96;
}

/* 3. Quick Actions Grid (Phase 2) */
.mob-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 24px;
  margin-bottom: 24px;
}

.mob-quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  background: none;
  border: none;
  color: inherit;
  width: 100%;
  padding: 0;
}

.mob-quick-item:active {
  transform: scale(0.95);
}

.mob-quick-icon {
  width: 100%;
  /* Fill container (aspect ratio handled by grid usually, but we want square) */
  aspect-ratio: 1/1;
  max-width: 64px;
  background: #fff;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  /* Soft shadow */
  color: var(--mob-grad-1);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: all 0.2s;
}

.mob-quick-item:hover .mob-quick-icon {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.mob-quick-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  letter-spacing: -0.2px;
}

/* 4. Daily Stats Card (Phase 3) */
.mob-daily-card {
  background: #fff;
  margin: 0 24px 24px;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 20px;
  align-items: center;
}

.mob-stats-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mob-stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mob-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.mob-stat-icon.green {
  background: #dcfce7;
  color: #16a34a;
}

.mob-stat-icon.red {
  background: #fee2e2;
  color: #dc2626;
}

.mob-stat-info h5 {
  margin: 0;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mob-stat-info h3 {
  margin: 2px 0 0;
  font-size: 1.25rem;
  color: #0f172a;
  font-weight: 800;
}

.mob-chart-wrap {
  width: 120px;
  height: 120px;
  position: relative;
  display: grid;
  place-items: center;
}

.mob-chart-center {
  position: absolute;
  text-align: center;
  pointer-events: none;
}

.mob-chart-center span {
  display: block;
  font-size: 0.7rem;
  color: #64748b;
}

.mob-chart-center b {
  display: block;
  font-size: 1.2rem;
  color: #0f172a;
  font-weight: 800;
}

/* 5. Modern Bottom Nav (Phase 4) */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  /* Taller for modern feel */
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.03);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 9999;
  padding-bottom: 10px;
  /* Safe area padding */
}

.mb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #94a3b8;
  position: relative;
  width: 20%;
  height: 100%;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mb-item.active {
  color: var(--mob-grad-1);
}

.mb-item .icon {
  font-size: 1.5rem;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: transparent;
  border-radius: 12px;
  width: 40px;
  height: 32px;
  display: grid;
  place-items: center;
}

.mb-item.active .icon {
  transform: translateY(-4px);
  color: var(--mob-grad-1);
}

.mb-item span {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.mb-item.active span {
  font-weight: 700;
  opacity: 1;
}

/* Floating Active Indicator */
.mb-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 40px;
  height: 4px;
  background: linear-gradient(90deg, var(--mob-grad-1), var(--mob-grad-2));
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: translateY(0);
  }
}






/* ============================================================================
   AREA 6: DASHBOARD (#route-dashboard)
   ========================================================================== */
.greet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px
}

.stat-label {
  color: var(--muted);
  margin-bottom: 6px
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800
}

.stat-sub {
  color: var(--muted)
}

/* Kartu statistik dibuat compact */
#route-dashboard .card.stat {
  background: #eff3f1;
  border: 1px solid #cfd8ea;
  border-radius: 16px
}

#route-dashboard .card.stat .stat-label {
  color: #0d09f7
}

#route-dashboard .card.stat .stat-value {
  color: #0f172a
}

/* progress bar */
#route-dashboard .progress-bar {
  background: #e6efff
}

#route-dashboard .progress {
  background: #2563eb
}

/* Panel shift di dalam kartu Scan 24 jam */
.scan-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start
}

#scanRightCol .card-subtitle {
  font-weight: 600;
  color: #ff0404;
  margin-bottom: 6px
}

#statCurrentShift .row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0
}

#statCurrentShift .chip {
  background: #f8ef04;
  border: 1px solid #c7d2fe;
  color: #ef0808;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 600
}

#statCurrentShift .muted {
  color: var(--muted)
}

/* ====== 6B. DASHBOARD TRIO: Kalender | Informasi | Aktivitas ====== */
.dash-trio {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) 1.1fr 1.1fr;
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.dash-trio>.card {
  height: 100%
}

#newsCardDash .news-grid {
  grid-template-columns: 1fr
}

#recentCard .table-wrap {
  max-height: 420px;
  overflow: auto
}

/* Responsif */
@media (max-width:1300px) {
  .dash-trio {
    grid-template-columns: 1fr 1fr
  }

  #recentCard {
    grid-column: 1 / -1
  }
}

@media (max-width:850px) {
  .dash-trio {
    grid-template-columns: 1fr
  }
}

/* ============================================================================
   AREA 7: COMPANY PRESENCE CARDS
   ========================================================================== */
.company-grid,
#companyPresenceGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px
}

.company-card {
  --accent: #2563eb;
  --bg: #eff6ff;
  background: linear-gradient(180deg, rgba(2, 6, 23, .06), var(--bg));
  border: 1px solid rgba(2, 6, 23, .08);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(2, 6, 23, .06);
  transition: transform .18s ease, box-shadow .18s ease;
}

@supports (background: color-mix(in srgb, #000 10%, #fff)) {
  .company-card {
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, #ffffff), var(--bg));
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  }
}

.company-card .name {
  font-weight: 700;
  letter-spacing: .2px
}

.company-card .sub {
  color: #64748b;
  font-size: 12px;
  margin-top: 2px
}

.company-card .badge {
  min-width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  border-radius: 40px;
  font-weight: 800;
  font-size: 20px;
  background: rgba(2, 6, 23, .03);
  color: #0f172a;
  border: 1px solid rgba(2, 6, 23, .08);
}

@supports (color: color-mix(in srgb, #000 10%, #fff)) {
  .company-card .badge {
    background: color-mix(in srgb, var(--accent) 16%, white);
    color: color-mix(in srgb, var(--accent) 85%, #0f172a);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  }
}

.company-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(2, 6, 23, .10)
}

.company-card:nth-child(4n+1) {
  --accent: #d9463c;
  --bg: #feedec
}

.company-card:nth-child(4n+2) {
  --accent: #f59e0b;
  --bg: #fffbeb
}

.company-card:nth-child(4n+3) {
  --accent: #10b981;
  --bg: #f0fdf4
}

.company-card:nth-child(4n+4) {
  --accent: #a855f7;
  --bg: #fbf5ff
}

@keyframes cardBlink {

  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent, #22c55e) 0%, transparent)
  }

  50% {
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent, #22c55e) 20%, transparent)
  }
}

@keyframes badgePing {

  0%,
  100% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.06)
  }
}

.company-card.live,
.company-card.present {
  animation: cardBlink 1.4s ease-in-out infinite
}

.company-card.live .badge,
.company-card.present .badge {
  animation: badgePing 1.4s ease-in-out infinite
}

.company-card.empty {
  filter: grayscale(.25);
  opacity: .95
}

/* LIVE STATS CHIPS */
.live-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 2px
}

.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: var(--primary-100);
  border: 1px solid var(--line);
  font-weight: 600;
  color: var(--text);
}

.stat-chip b {
  font-variant-numeric: tabular-nums
}

/* ============================================================================
   AREA 9: NEWS CARDS
   ========================================================================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px
}

.news-card {
  border: 1px solid var(--sky-200);
  background: linear-gradient(180deg, #FF0000, #f9fbff);
  border-radius: 16px;
  padding: 12px;
  position: relative;
  overflow: hidden;
  will-change: transform, box-shadow;
  animation: newsPulse 3.6s ease-in-out infinite;
}

.news-card .title {
  font-weight: 800;
  margin-bottom: 6px;
  color: #f3f4f1
}

.news-card .meta {
  font-size: .85rem;
  color: #040e19;
  margin-bottom: 6px
}

.news-card .body {
  color: #2e2e0e
}

.news-card a {
  color: #2563eb;
  text-decoration: none
}

.news-card a:hover {
  text-decoration: underline
}

.card-light .news-card {
  border-color: var(--sky-200)
}

@keyframes newsPulse {

  0%,
  100% {
    box-shadow: 0 8px 22px rgba(220, 20, 60, .18);
    transform: translateY(0)
  }

  50% {
    box-shadow: 0 14px 34px rgba(220, 20, 60, .30);
    transform: translateY(-2px)
  }
}

@keyframes newsGlow {

  0%,
  100% {
    opacity: .18;
    transform: translateY(0)
  }

  50% {
    opacity: .36;
    transform: translateY(-6px)
  }
}

@keyframes newsSweep {
  0% {
    transform: translateX(-130%)
  }

  100% {
    transform: translateX(130%)
  }
}

.news-card::after {
  content: "";
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 60%;
  background: radial-gradient(60% 50% at 20% 0%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 60%);
  pointer-events: none;
  animation: newsGlow 3.6s ease-in-out infinite;
}

.news-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, transparent 5%, rgba(5, 235, 243, .821) 50%, transparent 100%);
  mix-blend-mode: screen;
  transform: translateX(-130%);
  animation: newsSweep 6.5s linear infinite;
  pointer-events: none;
}

.news-card:hover {
  animation-play-state: paused
}

.news-card:hover::before,
.news-card:hover::after {
  animation-play-state: paused
}

/* ============================================================================
   AREA 10: KOMPONEN LAIN
   ========================================================================== */
.clock,
#liveClock {
  font-family: "Bernard MT Condensed", Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 800;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: .02em;
  color: #ff0000;
  font-variant-numeric: tabular-nums lining-nums;
}

/* Dialog Kamera */
dialog.camdlg {
  border: 0;
  padding: 0;
  background: transparent;
  width: auto
}

dialog.camdlg::backdrop {
  background: rgba(0, 0, 0, .85)
}

.cam-box {
  width: min(94vw, 640px);
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  padding: 12px
}

.cam-head {
  display: flex;
  justify-content: space-between;
  color: #e5e7eb;
  font-weight: 600;
  margin-bottom: 8px
}

.cam-view {
  position: relative;
  background: #000;
  border-radius: 10px;
  overflow: hidden
}

.cam-view video {
  width: 100%;
  height: auto;
  display: block
}

.cam-actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-top: 10px
}

.cam-actions .btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #111827;
  color: #e5e7eb
}

.cam-actions .btn.primary {
  background: #2563eb;
  border-color: #1d4ed8
}

.cam-actions .btn.warn {
  background: #d97706;
  border-color: #b45309;
  color: #111
}

.cam-thumb {
  margin-top: 8px;
  width: 86px;
  height: 86px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #e5e7eb
}

/* Tabel Shift Compact */
#tableSched.compact select.sched {
  min-width: 86px;
  height: 26px;
  font-size: 12px;
  padding: 2px 6px
}

#tableSched.compact th,
#tableSched.compact td {
  padding: 4px
}

/* ============================================================================
   AREA 11: FULLSCREEN
   ========================================================================== */
#route-scan:fullscreen,
#route-dashboard:fullscreen,
#route-scan:-webkit-full-screen,
#route-dashboard:-webkit-full-screen {
  background: var(--app-gradient) !important;
  min-height: 100vh;
  margin: 0;
  padding: 12px;
  border-radius: 0;
  position: relative;
  z-index: 0;
}

#route-scan:fullscreen::before,
#route-dashboard:fullscreen::before,
#route-scan:-webkit-full-screen::before,
#route-dashboard:-webkit-full-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--bg-art-url) var(--bg-art-pos-fs, center)/var(--bg-art-size-fs, cover) no-repeat;
  opacity: var(--bg-art-opac);
  pointer-events: none;
  z-index: -1;
}

#route-scan:fullscreen>*,
#route-dashboard:fullscreen>*,
#route-scan:-webkit-full-screen>*,
#route-dashboard:-webkit-full-screen>* {
  position: relative;
  z-index: 1
}

/* ============================================================================
   AREA 12: HELPERS, RESPONSIVE & AKSESIBILITAS
   ========================================================================== */
.hidden {
  display: none
}

.muted {
  color: var(--muted)
}

/* Responsive untuk scan panel */
@media (max-width:1100px) {
  #route-scan .scan-hero {
    grid-template-columns: 1fr
  }

  #route-scan .scan-hero-right {
    flex-direction: column;
    text-align: center
  }

  .scan-profile-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  #route-scan .photo-big {
    margin: 0 auto
  }

  #route-scan .scan-stats-grid {
    grid-template-columns: 1fr
  }

  #route-scan .scan-stats canvas {
    height: 220px !important
  }
}

/* Performa Mobile */
@media (max-device-width:1024px) {

  html,
  body {
    background-attachment: scroll
  }

  body::before,
  body::after {
    position: absolute
  }
}

/* Reduce Motion */
@media (prefers-reduced-motion:reduce) {

  .company-card.live,
  .company-card.present,
  .company-card.live .badge,
  .company-card.present .badge,
  .progress::after,
  .news-card,
  .news-card::before,
  .news-card::after {
    animation: none !important
  }

  .card:hover,
  .btn:hover,
  .company-card:hover {
    transform: none
  }
}

/* Focus Styles */
:is(.navlink, .btn):focus-visible {
  outline: 2px solid var(--primary-300);
  outline-offset: 2px
}

:is(input, select, .search):focus-visible {
  outline: none;
  border-color: var(--primary-300);
  box-shadow: var(--focus-ring)
}

/* ============================================================================
   AREA 13: MINI CALENDAR OVERRIDES (sizing + colors)
   ========================================================================== */
/* Override variabel kalender agar compact */
:root {
  --cal-max-w: 400px;
  --cal-cols: 4;
  --cal-month-h: 20px;
  --cal-gap: 3px;
  --cal-radius: 8px;
  --cal-pad: 6px 10px;
  --cal-font: 10px;
}

/* Paksa kartu kalender transparan */
#calendarCard,
#miniCalendar:where(.card) {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Lebar kartu + posisi kiri */
#calendarCard {
  max-width: var(--cal-max-w);
  margin: 2px 0 0
}

/* Skala font kalender */
#miniCalendar {
  font-size: var(--cal-font)
}

/* Grid bulan rapat */
#calendarCard #miniCalendar .cal-months {
  grid-template-columns: repeat(var(--cal-cols), minmax(4px, 1fr)) !important;
  gap: var(--cal-gap) !important;
}

/* Ukuran chip bulan & tahun */
#miniCalendar .cal-month {
  height: var(--cal-month-h);
  padding: var(--cal-pad) !important;
  border-radius: var(--cal-radius) !important
}

#miniCalendar .cal-years {
  gap: var(--cal-gap) !important
}

#miniCalendar .cal-year {
  padding: 6px 10px !important;
  border-radius: var(--cal-radius) !important
}

/* Mode super-kompak opsional */
#calendarCard.compact {
  transform: scale(.8);
  transform-origin: top left
}

/* Panel transparan */
.card {
  background: rgba(255, 255, 255, var(--panel-alpha)) !important;
}

.card.subtle,
#route-scan .scan-table.card-light {
  background: rgba(244, 248, 255, var(--panel-alpha-2)) !important;
}

.table-wrap {
  background: rgba(255, 255, 255, var(--panel-alpha)) !important;
}

#route-scan .scan-hero-left,
#route-scan .scan-hero-right {
  background: rgba(255, 255, 255, var(--panel-alpha)) !important;
  backdrop-filter: blur(6px);
}

/* ==== Kalender Bulan Ini (month-view) ==== */
#monthCalendar {
  --mc-cell-h: 42px;
}

#monthCalendar .mc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px
}

#monthCalendar .mc-title {
  font-weight: 800
}

#monthCalendar .mc-nav {
  display: flex;
  gap: 6px
}

#monthCalendar .mc-nav .btn {
  padding: 6px 10px;
  border-radius: 10px
}

#monthCalendar .mc-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 4px
}

#monthCalendar .mc-d {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0
}

#monthCalendar .mc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px
}

#monthCalendar .mc-day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--mc-cell-h);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 700;
  color: var(--text);
  transition: transform .12s ease, box-shadow .12s ease;
}

#monthCalendar .mc-day:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(2, 6, 23, .06)
}

#monthCalendar .mc-day.muted {
  color: #94a3b8;
  background: var(--surface-2)
}

#monthCalendar .mc-day.today {
  border-color: var(--primary-600);
  background: var(--primary-100);
  color: var(--primary-700);
  box-shadow: 0 0 0 3px rgba(43, 123, 255, .18) inset;
}

#monthCalendar .mc-day.has-logs::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  position: absolute;
  bottom: 6px;
}

/* Lebar kartu kalender ringkas (default) */
#monthCalendarCard {
  max-width: 520px
}

@media (max-width:1100px) {
  #monthCalendar .mc-day {
    height: 38px
  }
}

/* Kalender mengikuti kolom dash-trio */
.dash-trio #monthCalendarCard {
  max-width: none;
  width: 100%
}

/* ============================================================================
   AREA 14: SEMBUNYIKAN KALENDER STRIP LAMA (TAHUN/BULAN DI BAWAH)
   ========================================================================== */
#calendar,
#calendarBottom,
#yearCalendar,
#yearNav,
#monthNav,
.calendar-bottom,
.calendar-strip,
.kalender-bawah {
  display: none !important;
}

/* =========================
   FINAL PATCH â€” DASHBOARD & LIST PANEL
   ========================= */

/* 1) Sembunyikan mini calendar lama (tahun & bulan) */
#calendarCard,
#miniCalendar {
  display: none !important;
}

/* 2) Trio layout: Kalender | Info | Aktivitas */
.dash-trio {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr 1.2fr;
  gap: 16px;
  align-items: start;
}

/* Kartu di trio fleksibel dan bisa men-scroll isi */
.dash-trio .card {
  display: flex;
  flex-direction: column;
  min-height: 360px;
}

#newsCardDash .news-grid {
  margin-top: 4px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

#recentCard .table-wrap {
  overflow: auto;
  flex: 1;
  min-height: 0;
}

/* Responsif */
@media (max-width:1400px) {
  .dash-trio {
    grid-template-columns: 1fr 1fr;
  }

  #recentCard {
    grid-column: 1 / -1;
  }
}

@media (max-width:900px) {
  .dash-trio {
    grid-template-columns: 1fr;
  }

  #monthCalendarCard,
  #newsCardDash,
  #recentCard {
    min-height: auto;
  }
}

/* 3) Kalender Bulan Ini (month-view) â€“ konsisten */
#monthCalendar {
  --mc-cell-h: 42px;
}

#monthCalendarCard {
  max-width: 520px;
}

#monthCalendar .mc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

#monthCalendar .mc-title {
  font-weight: 800;
}

#monthCalendar .mc-nav {
  display: flex;
  gap: 6px;
}

#monthCalendar .mc-nav .btn {
  padding: 6px 10px;
  border-radius: 10px;
}

#monthCalendar .mc-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 4px;
}

#monthCalendar .mc-d {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0;
}

#monthCalendar .mc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

#monthCalendar .mc-day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--mc-cell-h);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 700;
  color: var(--text);
  transition: transform .12s ease, box-shadow .12s ease;
}

#monthCalendar .mc-day:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(2, 6, 23, .06);
}

#monthCalendar .mc-day.muted {
  color: #94a3b8;
  background: var(--surface-2);
}

#monthCalendar .mc-day.today {
  border-color: var(--primary-600);
  background: var(--primary-100);
  color: var(--primary-700);
  box-shadow: 0 0 0 3px rgba(43, 123, 255, .18) inset;
}

#monthCalendar .mc-day.has-logs::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  position: absolute;
  bottom: 6px;
}

@media (max-width:1100px) {
  #monthCalendar .mc-day {
    height: 38px;
  }
}

/* 4) Konsistensi panel transparan & sembunyikan label persen Education */
.card {
  background: rgba(255, 255, 255, var(--panel-alpha, .70)) !important;
}

.table-wrap {
  background: rgba(255, 255, 255, var(--panel-alpha, .70)) !important;
}

/* HIDE persen "95%" di Education Highlights */
.edu-bar .val {
  display: none !important;
}

/* =========================
   FINAL PATCH â€” BRAND / LOGO PANEL PERSISTEN
   (letakkan di paling bawah agar menang melawan style sebelumnya)
   ========================= */

/* Token ukuran panel logo (ubah bebas) */
:root {
  --brand-size: 200px;
}

/* Panel logo dasar yang tidak memudar isi */
.logo-panel {
  --panel-alpha: .50;
  --panel-alpha-2: .45;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 100%;
  padding: 9px;
  backdrop-filter: blur(6px);
}

/* Gambar/logo di dalam panel */
.logo-panel>img,
.logo-panel .logo-img,
.brand-corner .logo-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  display: block;
  filter: none;
}

/* Jika ada inline width/height dari JS, timpa biar konsisten */
.logo-panel[style*="width"],
.logo-panel[style*="height"] {
  width: var(--brand-size) !important;
  height: var(--brand-size) !important;
}

/* Panel khusus pojok brand: kontrol opacity tanpa mempengaruhi konten */
:root {
  --brand-panel-alpha: .9;
  --brand-panel-blur: 0px;
  --brand-panel-bg-rgb: 225, 255, 255;
  --brand-panel-border: var(--line);
}

.brand-corner.card,
.brand-corner.card.subtle {
  background: rgba(var(--brand-panel-bg-rgb), var(--brand-panel-alpha)) !important;
  border: 1px solid var(--brand-panel-border) !important;
  backdrop-filter: blur(var(--brand-panel-blur));
  -webkit-backdrop-filter: blur(var(--brand-panel-blur));
}

/* Kontainer brand jangan menyusutkan panel */
.brand-corner {
  flex: 0 0 auto;
}

/* Opsional: panel greet sedikit lebih gelap (tanpa ubah layout) */
#route-dashboard .greet {
  --greet-tint: 0, 255, 255;
  --greet-alpha: .68;
  position: relative;
  background: linear-gradient(135deg,
      rgba(var(--greet-tint), calc(var(--greet-alpha) + .06)),
      rgba(var(--greet-tint), var(--greet-alpha))) !important;
  border-color: color-mix(in srgb, rgb(var(--greet-tint)) 40%, transparent);
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .12);
}

#route-dashboard .greet::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120% 140% at 10% 0%, rgba(255, 255, 255, .893), transparent 20%);
}

/* ============================================================================
   AREA 8: NEW DASHBOARD HEADER & STATS (Modern)
   ========================================================================== */
.header-modern {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 249, 255, 0.85));
  backdrop-filter: blur(10px);
  padding: 16px 24px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  min-height: fit-content;
}

.header-logo {
  width: auto;
  height: 135px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.header-logo img {
  width: auto;
  height: 100%;
  object-fit: contain;
  max-width: 450px;
  /* Allow wider logos */
}

.header-content {
  flex: 1;
  text-align: center;
  margin: 0 24px;
}

.header-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--primary-700);
  margin: 0 0 4px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
  margin: 0 auto;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-100%);
  }
}

.marquee-wrap {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-content {
  display: inline-block;
  padding-left: 100%;
  /* Start from right */
  animation: marquee 25s linear infinite;
  font-weight: 600;
  color: #64748b;
  /* Use distinct color or var(--text-muted) */
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.header-clock {
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-600);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.header-btn {
  background: white;
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.header-btn:hover {
  background: var(--primary-50);
  color: var(--primary-600);
  border-color: var(--primary-200);
}

/* Grid 4 Columns */
.grid-4 {
  display: grid;
  /* Fixed grid to ensure row of 4, but switch to wrapping if too small (via media query) 
     OR use auto-fit for zoom stability. Let's use auto-fit. */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* Solid Cards */
.card-solid {
  padding: 20px;
  border-radius: 20px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s;
  cursor: pointer;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-solid:hover {
  transform: translateY(-4px);
  filter: brightness(1.05);
}

/* Card Variants */
.stat-blue {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 8px 16px rgba(79, 172, 254, 0.3);
}

.stat-orange {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 8px 16px rgba(245, 87, 108, 0.3);
}

.stat-cyan {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  box-shadow: 0 8px 16px rgba(67, 233, 123, 0.3);
}

.stat-green {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  box-shadow: 0 8px 16px rgba(250, 112, 154, 0.3);
}

.pills {
  display: flex;
  margin-bottom: 12px;
}

.pill {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.lbl {
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.9;
}

.val {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.1;
}

/* Responsive */
@media (max-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-modern {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .header-right {
    align-items: center;
  }

  .dash-trio {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ===== Global Tooltip ===== */
#global-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(4px);
}

#global-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Loading & Skeletons (Performance UX) ===== */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 0.8s ease-in-out infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
  min-height: 1em;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
   AREA FINAL: COMPREHENSIVE MOBILE RESPONSIVENESS
   ========================================================================== */

/* 1. Mobile Toggle Button */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1100;
  background: white;
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  color: var(--primary-700);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 2. Responsive Breakpoints */
@media (max-width: 1024px) {

  /* Reset Main Layout */
  .main {
    margin-left: 0;
    width: 100%;
    padding: 16px;
    padding-top: 80px;
    /* Space for hamburger */
  }

  /* Show Toggle */
  .mobile-nav-toggle {
    display: flex;
  }

  /* Off-canvas Sidebar */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  /* Reset Header Logo logic override */
  .header-modern {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 16px;
  }

  .header-logo {
    height: auto;
    max-height: 80px;
    justify-content: center;
  }

  .header-content {
    margin: 0;
    text-align: center;
  }

  .header-right {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    margin-top: 8px;
  }
}

/* 3. Small Mobile */
@media (max-width: 480px) {

  .grid-4,
  .grid-3,
  .grid-5,
  .news-grid {
    grid-template-columns: 1fr !important;
  }

  .header-title {
    font-size: 1.2rem;
  }

  .header-clock {
    font-size: 1.4rem;
  }

  /* Tables */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid var(--line);
  }

  th,
  td {
    white-space: nowrap;
    font-size: 0.85rem;
  }
}

/* ===== REBRANDING POLISH ===== */
.header-title,
h1.page-title {
  color: var(--text-brand) !important;
}

/* ============================================================================
   AREA FINAL: MOBILE REDESIGN (REF STYLE)
   ========================================================================== */

/* Default State: Mobile UI Hidden */
.mob-dash-container {
  display: none;
}

.desktop-dash {
  display: block;
}

.mobile-bottom-nav {
  display: none;
}

/* MOBILE BREAKPOINT */
@media (max-width: 768px) {

  /* 1. Toggle Views */
  .mob-dash-container {
    display: block;
  }

  .desktop-dash {
    display: none !important;
  }

  /* Sidebar: Hidden by default on mobile, unless active */
  .sidebar:not(.active-mobile) {
    display: none !important;
  }

  /* Mobile Sidebar Drawer Style */
  .sidebar.active-mobile {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    /* Fallback */
    height: 100dvh;
    /* FIX: Stable on mobile browsers */
    bottom: 0;
    /* Anchor to bottom */
    z-index: 10002;
    /* Above everything */
    animation: slideInSidebar 0.3s ease forwards;
    /* FIX: Sync mobile sidebar background */
    background: url('assets/sidebar-bg-final.png') no-repeat center bottom !important;
    background-size: 100% 100% !important;
    overflow-y: auto;
    padding-bottom: 80px;
    /* Ensure bottom content is reachable */
    /* Allow scrolling for small screens */
  }

  /* FIX: Pastikan teks menu yg AKTIF berwarna biru (kontras dengan putih) */
  .sidebar.active-mobile .navlink.active {
    color: var(--primary-700) !important;
    background: #fff;
  }

  /* FIX: Revert text color to white for dark background (yg tidak aktif) */
  .sidebar.active-mobile .navlink:not(.active) {
    color: #fff;
  }

  .sidebar.active-mobile .brand-sub {
    color: rgba(255, 255, 255, 0.85);
  }

  @keyframes slideInSidebar {
    from {
      transform: translateX(-100%);
    }

    to {
      transform: translateX(0);
    }
  }

  /* Overlay Z-Index Fix */
  .sidebar-overlay.active {
    z-index: 10001;
    display: block;
    background: rgba(0, 0, 0, 0.5);
  }

  /* Kill Desktop Header & Toggle Button (redundant) */
  .header-modern,
  .mobile-nav-toggle,
  #btnMobileNav {
    display: none !important;
  }

  /* Kill Desktop Header */

  /* Show Bottom Nav */
  .mobile-bottom-nav {
    display: flex !important;
    justify-content: space-evenly;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 12px 16px 24px 16px;
    /* Extra padding bottom for safe area */
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08);
    z-index: 9999;
  }

  /* Reset Main Padding */
  .main {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 20px 20px 100px 20px !important;
    /* Bottom pad for nav */
  }

  /* 2. Mobile Components Styling */
  .mob-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
  }

  .mob-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .mob-brand h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 800;
  }

  .mob-brand span {
    font-size: 0.8rem;
    color: var(--muted);
  }

  .mob-hero-card {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
    padding: 24px;
    border-radius: 24px;
    color: #fff;
    text-align: center;
    box-shadow: 0 12px 24px rgba(0, 174, 239, 0.25);
    /* Cyan Shadow */
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
  }

  /* Decor circles */
  .mob-hero-card::before {
    content: "";
    position: absolute;
    top: -50px;
    left: -50px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
  }

  .mob-clock {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
  }

  .mob-date {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 12px;
  }

  .mob-greet {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
  }

  .mob-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }

  .mob-stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  }

  .mob-stat-card.red {
    border-bottom: 3px solid var(--danger);
  }

  .mob-stat-card.blue {
    border-bottom: 3px solid var(--primary-600);
  }

  .mob-stat-card.gray {
    border-bottom: 3px solid var(--muted);
  }

  /* Comp Grid Mobile */
  .company-grid-mobile {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mob-comp-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
  }

  .mob-comp-card:active {
    background: #e2e8f0;
  }

  .mob-comp-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
  }

  .mob-comp-countBadge {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    min-width: 24px;
    text-align: center;
  }

  .mob-comp-countBadge.blue {
    background: #dbeafe;
    color: #1e40af;
  }

  .mob-comp-countBadge.orange {
    background: #ffedd5;
    color: #9a3412;
  }

  .mob-comp-countBadge.green {
    background: #dcfce7;
    color: #166534;
  }

  .mob-comp-countBadge.purple {
    background: #f3e8ff;
    color: #6b21a8;
  }

  .mob-comp-countBadge.gray {
    background: #f1f5f9;
    color: #475569;
  }

  .mob-stat-card .label {
    font-size: 0.7rem;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .mob-stat-card .val {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    margin: 6px 0;
  }

  .mob-stat-card .unit {
    font-size: 0.65rem;
    color: #94a3b8;
  }

  .mob-gauge-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--line);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  }

  .mob-gauge-card h4 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    color: var(--text);
  }

  .gauge-wrap {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 12px solid var(--primary-100);
    margin: 0 auto 12px auto;
    display: grid;
    place-items: center;
    position: relative;
  }

  /* Simple CSS Gauge Simulation */
  .gauge-wrap::after {
    content: "";
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 12px solid transparent;
    border-top-color: var(--primary-600);
    border-right-color: var(--primary-600);
    transform: rotate(-45deg);
    /* Demo 75% filled */
  }

  /* Gauge Val */
  .gauge-val {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-700);
  }

  /* ============================================================================ 
     AREA 3: GENERAL REPORT OPTIMIZATION (MOBILE)
     Force charts to be smaller (180px) to reduce scrolling
     ========================================================================== */
  #route-general-report {
    padding-bottom: 80px;
    /* Space for bottom nav */
  }

  /* Compact Chart Containers */
  #route-general-report .card>div {
    height: 200px !important;
    /* Force override inline 300px */
    min-height: 0 !important;
  }

  /* Compact Cards */
  #route-general-report .card {
    margin-bottom: 12px;
    padding: 12px;
  }

  #route-general-report .card-title {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }

  /* Compact Top Stats (Cards Row) */
  #route-general-report .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    /* 2 cols instead of 1 stack */
    gap: 8px;
  }

  #route-general-report .card-solid {
    padding: 10px;
    margin-bottom: 0;
  }

  #route-general-report .card-solid .val {
    font-size: 1.2rem;
  }

  #route-general-report .card-solid .lbl {
    font-size: 0.7rem;
  }
}

/* 3. Mobile Table "Card View" Transformation */
@media (max-width: 768px) {

  /* Generic Table Reset for Card View */
  .emp-table,
  #route-inventory table,
  #route-latest table,
  #route-education table {
    display: block;
    width: 100%;
  }

  .emp-table thead,
  #route-inventory thead,
  #route-latest thead,
  #route-education thead {
    display: none;
    /* Hide headers */
  }

  .emp-table tbody,
  #route-inventory tbody,
  #route-latest tbody,
  #route-education tbody {
    display: block;
    width: 100%;
  }

  .emp-table tr,
  #route-inventory tr,
  #route-latest tr,
  #route-education tr {
    display: block;
    background: #fff;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
  }

  .emp-table td,
  #route-inventory td,
  #route-latest td,
  #route-education td {
    display: flex;
    justify-content: space-between;
    /* Label Left, Value Right */
    align-items: center;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
    text-align: right;
    /* Value align right */
  }

  .emp-table td:last-child,
  #route-inventory td:last-child {
    border-bottom: none;
    padding-top: 16px;
    justify-content: center;
    /* Actions centered */
  }

  /* Inject Label via data-label */
  .emp-table td::before,
  #route-inventory td::before,
  #route-latest td::before,
  #route-education td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    text-align: left;
    margin-right: 16px;
    font-size: 0.85rem;
  }

  /* Fix Image Alignment in Employee Card */
  .emp-table td[data-label="Foto"] {
    justify-content: center;
    border-bottom: none;
    padding-bottom: 4px;
    padding-top: 0;
  }

  .emp-table td[data-label="Foto"]::before {
    display: none;
    /* Hide label for photo */
  }

  /* Make Action Buttons Bigger on Mobile */
  .btn.small {
    padding: 8px 12px;
    font-size: 0.9rem;
    min-width: 40px;
    min-height: 40px;
  }

  /* Adjust Toolbar Layouts */
  .toolbar .left,
  .toolbar .right {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .toolbar input,
  .toolbar select,
  .toolbar button {
    width: 100% !important;
    margin-bottom: 8px;
  }

  /* SpecificTweaks */
  .emp-table td[data-label="Nama"] {
    font-weight: 700;
    color: var(--primary-700);
    font-size: 1.1rem;
    display: block;
    text-align: center;
  }

  .emp-table td[data-label="Nama"]::before {
    display: none;
  }

  /* 4. Mobile Dashboard Grid Adjustments */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  /* Adjust Card size for 2-column layout */
  .card-stat {
    padding: 16px !important;
    min-height: 140px;
  }

  .card-stat .val {
    font-size: 2rem !important;
  }

  .card-stat .lbl {
    font-size: 0.8rem !important;
  }

  .card-stat h3 {
    font-size: 0.9rem !important;
  }

  /* 5. Fix Scan Page Layout on Mobile */
  .scan-hero {
    flex-direction: column !important;
    gap: 16px;
  }

  .scan-hero-left,
  .scan-hero-right {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Fix Input Scan */
  .scan-input {
    font-size: 1.1rem !important;
    padding: 12px !important;
  }

  /* Scan Profile Card Mobile */
  .scan-profile-card {
    flex-direction: row;
    /* Keep row for photo + details */
    align-items: flex-start;
    padding: 16px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  }

  .scan-profile-card .photo-big {
    width: 80px;
    height: 80px;
    flex: 0 0 80px;
  }

  /* Fix Table in Scan Page */
  #route-scan .table-wrap {
    border: none;
    box-shadow: none;
  }
}

/* 6. Fix Logistik (Inventory) Toolbar on Mobile */
@media (max-width: 768px) {
  #route-inventory .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px !important;
  }

  /* Target the nested container with date inputs */
  #route-inventory .toolbar .left>div {
    flex-direction: column;
    align-items: stretch !important;
    border-left: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    gap: 12px !important;
    width: 100%;
    margin-top: 12px;
  }

  /* Make date inputs full width */
  #route-inventory input[type="date"] {
    width: 100% !important;
    box-sizing: border-box;
    /* Ensure padding doesn't overflow */
  }

  /* Fix small buttons in toolbar to be full width/bigger */
  #route-inventory .toolbar .btn.small {
    width: 100%;
    justify-content: center;
    padding: 10px;
  }

  /* Allow text wrap in Card View Values */
  #route-inventory td {
    white-space: normal !important;
    /* Allow wrapping */
  }

  #route-inventory td {
    align-items: flex-start !important;
    /* Align label/value to top if wrapped */
  }

  #route-inventory td::before {
    white-space: nowrap;
    /* Keep label single line */
    flex-shrink: 0;
    /* Prevent label from shrinking */
  }

  /* Specific fix for "Barang" value alignment */
  #route-inventory td[data-label="Jenis Barang & Jumlah"] {
    text-align: right;
    /* Keep right align but allow wrap */
    word-break: break-word;
  }

  /* 7. Fix Karyawan (Employees) Toolbar on Mobile */
  #route-employees .toolbar {
    flex-direction: column;
    gap: 12px;
  }

  /* Make button container a grid for neat alignment */
  #route-employees .toolbar .left {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 2 columns */
    gap: 8px;
    width: 100%;
  }

  /* "Tambah" button full width */
  #btnAddEmp {
    grid-column: 1 / -1;
    justify-content: center;
  }

  /* "Sync Cloud" button also full width for emphasis */
  #btnSyncEmp {
    grid-column: 1 / -1;
    justify-content: center;
  }

  #route-employees .toolbar .left .btn {
    justify-content: center;
    width: 100%;
    margin: 0;
  }

  /* Stack inputs on the right */
  #route-employees .toolbar .right {
    flex-direction: column;
    width: 100%;
    gap: 8px !important;
  }

  #route-employees .toolbar .right select,
  #route-employees .toolbar .right input {
    width: 100% !important;
    max-width: 100% !important;

    /* 8. Fix Add Employee Modal on Mobile */
    #empModal .grid-2 {
      grid-template-columns: 1fr !important;
      /* Force 1 column */
      gap: 16px;
    }

    /* Force Labels to stack vertically with Inputs */
    #empModal label {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 4px;
      width: 100%;
    }

    /* Full width inputs/selects */
    #empModal input,
    #empModal select {
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box;
      padding: 12px;
      /* Bigger touch target */
    }

    /* Camera Actions: 2 columns for buttons */
    #empModal .camera-actions {
      display: grid !important;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      width: 100%;
      margin-top: 8px;
    }

    #empModal .camera-actions button {
      width: 100%;
      justify-content: center;
    }

    #empModal .camera-actions small {
      grid-column: 1 / -1;
      /* Hint text spans full width */
      text-align: center;
    }

    /* Modal Actions (Save/Cancel) */
    #empModal .modal-actions {
      display: grid;
      /* Grid for 2 big buttons at bottom */
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-top: 20px;
    }

    #empModal .modal-actions button {
      width: 100%;
      justify-content: center;
      padding: 12px;
    }
  }
}

/* MOBILE DASHBOARD NEW */
.mob-stat-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.mob-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 4px;
  text-align: center;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mob-stat-card.stat-red {
  border-bottom: 3px solid var(--danger);
}

.mob-stat-card.stat-blue {
  border-bottom: 3px solid var(--primary);
}

.mob-stat-card.stat-gray {
  border-bottom: 3px solid #64748b;
}

.mob-stat-card .lbl-sm {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.mob-stat-card .val {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 2px;
  color: #0f172a;
}

.mob-stat-card .lbl-xs {
  font-size: 0.7rem;
  color: #94a3b8;
}

/* Gauge styles */
.gauge-simple {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0%, #e2e8f0 0%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge-simple::before {
  content: '';
  position: absolute;
  width: 110px;
  height: 110px;
  background: #fff;
  border-radius: 50%;
}

.gauge-val {
  position: relative;
  z-index: 2;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

/* MOBILE DASHBOARD GAUGE FIX */
.mob-stat-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.mob-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 4px;
  text-align: center;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ============================================================================ 
   AREA: DATA HOVER INTERACTIONS (Tooltip & Focus)
   ========================================================================== */
/* Generic Data Panel Hover Effect */
[data-hover-card] {
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: help;
}

[data-hover-card="interactive"] {
  cursor: pointer;
}

[data-hover-card]:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

/* Tooltip Implementation using ::after (and ::before for arrow) */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
  visibility: hidden;
}

/* The arrow */
[data-tooltip]::before {
  content: "";
  border: 6px solid transparent;
  border-top-color: #1e293b;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  margin-bottom: -12px;
}

/* The body */
[data-tooltip]::after {
  content: attr(data-tooltip);
  background: #1e293b;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: pre-wrap;
  /* Critical for newlines */
  width: max-content;
  max-width: 260px;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  margin-bottom: 8px;
  text-align: left;
  /* Critical for readability */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  line-height: 1.4;
}

/* Hover State */
[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}



/* ============================================================================ 
   AREA: MODALS (Generic & Company Detail)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: none;
  /* START HIDDEN */
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal-overlay.active {
  display: flex;
  /* Show flex on active */
}

.modal-card {
  background: #fff;
  width: 90%;
  max-width: 450px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
  padding: 0 4px;
}

.modal-body {
  padding: 0;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: center;
}

.btn-primary {
  background-color: var(--primary, #0f766e);
  color: white;
  border: none;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
}

/* Company Detail Modal List Styles */
.comp-detail-list {
  display: flex;
  flex-direction: column;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0 16px;
}

.comp-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.comp-detail-item:last-child {
  border-bottom: none;
}

.comp-detail-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.comp-detail-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.95rem;
}

.comp-detail-sub {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comp-detail-right {
  text-align: right;
  min-width: 60px;
}

.comp-detail-lbl {
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.comp-detail-time {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.9rem;
}

/* Scrollbar for modal list */
.comp-detail-list::-webkit-scrollbar {
  width: 6px;
}

.comp-detail-list::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.comp-detail-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}