/* ================================================================
   Taller Diagonal — styles.css (rebuilt 2026-04-07)
   Modern orange-brand design with dark mode
   ================================================================ */

:root {
  --brand: #f97316;
  --brand-2: #ea580c;
  --brand-soft: #fff7ed;
  --brand-contrast: #ffffff;

  --surface-0: #f8fafc;
  --surface-1: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;

  --ink-1: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;

  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --success: #16a34a;
  --success-soft: #f0fdf4;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --info: #2563eb;
  --info-soft: #eff6ff;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  --e1: 0 1px 2px rgba(15,23,42,.06);
  --e2: 0 4px 12px -4px rgba(15,23,42,.12);
  --e3: 0 20px 40px -12px rgba(15,23,42,.25);

  --dur-fast: 120ms;
  --dur: 180ms;
  --ease: cubic-bezier(.2,.8,.2,1);

  --h-control: 32px;

  /* Type scale (uniform) */
  --fs-xs: 11px;   /* labels chips, hints */
  --fs-sm: 12px;   /* secondary text, table cells */
  --fs-base: 13px; /* body, buttons, inputs */
  --fs-md: 14px;   /* emphasized body */
  --fs-lg: 16px;   /* card titles, modal h3 */
  --fs-xl: 18px;   /* panel h2 */
  --fs-2xl: 22px;  /* big stat values */
  --lh: 1.5;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
}

[data-theme="dark"] {
  --brand: #fb923c;
  --brand-2: #f97316;
  --brand-soft: rgba(251,146,60,.12);

  --surface-0: #0b1220;
  --surface-1: #0f172a;
  --surface-2: #111c34;
  --surface-3: #1e293b;

  --ink-1: #f1f5f9;
  --ink-2: #cbd5e1;
  --ink-3: #94a3b8;

  --border: #1e293b;
  --border-strong: #334155;

  --success-soft: rgba(22,163,74,.15);
  --warning-soft: rgba(245,158,11,.15);
  --danger-soft: rgba(220,38,38,.15);
  --info-soft: rgba(37,99,235,.15);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--surface-0);
  color: var(--ink-1);
  font-size: var(--fs-base);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; color: var(--ink-1); font-weight: 700; letter-spacing: -0.01em; }

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

.hidden { display: none !important; }

/* ========== Header ========== */
.header {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 8px var(--s-4);
  min-height: 52px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(1.1) blur(6px);
}
.header-admin { position: sticky; top: 0; }

/* TD logo mark */
.brand-mark {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: var(--fs-base);
  font-weight: 800;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 12px -4px rgba(249,115,22,.5);
  transition: transform var(--dur) var(--ease);
}
.brand-mark:hover { transform: scale(1.05); text-decoration: none; }

/* Dynamic header title (current section / current campaign) */
.header-title {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: var(--s-3);
}
.header-title .ht-text {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink-1);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-title .ht-sub {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.header-left { display: none; }
.subtitle { font-size: var(--fs-xs); color: var(--ink-3); }

.header-nav { flex: 0 0 auto; padding: 3px; border-radius: 999px; background: var(--surface-2); display: inline-flex; gap: 2px; }
.header-admin .admin-tabs { padding: 2px; }
.header-nav .admin-tab,
.admin-tabs .admin-tab {
  height: 28px;
  padding: 0 14px;
  font-size: var(--fs-sm);
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--dur) var(--ease);
}
.admin-tab:hover { color: var(--brand); background: var(--surface-1); }
.admin-tab.active { background: var(--brand); color: #fff; box-shadow: 0 2px 8px -3px rgba(249,115,22,.55); }
.admin-tab.active:hover { color: #fff; background: var(--brand-2); }

.header-right { display: flex; align-items: center; gap: var(--s-2); }
.header-context { display: flex; flex-direction: column; }
.header-context-title { font-size: 12px; font-weight: 600; color: var(--ink-2); }

.btn-icon-round,
.theme-toggle,
.hamburger-btn,
.user-info,
.header-icon-btn,
.stats { height: var(--h-control); }

.theme-toggle {
  width: var(--h-control);
  height: var(--h-control);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  cursor: pointer;
  font-size: var(--fs-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur) var(--ease);
}
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); }

.hamburger-btn { display: none; }

.user-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.lugar-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
}

.btn-icon-round {
  width: var(--h-control);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
}
.btn-icon-round:hover { border-color: var(--brand); color: var(--brand); }

.stats, .stats-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--h-control);
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--ink-1);
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}
.btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px -3px rgba(249,115,22,.5);
}
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; box-shadow: 0 8px 20px -6px rgba(249,115,22,.6); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(.98); }

.btn-success { background: var(--success); border-color: var(--success); color: #fff; box-shadow: 0 2px 8px -3px rgba(22,163,74,.4); }
.btn-success:hover { filter: brightness(1.06); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-secondary { background: var(--surface-2); }
.btn-sm { height: 28px; padding: 0 12px; font-size: var(--fs-sm); }
.btn-large { height: 44px; padding: 0 22px; font-size: var(--fs-md); }
.btn-text { background: transparent; border-color: transparent; }
.btn-text:hover { background: var(--surface-2); border-color: transparent; }
.btn-close {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.btn-close:hover { background: var(--surface-2); color: var(--danger); }
.btn-link {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
  font-weight: 500;
}
.btn-link:hover { text-decoration: underline; }
.btn-block { width: 100%; }

/* ========== Forms ========== */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="search"],
select,
textarea {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-1);
  color: var(--ink-1);
  font-size: var(--fs-md);
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  width: 100%;
  box-sizing: border-box;
}
textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-row label { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-grid-2 { grid-template-columns: 1fr; } }

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="number"],
.form-row select {
  height: 42px;
  border-radius: var(--r-md);
}

.hint { font-size: var(--fs-xs); color: var(--ink-3); }
.optional-tag { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 500; margin-left: 4px; }

.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-base); cursor: pointer; }

/* Switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: 999px;
  transition: background var(--dur) var(--ease);
  cursor: pointer;
}
.slider::before {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 999px;
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ========== Chips / Pills / Badges ========== */
.chip, .filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-2);
}
.chip-user { background: var(--brand-soft); color: var(--brand-2); border-color: transparent; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip { cursor: pointer; }
.filter-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.active-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }

/* ========== App container / panels ========== */
.app-container, .admin-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.main-content, .admin-main, .content-area {
  padding: var(--s-5);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: var(--s-4);
  gap: var(--s-3);
  flex-wrap: wrap;
}
.panel-header h2 { display: none; }
.panel-actions { display: flex; gap: 8px; align-items: center; }
.panel-actions .btn { height: 36px; padding: 0 16px; font-size: var(--fs-base); }

.search-panel, .results-panel, .detail-panel, .cfg-card, .sub-panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 1px 2px rgba(15,23,42,.06);
  transition: box-shadow var(--dur) var(--ease);
}
.search-panel:hover, .cfg-card:hover { box-shadow: 0 4px 12px -4px rgba(15,23,42,.1); }

.search-box, .search-box-full {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box input, .search-box-full input { padding-left: 38px; padding-right: 38px; }
.search-icon { position: absolute; left: 12px; color: var(--ink-3); pointer-events: none; }
.search-clear { position: absolute; right: 8px; background: none; border: none; cursor: pointer; color: var(--ink-3); font-size: 16px; }
.search-row { display: flex; gap: 12px; flex-wrap: wrap; }
.search-info { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 6px; }

.results-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.results-count { font-size: var(--fs-sm); color: var(--ink-3); }
.results-list { display: flex; flex-direction: column; gap: 8px; }

.detail-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.detail-content { display: flex; flex-direction: column; gap: 10px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ========== Campana cards ========== */
.campana-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-4);
}
.campana-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
  transition: all var(--dur) var(--ease);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.campana-card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -12px rgba(249,115,22,.35);
}
.campana-card:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.campana-card-name, .hc-name {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--ink-1);
  margin: 12px 0 14px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.campana-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.campana-card-code {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--brand-2);
  background: var(--brand-soft);
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.campana-card-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip-active { background: var(--success-soft); color: var(--success); border-color: transparent; }
.chip-closed, .chip-inactive { background: var(--surface-3); color: var(--ink-3); border-color: transparent; }
.chip-open { background: var(--info-soft); color: var(--info); border-color: transparent; }

.campana-card-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.ccs-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  min-width: 0;
}
.ccs-val {
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--ink-1);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.ccs-lbl {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-2);
  margin-top: 4px;
}
.ccs-mini { font-size: var(--fs-xs); color: var(--ink-3); }

.campana-card-progress {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}
.ccp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 999px;
  transition: width .4s var(--ease);
}
.campana-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.campana-card.is-closed { opacity: .72; }
.campana-card.is-closed .ccp-bar { background: var(--border-strong); }
.campana-card.is-hidden { border-style: dashed; }
.campana-card.is-hidden::before {
  content: 'Oculta';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  padding: 2px 6px;
  background: var(--warning-soft);
  color: var(--warning);
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.campana-card { position: relative; }

.campana-card-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dash-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--ink-2);
  cursor: pointer;
  font-weight: 600;
  margin-right: auto;
}
.dash-toggle input { accent-color: var(--brand); }
.btn-danger-text {
  background: transparent;
  border-color: transparent;
  color: var(--danger);
  padding: 0 8px;
}
.btn-danger-text:hover { background: var(--danger-soft); border-color: transparent; color: var(--danger); }

body.is-visor .ccf-actions,
body.is-visor .cc-confirm { display: none; }

/* Card footer actions row */
.campana-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.ccf-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cc-del-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--ink-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  position: relative;
  z-index: 2;
}
.cc-del-btn:hover {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
  transform: scale(1.08);
  box-shadow: 0 4px 12px -4px rgba(220,38,38,.4);
}
.cc-del-btn:active { transform: scale(.96); }
.cc-del-btn:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }

/* Inline confirm inside the card */
.cc-confirm {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeIn .15s var(--ease);
}
.cc-confirm-msg {
  font-size: var(--fs-sm);
  color: #991b1b;
  font-weight: 600;
}
[data-theme="dark"] .cc-confirm-msg { color: #fca5a5; }
.cc-confirm-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* (camp-breadcrumb removed — title now in header) */
.camp-breadcrumb { display: none; }

/* ========== Legacy breadcrumb tokens (kept for safety) ========== */
.camp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: var(--s-3);
  flex-wrap: wrap;
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
}
.cb-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px 0 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.cb-back:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.cb-sep { color: var(--ink-3); font-size: var(--fs-md); }
.cb-code { font-size: var(--fs-xs); }
.cb-name {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--ink-1);
  margin: 0;
  letter-spacing: -0.01em;
  flex: 1;
  min-width: 0;
}
.cb-state { display: inline-flex; }

/* ========== Stats bar (compact hero, single row, divided) ========== */
.stats-bar {
  display: flex;
  align-items: stretch;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
  margin-bottom: var(--s-3);
  overflow: hidden;
}
.sb-item {
  flex: 1 1 0;
  min-width: 0;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  position: relative;
}
.sb-item:last-child { border-right: none; }
.sb-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink-1);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.sb-pct {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--success);
  background: var(--success-soft);
  padding: 2px 8px;
  border-radius: 999px;
}
.sb-lbl {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  margin-top: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sb-sub { color: var(--ink-2); font-weight: 700; text-transform: none; letter-spacing: 0; }
.sb-progress .sb-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--surface-2);
}
.sb-progress .sb-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .4s var(--ease);
}
@media (max-width: 760px) {
  .stats-bar { flex-wrap: wrap; }
  .sb-item { flex: 1 1 50%; border-bottom: 1px solid var(--border); }
  .sb-item:nth-child(2n) { border-right: none; }
}

/* ========== Improved search + clear filters ========== */
.search-box-lg {
  position: relative;
  flex: 1;
  min-width: 240px;
}
.search-box-lg .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.search-box-lg input {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 44px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-1);
  color: var(--ink-1);
  font-size: var(--fs-md);
  transition: all var(--dur) var(--ease);
}
.search-box-lg input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
  outline: none;
}
.search-box-lg .search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface-2);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.search-box-lg .search-clear:hover { background: var(--danger-soft); color: var(--danger); }

.btn-clear-filters {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 16px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}
.btn-clear-filters:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.dir-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
}
@media (max-width: 600px) {
  .btn-clear-filters { justify-content: center; }
}

/* ========== Confirm popover (anchored near trigger) ========== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.35);
  z-index: 4000;
  animation: overlayIn .12s var(--ease);
  backdrop-filter: blur(1px);
}
.confirm-dialog {
  position: absolute;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px -12px rgba(15,23,42,.4), 0 8px 20px -8px rgba(15,23,42,.2);
  width: 320px;
  max-width: calc(100vw - 24px);
  padding: 16px 18px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 10px 12px;
  animation: popIn .18s var(--ease);
  transform-origin: top left;
}
.confirm-dialog.danger { border-top: 3px solid var(--danger); }
@keyframes popIn {
  from { transform: scale(.96) translateY(-4px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.confirm-icon-wrap { grid-row: 1; grid-column: 1; }
.confirm-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-md);
  font-weight: 800;
}
.confirm-dialog.danger .confirm-icon { background: var(--danger-soft); color: var(--danger); }
.confirm-body { grid-row: 1; grid-column: 2; min-width: 0; }
.confirm-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink-1);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.confirm-msg { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.45; }
.confirm-actions {
  grid-row: 2;
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 6px;
}
.confirm-actions .btn { min-width: 0; height: 32px; padding: 0 14px; font-size: var(--fs-sm); }

/* ========== Toast container styling ========== */
.toast {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--r-md);
  padding: 12px 16px;
  box-shadow: var(--e3);
  font-size: 13px;
  max-width: 360px;
  animation: toastIn .2s var(--ease);
  color: var(--ink-1);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }
.toast.warning { border-left-color: var(--warning); }

.camp-toolbar { display: flex; gap: 8px; margin-bottom: var(--s-3); flex-wrap: wrap; }

/* ========== Admin lists ========== */
.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-list-item {
  background: var(--surface-1);
  border: 1px solid var(--border);
  padding: 16px 18px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all var(--dur) var(--ease);
}
.admin-list-item:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 16px -8px rgba(249,115,22,.3);
  transform: translateY(-1px);
}

.user-actions { display: flex; gap: 6px; }

/* ========== User card (admin > usuarios) ========== */
.user-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all .18s var(--ease);
}
.user-card:hover {
  border-color: var(--brand);
  box-shadow: 0 6px 20px -10px rgba(249,115,22,.35);
  transform: translateY(-1px);
}
.uc-avatar {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex: none;
  background: var(--ink-3);
  box-shadow: 0 4px 12px -6px rgba(0,0,0,.25);
  overflow: hidden;
  line-height: 1;
  letter-spacing: 0;
  padding: 0 2px;
  text-transform: uppercase;
  box-sizing: border-box;
}
.uc-avatar-admin { background: linear-gradient(135deg, #f97316, #ea580c); }
.uc-avatar-visor { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.uc-avatar-user  { background: linear-gradient(135deg, #64748b, #475569); }
.uc-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.uc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.uc-name { font-size: 15px; font-weight: 700; color: var(--ink-1); }
.uc-rol {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.uc-rol-admin { background: rgba(249,115,22,.12); color: #ea580c; }
.uc-rol-visor { background: rgba(14,165,233,.12); color: #0284c7; }
.uc-rol-user  { background: rgba(100,116,139,.15); color: #475569; }
.uc-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.uc-dot-on  { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.uc-dot-off { background: #cbd5e1; }
.uc-email { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 6px;
  margin-top: 2px;
}
.ul-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
  line-height: 1.4;
}
.ul-chip-lugar { background: rgba(249,115,22,.08); color: #ea580c; border-color: rgba(249,115,22,.25); }
.ul-chip-camp  { background: rgba(14,165,233,.08); color: #0284c7; border-color: rgba(14,165,233,.25); }
.ul-chip-empty { color: var(--ink-3); font-style: italic; }
.ul-chip-all { background: rgba(34,197,94,.1); color: #16a34a; border-color: rgba(34,197,94,.3); font-weight: 700; }
.uc-actions { display: flex; gap: 6px; flex: none; align-self: center; }
.uc-icon-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s var(--ease);
}
.uc-icon-btn:hover { background: var(--surface-2); color: var(--ink-1); }
.uc-icon-btn.uc-edit:hover { border-color: var(--brand); color: var(--brand); background: rgba(249,115,22,.08); }
.uc-icon-btn.uc-del:hover  { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,.08); }

/* ========== Tables ========== */
.table-outer { position: relative; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-1); }
.data-table, .smart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
}
.data-table thead th, .smart-table thead th {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 12px 14px;
  background: var(--surface-2);
  color: var(--ink-2);
  text-align: left;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
}
.data-table tbody td, .smart-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-1);
}
.data-table tbody tr:hover, .smart-table tbody tr:hover { background: var(--surface-2); }

.col-filterable, .asist-filterable { cursor: pointer; user-select: none; }
.col-filterable:hover, .asist-filterable:hover { color: var(--brand); }
.th-caret { display: inline-block; margin-left: 4px; opacity: .6; font-size: 9px; }
.col-filterable.is-filtered .th-caret, .asist-filterable.is-filtered .th-caret { opacity: 1; color: var(--brand); }

.col-filter-pop {
  position: fixed;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--e3);
  z-index: 2000;
  padding: 8px;
  min-width: 180px;
  max-height: 420px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.col-filter-pop label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: var(--fs-sm);
  cursor: pointer;
  border-radius: 4px;
}
.col-filter-pop label:hover { background: var(--surface-2); }

.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}
.pagination button {
  height: 32px;
  min-width: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: var(--fs-sm);
}
.pagination button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ========== Sub-tabs ========== */
.sub-tabs { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-2); border-radius: 999px; margin-bottom: var(--s-3); }
.sub-tab {
  height: 30px;
  padding: 0 14px;
  border: none;
  background: transparent;
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-2);
}
.sub-tab.active { background: var(--surface-1); color: var(--brand); box-shadow: var(--e1); }

/* ========== Modals ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: overlayIn .15s var(--ease);
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 30px 80px -20px rgba(15,23,42,.4), 0 10px 30px -10px rgba(15,23,42,.2);
  max-width: 560px;
  width: 100%;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn .2s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-lg { max-width: 780px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: var(--fs-lg); }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-footer {
  padding: 14px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.modal-footer-stack { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; }
.modal-footer-stack .dir-mark-controls { flex: 1 1 auto; }
.modal-footer-stack .dir-mark-actions { margin-left: auto; }
.modal-section { margin-bottom: var(--s-4); }
.modal-section-title { font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 8px; }

/* ========== Toasts ========== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3000;
}
.toast-container > div {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--r-md);
  padding: 12px 16px;
  box-shadow: var(--e3);
  font-size: var(--fs-base);
  max-width: 360px;
  animation: toastIn .2s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ========== Config ========== */
.cfg-layout { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s-4); }
.cfg-card { padding: 0; overflow: hidden; }
.cfg-card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cfg-card-title { font-size: 13px; font-weight: 700; }
.cfg-badge { margin-left: auto; font-size: 10px; padding: 2px 8px; background: var(--brand-soft); color: var(--brand-2); border-radius: 999px; font-weight: 700; }
.cfg-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.cfg-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-2); display: inline-flex; align-items: center; justify-content: center; }
.cfg-field { display: flex; flex-direction: column; gap: 6px; }
.cfg-label { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.cfg-hint, .cfg-hint-top { font-size: 11px; color: var(--ink-3); }
.cfg-field-text input { width: 100%; }
.cfg-field-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cfg-control { display: flex; gap: 8px; align-items: center; }
.cfg-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); }
.cfg-meta-label { color: var(--ink-3); }
.cfg-meta-value { color: var(--ink-1); font-weight: 600; }
.cfg-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.cfg-export-body { display: flex; flex-direction: column; gap: 10px; }

/* ========== Attendance history / guest ========== */
.attendance-history { display: flex; flex-direction: column; gap: 8px; }
.guest-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ========== Dup alert ========== */
.dup-alert {
  background: var(--warning-soft);
  border: 1px solid var(--warning);
  color: #92400e;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 12px;
  margin-top: 8px;
}

/* ========== Inline edit ========== */
.inline-edit { display: inline-flex; align-items: center; gap: 6px; }
.inline-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-3);
  padding: 2px;
}
.inline-edit-btn:hover { color: var(--brand); }
.inline-value { cursor: pointer; border-bottom: 1px dashed var(--border-strong); }
.inline-value:hover { color: var(--brand); border-color: var(--brand); }
.inline-input {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--brand);
  border-radius: var(--r-sm);
  font-size: 13px;
  background: var(--surface-1);
}
.inline-confirm { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--warning-soft); border: 1px solid var(--warning); border-radius: var(--r-sm); }
.inline-confirm-msg { font-size: 12px; color: #92400e; }
.inline-confirm-actions { display: flex; gap: 6px; }

/* ========== Lugares ========== */
.lugares-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lugares-add { display: flex; gap: 6px; margin-top: 8px; }
.lugar-sugerencias {
  position: absolute;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--e3);
  z-index: 1500;
  max-height: 200px;
  overflow: auto;
}
.lugar-sugerencias div { padding: 8px 12px; cursor: pointer; font-size: 13px; }
.lugar-sugerencias div:hover { background: var(--surface-2); }

/* ========== Directoras ========== */
.dir-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.dir-mark-row { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-1); min-height: 44px; }
.dir-mark-row > label:first-child { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.dir-mark-row select { height: 32px; border: 1px solid var(--border); border-radius: 6px; padding: 0 10px; background: var(--surface-1); font-size: 13px; }
.dir-mark-controls { display: flex; gap: 8px; flex: 1; }
.dir-mark-controls > .dir-mark-row:first-child { flex: 1; }
.dir-mark-actions { display: flex; gap: 8px; margin-left: auto; align-items: stretch; }
.dir-mark-actions .btn { height: 44px; padding: 0 18px; }
.dir-count-row { display: flex; gap: 12px; font-size: 12px; color: var(--ink-3); }

/* ========== File drop (import) ========== */
.file-drop {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.file-drop:hover, .file-drop.dragover { border-color: var(--brand); background: var(--brand-soft); }
.file-drop-icon { font-size: 28px; margin-bottom: 8px; }
.file-drop-text { font-size: 14px; font-weight: 600; }
.file-drop-sub { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.import-hint { font-size: 11px; color: var(--ink-3); margin-top: 6px; }

/* ========== Readonly banner (visor) ========== */
.readonly-banner {
  background: var(--info-soft);
  border: 1px solid var(--info);
  color: var(--info);
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
body.is-visor .btn-danger,
body.is-visor .btn-primary[data-requires-write],
body.is-visor .inline-edit-btn { display: none !important; }

/* ========== Usuario (rol=user): oculta gestión admin ========== */
body.is-user .admin-tab[data-tab="usuarios"],
body.is-user .admin-tab[data-tab="dominios"],
body.is-visor .admin-tab[data-tab="dominios"],
body.is-visor .admin-tab[data-tab="usuarios"],
body.is-visor #btnAddCampana,
body.is-visor #btnAddUsuario,
body.is-visor #btnAddDominio,
body.is-visor .cc-actions,
body.is-visor .camp-card-menu,
body.is-visor .uc-actions,
body.is-visor .cfg-danger-zone,
body.is-visor .dir-mark-controls,
body.is-visor #btnDirMark,
body.is-visor #btnDirUpdate,
body.is-visor #btnDirUnmark,
body.is-visor #dirInlineConfirm,
body.is-visor .cfg-card-datos,
body.is-visor .cfg-card-lugares,
body.is-visor .cfg-card-reimport,
body.is-visor #btnAddDirectora,
body.is-user #btnAddDirectora,
body.is-visor #btnOpenCfg,
body.is-user #btnAddCampana,
body.is-user #btnAddUsuario,
body.is-user #btnOpenCfg,
body.is-user .cc-actions,
body.is-user .cc-confirm,
body.is-user .inline-edit-btn,
body.is-user [data-requires-admin],
body.is-user .cfg-open-btn,
body.is-user .camp-card-menu,
body.is-user .ccf-actions,
body.is-user .cr-actions [data-act="del"],
body.is-user .cr-actions [data-act="activate"],
body.is-visor .cr-actions [data-act="del"],
body.is-visor .cr-actions [data-act="activate"] { display: none !important; }
/* Usuario puede quitar su propia asistencia, así que permitimos btn-danger dentro del modal de directora */
body.is-user #modalDirectora .btn-danger,
body.is-user .inline-confirm .btn-danger { display: inline-flex !important; }
/* Lugar badge in header for user */
body.is-user .lugar-badge-hdr { display: inline-flex; }
.dir-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 18px;
  font-size: var(--fs-base);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
body.is-user .dir-add-btn { display: none !important; }

.uc-icon-placeholder { visibility: hidden; pointer-events: none; }
.conex-log-wrap { max-height: 60vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
.conex-log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.conex-log-table thead th { position: sticky; top: 0; background: var(--surface-2); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--ink-2); z-index: 1; }
.conex-log-table tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--ink-1); }
.conex-log-table tbody tr:last-child td { border-bottom: none; }
.conex-log-table td.mono { font-family: ui-monospace, monospace; font-size: 12px; color: var(--ink-2); }

.uc-conex { font-size: 11px; line-height: 1.35; min-width: 0; }
.uc-conex-date { color: var(--ink-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-conex-ip { color: var(--ink-3); font-family: ui-monospace, monospace; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.uc-inline-confirm {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 12px;
  color: #7f1d1d;
  font-weight: 600;
}
.uc-inline-confirm > span { flex: 1; min-width: 140px; }
.uc-inline-confirm .btn-xs { padding: 5px 10px; font-size: 11px; line-height: 1; }
.user-card.is-confirming { border-color: #fecaca; }
.user-card.is-deleting { opacity: .5; pointer-events: none; }

.export-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  align-self: stretch;
  height: auto;
  min-height: 0;
  padding: 0 18px;
  text-decoration: none;
  line-height: 1;
  box-sizing: border-box;
}
.lugar-badge-hdr { display: none; align-items: center; gap: 6px; padding: 6px 12px; background: var(--brand-soft); color: var(--brand); border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; margin-right: 10px; border: 1px solid transparent; }
.lugar-badge-hdr:hover { border-color: var(--brand); }

/* ========== Misc ========== */
.separator { height: 1px; background: var(--border); margin: 12px 0; }
.loading-msg { text-align: center; padding: 20px; color: var(--ink-3); font-size: 13px; }
.chip { user-select: none; }

/* ================================================================
   ▓▓▓ v3 — SLIM HEADER / USER MENU / MODAL USUARIO / REFRESH ▓▓▓
   ================================================================ */

/* User menu dropdown */
.user-menu { position: relative; }
.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--h-control);
  padding: 0 10px 0 4px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--ink-1);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--dur) var(--ease);
}
.user-menu-trigger:hover { border-color: var(--brand); color: var(--brand); }
.user-menu-avatar {
  position: relative;
  width: 26px; height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  flex: none;
}
.umh-rol-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 2px solid var(--surface-1);
}
.umh-rol-dot.admin { background: var(--success); }
.umh-rol-dot.visor { background: var(--info); }
.umh-rol-inline {
  display: inline-block;
  margin-left: 6px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-2);
  vertical-align: middle;
}
.user-menu-name {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--e3);
  z-index: 1500;
  overflow: hidden;
  animation: fadeIn .15s var(--ease);
}
.user-menu-head { padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.umh-name { font-size: 13px; font-weight: 700; color: var(--ink-1); }
.umh-email { font-size: 11px; color: var(--ink-3); margin-top: 2px; word-break: break-all; }
.umh-rol { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); margin-top: 6px; }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--ink-1);
  text-decoration: none;
  font-size: var(--fs-base);
  font-weight: 500;
  transition: background var(--dur-fast) var(--ease);
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.user-menu-item:hover { background: var(--surface-2); color: var(--brand); text-decoration: none; }
.user-menu-item svg { color: var(--ink-3); }
.user-menu-item:hover svg { color: var(--brand); }

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

.header-admin .user-info { display: none; }

/* ================================================================
   Modal Usuario — modernized
   ================================================================ */
.mu-modal { max-width: 640px; }
.mu-modal.modal-content { overflow: hidden; }
.mu-modal .mu-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }

.mu-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--brand-soft), transparent);
}
.mu-header-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-shadow: 0 6px 16px -6px rgba(249,115,22,.6);
}
.mu-header-text { flex: 1; min-width: 0; }
.mu-header-text h3 { font-size: 16px; margin-bottom: 2px; }
.mu-header-sub { font-size: 12px; color: var(--ink-3); }

.mu-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; }

.mu-section { display: flex; flex-direction: column; gap: 10px; }
.mu-section-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
  margin: 0;
}
.mu-section-hint { font-size: 12px; color: var(--ink-3); margin: -4px 0 4px; }

.mu-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .mu-grid-2 { grid-template-columns: 1fr; } }

.mu-field { display: flex; flex-direction: column; gap: 6px; }
.mu-field label { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.mu-input-wrap { position: relative; }
.mu-input-ic {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.mu-input-wrap input {
  width: 100%;
  height: 42px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-1);
  color: var(--ink-1);
  font-size: 14px;
  transition: all var(--dur) var(--ease);
}
.mu-input-wrap input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.mu-input-wrap:focus-within .mu-input-ic { color: var(--brand); }

.mu-role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .mu-role-grid { grid-template-columns: 1fr; } }
.mu-role-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-1);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  position: relative;
}
.mu-role-card:hover { border-color: var(--border-strong); }
.mu-role-card input { position: absolute; opacity: 0; pointer-events: none; }
.mu-role-card.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 4px 12px -6px rgba(249,115,22,.4);
}
.mu-role-card.is-active::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 10px;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mu-role-ic {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mu-role-card.is-active .mu-role-ic { background: var(--brand); color: #fff; }
.mu-role-name { font-size: 13px; font-weight: 700; color: var(--ink-1); }
.mu-role-desc { font-size: 11px; color: var(--ink-3); line-height: 1.35; }

.mu-active-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  cursor: pointer;
  margin-top: 4px;
}
.mu-active-toggle input { display: none; }
.mu-active-slider {
  width: 36px; height: 20px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  transition: background var(--dur) var(--ease);
  flex: none;
}
.mu-active-slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; top: 3px;
  border-radius: 999px;
  background: #fff;
  transition: transform var(--dur) var(--ease);
}
.mu-active-toggle input:checked + .mu-active-slider { background: var(--success); }
.mu-active-toggle input:checked + .mu-active-slider::before { transform: translateX(16px); }
.mu-active-label { display: flex; flex-direction: column; }
.mu-active-label strong { font-size: 13px; color: var(--ink-1); }
.mu-active-label small { font-size: 11px; color: var(--ink-3); }

.mu-camp-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.mu-camp-list .uc-row {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mu-camp-list .uc-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mu-camp-list .uc-row-head .uc-check { flex: 1; min-width: 0; }
.mu-camp-list .uc-lugares-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.mu-camp-list .uc-lugares-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.mu-camp-list .uc-lugares-btn:disabled { opacity: .5; cursor: not-allowed; }
.mu-camp-list .uc-lugares-btn .uc-chev { transition: transform .2s ease; }
.mu-camp-list .uc-lugares-btn.is-open { background: var(--brand); color: #fff; border-color: var(--brand); }
.mu-camp-list .uc-lugares-btn.is-open .uc-chev { transform: rotate(180deg); }
.mu-camp-list .uc-lug-none {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  font-style: italic;
}
.mu-camp-list .uc-lugares-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: cfp-in .15s ease-out;
}
.mu-camp-list .uc-lug-all {
  padding-bottom: 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.mu-camp-list .uc-lug-scroll {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mu-camp-list .uc-lug-scroll::-webkit-scrollbar { width: 8px; }
.mu-camp-list .uc-lug-scroll::-webkit-scrollbar-track { background: transparent; }
.mu-camp-list .uc-lug-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.mu-camp-list .uc-lug-scroll::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
.mu-camp-list .uc-lug-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: var(--fs-xs);
  color: var(--ink-1);
  cursor: pointer;
  transition: background .12s ease;
}
.mu-camp-list .uc-lug-item:hover { background: var(--surface-1); }
.mu-camp-list .uc-lug-item input[type="checkbox"] { flex-shrink: 0; accent-color: var(--brand); }
.mu-camp-list .uc-lug-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mu-footer {
  padding: 14px 24px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.mu-footer .btn { min-width: 120px; }

/* ================================================================
   Login page
   ================================================================ */
.login-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(249,115,22,.18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(234,88,12,.14), transparent 60%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  padding: 24px;
  color: var(--ink-1);
}
[data-theme="dark"] .login-body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(251,146,60,.25), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(249,115,22,.18), transparent 60%),
    linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
  color: #e2e8f0;
}
.login-wrap {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-card {
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: 0 20px 60px -20px rgba(15,23,42,.25), 0 4px 12px -6px rgba(15,23,42,.08);
}
[data-theme="dark"] .login-card {
  background: rgba(17,24,39,.75);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,.6);
}
.login-header { text-align: center; margin-bottom: 24px; }
.login-header h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.login-header .subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
}

.login-step { display: flex; flex-direction: column; gap: 10px; }
.login-step label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
  margin-top: 4px;
}
.login-step input[type="email"],
.login-step input[type="text"] {
  height: 44px;
  padding: 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  color: var(--ink-1);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  width: 100%;
  box-sizing: border-box;
}
[data-theme="dark"] .login-step input[type="email"],
[data-theme="dark"] .login-step input[type="text"] {
  background: rgba(15,23,42,.6);
  border-color: rgba(255,255,255,.12);
  color: #f1f5f9;
}
.login-step input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(249,115,22,.18);
}
.otp-input {
  text-align: center;
  letter-spacing: .5em;
  font-size: 22px !important;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0 !important;
}
.otp-hint {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}
.otp-hint strong { color: var(--ink-1); }

.btn-block {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.btn-block.btn-primary {
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px -4px rgba(249,115,22,.5);
}
.btn-block.btn-primary:hover { box-shadow: 0 8px 20px -6px rgba(249,115,22,.6); }
.btn-block.btn-primary:active { transform: translateY(1px); }
.btn-block:disabled { opacity: .55; cursor: not-allowed; }

.login-msg {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  border: 1px solid transparent;
}
.login-msg.error { background: var(--danger-soft); color: #991b1b; border-color: #fecaca; }
.login-msg.success { background: var(--success-soft); color: #166534; border-color: #bbf7d0; }
.login-msg.info { background: var(--info-soft); color: #1e40af; border-color: #bfdbfe; }
[data-theme="dark"] .login-msg.error { background: rgba(153,27,27,.2); color: #fca5a5; border-color: rgba(252,165,165,.2); }
[data-theme="dark"] .login-msg.success { background: rgba(22,101,52,.2); color: #86efac; border-color: rgba(134,239,172,.2); }
[data-theme="dark"] .login-msg.info { background: rgba(30,64,175,.25); color: #93c5fd; border-color: rgba(147,197,253,.2); }

.login-wrap .theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.8);
  cursor: pointer;
  font-size: 16px;
  align-self: flex-end;
}
[data-theme="dark"] .login-wrap .theme-toggle {
  background: rgba(17,24,39,.75);
  border-color: rgba(255,255,255,.08);
  color: #f1f5f9;
}

@media (max-width: 420px) {
  .login-card { padding: 24px 20px; border-radius: 14px; }
  .login-header h1 { font-size: 20px; }
}

@media (max-width: 760px) {
  .user-menu-name { display: none; }
  .user-menu-trigger { padding: 0 6px 0 4px; }
  .main-content, .admin-main, .content-area { padding: var(--s-3); }
  .header { padding: 8px var(--s-3); }
}

/* ========== Patch: table rows clickable affordance ========== */
.data-table tbody tr, .smart-table tbody tr { transition: background .12s ease, box-shadow .12s ease; }
.data-table tbody tr.row-clickable, .smart-table tbody tr.row-clickable { cursor: pointer; }
.data-table tbody tr.row-clickable:hover,
.smart-table tbody tr.row-clickable:hover {
  background: var(--surface-2);
  box-shadow: inset 3px 0 0 var(--brand);
}
.data-table tbody tr:hover td:first-child { color: var(--brand); }

/* ========== Patch: pagination redesigned ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  box-shadow: var(--e1);
}
.pagination button {
  height: 34px;
  min-width: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all .15s ease;
}
.pagination button:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--brand);
  transform: translateY(-1px);
}
.pagination button:active:not(:disabled) { transform: translateY(0) scale(.97); }
.pagination button:disabled { opacity: .35; cursor: not-allowed; }
.pagination #dirPageInfo {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  height: 34px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  min-width: 110px;
  justify-content: center;
}

/* ========== Patch: col-filter-pop as viewport-fixed body child ========== */
.col-filter-pop {
  position: fixed !important;
  min-width: 240px;
  max-width: 320px;
  padding: 10px;
  border-radius: var(--r-md);
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.25), 0 4px 12px -4px rgba(0,0,0,.1);
  animation: cfp-in .14s ease-out;
}
@keyframes cfp-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.col-filter-pop .cfp-head,
.col-filter-pop .cf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.col-filter-pop .cfp-clear,
.col-filter-pop .cf-clear {
  background: none;
  border: none;
  color: var(--brand);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.col-filter-pop .cfp-clear:hover,
.col-filter-pop .cf-clear:hover { background: var(--surface-2); }
.col-filter-pop .cfp-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  margin-bottom: 6px;
  background: var(--surface-1);
  color: var(--ink-1);
}
.col-filter-pop .cfp-list,
.col-filter-pop .cf-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; max-height: 280px; }
.col-filter-pop .cfp-count {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 999px;
}
.col-filter-pop .cfp-foot {
  padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
  text-align: right;
}

/* ========== Patch: Asistencias actions column ========== */
#tblAsistencias .td-actions {
  text-align: right;
  white-space: nowrap;
  width: 1%;
  padding: 6px 10px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--ink-2);
  transition: all .15s ease;
  padding: 0;
}
.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--e2);
}
.icon-btn:active { transform: translateY(0) scale(.95); }
.icon-btn-danger:hover {
  background: var(--danger, #ef4444);
  border-color: var(--danger, #ef4444);
  color: #fff;
}
.icon-btn-cancel { display: none; }
.icon-btn-confirm { display: none; }
tr.confirming .icon-btn-danger { display: none; }
tr.confirming .row-confirm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  animation: cfp-in .14s ease-out;
}
tr.confirming .icon-btn-cancel,
tr.confirming .icon-btn-confirm { display: inline-flex; }
tr.confirming .icon-btn-confirm {
  background: var(--success, #10b981);
  border-color: var(--success, #10b981);
  color: #fff;
}
.row-confirm { display: none; }
.row-confirm-msg { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; }
tr.deleting { opacity: .5; pointer-events: none; }

/* ========== Patch: duplicadas toast (clean, no warn accent) ========== */
.dups-toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.25);
  padding: 16px 18px;
  max-width: 440px;
  color: var(--ink-1);
}
.dups-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.dups-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink-1);
}
.dups-close {
  background: transparent;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: inline-flex;
  transition: all .15s ease;
}
.dups-close:hover { background: var(--surface-2); color: var(--ink-1); }
.dups-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dups-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.dups-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-1);
}
.dups-places {
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.dups-more {
  margin-top: 8px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  text-align: center;
}

/* ========== Patch: camp-toolbar (stats chips + cfg button) ========== */
.camp-toolbar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: var(--s-3);
}
.stats-chips {
  display: flex;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}
.stat-chip {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  transition: all .15s ease;
  position: relative;
  overflow: hidden;
}
.stat-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--e2);
  border-color: var(--brand);
}
.stat-chip:active { transform: translateY(0) scale(.98); }
.stat-chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(249,115,22,.4);
}
.stat-chip.is-active .sc-lbl,
.stat-chip.is-active .sc-val,
.stat-chip.is-active .sc-pct { color: #fff; }
.sc-val {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--ink-1);
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.sc-pct {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-3);
}
.sc-lbl {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sc-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--surface-2);
}
.sc-bar-fill {
  height: 100%;
  background: #10b981;
  transition: width .3s ease;
}
.stat-chip.is-active .sc-bar { background: rgba(255,255,255,.25); }
.stat-chip.is-active .sc-bar-fill { background: #fff; }

.stat-chip-success:hover { border-color: #10b981; }
.stat-chip-info:hover { border-color: #3b82f6; }
.stat-chip-warn:hover { border-color: #f59e0b; }

.cfg-open-btn {
  flex-shrink: 0;
  align-self: stretch;
  height: auto;
  min-height: 100%;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .camp-toolbar { flex-direction: column; }
  .stat-chip { min-width: 0; }
}

/* ========== Patch: Configuración modal ========== */
.cfg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow: hidden;
  animation: cfp-in .2s ease-out;
}
.cfg-modal {
  background: var(--surface-1);
  border-radius: var(--r-lg, 12px);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.4);
  width: 100%;
  max-width: 1100px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cfp-in .22s ease-out;
}
.cfg-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}
.cfg-modal-head h2 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--ink-1);
}
.cfg-modal-close {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-2);
  transition: all .15s ease;
}
.cfg-modal-close:hover { background: var(--surface-2); color: var(--ink-1); }
.cfg-modal #subtab-config {
  padding: 24px;
  overflow-y: auto;
  display: block !important;
}

/* ========== Patch: Directora modal redesign ========== */
#modalDirectora .modal-content { max-width: 760px; }
#modalDirectora .modal-body {
  padding: 0;
  background: var(--surface-2);
}
#modalDirectora .modal-header { display: block; border-bottom: none; padding: 0; margin: 0; position: absolute; top: 14px; right: 14px; left: auto; bottom: auto; z-index: 100; background: transparent; pointer-events: none; width: auto; height: auto; }
#modalDirectora .modal-header h3 { display: none; }
#modalDirectora .modal-header .btn-close { pointer-events: auto; position: relative; z-index: 101; }
#modalDirectora .modal-header h3 { display: none; }
#modalDirectora .btn-close { background: rgba(0,0,0,.35); color: #fff; border-radius: 8px; width: 34px; height: 34px; font-size: 24px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; padding: 0 0 2px 0; border: none; backdrop-filter: blur(4px); }
#modalDirectora .btn-close:hover { background: rgba(0,0,0,.55); color: #fff; }

.dm-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px 20px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  margin: 0;
}
.dm-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(255,255,255,.22);
  backdrop-filter: blur(8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  flex-shrink: 0;
  text-transform: uppercase;
}
.dm-hero-text { flex: 1; min-width: 0; }
.dm-name {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.dm-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  opacity: .92;
  margin-bottom: 10px;
}
.dm-code { font-weight: 700; letter-spacing: .02em; }
.dm-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.dm-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dm-status, .dm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: rgba(255,255,255,.22);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
}
.dm-status-ok { background: rgba(16,185,129,.9); border-color: transparent; }
.dm-status-pending { background: rgba(255,255,255,.18); }

.dm-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 18px 24px;
  background: var(--surface-2);
}
.dm-tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  text-align: center;
  transition: all .2s ease;
}
.dm-tile.is-on {
  border-color: var(--brand);
  box-shadow: 0 4px 12px -4px rgba(249,115,22,.25);
}
.dm-tile-ic { font-size: 20px; margin-bottom: 4px; }
.dm-tile-lbl {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 2px;
}
.dm-tile-val {
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--ink-1);
}
.dm-tile.is-on .dm-tile-val { color: var(--brand); }

.dm-details {
  margin: 0 24px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.dm-details-head {
  padding: 12px 16px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.dm-details-head::-webkit-details-marker { display: none; }
.dm-details-head::after {
  content: '▾';
  font-size: 12px;
  color: var(--ink-3);
  transition: transform .2s ease;
}
.dm-details[open] .dm-details-head::after { transform: rotate(180deg); }
.dm-details-head:hover { background: var(--surface-2); }
.dm-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
}
.dm-kv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
}
.dm-kv:nth-last-child(-n+2) { border-bottom: none; }
.dm-kv:nth-child(odd) { border-right: 1px solid var(--border); }
.dm-k { color: var(--ink-3); font-weight: 600; }
.dm-v { color: var(--ink-1); font-weight: 600; text-align: right; }

.dm-history {
  padding: 0 24px 20px;
}
.dm-history-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.dm-history-head h4 {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink-1);
}
.dm-history-count {
  background: var(--brand);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 999px;
  min-width: 24px;
  text-align: center;
}
.dm-history-empty {
  padding: 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: var(--fs-sm);
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
}
.dm-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.dm-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}
.dm-tl-item {
  position: relative;
  padding: 8px 12px 8px 32px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 6px;
}
.dm-tl-item:last-child { margin-bottom: 0; }
.dm-tl-item.is-dup { border-color: #f59e0b; }
.dm-tl-dot {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--surface-2), 0 0 0 4px var(--border);
}
.dm-tl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.dm-tl-row .dm-tl-place { flex-shrink: 0; font-weight: 600; }
.dm-tl-row .dm-tl-meta { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-tl-item.is-dup .dm-tl-dot { background: #f59e0b; }
.dm-tl-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.dm-tl-place { font-size: var(--fs-sm); color: var(--ink-1); }
.dm-tl-meta { font-size: var(--fs-xs); color: var(--ink-3); }
.dm-inv-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
}
.dm-dup-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
}

[data-theme="dark"] .dm-inv-pill { background: rgba(59,130,246,.2); color: #93c5fd; }
[data-theme="dark"] .dm-dup-pill { background: rgba(245,158,11,.2); color: #fcd34d; }

/* ========== Patch: Dashboard view switcher ========== */
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: var(--s-3); }
.view-switcher {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.vs-btn {
  width: 34px;
  height: 30px;
  border: none;
  background: transparent;
  border-radius: calc(var(--r-md) - 3px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  transition: all .15s ease;
}
.vs-btn:hover { color: var(--ink-1); }
.vs-btn.active {
  background: var(--surface-1);
  color: var(--brand);
  box-shadow: var(--e1);
}

/* ========== Patch: Dashboard rows view ========== */
.campana-rows { display: block !important; }
.cr-table-wrap {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--e1);
}
.cr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.cr-table thead th {
  background: var(--surface-2);
  padding: 12px 14px;
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--border);
}
.cr-row {
  cursor: pointer;
  transition: background .12s ease;
  border-bottom: 1px solid var(--border);
}
.cr-row:last-child { border-bottom: none; }
.cr-row:hover { background: var(--surface-2); }
.cr-row.is-closed { opacity: .65; }
.cr-row td { padding: 12px 14px; vertical-align: middle; }
.cr-code { font-weight: 700; color: var(--brand); font-family: ui-monospace, monospace; font-size: var(--fs-xs); }
.cr-name { font-weight: 600; color: var(--ink-1); }
.cr-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); }
.cr-progress {
  position: relative;
  height: 22px;
  background: var(--surface-2);
  border-radius: 999px;
  min-width: 120px;
  overflow: hidden;
}
.cr-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 999px;
  transition: width .3s ease;
}
.cr-progress-lbl {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink-1);
  text-shadow: 0 1px 2px rgba(255,255,255,.6);
}
[data-theme="dark"] .cr-progress-lbl { text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.cr-actions {
  text-align: right;
  white-space: nowrap;
}
.cr-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.cr-actions > * + * { margin-left: 0; }
.cr-actions .icon-btn { width: 28px; height: 28px; }
.cr-actions .btn-sm { height: 28px; }
.cr-confirm-row td {
  padding: 0 !important;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.cc-confirm-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(239,68,68,.08);
  border-left: 3px solid #ef4444;
  animation: cfp-in .14s ease-out;
}

/* ========== Patch: Configuración modal redesign ========== */
.cfg-modal #subtab-config { padding: 0 !important; background: var(--surface-2); }
.cfg-modal .cfg-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px 24px 24px;
}
.cfg-modal .cfg-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--e1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cfg-modal .cfg-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.cfg-modal .cfg-card-head .cfg-ic {
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 8px;
  background: rgba(249,115,22,.12);
  color: var(--brand);
  flex-shrink: 0;
}
.cfg-modal .cfg-card-title {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink-1);
  flex: 1;
}
.cfg-modal .cfg-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16,185,129,.15);
  color: #059669;
  text-transform: uppercase;
  letter-spacing: .04em;
}
[data-theme="dark"] .cfg-modal .cfg-badge { background: rgba(16,185,129,.2); color: #6ee7b7; }
.cfg-modal .cfg-card-body { padding: 16px; }
.cfg-modal .cfg-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.cfg-modal .cfg-field:last-child { border-bottom: none; padding-bottom: 0; }
.cfg-modal .cfg-field:first-child { padding-top: 0; }
.cfg-modal .cfg-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cfg-modal .cfg-control { flex: 1; display: flex; align-items: center; gap: 8px; }
.cfg-modal .inline-value {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-1);
}
.cfg-modal .inline-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  background: var(--surface-1);
  color: var(--ink-1);
}
.cfg-modal .inline-edit-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
}
.cfg-modal .inline-edit-btn:hover { color: var(--brand); border-color: var(--brand); }
.cfg-modal .cfg-field-toggle {
  align-items: flex-start;
}
.cfg-modal .cfg-field-text { flex: 1; }
.cfg-modal .cfg-hint {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  margin: 4px 0 0;
  line-height: 1.5;
}
.cfg-modal .cfg-hint-top { margin: 0 0 12px; }

/* Lugares as pills */
.cfg-modal .lugares-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 40px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
}
.cfg-modal .lugares-chips:empty::before {
  content: 'Sin lugares configurados';
  font-size: var(--fs-xs);
  color: var(--ink-3);
  font-style: italic;
  align-self: center;
}
.cfg-modal .lugar-chip, .lugar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 12px;
  background: linear-gradient(135deg, rgba(249,115,22,.12), rgba(249,115,22,.06));
  border: 1px solid rgba(249,115,22,.3);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--brand);
  transition: all .15s ease;
  cursor: pointer;
}
.lugar-chip:hover {
  background: linear-gradient(135deg, rgba(249,115,22,.2), rgba(249,115,22,.1));
  transform: translateY(-1px);
  box-shadow: 0 3px 8px -3px rgba(249,115,22,.4);
}
.lugar-chip::before {
  content: '📍';
  font-size: 11px;
}
.lugar-chip .lugar-del {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(239,68,68,.15);
  color: #dc2626;
  border: none;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  transition: all .15s ease;
}
.lugar-chip .lugar-del:hover { background: #dc2626; color: #fff; }
.cfg-modal .lugares-add {
  display: flex;
  gap: 6px;
}
.cfg-modal .lugares-add input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  background: var(--surface-1);
  color: var(--ink-1);
}
.cfg-modal .lugares-add input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}
.cfg-modal .cfg-export-body {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cfg-modal .cfg-export-body .btn { flex: 1; min-width: 140px; }
.cfg-modal .switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.cfg-modal .switch input { opacity: 0; width: 0; height: 0; }
.cfg-modal .switch .slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--border); border-radius: 24px; transition: .2s;
}
.cfg-modal .switch .slider::before {
  content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.cfg-modal .switch input:checked + .slider { background: var(--brand); }
.cfg-modal .switch input:checked + .slider::before { transform: translateX(18px); }

@media (max-width: 800px) {
  .cfg-modal .cfg-layout { grid-template-columns: 1fr; padding: 16px; }
}

/* ========== Patch: codigo split (año + corto) ========== */
.codigo-split {
  display: flex;
  align-items: center;
  gap: 6px;
}
.codigo-anio {
  width: 90px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  background: var(--surface-1);
  color: var(--ink-1);
}
.codigo-corto {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  background: var(--surface-1);
  color: var(--ink-1);
  text-transform: uppercase;
}
.codigo-sep { color: var(--ink-3); font-weight: 700; }

/* ========== Patch: dashboard filters + year select ========== */
.dash-filters { display: inline-flex; gap: 8px; align-items: center; }
.dash-year-select {
  padding: 7px 32px 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-1) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 10px center;
  color: var(--ink-1);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  appearance: none;
}
.dash-year-select:hover { border-color: var(--brand); }

/* ========== Patch: campana card year+corto split ========== */
.cc-year {
  background: var(--surface-2);
  color: var(--ink-3);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  margin-right: 6px;
}
.cc-corto {
  color: var(--brand);
  font-weight: 800;
  font-size: var(--fs-sm);
  font-family: ui-monospace, monospace;
}
.cr-year {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink-3);
}

/* ========== Patch: directoras page-size select ========== */
.page-size-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  font-weight: 600;
}
.page-size-select label { text-transform: uppercase; letter-spacing: .04em; }
.page-size-select select {
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-1) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 8px center;
  color: var(--ink-1);
  font-size: var(--fs-sm);
  font-weight: 600;
  appearance: none;
  cursor: pointer;
}
.page-size-select select:hover { border-color: var(--brand); }

/* ========== Patch: campañas accordion (lugares breakdown) ========== */
.cr-expand-col { width: 36px; }
.cr-expand-cell { width: 36px; padding: 0 0 0 8px !important; }
.cr-expand-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  border-radius: 6px;
  color: var(--ink-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .18s ease;
}
.cr-expand-btn:hover { color: var(--brand); border-color: var(--brand); }
.cr-expand-btn svg { transition: transform .2s ease; }
.cr-expand-btn.is-open { background: var(--brand); border-color: var(--brand); color: #fff; }
.cr-expand-btn.is-open svg { transform: rotate(180deg); }
.cr-expand-row td {
  padding: 0 !important;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.cr-expand-cell-body {
  animation: cfp-in .2s ease-out;
}

.cc-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-top: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  width: 100%;
  justify-content: center;
}
.cc-expand-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--surface-1); }
.cc-expand-btn svg { transition: transform .2s ease; }
.cc-expand-btn.is-open { background: var(--brand); color: #fff; border-color: var(--brand); }
.cc-expand-btn.is-open svg { transform: rotate(180deg); }
.campana-card .cc-expand-btn { margin-bottom: 12px; }
.campana-card .ccf-actions > .btn,
.campana-card .ccf-actions > .cc-del-btn {
  height: 32px;
  min-height: 32px;
  padding-top: 0;
  padding-bottom: 0;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  line-height: 1;
}
.cc-lug-panel {
  margin-top: 8px;
  animation: cfp-in .2s ease-out;
}

.lug-panel { padding: 16px 20px; }
.lug-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-3);
}
.lug-panel-head svg { color: var(--brand); }
.lug-count {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}
.lug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.lug-item {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  transition: all .15s ease;
}
.lug-item:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: var(--e2);
}
.lug-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.lug-name {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lug-pct {
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--brand);
  flex-shrink: 0;
}
.lug-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.lug-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 999px;
  transition: width .3s ease;
}
.lug-stats {
  display: flex;
  gap: 10px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  flex-wrap: wrap;
}
.lug-stats strong { color: var(--ink-1); font-weight: 700; }
.lug-inv {
  margin-left: auto;
  padding: 1px 8px;
  background: rgba(59,130,246,.12);
  color: #2563eb;
  border-radius: 999px;
  font-weight: 700;
}
[data-theme="dark"] .lug-inv { background: rgba(59,130,246,.2); color: #93c5fd; }
.lug-totals {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  font-weight: 600;
}
.lug-empty {
  padding: 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: var(--fs-sm);
  font-style: italic;
}

@media (max-width: 640px) {
  .dm-tiles { grid-template-columns: repeat(2, 1fr); }
  .dm-details-grid { grid-template-columns: 1fr; }
  .dm-kv:nth-child(odd) { border-right: none; }
  .dm-kv:nth-last-child(2) { border-bottom: 1px solid var(--border); }
}

/* ================================================================
   Iteration fixes — cfg compact, pills redesign, card spacing, lug-item click
   ================================================================ */

/* Card view: breathing room between lugares panel and footer buttons */
.campana-card .cc-lug-panel { margin-top: 10px; margin-bottom: 14px; }
.campana-card .cc-lug-panel:not(.hidden) + .campana-card-footer { border-top: 1px solid var(--border); padding-top: 12px; }

/* Lug-item clickable affordance */
.lug-item { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.lug-item:hover { transform: translateY(-1px); box-shadow: 0 4px 14px -6px rgba(249,115,22,.4); border-color: var(--brand); }
.lug-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* cfg-row-2: year + code inline */
.cfg-row-2 { display: grid; grid-template-columns: 90px 1fr; gap: 10px; }

/* Compact cfg modal — tighter padding on Datos / Exportar / Reimportar */
.cfg-modal .cfg-card { border-radius: var(--r-md); }
.cfg-modal .cfg-card-head { padding: 10px 14px; }
.cfg-modal .cfg-card-body { padding: 12px 14px !important; gap: 10px !important; }
.cfg-modal .cfg-field { padding: 6px 0; }
.cfg-modal .cfg-field-toggle { padding: 6px 0; }
.cfg-modal .cfg-export-body { gap: 6px; padding: 10px 14px !important; }
.cfg-modal .cfg-export-body .btn { flex: 0 0 auto; min-width: 0; }
.cfg-modal .cfg-export-body .cfg-hint { margin: 0; font-size: 11px; color: var(--ink-3); }
.cfg-modal .file-drop { padding: 14px 12px; gap: 4px; }
.cfg-modal .file-drop svg { width: 22px; height: 22px; }
.cfg-modal .file-drop-text { font-size: var(--fs-xs); }
.cfg-modal .file-drop-sub { font-size: 10px; }
.cfg-modal .cfg-meta { display: flex; justify-content: space-between; font-size: 11px; padding: 6px 10px; background: var(--surface-2); border-radius: var(--r-sm); }
.cfg-modal .cfg-meta-label { color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.cfg-modal .cfg-meta-value { color: var(--ink-1); font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Lugares pills — rediseño con contraste fuerte */
.cfg-modal .lugar-chip, .lugar-chip {
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--ink-1);
  padding: 7px 8px 7px 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.cfg-modal .lugar-chip::before, .lugar-chip::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(249,115,22,.18);
  margin-right: 2px;
}
.cfg-modal .lugar-chip:hover, .lugar-chip:hover {
  background: var(--surface-1);
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(249,115,22,.35);
}
[data-theme="dark"] .lugar-chip { background: var(--surface-2); border-color: var(--border); }

/* Lugar chip action buttons (edit + delete) */
.lugar-chip .lc-text { padding: 0 2px; font-weight: 600; color: var(--ink-1); }
.lugar-chip .lc-edit, .lugar-chip .lc-remove {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0;
  transition: all .15s ease;
}
.lugar-chip .lc-edit:hover {
  background: rgba(249,115,22,.12);
  border-color: rgba(249,115,22,.3);
  color: var(--brand);
}
.lugar-chip .lc-remove:hover {
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.3);
  color: #dc2626;
}
.lugar-chip.editing {
  padding: 4px 6px;
  background: var(--surface-1);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}
.lugar-chip .lc-input {
  border: none; outline: none; background: transparent;
  font-size: var(--fs-xs); font-weight: 600; color: var(--ink-1);
  min-width: 120px; padding: 2px 4px;
}
.lugar-chip .lc-save, .lugar-chip .lc-cancel {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-2); color: var(--ink-2);
  cursor: pointer; padding: 0;
  transition: all .15s ease;
}
.lugar-chip .lc-save { background: var(--brand); color: #fff; border-color: var(--brand); }
.lugar-chip .lc-save:hover { filter: brightness(1.08); }
.lugar-chip .lc-cancel:hover { background: rgba(239,68,68,.12); color: #dc2626; border-color: rgba(239,68,68,.3); }

/* Datos de la campaña — cleaner inline editing */
.cfg-modal .cfg-field {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px !important;
  transition: border-color .15s ease;
}
.cfg-modal .cfg-field:hover { border-color: var(--brand); }
.cfg-modal .cfg-field-toggle { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px !important; justify-content: space-between; }
.cfg-modal .cfg-label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; min-width: 54px; }
.cfg-modal .cfg-control { flex: 1; min-width: 0; }
.cfg-modal .cfg-control .inline-value { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-1); }
.cfg-modal .cfg-control .inline-input { width: 100%; border: 1px solid var(--brand); background: var(--surface-1); color: var(--ink-1); border-radius: 4px; padding: 4px 8px; font-size: var(--fs-sm); font-weight: 600; }
.cfg-modal .inline-edit-btn {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-1); color: var(--ink-3);
  cursor: pointer; padding: 0; flex-shrink: 0;
  transition: all .15s ease;
}
.cfg-modal .inline-edit-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ==== cfg-layout v2 — Datos full-width horizontal, Lugares big, Export+Reimport side-by-side ==== */
.cfg-modal .cfg-layout-v2 {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "datos"
    "lugares"
    "reimp";
  gap: 14px;
  padding: 18px 22px 22px;
}
.cfg-modal .cfg-card-datos   { grid-area: datos; }
.cfg-modal .cfg-card-lugares { grid-area: lugares; }
.cfg-modal .cfg-card-export  { grid-area: export; }
.cfg-modal .cfg-card-reimport{ grid-area: reimp; }

/* Datos: pills estilo lugares, todo en una sola fila */
.cfg-modal .cfg-card-datos .cfg-card-body {
  padding: 12px 14px !important;
}
.cfg-modal .datos-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.cfg-modal .datos-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color .15s ease, box-shadow .15s ease;
  min-height: 34px;
  box-sizing: border-box;
}
.cfg-modal .datos-pill:hover { border-color: var(--brand); }
.cfg-modal .datos-pill-nombre { flex: 1 1 auto; min-width: 0; }
.cfg-modal .datos-pill { flex-shrink: 0; }
.cfg-modal .datos-pill.datos-pill-nombre { flex-shrink: 1; }
.cfg-modal .datos-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-3);
  white-space: nowrap;
}
.cfg-modal .datos-val {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.cfg-modal .datos-pill-nombre .datos-val { max-width: none; flex: 1; }
.cfg-modal .datos-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-1);
  padding: 0;
  min-width: 80px;
}
.cfg-modal .datos-pill-nombre .datos-input { flex: 1; min-width: 180px; }
.cfg-modal .datos-edit {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0;
  transition: all .15s ease;
}
.cfg-modal .datos-edit:hover {
  background: rgba(249,115,22,.12);
  border-color: rgba(249,115,22,.3);
  color: var(--brand);
}
.cfg-modal .datos-pill-select { padding: 2px 6px 2px 12px; }
.cfg-modal .datos-select {
  border: none; background: transparent;
  font-size: var(--fs-sm); font-weight: 700; color: var(--ink-1);
  cursor: pointer; outline: none;
  padding: 4px 16px 4px 4px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
}
[data-theme="dark"] .cfg-modal .datos-select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
.cfg-modal .datos-pill-toggle { padding: 4px 10px 4px 12px; }
.cfg-modal .datos-pill-toggle .switch { width: 36px; height: 20px; }
.cfg-modal .datos-pill-toggle .switch .slider::before { height: 14px; width: 14px; }
.cfg-modal .datos-pill-toggle .switch input:checked + .slider::before { transform: translateX(16px); }

@media (max-width: 768px) {
  .cfg-modal .datos-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .cfg-modal .datos-pill {
    flex: 1 1 100% !important;
    border-radius: 12px;
    padding: 10px 14px;
    min-height: 44px;
    justify-content: space-between;
  }
  .cfg-modal .datos-pill-select,
  .cfg-modal .datos-pill-toggle {
    flex: 1 1 calc(50% - 4px) !important;
  }
  .cfg-modal .datos-pill .datos-val,
  .cfg-modal .datos-pill .datos-input {
    text-align: right;
    flex: 1;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .cfg-modal .datos-pill-nombre .datos-input { min-width: 0; }
  .cfg-modal .datos-pill-select .datos-select { text-align: right; }
}

/* Danger zone */
.cfg-modal .cfg-danger-zone {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--danger, #ef4444);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cfg-modal .cfg-danger-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--danger, #dc2626);
}
.cfg-modal .cfg-danger-zone .btn { width: 100%; justify-content: center; }

/* Sm cards: Exportar + Reimportar compactos */
.cfg-modal .cfg-card-sm .cfg-card-head { padding: 8px 12px; }
.cfg-modal .cfg-card-sm .cfg-card-title { font-size: 12px; }
.cfg-modal .cfg-card-sm .cfg-card-body { padding: 10px 12px !important; gap: 8px !important; }
.cfg-modal .cfg-card-export .cfg-card-body { flex-direction: column; }
.cfg-modal .cfg-card-export .btn { width: 100%; justify-content: center; }
.cfg-modal .cfg-card-export .cfg-hint { font-size: 10px; line-height: 1.3; margin: 0; text-align: center; }
.cfg-modal .cfg-card-reimport .file-drop { padding: 10px 8px; gap: 2px; }
.cfg-modal .cfg-card-reimport .file-drop svg { width: 18px; height: 18px; }
.cfg-modal .cfg-card-reimport .file-drop-text { font-size: 11px; }
.cfg-modal .cfg-card-reimport .file-drop-sub { font-size: 9px; }
.cfg-modal .cfg-card-reimport .cfg-meta { padding: 4px 8px; font-size: 10px; }
.cfg-modal .cfg-card-reimport .cfg-check { font-size: 11px; }
.cfg-modal .cfg-card-reimport .cfg-check small { font-size: 10px; }
.cfg-modal .cfg-card-reimport .btn { width: 100%; justify-content: center; }

@media (max-width: 820px) {
  .cfg-modal .cfg-layout-v2 {
    grid-template-columns: 1fr;
    grid-template-areas: "datos" "lugares" "export" "reimp";
  }
  .cfg-modal .cfg-card-datos .cfg-card-body { grid-template-columns: 1fr 1fr; }
}

/* Año select */
.cfg-modal .cfg-field-select {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 10px !important;
  transition: border-color .15s ease;
}
.cfg-modal .cfg-field-select:hover { border-color: var(--brand); }
.cfg-modal .cfg-select {
  flex: 1; min-width: 0;
  border: none; background: transparent;
  font-size: var(--fs-sm); font-weight: 700; color: var(--ink-1);
  cursor: pointer; outline: none;
  padding: 2px 4px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  padding-right: 16px;
}
[data-theme="dark"] .cfg-modal .cfg-select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* Inline-edit: botón a la derecha, siempre alineado al final */
.cfg-modal .cfg-field.inline-edit {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cfg-modal .cfg-field.inline-edit .cfg-label { flex-shrink: 0; }
.cfg-modal .cfg-field.inline-edit .cfg-control { flex: 1; min-width: 0; }
.cfg-modal .cfg-field.inline-edit .inline-edit-btn { margin-left: auto; flex-shrink: 0; }

/* Sort button in filterable th */
.col-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  margin-left: 4px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
  line-height: 1;
}
.col-sort-btn:hover { background: var(--surface-2); color: var(--brand); }
.col-sort-btn.is-active { color: var(--brand); background: rgba(249,115,22,.12); }

/* ==== Remove left-accent from toasts ==== */
.toast, .toast-success, .toast-error, .toast-info, .toast-warning,
.toast-container > div,
.dups-toast {
  border-left: none !important;
  border-left-color: transparent !important;
}

/* ========== Usuarios: toolbar + view switch + rows view ========== */
#tab-usuarios .panel-header {
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 10px;
}
#tab-usuarios .panel-header .search-box-lg {
  flex: 1 1 220px;
  min-width: 160px;
  max-width: 320px;
}
#tab-usuarios .panel-header .search-box-lg input,
#tab-dashboard .panel-header .search-box-lg input,
#tab-dominios .panel-header .search-box-lg input {
  height: 36px;
  padding: 0 36px 0 38px;
  font-size: 13px;
  border-width: 1px;
}
#tab-usuarios .panel-header .search-box-lg .search-icon,
#tab-dashboard .panel-header .search-box-lg .search-icon,
#tab-dominios .panel-header .search-box-lg .search-icon {
  left: 12px;
  width: 16px;
  height: 16px;
}
#tab-usuarios .panel-header .search-box-lg .search-clear,
#tab-dashboard .panel-header .search-box-lg .search-clear,
#tab-dominios .panel-header .search-box-lg .search-clear {
  width: 22px;
  height: 22px;
  right: 8px;
}
#tab-dashboard .panel-header .search-box-lg,
#tab-dominios .panel-header .search-box-lg {
  flex: 1 1 220px;
  min-width: 160px;
  max-width: 320px;
}
#tab-dashboard .panel-header .dash-year-select { height: 36px; padding: 0 28px 0 12px; font-size: 13px; line-height: 1; box-sizing: border-box; }
#tab-dashboard .panel-header .panel-actions .btn { height: 36px; }
#tab-dashboard .panel-header .view-switcher { height: 36px; box-sizing: border-box; }
#tab-dashboard .panel-header .vs-btn { height: 30px; }
.panel-filter-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  align-items: center;
}
.panel-filter-group .dash-year-select {
  min-width: 0;
  max-width: 150px;
  height: 36px;
  padding: 0 28px 0 12px;
  font-size: 13px;
  line-height: 1;
  box-sizing: border-box;
}
#tab-usuarios .panel-header .view-switcher { height: 36px; box-sizing: border-box; }
#tab-usuarios .panel-header .vs-btn { height: 30px; }
#tab-usuarios .panel-header .panel-actions .btn { height: 36px; }
#tab-usuarios .panel-header .view-switcher,
#tab-dashboard .panel-header .view-switcher { margin-left: auto; flex-shrink: 0; }
#tab-usuarios .panel-header .panel-actions { flex-shrink: 0; }
@media (max-width: 960px) {
  #tab-usuarios .panel-header { flex-wrap: wrap; }
  #tab-usuarios .panel-header .search-box-lg { max-width: none; flex: 1 1 100%; }
  #tab-usuarios .panel-header .view-switcher { margin-left: 0; }
}
.usu-count-row {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 10px;
  padding-left: 2px;
}

/* Cards view (existing .user-card grid container) */
.admin-list.usu-view-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.uc-card-v2 {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
}
.uc-card-v2 .uc-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}
.uc-card-v2 .uc-avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  font-size: 14px;
}
.uc-card-v2 .uc-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.uc-card-v2 .uc-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uc-card-v2 .uc-email {
  font-size: 11.5px;
}
.uc-card-v2 > .uc-rol {
  display: none;
}
.uc-card-v2 .uc-name + .uc-rol,
.uc-card-v2 .uc-body .uc-rol {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 3px;
}
.uc-card-v2 .uc-actions { align-self: flex-start; }

.uc-section {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.uc-section-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
  flex: none;
  width: 58px;
  padding-top: 5px;
}
.uc-section-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
}
.uc-section-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uc-si-lugar {
  background: rgba(249,115,22,.08);
  color: #ea580c;
  border-color: rgba(249,115,22,.25);
}
.uc-si-camp {
  background: rgba(14,165,233,.08);
  color: #0284c7;
  border-color: rgba(14,165,233,.25);
  font-variant-numeric: tabular-nums;
}
.uc-section-empty {
  font-size: 11px;
  color: var(--ink-3);
  font-style: italic;
  padding-top: 4px;
}
[data-theme="dark"] .uc-si-lugar { background: rgba(249,115,22,.15); color: #fdba74; }
[data-theme="dark"] .uc-si-camp  { background: rgba(14,165,233,.18); color: #7dd3fc; }

/* Rows view */
.admin-list.usu-view-rows {
  display: block;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.admin-list.usu-view-rows .user-card {
  display: grid;
  grid-template-columns: 44px minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(120px, 0.9fr) minmax(140px, 0.8fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.admin-list.usu-view-rows .user-card.is-confirming { grid-template-columns: 44px minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(120px, 0.9fr) minmax(140px, 0.8fr) auto; }
.admin-list.usu-view-rows .user-card .uc-inline-confirm { grid-column: 1 / -1; margin-top: 6px; }
.admin-list.usu-view-rows .user-card.usu-row-head {
  background: var(--surface-2);
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  position: sticky; top: 0; z-index: 2;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-3);
  pointer-events: none;
}
.admin-list.usu-view-rows .user-card.usu-row-head:hover { background: var(--surface-2); }
.admin-list.usu-view-rows .user-card.usu-row-head .uch-actions { text-align: right; }
.admin-list.usu-view-rows .user-card:last-child { border-bottom: none; }
.admin-list.usu-view-rows .user-card:hover { background: var(--surface-2); transform: none; }
.admin-list.usu-view-rows .uc-body { min-width: 0; }
.admin-list.usu-view-rows .uc-chips { margin-top: 2px; }
.admin-list.usu-view-rows .uc-email {
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-list.usu-view-rows .uc-chips-lugares,
.admin-list.usu-view-rows .uc-chips-camps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.admin-tabs-mobile { display: none; }

/* ========== Trash can FAB + modal ========== */
.trash-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px -8px rgba(15,23,42,.25);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 500;
  transition: all .18s var(--ease);
}
.trash-fab:hover {
  color: var(--danger);
  border-color: var(--danger);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(239,68,68,.35);
}
body.is-user .trash-fab,
body.is-visor .trash-fab { display: none !important; }
.trash-fab-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239,68,68,.4);
}
.trash-fab-count[hidden] { display: none !important; }
.trash-note { color: var(--ink-3); font-size: 13px; margin: 0 0 14px; }
.trash-list { display: flex; flex-direction: column; gap: 10px; }
.trash-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.trash-item-body .trash-codigo { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.trash-item-body .trash-nombre { font-size: 15px; font-weight: 700; color: var(--ink-1); margin-top: 2px; }
.trash-item-meta { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.trash-item-meta .trash-purge { color: var(--warning); font-weight: 600; }
.trash-actions { display: flex; gap: 6px; }
.trash-empty { text-align: center; padding: 24px; color: var(--ink-3); font-size: 14px; }
@media (max-width: 768px) {
  .trash-fab { right: 16px; bottom: 16px; width: 48px; height: 48px; }
  .trash-item { grid-template-columns: 1fr; }
  .trash-actions { justify-content: flex-end; }
}

/* Desktop: everything in dir-toolbar on a single line */
.dir-toolbar { flex-wrap: nowrap; align-items: center; }
.dir-toolbar .search-box-lg { flex: 1 1 auto; min-width: 0; }
.dir-toolbar .btn-clear-filters,
.dir-toolbar .dir-add-btn { flex: 0 0 auto; white-space: nowrap; }
.dir-toolbar .page-size-select { flex: 0 0 auto; white-space: nowrap; }

/* ========== Stats total chip (hero) + subgrid ========== */
#campView_stats {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 10px;
  flex: 1;
  min-width: 0;
}
#campView_stats > .stats-subgrid { display: contents; }
@media (max-width: 550px) {
  #campView_stats { display: flex; flex-direction: column; }
  #campView_stats > .stats-subgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
.stat-chip.stat-chip-total {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--brand-soft), #fff);
  border: 1px solid var(--brand);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: all .15s ease;
}
.stat-chip.stat-chip-total:hover { box-shadow: var(--e2); transform: translateY(-1px); }
.stat-chip.stat-chip-total.is-active { background: var(--brand); color: #fff; }
.stat-chip.stat-chip-total.is-active .sct-lbl,
.stat-chip.stat-chip-total.is-active .sct-sub { color: rgba(255,255,255,.9); }
.sct-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.sct-val { font-size: clamp(22px, 2.2vw, 30px); font-weight: 800; line-height: 1; color: var(--brand); }
.stat-chip.stat-chip-total.is-active .sct-val { color: #fff; }
.sct-lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.sct-progress { height: 6px; background: rgba(0,0,0,.08); border-radius: 4px; overflow: hidden; }
.sct-progress-fill { height: 100%; background: var(--brand); border-radius: 4px; transition: width .3s ease; }
.stat-chip.stat-chip-total.is-active .sct-progress { background: rgba(255,255,255,.3); }
.stat-chip.stat-chip-total.is-active .sct-progress-fill { background: #fff; }
.sct-sub { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.sct-sub span { opacity: .5; margin: 0 4px; }

.stats-subgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.stats-subgrid .stat-chip { padding: 10px 12px; min-height: 64px; }

/* ========================================================= */
/* ======================  MOBILE  ========================= */
/* ========================================================= */
@media (max-width: 768px) {
  /* Body padding */
  .app-main, .admin-panel { padding: 12px !important; }
  .panel-header {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }
  .panel-header .search-box,
  .panel-header .search-box-lg {
    flex: 1 1 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    order: 1;
  }
  .panel-header .panel-actions,
  .panel-header .view-switcher,
  .panel-header .dash-year-select,
  .panel-header .panel-filter-group { order: 2; }
  .panel-header .panel-filter-group {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    width: 100%;
  }
  .panel-header .panel-filter-group .dash-year-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: 11px !important;
    padding: 8px 6px !important;
  }
  .panel-header .panel-actions {
    display: grid !important;
    grid-template-columns: auto 1fr;
    gap: 6px;
    width: 100%;
  }
  .panel-header .panel-actions .btn { width: 100%; justify-content: center; }

  /* Tabs → dropdown on mobile */
  .admin-tabs { display: none !important; }
  .admin-tabs-mobile {
    display: block !important;
    flex: 1;
    max-width: 220px;
    height: 38px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-1);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-1);
  }
  body.is-visor .admin-tabs-mobile option[value="usuarios"],
  body.is-visor .admin-tabs-mobile option[value="dominios"],
  body.is-user .admin-tabs-mobile option[value="usuarios"],
  body.is-user .admin-tabs-mobile option[value="dominios"] { display: none; }

  /* Force cards view on mobile for usuarios/campañas/dominios, hide rows */
  .admin-list.usu-view-rows,
  .admin-list.usu-view-cards {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .admin-list.usu-view-rows .usu-row-head { display: none !important; }
  .admin-list.usu-view-rows .user-card {
    display: grid !important;
    grid-template-columns: 44px 1fr auto !important;
    grid-template-areas:
      "avatar body  actions"
      "lug    lug    lug"
      "camps  camps  camps"
      "conex  conex  conex" !important;
    gap: 8px 10px !important;
    padding: 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    background: var(--surface-1) !important;
  }
  .admin-list.usu-view-rows .user-card > .uc-avatar { grid-area: avatar; }
  .admin-list.usu-view-rows .user-card > .uc-body { grid-area: body; min-width: 0; }
  .admin-list.usu-view-rows .user-card > .uc-actions { grid-area: actions; align-self: center; }
  .admin-list.usu-view-rows .user-card > .uc-chips-lugares { grid-area: lug; }
  .admin-list.usu-view-rows .user-card > .uc-chips-camps { grid-area: camps; }
  .admin-list.usu-view-rows .user-card > .uc-conex { grid-area: conex; font-size: 11px; color: var(--ink-3); padding-top: 6px; border-top: 1px dashed var(--border); }
  .admin-list.usu-view-rows .user-card > .uc-conex .uc-conex-ip { display: inline; }

  /* View switcher: hide since mobile is single-column */
  .view-switcher { display: none !important; }

  /* Campañas: JS forces cards view on mobile; keep cr-table overflow just in case */
  .cr-table { display: block; overflow-x: auto; }

  /* Camp toolbar */
  .camp-toolbar { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
  .camp-toolbar .camp-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .cfg-open-btn, .export-toolbar-btn { width: 100%; justify-content: center; padding: 0 12px !important; height: 46px !important; min-height: 46px; font-size: 13px; }
  .stats-subgrid { grid-template-columns: repeat(2, 1fr) !important; }
  .sct-val { font-size: 26px !important; }

  /* Dir toolbar mobile: search full, Limpiar+Filas 50/50, Nueva directora full */
  .dir-toolbar { flex-wrap: wrap !important; gap: 8px !important; display: flex !important; flex-direction: row !important; align-items: stretch !important; }
  .dir-toolbar .search-box-lg { flex: 1 1 100% !important; order: 1; }
  .dir-toolbar .btn-clear-filters { order: 2; flex: 1 1 calc(50% - 4px) !important; max-width: calc(50% - 4px) !important; height: 46px !important; padding: 0 12px !important; font-size: 13px !important; justify-content: center; margin: 0 !important; }
  .dir-toolbar .page-size-select { order: 3; flex: 1 1 calc(50% - 4px) !important; max-width: calc(50% - 4px) !important; justify-content: center; height: 46px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; box-sizing: border-box; }
  .dir-toolbar .dir-add-btn { order: 4; flex: 1 1 100% !important; max-width: 100% !important; height: 46px !important; padding: 0 12px !important; font-size: 13px !important; justify-content: center; }

  /* Directoras table: horizontally scrollable */
  .sub-panel, #subtab-directoras { overflow-x: auto; }
  #tblDirectoras { min-width: 720px; font-size: 12px; }
  #tblDirectoras th, #tblDirectoras td { padding: 8px 6px !important; }

  /* Modals: near-full-screen with breathing room on mobile */
  .modal-overlay { padding: 12px !important; align-items: stretch !important; }
  .modal-content, .modal-lg {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100vh - 24px) !important;
    margin: auto !important;
    border-radius: 16px !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
  }
  .modal-body { flex: 1; overflow-y: auto; }
  .mu-grid-2 { grid-template-columns: 1fr !important; }

  /* Header */
  .app-header { padding: 10px 12px !important; }
  .header-title { font-size: 16px !important; }
  .header-subtitle { display: none; }

  /* Stats chips in dashboard */
  .dash-stats, .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Config modal */
  .cfg-modal .cfg-layout-v2 { padding: 12px !important; gap: 10px !important; }
  .cfg-modal .cfg-layout { grid-template-columns: 1fr !important; padding: 12px !important; gap: 10px !important; }
  .cfg-modal .cfg-card { min-width: 0; }
  .cfg-modal .cfg-card-body { padding: 12px !important; }
  .cfg-modal .cfg-field {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    padding: 10px 0 !important;
  }
  .cfg-modal .cfg-field .cfg-label { font-size: 10px; }
  .cfg-modal .cfg-control { width: 100%; flex-wrap: wrap; }
  .cfg-modal .inline-value,
  .cfg-modal .cfg-meta-value {
    max-width: 100% !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal !important;
  }
  .cfg-modal .inline-input { min-width: 0; width: 100%; }
  .cfg-modal .cfg-field-toggle { flex-direction: row !important; align-items: center !important; }

  /* Reduce chips in user cards */
  .ul-chip { font-size: 10px; padding: 2px 7px; }

  /* Conex log modal */
  .conex-log-table { font-size: 11px; }
  .conex-log-table td, .conex-log-table th { padding: 7px 8px; }

  /* Lugar badge (user mode): collapsed to pin only, expand on active */
  body.is-user .lugar-badge-hdr { padding: 6px 8px; gap: 0; }
  body.is-user .lugar-badge-hdr #lugarBadgeHdrText { display: none; }
  body.is-user .lugar-badge-hdr.is-expanded { gap: 6px; padding: 6px 12px; }
  body.is-user .lugar-badge-hdr.is-expanded #lugarBadgeHdrText { display: inline; }

  /* Directora modal mobile */
  #modalDirectora .modal-content { max-width: 100% !important; }
  #modalDirectora .modal-header {
    padding: 0 !important;
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    bottom: auto !important;
    width: auto !important;
    height: auto !important;
    z-index: 100 !important;
    background: transparent !important;
    pointer-events: none !important;
    display: block !important;
  }
  #modalDirectora .modal-header h3 { display: none !important; }
  #modalDirectora .modal-header .btn-close {
    pointer-events: auto !important;
    width: 38px !important;
    height: 38px !important;
    font-size: 26px !important;
    border-radius: 10px !important;
    background: rgba(0,0,0,.4) !important;
    color: #fff !important;
    padding: 0 0 3px 0 !important;
  }
  .dm-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 16px 14px !important;
    text-align: left;
  }
  .dm-avatar { width: 52px; height: 52px; border-radius: 14px; font-size: 18px; }
  .dm-name { font-size: 22px !important; }
  .dm-meta { font-size: 12px !important; margin-bottom: 8px; flex-wrap: wrap; }
  .dm-badges { gap: 5px; }
  .dm-badge, .dm-status { font-size: 10px !important; padding: 3px 8px !important; }

  .dm-tiles {
    grid-template-columns: repeat(2, 1fr) !important;
    padding: 12px 14px !important;
    gap: 8px !important;
  }
  .dm-tile { padding: 10px 8px; }
  .dm-tile-ic { font-size: 17px; }
  .dm-tile-lbl { font-size: 9px !important; }
  .dm-tile-val { font-size: 14px !important; }

  .dm-details { margin: 0 14px 12px !important; }
  .dm-details-head { padding: 10px 12px !important; font-size: 12px !important; }
  .dm-details-grid { grid-template-columns: 1fr !important; gap: 6px !important; padding: 10px 12px !important; }
  .dm-kv { font-size: 12px; }

  .dm-history { padding: 0 14px 14px !important; }
  .dm-history-head h4 { font-size: 13px; }
  .dm-tl-item { font-size: 12px; }
  .dm-tl-meta { font-size: 10px; }

  /* Footer stack: lugar + inv + botones verticales */
  #modalDirectora .modal-footer { padding: 10px 12px !important; gap: 8px !important; flex-direction: column !important; align-items: stretch !important; background: var(--surface-1); border-top: 1px solid var(--border); }
  .dir-mark-controls { display: flex; flex-direction: column; gap: 8px; width: 100%; }
  .dir-mark-row { display: flex; align-items: center; gap: 8px; width: 100%; }
  .dir-mark-row label:first-child { font-size: 12px; font-weight: 600; min-width: 44px; }
  .dir-mark-row select { flex: 1; min-width: 0; }
  .dir-mark-actions { display: flex !important; flex-direction: column; gap: 6px; width: 100%; }
  .dir-mark-actions .btn { width: 100%; padding: 12px; font-size: 14px; justify-content: center; }
}

@media (max-width: 480px) {
  .app-main, .admin-panel { padding: 8px !important; }
  .admin-list.usu-view-rows,
  .admin-list.usu-view-cards { grid-template-columns: 1fr !important; }
}

