/* ============================================================
   MAIROA PANEL — Modern SaaS, Apple/Airbnb inspired
   Light mode, warm neutrals, soft depth, mobile-first
   ============================================================ */

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ── Tokens (light) ────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg:           #FAFAF7;          /* warm canvas */
  --surface:      #FFFFFF;          /* cards */
  --surface-2:    #F4F3EF;          /* hovered / sunken */
  --surface-3:    #EDEBE5;          /* deeper accent */
  --overlay:      rgba(20, 20, 20, 0.45);

  /* Text */
  --text:         #1B1B1B;          /* primary text */
  --text-soft:    #4F4F4F;
  --text-muted:   #828282;
  --text-faint:   #B0B0B0;
  --text-on-primary: #FFFFFF;

  /* Borders */
  --border:       #ECECE8;
  --border-2:     #DBDAD3;
  --ring:         rgba(255, 90, 95, 0.18);

  /* Brand — coral with warmth (Airbnb DNA, not identical) */
  --primary:      #FF5A5F;
  --primary-soft: #FFEDEE;
  --primary-700:  #E04347;
  --primary-tint: rgba(255, 90, 95, 0.08);

  /* Semantic */
  --teal:         #00A699;
  --teal-soft:    #DFF5F2;
  --amber:        #FFB400;
  --amber-soft:   #FFF4D6;
  --rose:         #E11D48;
  --rose-soft:    #FFE4E8;
  --emerald:      #059669;
  --emerald-soft: #D1FAE5;
  --indigo:       #4F46E5;
  --indigo-soft:  #E5E7FB;

  /* Type */
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(20, 20, 20, 0.04);
  --shadow-sm: 0 1px 2px rgba(20, 20, 20, 0.04), 0 2px 6px rgba(20, 20, 20, 0.04);
  --shadow-md: 0 2px 4px rgba(20, 20, 20, 0.04), 0 6px 16px rgba(20, 20, 20, 0.06);
  --shadow-lg: 0 8px 24px rgba(20, 20, 20, 0.10);
  --shadow-pop: 0 12px 40px rgba(20, 20, 20, 0.16);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 320ms;

  /* Layout */
  --sidebar-w: 264px;
  --topbar-h: 64px;
  --bottombar-h: 68px;
  --content-max: 1320px;
  --gutter: clamp(16px, 3vw, 28px);

  color-scheme: light;
}

/* ── Tokens (dark) ─────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:           #0E0E10;
  --surface:      #17171A;
  --surface-2:    #1E1E22;
  --surface-3:    #25252A;
  --overlay:      rgba(0, 0, 0, 0.6);

  --text:         #F5F5F4;
  --text-soft:    #C9C9C6;
  --text-muted:   #8E8E8E;
  --text-faint:   #5C5C5C;

  --border:       #25252A;
  --border-2:     #34343A;
  --ring:         rgba(255, 90, 95, 0.32);

  --primary-soft: rgba(255, 90, 95, 0.14);
  --primary-tint: rgba(255, 90, 95, 0.18);

  --teal-soft:    rgba(0, 166, 153, 0.18);
  --amber-soft:   rgba(255, 180, 0, 0.18);
  --rose-soft:    rgba(225, 29, 72, 0.18);
  --emerald-soft: rgba(5, 150, 105, 0.18);
  --indigo-soft:  rgba(79, 70, 229, 0.18);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 16px 48px rgba(0, 0, 0, 0.7);

  color-scheme: dark;
}

/* ── Base ──────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--primary-tint); color: var(--text); }

/* ── Utilities ─────────────────────────────────────────────── */
.hidden { display: none !important; }
.no-scroll { overflow: hidden; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  background: var(--text);
  color: var(--surface);
  border-radius: var(--r-md);
  font-weight: 600;
  z-index: 1000;
  transform: translateY(-200%);
  transition: transform var(--t-base) var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ── Icons ─────────────────────────────────────────────────── */
.ui-icon, .brand-mark {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-icon--xs { width: 14px; height: 14px; }
.ui-icon--sm { width: 16px; height: 16px; }
.ui-icon--lg { width: 22px; height: 22px; }

.label-with-icon, .title-with-icon, .button-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.button-label { justify-content: center; }
.button-label--inline { justify-content: flex-start; }

/* ── App Status / Toasts ───────────────────────────────────── */
.app-status {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 24px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  font-weight: 500;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: toast-in 240ms var(--ease-out);
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.app-status--success {
  background: var(--emerald);
  color: white;
  border-color: transparent;
}
.app-status--error {
  background: var(--rose);
  color: white;
  border-color: transparent;
}
.app-status--info {
  background: var(--text);
  color: var(--surface);
  border-color: transparent;
}

/* ── Login Screen ──────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--primary-tint), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--teal-soft), transparent 60%),
    var(--bg);
}

.login-bg-pattern { display: none; }

.login-container {
  width: 100%;
  max-width: 440px;
  display: grid;
  gap: 28px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.logo-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--text);
  color: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.logo-mark .brand-mark {
  width: 22px; height: 22px;
  stroke: currentColor;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.login-card-header { margin-bottom: 24px; }

.login-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.field-group {
  display: grid;
  gap: 6px;
}

.field-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-soft);
}

.field-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  font-size: 15px;
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field-input::placeholder { color: var(--text-faint); }
.field-input:hover { border-color: var(--text-muted); }
.field-input:focus,
.field-input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

.login-error {
  padding: 10px 12px;
  background: var(--rose-soft);
  color: var(--rose);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
}

.login-footer {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary,
.btn-outline,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
  user-select: none;
}
.btn-primary:active,
.btn-outline:active,
.btn-ghost:active { transform: translateY(1px); }

.btn-primary {
  background: var(--text);
  color: var(--surface);
  width: 100%;
}
.btn-primary:hover:not([disabled]) {
  background: var(--primary);
  box-shadow: 0 6px 18px var(--ring);
}
.btn-primary[disabled] { opacity: 0.55; cursor: progress; }

.btn-outline {
  background: var(--surface);
  border-color: var(--border-2);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--text); background: var(--surface-2); }

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: var(--r-sm);
}

/* ── Layout: app shell (login is fullscreen, dashboard uses shell) ── */
.dashboard-screen {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
}

@media (max-width: 960px) {
  .dashboard-screen {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 1fr var(--bottombar-h);
    grid-template-areas:
      "topbar"
      "main"
      "bottombar";
  }
}

/* ── Sidebar (desktop) ─────────────────────────────────────── */
.sidebar {
  grid-area: sidebar;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.sidebar-brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--text);
  color: var(--surface);
  border-radius: var(--r-md);
  font-weight: 700;
}
.sidebar-brand-name {
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 15px;
  line-height: 1.1;
}
.sidebar-brand-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.sidebar-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 14px 10px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 14px;
  color: var(--text-soft);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active {
  background: var(--text);
  color: var(--surface);
  font-weight: 600;
}
.nav-item.is-active .nav-item-sub { color: rgba(255, 255, 255, 0.7); }

.nav-item-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.nav-item-icon svg { width: 18px; height: 18px; }

.nav-item-label { flex: 1; }
.nav-item-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 4px;
}

@media (max-width: 960px) {
  .sidebar { display: none; }
}

/* ── Top bar ───────────────────────────────────────────────── */
.topbar {
  grid-area: topbar;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
}
.topbar-mobile-brand .logo-mark {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
}
.topbar-mobile-brand .logo-text {
  font-size: 17px;
}

.topbar-greeting {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar-greeting-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-greeting-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--text-soft);
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}
.status-dot--active   { background: var(--emerald); box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15); }
.status-dot--inactive { background: var(--text-faint); }
.status-dot--vacation { background: var(--amber); }
.status-dot--error    { background: var(--rose); }

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-soft);
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--amber));
  color: white;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 12.5px;
}

.nav-time { display: none; }

@media (max-width: 960px) {
  .topbar-mobile-brand { display: flex; }
  .topbar-greeting { display: none; }
  .status-pill { display: none; }
  .topbar-right { gap: 6px; }
}

/* ── Main content ──────────────────────────────────────────── */
.main {
  grid-area: main;
  padding: 28px var(--gutter) 56px;
  max-width: var(--content-max);
  width: 100%;
}

@media (max-width: 960px) {
  .main {
    padding: 18px var(--gutter) calc(var(--bottombar-h) + 24px);
  }
}

/* ── Section system ────────────────────────────────────────── */
.section {
  display: block;
  animation: fade-up 220ms var(--ease-out);
}
.section[hidden] { display: none; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 24px;
}

.section-page-header h2,
.page-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-page-header p,
.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

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

/* Hide legacy section-nav (replaced by sidebar/bottom-nav) */
.section-nav { display: none; }

/* ── Page header (Panorama) ────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.dot-strip { display: none; }

/* ── Bottom nav (mobile) ───────────────────────────────────── */
.bottom-nav {
  grid-area: bottombar;
  display: none;
  background: var(--surface);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 30;
  padding: 8px max(8px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
  box-shadow: 0 -4px 20px rgba(20, 20, 20, 0.04);
}

.bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  width: 100%;
}

.bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  font-size: 10.5px;
  color: var(--text-muted);
  border-radius: var(--r-md);
  transition: background var(--t-fast), color var(--t-fast);
  font-weight: 500;
}
.bottom-tab:active { background: var(--surface-2); }
.bottom-tab.is-active {
  color: var(--text);
}
.bottom-tab.is-active .bottom-tab-icon {
  background: var(--text);
  color: var(--surface);
}

.bottom-tab-icon {
  width: 36px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  transition: background var(--t-fast), color var(--t-fast);
}
.bottom-tab-icon svg { width: 20px; height: 20px; stroke-width: 1.8; }

@media (max-width: 960px) {
  .bottom-nav { display: block; }
  .bottom-nav-inner { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 380px) {
  .bottom-tab { font-size: 9.5px; }
}

/* ── Cards ─────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow var(--t-base), transform var(--t-base);
  min-height: 110px;
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.stat-card--accent {
  background: linear-gradient(135deg, var(--primary), var(--primary-700));
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 22px rgba(255, 90, 95, 0.22);
}
.stat-card--accent .stat-label,
.stat-card--accent .stat-sub { color: rgba(255, 255, 255, 0.78); }
.stat-card--accent .stat-value { color: white; }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.1;
}

.stat-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: auto;
}

/* ── Controls grid (chatbot + vacaciones cards) ────────────── */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.control-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.control-title {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-desc {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.control-status {
  font-size: 13px;
  color: var(--text-soft);
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--r-md);
}

.control-help {
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 12px;
  margin-top: 8px;
  background: var(--surface);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-sm);
  line-height: 1.5;
}
.control-help strong { color: var(--text); }

.vacation-msg-row {
  display: grid;
  gap: 10px;
}
.vacation-msg-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  font-size: 13.5px;
  resize: vertical;
  min-height: 70px;
  color: var(--text);
}
.vacation-msg-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

/* ── iOS-style toggle ──────────────────────────────────────── */
.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  display: inline-block;
  flex-shrink: 0;
}
.toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  transition: background var(--t-base) var(--ease);
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform var(--t-base) var(--ease);
}
.toggle input:checked + .toggle-track {
  background: var(--emerald);
}
.toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}
.toggle input:focus-visible + .toggle-track {
  box-shadow: 0 0 0 4px var(--ring);
}

/* ── Section header (interno) ──────────────────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 8px 0 14px;
}
.section-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.section-count {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Automations grid ──────────────────────────────────────── */
.automations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.automation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow var(--t-base), transform var(--t-base);
}
.automation-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.automation-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.automation-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}
.automation-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.automation-stats {
  display: flex;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.exec-bar {
  display: inline-block;
  width: 5px;
  height: 14px;
  border-radius: 1.5px;
  background: var(--surface-3);
}
.exec-bar--success { background: var(--emerald); }
.exec-bar--error { background: var(--rose); }

.automation-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.automations-empty,
.activity-empty,
.table-empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Bottom grid (panorama charts) ─────────────────────────── */
.bottom-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .bottom-grid { grid-template-columns: 1fr; }
}

.chart-card,
.activity-card,
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-title {
  font-weight: 700;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.chart-legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot--white { background: var(--text); }
.legend-dot--muted { background: var(--primary); }

.chart-wrapper {
  position: relative;
  height: 280px;
}

/* ── Activity feed ─────────────────────────────────────────── */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  transition: background var(--t-fast);
}
.activity-item:hover { background: var(--surface-2); }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
}
.activity-dot--message  { background: var(--indigo); }
.activity-dot--payment  { background: var(--emerald); }
.activity-dot--reminder { background: var(--amber); }
.activity-dot--human    { background: var(--primary); }

.activity-content { min-width: 0; flex: 1; }
.activity-type {
  font-weight: 600;
  font-size: 13px;
}
.activity-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  word-break: break-word;
}
.activity-time {
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Tables ────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--r-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.data-table tbody tr {
  transition: background var(--t-fast);
}
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }

/* ── Badges / chips ────────────────────────────────────────── */
.badge,
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--surface-2);
  color: var(--text-soft);
  border: 1px solid var(--border);
}

.badge--paid { background: var(--emerald-soft); color: var(--emerald); border-color: transparent; }
.badge--pending { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge--draft { background: var(--surface-2); color: var(--text-muted); }
.badge--cancelled { background: var(--rose-soft); color: var(--rose); border-color: transparent; }

.chip--on { background: var(--emerald-soft); color: var(--emerald); border-color: transparent; }
.chip--off { background: var(--surface-2); color: var(--text-muted); }
.chip--segment-adulto { background: var(--indigo-soft); color: var(--indigo); border-color: transparent; }
.chip--segment-infantil { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.chip--segment-corporativo { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.chip--info { background: var(--indigo-soft); color: var(--indigo); border-color: transparent; }
.chip--warn { background: var(--amber-soft); color: var(--amber); border-color: transparent; }

/* ── Estado del día (STEP 8) ───────────────────────────────── */
.dia-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.dia-date-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-soft);
}
.dia-date-label input[type="date"] {
  padding: 8px 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
}
.dia-quick-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dia-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.dia-banner {
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--amber-soft);
  color: var(--amber);
  margin-bottom: 16px;
  font-size: 14px;
}
.dia-banner--alert { border-left: 4px solid var(--amber); }
.dia-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 18px 12px;
  margin-bottom: 16px;
}
.dia-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.dia-card-desc {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.dia-excepciones-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ── KPI grid (Métricas) ───────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 110px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t-base), transform var(--t-base);
}
.kpi-cell:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.kpi-cell--accent {
  background: linear-gradient(135deg, var(--text), #2C2C2C);
  color: white;
  border-color: transparent;
}
.kpi-cell--accent .kpi-label,
.kpi-cell--accent .kpi-hint { color: rgba(255, 255, 255, 0.7); }
.kpi-cell--accent .kpi-value { color: white; }

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.1;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-muted);
  align-self: flex-start;
  margin-top: 4px;
}
.kpi-delta--up { background: var(--emerald-soft); color: var(--emerald); }
.kpi-delta--down { background: var(--rose-soft); color: var(--rose); }

.kpi-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
}

/* ── Filter bar ────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}

.filter-bar input,
.filter-bar select {
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--text);
  min-width: 130px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.filter-bar input:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.filter-bar input[type="search"] { min-width: 220px; flex: 1; }

.filter-bar-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 2px;
}

.filter-bar-spacer { flex: 1; }

.filter-count {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Charts grid ───────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.charts-grid .chart-card { min-height: 320px; }

/* ── Heatmap ───────────────────────────────────────────────── */
.heatmap {
  display: grid;
  gap: 3px;
  padding: 4px;
  margin-top: 12px;
}

.heatmap-cell {
  background: var(--surface-2);
  aspect-ratio: 1 / 1;
  min-height: 22px;
  font-size: 9.5px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  border-radius: 4px;
  transition: transform var(--t-fast);
}
.heatmap-cell:hover { transform: scale(1.08); z-index: 1; }

.heatmap-label { background: transparent; font-weight: 600; }
.heatmap-col-label { font-size: 10px; color: var(--text-muted); }
.heatmap-row-label {
  justify-content: flex-end;
  padding-right: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.heatmap-cell[data-level="0"] { background: var(--surface-2); color: transparent; }
.heatmap-cell[data-level="1"] { background: rgba(255, 90, 95, 0.10); color: var(--text-muted); }
.heatmap-cell[data-level="2"] { background: rgba(255, 90, 95, 0.22); color: var(--text-soft); }
.heatmap-cell[data-level="3"] { background: rgba(255, 90, 95, 0.40); color: var(--text); }
.heatmap-cell[data-level="4"] { background: rgba(255, 90, 95, 0.65); color: white; }
.heatmap-cell[data-level="5"] { background: var(--primary); color: white; font-weight: 700; }

/* ── Config CRUD (Catálogo / Calendario / Operativa) ──────── */
.config-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.config-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.config-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 14px;
  flex-wrap: wrap;
}

.config-card-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.config-card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.config-card-body { padding: 0; }

.config-table-wrapper {
  overflow-x: auto;
}

.config-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.config-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.config-table tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.config-table tbody tr:last-child td { border-bottom: 0; }
.config-table tbody tr { transition: background var(--t-fast); }
.config-table tbody tr:hover { background: var(--surface-2); }
.config-table tbody tr.is-editing { background: var(--primary-tint); }

.config-table .cell-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text);
  font-size: 13px;
  border-radius: var(--r-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.config-table .cell-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.config-table .cell-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.cell-value { color: var(--text); }
.cell-value--muted { color: var(--text-muted); }
.cell-value--numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.config-new-row { background: var(--primary-tint); }

.cell-edit-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}
.cell-edit-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
  line-height: 1.2;
}
.cell-edit-helper {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
  opacity: 0.85;
}
.cell-input--readonly {
  display: inline-block;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-sm);
  color: var(--text-soft);
  font-style: italic;
}

/* ── Icon buttons (table actions) ──────────────────────────── */
.btn-icon {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text-soft);
  border-radius: var(--r-sm);
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn-icon:hover { border-color: var(--text); color: var(--text); background: var(--surface-2); }
.btn-icon--danger:hover { border-color: var(--rose); color: var(--rose); background: var(--rose-soft); }

.btn-icon[disabled] { opacity: 0.4; cursor: not-allowed; }

.btn-add-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--text);
  color: var(--surface);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--t-fast), transform var(--t-fast);
}
.btn-add-row:hover { background: var(--primary); }
.btn-add-row:active { transform: translateY(1px); }
.btn-add-row::before {
  content: '+';
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

/* ── Mini toggle (en tablas) ───────────────────────────────── */
.mini-toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
}
.mini-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.mini-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  transition: background var(--t-base) var(--ease);
}
.mini-toggle-track::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--t-base) var(--ease);
}
.mini-toggle input:checked + .mini-toggle-track { background: var(--emerald); }
.mini-toggle input:checked + .mini-toggle-track::before { transform: translateX(16px); }
.mini-toggle input:focus-visible + .mini-toggle-track { box-shadow: 0 0 0 3px var(--ring); }

/* ── Side panel (sheet) ────────────────────────────────────── */
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 460px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--t-slow) var(--ease-out);
  box-shadow: var(--shadow-pop);
}
.side-panel.is-open { transform: translateX(0); }

.side-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.side-panel-title {
  font-size: 16px;
  font-weight: 700;
}
.side-panel-close {
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: 22px;
  transition: background var(--t-fast), color var(--t-fast);
}
.side-panel-close:hover { background: var(--surface-2); color: var(--text); }

.side-panel-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.detail-list {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px 18px;
  font-size: 13.5px;
}
.detail-list dt {
  color: var(--text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  align-self: center;
}
.detail-list dd {
  color: var(--text);
  word-break: break-word;
  font-weight: 500;
}

.side-panel-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-slow);
  backdrop-filter: blur(2px);
}
.side-panel-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 540px) {
  .side-panel { max-width: 100%; }
  .detail-list { grid-template-columns: 1fr; gap: 4px; }
  .detail-list dt { margin-top: 8px; }
}

/* ── Upcoming list (cards) ─────────────────────────────────── */
.upcoming-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.upcoming-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: box-shadow var(--t-base), transform var(--t-base), border-color var(--t-base);
  box-shadow: var(--shadow-xs);
}
.upcoming-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.upcoming-date {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.upcoming-when {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.upcoming-title {
  font-size: 13.5px;
  color: var(--text);
}
.upcoming-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  align-items: center;
  justify-content: space-between;
}
.upcoming-tag {
  display: inline-block;
  padding: 3px 9px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  font-size: 11.5px;
  color: var(--text-soft);
  font-weight: 500;
}

/* ── Reservation rows (existing) ───────────────────────────── */
.reservation-row { cursor: pointer; }
.reservation-row td { font-size: 13.5px; }

/* ── Skeleton loader ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  border-radius: var(--r-sm);
  animation: skeleton-shine 1.4s ease-in-out infinite;
}
@keyframes skeleton-shine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  display: none;
}

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

/* ── Misc legacy class hides ───────────────────────────────── */
.nav-divider { display: none; }
.nav-logo { display: none; }
.nav-status { display: none; }
.nav-client { display: none; }

/* ── Responsive tweaks ─────────────────────────────────────── */
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 14px; min-height: 96px; }
  .stat-value { font-size: 22px; }

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

  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 22px; }

  .config-card-header { padding: 14px 16px; }
  .config-table thead th,
  .config-table tbody td { padding: 8px 10px; font-size: 12.5px; }

  .filter-bar { gap: 6px; }
  .filter-bar input[type="search"] { min-width: 100%; }
}

/* ── Pendientes (handoffs) ────────────────────────────────── */
.pendientes-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 7px;
  margin-left: 6px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--text-on-primary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.pendientes-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.pendientes-empty {
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: var(--r-md, 12px);
  background: var(--surface);
  color: var(--text-muted);
  text-align: center;
  font-size: 14px;
}

.pendientes-empty--error {
  border-color: var(--rose);
  color: var(--rose);
  background: var(--rose-soft);
}

.pendientes-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md, 12px);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.04));
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.pendientes-card:hover {
  border-color: var(--border-2);
  transform: translateY(-1px);
}

.pendientes-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pendientes-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pendientes-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.pendientes-card-time {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.pendientes-card-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  font-size: 13px;
  color: var(--text-soft);
}

.pendientes-card-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.pendientes-card-label {
  flex: 0 0 80px;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.pendientes-card-value {
  color: var(--text);
  word-break: break-word;
}

.pendientes-card-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ── Confirm cobro modal ─────────────────────────────────── */
.confirm-modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 480px;
  width: calc(100% - 32px);
  border-radius: var(--r-lg, 14px);
}

.confirm-modal::backdrop {
  background: var(--overlay);
  backdrop-filter: blur(2px);
}

.confirm-modal-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px 18px;
  background: var(--surface);
  border-radius: var(--r-lg, 14px);
  border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.confirm-modal-header h2 {
  margin: 0 0 4px 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.confirm-modal-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.confirm-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.confirm-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.confirm-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.confirm-field input {
  padding: 9px 11px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.confirm-field input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.confirm-field-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.9fr;
  gap: 10px;
}

.confirm-modal-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--rose-soft);
  color: var(--rose);
  font-size: 12.5px;
}

.confirm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

@media (max-width: 540px) {
  .confirm-field-grid {
    grid-template-columns: 1fr 1fr;
  }
  .confirm-field-grid .confirm-field:first-child {
    grid-column: 1 / -1;
  }
  .pendientes-card-label { flex-basis: 70px; }
}
