/* ═══════════════════════════════════════════════════════════════
   doAttendance — Premium Dark Glassmorphism Design System
   Modern UI with micro-animations, gradients, and glass effects
   ═══════════════════════════════════════════════════════════════ */

/* ═══ TOKENS ═══ */
:root {
  /* Backgrounds */
  --bg-primary: #06080f;
  --bg-secondary: #0c1021;
  --bg-tertiary: #111827;
  --bg-glass: rgba(15, 23, 42, 0.65);
  --bg-glass-hover: rgba(30, 41, 59, 0.5);
  --bg-glass-active: rgba(51, 65, 85, 0.4);
  --bg-card: rgba(15, 23, 42, 0.7);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  /* Accents */
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-orange: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-indigo: #6366f1;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
  --gradient-danger: linear-gradient(135deg, #ef4444, #ec4899);
  --gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444);
  --gradient-cool: linear-gradient(135deg, #06b6d4, #3b82f6);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));

  /* Borders */
  --border-glass: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-active: rgba(59, 130, 246, 0.4);

  /* Glow */
  --glow-blue: 0 0 20px rgba(59, 130, 246, 0.15);
  --glow-purple: 0 0 20px rgba(139, 92, 246, 0.15);
  --glow-green: 0 0 20px rgba(16, 185, 129, 0.15);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);

  /* Layout */
  --sidebar-width: 228px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(59, 130, 246, 0.3);
  color: white;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ═══════════════════════════════════════
   ANIMATED BACKGROUND
   ═══════════════════════════════════════ */

.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}

.bg-orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3), transparent 70%);
  top: -200px;
  right: -100px;
  animation: floatOrb1 20s ease-in-out infinite;
}

.bg-orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.25), transparent 70%);
  bottom: -150px;
  left: -100px;
  animation: floatOrb2 25s ease-in-out infinite;
}

.bg-orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2), transparent 70%);
  top: 40%;
  left: 30%;
  animation: floatOrb3 18s ease-in-out infinite;
}

.bg-orb-4 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.15), transparent 70%);
  top: 20%;
  right: 20%;
  animation: floatOrb4 22s ease-in-out infinite;
}

.bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black, transparent);
}

@keyframes floatOrb1 {

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

  33% {
    transform: translate(-60px, 80px) scale(1.1);
  }

  66% {
    transform: translate(40px, -50px) scale(0.9);
  }
}

@keyframes floatOrb2 {

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

  33% {
    transform: translate(70px, -60px) scale(1.15);
  }

  66% {
    transform: translate(-40px, 40px) scale(0.85);
  }
}

@keyframes floatOrb3 {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(100px, -80px);
  }
}

@keyframes floatOrb4 {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(-80px, 60px);
  }
}

/* Floating particles */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  animation: particleFloat 10s ease-in-out infinite;
}

@keyframes particleFloat {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 0.6;
  }

  50% {
    transform: translateY(-120px) rotate(180deg);
    opacity: 0.3;
  }

  90% {
    opacity: 0;
  }

  100% {
    transform: translateY(-240px) rotate(360deg);
  }
}

/* ═══════════════════════════════════════
   LOGIN PAGE — Split Panel
   ═══════════════════════════════════════ */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-back-home {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 100;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.login-back-home:hover {
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

.login-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  max-width: 900px;
  min-height: 540px;
  background: var(--bg-glass);
  backdrop-filter: blur(40px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: loginAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes loginAppear {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }

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

/* Left branding panel */
.login-brand {
  flex: 1;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.12), rgba(6, 182, 212, 0.08));
  border-right: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.login-brand::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(59, 130, 246, 0.1), transparent 60%);
  animation: brandGlow 8s ease-in-out infinite;
}

@keyframes brandGlow {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(30px, -20px);
  }
}

.brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.brand-icon-ring {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--gradient-primary);
  padding: 3px;
  animation: iconPulse 3s ease-in-out infinite;
}

.brand-icon {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

@keyframes iconPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  }

  50% {
    box-shadow: 0 0 0 12px rgba(59, 130, 246, 0);
  }
}

.login-brand h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.brand-highlight {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-tagline {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 28px;
}

.brand-features {
  text-align: left;
  display: inline-block;
}

.brand-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
}

.feature-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gradient-primary);
  flex-shrink: 0;
}

.brand-trust {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  justify-content: center;
}

.trust-badge {
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--text-muted);
}

/* Right login form */
.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-card {
  width: 100%;
  max-width: 340px;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-icon {
  font-size: 28px;
  margin-bottom: 12px;
  display: inline-block;
  animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {

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

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

.login-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Input groups */
.input-group {
  position: relative;
  margin-bottom: 20px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  z-index: 1;
  transition: var(--transition);
}

.input-group input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
}

.input-group input::placeholder {
  color: var(--text-dim);
}

.input-group input:focus {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.05);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), var(--glow-blue);
}

.input-group input:focus+.input-line {
  transform: scaleX(1);
}

.input-line {
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 1px;
  transform: scaleX(0);
  transition: var(--transition);
}

/* Login button */
.btn-login {
  width: 100%;
  padding: 14px 24px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  margin-top: 8px;
}

.btn-login::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.btn-login:hover::before {
  left: 100%;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

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

.btn-arrow {
  transition: var(--transition);
  font-size: 18px;
}

.btn-login:hover .btn-arrow {
  transform: translateX(4px);
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Error */
.error-message {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  75% {
    transform: translateX(6px);
  }
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-glass);
}

.login-footer p {
  font-size: 11px;
  color: var(--text-dim);
  margin: 3px 0;
}

/* ═══════════════════════════════════════
   SHARED: BUTTONS
   ═══════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: normal;
  text-align: center;
  line-height: 1.35;
  text-decoration: none;
  position: relative;
  overflow: visible;
  min-height: 36px;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transition: left 0.4s;
  pointer-events: none;
  border-radius: inherit;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
}

.btn-primary:hover {
  box-shadow: var(--glow-blue);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-glass);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.btn-danger {
  background: var(--gradient-danger);
  color: white;
  border: none;
}

.btn-success {
  background: var(--gradient-success);
  color: white;
  border: none;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 15px;
}

/* ═══════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════ */

.dashboard-page {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: rgba(10, 15, 28, 0.85);
  backdrop-filter: blur(30px);
  border-right: 1px solid var(--border-glass);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-glass);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.06), transparent);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sidebar-logo {
  margin-bottom: 0;
  flex: none;
}

.sidebar-logo img {
  display: block;
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.35));
}

.sidebar-header h2 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-icon img {
  display: block;
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 4px 14px rgba(59, 130, 246, 0.4));
}

.sidebar-badge {
  display: inline-block;
  flex: none;
  padding: 2px 7px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-full);
  font-size: 8px;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 1px;
  margin-top: 0;
}

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

.nav-group-label {
  margin: 10px 8px 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.nav-group-label:first-child {
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition-fast);
  margin-bottom: 1px;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.08));
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 2px;
  background: var(--gradient-primary);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  font-size: 14px;
  width: 1.25em;
  text-align: center;
  flex: none;
  line-height: 1;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-badge {
  position: absolute;
  right: 8px;
  background: var(--accent-red);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  min-width: 16px;
  text-align: center;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

.sidebar-footer {
  padding: 10px 10px 12px;
  border-top: 1px solid var(--border-glass);
}

.admin-info {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}

.sidebar-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.sidebar-tool {
  height: 32px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: var(--transition-fast);
}

.sidebar-tool:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.btn-logout {
  width: 100%;
  padding: 7px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 8px;
  color: var(--accent-red);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.sidebar-backdrop.visible {
  display: block;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 20px;
  padding: 10px 14px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  touch-action: manipulation;
}

body.sidebar-open {
  overflow: hidden;
}

.section-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ═══════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════ */

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 28px;
  min-height: 100vh;
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
  position: relative;
  z-index: 1;
}

.section {
  animation: fadeSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.section.hidden {
  display: none;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.auto-refresh-badge {
  padding: 5px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 6px;
}

.auto-refresh-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: liveDot 1.5s ease-in-out infinite;
}

@keyframes liveDot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

/* ═══════════════════════════════════════
   STATS CARDS — Powerful dashboard cards
   ═══════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: center;
  transition: var(--transition-spring);
  position: relative;
  overflow: hidden;
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.03), transparent 60%);
  pointer-events: none;
}

.stat-present::before {
  background: var(--gradient-success);
}

.stat-absent::before {
  background: var(--gradient-danger);
}

.stat-outside::before {
  background: var(--gradient-warm);
}

.stat-late::before {
  background: linear-gradient(90deg, var(--accent-orange), #eab308);
}

.stat-total::before {
  background: var(--gradient-primary);
}

.stat-selfie::before {
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
}

.stat-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  font-size: 26px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.1;
}

.stat-present .stat-value {
  color: var(--accent-green);
}

.stat-absent .stat-value {
  color: var(--accent-red);
}

.stat-outside .stat-value {
  color: var(--accent-orange);
}

.stat-late .stat-value {
  color: var(--accent-orange);
}

.stat-total .stat-value {
  color: var(--accent-blue);
}

.stat-selfie .stat-value {
  color: var(--accent-purple);
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ═══════════════════════════════════════
   TABLES — Modern glass tables
   ═══════════════════════════════════════ */

.table-container {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.table-scroll-hint {
  display: none;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.table-container h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

#usersTable {
  min-width: 920px;
}

.actions-cell {
  white-space: normal;
  min-width: 200px;
}

.actions-cell .action-btn {
  margin-bottom: 4px;
}

.actions-cell .action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.user-attendance-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-right: 4px;
}

.user-attendance-badge {
  margin-top: 4px;
  font-size: 10px;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-glass);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.025);
}

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

.data-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.04);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-active,
.badge-present,
.badge-completed,
.badge-valid {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-disabled,
.badge-absent,
.badge-failed {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-pending,
.badge-outside {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-orange);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-expired {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.2);
}

.badge-auto {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Action buttons */
.action-btn {
  padding: 5px 10px;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: 'Inter', sans-serif;
  margin-right: 3px;
}

.action-btn:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  transform: translateY(-1px);
}

.action-btn-danger:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.action-btn-success:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

/* Search */
.search-bar {
  margin-bottom: 16px;
}

.search-input {
  max-width: 380px;
}

/* ═══════════════════════════════════════
   TABS & FILTERS
   ═══════════════════════════════════════ */

.report-tabs,
.privacy-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.tab-btn {
  padding: 9px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.08));
  border-color: rgba(59, 130, 246, 0.25);
  color: var(--accent-blue);
  box-shadow: inset 0 0 12px rgba(59, 130, 246, 0.05);
}

.report-filters,
.selfie-filters,
.timeline-filters,
.audit-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* ═══════════════════════════════════════
   FORM INPUTS & SELECTS (admin filters + settings)
   ═══════════════════════════════════════ */

.filter-input,
.form-input {
  padding: 10px 14px;
  min-height: 42px;
  max-width: 220px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.35;
  color-scheme: dark;
  transition: var(--transition);
}

.filter-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.filter-input:hover,
.form-input:hover {
  border-color: var(--border-hover);
  background: rgba(30, 41, 59, 0.55);
}

.filter-input:focus,
.form-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(30, 41, 59, 0.65);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* Native selects — visible text + custom chevron */
select.filter-input,
select.form-input,
.modal-body select,
.settings-card select {
  min-width: 160px;
  max-width: 280px;
  padding-right: 36px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  background-color: rgba(15, 23, 42, 0.85);
}

select.filter-input:hover,
select.form-input:hover,
.modal-body select:hover,
.settings-card select:hover {
  background-color: rgba(30, 41, 59, 0.55);
}

select.filter-input:focus,
select.form-input:focus,
.modal-body select:focus,
.settings-card select:focus {
  background-color: rgba(30, 41, 59, 0.65);
}

select.filter-input option,
select.form-input option,
.modal-body select option,
.settings-card select option {
  background-color: #0f172a;
  color: #f1f5f9;
  padding: 8px 12px;
}

select.filter-input optgroup,
select.form-input optgroup,
.modal-body select optgroup {
  background-color: #0c1021;
  color: var(--text-secondary);
  font-weight: 600;
}

select.filter-input[size],
select.form-input[size],
select.filter-input[multiple],
select.form-input[multiple] {
  padding-right: 14px;
  background-image: none;
  min-height: 120px;
}

select.filter-input[disabled],
select.form-input[disabled],
.filter-input:disabled,
.form-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Date / time inputs — match select contrast */
input[type="date"].filter-input,
input[type="time"].filter-input,
input[type="datetime-local"].filter-input,
input[type="month"].filter-input,
input[type="date"].form-input,
input[type="time"].form-input,
input[type="datetime-local"].form-input,
input[type="month"].form-input {
  color-scheme: dark;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px;
  margin-top: 12px;
}

.settings-card .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-card .form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.settings-card .form-group .filter-input,
.settings-card .form-group .form-input {
  max-width: 100%;
  width: 100%;
}

.settings-card .form-group select.filter-input,
.settings-card .form-group select.form-input {
  max-width: 100%;
}

/* Wider selects for long labels (status, role, etc.) */
select.filter-input.ar-status-select,
#arStatus,
#prStatus,
#prRunStatus,
#prAsgStatus,
#prSort,
#selfieStatusFilter {
  min-width: 200px;
  max-width: 320px;
}

select.filter-input {
  min-width: 180px;
}


/* ═══════════════════════════════════════
   TIMELINE
   ═══════════════════════════════════════ */

.timeline-container {
  padding: 16px;
}

.timeline-event {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  position: relative;
  animation: fadeSlideIn 0.3s ease;
}

.timeline-event:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 46px;
  bottom: -14px;
  width: 2px;
  background: linear-gradient(180deg, var(--border-glass), transparent);
}

.timeline-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 2px solid var(--border-glass);
  background: var(--bg-secondary);
  flex-shrink: 0;
  z-index: 1;
}

.timeline-content {
  flex: 1;
}

.timeline-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.timeline-distance {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ═══════════════════════════════════════
   LOCATIONS GRID
   ═══════════════════════════════════════ */

.locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.location-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: var(--transition-spring);
  position: relative;
  overflow: hidden;
}

.location-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-cool);
}

.location-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.location-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.location-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin: 5px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.location-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-glass);
}

/* ═══════════════════════════════════════
   NOTIFICATIONS
   ═══════════════════════════════════════ */

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
}

.notification-item:hover {
  border-color: var(--border-hover);
  background: rgba(59, 130, 246, 0.03);
}

.notification-item.unread {
  border-left: 3px solid var(--accent-blue);
  background: rgba(59, 130, 246, 0.04);
}

.notif-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.notif-content {
  flex: 1;
}

.notif-message {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}

.notif-time {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.notif-employee {
  font-size: 11px;
  color: var(--accent-blue);
  margin-top: 2px;
}

/* ═══════════════════════════════════════
   MODAL — Glass overlay
   ═══════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: modalSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-glass);
}

.modal-header h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.modal-body {
  padding: 22px;
}

.modal-body .form-group {
  margin-bottom: 14px;
}

.modal-body .form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  padding: 10px 14px;
  min-height: 42px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color-scheme: dark;
  transition: var(--transition);
}

.modal-body select {
  padding-right: 36px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  background-color: rgba(15, 23, 42, 0.85);
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
}

/* Map */
.map-container {
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg) !important;
}

/* ═══════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════ */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 16px;
}

.settings-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.settings-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.settings-hint {
  font-size: 12.5px;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 14px;
}

#configSection .settings-card {
  margin-bottom: 16px;
}

#configSection .form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

#configSection .form-row label {
  flex: 0 0 200px;
  font-size: 13px;
  color: var(--text-secondary, #cbd5e1);
}

#configSection .form-row .filter-input {
  flex: 1;
}

.audit-pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  justify-content: flex-end;
  font-size: 13px;
  color: var(--text-secondary, #cbd5e1);
}

.inbox-counts {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Attendance security factor toggles */
.factor-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.factor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md, 12px);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.factor-row:hover {
  border-color: var(--accent-blue, #1f6feb);
  background: rgba(31, 111, 235, 0.06);
}

.factor-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #e6edf3);
}

.factor-desc {
  font-size: 12px;
  color: var(--text-secondary, #8b949e);
  margin-top: 3px;
  max-width: 520px;
}

/* iOS-style toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

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

.switch .slider {
  position: absolute;
  inset: 0;
  background: #30363d;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.switch .slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.switch input:checked + .slider {
  background: #238636;
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.switch input:disabled + .slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.map-provider-options,
.map-type-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-type-options {
  flex-direction: row;
  flex-wrap: wrap;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.radio-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.04);
}

.radio-card input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--accent-blue);
}

.radio-card:has(input:checked) {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: inset 0 0 12px rgba(59, 130, 246, 0.04);
}

.radio-content {
  flex: 1;
}

.radio-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.radio-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.radio-card.mini {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 14px;
  min-width: 90px;
}

.settings-status {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  display: none;
}

.settings-status.success {
  display: block;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.settings-status.error {
  display: block;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

/* ═══════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
}

.empty-state-icon {
  font-size: 44px;
  margin-bottom: 10px;
  opacity: 0.4;
}

.empty-state-text {
  font-size: 13px;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 1100px) {
  .col-hide-md {
    display: none;
  }

  #usersTable {
    min-width: 720px;
  }
}

@media (max-width: 992px) {
  .main-content {
    padding: 24px 18px 18px;
  }

  .billing-banner-host {
    margin: -24px -18px 16px;
    width: calc(100% + 36px);
  }

  .section-header h1 {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }

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

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 56px 12px 16px;
  }

  .billing-banner-host {
    margin: -16px -12px 14px;
    width: calc(100% + 24px);
  }

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

  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .section-header-actions {
    width: 100%;
  }

  .section-header-actions .btn {
    flex: 1 1 auto;
    min-width: 72px;
  }

  .filter-toolbar .btn {
    flex: 1 1 auto;
    min-width: 72px;
  }

  .search-input,
  .filter-input {
    max-width: 100%;
    width: 100%;
  }

  .search-bar .search-input {
    width: 100%;
  }

  .table-scroll-hint {
    display: block;
  }

  .table-container {
    padding: 12px;
  }

  .report-filters,
  .timeline-filters,
  .selfie-filters,
  .audit-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .report-tabs,
  .privacy-tabs {
    flex-wrap: wrap;
  }

  .tab-btn {
    flex: 1;
    min-width: calc(50% - 4px);
    text-align: center;
  }

  .locations-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  #configSection .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  #configSection .form-row label {
    flex: none;
  }

  .modal {
    width: calc(100% - 24px);
    max-width: none;
    max-height: 90vh;
    margin: 12px;
  }

  .modal-overlay {
    align-items: flex-end;
  }

  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  #fieldMap,
  #locationMap {
    height: 280px !important;
  }

  .login-brand {
    display: none;
  }

  .login-wrapper {
    max-width: 400px;
  }
}

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

  .stat-value {
    font-size: 28px;
  }

  .actions-cell .action-btn {
    display: inline-block;
    font-size: 10px;
    padding: 6px 8px;
  }

  .nav-item {
    padding: 14px 16px;
    min-height: 44px;
  }
}

/* ═══════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.3s ease;
}

.toast.toast-exit {
  animation: toastSlideOut 0.3s ease forwards;
}

.toast-success {
  border-left: 3px solid var(--accent-green);
}

.toast-error {
  border-left: 3px solid var(--accent-red);
}

.toast-info {
  border-left: 3px solid var(--accent-blue);
}

.toast-warning {
  border-left: 3px solid var(--accent-orange);
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

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

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

/* ═══ LIGHT THEME (Module 13) ═══ */
html[data-theme="light"] {
  --bg-primary: #eef2f7;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-hover: rgba(241, 245, 249, 0.9);
  --bg-glass-active: rgba(226, 232, 240, 0.9);
  --bg-card: rgba(255, 255, 255, 0.92);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --border-glass: rgba(15, 23, 42, 0.10);
  --border-hover: rgba(15, 23, 42, 0.18);
  --border-active: rgba(59, 130, 246, 0.5);
}

html[data-theme="light"] body {
  background: var(--bg-primary);
}

.theme-toggle {
  width: 100%;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ═══ Campus Studio + Live Tracking ═══ */
.modal-wide {
  max-width: 920px;
  width: 95vw;
}

.campus-studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .campus-studio-grid {
    grid-template-columns: 1fr;
  }
}

.campus-studio-map {
  height: 280px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.loc-radius-slider {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--accent-blue);
}

.loc-gps-btn {
  width: 100%;
}

.live-track-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.live-track-stat {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.live-track-stat .val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.live-track-stat .lbl {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.live-track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.live-track-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: var(--transition-fast);
}

.live-track-card:hover {
  border-color: var(--border-hover);
}

.live-track-card.inside {
  border-left: 3px solid var(--accent-green);
}

.live-track-card.outside {
  border-left: 3px solid var(--accent-red);
}

.live-track-card.checkin-only {
  border-left: 3px solid var(--accent-orange);
}

.live-track-card .lt-name {
  font-weight: 600;
  font-size: 15px;
}

.live-track-card .lt-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}

.fieldmap-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

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

.field-map-panel {
  height: 460px;
  border-radius: 14px;
  overflow: hidden;
}

.field-map-sidebar-wrap {
  display: flex;
  flex-direction: column;
}

.field-map-sidebar {
  max-height: 410px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fieldmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

.fm-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fm-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.fm-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.fm-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.field-emp-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.field-emp-card:hover {
  border-color: var(--accent-blue);
}

.field-emp-card.outside {
  border-left: 3px solid var(--accent-red);
}

.field-emp-card.inside {
  border-left: 3px solid var(--accent-green);
}

.pac-container {
  z-index: 10050 !important;
}

/* Attendance Records — v2 command bar + grouped table */
#sectionAttendance .ar-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

#sectionAttendance .ar-page-header h1 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}

#sectionAttendance .ar-page-sub {
  margin: 0;
  max-width: 520px;
}

#sectionAttendance .ar-page-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#sectionAttendance .ar-page-pager {
  display: flex;
  gap: 4px;
}

#sectionAttendance .ar-command-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  position: sticky;
  top: 0;
  z-index: 20;
}

#sectionAttendance .ar-command-search {
  position: relative;
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 320px;
}

#sectionAttendance .ar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.6;
  pointer-events: none;
}

#sectionAttendance .ar-search-input {
  width: 100%;
  padding-left: 32px;
}

#sectionAttendance .ar-date-input {
  flex: 0 0 auto;
  width: 138px;
  min-width: 0;
}

#sectionAttendance .ar-status-select {
  flex: 0 0 auto;
  width: 130px;
  min-width: 0;
}

#sectionAttendance .ar-filters-btn {
  position: relative;
}

#sectionAttendance .ar-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-blue);
  color: #fff;
  border-radius: 999px;
}

#sectionAttendance .ar-filter-badge.hidden {
  display: none;
}

#sectionAttendance .ar-export-wrap {
  position: relative;
  margin-left: auto;
}

#sectionAttendance .ar-export-menu.hidden {
  display: none;
}

#sectionAttendance .ar-export-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 30;
  overflow: hidden;
}

#sectionAttendance .ar-export-menu button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
}

#sectionAttendance .ar-export-menu button:hover {
  background: rgba(59, 130, 246, 0.1);
}

#sectionAttendance .ar-kpi-strip {
  margin-bottom: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

#sectionAttendance .ar-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

#sectionAttendance .ar-kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  white-space: nowrap;
}

#sectionAttendance .ar-kpi-pill strong {
  color: var(--text-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#sectionAttendance .ar-kpi-pill.ar-kpi-good strong {
  color: var(--accent-green);
}

#sectionAttendance .ar-kpi-pill.ar-kpi-warn strong {
  color: var(--accent-orange);
}

#sectionAttendance .ar-kpi-hint {
  margin: 0;
  font-size: 12px;
}

#sectionAttendance .ar-active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

#sectionAttendance .ar-active-chips.hidden {
  display: none;
}

#sectionAttendance .ar-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}

#sectionAttendance .ar-chip:hover {
  background: rgba(59, 130, 246, 0.15);
}

#sectionAttendance .ar-chip-clear {
  background: transparent;
  border-color: var(--border-glass);
}

#sectionAttendance .ar-table-wrap {
  margin-bottom: 10px;
}

#sectionAttendance .ar-grouped-table {
  table-layout: fixed;
}

#sectionAttendance .ar-grouped-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

#sectionAttendance .ar-col-employee { width: 20%; }
#sectionAttendance .ar-col-time { width: 17%; }
#sectionAttendance .ar-col-trust { width: 18%; }
#sectionAttendance .ar-col-signature { width: 16%; }
#sectionAttendance .ar-col-location { width: 18%; }
#sectionAttendance .ar-col-actions { width: 48px; }

#sectionAttendance .ar-emp-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#sectionAttendance .ar-emp-date {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

#sectionAttendance .ar-emp-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sectionAttendance .ar-emp-meta {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sectionAttendance .ar-emp-meta code {
  font-size: 10px;
}

#sectionAttendance .ar-emp-status {
  align-self: flex-start;
  margin-top: 4px;
  font-size: 10px;
  text-transform: capitalize;
}

#sectionAttendance .ar-time-cell {
  font-size: 12px;
}

#sectionAttendance .ar-time-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

#sectionAttendance .ar-sig-session {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-glass);
}

#sectionAttendance .ar-sig-session:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

#sectionAttendance .ar-sig-session-num {
  grid-column: 1 / -1;
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 2px;
}

#sectionAttendance .ar-sig-rows {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#sectionAttendance .ar-sig-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
}

#sectionAttendance .ar-sig-label {
  flex: 0 0 22px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

#sectionAttendance .ar-sig-row .badge {
  font-size: 10px;
  padding: 2px 6px;
}

#sectionAttendance .ar-sig-view-btn {
  grid-column: auto;
  grid-row: auto;
  align-self: center;
  white-space: nowrap;
  padding: 2px 8px !important;
  font-size: 10px !important;
  min-height: 0;
  line-height: 1.4;
}

#sectionAttendance .ar-sig-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

#sectionAttendance .ar-sig-privacy-hint {
  font-size: 11px;
  opacity: 0.85;
}

#sectionAttendance .ar-sig-privacy-panel {
  margin-bottom: 10px;
}

#sectionAttendance .ar-sig-privacy-msg {
  margin: 0 0 8px;
  color: var(--accent-orange);
}

#sectionAttendance .ar-sig-match-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  margin-bottom: 10px;
}

#sectionAttendance .ar-sig-baseline-note {
  margin: 4px 0 0;
  font-size: 10px;
}

#sectionAttendance .ar-sig-baseline-only {
  max-width: 200px;
}

#sectionAttendance .ar-sig-view-btn.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

#sectionAttendance .ar-sig-expand-row td {
  padding: 0 !important;
  background: rgba(59, 130, 246, 0.04);
  border-bottom: 1px solid var(--border-glass);
}

#sectionAttendance .ar-sig-expand-row.hidden {
  display: none;
}

#sectionAttendance .ar-sig-expand-inner {
  padding: 10px 14px 12px;
}

#sectionAttendance .ar-sig-expand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

#sectionAttendance .ar-sig-mini-panel {
  flex: 1;
  min-width: 140px;
  max-width: 200px;
}

#sectionAttendance .ar-sig-mini-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

#sectionAttendance .ar-sig-mini-head .badge {
  font-size: 9px;
  padding: 1px 5px;
}

#sectionAttendance .ar-sig-mini-canvas {
  width: 100%;
  height: 56px;
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  background: #fff;
  display: block;
}

#sectionAttendance .ar-sig-expand-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-glass);
}

#sectionAttendance .ar-sig-note-input {
  flex: 1 1 180px;
  min-width: 120px;
  max-width: 320px;
  font-size: 12px;
  resize: vertical;
  min-height: 32px;
}

#sectionAttendance .ar-sig-reviewed {
  font-size: 10px;
}

#sectionAttendance .ar-trust-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-bottom: 4px;
}

#sectionAttendance .ar-trust-line:last-child {
  margin-bottom: 0;
}

#sectionAttendance .ar-trust-chip {
  display: inline-block;
  padding: 2px 7px;
  font-size: 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: default;
}

#sectionAttendance .ar-trust-chip.ar-trust-ok {
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--accent-green);
  background: rgba(34, 197, 94, 0.08);
}

#sectionAttendance .ar-trust-chip.ar-trust-warn {
  border-color: rgba(251, 191, 36, 0.35);
  color: var(--accent-orange);
  background: rgba(251, 191, 36, 0.08);
}

#sectionAttendance .ar-trust-chip.ar-trust-bad {
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.08);
}

#sectionAttendance .ar-trust-chip.ar-trust-admin {
  border-color: rgba(168, 85, 247, 0.35);
  color: #c084fc;
  background: rgba(168, 85, 247, 0.08);
}

#sectionAttendance .ar-loc-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

#sectionAttendance .ar-loc-line {
  color: var(--text-secondary);
}

#sectionAttendance .ar-loc-line.ar-loc-warn {
  color: var(--accent-orange);
}

#sectionAttendance .ar-loc-line.ar-loc-bad {
  color: var(--accent-red);
}

#sectionAttendance .ar-loc-campus {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

#sectionAttendance .ar-actions-cell {
  position: relative;
  text-align: right;
}

#sectionAttendance .ar-menu-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}

#sectionAttendance .ar-menu-btn:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

#sectionAttendance .ar-action-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 25;
  overflow: hidden;
}

#sectionAttendance .ar-action-menu.open {
  display: block;
}

#sectionAttendance .ar-action-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
}

#sectionAttendance .ar-action-item:hover {
  background: rgba(59, 130, 246, 0.1);
}

#sectionAttendance .ar-footer-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
}

#sectionAttendance .ar-footer-pager-btns {
  display: flex;
  gap: 6px;
}

#sectionAttendance .ar-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 900;
}

#sectionAttendance .ar-drawer-backdrop.hidden {
  display: none;
}

#sectionAttendance .ar-filter-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(340px, 92vw);
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-glass);
  z-index: 901;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
}

#sectionAttendance .ar-filter-drawer.hidden {
  display: none;
}

#sectionAttendance .ar-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-glass);
}

#sectionAttendance .ar-drawer-header h3 {
  margin: 0;
  font-size: 16px;
}

#sectionAttendance .ar-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#sectionAttendance .ar-drawer-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#sectionAttendance .ar-drawer-field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

#sectionAttendance .ar-drawer-field .filter-input {
  width: 100%;
  max-width: none;
}

#sectionAttendance .ar-drawer-toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

#sectionAttendance .ar-drawer-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  gap: 8px;
}

#sectionAttendance .ar-signature-compare-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

#sectionAttendance .ar-signature-panel {
  flex: 1;
  min-width: 240px;
}

#sectionAttendance .ar-sig-panel-title {
  font-weight: 600;
  margin-bottom: 6px;
}

#sectionAttendance .ar-sig-canvas {
  width: 100%;
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  background: #fff;
}

.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.filter-toolbar .filter-input {
  min-width: 120px;
  flex: 1 1 160px;
  max-width: 240px;
}

.filter-toolbar select.filter-input {
  flex: 1 1 180px;
  max-width: 280px;
}

.ar-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.ar-shift-time {
  color: var(--text-secondary);
  font-size: 11px;
}

.ar-punch-line {
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}

.ar-punch-line + .ar-punch-line {
  margin-top: 2px;
}

.ar-punch-num {
  color: var(--text-dim);
  font-size: 10px;
}

.ar-punch-in {
  color: var(--accent-green);
}

.ar-punch-out {
  color: var(--accent-orange);
}

#sectionAttendance .ar-row-clickable {
  cursor: pointer;
}

#sectionAttendance .ar-row-clickable:hover {
  background: rgba(59, 130, 246, 0.06);
}

@media (max-width: 768px) {
  #sectionAttendance .ar-command-bar {
    position: static;
  }

  #sectionAttendance .ar-col-location {
    display: none;
  }

  #sectionAttendance .ar-grouped-table .ar-col-location {
    display: none;
  }
}

.ar-row-clickable {
  cursor: pointer;
}

.ar-row-clickable:hover {
  background: rgba(59, 130, 246, 0.06);
}

.ar-timeline-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.ar-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 55vh;
  overflow-y: auto;
}

.ar-timeline-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-glass);
}

.ar-timeline-time {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.ar-timeline-body {
  font-size: 13px;
}

.ar-stats-panel {
  margin-bottom: 16px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.ar-stats-periods {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ar-period-btn.active {
  background: var(--accent-blue);
  color: #fff;
}

/* Live Workforce */
.lw-filters .lw-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.lw-main-map {
  height: 380px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--border-glass);
}

.lw-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.lw-emp-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: var(--transition-fast);
  cursor: pointer;
}

.lw-emp-card:hover,
.lw-emp-card.lw-card-active {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.lw-emp-card.inside {
  border-left: 3px solid var(--accent-green);
}

.lw-emp-card.outside {
  border-left: 3px solid var(--accent-red);
}

.lw-emp-card.checkin-only {
  border-left: 3px solid var(--accent-orange);
}

.lw-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.lw-card-name {
  font-weight: 600;
  font-size: 14px;
}

.lw-card-id {
  font-size: 11px;
  color: var(--text-muted);
}

.lw-card-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.lw-minimap {
  height: 140px;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0 8px;
  border: 1px solid var(--border-glass);
  background: var(--bg-secondary);
}

.lw-minimap-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
}

.lw-focus-btn {
  width: 100%;
  margin-top: 4px;
}

/* Video meetings / inspections admin */
.vi-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.vi-tab.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.vi-tab,
.msg91-tab,
.ar-period-btn {
  color: var(--text-secondary);
}

.vi-tab.active,
.msg91-tab.active,
.ar-period-btn.active {
  color: #fff;
}

.vi-panel.hidden {
  display: none;
}

.vi-emp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.vi-emp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.vi-schedule-form .filter-input {
  min-width: 160px;
}

/* Dashboard charts responsive */
.charts-row {
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .charts-row {
    grid-template-columns: 1fr !important;
  }
}

/* Payroll Management */
.pr-filters {
  margin-bottom: 14px;
}

.pr-context-bar {
  margin-bottom: 12px;
  align-items: center;
}

.pr-context-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-right: 4px;
}

.pr-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.pr-kpi-grid {
  margin-bottom: 16px;
}

.pr-meta-row {
  margin-top: 12px;
}

.pr-meta-actions {
  display: flex;
  gap: 8px;
}

.pr-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.pr-alert-panel,
.pr-mini-stats {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
}

.pr-alert-panel h3,
.pr-mini-stats h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.pr-alert-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}

.pr-alert-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 13px;
}

.pr-alert-item:last-child {
  border-bottom: none;
}

.pr-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pr-dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 16px;
  margin: 0;
  font-size: 13px;
}

.pr-dl dt {
  color: var(--text-secondary);
}

.pr-dl dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
}

.pr-trend-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pr-trend-list li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 13px;
}

.pr-slip-row {
  cursor: pointer;
}

.pr-slip-row:hover {
  background: rgba(99, 102, 241, 0.06);
}

.pr-actions-cell {
  white-space: nowrap;
}

.pr-actions-cell .btn {
  margin: 2px 0;
}

.pr-payslip-panel .pr-panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.pr-att-summary {
  font-size: 13px;
  margin-bottom: 16px;
}

.pr-earnings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .pr-earnings-grid {
    grid-template-columns: 1fr;
  }
}

.pr-earnings-grid h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.pr-totals-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 14px;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.04));
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 14px;
}

.pr-compare {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.pr-preflight-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.pr-preflight-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 13px;
}

.pr-preflight-item.fail {
  color: var(--accent-red);
}

.pr-preflight-samples {
  margin: 6px 0 0 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

.pr-reports-info {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 14px;
}

.pr-reports-info ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.pr-calc-panel {
  margin: 16px 0;
  padding: 14px;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.pr-calc-panel h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.pr-calc-formula {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-blue);
  margin: 0 0 8px;
}

.pr-calc-dl {
  margin-bottom: 12px;
}

.pr-calc-rules {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-secondary);
}

.pr-calc-rules li {
  margin-bottom: 4px;
}

.pr-calc-table-wrap {
  max-height: 220px;
  overflow: auto;
}

.pr-calc-table {
  font-size: 12px;
}

.pr-calc-rule {
  max-width: 280px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.payroll-rules-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.payroll-rules-group h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

.payroll-rule-row {
  margin-bottom: 8px;
}

.pr-rules-summary {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.pr-rules-group {
  margin-bottom: 16px;
}

.pr-rules-group h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.pr-rules-status-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pr-rules-status-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 13px;
}

.pr-rules-status-list li:last-child {
  border-bottom: none;
}

/* Manual Attendance Editor */
.ma-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

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

.ma-form-panel,
.ma-context-panel {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.ma-policy-banner {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ma-time-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.ma-time-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.ma-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ma-preview {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  font-size: 13px;
}

.ma-session-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 13px;
}

.ma-session-row:last-child {
  border-bottom: none;
}

.ma-recent-panel {
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.ma-recent-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 13px;
}

.ma-recent-row:last-child {
  border-bottom: none;
}

/* MSG91 messaging hub */
.msg91-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.msg91-tab.active {
  background: var(--accent, #6366f1);
  color: #fff;
}

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

.msg91-panel.hidden {
  display: none;
}

.msg91-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.msg91-stat-card {
  background: var(--bg-card, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 12px 14px;
}

.msg91-stat-label {
  display: block;
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 4px;
}

.msg91-voice-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-glass);
}

.msg91-voice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.msg91-tag {
  font-size: 11px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 2px 6px;
  border-radius: 4px;
}

.msg91-channel-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
}

.msg91-events-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.msg91-tpl-group {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-glass);
}

.msg91-tpl-group h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.msg91-camp-row {
  padding: 6px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 13px;
}

.msg91-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: lowercase;
}
.msg91-pill-sent { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
.msg91-pill-delivered { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.msg91-pill-read { background: rgba(16, 185, 129, 0.22); color: #6ee7b7; }
.msg91-pill-failed { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.msg91-pill-skipped { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.msg91-pill-muted { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

.msg91-tpl-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(15, 23, 42, 0.25);
}
.msg91-tpl-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.msg91-var { color: #38bdf8; }
.msg91-chip { opacity: 0.9; }
  padding: 6px 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 13px;
}

/* ═══════════════ BILLING ═══════════════ */
.section-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 2px;
}
.billing-content { display: flex; flex-direction: column; gap: 18px; }
.billing-loading, .billing-muted { color: var(--text-secondary); font-size: 14px; padding: 8px 0; }
.billing-error { color: #f87171; padding: 12px; }
.billing-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #f59e0b;
  border-radius: var(--radius-md, 12px);
  padding: 12px 14px;
  font-size: 13px;
}
.billing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.billing-card {
  background: var(--bg-card, rgba(255,255,255,0.03));
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
}
.billing-card-title { font-weight: 700; font-size: 15px; margin-bottom: 14px; }
.billing-plan-current { font-size: 20px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.billing-kv { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-secondary); margin: 8px 0 4px; }
.billing-wallet-balance { font-size: 28px; font-weight: 800; color: var(--accent-blue); }
.billing-topup { display: flex; gap: 8px; margin-top: 14px; }
.billing-topup input {
  flex: 1; min-width: 0; padding: 9px 12px;
  border: 1px solid var(--border-glass); border-radius: 10px;
  background: transparent; color: var(--text-primary, inherit);
}
.billing-badge {
  font-size: 11px; padding: 2px 10px; border-radius: 999px; font-weight: 600;
  background: rgba(148,163,184,0.15); color: var(--text-secondary); text-transform: capitalize;
}
.billing-badge-active, .billing-badge-paid { background: rgba(16,185,129,0.15); color: #34d399; }
.billing-badge-past_due, .billing-badge-unpaid { background: rgba(245,158,11,0.15); color: #f59e0b; }
.billing-badge-cancelled { background: rgba(239,68,68,0.15); color: #f87171; }
.billing-usage-row { display: grid; grid-template-columns: 90px 1fr 90px; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.billing-usage-label { color: var(--text-secondary); }
.billing-usage-bar { height: 8px; border-radius: 999px; background: rgba(148,163,184,0.15); overflow: hidden; }
.billing-usage-fill { height: 100%; background: var(--gradient-primary, #2563eb); border-radius: 999px; }
.billing-usage-fill.over { background: #ef4444; }
.billing-usage-count { text-align: right; color: var(--text-secondary); }
.billing-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.billing-plan-card { border: 1px solid var(--border-glass); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.billing-plan-card.current { border-color: var(--accent-blue); box-shadow: var(--glow-blue, 0 0 0 1px rgba(37,99,235,0.4)); }
.billing-plan-name { font-weight: 700; font-size: 16px; }
.billing-plan-price { font-size: 22px; font-weight: 800; }
.billing-plan-price span { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.billing-plan-min { font-size: 12px; color: var(--text-secondary); }
.billing-plan-modules { list-style: none; padding: 0; margin: 8px 0; font-size: 12px; color: var(--text-secondary); display: flex; flex-direction: column; gap: 3px; }
.billing-plan-card .btn { margin-top: auto; }
.btn-secondary { background: rgba(148,163,184,0.15); color: var(--text-secondary); border: 1px solid var(--border-glass); }
.billing-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.billing-table th { text-align: left; color: var(--text-secondary); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--border-glass); }
.billing-table td { padding: 10px 8px; border-bottom: 1px solid var(--border-glass); }
.billing-invoice-pdf { color: var(--accent-blue); text-decoration: none; }
.billing-invoice-pdf:hover { text-decoration: underline; }

/* ── Org branding card in dashboard sidebar ── */
.org-card {
  margin: 8px 10px 6px;
  padding: 8px 10px;
  border: 1px solid var(--border-glass, rgba(255,255,255,0.1));
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}
.org-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.org-card-name { font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-card-plan {
  flex: none; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
  padding: 2px 6px; border-radius: 999px;
  background: rgba(37,99,235,0.18); color: #93b4ff;
}
.org-card-plan.trial { background: rgba(251,191,36,0.18); color: #fcd34d; }
.org-card-plan.suspended { background: rgba(248,113,113,0.18); color: #fca5a5; }
.org-card-seats { margin-top: 6px; }
.org-card-seats-row { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: var(--text-secondary, #9aa4bd); }
.org-card-code { font-family: ui-monospace, monospace; opacity: .8; }
.org-card-meter { height: 4px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; margin-top: 4px; }
.org-card-meter span { display: block; height: 100%; width: 0; background: var(--accent-blue, #2563eb); transition: width .3s; }
.org-card-meter span.warn { background: #fbbf24; }
.org-card-meter span.over { background: #f87171; }

#impersonationBanner {
  position: sticky; top: 0; z-index: 200;
  background: #b45309; color: #fff;
  text-align: center; font-size: 13px; font-weight: 600;
  padding: 8px 14px;
}

.billing-banner-host {
  margin: -28px -28px 18px;
  width: calc(100% + 56px);
  max-width: none;
}
.billing-banner-host:empty {
  display: none;
  margin: 0;
}
.billing-banner {
  position: sticky; top: 0; z-index: 40;
  text-align: center; font-size: 13px; font-weight: 600;
  padding: 10px 16px;
  border-radius: 0;
}
.billing-banner.warn { background: #92710a; color: #fff; }
.billing-banner.danger { background: #b91c1c; color: #fff; }
.billing-banner a { color: #fff; text-decoration: underline; margin-left: 8px; }

/* ── Auth dark window (Billing-style) ── */
.login-page {
  padding: 24px 16px;
  align-items: center;
  background: #0b0e14;
  background-color: #0b0e14;
}

.login-page .bg-animation {
  opacity: 0.35;
  pointer-events: none;
}

.login-page .bg-orb {
  filter: saturate(0.35) brightness(0.55);
}

.login-page .login-back-home {
  background: rgba(20, 25, 38, 0.85);
  border-color: rgba(148, 163, 184, 0.18);
  color: #97a3c0;
}

.login-page .login-back-home:hover {
  color: #e8edf7;
  border-color: rgba(201, 162, 39, 0.55);
}

.login-wrapper.auth-shell {
  min-height: 520px;
  max-width: 960px;
  width: 100%;
  max-height: none;
  background: #121826;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: none;
}

.auth-shell .login-brand {
  padding: 40px 36px;
  background: linear-gradient(165deg, #161c2c 0%, #10151f 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: inset 3px 0 0 #c9a227;
}

.auth-shell .login-brand::before {
  background: radial-gradient(circle at 30% 40%, rgba(201, 162, 39, 0.08), transparent 60%);
  animation: none;
}

.auth-shell .brand-icon-ring {
  transform: none;
  margin-bottom: 18px;
}

.auth-shell .brand-content h1 {
  font-size: 2rem;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
  color: #f1f5f9;
}

.auth-shell .brand-highlight {
  color: #e8c547;
}

.auth-shell .brand-tagline {
  font-size: 14px;
  margin-bottom: 22px;
  line-height: 1.5;
  max-width: 28ch;
  color: #97a3c0;
}

.auth-shell .brand-features {
  margin-bottom: 0;
  gap: 10px;
}

.auth-shell .brand-feature {
  font-size: 13px;
  padding: 6px 0;
  color: #cbd5e1;
}

.auth-shell .feature-dot {
  background: #c9a227;
}

.auth-shell .login-form-panel {
  padding: 32px 36px;
  overflow-y: visible;
  max-height: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f131c;
}

.auth-shell .login-card {
  width: 100%;
  max-width: 420px;
  background: #141926;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-sizing: border-box;
}

.auth-shell.auth-shell-signup .login-card {
  max-width: 520px;
}

.auth-shell .login-header {
  margin-bottom: 18px;
  text-align: left;
}

.auth-shell .login-header h2 {
  font-size: 1.45rem;
  font-weight: 750;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.auth-shell .login-subtitle {
  font-size: 13px;
  margin-top: 0;
  line-height: 1.45;
  color: #97a3c0;
}

.auth-banner {
  display: none;
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
}

.auth-banner.warn {
  background: #92710a;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-banner.danger {
  background: #b91c1c;
  color: #fff;
}

.auth-shell .btn-login {
  padding: 13px 20px;
  min-height: 46px;
  font-size: 15px;
  margin-top: 8px;
  border-radius: 12px;
  border: none;
  background: #c9a227;
  color: #111827;
  font-weight: 700;
  box-shadow: none;
}

.auth-shell .btn-login::before {
  display: none;
}

.auth-shell .btn-login:hover {
  background: #dbb42f;
  transform: none;
  box-shadow: 0 8px 20px rgba(201, 162, 39, 0.25);
}

.auth-shell .btn-login:active {
  background: #b8921f;
}

.auth-shell .login-footer {
  padding-top: 18px;
  margin-top: 18px;
  font-size: 13px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  text-align: center;
}

.auth-shell .login-footer p {
  margin: 4px 0;
}

.auth-footer-prompt {
  margin: 0 0 10px;
  font-size: 13px;
  color: #97a3c0;
}

.auth-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.08);
  color: #f1f5f9 !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
  box-sizing: border-box;
}

.auth-btn-secondary:hover {
  border-color: rgba(201, 162, 39, 0.7);
  background: rgba(201, 162, 39, 0.16);
  color: #fff !important;
}

.auth-footer-cta {
  margin-bottom: 14px;
}

.auth-footer-quiet {
  margin: 0;
  font-size: 12px;
}

.auth-footer-quiet a {
  color: #64748b !important;
  font-weight: 500;
  text-decoration: none !important;
}

.auth-footer-quiet a:hover {
  color: #97a3c0 !important;
  text-decoration: underline !important;
}

.auth-shell .login-footer > p a {
  color: #e8c547;
  text-decoration: none;
  font-weight: 500;
}

.auth-shell .login-footer > p a:hover {
  text-decoration: underline;
}

.auth-section {
  margin-bottom: 18px;
}

.auth-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0 0 10px;
}

.auth-field {
  margin-bottom: 14px;
}

.auth-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #97a3c0;
  margin-bottom: 6px;
}

.auth-optional { font-weight: 400; opacity: .75; }

.auth-field input,
.auth-shell .auth-field input {
  width: 100%;
  padding: 12px 14px;
  min-height: 44px;
  background: #0b0e14;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  color: #e8edf7;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.auth-field input:hover {
  border-color: rgba(148, 163, 184, 0.35);
}

.auth-field input:focus {
  border-color: rgba(201, 162, 39, 0.65);
  background: #0d111a;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.auth-field.is-invalid input { border-color: #f87171; }

.auth-field .field-error {
  display: block;
  min-height: 0;
  margin-top: 4px;
  font-size: 12px;
  color: #f87171;
  line-height: 1.3;
}

.auth-field .field-error:empty { display: none; }

.auth-input-row { position: relative; display: flex; align-items: center; }
.auth-input-row input { padding-right: 64px; }

.auth-toggle-pw {
  position: absolute;
  right: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
  border-radius: 8px;
  color: #97a3c0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
}

.auth-toggle-pw:hover {
  color: #e8edf7;
  border-color: rgba(148, 163, 184, 0.2);
}

.auth-hint {
  font-size: 12px;
  color: #64748b;
  margin: 6px 0 0;
  line-height: 1.35;
}

.auth-hint-ok { color: #34d399; }
.auth-hint-err { color: #f87171; }

.auth-alert {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.45;
}

.auth-alert-error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.auth-alert-ok {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #a7f3d0;
}

.auth-alert-warn {
  background: rgba(201, 162, 39, 0.14);
  border: 1px solid rgba(201, 162, 39, 0.4);
  color: #fde68a;
}

.auth-mode-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
  padding: 4px;
  background: #0b0e14;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 999px;
}

.auth-mode-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: #97a3c0;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.auth-mode-tab:hover {
  color: #e8edf7;
}

.auth-mode-tab.active {
  background: rgba(201, 162, 39, 0.22);
  color: #f8fafc;
  box-shadow: none;
}

.auth-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.auth-chip {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255,255,255,0.03);
  color: #97a3c0;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.auth-chip:hover {
  border-color: rgba(201, 162, 39, 0.45);
  color: #e2e8f0;
}

.auth-chip.active {
  background: rgba(201, 162, 39, 0.2);
  border-color: rgba(201, 162, 39, 0.6);
  color: #f8fafc;
}

.auth-link-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  background: transparent;
  border: none;
  color: #97a3c0;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  padding: 10px;
}

.auth-link-btn:hover { color: #e8c547; }

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.auth-grid .auth-field { margin-bottom: 0; }

.auth-grid .auth-field-span {
  grid-column: 1 / -1;
}

.auth-field-gstin label {
  font-size: 12px;
  opacity: 0.9;
}

.signup-plan-banner {
  background: #92710a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.45;
  color: #fff;
  font-weight: 600;
}

.signup-plan-banner strong { color: #fff; }
.signup-plan-banner.signup-disabled {
  background: rgba(185, 28, 28, 0.9);
  border-color: rgba(255,255,255,0.08);
}
.signup-plan-banner a { color: #fff; text-decoration: underline; }

@media (max-height: 640px) {
  .auth-shell .brand-features { display: none; }
}

@media (max-width: 768px) {
  .auth-grid { grid-template-columns: 1fr; gap: 12px; }
  .login-wrapper.auth-shell {
    min-height: 0;
  }
  .auth-shell .login-form-panel {
    padding: 20px 16px;
    align-items: flex-start;
  }
  .auth-shell .login-brand {
    padding: 28px 24px;
    box-shadow: inset 0 3px 0 #c9a227;
  }
  .auth-shell .login-card {
    padding: 18px 16px 14px;
  }
  .auth-mode-tabs {
    margin-bottom: 16px;
  }
}

/* ═══ Employee HRIS drawer (Pillar A) ═══ */
.emp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.emp-filters .search-input { flex: 1 1 220px; min-width: 180px; }
.emp-filters .filter-input { flex: 0 1 160px; min-width: 140px; }

.emp-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1200;
  display: flex;
  justify-content: flex-end;
}
.emp-drawer-overlay.hidden { display: none; }
.emp-drawer {
  width: min(560px, 100vw);
  height: 100%;
  background: var(--bg-card, #fff);
  color: var(--text-primary, #0f172a);
  box-shadow: -8px 0 32px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  animation: empDrawerIn 0.2s ease-out;
}
@keyframes empDrawerIn {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}
.emp-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.emp-drawer-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}
.emp-drawer-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}
.emp-drawer-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-secondary, #64748b);
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.emp-drawer-close:hover { background: var(--bg-hover, #f1f5f9); }
.emp-drawer-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.emp-tab {
  border: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary, #64748b);
  border-radius: 8px;
  white-space: nowrap;
}
.emp-tab.active {
  background: var(--primary-soft, rgba(37, 99, 235, 0.1));
  color: var(--primary, #2563eb);
  font-weight: 600;
}
.emp-drawer-body {
  flex: 1;
  overflow: auto;
  padding: 16px 20px;
}
.emp-drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.emp-kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.emp-kv-grid .emp-k {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 2px;
}
.emp-kv-grid .emp-v { font-size: 14px; font-weight: 500; }
.emp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.emp-form-grid .form-group { margin-bottom: 8px; }
.emp-action-row, .emp-doc-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}
@media (max-width: 560px) {
  .emp-kv-grid, .emp-form-grid { grid-template-columns: 1fr; }
}