/* ============================================================
   HORALEGAL — Design System CSS
   Translated from Google Stitch / Material Design 3
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

/* ── CSS Custom Properties (M3 Color Tokens) ─────────────── */
:root {
  /* Primary */
  --primary: #00236f;
  --on-primary: #ffffff;
  --primary-container: #1e3a8a;
  --on-primary-container: #90a8ff;
  --primary-fixed: #dce1ff;
  --primary-fixed-dim: #b6c4ff;
  --on-primary-fixed: #00164e;
  --on-primary-fixed-variant: #264191;
  --inverse-primary: #b6c4ff;

  /* Secondary */
  --secondary: #585f67;
  --on-secondary: #ffffff;
  --secondary-container: #dce3ec;
  --on-secondary-container: #5e656d;
  --secondary-fixed: #dce3ec;
  --secondary-fixed-dim: #c0c7d0;
  --on-secondary-fixed: #151c23;
  --on-secondary-fixed-variant: #40484f;

  /* Tertiary */
  --tertiary: #00311f;
  --on-tertiary: #ffffff;
  --tertiary-container: #004a31;
  --on-tertiary-container: #27c38a;
  --tertiary-fixed: #6ffbbe;
  --tertiary-fixed-dim: #4edea3;
  --on-tertiary-fixed: #002113;
  --on-tertiary-fixed-variant: #005236;

  /* Error */
  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-container: #ffdad6;
  --on-error-container: #93000a;

  /* Surface */
  --surface: #f8f9ff;
  --surface-dim: #cbdbf5;
  --surface-bright: #f8f9ff;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #eff4ff;
  --surface-container: #e5eeff;
  --surface-container-high: #dce9ff;
  --surface-container-highest: #d3e4fe;
  --on-surface: #0b1c30;
  --on-surface-variant: #444651;
  --surface-variant: #d3e4fe;
  --surface-tint: #4059aa;

  /* Inverse */
  --inverse-surface: #213145;
  --inverse-on-surface: #eaf1ff;

  /* Outline */
  --outline: #757682;
  --outline-variant: #c5c5d3;

  /* Background */
  --background: #f8f9ff;
  --on-background: #0b1c30;

  /* Semantic Colors */
  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.125);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.125);

  /* Shadows (tinted with primary) */
  --shadow-card: 0px 4px 20px rgba(30, 58, 138, 0.05);
  --shadow-sm: 0 1px 2px rgba(30, 58, 138, 0.06);
  --shadow-md: 0 4px 12px rgba(30, 58, 138, 0.08);
  --shadow-xl: 0 8px 32px rgba(30, 58, 138, 0.12);

  /* Spacing */
  --space-base: 4px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 64px;
  --gutter: 24px;
  --container-max: 1280px;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-default: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* ── Dark Mode Tokens ─────────────────────────────────────── */
[data-theme="dark"] {
  /* Primary */
  --primary: #b6c4ff;
  --on-primary: #00164e;
  --primary-container: #1e3a8a;
  --on-primary-container: #dce1ff;
  --primary-fixed: #dce1ff;
  --primary-fixed-dim: #b6c4ff;
  --on-primary-fixed: #00164e;
  --on-primary-fixed-variant: #264191;
  --inverse-primary: #00236f;

  /* Secondary */
  --secondary: #c0c7d0;
  --on-secondary: #2a3138;
  --secondary-container: #40484f;
  --on-secondary-container: #dce3ec;
  --secondary-fixed: #dce3ec;
  --secondary-fixed-dim: #c0c7d0;
  --on-secondary-fixed: #151c23;
  --on-secondary-fixed-variant: #40484f;

  /* Tertiary */
  --tertiary: #4edea3;
  --on-tertiary: #002113;
  --tertiary-container: #005236;
  --on-tertiary-container: #6ffbbe;
  --tertiary-fixed: #6ffbbe;
  --tertiary-fixed-dim: #4edea3;
  --on-tertiary-fixed: #002113;
  --on-tertiary-fixed-variant: #005236;

  /* Error */
  --error: #ffb4ab;
  --on-error: #690005;
  --error-container: #93000a;
  --on-error-container: #ffdad6;

  /* Surface */
  --surface: #111827;
  --surface-dim: #0d1117;
  --surface-bright: #1e293b;
  --surface-container-lowest: #0b0f19;
  --surface-container-low: #151c28;
  --surface-container: #1a2332;
  --surface-container-high: #1f2a3c;
  --surface-container-highest: #253347;
  --on-surface: #e2e8f0;
  --on-surface-variant: #c5c6d0;
  --surface-variant: #253347;
  --surface-tint: #b6c4ff;

  /* Inverse */
  --inverse-surface: #e2e8f0;
  --inverse-on-surface: #1a2332;

  /* Outline */
  --outline: #8e909a;
  --outline-variant: #44474f;

  /* Background */
  --background: #0d1117;
  --on-background: #e2e8f0;

  /* Semantic Colors */
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.15);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.15);

  /* Shadows */
  --shadow-card: 0px 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--on-background);
  background-color: var(--background);
  min-height: 100dvh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
  color: inherit;
}

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

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

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

ul, ol {
  list-style: none;
}

/* ── Typography Classes ───────────────────────────────────── */
.text-display-lg {
  font-family: var(--font-body);
  font-size: 48px;
  line-height: 56px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.text-headline-lg {
  font-family: var(--font-body);
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.text-headline-lg-mobile {
  font-family: var(--font-body);
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
}

.text-headline-md {
  font-family: var(--font-body);
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
}

.text-headline-sm {
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}

.text-body-lg {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 28px;
  font-weight: 400;
}

.text-body-md {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
}

.text-body-sm {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
}

.text-label-md {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.text-label-sm {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.font-mono {
  font-family: var(--font-mono);
}

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.tracking-tight { letter-spacing: -0.01em; }
.tracking-tighter { letter-spacing: -0.02em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.uppercase { text-transform: uppercase; }

/* ── Material Symbols ─────────────────────────────────────── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.material-symbols-outlined.filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ── Layout Utilities ─────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.flex-grow { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-none { flex: none; }

.items-center { align-items: center; }
.items-start { align-items: start; }
.items-end { align-items: end; }
.items-baseline { align-items: baseline; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-end { justify-content: flex-end; }

.gap-base { gap: var(--space-base); }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }

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

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100dvh; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mt-auto { margin-top: auto; }
.mb-auto { margin-bottom: auto; }
.ml-auto { margin-left: auto; }

/* Spacing utilities */
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-sm { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-xs { padding-left: var(--space-xs); padding-right: var(--space-xs); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-xs { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* ── Color Utility Classes ────────────────────────────────── */
.text-primary { color: var(--primary); }
.text-on-primary { color: var(--on-primary); }
.text-on-surface { color: var(--on-surface); }
.text-on-surface-variant { color: var(--on-surface-variant); }
.text-secondary { color: var(--secondary); }
.text-on-secondary-container { color: var(--on-secondary-container); }
.text-error { color: var(--error); }
.text-on-error { color: var(--on-error); }
.text-on-tertiary-container { color: var(--on-tertiary-container); }
.text-on-primary-container { color: var(--on-primary-container); }
.text-outline { color: var(--outline); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-white { color: #ffffff; }

.bg-background { background-color: var(--background); }
.bg-surface { background-color: var(--surface); }
.bg-surface-container { background-color: var(--surface-container); }
.bg-surface-container-low { background-color: var(--surface-container-low); }
.bg-surface-container-high { background-color: var(--surface-container-high); }
.bg-surface-container-highest { background-color: var(--surface-container-highest); }
.bg-surface-container-lowest { background-color: var(--surface-container-lowest); }
.bg-surface-variant { background-color: var(--surface-variant); }
.bg-primary { background-color: var(--primary); }
.bg-primary-container { background-color: var(--primary-container); }
.bg-primary-fixed { background-color: var(--primary-fixed); }
.bg-secondary-container { background-color: var(--secondary-container); }
.bg-secondary-fixed { background-color: var(--secondary-fixed); }
.bg-tertiary-container { background-color: var(--tertiary-container); }
.bg-error { background-color: var(--error); }
.bg-error-container { background-color: var(--error-container); }
.bg-success { background-color: var(--success); }
.bg-white { background-color: #ffffff; }

/* ── Component: Header / TopAppBar ────────────────────────── */
.top-app-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
  height: 64px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
}

.top-app-bar .logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.top-app-bar .logo-icon {
  color: var(--primary);
  font-size: 24px;
}

.top-app-bar .logo-text {
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  color: var(--primary);
}

.top-app-bar .actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ── Component: Avatar ────────────────────────────────────── */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--outline-variant);
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--sm {
  width: 32px;
  height: 32px;
}

.avatar--lg {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-xl);
  border-width: 2px;
  border-color: var(--surface-container-highest);
}

.avatar--xl {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-xl);
  border-width: 2px;
  border-color: var(--surface-container-highest);
}

.avatar-initials {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--secondary-fixed);
  color: var(--primary);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Component: Buttons ───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-success {
  background-color: var(--success);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  opacity: 0.9;
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-outline {
  background-color: var(--surface-container-lowest);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background-color: var(--surface-container);
}

.btn-outline-primary {
  background-color: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline-primary:hover {
  background-color: rgba(0, 35, 111, 0.05);
}

.btn-tertiary {
  background-color: var(--tertiary-container);
  color: var(--on-tertiary-container);
  box-shadow: var(--shadow-sm);
}

.btn-tertiary:hover {
  background-color: var(--on-tertiary-fixed-variant);
}

.btn-ghost {
  background-color: transparent;
  color: var(--on-surface-variant);
  padding: 8px;
  border-radius: var(--radius-full);
}

.btn-ghost:hover {
  background-color: rgba(211, 228, 254, 0.5);
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-full);
  color: var(--on-surface-variant);
}

.btn-icon:hover {
  background-color: rgba(211, 228, 254, 0.5);
}

.btn-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-lg {
  padding: 12px var(--space-xl);
  border-radius: var(--radius-md);
  font-weight: 700;
}

/* ── Component: Cards ─────────────────────────────────────── */
.card {
  background-color: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-md);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-elevated {
  box-shadow: var(--shadow-xl);
}

.card-interactive {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
}

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

/* ── Component: Chips / Badges ────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chip-success {
  background-color: var(--success-bg);
  color: var(--success);
}

.chip-danger {
  background-color: var(--danger-bg);
  color: var(--danger);
}

.chip-active {
  background-color: var(--tertiary-fixed);
  color: var(--tertiary-container);
}

.chip-paused {
  background-color: var(--secondary-container);
  color: var(--secondary-fixed-dim);
}

.chip-inactive {
  background-color: var(--surface-container);
  color: var(--on-surface-variant);
}

.chip-certified {
  background-color: var(--tertiary-container);
  color: var(--on-tertiary-container);
  padding: 4px var(--space-md);
  font-size: 12px;
}

.chip-critical {
  background-color: rgba(186, 26, 26, 0.1);
  color: var(--error);
  padding: 2px 8px;
  border-radius: var(--radius-default);
  font-size: 10px;
  font-weight: 700;
}

/* Status badge (dot + text) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 16px;
  background-color: var(--surface-container);
  border-radius: var(--radius-full);
  border: 1px solid var(--outline-variant);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: var(--secondary);
  animation: pulse 2s infinite;
}

.status-dot--success { background-color: var(--success); }
.status-dot--error { background-color: var(--error); }

/* ── Component: Inputs ────────────────────────────────────── */
.input {
  width: 100%;
  background-color: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-default);
  padding: var(--space-sm) var(--space-md);
  font-size: 14px;
  line-height: 20px;
  color: var(--on-surface);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-fixed-dim);
}

.input::placeholder {
  color: var(--outline);
}

.input-sm {
  padding: 6px 12px;
  font-size: 14px;
}

.select {
  width: 100%;
  background-color: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-default);
  padding: var(--space-sm) var(--space-md);
  font-size: 14px;
  line-height: 20px;
  color: var(--on-surface);
  outline: none;
  cursor: pointer;
  appearance: auto;
}

.select-sm {
  padding: 6px 12px;
  font-size: 14px;
}

.select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-fixed-dim);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-label {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--on-surface-variant);
}

.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper .input {
  padding-right: 48px;
}

.input-icon-wrapper .icon-right {
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--on-surface-variant);
  pointer-events: none;
}

/* ── Component: Sidebar / Navigation Drawer ───────────────── */
.sidebar {
  width: 288px;
  height: 100dvh;
  position: fixed;
  top: 0;
  left: 0;
  background-color: var(--surface-container-low);
  border-right: 1px solid var(--outline-variant);
  z-index: 100;
  display: none;
  flex-direction: column;
  padding: var(--space-md);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.mobile-open {
  display: flex;
  transform: translateX(0);
}

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

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.sidebar-logo {
  padding: 0 var(--space-md);
  margin-bottom: var(--space-lg);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  background-color: rgba(229, 238, 255, 0.3);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 9px var(--space-md);
  color: var(--on-surface-variant);
  transition: all 0.3s ease-in-out;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.sidebar-link:hover {
  background-color: var(--surface-container-high);
}

.sidebar-link.active {
  color: var(--primary);
  font-weight: 700;
  border-right: 4px solid var(--primary);
  background-color: var(--surface-container);
}

.sidebar-link .material-symbols-outlined {
  font-size: 24px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--outline-variant);
  margin-left: var(--space-md);
  margin-right: var(--space-md);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 8px;
  color: var(--error);
  border-radius: var(--radius-default);
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.sidebar-logout:hover {
  background-color: rgba(255, 218, 214, 0.2);
}

/* ── Component: Data Table ────────────────────────────────── */
.data-table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}

.data-table thead tr {
  background-color: var(--surface-container-low);
  border-bottom: 1px solid var(--outline-variant);
}

.data-table th {
  padding: 12px var(--space-md);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--on-surface-variant);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--outline-variant);
  transition: background-color 0.15s;
}

.data-table tbody tr:hover {
  background-color: var(--surface-container-low);
}

.data-table td {
  padding: 16px var(--space-md);
  font-size: 14px;
  line-height: 20px;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.table-action-btn {
  padding: 4px;
  color: var(--secondary);
  transition: color 0.15s;
  background: none;
  border: none;
  cursor: pointer;
}

.table-action-btn:hover {
  color: var(--primary);
}

.table-action-btn--danger:hover {
  color: var(--error);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--outline-variant);
}

.page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-default);
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.15s;
}

.page-btn:hover {
  background-color: var(--surface-container-high);
}

.page-btn.active {
  background-color: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}

/* ── Component: Bottom Navigation ─────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--surface);
  border-top: 1px solid var(--outline-variant);
  z-index: 50;
  height: 64px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 16px;
  color: var(--on-surface-variant);
  border-radius: var(--radius-xl);
  transition: all 0.2s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.bottom-nav-item:hover {
  background-color: var(--surface-container-high);
}

.bottom-nav-item.active {
  background-color: var(--primary-container);
  color: var(--on-primary-container);
  padding: 4px 24px;
}

.bottom-nav-item:active {
  transform: scale(0.95);
}

.bottom-nav-item .material-symbols-outlined {
  font-size: 24px;
}

.bottom-nav-label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

/* ── Component: Alert / Notice ────────────────────────────── */
.alert {
  padding: var(--space-sm);
  border-radius: 0 var(--radius-default) var(--radius-default) 0;
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}

.alert-error {
  background-color: rgba(255, 218, 214, 0.2);
  border-left: 4px solid var(--error);
}

.alert-success {
  background-color: rgba(111, 251, 190, 0.1);
  border-left: 4px solid var(--success);
}

.alert-info {
  background-color: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.alert-tertiary {
  background-color: rgba(0, 74, 49, 0.1);
  border-left: 4px solid var(--tertiary);
}

.alert-timestamp {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 4px;
}

/* ── Component: Progress Bar ──────────────────────────────── */
.progress-bar {
  height: 8px;
  width: 100%;
  background-color: var(--surface-variant);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.progress-bar-fill--primary {
  background-color: var(--primary-container);
}

.progress-bar-fill--success {
  background-color: var(--success);
}

/* Activity timeline bar */
.activity-bar {
  height: 16px;
  width: 100%;
  background-color: var(--surface-container);
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
}

.activity-bar-segment {
  height: 100%;
}

.activity-bar-segment--work {
  background-color: var(--tertiary-fixed-dim);
}

.activity-bar-segment--break {
  background-color: var(--secondary-container);
}

.activity-bar-segment--empty {
  background-color: var(--surface-variant);
}

/* ── Component: Timeline ──────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: var(--space-md);
}

.timeline-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-top: 6px;
}

.timeline-dot--success { background-color: var(--success); }
.timeline-dot--error { background-color: var(--error); }
.timeline-dot--muted { background-color: var(--outline-variant); }

.timeline-line {
  width: 1px;
  flex: 1;
  background-color: var(--outline-variant);
  min-height: 20px;
}

.timeline-content {
  padding-bottom: var(--space-md);
}

/* ── Component: Notification Badge ────────────────────────── */
.notification-btn {
  position: relative;
  padding: 8px;
  border-radius: var(--radius-full);
  transition: background-color 0.15s;
}

.notification-btn:hover {
  background-color: rgba(211, 228, 254, 0.5);
}

.notification-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background-color: var(--error);
  border-radius: var(--radius-full);
}

/* ── Component: Footer ────────────────────────────────────── */
.site-footer {
  width: 100%;
  padding: var(--space-sm) 0;
  margin-top: auto;
  background-color: var(--surface-container-low);
  border-top: 1px solid var(--outline-variant);
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.footer-links {
  display: flex;
  gap: var(--space-md);
}

.footer-links a {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--secondary);
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--primary);
}

/* ── PIN-specific Components ──────────────────────────────── */
.pin-dots {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  padding: var(--space-sm) 0;
}

.pin-dot {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  border: 2px solid var(--primary-container);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pin-dot.active {
  background-color: var(--primary);
  transform: scale(1.2);
  border-color: var(--primary);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  width: 100%;
  max-width: 320px;
}

.keypad-btn {
  height: 64px;
  border-radius: var(--radius-md);
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--outline-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  color: var(--primary);
  transition: all 0.15s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.keypad-btn:hover {
  background-color: rgba(211, 228, 254, 0.5);
}

.keypad-btn:active {
  transform: scale(0.95);
}

.keypad-btn--backspace {
  background-color: rgba(255, 218, 214, 0.2);
  border-color: rgba(186, 26, 26, 0.2);
  color: var(--error);
}

.keypad-btn--backspace:hover {
  background-color: rgba(255, 218, 214, 0.4);
}

.keypad-btn--accept {
  background-color: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.keypad-btn--accept:hover {
  background-color: rgba(16, 185, 129, 0.25);
}

.keypad-placeholder {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--outline-variant);
}

/* Action grid (Fichaje buttons) */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  width: 100%;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-sm);
  border-radius: var(--radius-md);
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.action-btn:active {
  transform: scale(0.95);
}

.action-btn--entrada {
  background-color: #15803d;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.35);
}

.action-btn--salida {
  background-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.action-btn--descanso-inicio {
  background-color: #3b82f6;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.action-btn--descanso-fin {
  background-color: #f97316;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* ── Metric Card with Icon ────────────────────────────────── */
.metric-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-default);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon--primary {
  background-color: var(--primary-container);
  color: var(--on-primary-container);
}

.metric-icon--tertiary {
  background-color: var(--tertiary-container);
  color: var(--on-tertiary-container);
}

.metric-icon--secondary {
  background-color: var(--secondary-container);
  color: var(--on-secondary-container);
}

.metric-icon--error {
  background-color: var(--error-container);
  color: var(--on-error-container);
}

/* ── Chart: Bar Chart (CSS-only) ──────────────────────────── */
.bar-chart {
  height: 256px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
}

.bar-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.bar-chart-bar {
  width: 100%;
  background-color: var(--primary-fixed-dim);
  border-radius: var(--radius-default) var(--radius-default) 0 0;
  transition: background-color 0.2s;
  min-height: 2px;
}

.bar-chart-bar:hover {
  background-color: var(--primary);
}

.bar-chart-bar--today {
  background-color: var(--primary-container);
}

.bar-chart-bar--empty {
  background-color: var(--surface-variant);
}

.bar-chart-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--secondary);
}

.bar-chart-label--today {
  color: var(--primary);
  font-weight: 700;
}

/* ── SVG Progress Ring ────────────────────────────────────── */
.progress-ring {
  position: relative;
  width: 80px;
  height: 80px;
}

.progress-ring svg {
  width: 100%;
  height: 100%;
}

.progress-ring__track {
  fill: none;
  stroke: var(--surface-variant);
  stroke-width: 3;
}

.progress-ring__fill {
  fill: none;
  stroke: var(--success);
  stroke-width: 3;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.35s;
}

.progress-ring__icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

/* ── Scrollbar Hide ───────────────────────────────────────── */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ── Extra Utilities ──────────────────────────────────────── */
.p-0 { padding: 0; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.p-1 { padding: 4px; }
.hidden { display: none !important; }
.cursor-pointer { cursor: pointer; }
.border-b { border-bottom: 1px solid var(--outline-variant); }
.border-outline-variant { border-color: var(--outline-variant); }
.rounded { border-radius: var(--radius-default); }
.rounded-lg { border-radius: var(--radius-lg); }
.opacity-80 { opacity: 0.8; }
.max-w-container-max { max-width: var(--container-max); }
.pb-xl { padding-bottom: var(--space-xl); }
.sm\:w-auto { }

/* ── Component: Modal Overlay ────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background-color: var(--surface-container-lowest);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s ease;
}

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

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

.modal-body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md) var(--space-md);
}

/* ── Component: Form Input ───────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--on-surface-variant);
}

.form-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--surface-container);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent);
}

.form-input::placeholder {
  color: var(--outline);
}

/* ── Component: Toast Notification ───────────────────────── */
.toast-container {
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  min-width: 300px;
  max-width: 420px;
  animation: toast-in 0.3s ease forwards;
  font-size: 14px;
  font-weight: 500;
}

.toast--success {
  background-color: var(--tertiary-container);
  color: var(--on-tertiary-container);
  border: 1px solid rgba(78, 222, 163, 0.3);
}

.toast--error {
  background-color: var(--error-container);
  color: var(--on-error-container);
  border: 1px solid rgba(186, 26, 26, 0.2);
}

.toast--info {
  background-color: var(--surface-container);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
}

.toast.removing {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* Hide on mobile, show on desktop */
@media (max-width: 1023px) {
  .hide-mobile { display: none !important; }
}

/* ── Responsive: Desktop ──────────────────────────────────── */
@media (min-width: 1024px) {
  .sidebar {
    display: flex;
  }

  /* FIX: Proper margin for content next to sidebar */
  .main-with-sidebar {
    margin-left: 288px;
  }

  .md-hidden {
    display: none !important;
  }

  .md-flex {
    display: flex !important;
  }

  .md-block {
    display: block !important;
  }

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

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

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

  .md-flex-row {
    flex-direction: row;
  }

  .md-items-end {
    align-items: flex-end;
  }

  .md-text-left {
    text-align: left;
  }

  .sm\:w-auto {
    width: auto;
  }

  .site-footer .container {
    flex-direction: row;
    justify-content: space-between;
  }

  .bottom-nav {
    display: none;
  }

  .md-w-auto { width: auto; }
  .md-flex-none { flex: none; }
}

@media (min-width: 1024px) {
  .lg-grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .lg-grid-cols-12 {
    grid-template-columns: repeat(12, 1fr);
  }

  .lg-col-span-8 {
    grid-column: span 8;
  }

  .lg-col-span-4 {
    grid-column: span 4;
  }

  .lg-col-span-2 {
    grid-column: span 2;
  }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .sidebar,
  .bottom-nav,
  .top-app-bar {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }
}

/* ── Toggle Switch ────────────────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--outline-variant);
  border-radius: 24px;
  transition: 0.2s;
}

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

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background-color: var(--on-primary);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px var(--primary-container);
}

/* ── Calendario Días Libres ───────────────────────────────── */
.calendario-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
}

.calendario-nav-btn {
  width: 36px;
  height: 36px;
}

.calendario-grid {
  max-width: 340px;
  margin: 0 auto;
}

.calendario-cabecera {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 4px;
}

.calendario-cabecera span {
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 0;
}

.calendario-dias {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendario-dia {
  text-align: center;
  padding: 6px 0;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendario-dia--fuera {
  visibility: hidden;
}

.calendario-dia--libre {
  background-color: var(--tertiary-container);
  color: var(--on-tertiary-container);
  font-weight: 700;
}

.calendario-dia--hoy {
  box-shadow: inset 0 0 0 2px var(--primary);
  font-weight: 800;
}

/* ── Calendario: Cierre de empresa ── */
.calendario-dia--cierre {
  background-color: var(--error-container);
  color: var(--on-error-container);
  font-weight: 700;
  cursor: help;
}

/* Día que es libre personal Y cierre de empresa a la vez */
.calendario-dia--libre.calendario-dia--cierre {
  background: linear-gradient(135deg, var(--tertiary-container) 50%, var(--error-container) 50%);
  color: var(--on-error-container);
  outline: 2px solid var(--error-container);
  outline-offset: -2px;
}

/* Leyenda del calendario */
.calendario-leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--outline-variant);
}

.leyenda-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--secondary);
  font-weight: 500;
}

.leyenda-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.leyenda-dot--libre {
  background-color: rgba(245, 158, 11, 0.7);
}

.leyenda-dot--cierre {
  background-color: var(--error-container);
}

.leyenda-dot--libre-cierre {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.8) 50%, var(--error-container) 50%);
}

.leyenda-dot--vacaciones {
  background-color: #a855f7;
}

/* ── Calendario: Vacaciones personales ── */
.calendario-dia--vacaciones {
  background-color: rgba(168, 85, 247, 0.25);
  color: #7c3aed;
  font-weight: 700;
  cursor: default;
}

/* ── Modal: ajuste móvil ── */
@media (max-width: 640px) {
  .modal-overlay {
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    align-items: center;
  }
  .modal {
    max-height: 88vh;
    max-height: 88dvh;
    width: 100%;
    border-radius: var(--radius-lg);
  }
}

/* ── iOS zoom prevention: font-size mínimo 16px en móvil ── */
/* iOS hace zoom automático cuando un input tiene font-size < 16px  */
@media (max-width: 768px) {
  input,
  textarea,
  select,
  .input,
  .select,
  .form-input {
    font-size: 16px !important;
  }
}
/* ── Modal Tabs ── */
.modal .tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.modal .tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal .tab:hover {
  color: var(--md-sys-color-on-surface);
  background-color: var(--md-sys-color-surface-container-highest);
}

.modal .tab.active {
  color: var(--md-sys-color-primary);
  border-bottom-color: var(--md-sys-color-primary);
}

/* ── Backup list items ── */
.backup-item {
  transition: background-color 0.15s ease;
}

.backup-item:hover {
  background-color: var(--md-sys-color-surface-container-highest);
}

/* ── Break Card Animations ────────────────────────────────── */
@keyframes textDangerPulse {
  0%, 100% { text-shadow: 0 0 12px rgba(239,68,68,0.4); }
  50%       { color: #ef4444; text-shadow: 0 0 24px rgba(239,68,68,0.8); }
}
.text-danger-pulse {
  color: var(--error) !important;
  animation: textDangerPulse 2s ease-in-out infinite !important;
}
.break-card.overtime {
  border-color: rgba(239,68,68,0.40) !important;
  box-shadow: 0 8px 32px rgba(185,28,28,0.20), inset 0 1px 0 rgba(255,255,255,0.04) !important;
}
.break-card.overtime h3 {
  color: #fca5a5 !important;
}
/* -- Dropdowns ------------------------------------------ */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background-color: var(--surface);
  min-width: 240px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--outline-variant);
  z-index: 100;
  padding: 8px 0;
  animation: fadeIn 0.2s ease;
}
.dropdown-menu.show {
  display: block;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface);
  cursor: pointer;
  transition: background-color 0.2s;
}
.dropdown-item:hover {
  background-color: var(--surface-container-highest);
}
.dropdown-item .material-symbols-outlined {
  font-size: 20px;
  color: var(--primary);
}

/* -- Dropdown Icons -- */
.dd-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dd-icon .material-symbols-outlined {
  font-size: 18px !important;
}
.dd-icon--primary { background-color: var(--primary-container); color: var(--on-primary-container); }
.dd-icon--secondary { background-color: var(--secondary-container); color: var(--on-secondary-container); }
.dd-icon--tertiary { background-color: var(--tertiary-container); color: var(--on-tertiary-container); }
.dd-icon--error { background-color: var(--error-container); color: var(--on-error-container); }
.dd-icon--warning { background-color: rgba(245, 158, 11, 0.15); color: #d97706; }
.dd-icon--success { background-color: var(--success-bg); color: var(--success); }
.dd-icon--purple { background-color: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

/* -- Premium Gradient Buttons -- */
.btn-gradient {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  color: #ffffff !important;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}
.btn-gradient:hover {
  transform: translateY(-2px);
}
.btn-gradient:active {
  transform: translateY(0);
}
.btn-gradient-personal {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}
.btn-gradient-personal:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}
.btn-gradient-sistema {
  background: linear-gradient(135deg, #475569 0%, #1e293b 100%);
  box-shadow: 0 4px 14px rgba(30, 41, 59, 0.3);
}
.btn-gradient-sistema:hover {
  box-shadow: 0 6px 20px rgba(30, 41, 59, 0.4);
}
.btn-gradient-purgar {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.3);
}
.btn-gradient-purgar:hover {
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.4);
}





@media (min-width: 640px) {
  .sm-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .sm-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .lg-grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
}

/* ── Inspección: Acordeones por Empleado ─────────────────────────────── */
.insp-acordeon {
  background: var(--surface);
  transition: background 0.2s;
}
.insp-acordeon:hover {
  background: var(--surface-container-low);
}
.insp-acordeon-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 12px;
  transition: background 0.2s;
}
.insp-acordeon-header:hover {
  background: var(--surface-container);
}
.insp-chevron {
  color: var(--on-surface-variant);
  transition: transform 0.25s ease;
  font-size: 22px;
  flex-shrink: 0;
}
.insp-acordeon[data-state='open'] .insp-chevron {
  transform: rotate(180deg);
}
.insp-acordeon-body {
  border-top: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest, var(--background));
}
.insp-badge {
  display: inline-flex;
  align-items: center;
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
