/* ============================================================
   GENIUS HR APP — style.css
   Modern Glassmorphism · 3D Depth · High Contrast · Responsive
   ============================================================ */

/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ===== CSS RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== CSS VARIABLES ===== */
:root {
  /* Brand Colors */
  --primary:        #2563eb;
  --primary-dark:   #1d4ed8;
  --primary-deeper: #1e3a8a;
  --primary-light:  #eff6ff;
  --primary-mid:    #bfdbfe;
  --primary-glow:   rgba(37,99,235,.22);

  /* Semantic Colors */
  --success:        #16a34a;
  --success-light:  #f0fdf4;
  --success-mid:    #86efac;
  --success-glow:   rgba(22,163,74,.22);

  --danger:         #dc2626;
  --danger-light:   #fef2f2;
  --danger-mid:     #fca5a5;
  --danger-glow:    rgba(220,38,38,.22);

  --warning:        #d97706;
  --warning-dark:   #92400e;
  --warning-light:  #fffbeb;
  --warning-mid:    #fcd34d;
  --warning-glow:   rgba(217,119,6,.22);

  /* Neutrals */
  --gray-50:   #f8fafc;
  --gray-100:  #f1f5f9;
  --gray-200:  #e2e8f0;
  --gray-300:  #cbd5e1;
  --gray-400:  #94a3b8;
  --gray-500:  #64748b;
  --gray-600:  #475569;
  --gray-700:  #334155;
  --gray-800:  #1e293b;
  --gray-900:  #0f172a;

  --white: #ffffff;
  --text:  #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-focus: rgba(37,99,235,.4);

  /* Layout */
  --sidebar-w:    260px;
  --topbar-h:     58px;
  --bottom-nav-h: 64px;

  /* Border Radius */
  --r-xs:  4px;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 28px;
  --r-full: 999px;

  /* Shadows — 3D Layered */
  --shadow-xs:    0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:    0 1px 4px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 14px rgba(0,0,0,.09), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:    0 10px 32px rgba(0,0,0,.11), 0 4px 10px rgba(0,0,0,.06);
  --shadow-xl:    0 20px 48px rgba(0,0,0,.13), 0 8px 16px rgba(0,0,0,.07);
  --shadow-card:  0 2px 10px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04),
                  inset 0 1px 0 rgba(255,255,255,.95);
  --shadow-btn:   0 2px 8px rgba(37,99,235,.28), 0 1px 2px rgba(0,0,0,.09),
                  inset 0 1px 0 rgba(255,255,255,.22);
  --shadow-hover: 0 8px 28px rgba(0,0,0,.11), 0 3px 8px rgba(0,0,0,.06),
                  inset 0 1px 0 rgba(255,255,255,.95);

  /* 3D Inset Highlight */
  --inset-light: inset 0 1px 0 rgba(255,255,255,.22);
  --inset-white: inset 0 1px 0 rgba(255,255,255,.9);
}

/* ===== BASE ===== */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: #eef2f9;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(37,99,235,.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(8,145,178,.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--primary); text-decoration: none; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* =============================================
   LOGIN PAGE
   ============================================= */
#loginPage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 100% 80% at 20% -10%, #1e40af 0%, transparent 55%),
    radial-gradient(ellipse 80% 70% at 80% 110%, #0891b2 0%, transparent 55%),
    linear-gradient(160deg, #0f172a 0%, #1e3a8a 50%, #0c4a6e 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* Animated mesh circles */
#loginPage::before,
#loginPage::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: floatBubble 12s ease-in-out infinite;
}
#loginPage::before {
  width: 700px; height: 700px;
  top: -280px; right: -180px;
  background: radial-gradient(circle, rgba(96,165,250,.12) 0%, transparent 70%);
  animation-delay: 0s;
}
#loginPage::after {
  width: 500px; height: 500px;
  bottom: -200px; left: -120px;
  background: radial-gradient(circle, rgba(34,211,238,.10) 0%, transparent 70%);
  animation-delay: -6s;
}

@keyframes floatBubble {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(12px, -20px) scale(1.03); }
  66%       { transform: translate(-8px, 10px) scale(0.97); }
}

.login-box {
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--r-2xl);
  padding: 44px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow:
    0 32px 80px rgba(0,0,0,.28),
    0 12px 32px rgba(0,0,0,.16),
    inset 0 1px 0 rgba(255,255,255,1),
    inset 0 -1px 0 rgba(0,0,0,.04);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255,255,255,.6);
}

/* Glass rim effect */
.login-box::before {
  content: '';
  position: absolute;
  top: 0; left: 16px; right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent);
  border-radius: var(--r-full);
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-icon {
  font-size: 3.2rem;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(37,99,235,.3));
}

.login-logo h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--primary-dark), #0891b2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-logo p {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 5px;
  font-weight: 500;
  letter-spacing: .4px;
}

.login-field { margin-bottom: 16px; }

.login-field label {
  display: block;
  font-size: .7rem;
  font-weight: 800;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-bottom: 7px;
}

.login-field input {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: .92rem;
  color: var(--text);
  background: var(--gray-50);
  outline: none;
  font-family: inherit;
  font-weight: 500;
  transition: border-color .2s, box-shadow .2s, background .2s;
  box-shadow: var(--shadow-xs), inset 0 1px 3px rgba(0,0,0,.04);
}

.login-field input:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow-xs);
}

.login-field input::placeholder { color: var(--gray-400); }

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(180deg, #4f8ef7 0%, var(--primary) 40%, var(--primary-dark) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--r-md);
  font-size: .95rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  letter-spacing: .4px;
  transition: transform .15s, box-shadow .22s;
  box-shadow: var(--shadow-btn), 0 6px 18px var(--primary-glow);
  position: relative;
  overflow: hidden;
}
.btn-login::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,99,235,.38), 0 10px 28px var(--primary-glow), var(--inset-light);
}
.btn-login:active { transform: scale(.98) translateY(0); }

#btnSignup {
  background: linear-gradient(180deg, #34d399 0%, #16a34a 50%, #15803d 100%) !important;
  box-shadow: 0 4px 14px var(--success-glow), 0 2px 6px rgba(0,0,0,.1), var(--inset-light) !important;
  margin-top: 10px !important;
}
#btnSignup:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(22,163,74,.38), var(--inset-light) !important;
}

/* =============================================
   APP SHELL
   ============================================= */
#appPage { display: none; min-height: 100vh; position: relative; z-index: 1; }

/* ===== TOPBAR ===== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: linear-gradient(180deg, #3472f5 0%, var(--primary) 50%, var(--primary-dark) 100%);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 100;
  box-shadow:
    0 2px 10px rgba(29,78,216,.35),
    0 4px 20px rgba(29,78,216,.18),
    inset 0 1px 0 rgba(255,255,255,.15),
    inset 0 -1px 0 rgba(0,0,0,.12);
}

.topbar-left  { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.topbar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--white);
  text-shadow: 0 1px 4px rgba(0,0,0,.2);
}

#userName {
  font-size: .82rem;
  font-weight: 700;
  color: rgba(255,255,255,.95);
  letter-spacing: .2px;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255,255,255,.12);
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid rgba(255,255,255,.18);
}

.btn-menu,
.btn-logout-top {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  color: var(--white);
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background .2s, transform .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-menu:hover,
.btn-logout-top:hover {
  background: rgba(255,255,255,.28);
  transform: translateY(-1px);
}

/* ===== OVERLAY ===== */
#overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 150;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
#overlay.active { display: block; }

/* ===== SIDEBAR ===== */
#sidebar {
  position: fixed;
  top: 0; left: -300px;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--white);
  z-index: 200;
  overflow-y: auto;
  transition: left .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 6px 0 40px rgba(0,0,0,.14), 1px 0 0 var(--border);
  display: flex;
  flex-direction: column;
}
#sidebar.open { left: 0; }

.sidebar-header {
  background: linear-gradient(160deg, #0f172a 0%, var(--primary-deeper) 50%, #0e7490 100%);
  color: var(--white);
  padding: calc(var(--topbar-h) + 16px) 18px 20px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.08);
}
.sidebar-header::after {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  top: -80px; right: -60px;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.sidebar-header .sb-name {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: .3px;
}
.sidebar-header .sb-role {
  font-size: .68rem;
  color: rgba(255,255,255,.65);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .9px;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 10px 28px;
  overflow-y: auto;
}

.sidebar-nav .nav-section {
  font-size: .63rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--gray-400);
  padding: 18px 10px 6px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  color: var(--gray-600);
  border-radius: var(--r-md);
  font-size: .86rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .18s cubic-bezier(.4,0,.2,1);
  border: 1px solid transparent;
  margin-bottom: 2px;
  position: relative;
}

.sidebar-nav a i {
  width: 20px;
  font-size: .92rem;
  color: var(--gray-400);
  flex-shrink: 0;
  transition: color .18s;
  text-align: center;
}

.sidebar-nav a:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary-mid);
  transform: translateX(3px);
}
.sidebar-nav a:hover i { color: var(--primary); }

.sidebar-nav a.active {
  background: linear-gradient(135deg, var(--primary-light), #dbeafe);
  color: var(--primary-dark);
  border-color: var(--primary-mid);
  font-weight: 800;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.9);
}
.sidebar-nav a.active i { color: var(--primary); }
.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 var(--r-full) var(--r-full) 0;
  box-shadow: 0 0 8px var(--primary-glow);
}

/* ===== CONTENT ===== */
#content {
  margin-top: var(--topbar-h);
  padding: 20px 16px;
  padding-bottom: calc(var(--bottom-nav-h) + 20px);
  min-height: calc(100vh - var(--topbar-h));
  position: relative;
  z-index: 1;
}

/* ===== BOTTOM NAV ===== */
#bottomNav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(226,232,240,.8);
  display: flex;
  z-index: 100;
  box-shadow: 0 -6px 24px rgba(0,0,0,.08), 0 -1px 0 var(--border);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: var(--gray-400);
  font-size: .58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  border: none;
  background: none;
  transition: color .2s, transform .15s;
  padding: 8px 0;
  font-family: inherit;
}
.bottom-nav-item i { font-size: 1.22rem; transition: transform .2s; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active i {
  transform: translateY(-2px);
  filter: drop-shadow(0 2px 6px var(--primary-glow));
}
.bottom-nav-item:hover:not(.active) { color: var(--gray-600); }

/* =============================================
   CARD — base component
   ============================================= */
.card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(226,232,240,.8);
  transition: transform .22s cubic-bezier(.4,0,.2,1), box-shadow .22s;
  position: relative;
  overflow: hidden;
}

/* Top glass rim */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 14px; right: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,1), transparent);
  pointer-events: none;
  z-index: 1;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.card-title {
  font-size: .82rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.card-title i {
  color: var(--primary);
  font-size: .95rem;
  width: 30px; height: 30px;
  background: var(--primary-light);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* =============================================
   DASHBOARD STATS
   ============================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(226,232,240,.8);
  position: relative;
  overflow: hidden;
  transition: transform .22s, box-shadow .22s;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 12px; right: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.9), transparent);
}

/* Color accent top border */
.stat-card.blue   { border-top: 3px solid var(--primary); }
.stat-card.green  { border-top: 3px solid var(--success); }
.stat-card.yellow { border-top: 3px solid var(--warning); }
.stat-card.red    { border-top: 3px solid var(--danger);  }

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.stat-card.blue   .stat-icon { background: var(--primary-light);  color: var(--primary);  box-shadow: 0 3px 10px var(--primary-glow); }
.stat-card.green  .stat-icon { background: var(--success-light);  color: var(--success);  box-shadow: 0 3px 10px var(--success-glow); }
.stat-card.yellow .stat-icon { background: var(--warning-light);  color: var(--warning);  box-shadow: 0 3px 10px var(--warning-glow); }
.stat-card.red    .stat-icon { background: var(--danger-light);   color: var(--danger);   box-shadow: 0 3px 10px var(--danger-glow);  }

.stat-card .stat-label {
  font-size: .65rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 5px;
}

.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1;
}

.stat-card.blue   .stat-value { color: var(--primary); }
.stat-card.green  .stat-value { color: var(--success); }
.stat-card.yellow .stat-value { color: var(--warning); }
.stat-card.red    .stat-value { color: var(--danger);  }

.stat-card .stat-sub {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* =============================================
   LIVE CLOCK CARD
   ============================================= */
.live-clock-card {
  background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 55%, #0c4a6e 100%);
  color: var(--white);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  text-align: center;
  box-shadow:
    0 8px 32px rgba(15,23,42,.3),
    0 2px 8px rgba(0,0,0,.15),
    inset 0 1px 0 rgba(255,255,255,.12);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}
.live-clock-card::before {
  content: '';
  position: absolute;
  width: 250px; height: 250px;
  top: -100px; right: -80px;
  background: radial-gradient(circle, rgba(96,165,250,.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.live-clock-card::after {
  content: '';
  position: absolute;
  width: 150px; height: 150px;
  bottom: -60px; left: -40px;
  background: radial-gradient(circle, rgba(34,211,238,.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.live-clock {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 48px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: 3px;
  text-shadow: 0 2px 16px rgba(96,165,250,.4);
  position: relative;
  z-index: 1;
}

.live-date {
  margin-top: 8px;
  color: rgba(255,255,255,.7);
  font-size: .85rem;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* =============================================
   SHIFT INFO BOX
   ============================================= */
.shift-info-box {
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, #0891b2 100%);
  color: var(--white);
  box-shadow:
    0 8px 24px var(--primary-glow),
    0 2px 8px rgba(0,0,0,.12),
    inset 0 1px 0 rgba(255,255,255,.2);
  position: relative;
  overflow: hidden;
}

.shift-info-box::before {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  top: -80px; right: -60px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
  pointer-events: none;
}
.shift-info-box::after {
  content: '';
  position: absolute;
  width: 120px; height: 120px;
  bottom: -50px; right: 80px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
  pointer-events: none;
}

.shift-info-box .sib-label {
  font-size: .68rem;
  color: rgba(255,255,255,.72);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  margin-bottom: 6px;
}
.shift-info-box .sib-name  {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--white);
}
.shift-info-box .sib-time  {
  font-size: .84rem;
  color: rgba(255,255,255,.8);
  margin-top: 6px;
  font-weight: 500;
}

/* =============================================
   ABSEN BUTTONS
   ============================================= */
.absen-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.btn-absen {
  padding: 24px 14px;
  border: none;
  border-radius: var(--r-lg);
  cursor: pointer;
  font-size: .84rem;
  font-weight: 900;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform .18s cubic-bezier(.4,0,.2,1), box-shadow .22s;
  letter-spacing: .4px;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
}

/* Rim highlight */
.btn-absen::after {
  content: '';
  position: absolute;
  top: 0; left: 18%; right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  pointer-events: none;
}

.btn-absen i { font-size: 1.9rem; }
.btn-absen span { font-size: .7rem; letter-spacing: .8px; }

.btn-absen.masuk {
  background: linear-gradient(180deg, #4f8ef7 0%, var(--primary) 45%, var(--primary-dark) 100%);
  color: var(--white);
  box-shadow:
    0 8px 24px var(--primary-glow),
    0 2px 6px rgba(0,0,0,.14),
    inset 0 1px 0 rgba(255,255,255,.22);
}
.btn-absen.masuk:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px var(--primary-glow), 0 4px 10px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.22);
}
.btn-absen.masuk:active { transform: translateY(1px); }

.btn-absen.masuk.done {
  background: linear-gradient(180deg, #34d399 0%, #16a34a 50%, #15803d 100%);
  box-shadow: 0 8px 24px var(--success-glow), 0 2px 6px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.22);
}

.btn-absen.pulang {
  background: var(--white);
  color: var(--primary-dark);
  border: 2px solid var(--primary-mid) !important;
  box-shadow: var(--shadow-card), 0 2px 8px var(--primary-glow);
}
.btn-absen.pulang .fa-sign-out-alt,
.btn-absen.pulang i { color: var(--primary); }
.btn-absen.pulang:hover:not(:disabled) {
  background: var(--primary-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover), 0 6px 16px var(--primary-glow);
}
.btn-absen.pulang.done {
  color: var(--success);
  border-color: var(--success-mid) !important;
  background: var(--success-light);
}
.btn-absen.pulang.done i { color: var(--success); }
.btn-absen:disabled { opacity: .42; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* =============================================
   KPI GRID
   ============================================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-card {
  padding: 20px 18px;
  border-radius: var(--r-lg);
  color: var(--white);
  position: relative;
  overflow: hidden;
  transition: transform .22s, box-shadow .22s;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 14px; right: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
}
.kpi-card::after {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
  pointer-events: none;
}

.kpi-card:hover { transform: translateY(-4px); }

.kpi-card h4, .kpi-card p {
  font-size: .68rem;
  color: rgba(255,255,255,.82);
  text-transform: uppercase;
  letter-spacing: .7px;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.kpi-card h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  color: var(--white);
  margin: 0 0 4px;
  position: relative;
  z-index: 1;
}
.kpi-card h3 { font-size: .86rem; color: rgba(255,255,255,.85); font-weight: 700; z-index:1; position:relative; }
.kpi-card small { font-size: .72rem; color: rgba(255,255,255,.7); z-index:1; position:relative; }

.kpi-card.blue   { background: linear-gradient(145deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%); box-shadow: 0 8px 24px rgba(37,99,235,.32), var(--inset-light); }
.kpi-card.green  { background: linear-gradient(145deg, #22c55e 0%, #16a34a 50%, #15803d 100%); box-shadow: 0 8px 24px rgba(22,163,74,.32), var(--inset-light); }
.kpi-card.orange { background: linear-gradient(145deg, #f59e0b 0%, #d97706 50%, #b45309 100%); box-shadow: 0 8px 24px rgba(217,119,6,.32), var(--inset-light); }
.kpi-card.red    { background: linear-gradient(145deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%); box-shadow: 0 8px 24px rgba(220,38,38,.32), var(--inset-light); }

/* =============================================
   BADGES
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .2px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-green  { background: var(--success-light); color: #14532d;  border-color: var(--success-mid); }
.badge-red    { background: var(--danger-light);  color: #7f1d1d;  border-color: var(--danger-mid);  }
.badge-yellow { background: var(--warning-light); color: var(--warning-dark); border-color: var(--warning-mid); }
.badge-blue   { background: var(--primary-light); color: #1e3a8a;  border-color: var(--primary-mid); }
.badge-gray   { background: var(--gray-100);      color: var(--gray-700); border-color: var(--gray-300); }

/* =============================================
   BUTTONS
   ============================================= */
button { font-family: inherit; }

.btn-primary {
  background: linear-gradient(180deg, #4f8ef7 0%, var(--primary) 45%, var(--primary-dark) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--r-md);
  padding: 11px 20px;
  font-size: .84rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .15s, box-shadow .2s;
  white-space: nowrap;
  box-shadow: var(--shadow-btn);
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px var(--primary-glow), 0 2px 6px rgba(0,0,0,.12), var(--inset-light);
}
.btn-primary:active { transform: scale(.97); }

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 18px;
  font-size: .84rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .2s;
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1.5px solid var(--danger-mid);
  border-radius: var(--r-md);
  padding: 8px 14px;
  font-size: .8rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
  box-shadow: var(--shadow-xs);
}
.btn-danger:hover {
  background: var(--danger);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--danger-glow);
}

.btn-sm { padding: 6px 12px; font-size: .75rem; }

button:active { transform: scale(.97); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* =============================================
   FORM FIELDS
   ============================================= */
.field { margin-bottom: 16px; }

.field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  font-weight: 800;
  color: var(--gray-600);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.field label .req { color: var(--danger); font-size: .88rem; line-height: 1; }
.field label i { color: var(--primary); font-size: .8rem; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--r-md);
  font-size: .9rem;
  color: var(--text);
  background: var(--gray-50);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  font-family: inherit;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), inset 0 1px 3px rgba(0,0,0,.04);
  appearance: none;
  -webkit-appearance: none;
}

.field input::placeholder, .field textarea::placeholder { color: var(--gray-400); font-weight: 400; }

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 38px;
  cursor: pointer;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px var(--primary-glow), 0 1px 4px rgba(0,0,0,.06);
}

.field input:hover:not(:focus):not(:disabled),
.field select:hover:not(:focus):not(:disabled),
.field textarea:hover:not(:focus):not(:disabled) {
  border-color: var(--gray-300);
  background: var(--white);
}

.field input:disabled, .field select:disabled, .field textarea:disabled {
  opacity: .55; cursor: not-allowed; background: var(--gray-100);
}

.field textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.field input[type="date"], .field input[type="time"], .field input[type="datetime-local"] {
  color: var(--text); cursor: pointer;
}

/* Input group with icon */
.input-group { position: relative; }
.input-group > i {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400); font-size: .88rem;
  pointer-events: none; z-index: 1;
}
.input-group input, .input-group select { padding-left: 40px !important; }

/* Field messages */
.field-msg { font-size: .72rem; margin-top: 5px; display: flex; align-items: center; gap: 4px; font-weight: 600; }
.field-msg.error { color: var(--danger); }
.field-msg.hint  { color: var(--text-muted); }
.field-msg.ok    { color: var(--success); }

/* Validation states */
.field.is-valid input, .field.is-valid select, .field.is-valid textarea {
  border-color: var(--success); background: var(--success-light);
}
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea {
  border-color: var(--danger); background: var(--danger-light);
}

/* Form layout helpers */
.form-section {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-card);
}

.form-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.field.full { grid-column: 1 / -1; }

.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 16px; margin-top: 4px;
  border-top: 1px solid var(--gray-100); flex-wrap: wrap;
}
.form-actions .btn-primary, .form-actions .btn-secondary { min-width: 110px; justify-content: center; }

/* =============================================
   TABLE
   ============================================= */
.tbl-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-200);
  background: var(--white);
}

table { width: 100%; border-collapse: collapse; font-size: .83rem; min-width: 480px; background: var(--white); }

thead { position: sticky; top: 0; z-index: 2; }

thead th {
  background: linear-gradient(180deg, var(--gray-50) 0%, var(--gray-100) 100%);
  padding: 13px 15px;
  text-align: left;
  font-weight: 800;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--gray-600);
  white-space: nowrap;
  border-bottom: 2px solid var(--gray-200);
}

thead th:first-child { border-radius: var(--r-lg) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--r-lg) 0 0; }

tbody td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text);
  vertical-align: middle;
  font-weight: 500;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: var(--gray-50); }
tbody tr:hover td { background: var(--primary-light) !important; }

/* Table action buttons */
.tbl-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: var(--r-sm);
  font-size: .73rem; font-weight: 800;
  border: 1px solid transparent; cursor: pointer;
  font-family: inherit; transition: all .15s; white-space: nowrap;
}
.tbl-btn + .tbl-btn { margin-left: 4px; }
.tbl-btn.edit  { background: var(--primary-light); color: var(--primary-dark);  border-color: var(--primary-mid); }
.tbl-btn.edit:hover  { background: var(--primary); color: var(--white); box-shadow: 0 4px 12px var(--primary-glow); }
.tbl-btn.del   { background: var(--danger-light);  color: var(--danger);        border-color: var(--danger-mid);  }
.tbl-btn.del:hover   { background: var(--danger);  color: var(--white); box-shadow: 0 4px 12px var(--danger-glow); }
.tbl-btn.view  { background: var(--success-light); color: var(--success);       border-color: var(--success-mid); }
.tbl-btn.view:hover  { background: var(--success); color: var(--white); box-shadow: 0 4px 12px var(--success-glow); }
.tbl-btn.warn  { background: var(--warning-light); color: var(--warning-dark);  border-color: var(--warning-mid); }
.tbl-btn.warn:hover  { background: var(--warning); color: var(--white); box-shadow: 0 4px 12px var(--warning-glow); }

td.td-action, th.td-action { text-align: right; white-space: nowrap; }
td.td-num, th.td-num { width: 42px; text-align: center; color: var(--text-muted); font-size: .78rem; }

/* Jadwal table */
.jadwal-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-lg); border: 1px solid var(--gray-200); box-shadow: var(--shadow-card); }
.jadwal-table { min-width: 600px; }
.jadwal-table thead th {
  background: linear-gradient(135deg, var(--primary) 0%, #0891b2 100%);
  color: var(--white); letter-spacing: .5px; border-bottom: none;
}

.jadwal-cell {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--r-sm);
  font-size: .74rem; font-weight: 800; white-space: nowrap; border: 1px solid transparent;
}
.jadwal-cell.pagi   { background: var(--primary-light); color: #1e40af; border-color: var(--primary-mid); }
.jadwal-cell.siang  { background: var(--warning-light); color: var(--warning-dark); border-color: var(--warning-mid); }
.jadwal-cell.malam  { background: #f5f3ff; color: #4c1d95; border-color: #ddd6fe; }
.jadwal-cell.libur  { background: var(--danger-light);  color: #7f1d1d; border-color: var(--danger-mid); }
.jadwal-cell.off    { background: var(--gray-100); color: var(--gray-600); border-color: var(--gray-200); }

/* =============================================
   MODAL
   ============================================= */
.modal-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 300;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-bg.open { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp .28s cubic-bezier(.4,0,.2,1);
  box-shadow:
    0 -12px 40px rgba(0,0,0,.14),
    0 -2px 8px rgba(0,0,0,.08),
    inset 0 1px 0 rgba(255,255,255,.95);
  border-top: 1px solid var(--border);
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 {
  font-size: .98rem; font-weight: 800;
  display: flex; align-items: center; gap: 10px; color: var(--text);
}
.modal-close {
  background: var(--gray-100); border: 1px solid var(--border);
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: var(--gray-500); transition: all .2s;
  box-shadow: var(--shadow-xs);
}
.modal-close:hover { background: var(--gray-200); color: var(--text); }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

/* =============================================
   USER ITEMS
   ============================================= */
.user-avatar {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: var(--white);
  font-weight: 900; font-size: .84rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px var(--primary-glow);
}

.user-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  margin-bottom: 9px;
  box-shadow: var(--shadow-card);
  transition: all .2s;
}
.user-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--primary-mid); }
.user-item .ui-info  { flex: 1; min-width: 0; }
.user-item .ui-name  { font-weight: 800; font-size: .92rem; color: var(--text); }
.user-item .ui-email { font-size: .74rem; color: var(--text-muted) !important; margin-top: 2px; font-weight: 500; }
.user-item .ui-actions { display: flex; gap: 7px; flex-shrink: 0; }

.action-btn {
  background: var(--gray-100); border: 1px solid var(--border);
  padding: 7px 10px; border-radius: var(--r-sm);
  cursor: pointer; font-size: .78rem; color: var(--gray-600);
  transition: all .15s; box-shadow: var(--shadow-xs);
  font-family: inherit;
}
.action-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary-mid); }
.action-btn.delete:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger-mid); }

/* =============================================
   SHIFT CARD
   ============================================= */
.shift-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  padding: 15px 18px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
  transition: all .22s;
}
.shift-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--primary-mid); }

.shift-card .sc-icon {
  width: 46px; height: 46px;
  border-radius: var(--r-md);
  background: var(--primary-light); color: var(--primary);
  font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 3px 10px var(--primary-glow);
}
.shift-card .sc-info { flex: 1; min-width: 0; }
.shift-card .sc-name { font-weight: 800; font-size: .92rem; color: var(--text); }
.shift-card .sc-time { font-size: .76rem; color: var(--text-muted) !important; margin-top: 3px; font-weight: 500; }
.shift-card .sc-actions { display: flex; gap: 7px; }

/* =============================================
   PENGAJUAN CARDS
   ============================================= */
.pengajuan-card {
  background: var(--white);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  padding: 16px 18px;
  margin-bottom: 11px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--gray-300);
  transition: all .2s;
}
.pengajuan-card:hover { transform: translateX(3px); box-shadow: var(--shadow-hover); }
.pengajuan-card.pending  { border-left-color: var(--warning); }
.pengajuan-card.approved { border-left-color: var(--success); }
.pengajuan-card.rejected { border-left-color: var(--danger);  }

.pengajuan-card .pq-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 7px; }
.pengajuan-card .pq-name   { font-weight: 800; font-size: .92rem; color: var(--text); }
.pengajuan-card .pq-type   { font-size: .78rem; color: var(--text-muted); margin-bottom: 5px; font-weight: 500; }
.pengajuan-card .pq-ket    { font-size: .84rem; color: var(--text); font-weight: 500; }
.pengajuan-card .pq-date   { font-size: .72rem; color: var(--text-muted); margin-top: 7px; }
.pengajuan-card .pq-actions { display: flex; gap: 7px; margin-top: 12px; }

/* =============================================
   ABSEN RECORD
   ============================================= */
.absen-record {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 11px;
  box-shadow: var(--shadow-card);
  transition: all .2s;
}
.absen-record:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.absen-record .ar-top  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.absen-record .ar-date { font-weight: 800; font-size: .92rem; color: var(--text); }
.absen-record .ar-times { display: flex; gap: 20px; font-size: .8rem; color: var(--text-muted); font-weight: 500; }
.absen-record .ar-time-item i { margin-right: 5px; color: var(--primary); }

/* =============================================
   PROFILE CARD
   ============================================= */
.profile-card {
  background: linear-gradient(145deg, #0f172a 0%, var(--primary-deeper) 45%, #0e7490 100%);
  color: var(--white);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: 0 10px 36px rgba(15,23,42,.3), 0 3px 10px rgba(0,0,0,.12), var(--inset-light);
  position: relative; overflow: hidden;
}
.profile-card::after {
  content: '';
  position: absolute; top: -70px; right: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,.07) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}

.profile-avatar {
  width: 76px; height: 76px;
  border-radius: var(--r-xl);
  background: rgba(255,255,255,.18);
  margin: 0 auto 14px;
  font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: var(--white);
  box-shadow: 0 6px 20px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.3);
  border: 2px solid rgba(255,255,255,.28);
  backdrop-filter: blur(8px);
}
.profile-name { font-size: 1.25rem; font-weight: 900; color: var(--white); }
.profile-role { font-size: .7rem; color: rgba(255,255,255,.68); margin-top: 6px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }

/* =============================================
   PAGE HEADER
   ============================================= */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.page-header h2 { font-size: 1.1rem; font-weight: 900; color: var(--text); }

/* =============================================
   CAMERA
   ============================================= */
#camera-container {
  width: 100%; border-radius: var(--r-md); overflow: hidden;
  background: #000; margin-bottom: 14px;
  border: 2px solid var(--border); box-shadow: var(--shadow-md);
}
#camera-video { width: 100%; display: block; max-height: 280px; object-fit: cover; }

/* =============================================
   LOADING OVERLAY
   ============================================= */
#loading-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 500;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#loading-overlay.active { display: flex; }

.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  box-shadow: 0 0 24px var(--primary-glow);
}
.loading-text { color: var(--white); font-weight: 700; font-size: .9rem; letter-spacing: .3px; }

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

/* =============================================
   TOAST
   ============================================= */
#toast-container {
  position: fixed; top: calc(var(--topbar-h) + 12px); right: 16px;
  z-index: 600; display: flex; flex-direction: column; gap: 9px; pointer-events: none;
}

.toast {
  background: var(--gray-900); color: var(--white);
  padding: 13px 18px; border-radius: var(--r-lg);
  font-size: .84rem; font-weight: 700; max-width: 310px;
  box-shadow: var(--shadow-xl);
  animation: toastIn .24s cubic-bezier(.4,0,.2,1);
  display: flex; align-items: center; gap: 10px;
  pointer-events: auto;
  border: 1px solid rgba(255,255,255,.07);
}
.toast.success { background: linear-gradient(135deg, #16a34a, #15803d); box-shadow: 0 10px 28px var(--success-glow); }
.toast.error   { background: linear-gradient(135deg, #dc2626, #b91c1c); box-shadow: 0 10px 28px var(--danger-glow);  }
.toast.info    { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 10px 28px var(--primary-glow); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* =============================================
   SEARCH BOX
   ============================================= */
.search-box { position: relative; margin-bottom: 16px; }
.search-box input {
  width: 100%; padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  font-size: .88rem; outline: none;
  background: var(--white); color: var(--text);
  transition: border-color .2s, box-shadow .2s; font-family: inherit;
  box-shadow: var(--shadow-xs); font-weight: 500;
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); }
.search-box input::placeholder { color: var(--gray-400); font-weight: 400; }
.search-box i {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--gray-400); font-size: .92rem; pointer-events: none;
}

/* =============================================
   FILTER ROW
   ============================================= */
.filter-row, .jadwal-filters {
  display: flex; gap: 9px; margin-bottom: 16px; flex-wrap: wrap;
}
.filter-row input, .filter-row select,
.jadwal-filters input, .jadwal-filters select {
  padding: 10px 13px; border: 1.5px solid var(--border);
  border-radius: var(--r-md); font-size: .84rem; outline: none;
  background: var(--white); color: var(--text);
  flex: 1; min-width: 120px; font-family: inherit; font-weight: 500;
  transition: border-color .2s, box-shadow .2s; box-shadow: var(--shadow-xs);
}
.filter-row input:focus, .filter-row select:focus,
.jadwal-filters input:focus, .jadwal-filters select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow);
}

/* =============================================
   STATUS DOTS
   ============================================= */
.status-bar { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; }
.status-item { display: flex; align-items: center; gap: 8px; font-size: .83rem; color: var(--text-muted); font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot.green  { background: var(--success); box-shadow: 0 0 8px var(--success-glow); }
.dot.orange { background: var(--warning); box-shadow: 0 0 8px var(--warning-glow); }
.dot.red    { background: var(--danger);  box-shadow: 0 0 8px var(--danger-glow);  }
.dot.blue   { background: var(--primary); box-shadow: 0 0 8px var(--primary-glow); }

/* =============================================
   ALERTS
   ============================================= */
.alert {
  padding: 13px 16px; border-radius: var(--r-md);
  font-size: .84rem; font-weight: 600;
  display: flex; align-items: flex-start; gap: 11px;
  border: 1px solid transparent; margin-bottom: 16px;
}
.alert i { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.alert.info    { background: var(--primary-light); color: #1e3a8a;  border-color: var(--primary-mid); }
.alert.success { background: var(--success-light); color: #14532d;  border-color: var(--success-mid); }
.alert.warning { background: var(--warning-light); color: var(--warning-dark); border-color: var(--warning-mid); }
.alert.danger  { background: var(--danger-light);  color: #7f1d1d;  border-color: var(--danger-mid);  }

/* =============================================
   SECTION TITLE
   ============================================= */
.section-title {
  font-size: .74rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 1.1px;
  color: var(--text-muted); margin: 20px 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* =============================================
   INFO ROW
   ============================================= */
.info-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--gray-100); font-size: .87rem;
}
.info-row:last-child { border-bottom: none; }
.info-row .ir-label { width: 128px; flex-shrink: 0; color: var(--text-muted); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; }
.info-row .ir-val { color: var(--text); font-weight: 600; flex: 1; }

/* =============================================
   DIVIDER
   ============================================= */
.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* =============================================
   POPUP
   ============================================= */
.popup-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.52);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.popup-box {
  background: var(--white); width: 92%; max-width: 520px;
  border-radius: var(--r-xl); padding: 22px;
  max-height: 85vh; overflow: auto;
  box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255,255,255,.9);
  border: 1px solid rgba(226,232,240,.8);
}
.popup-box table { width: 100%; border-collapse: collapse; }
.popup-box th, .popup-box td { padding: 11px; border-bottom: 1px solid var(--gray-100); text-align: left; }
.popup-box th { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--gray-500); }
.popup-box td { font-size: .85rem; color: var(--text); font-weight: 500; }

/* =============================================
   PAGINATION
   ============================================= */
.pagination { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 18px; }
.page-btn {
  width: 36px; height: 36px; border-radius: var(--r-md);
  border: 1.5px solid var(--border); background: var(--white);
  color: var(--text-muted); font-size: .83rem; font-weight: 800;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s; box-shadow: var(--shadow-xs); font-family: inherit;
}
.page-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary-mid); }
.page-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); box-shadow: 0 4px 14px var(--primary-glow); }

/* =============================================
   PROGRESS BAR
   ============================================= */
.progress-bar { width: 100%; height: 8px; background: var(--gray-200); border-radius: var(--r-full); overflow: hidden; margin-top: 8px; }
.progress-fill {
  height: 100%; border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--primary), #06b6d4);
  transition: width .6s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 10px var(--primary-glow);
}
.progress-fill.green  { background: linear-gradient(90deg, var(--success), #34d399); box-shadow: 0 0 10px var(--success-glow); }
.progress-fill.red    { background: linear-gradient(90deg, var(--danger), #f87171);  box-shadow: 0 0 10px var(--danger-glow);  }
.progress-fill.yellow { background: linear-gradient(90deg, var(--warning), #fbbf24); box-shadow: 0 0 10px var(--warning-glow); }

/* =============================================
   SKELETON LOADER
   ============================================= */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-line  { height: 12px; margin-bottom: 9px; }
.sk-title { height: 18px; width: 55%; margin-bottom: 14px; }
.sk-box   { height: 84px; border-radius: var(--r-lg); margin-bottom: 14px; }

/* =============================================
   FAB — Floating Action Button
   ============================================= */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 18px); right: 20px;
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(145deg, #4f8ef7, var(--primary-dark));
  color: var(--white); border: none; cursor: pointer;
  font-size: 1.35rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px var(--primary-glow), 0 2px 8px rgba(0,0,0,.18), var(--inset-light);
  transition: transform .22s, box-shadow .22s; z-index: 90;
  font-family: inherit;
}
.fab:hover {
  transform: translateY(-4px) scale(1.07);
  box-shadow: 0 14px 36px var(--primary-glow), 0 4px 12px rgba(0,0,0,.18);
}
.fab:active { transform: scale(.96); }

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up   { animation: fadeUp .32s ease both; }
.fade-up-1 { animation: fadeUp .32s .06s ease both; }
.fade-up-2 { animation: fadeUp .32s .12s ease both; }
.fade-up-3 { animation: fadeUp .32s .18s ease both; }
.fade-up-4 { animation: fadeUp .32s .24s ease both; }

/* =============================================
   UTILITY CLASSES
   ============================================= */
.text-muted   { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; }
.text-white   { color: var(--white) !important; }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }

.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.mb-4 { margin-bottom: 20px; }

.fw-600  { font-weight: 600; }
.fw-700  { font-weight: 700; }
.fw-800  { font-weight: 800; }
.fw-900  { font-weight: 900; }
.fs-sm   { font-size: .82rem; }
.fs-xs   { font-size: .72rem; }
.w-full  { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state { text-align: center; padding: 52px 24px; color: var(--text-muted); }
.empty-state i { font-size: 3rem; opacity: .2; display: block; margin-bottom: 14px; }
.empty-state p { font-size: .9rem; font-weight: 500; }

/* =============================================
   CALENDAR GRID
   ============================================= */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.cal-day {
  min-height: 72px; border-radius: var(--r-md);
  padding: 10px; color: var(--white); font-weight: 700;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 4px 14px rgba(0,0,0,.1), var(--inset-light);
  transition: transform .2s, filter .2s; position: relative; overflow: hidden;
}
.cal-day::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
}
.cal-day:hover { transform: scale(1.05) translateY(-2px); filter: brightness(1.08); }
.cal-date { font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 900; color: var(--white); }
.cal-label { font-size: 10px; font-weight: 800; color: rgba(255,255,255,.9); letter-spacing: .4px; }

/* =============================================
   RESPONSIVE — TABLET ≥640px
   ============================================= */
@media (min-width: 640px) {
  #content { padding: 24px 26px; padding-bottom: calc(var(--bottom-nav-h) + 20px); }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .kpi-grid   { grid-template-columns: repeat(4, 1fr); }
  .modal-box  { border-radius: var(--r-2xl); }
  .modal-bg   { align-items: center; }
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  table { font-size: .85rem; }
}

/* =============================================
   RESPONSIVE — DESKTOP ≥900px
   ============================================= */
@media (min-width: 900px) {
  #sidebar {
    left: 0 !important;
    box-shadow: 1px 0 0 var(--border), 4px 0 20px rgba(0,0,0,.05);
  }
  #content {
    margin-left: var(--sidebar-w);
    padding: 26px 32px;
    padding-bottom: 36px;
  }
  #bottomNav { display: none; }
  #overlay   { display: none !important; }
  .btn-menu  { display: none; }
  .topbar    { left: var(--sidebar-w); }
  .modal-box { max-width: 580px; }
  .fab       { bottom: 28px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .kpi-grid   { grid-template-columns: repeat(4, 1fr); }
  .calendar-grid { gap: 12px; }
}

/* =============================================
   RESPONSIVE — LARGE DESKTOP ≥1280px
   ============================================= */
@media (min-width: 1280px) {
  :root { --sidebar-w: 280px; }
  #content { padding: 30px 40px; }
  .live-clock { font-size: 56px; }
}

/* =============================================
   MOBILE OVERRIDES ≤480px
   ============================================= */
@media (max-width: 480px) {
  .absen-row   { grid-template-columns: 1fr 1fr; gap: 10px; }
  .btn-absen   { padding: 18px 10px; font-size: .76rem; }
  .btn-absen i { font-size: 1.6rem; }
  .stats-grid  { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-grid    { grid-template-columns: 1fr 1fr; }
  .kpi-card h1 { font-size: 2rem; }
  .live-clock  { font-size: 36px; letter-spacing: 2px; }
  .calendar-grid { grid-template-columns: repeat(4, 1fr); gap: 7px; }
  .login-box   { padding: 32px 22px; }
}


/* ================perubahan=============== */
/* =========================================================
   AUTO GLOBAL UI SYSTEM
   Flexible Styling for ALL HTML
========================================================= */

/* ===== GLOBAL SPACING ===== */

section,
.card,
form,
table,
.tbl-wrap,
fieldset {
  margin-bottom: 16px;
}

/* ===== AUTO CARD ===== */

div:not(:empty) {
  border-radius: var(--r-md);
}

/* ===== FORM AUTO STYLE ===== */

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--r-md);
  background: var(--white);
  color: var(--text);
  font-size: .92rem;
  font-family: inherit;
  outline: none;
  transition: .2s;
  box-shadow:
    0 1px 3px rgba(0,0,0,.04),
    inset 0 1px 2px rgba(0,0,0,.03);
}

/* focus */

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow:
    0 0 0 4px var(--primary-glow),
    0 2px 6px rgba(0,0,0,.05);
}

/* placeholder */

input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
}

/* ===== LABEL ===== */

label {
  display: block;
  margin-bottom: 6px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--gray-600);
}

/* ===== BUTTON GENERAL ===== */

button,
.btn {
  padding: 11px 18px;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: .85rem;
  transition: .2s;
  background:
    linear-gradient(
      180deg,
      #4f8ef7 0%,
      var(--primary) 50%,
      var(--primary-dark) 100%
    );

  color: white;

  box-shadow:
    0 4px 14px rgba(37,99,235,.22),
    inset 0 1px 0 rgba(255,255,255,.18);
}

/* hover */

button:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(37,99,235,.28);
}

/* active */

button:active,
.btn:active {
  transform: scale(.98);
}

/* ===== SECONDARY BUTTON ===== */

button.secondary,
.btn-secondary {
  background: white;
  color: var(--text);
  border: 1.5px solid var(--gray-200);
}

/* ===== DANGER BUTTON ===== */

button.danger,
.btn-danger {
  background:
    linear-gradient(
      180deg,
      #ef4444 0%,
      #dc2626 100%
    );
}

/* ===== TABLE AUTO ===== */

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* table header */

thead {
  background:
    linear-gradient(
      180deg,
      var(--gray-50),
      var(--gray-100)
    );
}

thead th {
  padding: 14px;
  text-align: left;
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gray-600);
  border-bottom: 2px solid var(--gray-200);
}

/* body */

tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--gray-100);
  font-size: .86rem;
}

tbody tr:hover {
  background: var(--primary-light);
}

/* ===== TABLE WRAP ===== */

.tbl-wrap,
.table-wrap,
.table-responsive {
  overflow-x: auto;
  border-radius: var(--r-lg);
}

/* ===== CARD AUTO ===== */

.card,
.box,
.panel,
.widget,
form,
fieldset {
  background: white;
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(226,232,240,.7);
}

/* ===== HEADINGS ===== */

h1,h2,h3,h4,h5,h6 {
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}

h1 {
  font-size: 1.8rem;
}

h2 {
  font-size: 1.4rem;
}

h3 {
  font-size: 1.1rem;
}

/* ===== LINKS ===== */

a {
  color: var(--primary);
  transition: .2s;
}

a:hover {
  opacity: .8;
}

/* ===== LIST ===== */

ul,
ol {
  padding-left: 20px;
}

/* ===== IMAGE ===== */

img {
  max-width: 100%;
  border-radius: var(--r-md);
}

/* ===== FLEX AUTO ===== */

.row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.col {
  flex: 1;
  min-width: 200px;
}

/* ===== GRID AUTO ===== */

.grid {
  display: grid;
  gap: 14px;
}

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

.grid-3 {
  grid-template-columns: repeat(3,1fr);
}

.grid-4 {
  grid-template-columns: repeat(4,1fr);
}

/* ===== MOBILE ===== */

@media (max-width: 768px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .row {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  table {
    min-width: 600px;
  }

}

/* ===== SMOOTH ANIMATION ===== */

.card,
button,
input,
select,
textarea,
table {
  transition:
    all .2s ease;
}


/* =========================================================
   GLOBAL RESPONSIVE FIX SYSTEM
========================================================= */

/* ===== GLOBAL SPACING SYSTEM ===== */

form > * + *,
.card > * + *,
.modal-box > * + *,
.popup-box > * + * {
  margin-top: 16px;
}

/* khusus button area */

button,
.btn,
.btn-primary,
.btn-secondary,
.btn-danger {
  margin-top: 10px;
}

/* spacing antar field */

.field + .field {
  margin-top: 16px;
}

/* ===== FORM LAYOUT ===== */

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== INPUT FIX ===== */

input,
select,
textarea {
  min-height: 46px;
}

/* textarea */

textarea {
  min-height: 100px;
}

/* ===== BUTTON FIX ===== */

button,
.btn,
.btn-primary,
.btn-secondary,
.btn-danger {

  min-height: 44px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  white-space: nowrap;
}

/* ===== BUTTON GROUP ===== */

.form-actions,
.button-group,
.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ===== CARD FIX ===== */

.card,
.box,
.panel,
.widget,
form {

  width: 100%;

  overflow: hidden;
}

/* ===== TABLE RESPONSIVE ===== */

.tbl-wrap,
.table-wrap,
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* table tidak rusak */

table {
  min-width: 600px;
}

/* ===== IMAGE ===== */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== FLEXIBLE GRID ===== */

.grid-auto {
  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(220px,1fr));

  gap: 16px;
}

/* ===== FLEX ROW ===== */

.row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.row > * {
  flex: 1;
  min-width: 220px;
}

/* ===== PAGE CONTENT ===== */

#content,
.content,
.page,
.container {

  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* ===== MOBILE ===== */

@media (max-width: 768px) {

  /* padding mobile */

  #content,
  .content,
  .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  /* form full width */

  form,
  .card,
  .modal-box,
  .popup-box {
    padding: 16px;
  }

  /* button full width */

  button,
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-danger {
    width: 100%;
  }

  /* action buttons */

  .form-actions,
  .button-group,
  .btn-group {
    flex-direction: column;
  }

  /* table */

  table {
    min-width: 520px;
  }

  /* heading */

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1.05rem;
  }

}

/* ===== SMALL MOBILE ===== */

@media (max-width: 480px) {

  body {
    font-size: 13px;
  }

  #content,
  .content,
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .card,
  form {
    padding: 14px;
    border-radius: 14px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  /* anti zoom ios */

  button {
    font-size: .85rem;
  }

}

/* ===== TABLET ===== */

@media (min-width: 769px) and (max-width: 1024px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2,1fr);
  }

}

/* ===== LARGE DESKTOP ===== */

@media (min-width: 1400px) {

  #content,
  .container {

    max-width: 1400px;
    margin-inline: auto;
  }

}

/* ===== SAFE OVERFLOW ===== */

* {
  max-width: 100%;
}

/* ===== RESPONSIVE IFRAME ===== */

iframe {
  max-width: 100%;
  border: none;
}

/* =========================================================
   UNIVERSAL WIDTH & OVERFLOW FIX
========================================================= */

/* ===== GLOBAL SAFE WIDTH ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
  min-width: 0;
}

/* ===== BODY FIX ===== */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* ===== APP CONTAINER ===== */

#appPage,
#content,
.container,
.page,
.content {

  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* ===== FLEX FIX ===== */

.row,
.flex,
.form-actions,
.button-group,
.btn-group {

  width: 100%;
  flex-wrap: wrap;
}

/* FLEX CHILD */

.row > *,
.flex > * {
  min-width: 0;
  max-width: 100%;
}

/* ===== GRID FIX ===== */

.grid,
.grid-2,
.grid-3,
.grid-4,
.grid-auto {

  width: 100%;
  max-width: 100%;
}

/* ===== CARD FIX ===== */

.card,
.box,
.panel,
.widget,
form {

  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* ===== INPUT FIX ===== */

input,
select,
textarea,
button {

  max-width: 100%;
}

/* ===== TEXT FIX ===== */

h1,h2,h3,h4,h5,h6,
p,
span,
label,
td,
th,
div {

  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ===== IMAGE ===== */

img,
video,
canvas,
iframe {

  max-width: 100%;
  height: auto;
}

/* ===== TABLE FIX ===== */

.tbl-wrap,
.table-wrap,
.table-responsive {

  width: 100%;
  max-width: 100%;
  overflow-x: auto;

  -webkit-overflow-scrolling: touch;
}

/* table jangan paksa layar */

table {
  width: 100%;
  min-width: unset !important;
}

/* table mobile */

@media (max-width: 768px) {

  table {
    font-size: .78rem;
  }

  th,
  td {
    padding: 10px 8px;
  }

}

/* ===== SIDEBAR FIX ===== */

#sidebar {
  max-width: 85vw;
}

/* ===== CONTENT FIX ===== */

#content {

  width: 100%;
  max-width: 100%;
  margin-left: 0;
}

/* desktop sidebar spacing */

@media (min-width: 900px) {

  #content {
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
  }

}

/* ===== BUTTON FIX ===== */

button,
.btn,
.btn-primary,
.btn-secondary,
.btn-danger {

  white-space: normal;
  text-align: center;
}

/* ===== MODAL FIX ===== */

.modal-box,
.popup-box {

  width: calc(100% - 20px);
  max-width: 600px;
}

/* ===== GRID RESPONSIVE ===== */

@media (max-width: 1024px) {

  .grid-4 {
    grid-template-columns: repeat(2,1fr);
  }

}

@media (max-width: 768px) {

  .grid-2,
  .grid-3,
  .grid-4,
  .grid-auto {

    grid-template-columns: 1fr !important;
  }

}

/* ===== SMALL MOBILE ===== */

@media (max-width: 480px) {

  body {
    overflow-x: hidden;
  }

  #content,
  .content,
  .container {

    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .card,
  form {

    padding: 14px;
  }

  h1 {
    font-size: 1.4rem;
  }

  h2 {
    font-size: 1.15rem;
  }

  h3 {
    font-size: 1rem;
  }

}

/* ===== PREVENT 100VW BUG ===== */

[style*="100vw"] {
  width: 100% !important;
}

/* ===== SAFE PRE ===== */

pre {
  overflow-x: auto;
  max-width: 100%;
}

/* =============================================================
   DARK MODE — .dark on <html>
   Full coverage: body, topbar, sidebar, cards, forms, tables,
   badges, modals, alerts, nav, inputs, search, filter, etc.
   ============================================================= */

/* ===== DARK MODE: CSS VARIABLES OVERRIDE ===== */
html.dark {
  --primary:        #60a5fa;
  --primary-dark:   #3b82f6;
  --primary-deeper: #1e3a8a;
  --primary-light:  rgba(59,130,246,.14);
  --primary-mid:    rgba(59,130,246,.32);
  --primary-glow:   rgba(96,165,250,.22);

  --success:        #4ade80;
  --success-light:  rgba(74,222,128,.12);
  --success-mid:    rgba(74,222,128,.28);
  --success-glow:   rgba(74,222,128,.22);

  --danger:         #f87171;
  --danger-light:   rgba(248,113,113,.12);
  --danger-mid:     rgba(248,113,113,.28);
  --danger-glow:    rgba(248,113,113,.22);

  --warning:        #fbbf24;
  --warning-dark:   #f59e0b;
  --warning-light:  rgba(251,191,36,.12);
  --warning-mid:    rgba(251,191,36,.28);
  --warning-glow:   rgba(251,191,36,.22);

  --gray-50:   #1e293b;
  --gray-100:  #243247;
  --gray-200:  #2d3f57;
  --gray-300:  #3d5068;
  --gray-400:  #7a90ac;
  --gray-500:  #94a3b8;
  --gray-600:  #b8c9d9;
  --gray-700:  #cbd5e1;
  --gray-800:  #e2e8f0;
  --gray-900:  #f1f5f9;

  --white:      #1a2540;
  --text:       #e8f0fe;
  --text-muted: #94a3b8;
  --border:     rgba(255,255,255,.09);
  --border-focus: rgba(96,165,250,.5);

  --shadow-xs:    0 1px 2px rgba(0,0,0,.35);
  --shadow-sm:    0 1px 4px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.28);
  --shadow-md:    0 4px 14px rgba(0,0,0,.45), 0 2px 4px rgba(0,0,0,.28);
  --shadow-lg:    0 10px 32px rgba(0,0,0,.5), 0 4px 10px rgba(0,0,0,.32);
  --shadow-xl:    0 20px 48px rgba(0,0,0,.55), 0 8px 16px rgba(0,0,0,.36);
  --shadow-card:  0 2px 12px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.32),
                  inset 0 1px 0 rgba(255,255,255,.05);
  --shadow-btn:   0 2px 8px rgba(96,165,250,.22), 0 1px 2px rgba(0,0,0,.38),
                  inset 0 1px 0 rgba(255,255,255,.1);
  --shadow-hover: 0 8px 28px rgba(0,0,0,.5), 0 3px 8px rgba(0,0,0,.36),
                  inset 0 1px 0 rgba(255,255,255,.06);

  --inset-light: inset 0 1px 0 rgba(255,255,255,.08);
  --inset-white: inset 0 1px 0 rgba(255,255,255,.06);
}

/* ===== DARK: BODY ===== */
html.dark body {
  color: var(--text);
  background: #0f1a2e;
}

html.dark body::before {
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(59,130,246,.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(8,145,178,.07) 0%, transparent 60%);
}

/* ===== DARK: SCROLLBAR ===== */
html.dark ::-webkit-scrollbar-track { background: #162035; }
html.dark ::-webkit-scrollbar-thumb { background: #2d3f57; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #3d5068; }

/* ===== DARK: LOGIN PAGE ===== */
html.dark .login-box {
  background: rgba(22,32,54,.97);
  border-color: rgba(255,255,255,.1);
}
html.dark .login-field label { color: #94a3b8; }
html.dark .login-field input {
  background: #1e293b;
  border-color: rgba(255,255,255,.1);
  color: #e8f0fe;
}
html.dark .login-field input:focus {
  background: #243247;
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow-xs);
}
html.dark .login-field input::placeholder { color: #4a5f7a; }
html.dark .login-logo p { color: #7a90ac; }

/* ===== DARK: TOPBAR ===== */
html.dark .topbar {
  background: linear-gradient(180deg, #1a2a4a 0%, #162035 50%, #111827 100%);
  box-shadow:
    0 2px 10px rgba(0,0,0,.55),
    0 4px 20px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.07),
    inset 0 -1px 0 rgba(0,0,0,.25);
}

/* ===== DARK: THEME TOGGLE BUTTON (in topbar) ===== */
html.dark .btn-theme-toggle {
  background: rgba(251,191,36,.15);
  border-color: rgba(251,191,36,.28);
}
html.dark .btn-theme-toggle:hover {
  background: rgba(251,191,36,.28);
}
html.dark .btn-theme-toggle i {
  color: #fbbf24;
}

/* ===== DARK: SIDEBAR ===== */
html.dark #sidebar {
  background: #131f35;
  border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: 6px 0 40px rgba(0,0,0,.55);
}

html.dark .sidebar-nav a {
  color: #94a3b8;
}
html.dark .sidebar-nav a i {
  color: #4a5f7a;
}
html.dark .sidebar-nav a:hover {
  background: rgba(59,130,246,.12);
  color: #93c5fd;
  border-color: rgba(59,130,246,.22);
}
html.dark .sidebar-nav a:hover i { color: #60a5fa; }
html.dark .sidebar-nav a.active {
  background: rgba(59,130,246,.18);
  color: #93c5fd;
  border-color: rgba(59,130,246,.3);
}
html.dark .sidebar-nav a.active i { color: #60a5fa; }
html.dark .sidebar-nav .nav-section { color: #3d5068; }

/* ===== DARK: BOTTOM NAV ===== */
html.dark #bottomNav {
  background: rgba(19,31,53,.97);
  border-top-color: rgba(255,255,255,.07);
  box-shadow: 0 -6px 24px rgba(0,0,0,.4);
}
html.dark .bottom-nav-item { color: #3d5068; }
html.dark .bottom-nav-item.active { color: #60a5fa; }
html.dark .bottom-nav-item:hover:not(.active) { color: #7a90ac; }

/* ===== DARK: CARD ===== */
html.dark .card {
  background: #1a2540;
  border-color: rgba(255,255,255,.07);
}
html.dark .card::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
}
html.dark .card-title { color: #e8f0fe; }
html.dark .card-title i {
  background: rgba(59,130,246,.18);
  color: #60a5fa;
}

/* ===== DARK: STAT CARDS ===== */
html.dark .stat-card {
  background: #1a2540;
  border-color: rgba(255,255,255,.07);
}
html.dark .stat-card::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
}
html.dark .stat-card .stat-label { color: #7a90ac; }
html.dark .stat-card .stat-sub { color: #7a90ac; }
html.dark .stat-card.blue .stat-icon  { background: rgba(59,130,246,.18); color: #60a5fa; }
html.dark .stat-card.green .stat-icon { background: rgba(74,222,128,.14); color: #4ade80; }
html.dark .stat-card.yellow .stat-icon { background: rgba(251,191,36,.14); color: #fbbf24; }
html.dark .stat-card.red .stat-icon  { background: rgba(248,113,113,.14); color: #f87171; }

/* ===== DARK: FORM FIELDS ===== */
html.dark .field label { color: #7a90ac; }
html.dark .field input,
html.dark .field select,
html.dark .field textarea {
  background: #131f35;
  border-color: rgba(255,255,255,.1);
  color: #e8f0fe;
  box-shadow: 0 1px 3px rgba(0,0,0,.3), inset 0 1px 3px rgba(0,0,0,.2);
}
html.dark .field input::placeholder,
html.dark .field textarea::placeholder { color: #3d5068; }
html.dark .field input:focus,
html.dark .field select:focus,
html.dark .field textarea:focus {
  background: #1a2540;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96,165,250,.18), 0 1px 4px rgba(0,0,0,.25);
}
html.dark .field input:hover:not(:focus):not(:disabled),
html.dark .field select:hover:not(:focus):not(:disabled),
html.dark .field textarea:hover:not(:focus):not(:disabled) {
  border-color: rgba(255,255,255,.18);
  background: #1a2540;
}
html.dark .field input:disabled,
html.dark .field select:disabled,
html.dark .field textarea:disabled {
  background: #131f35;
  color: #3d5068;
}
html.dark .field input[type="date"],
html.dark .field input[type="time"],
html.dark .field input[type="datetime-local"] {
  color-scheme: dark;
}

html.dark .field-msg.hint { color: #7a90ac; }
html.dark .field-msg.error { color: #f87171; }
html.dark .field-msg.ok { color: #4ade80; }

html.dark .form-section {
  background: #1a2540;
  border-color: rgba(255,255,255,.07);
}
html.dark .form-actions { border-top-color: rgba(255,255,255,.07); }

html.dark .input-group > i { color: #3d5068; }

/* ===== DARK: SEARCH BOX ===== */
html.dark .search-box input {
  background: #131f35;
  border-color: rgba(255,255,255,.1);
  color: #e8f0fe;
}
html.dark .search-box input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96,165,250,.18);
}
html.dark .search-box input::placeholder { color: #3d5068; }
html.dark .search-box i { color: #3d5068; }

/* ===== DARK: FILTER ROW ===== */
html.dark .filter-row input,
html.dark .filter-row select,
html.dark .jadwal-filters input,
html.dark .jadwal-filters select {
  background: #131f35;
  border-color: rgba(255,255,255,.1);
  color: #e8f0fe;
}
html.dark .filter-row input:focus,
html.dark .filter-row select:focus,
html.dark .jadwal-filters input:focus,
html.dark .jadwal-filters select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96,165,250,.18);
}

/* ===== DARK: TABLE ===== */
html.dark .tbl-wrap {
  background: #1a2540;
  border-color: rgba(255,255,255,.07);
}
html.dark table {
  background: #1a2540;
}
html.dark thead th {
  background: linear-gradient(180deg, #1e293b 0%, #162035 100%);
  color: #7a90ac;
  border-bottom-color: rgba(255,255,255,.08);
}
html.dark tbody td {
  color: #e8f0fe;
  border-bottom-color: rgba(255,255,255,.05);
}
html.dark tbody tr:nth-child(even) td { background: rgba(255,255,255,.025); }
html.dark tbody tr:hover td {
  background: rgba(59,130,246,.1) !important;
}

html.dark td.td-num { color: #7a90ac; }

/* Jadwal table header stays coloured */
html.dark .jadwal-table thead th {
  background: linear-gradient(135deg, #1d4ed8 0%, #0369a1 100%);
  color: #fff;
}

/* ===== DARK: TABLE ACTION BUTTONS ===== */
html.dark .tbl-btn.edit  { background: rgba(59,130,246,.18); color: #93c5fd; border-color: rgba(59,130,246,.3); }
html.dark .tbl-btn.edit:hover  { background: #3b82f6; color: #fff; }
html.dark .tbl-btn.del   { background: rgba(248,113,113,.14); color: #fca5a5; border-color: rgba(248,113,113,.28); }
html.dark .tbl-btn.del:hover   { background: #ef4444; color: #fff; }
html.dark .tbl-btn.view  { background: rgba(74,222,128,.14); color: #86efac; border-color: rgba(74,222,128,.28); }
html.dark .tbl-btn.view:hover  { background: #22c55e; color: #fff; }
html.dark .tbl-btn.warn  { background: rgba(251,191,36,.14); color: #fde68a; border-color: rgba(251,191,36,.28); }
html.dark .tbl-btn.warn:hover  { background: #d97706; color: #fff; }

/* ===== DARK: BADGES ===== */
html.dark .badge-green  { background: rgba(74,222,128,.15);  color: #86efac; border-color: rgba(74,222,128,.3);  }
html.dark .badge-red    { background: rgba(248,113,113,.15); color: #fca5a5; border-color: rgba(248,113,113,.3); }
html.dark .badge-yellow { background: rgba(251,191,36,.15);  color: #fde68a; border-color: rgba(251,191,36,.3);  }
html.dark .badge-blue   { background: rgba(96,165,250,.15);  color: #93c5fd; border-color: rgba(96,165,250,.3);  }
html.dark .badge-gray   { background: rgba(255,255,255,.08); color: #94a3b8; border-color: rgba(255,255,255,.12); }

/* ===== DARK: ALERTS ===== */
html.dark .alert.info    { background: rgba(59,130,246,.15);  color: #93c5fd; border-color: rgba(96,165,250,.3);  }
html.dark .alert.success { background: rgba(74,222,128,.13);  color: #86efac; border-color: rgba(74,222,128,.28); }
html.dark .alert.warning { background: rgba(251,191,36,.13);  color: #fde68a; border-color: rgba(251,191,36,.28); }
html.dark .alert.danger  { background: rgba(248,113,113,.14); color: #fca5a5; border-color: rgba(248,113,113,.28);}

/* ===== DARK: MODAL ===== */
html.dark .modal-box {
  background: #1a2540;
  border-top-color: rgba(255,255,255,.07);
  box-shadow: 0 -12px 40px rgba(0,0,0,.55), 0 -2px 8px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.04);
}
html.dark .modal-header h3 { color: #e8f0fe; }
html.dark .modal-close {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.1);
  color: #94a3b8;
}
html.dark .modal-close:hover { background: rgba(255,255,255,.13); color: #e8f0fe; }

/* ===== DARK: POPUP ===== */
html.dark .popup-box {
  background: #1a2540;
  border-color: rgba(255,255,255,.07);
}
html.dark .popup-box th { color: #7a90ac; }
html.dark .popup-box td { color: #e8f0fe; }
html.dark .popup-box th, html.dark .popup-box td { border-bottom-color: rgba(255,255,255,.06); }

/* ===== DARK: BTN-SECONDARY ===== */
html.dark .btn-secondary {
  background: rgba(255,255,255,.07);
  color: #b8c9d9;
  border-color: rgba(255,255,255,.12);
}
html.dark .btn-secondary:hover {
  background: rgba(255,255,255,.12);
  color: #e8f0fe;
  border-color: rgba(255,255,255,.2);
}

/* ===== DARK: ACTION BTNS ===== */
html.dark .action-btn {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.1);
  color: #94a3b8;
}
html.dark .action-btn:hover { background: rgba(59,130,246,.15); color: #60a5fa; border-color: rgba(96,165,250,.25); }
html.dark .action-btn.delete:hover { background: rgba(248,113,113,.15); color: #f87171; border-color: rgba(248,113,113,.28); }

/* ===== DARK: USER/SHIFT/PENGAJUAN/ABSEN CARDS ===== */
html.dark .user-item,
html.dark .shift-card,
html.dark .absen-record {
  background: #1a2540;
  border-color: rgba(255,255,255,.07);
}
html.dark .user-item:hover,
html.dark .shift-card:hover,
html.dark .absen-record:hover {
  border-color: rgba(59,130,246,.3);
  box-shadow: var(--shadow-hover);
}
html.dark .user-item .ui-name,
html.dark .shift-card .sc-name,
html.dark .absen-record .ar-date { color: #e8f0fe; }
html.dark .user-item .ui-email,
html.dark .shift-card .sc-time,
html.dark .absen-record .ar-times { color: #7a90ac !important; }

html.dark .pengajuan-card {
  background: #1a2540;
  border-color: rgba(255,255,255,.07);
}
html.dark .pengajuan-card .pq-name { color: #e8f0fe; }
html.dark .pengajuan-card .pq-type,
html.dark .pengajuan-card .pq-date { color: #7a90ac; }
html.dark .pengajuan-card .pq-ket  { color: #c8d8e8; }

/* ===== DARK: SHIFT CARD ICON ===== */
html.dark .shift-card .sc-icon {
  background: rgba(59,130,246,.18);
  color: #60a5fa;
}

/* ===== DARK: BTN-ABSEN PULANG ===== */
html.dark .btn-absen.pulang {
  background: #131f35;
  color: #93c5fd;
  border-color: rgba(59,130,246,.3) !important;
}
html.dark .btn-absen.pulang i { color: #60a5fa; }
html.dark .btn-absen.pulang:hover:not(:disabled) {
  background: rgba(59,130,246,.18);
  box-shadow: var(--shadow-hover), 0 6px 16px rgba(96,165,250,.18);
}
html.dark .btn-absen.pulang.done {
  color: #4ade80;
  border-color: rgba(74,222,128,.3) !important;
  background: rgba(74,222,128,.1);
}
html.dark .btn-absen.pulang.done i { color: #4ade80; }

/* ===== DARK: PAGE HEADER ===== */
html.dark .page-header h2 { color: #e8f0fe; }

/* ===== DARK: SECTION TITLE / DIVIDER / INFO ROW ===== */
html.dark .section-title { color: #7a90ac; }
html.dark .section-title::after { background: rgba(255,255,255,.07); }
html.dark .info-row { border-bottom-color: rgba(255,255,255,.06); }
html.dark .info-row .ir-label { color: #7a90ac; }
html.dark .info-row .ir-val { color: #e8f0fe; }
html.dark .divider { background: rgba(255,255,255,.07); }

/* ===== DARK: PAGINATION ===== */
html.dark .page-btn {
  background: #131f35;
  border-color: rgba(255,255,255,.1);
  color: #7a90ac;
}
html.dark .page-btn:hover { background: rgba(59,130,246,.15); color: #60a5fa; border-color: rgba(96,165,250,.25); }
html.dark .page-btn.active { background: #3b82f6; border-color: #3b82f6; color: #fff; }

/* ===== DARK: PROGRESS BAR ===== */
html.dark .progress-bar { background: rgba(255,255,255,.09); }

/* ===== DARK: SKELETON ===== */
html.dark .skeleton {
  background: linear-gradient(90deg, #162035 25%, #1e293b 50%, #162035 75%);
  background-size: 200% 100%;
}

/* ===== DARK: EMPTY STATE ===== */
html.dark .empty-state { color: #3d5068; }

/* ===== DARK: TOAST ===== */
html.dark .toast {
  background: #243247;
  border-color: rgba(255,255,255,.09);
}

/* ===== DARK: JADWAL CELLS ===== */
html.dark .jadwal-cell.pagi   { background: rgba(59,130,246,.18); color: #93c5fd; border-color: rgba(59,130,246,.3); }
html.dark .jadwal-cell.siang  { background: rgba(251,191,36,.15); color: #fde68a; border-color: rgba(251,191,36,.28); }
html.dark .jadwal-cell.malam  { background: rgba(139,92,246,.16); color: #c4b5fd; border-color: rgba(139,92,246,.28); }
html.dark .jadwal-cell.libur  { background: rgba(248,113,113,.14); color: #fca5a5; border-color: rgba(248,113,113,.28); }
html.dark .jadwal-cell.off    { background: rgba(255,255,255,.07); color: #7a90ac; border-color: rgba(255,255,255,.1); }

/* ===== DARK: CAMERA CONTAINER ===== */
html.dark #camera-container { border-color: rgba(255,255,255,.1); }

/* ===== DARK: STATUS BAR ===== */
html.dark .status-item { color: #7a90ac; }

/* ===== DARK: GENERAL HEADINGS & TEXT ===== */
html.dark h1, html.dark h2, html.dark h3, html.dark h4 { color: #e8f0fe; }
html.dark p { color: #b8c9d9; }
html.dark label { color: #94a3b8; }
html.dark small { color: #7a90ac; }
html.dark span:not(.badge):not(.topbar-title):not(#userName):not(.dot) { color: inherit; }
html.dark a { color: #60a5fa; }

/* ===== DARK: THEME TOGGLE BASE STYLE ===== */
/* (light mode base styles for the new button) */
.btn-theme-toggle {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  color: var(--white);
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background .2s, transform .15s, color .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-theme-toggle i {
  font-size: .95rem;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.btn-theme-toggle:hover {
  background: rgba(255,255,255,.28);
  transform: translateY(-1px);
}
.btn-theme-toggle:hover i { transform: rotate(20deg) scale(1.1); }


/* =============================================
   THEME TOGGLE BUTTON
   ============================================= */
.btn-theme-toggle {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  color: var(--white);
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background .2s, transform .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.18);
  margin-top: 0 !important;
  min-height: unset !important;
  padding: 0 !important;
  width: 38px !important;
}
.btn-theme-toggle:hover {
  background: rgba(255,255,255,.28);
  transform: translateY(-1px);
}

/* =============================================
   DARK MODE — Variables Override
   ============================================= */
:root.dark {
  --white:        #1e293b;
  --text:         #e2e8f0;
  --text-muted:   #94a3b8;
  --border:       #334155;
  --border-focus: rgba(96,165,250,.45);

  --gray-50:   #0f172a;
  --gray-100:  #1e293b;
  --gray-200:  #334155;
  --gray-300:  #475569;
  --gray-400:  #64748b;
  --gray-500:  #94a3b8;
  --gray-600:  #cbd5e1;
  --gray-700:  #e2e8f0;
  --gray-800:  #f1f5f9;
  --gray-900:  #f8fafc;

  --primary-light:  #1e3a5f;
  --primary-mid:    #2563eb;
  --primary-glow:   rgba(96,165,250,.22);

  --success-light:  #052e16;
  --success-mid:    #16a34a;
  --success-glow:   rgba(34,197,94,.22);

  --danger-light:   #2d0a0a;
  --danger-mid:     #dc2626;
  --danger-glow:    rgba(248,113,113,.22);

  --warning-light:  #1c1002;
  --warning-mid:    #d97706;
  --warning-glow:   rgba(251,191,36,.22);

  --shadow-card:  0 2px 10px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.2),
                  inset 0 1px 0 rgba(255,255,255,.05);
  --shadow-hover: 0 8px 28px rgba(0,0,0,.35), 0 3px 8px rgba(0,0,0,.25),
                  inset 0 1px 0 rgba(255,255,255,.05);
}

/* =============================================
   DARK MODE — Body & Background
   ============================================= */
:root.dark body {
  background: #0b1120;
  color: var(--text);
}

:root.dark body::before {
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(37,99,235,.1) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(8,145,178,.08) 0%, transparent 60%);
}

/* =============================================
   DARK MODE — Login Page
   ============================================= */
:root.dark .login-box {
  background: rgba(15,23,42,.96);
  border-color: rgba(51,65,85,.8);
}

:root.dark .login-field label {
  color: var(--gray-500);
}

:root.dark .login-field input {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

:root.dark .login-field input:focus {
  background: #1e3a5f;
  border-color: var(--primary);
}

:root.dark .login-field input::placeholder {
  color: #475569;
}

:root.dark .login-logo p {
  color: var(--gray-500);
}

/* =============================================
   DARK MODE — Sidebar
   ============================================= */
:root.dark #sidebar {
  background: #111827;
  border-right: 1px solid #1f2937;
  box-shadow: 6px 0 40px rgba(0,0,0,.4);
}

:root.dark .sidebar-nav a {
  color: #94a3b8;
}

:root.dark .sidebar-nav a i {
  color: #64748b;
}

:root.dark .sidebar-nav a:hover {
  background: rgba(37,99,235,.15);
  color: #93c5fd;
  border-color: rgba(37,99,235,.3);
}

:root.dark .sidebar-nav a:hover i {
  color: #60a5fa;
}

:root.dark .sidebar-nav a.active {
  background: rgba(37,99,235,.2);
  color: #93c5fd;
  border-color: rgba(37,99,235,.4);
}

:root.dark .sidebar-nav a.active i {
  color: #60a5fa;
}

:root.dark .sidebar-nav .nav-section {
  color: #475569;
}

/* =============================================
   DARK MODE — Cards & Containers
   ============================================= */
:root.dark .card,
:root.dark .box,
:root.dark .panel,
:root.dark .widget {
  background: #1e293b;
  border-color: #334155;
}

:root.dark .card::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
}

:root.dark .stat-card {
  background: #1e293b;
  border-color: #334155;
}

:root.dark .stat-card::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
}

:root.dark .stat-card .stat-label {
  color: #64748b;
}

:root.dark .stat-card .stat-sub {
  color: #64748b;
}

:root.dark .stat-card.blue .stat-icon {
  background: rgba(37,99,235,.2);
}
:root.dark .stat-card.green .stat-icon {
  background: rgba(22,163,74,.15);
}
:root.dark .stat-card.yellow .stat-icon {
  background: rgba(217,119,6,.15);
}
:root.dark .stat-card.red .stat-icon {
  background: rgba(220,38,38,.15);
}

/* =============================================
   DARK MODE — Bottom Nav
   ============================================= */
:root.dark #bottomNav {
  background: rgba(17,24,39,.97);
  border-top-color: #1f2937;
  box-shadow: 0 -6px 24px rgba(0,0,0,.4);
}

:root.dark .bottom-nav-item {
  color: #475569;
}

:root.dark .bottom-nav-item.active {
  color: #60a5fa;
}

:root.dark .bottom-nav-item:hover:not(.active) {
  color: #94a3b8;
}

/* =============================================
   DARK MODE — Tables
   ============================================= */
:root.dark table,
:root.dark .tbl-wrap {
  background: #1e293b;
}

:root.dark thead,
:root.dark thead th {
  background: #162032;
  color: #64748b;
  border-bottom-color: #334155;
}

:root.dark .jadwal-table thead th {
  background: linear-gradient(135deg, #1e3a8a 0%, #0e4f6e 100%);
  color: #e2e8f0;
}

:root.dark tbody td {
  border-bottom-color: #263347;
  color: #cbd5e1;
}

:root.dark tbody tr:nth-child(even) td {
  background: #162032;
}

:root.dark tbody tr:hover td {
  background: rgba(37,99,235,.12) !important;
}

:root.dark .tbl-wrap {
  border-color: #334155;
}

/* =============================================
   DARK MODE — Forms & Inputs
   ============================================= */
:root.dark input,
:root.dark select,
:root.dark textarea {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

:root.dark input:focus,
:root.dark select:focus,
:root.dark textarea:focus {
  background: #1a2f4a;
  border-color: #3b82f6;
}

:root.dark input::placeholder,
:root.dark textarea::placeholder {
  color: #475569;
}

:root.dark label {
  color: #94a3b8;
}

:root.dark .field label {
  color: #94a3b8;
}

:root.dark .field input,
:root.dark .field select,
:root.dark .field textarea {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

:root.dark .field input:focus,
:root.dark .field select:focus,
:root.dark .field textarea:focus {
  background: #1a2f4a;
}

:root.dark .field input::placeholder,
:root.dark .field textarea::placeholder {
  color: #475569;
}

:root.dark .field input:hover:not(:focus),
:root.dark .field select:hover:not(:focus),
:root.dark .field textarea:hover:not(:focus) {
  border-color: #475569;
  background: #243348;
}

:root.dark .login-field input {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

/* =============================================
   DARK MODE — Buttons (secondary)
   ============================================= */
:root.dark .btn-secondary,
:root.dark button.secondary {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}

:root.dark .btn-secondary:hover {
  background: #263347;
  border-color: #475569;
  color: #f1f5f9;
}

:root.dark .btn-danger {
  background: rgba(220,38,38,.15);
  color: #f87171;
  border-color: rgba(220,38,38,.4);
}

:root.dark .btn-danger:hover {
  background: #dc2626;
  color: #fff;
}

/* =============================================
   DARK MODE — Headings & Text
   ============================================= */
:root.dark h1, :root.dark h2, :root.dark h3,
:root.dark h4, :root.dark h5, :root.dark h6 {
  color: #e2e8f0;
}

:root.dark .card-title {
  color: #e2e8f0;
}

:root.dark .card-title i {
  background: rgba(37,99,235,.2);
}

:root.dark .page-header h2 {
  color: #e2e8f0;
}

:root.dark p {
  color: #94a3b8;
}

/* =============================================
   DARK MODE — Badges
   ============================================= */
:root.dark .badge-green {
  background: rgba(22,163,74,.15);
  color: #86efac;
  border-color: rgba(22,163,74,.3);
}

:root.dark .badge-red {
  background: rgba(220,38,38,.15);
  color: #fca5a5;
  border-color: rgba(220,38,38,.3);
}

:root.dark .badge-yellow {
  background: rgba(217,119,6,.15);
  color: #fcd34d;
  border-color: rgba(217,119,6,.3);
}

:root.dark .badge-blue {
  background: rgba(37,99,235,.15);
  color: #93c5fd;
  border-color: rgba(37,99,235,.3);
}

:root.dark .badge-gray {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}

/* =============================================
   DARK MODE — Modal & Popup
   ============================================= */
:root.dark .modal-box {
  background: #1e293b;
  border-top-color: #334155;
}

:root.dark .modal-header h3 {
  color: #e2e8f0;
}

:root.dark .modal-close {
  background: #263347;
  border-color: #334155;
  color: #94a3b8;
}

:root.dark .modal-close:hover {
  background: #334155;
  color: #e2e8f0;
}

:root.dark .popup-box {
  background: #1e293b;
  border-color: #334155;
}

:root.dark .popup-box th {
  color: #94a3b8;
}

:root.dark .popup-box td {
  color: #cbd5e1;
  border-bottom-color: #263347;
}

/* =============================================
   DARK MODE — Cards: User, Shift, Pengajuan, Absen
   ============================================= */
:root.dark .user-item {
  background: #1e293b;
  border-color: #334155;
}

:root.dark .user-item:hover {
  border-color: rgba(37,99,235,.4);
}

:root.dark .user-item .ui-name {
  color: #e2e8f0;
}

:root.dark .shift-card {
  background: #1e293b;
  border-color: #334155;
}

:root.dark .shift-card:hover {
  border-color: rgba(37,99,235,.4);
}

:root.dark .shift-card .sc-name {
  color: #e2e8f0;
}

:root.dark .shift-card .sc-icon {
  background: rgba(37,99,235,.2);
}

:root.dark .pengajuan-card {
  background: #1e293b;
  border-color: #334155;
}

:root.dark .pengajuan-card:hover {
  box-shadow: var(--shadow-hover);
}

:root.dark .pengajuan-card .pq-name {
  color: #e2e8f0;
}

:root.dark .pengajuan-card .pq-ket {
  color: #cbd5e1;
}

:root.dark .absen-record {
  background: #1e293b;
  border-color: #334155;
}

:root.dark .absen-record .ar-date {
  color: #e2e8f0;
}

/* =============================================
   DARK MODE — Absen Buttons (pulang variant)
   ============================================= */
:root.dark .btn-absen.pulang {
  background: #1e293b;
  color: #93c5fd;
  border-color: rgba(37,99,235,.4) !important;
}

:root.dark .btn-absen.pulang i {
  color: #60a5fa;
}

:root.dark .btn-absen.pulang:hover:not(:disabled) {
  background: rgba(37,99,235,.2);
}

:root.dark .btn-absen.pulang.done {
  background: rgba(22,163,74,.15);
  color: #86efac;
  border-color: rgba(22,163,74,.4) !important;
}

:root.dark .btn-absen.pulang.done i {
  color: #86efac;
}

/* =============================================
   DARK MODE — Search & Filter
   ============================================= */
:root.dark .search-box input {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

:root.dark .search-box input::placeholder {
  color: #475569;
}

:root.dark .search-box input:focus {
  border-color: #3b82f6;
}

:root.dark .search-box i {
  color: #475569;
}

:root.dark .filter-row input,
:root.dark .filter-row select,
:root.dark .jadwal-filters input,
:root.dark .jadwal-filters select {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

:root.dark .filter-row input:focus,
:root.dark .filter-row select:focus,
:root.dark .jadwal-filters input:focus,
:root.dark .jadwal-filters select:focus {
  border-color: #3b82f6;
}

/* =============================================
   DARK MODE — Alerts
   ============================================= */
:root.dark .alert.info {
  background: rgba(37,99,235,.15);
  color: #93c5fd;
  border-color: rgba(37,99,235,.3);
}

:root.dark .alert.success {
  background: rgba(22,163,74,.15);
  color: #86efac;
  border-color: rgba(22,163,74,.3);
}

:root.dark .alert.warning {
  background: rgba(217,119,6,.15);
  color: #fcd34d;
  border-color: rgba(217,119,6,.3);
}

:root.dark .alert.danger {
  background: rgba(220,38,38,.15);
  color: #fca5a5;
  border-color: rgba(220,38,38,.3);
}

/* =============================================
   DARK MODE — Pagination
   ============================================= */
:root.dark .page-btn {
  background: #1e293b;
  border-color: #334155;
  color: #64748b;
}

:root.dark .page-btn:hover {
  background: rgba(37,99,235,.15);
  color: #93c5fd;
  border-color: rgba(37,99,235,.3);
}

:root.dark .page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* =============================================
   DARK MODE — Divider & Section Title
   ============================================= */
:root.dark .divider {
  background: #334155;
}

:root.dark .section-title {
  color: #475569;
}

:root.dark .section-title::after {
  background: #334155;
}

:root.dark .form-actions {
  border-top-color: #263347;
}

/* =============================================
   DARK MODE — Info Row
   ============================================= */
:root.dark .info-row {
  border-bottom-color: #263347;
}

:root.dark .info-row .ir-label {
  color: #64748b;
}

:root.dark .info-row .ir-val {
  color: #e2e8f0;
}

/* =============================================
   DARK MODE — Action Buttons (table)
   ============================================= */
:root.dark .action-btn {
  background: #263347;
  border-color: #334155;
  color: #94a3b8;
}

:root.dark .action-btn:hover {
  background: rgba(37,99,235,.2);
  color: #93c5fd;
  border-color: rgba(37,99,235,.3);
}

:root.dark .tbl-btn.edit {
  background: rgba(37,99,235,.15);
  color: #93c5fd;
  border-color: rgba(37,99,235,.3);
}

:root.dark .tbl-btn.edit:hover {
  background: var(--primary);
  color: #fff;
}

:root.dark .tbl-btn.del {
  background: rgba(220,38,38,.15);
  color: #fca5a5;
  border-color: rgba(220,38,38,.3);
}

:root.dark .tbl-btn.del:hover {
  background: var(--danger);
  color: #fff;
}

:root.dark .tbl-btn.view {
  background: rgba(22,163,74,.15);
  color: #86efac;
  border-color: rgba(22,163,74,.3);
}

:root.dark .tbl-btn.view:hover {
  background: var(--success);
  color: #fff;
}

:root.dark .tbl-btn.warn {
  background: rgba(217,119,6,.15);
  color: #fcd34d;
  border-color: rgba(217,119,6,.3);
}

:root.dark .tbl-btn.warn:hover {
  background: var(--warning);
  color: #fff;
}

/* =============================================
   DARK MODE — Skeleton
   ============================================= */
:root.dark .skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #263347 50%, #1e293b 75%);
  background-size: 200% 100%;
}

/* =============================================
   DARK MODE — Progress Bar
   ============================================= */
:root.dark .progress-bar {
  background: #263347;
}

/* =============================================
   DARK MODE — Scrollbar
   ============================================= */
:root.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}

:root.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}

:root.dark ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* =============================================
   DARK MODE — form auto (global section)
   ============================================= */
:root.dark form {
  background: #1e293b;
  border-color: #334155;
}

:root.dark fieldset {
  background: #1e293b;
  border-color: #334155;
}

/* =============================================
   DARK MODE — td.td-num
   ============================================= */
:root.dark td.td-num {
  color: #475569;
}

/* =============================================
   DARK MODE — Empty State
   ============================================= */
:root.dark .empty-state {
  color: #475569;
}

/* =============================================
   DARK MODE — Status Items
   ============================================= */
:root.dark .status-item {
  color: #64748b;
}

/* =============================================
   DARK MODE — jadwal cell off/gray
   ============================================= */
:root.dark .jadwal-cell.off {
  background: #263347;
  color: #64748b;
  border-color: #334155;
}

:root.dark .jadwal-cell.malam {
  background: rgba(109,40,217,.2);
  color: #c4b5fd;
  border-color: rgba(109,40,217,.35);
}

/* =============================================
   DARK MODE — Camera
   ============================================= */
:root.dark #camera-container {
  border-color: #334155;
}

/* Smooth transition for all theme changes */
body, body * {
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}

/* But exclude animated elements from slow transition */
.loading-spinner, @keyframes, .skeleton {
  transition: none !important;
}

/* =============================================
   MODERN BUTTON IMPROVEMENTS
   ============================================= */

/* Primary Button - Solid & Modern */
.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  border: none;
  border-radius: var(--r-md);
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-btn);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Secondary Button */
.btn-secondary {
  background: var(--gray-100);
  color: var(--text);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--r-md);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--gray-200);
  border-color: var(--gray-400);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* Success Button */
.btn-success {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: white;
  border: none;
  border-radius: var(--r-md);
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-btn);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-success:hover {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-success:active {
  transform: translateY(0);
}

/* Danger Button */
.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  border: none;
  border-radius: var(--r-md);
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-btn);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-danger:active {
  transform: translateY(0);
}

/* Small Button Variant */
.btn-sm {
  padding: 8px 12px;
  font-size: 0.75rem;
  border-radius: var(--r-sm);
}

/* Full Width Button */
.btn-full {
  width: 100%;
}

/* =============================================
   RESPONSIVE LAYOUT IMPROVEMENTS
   ============================================= */

/* Mobile First */
@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
    gap: 12px;
  }

  .page-header h2 {
    font-size: 1.3rem;
  }

  .page-header button {
    width: 100%;
  }

  .card {
    padding: 12px;
    margin-bottom: 12px;
  }

  .btn-primary, .btn-secondary, .btn-success, .btn-danger {
    width: 100%;
    justify-content: center;
  }

  /* Grid reduce columns on mobile */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Table responsive */
  table {
    font-size: 0.75rem;
  }

  th, td {
    padding: 8px 6px;
  }

  /* Modal responsive */
  .modal {
    margin: 16px;
  }

  /* Favorite buttons smaller */
  .fav-btn {
    padding: 12px 8px !important;
    font-size: 0.65rem !important;
  }

  .fav-btn i {
    font-size: 1.3rem !important;
  }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
  .card {
    padding: 14px;
  }

  [style*="grid-template-columns: repeat"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Desktop */
@media (min-width: 1025px) {
  .card {
    padding: 16px;
  }

  [style*="grid-template-columns: repeat(auto"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* =============================================
   BUTTON GROUP RESPONSIVE
   ============================================= */

.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .btn-group {
    flex-direction: column;
  }

  .btn-group button {
    width: 100%;
  }
}

/* =============================================
   FAVORITE MENU RESPONSIVE
   ============================================= */

.favorite-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .favorite-menu {
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }

  .favorite-menu button {
    padding: 10px 6px !important;
  }

  .favorite-menu button i {
    font-size: 1.3rem !important;
  }

  .favorite-menu button div:last-child {
    font-size: 0.6rem !important;
  }
}

/* =============================================
   MODAL RESPONSIVE
   ============================================= */

@media (max-width: 640px) {
  .modal-box {
    max-width: calc(100vw - 32px) !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-box textarea,
  .modal-box input {
    font-size: 16px !important; /* Prevent zoom on iOS */
  }
}

/* =============================================
   FILTER BAR RESPONSIVE
   ============================================= */

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

@media (max-width: 768px) {
  .filter-bar {
    flex-direction: column;
  }

  .filter-bar > div,
  .filter-bar button {
    width: 100%;
  }

  .filter-bar button {
    margin-top: 8px;
  }
}

/* =============================================
   FORM RESPONSIVE
   ============================================= */

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  transition: all 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

@media (max-width: 640px) {
  .field input,
  .field textarea,
  .field select {
    font-size: 16px; /* Prevent zoom */
  }
}

/* =============================================
   ICON + TEXT BUTTON
   ============================================= */

.btn-primary i,
.btn-secondary i,
.btn-success i,
.btn-danger i {
  font-size: 0.9rem;
}

.btn-sm i {
  font-size: 0.8rem;
}

/* =============================================
   UTILITY: FLEX RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
  [style*="display: flex"] {
    flex-wrap: wrap;
  }

  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}



/* ============================================================
   SIDEBAR CATEGORY TITLES & BADGES
   ============================================================ */

/* Judul kategori pemisah menu — Light Mode */
.sidebar-section-title {
  font-size: .63rem;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #334155;
  padding: 18px 16px 6px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(226,232,240,.6);
  user-select: none;
}

/* Dark Mode override — pakai :root.dark sesuai konvensi file ini */
html.dark .sidebar-section-title {
  color: rgba(255,255,255,.45);
  border-bottom-color: rgba(255,255,255,.05);
}

/* Badge info kecil di kanan teks menu */
.sidebar-badge-info {
  font-size: .58rem;
  background: rgba(37,99,235,.18);
  color: #3b82f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  margin-left: auto;
  letter-spacing: .5px;
  flex-shrink: 0;
}

html.dark .sidebar-badge-info {
  background: rgba(96,165,250,.15);
  color: #60a5fa;
}
