/* ============================================================
   Green Repack LLC — Control de Personal (Supervisor & Admin Portal)
   Identidad Visual Oficial: Manrope & DM Mono
   Paleta: Lush Forest, Deep Night, Emerald Glow & Warm Cream
   ============================================================ */

:root {
  /* Paleta Oficial extraída de Landing Page */
  --ink: #102808;
  --ink-soft: #2b4122;
  --forest: #063014;
  --forest-mid: #0a3d1b;
  --forest-light: #124d24;
  --deep: #071b0b;
  --deep-alt: #041207;

  /* Acento Primario Esmeralda (Admin & CTA) */
  --emerald: #3ecf8e;
  --emerald-glow: rgba(62, 207, 142, 0.35);
  --emerald-deep: #24b47e;
  --emerald-soft: #eafaf1;
  --emerald-border: rgba(62, 207, 142, 0.40);

  /* Acento Operativo Hoja (Supervisor & Campo) */
  --leaf: #78b030;
  --leaf-light: #a5cf49;
  --leaf-soft: #e8f5d8;
  --leaf-border: rgba(120, 176, 48, 0.35);

  /* Tonalidades de Fondo / Superficies */
  --cream: #f8faf4;
  --cream-alt: #f1f4ec;
  --sand: #e6ede0;
  --white: #ffffff;
  --card: #ffffff;
  --card-subtle: #fafcf8;
  --card-hover: #f4f8f1;

  /* Estados Semánticos Sobrios */
  --red: #e02020;
  --red-soft: #fef2f2;
  --red-border: rgba(224, 32, 32, 0.35);

  --orange: #f4860a;
  --orange-soft: #fffbeb;
  --orange-border: rgba(244, 134, 10, 0.35);

  --sky: #0284c7;
  --sky-soft: #f0f9ff;
  --sky-border: rgba(2, 132, 199, 0.35);

  /* Textos & Neutros */
  --muted: #5d6d58;
  --muted-light: #8fa08a;
  --line: rgba(16, 40, 8, 0.12);
  --line-dark: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(16, 40, 8, 0.20);

  /* Tipografía */
  --display: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'DM Mono', monospace;

  /* Sombras Táctiles */
  --shadow-sm: 0 2px 8px rgba(7, 27, 11, 0.05);
  --shadow-md: 0 8px 24px rgba(7, 27, 11, 0.08);
  --shadow-lg: 0 16px 40px rgba(7, 27, 11, 0.12);
  --shadow-dark: 0 20px 50px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 30px rgba(62, 207, 142, 0.25);
  --shadow-card: 0 1px 3px rgba(7, 27, 11, 0.05), 0 0 0 1px var(--line);

  /* Radios de Borde */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transiciones Suaves */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: all 0.25s var(--ease-spring);
  --transition-fast: all 0.15s ease;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   JERARQUÍA TIPOGRÁFICA
   ============================================================ */
h1, h2, h3, h4, p {
  margin-top: 0;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--ink);
}

h1 { font-size: clamp(24px, 3.2vw, 34px); }
h2 { font-size: clamp(18px, 2.2vw, 26px); }
h3 { font-size: clamp(15px, 1.6vw, 19px); letter-spacing: -0.01em; }

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--forest-light);
  margin-bottom: 4px;
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.small-note {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 8px 0;
  line-height: 1.5;
}

/* ============================================================
   TOPBAR NAVIGATION (Encabezado Unificado con Landing Page)
   ============================================================ */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--deep);
  color: #fff;
  padding: 12px 28px;
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--line-dark);
}

.brand-nav-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-title span {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
  color: #ffffff;
}

.brand-title span span {
  color: var(--emerald);
}

.brand-title small {
  font-family: var(--mono);
  font-size: 0.60rem;
  letter-spacing: 2px;
  color: var(--muted-light);
  text-transform: uppercase;
  margin-top: 3px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  border: 1px solid transparent;
}

.brand-badge.role-admin {
  background: rgba(62, 207, 142, 0.16);
  color: var(--emerald);
  border-color: var(--emerald-border);
}

.brand-badge.role-supervisor {
  background: rgba(120, 176, 48, 0.20);
  color: #bef264;
  border-color: var(--leaf-border);
}

.who {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  color: #f1f5f9;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-deep));
  color: var(--deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  font-family: var(--mono);
  font-size: 0.76rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.logout-btn:hover {
  background: rgba(224, 32, 32, 0.20);
  border-color: rgba(224, 32, 32, 0.50);
  color: #fca5a5;
}

/* ============================================================
   SUPERVISOR: QUICK SHIFT METRICS BAR (Métricas Rápidas de Turno)
   ============================================================ */
.shift-metrics-bar {
  max-width: 860px;
  margin: 18px auto 0;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.shift-metric-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: var(--transition-fast);
}

.shift-metric-card:hover {
  border-color: var(--leaf-border);
  box-shadow: var(--shadow-md);
}

.shift-metric-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}

.shift-metric-val {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.shift-metric-sub {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 0.70rem;
  color: var(--forest-light);
}

.status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--leaf);
  box-shadow: 0 0 8px var(--leaf);
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* ============================================================
   ADMIN: KPI METRICS GRID
/* ============================================================
   ADMIN: CENTERED SHELL & KPI METRICS GRID
   ============================================================ */
.admin-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
  width: 100%;
  box-sizing: border-box;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0 0;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--line);
  transition: var(--transition);
}

.kpi-card:hover {
  border-color: var(--emerald-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card:hover::before {
  background: var(--emerald);
}

.kpi-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  font-weight: 600;
  color: var(--muted);
}

.kpi-val {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 1.85rem;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin: 4px 0 2px;
}

.kpi-sub {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted-light);
}

/* ============================================================
   TABS & SEGMENTED CONTROLS (Admin)
   ============================================================ */
.tabs-wrap {
  margin: 22px 0 0;
  display: flex;
  justify-content: flex-start;
}

.tabs {
  display: inline-flex;
  background: rgba(16, 40, 8, 0.05);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}

.tab-btn.active {
  color: var(--forest);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  font-weight: 800;
}

.tab-panel {
  display: none;
  padding: 24px 0 80px;
  width: 100%;
}

.tab-panel.active {
  display: block;
  animation: panelFadeIn 0.22s var(--ease-spring);
}

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

/* ============================================================
   TOOLBARS & FILTERS
   ============================================================ */
.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) auto;
  gap: 14px;
  align-items: flex-end;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.toolbar label {
  margin: 0 0 6px 0;
}

/* Week Exporter Bar */
.export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, #ffffff, #f4fbf6);
  border: 1px solid var(--emerald-border);
  border-left: 4px solid var(--emerald);
  border-radius: var(--radius-md);
  padding: 14px 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.week-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.week-selector label {
  margin: 0;
  font-size: 0.80rem;
  color: var(--ink);
  white-space: nowrap;
}

.week-selector input[type="date"] {
  width: auto;
  padding: 7px 12px;
  min-height: 38px;
}

.week-range {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--forest);
  background: var(--emerald-soft);
  border: 1px solid var(--emerald-border);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  white-space: nowrap;
}

/* ============================================================
   FORMS & INPUTS
   ============================================================ */
label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  width: 100%;
  font-family: var(--display);
  font-size: 15px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #ccd8c8;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-height: 42px;
  transition: var(--transition-fast);
}

input[type="time"] {
  font-family: var(--mono);
  font-weight: 600;
}

input[type="date"] {
  font-family: var(--mono);
}

textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.55;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-glow);
  background: #ffffff;
}

input:disabled, select:disabled, textarea:disabled {
  background: var(--cream-alt);
  color: var(--muted);
  cursor: not-allowed;
  border-color: #dbe3d7;
}

input::placeholder, textarea::placeholder {
  color: var(--muted-light);
  font-size: 0.90rem;
}

/* Password input with toggle */
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrap input {
  padding-right: 48px;
}

.password-toggle-btn {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.password-toggle-btn .eye-icon {
  width: 20px;
  height: 20px;
  display: block;
  stroke: var(--muted);
  transition: stroke 0.15s ease, transform 0.15s ease;
}

.password-toggle-btn:hover {
  color: var(--forest);
  background: rgba(6, 48, 20, 0.08);
}

.password-toggle-btn:hover .eye-icon {
  stroke: var(--forest);
}

.password-toggle-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--emerald);
  background: var(--emerald-soft);
}

.password-toggle-btn:focus-visible .eye-icon {
  stroke: var(--emerald-deep);
}

.password-toggle-btn .eye-closed {
  display: none;
}

.password-toggle-btn.is-revealed .eye-open {
  display: none;
}

.password-toggle-btn.is-revealed .eye-closed {
  display: block;
}

.password-toggle-btn.is-revealed {
  color: var(--emerald-deep);
}

.password-toggle-btn.is-revealed .eye-icon {
  stroke: var(--emerald-deep);
}

/* ============================================================
   TIME PICKER COMPONENT (AM / PM SELECTOR UNIFICADO)
   ============================================================ */
.time-picker-wrap {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #ccd8c8;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  min-height: 42px;
  width: 100%;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.time-picker-wrap:focus-within {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-glow);
}

.tp-select {
  border: none !important;
  background: transparent !important;
  font-family: var(--mono) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--ink) !important;
  padding: 4px 6px !important;
  min-height: unset !important;
  width: auto !important;
  cursor: pointer;
  outline: none !important;
  box-shadow: none !important;
  border-radius: var(--radius-xs) !important;
}

.tp-select:hover {
  background: rgba(16, 40, 8, 0.05) !important;
}

.tp-colon {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 16px;
  color: var(--forest);
  padding: 0 2px;
  user-select: none;
}

.tp-ampm-switch {
  display: inline-flex;
  margin-left: auto;
  background: rgba(16, 40, 8, 0.06);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.tp-ampm-btn {
  border: none;
  background: transparent;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  padding: 5px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
  line-height: 1;
}

.tp-ampm-btn:hover {
  color: var(--ink);
}

.tp-ampm-btn.active {
  background: var(--forest);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(7, 27, 11, 0.25);
}

/* En tablas de datos (Admin y Supervisor) */
table.data .time-picker-wrap {
  min-width: 155px;
  min-height: 36px;
  padding: 2px 6px;
}

table.data .tp-select {
  font-size: 13.5px !important;
  padding: 2px 4px !important;
}

table.data .tp-ampm-btn {
  padding: 3px 6px;
  font-size: 0.68rem;
}

/* ============================================================
   BUTTONS (Alineados con Landing Page)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  min-height: 42px;
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn.primary {
  background: var(--emerald);
  border-color: var(--emerald-deep);
  color: var(--deep);
  box-shadow: 0 2px 8px rgba(62, 207, 142, 0.30);
}

.btn.primary:hover {
  background: var(--emerald-deep);
  border-color: var(--emerald-deep);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(62, 207, 142, 0.40);
}

.btn.primary:disabled {
  background: #cbd5e1;
  border-color: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.ghost {
  background: #ffffff;
  color: var(--ink);
  border-color: #ccd8c8;
  box-shadow: var(--shadow-sm);
}

.btn.ghost:hover {
  background: var(--cream-alt);
  border-color: var(--ink-soft);
}

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

.btn.danger:hover {
  background: var(--red-soft);
  border-color: var(--red);
}

.btn.small {
  padding: 6px 14px;
  font-size: 0.78rem;
  min-height: 34px;
}

.btn.block {
  width: 100%;
}

.linklike {
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--emerald-deep);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  transition: var(--transition-fast);
}

.linklike:hover {
  color: var(--emerald);
}

/* ============================================================
   TICKET CARDS & CONTENEDORES
   ============================================================ */
.ticket {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
  transition: var(--transition);
}

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

.ticket-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--card-subtle);
}

.ticket-head h2 {
  margin: 2px 0 0;
  font-size: 1.25rem;
  color: var(--ink);
}

.ticket-body {
  padding: 22px 24px;
}

/* ============================================================
   STEPPER (Supervisor: Flujo de 4 Pasos)
   ============================================================ */
.stepper-container {
  max-width: 860px;
  margin: 18px auto 0;
  padding: 0 20px;
}

/* Mobile compact stepper bar */
.mobile-stepper-bar {
  display: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.mobile-stepper-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.80rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 8px;
}

.mobile-progress-track {
  height: 6px;
  background: var(--sand);
  border-radius: 999px;
  overflow: hidden;
}

.mobile-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--leaf), var(--leaf-light));
  width: 25%;
  transition: width 0.3s var(--ease-spring);
}

/* Desktop Stepper Track */
.stepper-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px 20px;
  box-shadow: var(--shadow-sm);
}

.step-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
  cursor: pointer;
  user-select: none;
}

.step-dot:hover {
  color: var(--ink);
  background: var(--cream-alt);
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sand);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  transition: var(--transition-fast);
}

.step-dot.active {
  background: var(--leaf-soft);
  color: var(--forest);
  font-weight: 700;
}

.step-dot.active .step-number {
  background: var(--leaf);
  color: #ffffff;
  box-shadow: 0 0 10px var(--leaf-border);
}

.step-dot.done {
  color: var(--forest);
}

.step-dot.done .step-number {
  background: var(--forest);
  color: #ffffff;
}

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--line);
  margin: 0 4px;
}

.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
  animation: panelFadeIn 0.22s var(--ease-spring);
}

.page-wrap {
  max-width: 860px;
  margin: 20px auto 60px;
  padding: 0 20px;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ============================================================
   STEP 2: EMPLOYEE SELECTION & SEARCH
   ============================================================ */
.emp-search-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.emp-search-row > div {
  flex: 1;
}

/* Quick Filter Pills (Puestos / Áreas) */
.role-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.filter-pill {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 3px 10px;
  cursor: pointer;
  color: var(--muted);
  transition: var(--transition-fast);
}

.filter-pill:hover, .filter-pill.active {
  background: var(--leaf-soft);
  border-color: var(--leaf);
  color: var(--forest);
  font-weight: 700;
}

.emp-results {
  margin: 12px 0;
  max-height: 280px;
  overflow-y: auto;
}

.emp-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 12px 18px;
  margin-bottom: 8px;
  transition: var(--transition-fast);
}

.emp-result-row:hover {
  border-color: var(--leaf-border);
  background: var(--card-hover);
  box-shadow: var(--shadow-sm);
}

.emp-meta {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--leaf-soft);
  border: 1px solid var(--leaf-border);
  color: var(--forest);
  border-radius: var(--radius-full);
  font-family: var(--mono);
  font-size: 0.80rem;
  padding: 6px 14px;
}

.chip button {
  background: none;
  border: none;
  color: var(--forest);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  transition: var(--transition-fast);
}

.chip button:hover {
  color: var(--red);
}

.new-emp-drawer {
  background: var(--card-subtle);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 16px;
}

/* ============================================================
   STEP 3: HOURS ENTRY CARDS
   ============================================================ */
.copy-hours-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f7fceb, #edf8db);
  border: 1px solid var(--leaf-border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.copy-hours-bar span {
  font-family: var(--mono);
  font-size: 0.80rem;
  color: var(--forest);
  font-weight: 700;
}

.hours-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.hours-card:hover {
  border-color: var(--leaf-border);
  box-shadow: var(--shadow-md);
}

.hours-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.hours-card-head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}

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

.break-presets {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.break-btn {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 3px 9px;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--muted);
}

.break-btn:hover, .break-btn.active {
  background: var(--leaf-soft);
  border-color: var(--leaf);
  color: var(--forest);
  font-weight: 700;
}

.hours-total {
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--forest);
  background: var(--leaf-soft);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--leaf-border);
}

.hours-card.invalid {
  border-color: var(--red);
  background: #fff8f8;
}

.hours-card .field-error {
  display: none;
  color: var(--red);
  font-size: 0.80rem;
  font-family: var(--mono);
  margin-top: 6px;
}

.hours-card.invalid .field-error {
  display: block;
}

/* ============================================================
   STEP 4: SUMMARY & PRESETS
   ============================================================ */
.summary-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.preset-chip {
  background: var(--card-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-family: var(--mono);
  font-size: 0.76rem;
  padding: 5px 12px;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--ink-soft);
}

.preset-chip:hover {
  background: var(--leaf-soft);
  border-color: var(--leaf);
  color: var(--forest);
}

/* ============================================================
   TABLES & DATOS ESTRUCTURADOS (Admin & Supervisor)
   ============================================================ */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

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

table.data th {
  font-family: var(--mono);
  font-size: 0.70rem;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  background: var(--card-subtle);
  border-bottom: 1px solid var(--line-strong);
  padding: 12px 16px;
  white-space: nowrap;
}

table.data td {
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  vertical-align: middle;
}

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

table.data tr:hover td {
  background: rgba(62, 207, 142, 0.04);
}

table.data td input {
  padding: 6px 10px;
  font-size: 0.84rem;
  min-height: 36px;
}

.week-hours {
  font-family: var(--mono);
  font-size: 0.80rem;
  font-weight: 700;
  color: var(--muted);
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  display: inline-block;
  white-space: nowrap;
}

.week-hours.has-hours {
  color: var(--forest);
  background: var(--emerald-soft);
  border-color: var(--emerald-border);
}

.week-hours.overtime {
  color: #991b1b;
  background: #fee2e2;
  border-color: var(--red-border);
}

/* ============================================================
   RECORD CARDS & DAY GROUPS
   ============================================================ */
.day-group {
  margin-bottom: 28px;
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--emerald);
}

.day-label {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--forest);
}

.day-count {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--forest);
  background: var(--emerald-soft);
  border: 1px solid var(--emerald-border);
  border-radius: var(--radius-full);
  padding: 3px 10px;
}

.record-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 6px;
}

.record-meta b {
  color: var(--ink);
}

.record-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.summary-quote {
  border-left: 3px solid var(--emerald);
  padding: 12px 16px;
  margin: 14px 0;
  background: var(--card-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.90rem;
  line-height: 1.55;
}

/* Supervisor Card in Admin */
.sup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.sup-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-fast);
}

.sup-card:hover {
  border-color: var(--emerald-border);
  box-shadow: var(--shadow-md);
}

.sup-card-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sup-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald-soft), #cbf2de);
  color: var(--forest);
  border: 1px solid var(--emerald-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.sup-info {
  flex: 1;
  min-width: 0;
}

.sup-info h3 {
  font-size: 0.98rem;
  margin: 0 0 2px 0;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sup-info p {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sup-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sup-card.editing {
  border-color: var(--emerald);
  box-shadow: 0 0 0 2px var(--emerald-glow), var(--shadow-md);
  background: #fafdfa;
}

.sup-card.editing label {
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 0.68rem;
}

.sup-card.editing input {
  padding: 8px 12px;
  font-size: 0.88rem;
  min-height: 38px;
}

/* Empty State */
.empty-state {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--muted);
  background: #ffffff;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
}

/* ============================================================
   LOGIN PAGE (Card Centrada, Branded Header & Background)
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 80% 15%, rgba(62, 207, 142, 0.20), transparent 45%),
    radial-gradient(circle at 15% 85%, rgba(120, 176, 48, 0.15), transparent 40%),
    linear-gradient(145deg, var(--deep-alt), var(--deep) 55%, #0d2813);
  position: relative;
}

.login-wrap::before {
  content: '';
  position: absolute;
  inset: 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: 36px 36px;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(62, 207, 142, 0.12);
  padding: 40px 36px;
  position: relative;
  z-index: 2;
}

.login-header-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.login-header-logo img {
  width: 50px;
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.12));
}

.login-title {
  font-size: 1.70rem;
  color: var(--forest);
  margin-bottom: 6px;
}

.login-sub {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Inline Messages */
.error-msg, .success-msg {
  display: none;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.86rem;
  margin: 12px 0;
  animation: panelFadeIn 0.2s ease;
}

.error-msg {
  background: var(--red-soft);
  border: 1px solid var(--red-border);
  color: var(--red);
}

.success-msg {
  background: var(--emerald-soft);
  border: 1px solid var(--emerald-border);
  color: var(--forest);
}

.error-msg.show, .success-msg.show {
  display: block;
}

/* ============================================================
   FLOATING TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 32px));
}

.toast-item {
  pointer-events: auto;
  background: var(--deep);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  animation: toastIn 0.25s var(--ease-spring);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-item.fade-out {
  opacity: 0;
  transform: translateY(10px);
}

.toast-item.toast-success {
  border-left: 4px solid var(--emerald);
}

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

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

.toast-content {
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 4px;
}

.toast-close:hover {
  color: #fff;
}

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

/* ============================================================
   RESPONSIVE BREAKPOINTS (Mobile & Tablet)
   ============================================================ */

/* Tablet (max-width: 900px) */
@media (max-width: 900px) {
  .admin-shell {
    padding: 0 18px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    margin: 16px 0 0;
  }

  .shift-metrics-bar {
    grid-template-columns: repeat(2, 1fr);
    margin: 14px 20px 0;
  }

  .tabs-wrap {
    margin: 16px 0 0;
  }

  .tab-panel {
    padding: 16px 0 60px;
  }

  .export-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .export-bar .btn {
    width: 100%;
  }
}

/* Mobile Screens (max-width: 680px) */
@media (max-width: 680px) {
  .topbar {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand-nav-wrap {
    gap: 8px;
  }

  .who {
    width: 100%;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .admin-shell {
    padding: 0 12px;
  }

  .shift-metrics-bar {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 14px 0;
    padding: 0 14px;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0 0;
  }

  .kpi-card {
    padding: 14px 16px;
  }

  .kpi-val {
    font-size: 1.45rem;
  }

  .tabs-wrap {
    margin: 14px 0 0;
  }

  .tabs {
    width: 100%;
    display: flex;
  }

  .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 8px;
    font-size: 0.76rem;
    gap: 5px;
  }

  .tab-panel {
    padding: 14px 0 60px;
  }

  /* Switch stepper to compact progress bar on mobile */
  .stepper-track {
    display: none;
  }

  .mobile-stepper-bar {
    display: block;
  }

  .page-wrap {
    padding: 0 14px;
  }

  .ticket-head {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 18px;
  }

  .ticket-body {
    padding: 16px 18px;
  }

  .record-actions {
    margin-top: 10px;
    width: 100%;
  }

  .record-actions .btn {
    flex: 1;
  }

  .hours-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .copy-hours-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-hours-bar .btn {
    width: 100%;
  }

  .step-actions {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .step-actions .btn {
    width: 100%;
  }

  .toolbar {
    grid-template-columns: 1fr;
    padding: 14px 16px;
  }

  .toolbar .btn {
    width: 100%;
  }

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

  .sup-actions {
    flex-wrap: wrap;
  }

  .sup-actions .btn {
    flex: 1;
  }

  .login-card {
    padding: 30px 20px;
  }
}

/* Small mobile devices (max-width: 480px) */
@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    flex-direction: column;
  }

  .tab-btn {
    width: 100%;
    justify-content: flex-start;
  }

  .brand-title span {
    font-size: 1.05rem;
  }

  .topbar {
    padding: 8px 12px;
  }
}
