/* ===================================================================
   ZK-ATTEND PRO - PREMIUM MODERN DESIGN SYSTEM
   Bespoke Vanilla CSS - Glassmorphism, Micro-animations, Dark Theme
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Option 2: Corporate Midnight Navy & Rich Color Accents */
  --bg-dark: #090d16;
  --bg-surface: #0e1424;
  --bg-card: #111828;
  --bg-card-hover: #162035;
  --border-subtle: #1c283f;
  --border-focus: #3b82f6;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-gradient: #2563eb;
  --accent-glow: rgba(37, 99, 235, 0.25);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --orange: #f97316;
  --orange-bg: rgba(249, 115, 22, 0.12);
  --sky: #0ea5e9;
  --sky-bg: rgba(14, 165, 233, 0.12);

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --sidebar-width: 250px;
  --header-height: 64px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 8px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.65);
  --shadow-glow: none;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Mode Overrides */
[data-theme="light"] {
  --bg-dark: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(248, 250, 252, 1);
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(255, 255, 255, 0.3);
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* Ambient Radial Glows in background */
.bg-ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  background: none; display: none;
}

/* Main App Shell Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ==========================================
   SIDEBAR NAVIGATION
   ========================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  backdrop-filter: none;
  transition: var(--transition);
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.brand-info h1 {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 0 0 2px 0;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-info span {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.sidebar-nav {
  padding: 20px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(37, 99, 235, 0.32);
  border-left: 3px solid #2563eb;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Sidebar Footer Device Status Card */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
}

.device-mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.device-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.device-name-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
}

.status-indicator.online {
  background: var(--success-bg);
  color: var(--success);
}

.status-indicator.offline {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-indicator.simulation {
  background: var(--warning-bg);
  color: var(--warning);
}

.pulsing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
}

.status-indicator.online .pulsing-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.7;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

.device-ip-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
  max-width: calc(100vw - var(--sidebar-width));
  overflow-x: hidden;
  transition: margin-left 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sidebar collapsed / Full Page mode */
body.sidebar-collapsed {
  --sidebar-width: 72px;
}
body.sidebar-collapsed .sidebar {
  width: 72px;
}
body.sidebar-collapsed .sidebar .brand-info,
body.sidebar-collapsed .sidebar .nav-item span,
body.sidebar-collapsed .sidebar-footer {
  display: none !important;
}
body.sidebar-collapsed .sidebar .nav-item {
  justify-content: center;
  padding: 12px 0;
}
body.sidebar-collapsed .main-content {
  margin-left: 72px;
  width: calc(100% - 72px);
  max-width: calc(100vw - 72px);
}

/* Top App Header */
.top-header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: none;
}

.header-title-area h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-title-area p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================
   BUTTONS & CONTROLS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-main);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #1d4ed8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1e40af;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .btn-secondary {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #334155;
  color: #ffffff;
  border-color: #475569;
}

.btn-success {
  background: #10b981; border-color: #059669;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.btn-danger {
  background: #ef4444; border-color: #dc2626;
  color: #ffffff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-icon-only {
  padding: 9px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-icon-only:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.spinning {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================
   VIEW SECTIONS (TABS)
   ========================================== */
.view-section {
  display: none;
  padding: 24px 28px;
  animation: fadeIn 0.3s ease;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   KPI STATS GRID
   ========================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 12px !important;
  padding: 16px 18px !important;
  backdrop-filter: none !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 106px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  overflow: hidden !important;
}

.stat-card:hover {
  border-color: rgba(148, 163, 184, 0.35) !important;
  box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04) !important;
  transform: translateY(-2px) !important;
}

/* NO rainbow top strips */
.stat-card::before {
  display: none !important;
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.stat-card-header .stat-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.stat-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.stat-card:hover .stat-icon-wrapper {
  transform: scale(1.08);
}

.stat-info {
  margin: 6px 0 4px;
}

.stat-info p {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.stat-info h3 {
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--text-main);
  margin: 0;
}

.stat-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.stat-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.02em;
}

/* Executive Accent Hierarchy - Clean Solid Cards (No Pastels) */
/* Clean Neutral Stat Card Icons & Subtle Metadata Badges */
.stat-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
}
[data-theme="dark"] .stat-icon-wrapper {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
}

.stat-badge {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted) !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.stat-staff .stat-icon-wrapper { color: #2563eb; }
.stat-present .stat-icon-wrapper { color: #10b981; }
.stat-present .stat-info h3 { color: #059669 !important; }
.stat-late .stat-icon-wrapper { color: #f59e0b; }
.stat-late .stat-info h3 { color: #d97706 !important; }
.stat-halfday .stat-icon-wrapper { color: #f97316; }
.stat-halfday .stat-info h3 { color: #ea580c !important; }
.stat-absent .stat-icon-wrapper { color: #ef4444; }
.stat-absent .stat-info h3 { color: #dc2626 !important; }
/* ==========================================
   CARDS & PANELS
   ========================================== */
.card-panel {
  border-top: 1px solid #283754;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: none;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.panel-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================
   TABLES
   ========================================== */
.table-responsive {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) rgba(255, 255, 255, 0.04);
  -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
  height: 7px;
}
.table-responsive::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.custom-table thead tr {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
}

.custom-table th {
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.custom-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.custom-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.custom-table td {
  padding: 10px 14px;
  color: var(--text-main);
  vertical-align: middle;
  white-space: nowrap;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Executive Linear/Stripe Status Badges: Neutral Tag with Crisp Solid Dot */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
}

[data-theme="dark"] .badge {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

.badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-present::before { background: #10b981; }
.badge-late::before    { background: #f59e0b; }
.badge-halfday::before { background: #f97316; }
.badge-absent::before  { background: #ef4444; }
.badge-weekend::before { background: #94a3b8; }
.badge-upcoming::before{ background: #94a3b8; }
.badge-leave::before   { background: #9333ea; }

.badge:not([class*="badge-"])::before {
  display: none !important;
}

/* 4-Interval Attendance Punch Pills */
/* Tabular Crisp Monospace Punches - Zero Rainbow Boxes */
.punch-pill {
  display: inline-block;
  padding: 2px 4px;
  background: transparent !important;
  border: none !important;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.punch-pill.pill-in {
  color: #059669 !important;
}
.punch-pill.pill-in-late {
  color: #d97706 !important;
}
.punch-pill.pill-bout {
  color: #ea580c !important;
}
.punch-pill.pill-bin {
  color: #0284c7 !important;
}
.punch-pill.pill-out {
  color: #2563eb !important;
}

[data-theme="dark"] .punch-pill.pill-in {
  color: #34d399 !important;
}
[data-theme="dark"] .punch-pill.pill-in-late {
  color: #fbbf24 !important;
}
[data-theme="dark"] .punch-pill.pill-bout {
  color: #fb923c !important;
}
[data-theme="dark"] .punch-pill.pill-bin {
  color: #38bdf8 !important;
}
[data-theme="dark"] .punch-pill.pill-out {
  color: #60a5fa !important;
}

/* Avatar with Initials */
.user-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2563eb;
  border: 1px solid #1d4ed8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.user-details .user-name {
  font-weight: 600;
  color: var(--text-main);
}

.user-details .user-sub {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

/* ==========================================
   INPUTS, SELECTS & CONTROLS
   ========================================== */
.form-input, .form-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-help {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==========================================
   MONTHLY MATRIX GRID
   ========================================== */
.matrix-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.matrix-table th, .matrix-table td {
  padding: 6px 3px;
  text-align: center;
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.matrix-table th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 700;
  color: var(--text-secondary);
}

.matrix-table .th-fixed {
  text-align: left;
  padding: 10px 14px;
  min-width: 160px;
}

.matrix-cell-badge {
  display: inline-block;
  width: 26px;
  height: 26px;
  line-height: 26px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.72rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.matrix-cell-badge:hover {
  transform: scale(1.2);
}

/* ==========================================
   DEVICE DIAGNOSTICS & HARDWARE CONTROLS
   ========================================== */
.device-diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.diag-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.diag-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.diag-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* Toggle Switch */
.switch-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* ==========================================
   MODAL DIALOGS
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
  z-index: 1001;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.3rem;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
}

/* ==========================================
   TOAST ALERTS
   ========================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  min-width: 300px;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-info { border-left: 4px solid var(--primary); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .sidebar {
    width: 72px;
  }
  .sidebar .brand-info,
  .sidebar .nav-item span,
  .sidebar-footer {
    display: none;
  }
  .main-content {
    margin-left: 72px;
  }
  .top-header {
    padding: 0 16px;
  }
  .view-section {
    padding: 16px;
  }
}

/* ==========================================
   LEAVES & PAYROLL ADDITIONS
   ========================================== */
.badge-leave {
  background: rgba(139, 92, 246, 0.16);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Payslip Modal Special Styling */
.modal-payslip-dialog {
  max-width: 680px;
  background: var(--bg-surface);
}

.payslip-paper {
  background: #ffffff;
  color: #0f172a;
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-family: 'Inter', sans-serif;
}

.payslip-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.payslip-company-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.payslip-sub {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.payslip-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 0.84rem;
}

.payslip-meta-row {
  display: flex;
  justify-content: space-between;
}

.payslip-meta-label {
  color: #64748b;
  font-weight: 500;
}

.payslip-meta-val {
  font-weight: 700;
  color: #0f172a;
}

.payslip-breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.payslip-col-box {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.payslip-col-header {
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.payslip-earnings-header {
  background: #ecfdf5;
  color: #065f46;
  border-bottom: 1px solid #a7f3d0;
}

.payslip-deductions-header {
  background: #fff1f2;
  color: #9f1239;
  border-bottom: 1px solid #fecdd3;
}

.payslip-line-item {
  display: flex;
  justify-content: space-between;
  padding: 7px 14px;
  font-size: 0.82rem;
  border-bottom: 1px solid #f1f5f9;
}

.payslip-net-box {
  background: #064e3b;
  color: #ffffff;
  border-radius: 8px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.payslip-net-label {
  font-size: 0.95rem;
  font-weight: 600;
}

.payslip-net-amount {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.payslip-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 14px;
}

.sig-box {
  border-top: 1px solid #94a3b8;
  width: 170px;
  text-align: center;
  font-size: 0.76rem;
  color: #475569;
  font-weight: 600;
  padding-top: 6px;
}

/* ==========================================
   DAY-WISE SHIFT SCHEDULE & SETTINGS STYLES
   ========================================== */
.shift-mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

@media (max-width: 768px) {
  .shift-mode-selector {
    grid-template-columns: 1fr;
  }
}

.shift-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.shift-mode-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.shift-mode-card.active {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--primary);
  box-shadow: 0 0 20px transparent;
}

.shift-mode-radio {
  margin-top: 3px;
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.shift-mode-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.shift-mode-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.shift-presets-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.05);
  border: 1px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}

.btn-preset {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-preset:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.day-schedule-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}

.day-schedule-table th {
  background: #1e3a8a !important;
  color: #ffffff !important;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  border-bottom: 2px solid #3b82f6 !important;
  text-align: left;
}

[data-theme="light"] .day-schedule-table th {
  background: #bfd6f9 !important;
  color: #0f172a !important;
  border-bottom: 2px solid #93c5fd !important;
}

.day-schedule-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.day-schedule-row {
  transition: all 0.2s ease;
}

.day-schedule-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.day-schedule-row.is-off {
  background: rgba(0, 0, 0, 0.18);
  opacity: 0.55;
}

.day-schedule-row.is-off .form-input {
  background: rgba(255, 255, 255, 0.02) !important;
  color: var(--text-muted) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  cursor: not-allowed;
}

/* Tabular Clean Hours - Zero Pastel Green */
.badge-hours {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-mono);
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
}

[data-theme="dark"] .badge-hours {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

.badge-hours.is-off {
  background: transparent !important;
  color: var(--text-muted) !important;
  border-color: transparent !important;
  font-weight: 500;
}

.badge-break-dur {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 3px;
  display: block;
}

.day-toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.day-toggle-switch input {
  display: none;
}

.day-toggle-slider {
  width: 38px;
  height: 20px;
  background-color: #334155;
  border-radius: 20px;
  position: relative;
  transition: 0.25s;
}

.day-toggle-slider:before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.25s;
}

.day-toggle-switch input:checked + .day-toggle-slider {
  background-color: #10b981;
}

.day-toggle-switch input:checked + .day-toggle-slider:before {
  transform: translateX(18px);
}

/* ==========================================
   PRINT STYLES (@media print) - PROPORTIONAL EXECUTIVE FIT & AMPLE SIGNATURE SPACE
   ========================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 10mm 8mm 10mm;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 1. COMPLETELY HIDE background portal layout, sidebar, tables, cards, toolbars & buttons */
  .app-container,
  .main-wrapper,
  .main-content,
  .sidebar,
  .top-header,
  .bg-ambient-glow,
  .toast-container,
  #view-login,
  .modal-header,
  .modal-footer,
  .modal-close,
  button,
  .btn,
  .modal-overlay:not(.open) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
  }

  /* 2. SINGLE PAYSLIP PRINTING (Enforce strictly 1 Single Page) */
  body:not(.batch-printing) {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
  }

  body:not(.batch-printing) .modal-overlay.open#modal-payslip {
    position: static !important;
    display: block !important;
    visibility: visible !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 999999 !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
    break-after: avoid !important;
    break-inside: avoid !important;
  }

  body:not(.batch-printing) .modal-overlay.open#modal-payslip .modal-dialog {
    box-shadow: none !important;
    border: none !important;
    max-width: 690px !important;
    width: 95% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    transform: none !important;
    background: transparent !important;
    display: block !important;
    visibility: visible !important;
  }

  body:not(.batch-printing) .modal-overlay.open#modal-payslip .modal-body {
    padding: 0 !important;
    margin: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
    visibility: visible !important;
  }

  body:not(.batch-printing) #modal-payslip .payslip-paper {
    box-shadow: none !important;
    border: 1.5px solid #0f172a !important;
    border-radius: 10px !important;
    padding: 16px 22px !important;
    margin: 2mm auto 0 auto !important;
    width: 95% !important;
    max-width: 690px !important;
    background: #ffffff !important;
    display: block !important;
    visibility: visible !important;
    box-sizing: border-box !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
    break-after: avoid !important;
    break-inside: avoid !important;
  }

  /* Executive typography and generous signature space */
  .payslip-paper {
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  .payslip-header {
    border-bottom: 2px solid #0f172a !important;
    padding-bottom: 10px !important;
    margin-bottom: 12px !important;
  }

  .payslip-company-title {
    font-size: 1.3rem !important;
  }

  .payslip-sub {
    font-size: 0.70rem !important;
    white-space: normal !important;
    max-width: 300px !important;
    line-height: 1.25 !important;
    margin-top: 3px !important;
  }

  .payslip-meta-grid {
    gap: 8px !important;
    padding: 8px 14px !important;
    margin-bottom: 12px !important;
    font-size: 0.78rem !important;
  }

  .payslip-stat-grid {
    margin-bottom: 12px !important;
    gap: 6px !important;
  }

  .payslip-stat-grid > div {
    padding: 6px 4px !important;
  }

  .payslip-breakdown-grid {
    gap: 14px !important;
    margin-bottom: 14px !important;
  }

  .payslip-col-header {
    padding: 6px 12px !important;
    font-size: 0.76rem !important;
  }

  .payslip-line-item {
    padding: 5px 12px !important;
    font-size: 0.76rem !important;
  }

  .payslip-net-box {
    padding: 12px 18px !important;
    margin-bottom: 14px !important;
    border-radius: 8px !important;
  }

  .payslip-net-label {
    font-size: 0.85rem !important;
  }

  .payslip-net-amount {
    font-size: 1.45rem !important;
  }

  /* AMPLE ROOM FOR OFFICIAL SIGNATURES & STAMPS (38px vertical signing space) */
  .payslip-signatures {
    display: flex !important;
    justify-content: space-between !important;
    margin-top: 38px !important;
    padding-top: 0 !important;
  }

  .sig-box {
    border-top: 1.5px solid #475569 !important;
    width: 185px !important;
    font-size: 0.72rem !important;
    color: #334155 !important;
    font-weight: 600 !important;
    padding-top: 6px !important;
    text-align: center !important;
  }

  .payslip-disclaimer {
    margin-top: 14px !important;
    padding-top: 8px !important;
    font-size: 0.65rem !important;
    line-height: 1.3 !important;
  }

  /* When printing single payslip, strictly suppress batch container */
  body:not(.batch-printing) #batch-payslips-print-container {
    display: none !important;
    visibility: hidden !important;
  }

  /* 3. BATCH PRINTING (All Slips in clean succession on separate pages) */
  body.batch-printing .modal-overlay {
    display: none !important;
    visibility: hidden !important;
  }

  body.batch-printing #batch-payslips-print-container {
    display: block !important;
    visibility: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  body.batch-printing .batch-slip-page {
    display: block !important;
    visibility: visible !important;
    page-break-after: always !important;
    page-break-inside: avoid !important;
    break-after: page !important;
    break-inside: avoid !important;
    margin: 0 0 10mm 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  body.batch-printing .batch-slip-page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
    margin-bottom: 0 !important;
  }

  body.batch-printing .batch-slip-page .payslip-paper {
    box-shadow: none !important;
    border: 1.5px solid #0f172a !important;
    border-radius: 10px !important;
    padding: 16px 22px !important;
    margin: 2mm auto 0 auto !important;
    width: 95% !important;
    max-width: 690px !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}

/* ==========================================
   PERSONNEL MODULE STYLES (ZKTeco Pro Layout)
   ========================================== */

/* Subnav switcher */
.personnel-subnav {
  display: flex;
  gap: 8px;
  background: var(--bg-card);
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.personnel-subnav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.personnel-subnav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.personnel-subnav-btn.active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

/* ZK Toolbar */
.zk-toolbar {
  display: flex;
  gap: 8px;
  background: var(--bg-card);
  padding: 10px 14px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  flex-wrap: wrap;
  align-items: center;
}

.zk-tool-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.zk-tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
}

.zk-tool-btn.btn-primary-action {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
}

.zk-tool-btn.btn-primary-action:hover {
  background: #059669;
}

/* Split Pane Layout */
.personnel-split-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  min-height: 620px;
}

@media (max-width: 900px) {
  .personnel-split-layout {
    grid-template-columns: 1fr;
  }
}

/* Left Employee List */
.zk-list-pane {
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.12);
}

.zk-search-box {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.zk-search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 0.82rem;
  color: var(--text-main);
  outline: none;
}

.zk-emp-table-container {
  flex: 1;
  overflow-y: auto;
  max-height: 560px;
}

.zk-emp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.zk-emp-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 10px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 2;
}

.zk-emp-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  user-select: none;
}

.zk-emp-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.zk-emp-table tr.selected td {
  background: rgba(59, 130, 246, 0.15) !important;
}

/* Right Workstation Pane */
.zk-form-pane {
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Tabs: General, Private Detail, Pay Details */
.zk-nav-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 20px;
}

.zk-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  padding: 8px 18px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.zk-tab-btn:hover {
  color: var(--text-main);
}

.zk-tab-btn.active {
  color: #10b981;
  border-bottom-color: #10b981;
}

/* Fieldset / Box */
.zk-fieldset {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px 20px 20px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.01);
}

.zk-fieldset legend {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Form Row Grid */
.zk-form-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
}

@media (max-width: 1050px) {
  .zk-form-grid {
    grid-template-columns: 1fr;
  }
}

.zk-field-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 11px;
}

.zk-field-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: right;
}

.zk-field-label.required:after {
  content: " *";
  color: #ef4444;
  font-weight: 700;
}

.zk-field-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.84rem;
  color: var(--text-main);
  outline: none;
  width: 100%;
}

.zk-field-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Photo Box 200x200 */
.zk-photo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.zk-photo-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.zk-photo-wrapper {
  display: flex;
  gap: 8px;
}

.zk-photo-box {
  width: 170px;
  height: 170px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  position: relative;
}

.zk-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.zk-photo-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zk-photo-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zk-photo-btn:hover {
  color: var(--text-main);
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

/* Biometric Credentials Grid */
.zk-bio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 28px;
  padding-top: 10px;
}

@media (max-width: 768px) {
  .zk-bio-grid {
    grid-template-columns: 1fr;
  }
}

.zk-bio-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 10px;
}

.zk-fp-icon-btn {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: all 0.2s ease;
}

.zk-fp-icon-btn:hover {
  transform: scale(1.08);
  background: rgba(16, 185, 129, 0.28);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* ==========================================
   ENROLL FINGERPRINT MODAL (ZKTeco Hardware Style)
   ========================================== */
.modal-zk-header {
  background: #16a34a !important;
  color: #ffffff !important;
  padding: 12px 18px !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-zk-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-zk-header .modal-close {
  color: #ffffff !important;
  font-size: 1.4rem;
  opacity: 0.85;
}

.modal-zk-header .modal-close:hover {
  opacity: 1;
}

/* Interactive Hands Container */
.hands-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  padding: 20px 10px 10px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.hand-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.hand-box-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hand-svg {
  width: 200px;
  height: 240px;
  cursor: default;
}

.finger-target {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.finger-target path {
  transition: fill 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease, filter 0.2s ease;
}

.finger-target circle {
  transition: fill 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease;
}

/* Hover on finger */
.finger-target:hover path {
  fill: #e0e7ff !important;
  stroke: #3b82f6 !important;
  stroke-width: 2px !important;
}

.finger-target:hover circle {
  fill: #3b82f6 !important;
  stroke: #4338ca !important;
  stroke-width: 2.5px !important;
}

.finger-target:hover text {
  fill: #ffffff !important;
}

/* Active Enrolling Finger Highlight (Vibrant Glowing Blue/Indigo) */
.finger-target.active-enrolling path {
  fill: #c7d2fe !important;
  stroke: #4f46e5 !important;
  stroke-width: 3px !important;
  filter: drop-shadow(0 0 10px rgba(79, 70, 229, 0.85));
}

.finger-target.active-enrolling circle {
  transform-box: fill-box;
  transform-origin: center;
  fill: #4f46e5 !important;
  stroke: #312e81 !important;
  stroke-width: 3px !important;
  animation: pulse-active-finger 1.2s infinite ease-in-out;
}

.finger-target.active-enrolling text {
  fill: #ffffff !important;
  font-weight: 900 !important;
}

/* Active Deleting Finger Highlight (Red Glowing Warning) */
.finger-target.active-deleting path {
  fill: #fee2e2 !important;
  stroke: #ef4444 !important;
  stroke-width: 3px !important;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.7));
}

.finger-target.active-deleting circle {
  transform-box: fill-box;
  transform-origin: center;
  fill: #ef4444 !important;
  stroke: #b91c1c !important;
  stroke-width: 3px !important;
}

.finger-target.active-deleting text {
  fill: #ffffff !important;
  font-weight: 900 !important;
}

@keyframes pulse-active-finger {
  0%, 100% {
    transform: scale(1);
    stroke-width: 2.5px;
  }
  50% {
    transform: scale(1.22);
    stroke-width: 4px;
    filter: drop-shadow(0 0 12px rgba(79, 70, 229, 0.9));
  }
}

.finger-badge-enrolled {
  filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.5));
  animation: pulse-fp 2s infinite ease-in-out;
}

@keyframes pulse-fp {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ==========================================
   SYSTEM MODULE STYLES (ZKBioTime.Net Layout)
   ========================================== */

.system-subnav {
  display: flex;
  gap: 12px;
  background: var(--bg-card);
  padding: 8px 16px 0;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--border-subtle);
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.system-subnav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px 14px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  position: relative;
  min-width: 95px;
  transition: all 0.2s ease;
}

.system-subnav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.system-subnav-btn.active {
  color: #84cc16;
}

.system-subnav-btn.active svg {
  stroke: #84cc16;
}

.system-subnav-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 8px;
  right: 8px;
  height: 3px;
  background: #84cc16;
  border-radius: 3px 3px 0 0;
  box-shadow: 0 0 8px rgba(132, 204, 22, 0.5);
}

.system-subnav-btn.active::before {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid #84cc16;
}

/* Split Column Layout for User and Role */
.system-split-view {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  min-height: 480px;
}

.system-left-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.system-left-header {
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.system-item-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}

.system-list-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.system-list-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.system-list-item.selected {
  background: rgba(132, 204, 22, 0.14) !important;
  color: var(--text-main) !important;
  font-weight: 600;
  border-left: 4px solid #84cc16;
}

.system-right-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}

.system-toolbar {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  align-items: center;
}

.system-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.system-tool-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.system-tool-btn.primary {
  background: #84cc16;
  color: #0f172a;
  border-color: #84cc16;
}

.system-tool-btn.primary:hover {
  background: #65a30d;
}

.system-form-body {
  padding: 24px;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.system-field-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: flex-start;
  gap: 16px;
}

.system-field-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding-top: 8px;
}

.system-field-label.required::after {
  content: ' *';
  color: #ef4444;
}

.system-checklist-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.system-checklist-box label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.86rem;
}

/* ZKBioTime.Net Green Button */
.zk-green-btn {
  background: #84cc16;
  color: #0f172a;
  font-weight: 700;
  padding: 9px 24px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(132, 204, 22, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.88rem;
}

.zk-green-btn:hover {
  background: #65a30d;
  color: #ffffff;
  transform: translateY(-1px);
}

.zk-green-btn-lg {
  background: #84cc16;
  color: #0f172a;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  min-width: 220px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(132, 204, 22, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.zk-green-btn-lg:hover {
  background: #65a30d;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Config subtabs & sections */
.system-config-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.system-section-card {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.015);
}

.system-section-title {
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 6px;
}

.system-subtab-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}

.system-subtab-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.system-subtab-btn.active {
  color: #84cc16;
  border-bottom-color: #84cc16;
}




/* ==========================================
   GLOBAL ACTIVE MONTH NAVIGATOR WIDGET
   ========================================== */
.global-month-bar {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px 8px;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-month-nav {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.72rem;
  transition: var(--transition);
}

.btn-month-nav:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

.global-month-display {
  display: flex;
  align-items: center;
  gap: 6px;
}

.global-month-icon {
  font-size: 0.95rem;
  margin-right: 2px;
}

.global-month-select, .global-year-select {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.global-month-select:focus, .global-year-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px transparent;
}

.global-month-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: var(--transition);
}

.global-month-status-pill.open {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.global-month-status-pill.open:hover {
  background: rgba(16, 185, 129, 0.22);
}

.global-month-status-pill.locked {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.global-month-status-pill.locked:hover {
  background: rgba(239, 68, 68, 0.24);
}

.global-month-status-pill .status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.global-month-status-pill.open .status-indicator-dot {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

.global-month-status-pill.locked .status-indicator-dot {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.8);
}

/* ==========================================
   EXECUTIVE DASHBOARD STYLES
   ========================================== */
.executive-hero-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* ===================================================================
   EXECUTIVE SEGMENTED STATUS FILTERS (STRIPE / LINEAR STYLE)
   =================================================================== */
.dash-filter-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

[data-theme="dark"] .dash-filter-pills {
  background: #0f172a;
  border-color: #1e293b;
}

.dash-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

[data-theme="dark"] .dash-pill-btn {
  color: #94a3b8;
}

.dash-pill-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #0f172a;
}

[data-theme="dark"] .dash-pill-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

.dash-pill-btn .pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 600;
  min-width: 18px;
}

[data-theme="dark"] .dash-pill-btn .pill-count {
  background: #1e293b;
  color: #94a3b8;
}

.dash-pill-btn .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-pill-btn .dot.dot-green { background: #10b981; }
.dash-pill-btn .dot.dot-amber { background: #f59e0b; }
.dash-pill-btn .dot.dot-cyan  { background: #06b6d4; }
.dash-pill-btn .dot.dot-purple { background: #8b5cf6; }
.dash-pill-btn .dot.dot-red   { background: #ef4444; }

.dash-pill-btn.active {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25) !important;
}

.dash-pill-btn.active .dot {
  background: #ffffff !important;
}

.dash-pill-btn.active .pill-count {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

.dash-pill-btn.pill-in-office.active {
  background: #059669 !important;
  border-color: #047857 !important;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25) !important;
}

.dash-pill-btn.pill-late.active {
  background: #d97706 !important;
  border-color: #b45309 !important;
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.25) !important;
}

.dash-pill-btn.pill-break.active {
  background: #0891b2 !important;
  border-color: #0e7490 !important;
  box-shadow: 0 1px 3px rgba(8, 145, 178, 0.25) !important;
}

.dash-pill-btn.pill-out.active {
  background: #7c3aed !important;
  border-color: #6d28d9 !important;
  box-shadow: 0 1px 3px rgba(124, 58, 237, 0.25) !important;
}

.dash-pill-btn.pill-absent.active {
  background: #dc2626 !important;
  border-color: #b91c1c !important;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.25) !important;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.dot-green { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }
.dot-amber { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }
.dot-cyan { background: #06b6d4; box-shadow: 0 0 6px rgba(6, 182, 212, 0.6); }
.dot-purple { background: #a855f7; box-shadow: 0 0 6px rgba(168, 85, 247, 0.6); }
.dot-red { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }

.payslip-stamp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1.5px solid #059669;
  color: #059669;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: none !important;
  background: #ecfdf5;
  white-space: nowrap;
  vertical-align: middle;
}


/* Royal Cobalt / Sapphire Blue Unified Action Buttons */
#btn-quick-punch {
  background: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
}
#btn-quick-punch svg {
  stroke: #ffffff !important;
}
#btn-quick-punch:hover {
  background: #1d4ed8 !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5) !important;
}

/* Machine Toolbar Buttons in Royal Cobalt */
#btn-device-sync-users,
#btn-device-push-users-tab,
#btn-sync-time,
#btn-restart-device {
  background: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
}
#btn-device-sync-users svg,
#btn-device-push-users-tab svg,
#btn-sync-time svg,
#btn-restart-device svg {
  stroke: #ffffff !important;
}
#btn-device-sync-users:hover,
#btn-device-push-users-tab:hover,
#btn-sync-time:hover,
#btn-restart-device:hover {
  background: #1d4ed8 !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45) !important;
}


/* Dedicated Royal Cobalt Theme Elements */
#btn-view-all-daily,
#btn-dash-early-off,
#pulse-month-name-badge {
  background: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
  font-weight: 600 !important;
}

#btn-view-all-daily:hover,
#btn-dash-early-off:hover {
  background: #1d4ed8 !important;
  border-color: #60a5fa !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5) !important;
  transform: translateY(-1px);
}

/* ===================================================================
   OPTION B: DEEP CHARCOAL / BLACK FILTER & RESET BUTTONS (LINEAR STYLE)
   =================================================================== */
#btn-apply-dw-filters {
  background: #0f172a !important;
  color: #ffffff !important;
  border: 1px solid #3b82f6 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25) !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}

#btn-apply-dw-filters:hover {
  background: #1e293b !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
  transform: translateY(-1px);
}

#btn-reset-dw-filters {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}

#btn-reset-dw-filters:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

/* Dark Mode Overrides for Option B Filter Buttons */
[data-theme="dark"] #btn-apply-dw-filters {
  background: #0a0e1a !important;
  color: #ffffff !important;
  border: 1px solid #3b82f6 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] #btn-apply-dw-filters:hover {
  background: #151d30 !important;
  border-color: #60a5fa !important;
}

[data-theme="dark"] #btn-reset-dw-filters {
  background: #111828 !important;
  color: #94a3b8 !important;
  border: 1px solid #1f2a40 !important;
}

[data-theme="dark"] #btn-reset-dw-filters:hover {
  background: #1c273e !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
}

/* ===================================================================
   SLEEK BLACK / DEEP CHARCOAL STYLING FOR TOPBAR & SIDEBAR WIDGETS
   (Month Bar, Theme Toggle, Device Status)
   =================================================================== */

/* 1. Global Month Navigator Bar */
#global-month-bar,
.global-month-bar {
  background: #0f172a !important;
  border: 1px solid #1e293b !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

#global-month-bar .btn-month-nav,
.btn-month-nav {
  color: #94a3b8 !important;
  background: transparent !important;
}

#global-month-bar .btn-month-nav:hover,
.btn-month-nav:hover {
  background: #1e293b !important;
  color: #ffffff !important;
}

#select-global-month,
#select-global-year,
.global-month-select,
.global-year-select {
  background: #020617 !important;
  border: 1px solid #334155 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

#select-global-month:focus,
#select-global-year:focus,
.global-month-select:focus,
.global-year-select:focus {
  border-color: #3b82f6 !important;
  outline: none !important;
}

/* 2. Theme Toggle Button */
#btn-theme-toggle {
  background: #0f172a !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

#btn-theme-toggle:hover {
  background: #1e293b !important;
  border-color: #f59e0b !important;
  transform: translateY(-1px);
}

.theme-icon-sun {
  filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.6));
}

.theme-icon-moon {
  filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.5));
}

/* 3. Hardware Status Mini Card in Sidebar */
#sidebar-device-card,
.device-mini-card {
  background: #0f172a !important;
  border: 1px solid #1e293b !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

#sidebar-device-card .device-name-badge,
.device-name-badge {
  color: #2563eb !important;
  font-weight: 700 !important;
}

#sidebar-device-card .device-ip-label,
.device-ip-label,
#sidebar-device-ip {
  color: #10b981 !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px;
}

/* Dark Theme Polish */
[data-theme="dark"] #global-month-bar {
  background: #0a0e1a !important;
  border-color: #1a2234 !important;
}

[data-theme="dark"] #select-global-month,
[data-theme="dark"] #select-global-year {
  background: #060911 !important;
  border-color: #243048 !important;
}

[data-theme="dark"] #btn-theme-toggle {
  background: #0a0e1a !important;
  border-color: #243048 !important;
}

[data-theme="dark"] #sidebar-device-card {
  background: #0a0e1a !important;
  border-color: #1a2234 !important;
}

/* ===================================================================
   ROYAL COBALT THEME - FILTER BARS & TOOLBAR BUTTONS
   =================================================================== */

/* 1. Filter Bar Dropdowns & Date Inputs (Images 1, 2, 4, 5) */
.panel-controls select,
.panel-controls input[type="date"],
.panel-controls .form-select,
.panel-controls .form-input,
#filter-dw-year,
#filter-dw-month,
#filter-dw-date,
#filter-dw-weekday,
#filter-dw-emp {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  font-weight: 500 !important;
  border-radius: var(--radius-sm) !important;
  outline: none !important;
  cursor: pointer !important;
}

[data-theme="dark"] .panel-controls select,
[data-theme="dark"] .panel-controls input[type="date"],
[data-theme="dark"] .panel-controls .form-select,
[data-theme="dark"] .panel-controls .form-input,
[data-theme="dark"] #filter-dw-year,
[data-theme="dark"] #filter-dw-month,
[data-theme="dark"] #filter-dw-date,
[data-theme="dark"] #filter-dw-weekday,
[data-theme="dark"] #filter-dw-emp {
  background: #0f172a !important;
  color: #f8fafc !important;
  border: 1px solid #334155 !important;
}

.panel-controls select option,
#filter-dw-year option,
#filter-dw-month option,
#filter-dw-weekday option,
#filter-dw-emp option {
  background: #0f172a !important;
  color: #ffffff !important;
}

.panel-controls select:focus,
.panel-controls input[type="date"]:focus,
#filter-dw-year:focus,
#filter-dw-month:focus,
#filter-dw-date:focus,
#filter-dw-weekday:focus,
#filter-dw-emp:focus {
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.45) !important;
}

.panel-controls input[type="date"]::-webkit-calendar-picker-indicator,
#filter-dw-date::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(2) !important;
  cursor: pointer !important;
}

/* 2. Personnel Toolbar Buttons in Royal Cobalt (Image 3) */
.zk-tool-btn,
#btn-zk-add-emp,
#btn-zk-save-emp,
#btn-zk-delete-emp,
#btn-zk-import-emp,
#btn-zk-export-emp,
#btn-zk-batch-emp,
#btn-pull-device-users,
#btn-push-device-users {
  background: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}

.zk-tool-btn svg,
#btn-zk-add-emp svg,
#btn-zk-save-emp svg,
#btn-zk-delete-emp svg,
#btn-zk-import-emp svg,
#btn-zk-export-emp svg,
#btn-zk-batch-emp svg,
#btn-pull-device-users svg,
#btn-push-device-users svg {
  stroke: #ffffff !important;
  color: #ffffff !important;
}

.zk-tool-btn:hover,
#btn-zk-add-emp:hover,
#btn-zk-save-emp:hover,
#btn-zk-delete-emp:hover,
#btn-zk-import-emp:hover,
#btn-zk-export-emp:hover,
#btn-zk-batch-emp:hover,
#btn-pull-device-users:hover,
#btn-push-device-users:hover {
  background: #1d4ed8 !important;
  border-color: #60a5fa !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5) !important;
  transform: translateY(-1px);
}

/* ==========================================================================
   MULTI-TENANT ROLE VISIBILITY CONTROLS
   Client Admin: Automatically hides Company dropdown filters across all views
   Master Admin: Retains full Company dropdown filters to manage/audit all tenants
   ========================================================================== */
body.role-client-admin .filter-group-company {
  display: none !important;
}

/* ==========================================================================
   THEME ACCENTS - DARK THEME (#1e3a8a Deep Royal Blue) & LIGHT THEME (#bfd6f9 Ice Blue)
   1. All Table Headers (Overrides, Custom Shifts, Day-Wise, Day-Schedule)
   2. Active Attendance & Leave Policy Banner
   ========================================================================== */

/* 1. All Table Headers - Dark Theme (Default & data-theme="dark") */
.custom-table th,
.custom-table thead tr th,
.day-schedule-table th,
.table-responsive > table > thead > tr > th,
#table-dw-machine-logs thead th,
[data-theme="dark"] .custom-table th,
[data-theme="dark"] .custom-table thead tr th,
[data-theme="dark"] .day-schedule-table th,
[data-theme="dark"] .table-responsive > table > thead > tr > th,
[data-theme="dark"] #table-dw-machine-logs thead th {
  background: #1e3a8a !important;
  color: #ffffff !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 11px 14px !important;
  border-bottom: 2px solid #3b82f6 !important;
  text-align: left !important;
}

/* 1. All Table Headers - Light Theme (Strictly Preserved #bfd6f9) */
[data-theme="light"] .custom-table th,
[data-theme="light"] .custom-table thead tr th,
[data-theme="light"] .day-schedule-table th,
[data-theme="light"] .table-responsive > table > thead > tr > th,
[data-theme="light"] #table-dw-machine-logs thead th {
  background: #bfd6f9 !important;
  color: #0f172a !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 11px 14px !important;
  border-bottom: 2px solid #93c5fd !important;
  text-align: left !important;
}

/* 2. Top Header Action Buttons (Sync Machine & Manual Punch) */
#btn-header-sync,
#btn-quick-punch {
  background: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
}
#btn-header-sync svg,
#btn-quick-punch svg {
  stroke: #ffffff !important;
}
#btn-header-sync:hover,
#btn-quick-punch:hover {
  background: #1d4ed8 !important;
  border-color: #60a5fa !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5) !important;
  transform: translateY(-1px);
}

/* 3. Sidebar Active Navigation Item */
.nav-item.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
}
.nav-item.active svg {
  stroke: #ffffff !important;
}
.nav-item.active:hover {
  background: #1d4ed8 !important;
  color: #ffffff !important;
}

/* 4. Reset Filters Button */
#btn-reset-dw-filters {
  background: #ffffff !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}
#btn-reset-dw-filters:hover {
  background: #1d4ed8 !important;
  border-color: #60a5fa !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5) !important;
  transform: translateY(-1px);
}

/* 5. Active Attendance & Leave Policy Banner - Dark Theme (#1e3a8a) */
#leaves-policy-banner,
.leaves-policy-banner,
[data-theme="dark"] #leaves-policy-banner,
[data-theme="dark"] .leaves-policy-banner {
  background: #1e3a8a !important;
  border: 1px solid #3b82f6 !important;
  border-radius: var(--radius-md) !important;
  padding: 18px 22px !important;
  margin-bottom: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 16px !important;
  box-shadow: 0 4px 14px rgba(30, 58, 138, 0.45) !important;
}

#leaves-policy-banner .policy-kicker,
[data-theme="dark"] #leaves-policy-banner .policy-kicker {
  font-size: 0.74rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: #93c5fd !important;
  font-weight: 800 !important;
  margin-bottom: 4px !important;
}

#leaves-policy-banner #active-policy-title,
[data-theme="dark"] #leaves-policy-banner #active-policy-title {
  margin: 0 !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
}

#leaves-policy-banner #active-policy-desc,
[data-theme="dark"] #leaves-policy-banner #active-policy-desc {
  font-size: 0.82rem !important;
  color: #cbd5e1 !important;
  margin-top: 6px !important;
}

#leaves-policy-banner #active-policy-desc strong,
[data-theme="dark"] #leaves-policy-banner #active-policy-desc strong {
  color: #ffffff !important;
}

/* 5. Active Attendance & Leave Policy Banner - Light Theme (Strictly Preserved #bfd6f9) */
[data-theme="light"] #leaves-policy-banner,
[data-theme="light"] .leaves-policy-banner {
  background: #bfd6f9 !important;
  border: 1px solid #93c5fd !important;
  border-radius: var(--radius-md) !important;
  padding: 18px 22px !important;
  margin-bottom: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 16px !important;
  box-shadow: 0 4px 14px rgba(191, 214, 249, 0.45) !important;
}

[data-theme="light"] #leaves-policy-banner .policy-kicker {
  font-size: 0.74rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: #1e40af !important;
  font-weight: 800 !important;
  margin-bottom: 4px !important;
}

[data-theme="light"] #leaves-policy-banner #active-policy-title {
  margin: 0 !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}

[data-theme="light"] #leaves-policy-banner #active-policy-desc {
  font-size: 0.82rem !important;
  color: #334155 !important;
  margin-top: 6px !important;
}

[data-theme="light"] #leaves-policy-banner #active-policy-desc strong {
  color: #0f172a !important;
}




/* Force 100% edge-to-edge stretch on monthly matrix - No empty space on the right */
#matrix-container {
  width: 100% !important;
  box-sizing: border-box;
}

#table-monthly-matrix {
  width: 100% !important;
  min-width: 100% !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
}

#table-monthly-matrix th,
#table-monthly-matrix td {
  border: 1px solid var(--border-subtle) !important;
}

/* ==========================================
   COLORFUL MONTHLY MATRIX BADGES (ENTERPRISE PALETTE)
   ========================================== */
.matrix-container {
  width: 100% !important;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.matrix-table {
  width: 100% !important;
  min-width: 100% !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
  font-size: 0.76rem;
}

.matrix-table th, .matrix-table td {
  padding: 6px 3px;
  text-align: center;
  border: 1px solid var(--border-subtle) !important;
  white-space: nowrap;
}

.matrix-cell-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.matrix-cell-badge:hover {
  transform: scale(1.22);
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 1. Present (P) - Emerald Green Pill */
.matrix-cell-badge.badge-present,
.matrix-cell-badge[data-code="P"] {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #059669 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

[data-theme="dark"] .matrix-cell-badge.badge-present,
[data-theme="dark"] .matrix-cell-badge[data-code="P"] {
  background: rgba(16, 185, 129, 0.22) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
}

/* 2. Late Arrival (L) - Warm Amber Pill */
.matrix-cell-badge.badge-late,
.matrix-cell-badge[data-code="L"] {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #d97706 !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

[data-theme="dark"] .matrix-cell-badge.badge-late,
[data-theme="dark"] .matrix-cell-badge[data-code="L"] {
  background: rgba(245, 158, 11, 0.25) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
}

/* 3. Half Day (HD) - Vibrant Orange Pill */
.matrix-cell-badge.badge-halfday,
.matrix-cell-badge[data-code="HD"] {
  background: rgba(249, 115, 22, 0.18) !important;
  color: #ea580c !important;
  border: 1px solid rgba(249, 115, 22, 0.4) !important;
}

/* 4. Absent (A) - Crimson Red Pill */
.matrix-cell-badge.badge-absent,
.matrix-cell-badge[data-code="A"] {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #dc2626 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

[data-theme="dark"] .matrix-cell-badge.badge-absent,
[data-theme="dark"] .matrix-cell-badge[data-code="A"] {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
}

/* 5. Weekend Off (W) - Soft Slate Blue Pill */
.matrix-cell-badge.badge-weekend,
.matrix-cell-badge[data-code="W"] {
  background: rgba(148, 163, 184, 0.12) !important;
  color: #64748b !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
}

[data-theme="dark"] .matrix-cell-badge.badge-weekend,
[data-theme="dark"] .matrix-cell-badge[data-code="W"] {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #94a3b8 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* 6. Leave / Holiday (S / H / L) - Regal Purple Pill */
.matrix-cell-badge.badge-leave,
.matrix-cell-badge[data-code="S"],
.matrix-cell-badge[data-code="H"] {
  background: rgba(168, 85, 247, 0.18) !important;
  color: #9333ea !important;
  border: 1px solid rgba(168, 85, 247, 0.4) !important;
}

[data-theme="dark"] .matrix-cell-badge.badge-leave,
[data-theme="dark"] .matrix-cell-badge[data-code="S"],
[data-theme="dark"] .matrix-cell-badge[data-code="H"] {
  background: rgba(168, 85, 247, 0.25) !important;
  color: #c084fc !important;
  border-color: rgba(168, 85, 247, 0.5) !important;
}

/* 7. Upcoming / Future (-) - Clean subtle dash */
.matrix-cell-badge.badge-upcoming,
.matrix-cell-badge[data-code="-"] {
  background: transparent !important;
  color: var(--text-muted, #94a3b8) !important;
  border: none !important;
}

/* Matrix Table: Clean White Background, Colored Letters Only (Image 1 Standard) */
/* Matrix Table: Solid Cell Background to Prevent Ghost Letter Overlap */
.matrix-table td {
  background: var(--bg-card, #111828) !important;
}

[data-theme="dark"] .matrix-table td {
  background: #111828 !important;
}

[data-theme="light"] .matrix-table td {
  background: #ffffff !important;
}

.matrix-table th.th-fixed,
.matrix-table td.th-fixed,
.matrix-table td[style*="sticky"],
.matrix-table th[style*="sticky"] {
  background: #111828 !important;
  z-index: 5 !important;
}

[data-theme="light"] .matrix-table th.th-fixed,
[data-theme="light"] .matrix-table td.th-fixed,
[data-theme="light"] .matrix-table td[style*="sticky"],
[data-theme="light"] .matrix-table th[style*="sticky"] {
  background: #ffffff !important;
}

.matrix-cell-badge {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.matrix-cell-badge {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   SINGLE-CLIENT DEPLOYMENT - PERMANENTLY HIDE COMPANY DROPDOWNS & TABS
   ========================================================================== */
.filter-group-company,
[data-subview="personnel-company"],
#subview-personnel-company {
  display: none !important;
}

/* ==========================================================================
   DAILY ATTENDANCE TABLE - EXACT ICE BLUE HEADER & MONOSPACE LEDGER STYLING
   ========================================================================== */
#table-daily-attendance thead th {
  background: #bfd6f9 !important;
  color: #0f172a !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 10px 12px !important;
  border-bottom: 2px solid #93c5fd !important;
  white-space: nowrap !important;
}

[data-theme="dark"] #table-daily-attendance thead th {
  background: #1e3a8a !important;
  color: #ffffff !important;
  border-bottom: 2px solid #3b82f6 !important;
}

#table-daily-attendance tbody tr {
  background: #ffffff;
  transition: background 0.15s ease;
}

[data-theme="dark"] #table-daily-attendance tbody tr {
  background: var(--bg-card);
}

#table-daily-attendance tbody tr:hover {
  background: rgba(241, 245, 249, 0.7);
}

[data-theme="dark"] #table-daily-attendance tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

#table-daily-attendance tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  vertical-align: middle;
}

/* ==========================================================================
   PUNCH TIME COLORS (DAILY ATTENDANCE & DASHBOARD PREVIEW)
   ========================================================================== */
.punch-pill.pill-in {
  color: #059669 !important; /* Emerald Green Morning In */
  font-weight: 700 !important;
}

.punch-pill.pill-in-late,
.punch-pill.pill-in.late {
  color: #d97706 !important; /* Warm Amber Late Arrival */
  font-weight: 700 !important;
}

.punch-pill.pill-bout {
  color: #ea580c !important; /* Warm Orange Break Out */
  font-weight: 700 !important;
}

.punch-pill.pill-bin {
  color: #0284c7 !important; /* Sky Blue Break In */
  font-weight: 700 !important;
}

.punch-pill.pill-out {
  color: #2563eb !important; /* Royal Blue Office Out */
  font-weight: 700 !important;
}

[data-theme="dark"] .punch-pill.pill-in {
  color: #10b981 !important;
}
[data-theme="dark"] .punch-pill.pill-in-late,
[data-theme="dark"] .punch-pill.pill-in.late {
  color: #f59e0b !important;
}
[data-theme="dark"] .punch-pill.pill-bout {
  color: #fb923c !important;
}
[data-theme="dark"] .punch-pill.pill-bin {
  color: #38bdf8 !important;
}
[data-theme="dark"] .punch-pill.pill-out {
  color: #60a5fa !important;
}


/* ===================================================================
   SANDBOX SIMULATOR TOP FLOATING BAR (DESKTOP & GLOBAL)
   =================================================================== */
.sandbox-top-bar {
  position: sticky;
  top: 0;
  z-index: 99999;
  background: #0F172A;
  color: #FFFFFF;
  padding: 8px 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  gap: 10px;
}
.sandbox-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10B981;
  display: inline-block;
  box-shadow: 0 0 8px #10B981;
}
.sandbox-top-title {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sandbox-top-sub {
  color: #94A3B8;
  font-size: 11px;
}
.sandbox-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sandbox-top-btn-link {
  text-decoration: none;
  font-weight: 600;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sandbox-top-btn-link.btn-back-web {
  background: #1E293B;
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.sandbox-top-btn-link.btn-admin {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.sandbox-country-select-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid #3b82f6;
  border-radius: 6px;
  padding: 3px 8px;
}
.sandbox-country-select-box select {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}
.sandbox-top-btn {
  border: none;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sandbox-top-btn.btn-rush {
  background: #059669;
  color: white;
}
.sandbox-top-btn.btn-export {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===================================================================
   MOBILE RESPONSIVENESS OVERRIDES FOR SANDBOX SIMULATOR (< 768px)
   =================================================================== */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
  }

  /* --- Top Simulator Bar --- */
  .sandbox-top-bar {
    padding: 6px 10px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
  }
  .sandbox-top-left {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
  }
  .sandbox-top-actions {
    display: flex !important;
    gap: 6px !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 2px !important;
  }
  .sandbox-top-actions::-webkit-scrollbar {
    display: none !important;
  }
  .sandbox-top-btn, .sandbox-top-btn-link, .sandbox-country-select-box {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
  }

  /* --- App Shell & Container --- */
  .app-container {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* --- FIXED BOTTOM NAVIGATION BAR: SMOOTH TOUCH SCROLL (NO OVERLAP) --- */
  .sidebar {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 62px !important;
    flex-direction: row !important;
    border-right: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    z-index: 99999 !important;
    background: #0f172a !important;
    padding: 0 4px !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .sidebar::-webkit-scrollbar {
    display: none !important;
  }
  .sidebar-header, .sidebar-footer {
    display: none !important;
  }
  .sidebar-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: max-content !important;
    min-width: 100% !important;
    align-items: center !important;
    padding: 0 6px !important;
    margin: 0 !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .sidebar-nav::-webkit-scrollbar {
    display: none !important;
  }
  .sidebar .nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 6px !important;
    margin: 0 !important;
    border-radius: 8px !important;
    gap: 3px !important;
    flex: 0 0 68px !important;
    width: 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
    text-align: center !important;
    color: #94a3b8 !important;
  }
  .sidebar .nav-item.active {
    background: rgba(37, 99, 235, 0.22) !important;
    color: #60a5fa !important;
  }
  .sidebar .nav-item svg {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
  }
  .sidebar .nav-item span {
    display: block !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 62px !important;
  }

  /* --- Main Content Area --- */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding-bottom: 80px !important;
    min-height: calc(100vh - 62px) !important;
    overflow-x: hidden !important;
  }

  /* --- Top Header in Simulator --- */
  .top-header {
    padding: 0 10px !important;
    height: 50px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    gap: 6px !important;
  }
  #btn-toggle-sidebar {
    display: none !important;
  }
  .header-title-area {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }
  .header-title-area h2 {
    font-size: 0.95rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 120px !important;
    margin: 0 !important;
  }
  .header-title-area p {
    display: none !important;
  }
  #global-month-bar {
    padding: 2px 6px !important;
    gap: 2px !important;
    flex-shrink: 0 !important;
  }
  #global-month-bar .global-month-select,
  #global-month-bar .global-year-select {
    font-size: 11px !important;
    padding: 1px 3px !important;
  }
  #btn-global-month-lock-status {
    display: none !important;
  }
  .header-actions {
    gap: 4px !important;
    flex-shrink: 0 !important;
  }
  .header-actions .btn {
    padding: 4px 8px !important;
    font-size: 11px !important;
  }
  .header-actions .btn span {
    display: none !important;
  }
  .user-auth-widget {
    margin-left: 2px !important;
    padding-left: 4px !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
  }
  #label-auth-username, #label-auth-role {
    display: none !important;
  }
  #btn-header-logout {
    padding: 3px 6px !important;
    font-size: 10px !important;
  }

  /* --- View Sections --- */
  .view-section {
    padding: 10px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* --- CONVERT ALL MULTI-COLUMN INLINE GRIDS TO 1-COLUMN ON MOBILE --- */
  .view-section div[style*="grid-template-columns"],
  .card-panel div[style*="grid-template-columns"],
  .system-section-card div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .view-section div[style*="grid-template-columns: 130px 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* --- Shift Banner on Mobile --- */
  #dashboard-shift-banner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px !important;
  }
  #dashboard-shift-banner > div:last-child {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  #dashboard-shift-banner button {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* --- Executive Real-Time Hero Card --- */
  .executive-hero-card {
    padding: 14px 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .executive-hero-card > div {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }
  .executive-hero-card > div > div:first-child {
    flex-direction: row !important;
    align-items: center !important;
    gap: 14px !important;
    width: 100% !important;
  }
  .dash-presence-bar-box {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* --- Stats Grid (2 Columns on Mobile) --- */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
  }
  .stat-card {
    padding: 10px 12px !important;
    min-height: 75px !important;
    box-sizing: border-box !important;
  }
  .stat-card-header .stat-label {
    font-size: 0.72rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .stat-info h3 {
    font-size: 1.25rem !important;
  }
  .stat-footer {
    display: none !important;
  }

  /* --- MATRIX TABLE MOBILE OVERRIDE: REMOVE STICKY POSITIONING ON MOBILE --- */
  /* This prevents the 365px sticky columns from covering the days or creating ghost text */
  .matrix-table th,
  .matrix-table td {
    position: static !important;
    left: auto !important;
    background: #111828 !important;
  }
  [data-theme="light"] .matrix-table th,
  [data-theme="light"] .matrix-table td {
    background: #ffffff !important;
  }

  /* --- All Tables Touch Horizontal Scroll --- */
  .table-responsive,
  .matrix-container,
  .table-container,
  .timesheet-matrix-wrapper {
    overflow-x: auto !important;
    max-width: 100% !important;
    width: 100% !important;
    display: block !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }

  /* --- Weekly Bars Container on Mobile --- */
  #weekly-bars-container {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* --- Modals on Mobile --- */
  .modal-dialog,
  .modal-content,
  .modal-payslip-dialog {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 10px auto !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }
}


/* =======================================================
   LANDSCAPE ORIENTATION OVERLAY (OPTION B)
   ======================================================= */
.landscape-orientation-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

/* Prompt only on mobile portrait screens */
@media screen and (max-width: 900px) and (orientation: portrait) {
  body:not(.dismiss-landscape-guide) .landscape-orientation-overlay {
    display: flex;
  }
}

/* When in landscape mode, completely hide the guidance modal */
@media screen and (orientation: landscape) {
  .landscape-orientation-overlay {
    display: none !important;
  }
}

.landscape-modal-box {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 35px rgba(56, 189, 248, 0.18);
  border-radius: 16px;
  max-width: 360px;
  width: 100%;
  padding: 24px 20px;
  text-align: center;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.landscape-device-icon-container {
  position: relative;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.2);
  margin-bottom: 4px;
}

.landscape-phone-rotate-anim {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rotate-arrow {
  position: absolute;
  top: -8px;
  right: -10px;
  animation: spinSlow 3s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.landscape-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.landscape-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
}

.landscape-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
}

.landscape-action-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}

.btn-landscape-rotate {
  width: 100%;
  padding: 10px 16px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
}

.btn-landscape-rotate:hover {
  background: #1d4ed8;
}

.btn-landscape-dismiss {
  width: 100%;
  padding: 8px 14px;
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-landscape-dismiss:hover {
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.25);
}

/* =======================================================
   LANDSCAPE MODE DESKTOP WORKSTATION SIMULATOR
   Activates when phone is turned horizontally (width > height)
   ======================================================= */
@media screen and (orientation: landscape) and (max-height: 600px) {
  .app-container {
    flex-direction: row !important;
  }

  /* Left Sidebar in Landscape */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: auto !important;
    width: 64px !important;
    height: 100vh !important;
    flex-direction: column !important;
    border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-top: none !important;
    z-index: 50 !important;
    padding: 6px 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    background: #0e1424 !important;
  }
  .sidebar-header {
    display: flex !important;
    height: 44px !important;
    padding: 0 12px !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .sidebar-header .brand-info {
    display: none !important;
  }
  .sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 6px 0 !important;
    gap: 4px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  .sidebar .nav-item {
    width: 100% !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 8px 0 !important;
    justify-content: center !important;
    border-radius: 0 !important;
  }
  .sidebar .nav-item span {
    display: none !important;
  }

  /* Main Content in Landscape */
  .main-content {
    margin-left: 64px !important;
    width: calc(100% - 64px) !important;
    max-width: calc(100vw - 64px) !important;
    padding-bottom: 24px !important;
    min-height: 100vh !important;
  }

  /* Top Header in Landscape */
  .top-header {
    height: 46px !important;
    padding: 0 16px !important;
  }
  .header-title-area h2 {
    font-size: 1.05rem !important;
    max-width: 250px !important;
  }

  /* Multi-column desktop grids in landscape */
  .view-section div[style*="grid-template-columns: 1.4fr 1fr"],
  .card-panel div[style*="grid-template-columns: 1.4fr 1fr"] {
    grid-template-columns: 1.4fr 1fr !important;
    gap: 16px !important;
  }
  .view-section div[style*="grid-template-columns: 1.15fr 1fr"] {
    grid-template-columns: 1.15fr 1fr !important;
    gap: 16px !important;
  }
  .view-section div[style*="grid-template-columns: 1.25fr 1fr"] {
    grid-template-columns: 1.25fr 1fr !important;
    gap: 16px !important;
  }
}


/* ============================================================== */
/* ENTERPRISE ROLE & PERMISSIONS STUDIO (CLEAN NATIVE DESIGN)     */
/* ============================================================== */
.perm-studio-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 100%;
}

.perm-count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-family: inherit;
  margin-top: 4px;
  display: inline-block;
}

.perm-presets-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.perm-presets-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
  margin-right: 4px;
  text-transform: uppercase;
}

.perm-preset-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 5px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.perm-preset-btn:hover {
  background: #f0fdf4;
  border-color: #10b981;
  color: #059669;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
}

.perm-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
}

.perm-action-link {
  background: none;
  border: none;
  color: #059669;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.perm-action-link:hover {
  background: #ecfdf5;
  color: #047857;
}

.role-protected-tag {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.perm-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding-right: 2px;
}

.perm-cat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.perm-cat-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.perm-cat-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}

.perm-cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
}

.perm-cat-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.perm-toggles-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.perm-toggle-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 5px;
  cursor: pointer;
  background: #ffffff;
  border: 1px solid transparent;
  transition: all 0.12s ease;
}

.perm-toggle-item:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.perm-toggle-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #10b981;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.perm-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
}

.perm-toggle-text strong {
  font-size: 0.77rem;
  font-weight: 600;
  color: #1e293b;
}

.perm-toggle-text small {
  font-size: 0.68rem;
  color: #64748b;
  line-height: 1.2;
}

/* Dark Mode Adaptation */
[data-theme="dark"] .perm-count-badge,
.dark-mode .perm-count-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .perm-presets-bar,
.dark-mode .perm-presets-bar {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .perm-presets-label,
.dark-mode .perm-presets-label {
  color: #94a3b8;
}

[data-theme="dark"] .perm-preset-btn,
.dark-mode .perm-preset-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  box-shadow: none;
}

[data-theme="dark"] .perm-preset-btn:hover,
.dark-mode .perm-preset-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
}

[data-theme="dark"] .perm-action-link,
.dark-mode .perm-action-link {
  color: #10b981;
}

[data-theme="dark"] .perm-action-link:hover,
.dark-mode .perm-action-link:hover {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
}

[data-theme="dark"] .role-protected-tag,
.dark-mode .role-protected-tag {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .perm-cat-card,
.dark-mode .perm-cat-card {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

[data-theme="dark"] .perm-cat-card:hover,
.dark-mode .perm-cat-card:hover {
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .perm-cat-header,
.dark-mode .perm-cat-header {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .perm-cat-title,
.dark-mode .perm-cat-title {
  color: #f1f5f9;
}

[data-theme="dark"] .perm-toggle-item,
.dark-mode .perm-toggle-item {
  background: transparent;
}

[data-theme="dark"] .perm-toggle-item:hover,
.dark-mode .perm-toggle-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .perm-toggle-text strong,
.dark-mode .perm-toggle-text strong {
  color: #e2e8f0;
}

[data-theme="dark"] .perm-toggle-text small,
.dark-mode .perm-toggle-text small {
  color: #94a3b8;
}


/* --- LIVE REAL-TIME COUNTRY CLOCK & PRORATED SALARY ENGINE STYLES --- */
.sandbox-live-clock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
}
.sandbox-live-clock-badge .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-live 1.5s infinite;
}
@keyframes pulse-live {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}
.btn-mode-toggle {
  background: transparent;
  color: #94a3b8;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-mode-toggle.active {
  background: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}
