/* ==========================================================================
   SC8TIME DESIGN SYSTEM v2.0 — CORA-INSPIRED OPERATIONAL SAAS
   Designed for Precision, Clarity, High Performance (<2s punch) & WCAG AA
   ========================================================================== */

/* ── 1. DESIGN TOKENS (LIGHT DEFAULT & PRO DARK READY) ────────────────────── */

:root {
  /* Canvas & Surface Foundations */
  --sc8-bg-canvas: #F8FAFC;          /* Slate 50 — Main Page Canvas */
  --sc8-bg-surface: #FFFFFF;         /* Pure White — Cards, Modals, Panels */
  --sc8-bg-subtle: #F1F5F9;          /* Slate 100 — Secondary backgrounds, pill tracks */
  --sc8-bg-hover: #E2E8F0;           /* Slate 200 — Interactive hover */
  --sc8-bg-active: #CBD5E1;          /* Slate 300 — Interactive active state */

  /* Typography & High Contrast Colors */
  --sc8-text-primary: #0F172A;       /* Slate 900 — Headings, key data (15.8:1 on white) */
  --sc8-text-secondary: #334155;     /* Slate 700 — Subtitles, form labels (9.6:1 on white) */
  --sc8-text-tertiary: #64748B;      /* Slate 500 — Metadata, timestamps (4.6:1 on white) */
  --sc8-text-muted: #94A3B8;         /* Slate 400 — Placeholders, disabled text */
  --sc8-text-inverse: #FFFFFF;       /* White — Text on dark surfaces */

  /* Borders & Dividers */
  --sc8-border-subtle: #F1F5F9;      /* Slate 100 — Subtle item dividers */
  --sc8-border-default: #E2E8F0;     /* Slate 200 — Standard card/table borders */
  --sc8-border-strong: #CBD5E1;      /* Slate 300 — Input borders, active outlines */
  --sc8-border-focus: #2563EB;       /* Blue 600 — Focus visible outline */

  /* Brand Signature (Deep Navy & Electric Cyan/Blue) */
  --sc8-brand-navy: #0B132B;         /* Deep Navy — Sidebar & brand background */
  --sc8-brand-navy-light: #162244;   /* Navy Slate — Sidebar item active/hover */
  --sc8-brand-blue: #2563EB;         /* Blue 600 — Primary action accent */
  --sc8-brand-blue-hover: #1D4ED8;   /* Blue 700 — Primary action hover */
  --sc8-brand-blue-rgb: 37, 99, 235;
  --sc8-brand-blue-subtle: #EFF6FF;  /* Blue 50 — Active pill / background */
  --sc8-brand-cyan: #0284C7;         /* Sky 600 — Secondary tech accent */

  /* Semantic Status Indicators */
  --sc8-status-success: #059669;     /* Emerald 600 — Clock In, Verified OK */
  --sc8-status-success-hover: #047857;
  --sc8-status-success-rgb: 5, 150, 105;
  --sc8-status-success-bg: #ECFDF5;  /* Emerald 50 */
  --sc8-status-success-text: #065F46;/* Emerald 800 */

  --sc8-status-warning: #D97706;     /* Amber 600 — Pause, Pending approval */
  --sc8-status-warning-hover: #B45309;
  --sc8-status-warning-rgb: 217, 119, 6;
  --sc8-status-warning-bg: #FFFBEB;  /* Amber 50 */
  --sc8-status-warning-text: #92400E;/* Amber 800 */

  --sc8-status-danger: #DC2626;      /* Red 600 — Clock Out, Critical alert */
  --sc8-status-danger-hover: #B91C1C;
  --sc8-status-danger-rgb: 220, 38, 38;
  --sc8-status-danger-bg: #FEF2F2;   /* Red 50 */
  --sc8-status-danger-text: #991B1B; /* Red 800 */

  --sc8-status-info: #0284C7;        /* Sky 600 — Holidays, General notices */
  --sc8-status-info-bg: #F0F9FF;     /* Sky 50 */
  --sc8-status-info-text: #075985;   /* Sky 800 */

  /* Typography Scales */
  --sc8-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sc8-font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;

  /* Spacing Grid (4px base) */
  --sc8-space-1: 4px;
  --sc8-space-2: 8px;
  --sc8-space-3: 12px;
  --sc8-space-4: 16px;
  --sc8-space-5: 20px;
  --sc8-space-6: 24px;
  --sc8-space-8: 32px;
  --sc8-space-10: 40px;
  --sc8-space-12: 48px;

  /* Border Radii */
  --sc8-radius-sm: 6px;
  --sc8-radius-md: 10px;
  --sc8-radius-lg: 14px;
  --sc8-radius-xl: 20px;
  --sc8-radius-pill: 9999px;

  /* Subtle Modern Shadows */
  --sc8-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --sc8-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --sc8-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.05), 0 2px 4px rgba(15, 23, 42, 0.03);
  --sc8-shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --sc8-shadow-punch: 0 10px 25px -3px rgba(37, 99, 235, 0.35);

  /* Layout Dimensions */
  --sc8-sidebar-w: 280px;
  --sc8-topbar-h: 56px;
  --sc8-mobile-nav-h: 64px;

  /* Transitions */
  --sc8-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --sc8-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Bootstrap 5 Overrides Mapping */
  --bs-body-font-family: var(--sc8-font-sans);
  --bs-body-font-size: 0.9rem;
  --bs-body-bg: var(--sc8-bg-canvas);
  --bs-body-color: var(--sc8-text-primary);
  --bs-primary: var(--sc8-brand-blue);
  --bs-primary-rgb: var(--sc8-brand-blue-rgb);
  --bs-success: var(--sc8-status-success);
  --bs-success-rgb: var(--sc8-status-success-rgb);
  --bs-warning: var(--sc8-status-warning);
  --bs-warning-rgb: var(--sc8-status-warning-rgb);
  --bs-danger: var(--sc8-status-danger);
  --bs-danger-rgb: var(--sc8-status-danger-rgb);
  --bs-border-radius: var(--sc8-radius-md);
  --bs-border-radius-lg: var(--sc8-radius-lg);
  --bs-border-color: var(--sc8-border-default);
}

/* ── 2. SC8TIME PRO DARK MODE (PREPARED TOKENS) ──────────────────────────── */

[data-bs-theme="dark"] {
  --sc8-bg-canvas: #0C101C;
  --sc8-bg-surface: #151B2E;
  --sc8-bg-subtle: #1C243B;
  --sc8-bg-hover: #26314D;
  --sc8-bg-active: #324065;

  --sc8-text-primary: #F8FAFC;
  --sc8-text-secondary: #CBD5E1;
  --sc8-text-tertiary: #94A3B8;
  --sc8-text-muted: #64748B;

  --sc8-border-subtle: #192138;
  --sc8-border-default: #222C46;
  --sc8-border-strong: #2F3D61;

  --sc8-brand-blue-subtle: rgba(37, 99, 235, 0.18);
  --sc8-status-success-bg: rgba(5, 150, 105, 0.18);
  --sc8-status-success-text: #34D399;
  --sc8-status-warning-bg: rgba(217, 119, 6, 0.18);
  --sc8-status-warning-text: #FBBF24;
  --sc8-status-danger-bg: rgba(220, 38, 38, 0.18);
  --sc8-status-danger-text: #F87171;
  --sc8-status-info-bg: rgba(2, 132, 199, 0.18);
  --sc8-status-info-text: #38BDF8;

  --bs-body-bg: var(--sc8-bg-canvas);
  --bs-body-color: var(--sc8-text-primary);
  --bs-border-color: var(--sc8-border-default);
}

/* ── 3. BASE & ACCESSIBILITY ─────────────────────────────────────────────── */

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

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

body {
  font-family: var(--sc8-font-sans);
  background-color: var(--sc8-bg-canvas);
  color: var(--sc8-text-primary);
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* Focus Visible Accessible Styling */
:focus-visible {
  outline: 2px solid var(--sc8-border-focus) !important;
  outline-offset: 2px !important;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

a {
  color: var(--sc8-brand-blue);
  text-decoration: none;
  transition: color var(--sc8-transition-fast);
}
a:hover {
  color: var(--sc8-brand-blue-hover);
}

/* ── 4. TYPOGRAPHY ───────────────────────────────────────────────────────── */

h1, .h1 {
  font-size: 1.75rem; /* 28px (max 32px) */
  font-weight: 700;
  color: var(--sc8-text-primary);
  letter-spacing: -0.025em;
  line-height: 1.25;
}

h2, .h2 {
  font-size: 1.375rem; /* 22px (max 24px) */
  font-weight: 600;
  color: var(--sc8-text-primary);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h3, .h3 {
  font-size: 1.15rem; /* 18.4px (max 20px) */
  font-weight: 600;
  color: var(--sc8-text-primary);
  letter-spacing: -0.015em;
  line-height: 1.25;
}

h4, h5, h6, .h4, .h5, .h6 {
  font-weight: 600;
  color: var(--sc8-text-primary);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.sc8-page-header {
  margin-bottom: var(--sc8-space-4);
}
.sc8-page-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--sc8-text-primary);
  margin-bottom: 2px;
}
.sc8-page-subtitle {
  font-size: 0.8125rem;
  color: var(--sc8-text-tertiary);
  margin: 0;
}

/* ── 5. LAYOUT: CORA SIDEBAR & TOPBAR ────────────────────────────────────── */

.sc8-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar CORA */
.sc8-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sc8-sidebar-w);
  background-color: var(--sc8-brand-navy);
  color: #F8FAFC;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform var(--sc8-transition);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sc8-sidebar-brand {
  padding: 12px var(--sc8-space-5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--sc8-topbar-h);
}

.sc8-logo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.sc8-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--sc8-radius-sm);
  background: linear-gradient(135deg, #2563EB 0%, #0284C7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}
.sc8-logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFF;
  letter-spacing: -0.03em;
}
.sc8-logo-text span {
  color: #60A5FA;
}

.sc8-sidebar-company-badge {
  display: block;
  font-size: 0.7rem;
  color: #94A3B8;
  padding: 6px var(--sc8-space-5);
  background-color: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc8-sidebar-nav {
  flex: 1;
  padding: var(--sc8-space-3) var(--sc8-space-2);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sc8-space-3);
}

.sc8-sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sc8-sidebar-group-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748B;
  padding: 6px 12px 2px 12px;
}

.sc8-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--sc8-radius-md);
  color: #94A3B8;
  font-size: 0.825rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--sc8-transition-fast);
  position: relative;
  min-height: 36px;
}
.sc8-sidebar-link i {
  font-size: 1.05rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  color: #64748B;
  transition: color var(--sc8-transition-fast);
}
.sc8-sidebar-link:hover {
  color: #FFFFFF;
  background-color: var(--sc8-brand-navy-light);
}
.sc8-sidebar-link:hover i {
  color: #93C5FD;
}
.sc8-sidebar-link.active {
  color: #FFFFFF;
  background-color: #1E2E5C;
  font-weight: 600;
}
.sc8-sidebar-link.active i {
  color: #60A5FA;
}
.sc8-sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  background-color: #3B82F6;
  border-radius: 0 3px 3px 0;
}

.sc8-sidebar-footer {
  padding: var(--sc8-space-3) var(--sc8-space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sc8-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 1035;
}
.sc8-sidebar-overlay.active {
  display: block;
}

/* Main Container & Topbar */
.sc8-main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sc8-sidebar-w);
  transition: margin-left var(--sc8-transition);
}
.sc8-main-container.sc8-main-fullwidth {
  margin-left: 0 !important;
}

.sc8-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  height: var(--sc8-topbar-h);
  padding: 0 var(--sc8-space-5);
  background-color: var(--sc8-bg-surface);
  border-bottom: 1px solid var(--sc8-border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sc8-topbar-left {
  display: flex;
  align-items: center;
  gap: var(--sc8-space-3);
}
.sc8-topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sc8-space-3);
}

.sc8-mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--sc8-border-default);
  color: var(--sc8-text-primary);
  font-size: 1.15rem;
  padding: 6px 8px;
  border-radius: var(--sc8-radius-md);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.sc8-main {
  flex: 1;
  padding: var(--sc8-space-5);
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}
.sc8-main-auth {
  padding: 0;
  max-width: 100%;
}

/* ── 6. CARDS & BENTO GRID ────────────────────────────────────────────────── */

.sc8-card {
  background-color: var(--sc8-bg-surface);
  border: 1px solid var(--sc8-border-default);
  border-radius: var(--sc8-radius-lg);
  box-shadow: var(--sc8-shadow-sm);
  padding: 20px;
  transition: box-shadow var(--sc8-transition), border-color var(--sc8-transition);
}
.sc8-card:hover {
  box-shadow: var(--sc8-shadow-md);
}

.sc8-bento-grid {
  display: grid;
  gap: var(--sc8-space-3);
}
.sc8-bento-4 { grid-template-columns: repeat(4, 1fr); }
.sc8-bento-3 { grid-template-columns: repeat(3, 1fr); }
.sc8-bento-2 { grid-template-columns: repeat(2, 1fr); }

.sc8-kpi-card {
  background-color: var(--sc8-bg-surface);
  border: 1px solid var(--sc8-border-default);
  border-radius: var(--sc8-radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--sc8-shadow-sm);
  transition: transform var(--sc8-transition), box-shadow var(--sc8-transition);
}
.sc8-kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--sc8-shadow-md);
}

.sc8-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sc8-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--sc8-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.sc8-kpi-icon-primary { background-color: var(--sc8-brand-blue-subtle); color: var(--sc8-brand-blue); }
.sc8-kpi-icon-success { background-color: var(--sc8-status-success-bg); color: var(--sc8-status-success); }
.sc8-kpi-icon-warning { background-color: var(--sc8-status-warning-bg); color: var(--sc8-status-warning); }
.sc8-kpi-icon-danger  { background-color: var(--sc8-status-danger-bg);  color: var(--sc8-status-danger); }
.sc8-kpi-icon-info    { background-color: var(--sc8-status-info-bg);    color: var(--sc8-status-info); }

.sc8-kpi-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sc8-text-tertiary);
}
.sc8-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--sc8-text-primary);
  line-height: 1.1;
  margin: 2px 0;
}
.sc8-kpi-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sc8-text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: auto;
  transition: color var(--sc8-transition-fast);
}
.sc8-kpi-link:hover {
  color: var(--sc8-brand-blue);
}

/* ── 7. PILLS & STATUS BADGES ─────────────────────────────────────────────── */

.sc8-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--sc8-radius-pill);
  font-size: 0.71875rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
}
.sc8-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.sc8-pill-success {
  background-color: var(--sc8-status-success-bg);
  color: var(--sc8-status-success-text);
  border: 1px solid rgba(5, 150, 105, 0.2);
}
.sc8-pill-success .sc8-pill-dot {
  background-color: var(--sc8-status-success);
}

.sc8-pill-warning {
  background-color: var(--sc8-status-warning-bg);
  color: var(--sc8-status-warning-text);
  border: 1px solid rgba(217, 119, 6, 0.2);
}
.sc8-pill-warning .sc8-pill-dot {
  background-color: var(--sc8-status-warning);
}

.sc8-pill-danger {
  background-color: var(--sc8-status-danger-bg);
  color: var(--sc8-status-danger-text);
  border: 1px solid rgba(220, 38, 38, 0.2);
}
.sc8-pill-danger .sc8-pill-dot {
  background-color: var(--sc8-status-danger);
}

.sc8-pill-info {
  background-color: var(--sc8-status-info-bg);
  color: var(--sc8-status-info-text);
  border: 1px solid rgba(2, 132, 199, 0.2);
}
.sc8-pill-info .sc8-pill-dot {
  background-color: var(--sc8-status-info);
}

.sc8-pill-neutral {
  background-color: var(--sc8-bg-subtle);
  color: var(--sc8-text-secondary);
  border: 1px solid var(--sc8-border-default);
}
.sc8-pill-neutral .sc8-pill-dot {
  background-color: var(--sc8-text-tertiary);
}

/* ── 8. HERO DE FICHAJE RÁPIDO (< 2 SEGUNDOS) ────────────────────────────── */

.sc8-punch-hero {
  text-align: center;
  padding: 24px 20px;
  background-color: var(--sc8-bg-surface);
  border: 1px solid var(--sc8-border-default);
  border-radius: var(--sc8-radius-lg);
  box-shadow: var(--sc8-shadow-sm);
  margin-bottom: var(--sc8-space-4);
}

.sc8-punch-clock {
  font-family: var(--sc8-font-mono);
  font-size: 2.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--sc8-text-primary);
  line-height: 1;
  margin-bottom: 2px;
}

.sc8-punch-date {
  font-size: 0.8125rem;
  color: var(--sc8-text-tertiary);
  font-weight: 500;
  margin-bottom: var(--sc8-space-3);
}

.sc8-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--sc8-radius-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: var(--sc8-space-4);
}
.sc8-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.sc8-status-working {
  background-color: var(--sc8-status-success-bg);
  color: var(--sc8-status-success-text);
  border: 1px solid rgba(5, 150, 105, 0.25);
}
.sc8-status-working .sc8-status-dot {
  background-color: var(--sc8-status-success);
  animation: sc8Pulse 2s infinite;
}

.sc8-status-paused {
  background-color: var(--sc8-status-warning-bg);
  color: var(--sc8-status-warning-text);
  border: 1px solid rgba(217, 119, 6, 0.25);
}
.sc8-status-paused .sc8-status-dot {
  background-color: var(--sc8-status-warning);
  animation: sc8Pulse 2s infinite;
}

.sc8-status-inactive {
  background-color: var(--sc8-bg-subtle);
  color: var(--sc8-text-secondary);
  border: 1px solid var(--sc8-border-default);
}
.sc8-status-inactive .sc8-status-dot {
  background-color: var(--sc8-text-tertiary);
}

.sc8-punch-actions {
  display: flex;
  justify-content: center;
  gap: var(--sc8-space-3);
  margin-bottom: var(--sc8-space-3);
  flex-wrap: wrap;
}

/* Primary Punch Button (Strictly ≥ 56px height preserved) */
.sc8-btn-punch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--sc8-radius-md);
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--sc8-font-sans);
  cursor: pointer;
  color: #FFF;
  transition: all var(--sc8-transition);
  touch-action: manipulation;
}
.sc8-btn-punch:hover {
  transform: translateY(-1px);
}
.sc8-btn-punch:active {
  transform: translateY(0);
}
.sc8-btn-punch:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.sc8-btn-punch i {
  font-size: 1.25rem;
}

.sc8-btn-punch-in {
  background-color: var(--sc8-status-success);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}
.sc8-btn-punch-in:hover {
  background-color: var(--sc8-status-success-hover);
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.4);
}

.sc8-btn-punch-out {
  background-color: var(--sc8-status-danger);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}
.sc8-btn-punch-out:hover {
  background-color: var(--sc8-status-danger-hover);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.4);
}

.sc8-btn-punch-pause {
  background-color: var(--sc8-status-warning);
  color: #FFF;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3);
}
.sc8-btn-punch-pause:hover {
  background-color: var(--sc8-status-warning-hover);
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.4);
}

.sc8-btn-punch-resume {
  background-color: var(--sc8-brand-blue);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}
.sc8-btn-punch-resume:hover {
  background-color: var(--sc8-brand-blue-hover);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.sc8-punch-last-entry {
  font-size: 0.775rem;
  color: var(--sc8-text-tertiary);
}

/* ── 9. BUTTONS, FORMS & TABLES ───────────────────────────────────────────── */

.btn {
  border-radius: var(--sc8-radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 7px 16px;
  min-height: 40px;
  font-family: var(--sc8-font-sans);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--sc8-transition-fast);
}
.btn-sm {
  padding: 4px 10px;
  font-size: 0.775rem;
  min-height: 32px;
}
.btn-primary {
  background-color: var(--sc8-brand-blue);
  border-color: var(--sc8-brand-blue);
}
.btn-primary:hover {
  background-color: var(--sc8-brand-blue-hover);
  border-color: var(--sc8-brand-blue-hover);
}
.btn-outline-primary {
  color: var(--sc8-brand-blue);
  border-color: var(--sc8-border-default);
  background-color: var(--sc8-bg-surface);
}
.btn-outline-primary:hover {
  background-color: var(--sc8-brand-blue-subtle);
  color: var(--sc8-brand-blue);
  border-color: var(--sc8-brand-blue);
}

/* Forms (Height ~42-44px) */
.form-control, .form-select {
  border-radius: var(--sc8-radius-md);
  border: 1px solid var(--sc8-border-strong);
  font-size: 0.85rem;
  padding: 8px 12px;
  min-height: 42px;
  background-color: var(--sc8-bg-surface);
  color: var(--sc8-text-primary);
  transition: border-color var(--sc8-transition-fast), box-shadow var(--sc8-transition-fast);
}
.form-control:focus, .form-select:focus {
  border-color: var(--sc8-brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-label {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--sc8-text-secondary);
  margin-bottom: 4px;
}

/* Modern Compact Accessible Tables (Rows ~56-60px) */
.table-responsive {
  border-radius: var(--sc8-radius-lg);
  border: 1px solid var(--sc8-border-default);
  background-color: var(--sc8-bg-surface);
}
.table {
  --bs-table-bg: transparent;
  font-size: 0.85rem;
  margin-bottom: 0;
}
.table > thead > tr > th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sc8-text-tertiary);
  background-color: var(--sc8-bg-subtle);
  border-bottom: 1px solid var(--sc8-border-default);
  padding: 10px 14px;
  white-space: nowrap;
}
.table > tbody > tr > td {
  padding: 10px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--sc8-border-subtle);
  color: var(--sc8-text-primary);
}
.table > tbody > tr:last-child > td {
  border-bottom: none;
}
.table-hover > tbody > tr:hover > td {
  background-color: var(--sc8-bg-subtle);
}

/* ── 10. AUTH / LOGIN REDESIGN ───────────────────────────────────────────── */

.sc8-auth-wrapper {
  min-height: 100vh;
  display: flex;
  width: 100%;
}

.sc8-auth-brand {
  flex: 1.1;
  background: linear-gradient(145deg, #0B132B 0%, #172554 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sc8-space-10);
  color: #FFF;
  position: relative;
  overflow: hidden;
}
.sc8-auth-brand-content {
  position: relative;
  z-index: 2;
  max-width: 440px;
  text-align: center;
}
.sc8-auth-brand-logo {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: var(--sc8-space-2);
}
.sc8-auth-brand-logo span {
  color: #60A5FA;
}
.sc8-auth-brand-tagline {
  font-size: 1.125rem;
  color: #94A3B8;
  line-height: 1.6;
  margin-bottom: var(--sc8-space-6);
}
.sc8-auth-badge-legal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--sc8-radius-pill);
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.8125rem;
  color: #CBD5E1;
}

.sc8-auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sc8-space-8);
  background-color: var(--sc8-bg-canvas);
}
.sc8-auth-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--sc8-bg-surface);
  border: 1px solid var(--sc8-border-default);
  border-radius: var(--sc8-radius-xl);
  padding: var(--sc8-space-8);
  box-shadow: var(--sc8-shadow-md);
}
.sc8-auth-title {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--sc8-text-primary);
  margin-bottom: var(--sc8-space-1);
}
.sc8-auth-subtitle {
  font-size: 0.875rem;
  color: var(--sc8-text-tertiary);
  margin-bottom: var(--sc8-space-6);
}

/* ── 11. QUIOSCO TÁCTIL REDESIGN ─────────────────────────────────────────── */

.sc8-kiosk-page {
  min-height: 100vh;
  background-color: var(--sc8-brand-navy);
  color: #FFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--sc8-space-6);
}

.sc8-kiosk-card {
  background-color: #151F3C;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--sc8-radius-xl);
  padding: var(--sc8-space-8);
  box-shadow: var(--sc8-shadow-lg);
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.sc8-kiosk-pin-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: var(--sc8-space-6) 0;
}
.sc8-kiosk-pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #475569;
  background-color: transparent;
  transition: all var(--sc8-transition-fast);
}
.sc8-kiosk-pin-dot.filled {
  background-color: #38BDF8;
  border-color: #38BDF8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.sc8-kiosk-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.sc8-kiosk-btn {
  height: 72px;
  border-radius: var(--sc8-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.06);
  color: #FFF;
  font-size: 1.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--sc8-transition-fast);
  touch-action: manipulation;
  user-select: none;
}
.sc8-kiosk-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}
.sc8-kiosk-btn:active {
  background-color: #2563EB;
  transform: scale(0.96);
}
.sc8-kiosk-btn-action {
  font-size: 1.25rem;
  background-color: rgba(255, 255, 255, 0.04);
}

/* ── 12. MOBILE NAVIGATION BAR ───────────────────────────────────────────── */

.sc8-mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--sc8-mobile-nav-h);
  background-color: var(--sc8-bg-surface);
  border-top: 1px solid var(--sc8-border-default);
  z-index: 1030;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
  box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.05);
}

.sc8-mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 48px;
  padding: 4px 8px;
  border-radius: var(--sc8-radius-md);
  color: var(--sc8-text-tertiary);
  text-decoration: none;
  font-size: 0.6875rem;
  font-weight: 600;
  transition: color var(--sc8-transition-fast);
}
.sc8-mobile-nav-item i {
  font-size: 1.35rem;
  margin-bottom: 2px;
}
.sc8-mobile-nav-item:hover, .sc8-mobile-nav-item.active {
  color: var(--sc8-brand-blue);
}

/* ── 13. ANIMATIONS & RESPONSIVE ─────────────────────────────────────────── */

@keyframes sc8FadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes sc8Pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

@media (max-width: 991.98px) {
  .sc8-bento-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767.98px) {
  .sc8-sidebar {
    transform: translateX(-100%);
  }
  .sc8-sidebar.sc8-sidebar-open {
    transform: translateX(0);
    box-shadow: var(--sc8-shadow-lg);
  }
  .sc8-main-container {
    margin-left: 0 !important;
  }
  .sc8-mobile-menu-btn {
    display: flex;
  }
  .sc8-main {
    padding: var(--sc8-space-4);
  }
  .sc8-mobile-nav {
    display: flex;
  }
  .sc8-main-container.sc8-has-mobile-nav .sc8-main {
    padding-bottom: calc(var(--sc8-mobile-nav-h) + var(--sc8-space-6));
  }
  .sc8-punch-clock {
    font-size: 2.75rem;
  }
  .sc8-auth-brand {
    display: none;
  }
  .sc8-auth-form-side {
    padding: var(--sc8-space-4);
  }
  .sc8-auth-card {
    padding: var(--sc8-space-6);
  }
}

@media (max-width: 575.98px) {
  .sc8-bento-4, .sc8-bento-3 {
    grid-template-columns: 1fr;
  }
  .sc8-btn-punch {
    width: 100%;
    padding: 14px 20px;
  }
}

/* ── 14. CONTRASTE LEGIBLE (WCAG AA) ─────────────────────────────────────── */
/* Cian (info) y ámbar (warning) de Bootstrap no alcanzan contraste como color de texto sobre
   fondos claros: se usan sus variantes "emphasis", que Bootstrap redefine en modo oscuro. */
.text-info { color: var(--bs-info-text-emphasis) !important; }
.text-warning { color: var(--bs-warning-text-emphasis) !important; }

.btn-outline-info {
  --bs-btn-color: var(--bs-info-text-emphasis);
  --bs-btn-border-color: #0aa2c0;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #087990;
  --bs-btn-hover-border-color: #087990;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #087990;
  --bs-btn-active-border-color: #087990;
  --bs-btn-disabled-color: var(--bs-info-text-emphasis);
}
.btn-outline-warning {
  --bs-btn-color: var(--bs-warning-text-emphasis);
  --bs-btn-border-color: #cc9a06;
  --bs-btn-hover-color: #000;
  --bs-btn-hover-bg: #ffc107;
  --bs-btn-hover-border-color: #ffc107;
  --bs-btn-active-color: #000;
  --bs-btn-active-bg: #ffc107;
  --bs-btn-active-border-color: #ffc107;
  --bs-btn-disabled-color: var(--bs-warning-text-emphasis);
}

/* Insignias sobre cian/ámbar: texto oscuro en lugar del blanco por defecto */
.badge.bg-info, .badge.bg-warning { --bs-badge-color: #111827; color: #111827; }

/* Los títulos (color fijo por la tipografía) heredan el blanco de cabeceras de color */
.text-white :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) { color: inherit; }

/* Verde de estado sobre fondos "-subtle" (insignias, resúmenes): variante oscura */
[class*="-subtle"].text-success, [class*="-subtle"] .text-success { color: var(--bs-success-text-emphasis) !important; }
