/* ============================================================
   IZIN MEROKOK DASHBOARD — PREMIUM RED THEME
   ============================================================ */

/* ===== CSS VARIABLES ===== */
:root {
  /* Red Palette */
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-200: #fecaca;
  --red-300: #fca5a5;
  --red-400: #f87171;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --red-800: #991b1b;
  --red-900: #7f1d1d;
  --red-950: #450a0a;

  /* Accent */
  --accent: #dc2626;
  --accent-light: #ef4444;
  --accent-dark: #991b1b;
  --accent-glow: rgba(220, 38, 38, 0.4);
  --accent-glow-strong: rgba(220, 38, 38, 0.7);

  /* Backgrounds */
  --bg-base: #0a0a0a;
  --bg-card: rgba(20, 20, 20, 0.85);
  --bg-card-hover: rgba(30, 30, 30, 0.9);
  --bg-header: rgba(15, 15, 15, 0.95);
  --bg-input: rgba(25, 25, 25, 0.9);
  --bg-modal: rgba(15, 15, 15, 0.97);
  --bg-overlay: rgba(0, 0, 0, 0.7);

  /* Text */
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #525252;
  --text-accent: #fca5a5;

  /* Borders */
  --border: rgba(220, 38, 38, 0.15);
  --border-hover: rgba(220, 38, 38, 0.35);
  --border-strong: rgba(220, 38, 38, 0.5);

  /* Misc */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(220, 38, 38, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.35) 50%, rgba(0,0,0,0.65) 100%),
    url('bg-dashboard.png');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--red-800);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--red-600);
}

/* ===== BLOCKED OVERLAY ===== */
.blocked-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.blocked-overlay.show {
  opacity: 1;
  visibility: visible;
}

.blocked-card {
  text-align: center;
  padding: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 60px rgba(220, 38, 38, 0.15);
  max-width: 420px;
  width: 90%;
}

.blocked-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 20px rgba(220, 38, 38, 0.5));
}

.blocked-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--red-300), var(--red-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.blocked-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.blocked-ip {
  font-family: monospace;
  color: var(--red-400) !important;
  font-weight: 600;
  margin-bottom: 20px !important;
}

.blocked-form {
  margin-top: 24px;
  text-align: left;
}

.blocked-form label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: block;
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--bg-header);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 20px;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  max-width: 1440px;
  margin: 20px auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.header-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--red-700), var(--red-900));
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.header-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fde68a, #f59e0b, #ef4444, #fde68a);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shineTitle 4s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5));
}

@keyframes shineTitle {
  0% { 
    background-position: 0% 50%; 
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5)); 
    transform: scale(1);
  }
  50% { 
    background-position: 100% 50%; 
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.8)) drop-shadow(0 0 30px rgba(239, 68, 68, 0.6)); 
    transform: scale(1.02);
  }
  100% { 
    background-position: 0% 50%; 
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5)); 
    transform: scale(1);
  }
}

.header-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.03em;
}

.heartbeat-logo {
  height: 60px;
  width: auto;
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.6)) drop-shadow(0 0 20px rgba(245, 158, 11, 0.4));
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.15); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  70% { transform: scale(1); }
  100% { transform: scale(1); }
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex: 1;
}

.header-center {
  text-align: center;
}

.live-clock {
  display: inline-block;
  line-height: 1;
}

/* ── Kontainer display ── */
.seg-display {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.55);
  padding: 8px 18px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 40, 40, 0.25);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.6), 0 0 20px rgba(220,38,38,0.2);
}

.seg-timer-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transform: scale(1.1);
}

/* Timer Idle (White) */
#timerContainer:not(.active):not(.warning):not(.overtime) .seg-timer-display .seg-on,
#timerContainer .seg-timer-display.idle .seg-on {
  background: #ffffff;
  box-shadow: 0 0 4px #ffffff, 0 0 10px rgba(255, 255, 255, 0.8), 0 0 15px rgba(255, 255, 255, 0.4);
}

/* Timer Active (Yellow) */
#timerContainer.active:not(.warning):not(.overtime) .seg-timer-display .seg-on {
  background: #facc15;
  box-shadow: 0 0 4px #facc15, 0 0 10px rgba(250, 204, 21, 0.8), 0 0 15px rgba(250, 204, 21, 0.4);
}

/* Timer Overtime (Red - default fallback if overtime) */
#timerContainer.overtime .seg-timer-display .seg-on {
  background: #ff2020;
  box-shadow: 0 0 4px #ff0000, 0 0 10px rgba(255, 0, 0, 0.8), 0 0 20px rgba(220, 38, 38, 0.5);
}

/* ── Satu digit ── */
.seg-digit {
  position: relative;
  width: 22px;
  height: 42px;
}

/* ── Semua segmen: default = mati (dim) ── */
.seg {
  position: absolute;
  background: rgba(180, 20, 20, 0.13);
  border-radius: 2px;
  transition: background 0.06s, box-shadow 0.06s;
}

/* ── Segmen horizontal (a, d, g) ── */
.seg-a, .seg-d, .seg-g {
  left: 3px;
  width: 16px;
  height: 4px;
}
.seg-a { top: 0; }
.seg-g { top: 19px; }
.seg-d { bottom: 0; }

/* ── Segmen vertikal (b, c, e, f) ── */
.seg-b, .seg-c, .seg-e, .seg-f {
  width: 4px;
  height: 16px;
}
.seg-f { top: 2px;    left: 0; }
.seg-b { top: 2px;    right: 0; }
.seg-e { bottom: 2px; left: 0; }
.seg-c { bottom: 2px; right: 0; }

/* ── Segmen ON = menyala merah ── */
.seg-on {
  background: #ff2020;
  box-shadow:
    0 0 4px #ff0000,
    0 0 10px rgba(255, 0, 0, 0.8),
    0 0 20px rgba(220, 38, 38, 0.5);
}

/* ── Titik dua (colon) ── */
.seg-colon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding-bottom: 2px;
}

.seg-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ff2020;
  box-shadow: 0 0 5px #ff0000, 0 0 12px rgba(255,0,0,0.7);
  animation: seg-blink 1s step-end infinite;
}

@keyframes seg-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.08; }
}

.live-date {
  font-size: 0.78rem;
  font-weight: 500;
  color: #a3a3a3;
  margin-top: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

/* ===== TICKER BERJALAN ===== */
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.ticker-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 6px 28px;
  position: sticky;
  top: 60px;
  z-index: 90;
  pointer-events: none;
}

.ticker-bar {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1440px;
  background: linear-gradient(90deg, #7f1d1d 0%, #dc2626 30%, #991b1b 70%, #7f1d1d 100%);
  border: 1px solid rgba(255, 100, 100, 0.35);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(220, 38, 38, 0.55), inset 0 1px 0 rgba(255,255,255,0.06);
  height: 36px;
  overflow: hidden;
  pointer-events: all;
}

.ticker-icon {
  flex-shrink: 0;
  padding: 0 14px;
  font-size: 1rem;
  background: rgba(0,0,0,0.25);
  height: 100%;
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(255,255,255,0.15);
  animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

.ticker-track {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.ticker-content {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-scroll 28s linear infinite;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fde68a;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(253, 230, 138, 0.6), 0 1px 3px rgba(0,0,0,0.5);
  text-transform: uppercase;
  padding-left: 100%;
}

.ticker-bar:hover .ticker-content {
  animation-play-state: paused;
}

.btn-admin {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--red-700), var(--red-900));
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.2);
}

.btn-admin:hover {
  background: linear-gradient(135deg, var(--red-600), var(--red-800));
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

.admin-icon {
  font-size: 1rem;
}

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  grid-template-rows: auto auto;
  gap: 20px;
  padding: 20px 28px 40px;
  max-width: 1440px;
  margin: 0 auto;
}

/* ===== CARDS ===== */
.card {
  background: rgba(35, 35, 35, 0.85); /* Lebih terang */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.5s ease-out both;
}

.card:hover {
  border-color: rgba(239, 68, 68, 0.8); /* Garis merah menyala */
  box-shadow: var(--shadow), 0 0 30px rgba(239, 68, 68, 0.5), inset 0 0 15px rgba(239, 68, 68, 0.15); /* Efek berlampu */
  transform: translateY(-2px);
}

.card-ambil { animation-delay: 0.05s; }
.card-aktif { animation-delay: 0.1s; }
.card-riwayat { animation-delay: 0.15s; }
.card-staff { animation-delay: 0.2s; }

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

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.06), transparent);
}

.card-icon {
  font-size: 1.1rem;
}

.card-header h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  flex: 1;
}

.card-body {
  padding: 20px;
}

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  background: linear-gradient(135deg, var(--red-600), var(--red-800));
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50px;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

/* ===== ROLE BADGE ===== */
.role-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-badge.cs {
  background: rgba(220, 38, 38, 0.15);
  color: var(--red-400);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.role-badge.kasir {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.role-badge.admin {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.role-badge.spv {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.role-badge.kapten {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

/* ===== KATEGORI IZIN BADGE ===== */
.kategori-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.kategori-badge.kategori-merokok {
  background: rgba(220, 38, 38, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(220, 38, 38, 0.4);
}

.kategori-badge.kategori-bab {
  background: rgba(20, 184, 166, 0.18);
  color: #5eead4;
  border: 1px solid rgba(20, 184, 166, 0.4);
}

/* ===== CIRCULAR TIMER ===== */
.timer-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 10px auto 24px;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 15px rgba(220, 38, 38, 0.2));
}

.timer-bg {
  fill: none;
  stroke: rgba(220, 38, 38, 0.1);
  stroke-width: 8;
}

.timer-ring {
  fill: none;
  stroke: url(#timerGradient);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.timer-value {
  font-size: 2.5rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  line-height: 1;
}

.timer-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.timer-staff {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-top: 2px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Timer Active State */
.timer-container.active .timer-svg {
  filter: drop-shadow(0 0 25px rgba(220, 38, 38, 0.5));
}

.timer-container.active .timer-value {
  color: var(--accent-light);
  text-shadow: 0 0 20px rgba(220, 38, 38, 0.5);
}

.timer-container.active {
  animation: timerPulse 2s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* Timer Warning (under 5 minutes) */
.timer-container.warning .timer-value {
  color: #f59e0b !important;
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.5) !important;
  animation: timerBlink 1s ease-in-out infinite;
}

.timer-container.warning .timer-ring {
  stroke: #f59e0b;
}

/* Timer Overtime */
.timer-container.overtime .timer-value {
  color: var(--red-500) !important;
  text-shadow: 0 0 25px rgba(220, 38, 38, 0.7) !important;
  animation: timerBlink 0.5s ease-in-out infinite;
}

@keyframes timerBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.label-icon {
  font-size: 0.85rem;
}

.form-select,
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-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='%23a3a3a3' stroke-width='2' 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 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-select option {
  background: #1a1a1a;
  color: var(--text-primary);
}

.form-select:focus,
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-select:hover,
.form-input:hover {
  border-color: var(--border-hover);
}

.form-select-sm {
  padding: 8px 12px;
  font-size: 0.82rem;
}

/* ===== BUTTONS ===== */
.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  flex: 1;
  letter-spacing: 0.01em;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red-600), var(--red-700));
  color: white;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--red-500), var(--red-600));
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.45);
  transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-danger {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
  color: white;
  box-shadow: 0 4px 15px rgba(127, 29, 29, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  box-shadow: 0 6px 20px rgba(127, 29, 29, 0.5);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
  flex: none;
}

.btn-end {
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--red-700), var(--red-900));
  color: white;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-end:hover {
  background: linear-gradient(135deg, var(--red-600), var(--red-800));
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
  transform: translateY(-1px);
}

.btn-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(220, 38, 38, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-refresh:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-icon-delete {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(220, 38, 38, 0.15);
  color: var(--red-400);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
}

.btn-icon-delete:hover {
  background: rgba(220, 38, 38, 0.3);
  border-color: var(--red-500);
  transform: scale(1.1);
}

/* ===== TOGGLE SWITCH ===== */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  display: inline-block;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--text-muted);
  border-radius: 50px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--red-500), var(--red-700));
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* ===== IP TOGGLE ROW ===== */
.ip-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 4px;
}

.ip-toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== SETTINGS ===== */
.settings-group {
  margin-bottom: 0;
}

.settings-group .admin-form-row {
  margin-top: 8px;
}

/* ===== TABLES ===== */
.table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 320px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

.table th {
  padding: 10px 8px;
  text-align: left;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(20, 20, 20, 0.95);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(220, 38, 38, 0.06);
  font-weight: 500;
  vertical-align: middle;
}

.table tbody tr {
  transition: var(--transition);
}

.table tbody tr:hover:not(.empty-row) {
  background: rgba(220, 38, 38, 0.05);
}

.table .empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 14px;
  font-style: italic;
}

.table .staff-name {
  font-weight: 700;
  color: var(--text-primary);
}

.table .durasi {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.table .durasi.overtime {
  color: var(--red-500);
  font-weight: 800;
}

.table .aksi-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  background: var(--bg-modal);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(220, 38, 38, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), transparent);
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(220, 38, 38, 0.25);
  color: var(--text-primary);
  border-color: var(--accent);
}

/* ===== MODAL TABS ===== */
.modal-tabs {
  display: flex;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.5);
  overflow-x: auto;
}

.tab-btn {
  padding: 14px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.tab-content.active {
  display: block;
}

/* ===== ADMIN FORM ===== */
.admin-form {
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(220, 38, 38, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.admin-form h3 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.admin-form-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-form-row .form-input,
.admin-form-row .form-select {
  flex: 1;
  padding: 10px 14px;
  font-size: 0.82rem;
}

.ip-info {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  padding: 6px 12px;
  background: rgba(220, 38, 38, 0.08);
  border-radius: var(--radius-xs);
  display: inline-block;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  color: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  max-width: 360px;
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.toast.success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.9), rgba(22, 163, 74, 0.9));
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.toast.error {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.9), rgba(185, 28, 28, 0.9));
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.toast.info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.9));
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.toast.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.9));
  border: 1px solid rgba(245, 158, 11, 0.3);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(50px) scale(0.9);
  }
}

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

  .header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

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

  .live-clock {
    font-size: 1.2rem;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 13px;
  }

  .header-left {
    order: 1;
    flex: 1;
  }

  .header-center {
    order: 3;
    width: 100%;
  }

  .header-right {
    order: 2;
  }

  .btn-row {
    flex-direction: column;
  }

  .admin-form-row {
    flex-direction: column;
  }

  .modal {
    width: 95%;
    max-height: 90vh;
  }

  .modal-tabs {
    padding: 0 12px;
  }

  .tab-btn {
    padding: 12px 14px;
    font-size: 0.78rem;
  }
}
