:root {
  --bg: #080b12;
  --bg-2: #0c1220;
  --sidebar: rgba(8, 12, 22, 0.72);
  --card: rgba(16, 22, 38, 0.58);
  --card-solid: #12182a;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #f4f7fb;
  --muted: #8b9cb3;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --green: #22c55e;
  --red: #ef4444;
  --rose: #e11d48;
  --orange: #f59e0b;
  --yellow: #eab308;
  --cyan: #22d3ee;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 20px;
  --sidebar-w: 268px;
  --calendar-picker-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
}

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background:
    linear-gradient(145deg, #06080f 0%, #0a1020 38%, #080b12 100%);
  color: var(--text);
  min-height: 100vh;
}

button, input { font-family: inherit; }

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 85% 55% at 12% -8%, rgba(225, 29, 72, 0.28), transparent 58%),
    radial-gradient(ellipse 70% 50% at 88% 6%, rgba(59, 130, 246, 0.26), transparent 55%),
    radial-gradient(ellipse 60% 48% at 78% 92%, rgba(139, 92, 246, 0.22), transparent 52%),
    radial-gradient(ellipse 50% 42% at 8% 88%, rgba(34, 211, 238, 0.14), transparent 50%),
    radial-gradient(ellipse 40% 35% at 50% 45%, rgba(59, 130, 246, 0.06), transparent 70%),
    linear-gradient(155deg, #0d1324 0%, #080b12 32%, #0a0f1c 58%, #0b101a 82%, #070a11 100%);
}

.bg-glow::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.025) 45%, transparent 70%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.015) 0,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 48px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.015) 0,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 48px
    );
  opacity: 0.45;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 42%, #000 20%, transparent 100%);
}

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  backdrop-filter: blur(20px) saturate(1.15);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 8px 18px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  display: block;
  width: 189px;
  height: auto;
  max-width: 100%;
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #fb7185, #be123c);
  box-shadow: 0 0 18px rgba(225, 29, 72, 0.45);
}

.brand-icon svg { width: 20px; height: 20px; }

.brand-text {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 2.5px;
}

.sidebar-close { display: none; }

.nav { flex: 1; overflow-y: auto; padding: 0 4px; }

.nav-label {
  margin: 18px 10px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin: 3px 0;
  border-radius: 12px;
  color: #c9d4e8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .2s, color .2s;
}

.nav-item :is(i, svg) { width: 18px; height: 18px; opacity: .85; }

.nav-item:hover { background: rgba(255, 255, 255, 0.04); color: #fff; }

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.28), rgba(225, 29, 72, 0.06));
  border-left-color: #fb7185;
  box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.12);
}

.nav-item--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.nav-item--disabled:hover {
  background: transparent;
  color: #c9d4e8;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.topbar .user-card {
  width: auto;
  min-width: 0;
  max-width: 240px;
  margin-left: 4px;
  flex-shrink: 0;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #7c3aed);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.user-card .user-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.user-card strong,
.user-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-card strong { font-size: 13px; }
.user-card small { color: var(--muted); font-size: 11px; }
.user-card :is(i, svg) { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.user-chevron { transition: transform .2s ease; }
.user-menu.open .user-chevron { transform: rotate(180deg); }

.user-menu {
  position: relative;
  margin-left: 4px;
  flex-shrink: 0;
}

.topbar .user-card {
  margin-left: 0;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(260px, calc(100vw - 32px));
  padding: 8px;
  border-radius: 16px;
  background: rgba(16, 22, 38, 0.95);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.user-dropdown-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 8px;
}

.user-dropdown-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-dropdown-meta strong,
.user-dropdown-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-meta strong { font-size: 14px; }
.user-dropdown-meta small { color: var(--muted); font-size: 12px; }

.user-dropdown-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--border);
}

.user-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}

.user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.user-dropdown-item :is(i, svg) {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

.user-dropdown-item--danger {
  color: #fca5a5;
}

.user-dropdown-item--danger :is(i, svg) {
  color: #f87171;
}

.user-dropdown-form {
  margin: 0;
}

.user-avatar--lg {
  width: 64px;
  height: 64px;
  font-size: 20px;
}

/* ── Main ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 20;
}

.main {
  padding: 18px 28px 36px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 46px;
  margin-bottom: 22px;
}

.menu-btn { display: none; }

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.logout-form {
  margin: 0;
  display: contents;
}

/* ── Forms & profile ── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
}

.alert :is(i, svg) {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #bbf7d0;
}

.profile-panel {
  max-width: 720px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.profile-head h2 {
  margin: 0 0 4px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
}

.profile-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-form {
  display: grid;
  gap: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field--full {
  grid-column: 1 / -1;
}

.form-field > span:first-child {
  font-size: 13px;
  font-weight: 500;
  color: #c9d4e8;
}

.form-field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(8, 12, 22, 0.45);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.form-field input:focus {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-field input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Icono de calendario blanco en inputs de fecha (dark UI) */
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"],
input[type="week"] {
  color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="week"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
  width: 18px;
  height: 18px;
  margin-inline-start: 4px;
  background-color: transparent;
  background-image: var(--calendar-picker-icon);
  background-size: 18px 18px;
  background-repeat: no-repeat;
  background-position: center;
  filter: none;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="week"]::-webkit-calendar-picker-indicator:hover {
  opacity: 0.85;
}

.form-field select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(8, 12, 22, 0.45);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.form-field select:focus {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-field textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(8, 12, 22, 0.45);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.form-field textarea:focus {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-field input[type="file"] {
  width: 100%;
  padding: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

.form-file-current {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.file-link--sm {
  padding: 6px 10px;
  font-size: 12px;
}

.form-radio-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  border: 0;
  padding: 0;
  margin: 0;
}

.form-radio-group legend {
  width: 100%;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #c9d4e8;
}

.form-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #dbe4f5;
  cursor: pointer;
}

.form-radio input {
  accent-color: #3b82f6;
}

.form-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 14px;
  color: #dbe4f5;
  cursor: pointer;
}

.form-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: #3b82f6;
}

.form-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
  user-select: none;
}

.form-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.form-switch-track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.form-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.form-switch input:checked + .form-switch-track {
  background: rgba(34, 197, 94, 0.35);
  border-color: rgba(34, 197, 94, 0.55);
}

.form-switch input:checked + .form-switch-track::after {
  transform: translateX(20px);
}

.form-switch input:focus-visible + .form-switch-track {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 2px;
}

.form-switch-label {
  font-size: 14px;
  color: #dbe4f5;
}

.form-field--checkbox > span:first-child,
.form-field--switch > span:first-child {
  margin-bottom: 0;
}

.inspector-dupla legend {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #c9d4e8;
}

.inspector-dupla-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.inspector-dupla-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(8, 12, 22, 0.35);
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.inspector-dupla-option:hover {
  border-color: rgba(59, 130, 246, 0.28);
}

.inspector-dupla-option.is-selected {
  border-color: rgba(59, 130, 246, 0.42);
  background: rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.inspector-dupla-option input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #3b82f6;
  flex-shrink: 0;
}

.inspector-dupla-label {
  display: grid;
  gap: 2px;
}

.inspector-dupla-label strong {
  font-size: 14px;
  font-weight: 600;
  color: #e8eef9;
}

.inspector-dupla-label small {
  font-size: 11px;
  color: var(--muted);
}

.row-actions .inline-form {
  display: inline-flex;
  margin: 0;
}

button.action-btn {
  padding: 0;
  font: inherit;
}

.action-btn--danger:hover {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.28);
}

.alert-danger {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
}

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

.form-section + .form-section {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.form-section .section-title {
  font-size: 16px;
}

.form-section h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
}

.form-section-lead {
  margin: -8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.form-hint,
.form-error {
  font-size: 12px;
}

.form-hint { color: var(--muted); }
.form-error { color: #fca5a5; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 0;
  transition: filter .2s;
}

.btn-primary :is(i, svg),
.btn-secondary :is(i, svg) {
  width: 16px;
  height: 16px;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(90deg, #3b82f6, #7c3aed);
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.btn-primary:hover,
.btn-secondary:hover {
  filter: brightness(1.08);
}

.btn-nuevo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  background: linear-gradient(90deg, #3b82f6, #7c3aed);
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.35);
}

.btn-nuevo :is(i, svg) { width: 16px; height: 16px; }

.icon-btn:hover,
.btn-nuevo:hover { filter: brightness(1.08); }

.lucide { stroke-width: 1.75; }

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.icon-btn :is(i, svg) { width: 18px; height: 18px; }

.icon-btn.has-dot::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px #0c1220;
}

/* ── Hero ── */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}

.hero h1,
.hero .page-title {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title .title-text strong { font-weight: 800; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 650;
}

.title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: #ffffff;
}

.section-title .title-icon {
  width: 30px;
  height: 30px;
}

.page-title .title-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.title-icon :is(i, svg) {
  width: 16px;
  height: 16px;
}

.page-title .title-icon :is(i, svg) {
  width: 22px;
  height: 22px;
}

.hero h1 strong { font-weight: 800; }

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.date-widget {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.date-widget strong { display: block; font-size: 14px; }
.date-widget span { color: var(--muted); font-size: 12px; }

.date-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.15);
  color: #ffffff;
}

.date-icon :is(i, svg) {
  width: 18px;
  height: 18px;
  color: #ffffff;
  stroke: currentColor;
}

/* ── Stats ── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 8px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  backdrop-filter: blur(16px) saturate(1.12);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --spark-ambient: rgba(59, 130, 246, 0.22);
}

.stat-card:not(.stat-card--compact)::before {
  content: "";
  position: absolute;
  right: -18%;
  bottom: -42%;
  width: 78%;
  height: 95%;
  background: radial-gradient(circle at 50% 50%, var(--spark-ambient) 0%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.stat-card > :not(.spark) {
  position: relative;
  z-index: 1;
}

.stat-card.accent-blue {
  --spark-ambient: rgba(59, 130, 246, 0.28);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.08), 0 16px 40px rgba(59, 130, 246, 0.08);
}
.stat-card.accent-purple {
  --spark-ambient: rgba(139, 92, 246, 0.28);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.08), 0 16px 40px rgba(139, 92, 246, 0.08);
}
.stat-card.accent-green {
  --spark-ambient: rgba(34, 197, 94, 0.24);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.08), 0 16px 40px rgba(34, 197, 94, 0.08);
}
.stat-card.accent-red {
  --spark-ambient: rgba(239, 68, 68, 0.24);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.08), 0 16px 40px rgba(239, 68, 68, 0.08);
}

.stat-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.stat-icon :is(i, svg) { width: 18px; height: 18px; }

.accent-blue .stat-icon { background: rgba(59, 130, 246, 0.16); color: #60a5fa; box-shadow: 0 0 16px rgba(59, 130, 246, 0.25); }
.accent-purple .stat-icon { background: rgba(139, 92, 246, 0.16); color: #c4b5fd; box-shadow: 0 0 16px rgba(139, 92, 246, 0.25); }
.accent-green .stat-icon { background: rgba(34, 197, 94, 0.16); color: #4ade80; box-shadow: 0 0 16px rgba(34, 197, 94, 0.25); }
.accent-red .stat-icon { background: rgba(239, 68, 68, 0.16); color: #f87171; box-shadow: 0 0 16px rgba(239, 68, 68, 0.25); }

.stat-title { font-size: 13px; color: var(--muted); font-weight: 500; }

.stat-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
}

.stat-body h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.6px;
}

.stat-variation {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid transparent;
}

.stat-badge :is(i, svg) { width: 14px; height: 14px; }

.stat-badge.up {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.22);
}

.stat-badge.down {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.22);
}

.stat-badge.neutral {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.18);
}

.stat-caption {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.stat-card--compact .stat-badge {
  font-size: 11px;
  padding: 3px 7px;
}

.spark {
  position: relative;
  z-index: 1;
  display: block;
  width: calc(100% + 36px);
  margin: 8px -18px -10px;
  height: 68px;
  overflow: visible;
}

.spark-area {
  opacity: 0.95;
}

.spark-glow {
  mix-blend-mode: screen;
}

.accent-blue .spark-line { filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.55)); }
.accent-green .spark-line { filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.5)); }
.accent-red .spark-line { filter: drop-shadow(0 0 8px rgba(248, 113, 113, 0.5)); }
.accent-purple .spark-line { filter: drop-shadow(0 0 8px rgba(196, 181, 253, 0.55)); }

.regional-stats {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.regional-stat-panel .stats {
  margin-bottom: 0;
}

.regional-stats--single .regional-stat-panel {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.stat-card--compact {
  padding: 14px 16px 12px;
}

.stat-card--compact .stat-body h2 {
  font-size: 26px;
}

/* ── Panels ── */
.row {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.row.mid { grid-template-columns: 1fr; }
.row.bottom { grid-template-columns: 2.15fr 0.9fr; }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  backdrop-filter: blur(16px) saturate(1.12);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-head .section-title {
  font-size: 16px;
  font-weight: 650;
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: color .2s, background .2s, border-color .2s;
}

a.chip:hover {
  color: #dbe4f5;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.28);
}

.chip :is(i, svg) { width: 13px; height: 13px; }

.chart-wrap { height: 260px; position: relative; }
.chart-wrap--activity { height: 320px; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* ── Inspecciones ── */
.table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

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

.inspections-table thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.inspections-table tbody td {
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  color: #dbe4f5;
  vertical-align: middle;
}

.table-empty {
  margin: 0;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.inspections-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.inspections-table tbody tr:last-child td {
  border-bottom: 0;
}

.cell-num {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  color: #93c5fd;
  white-space: nowrap;
}

.estado {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.estado.con-respuesta { color: #bbf7d0; background: rgba(34, 197, 94, 0.18); }
.estado.sin-respuesta { color: #fecaca; background: rgba(239, 68, 68, 0.18); }
.estado.en-proceso { color: #bfdbfe; background: rgba(59, 130, 246, 0.18); }
.estado.pendiente { color: #fde68a; background: rgba(234, 179, 8, 0.18); }

.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color .2s, background .2s, border-color .2s;
}

.action-btn:hover {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.25);
}

a.action-btn {
  text-decoration: none;
}

.action-btn :is(i, svg) { width: 15px; height: 15px; }

.inspecciones-index {
  display: grid;
  gap: 18px;
}

.filters-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(59, 130, 246, 0.2);
}

.filters-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 70% at 0% 0%, rgba(59, 130, 246, 0.12), transparent 62%),
    linear-gradient(145deg, rgba(59, 130, 246, 0.06) 0%, transparent 48%);
}

.filters-panel > * {
  position: relative;
  z-index: 1;
}

.filters-panel .panel-head h3 {
  font-family: "Space Grotesk", sans-serif;
}

.list-panel .panel-head h3 {
  font-family: "Space Grotesk", sans-serif;
}

.inspections-list-panel {
  display: grid;
  gap: 18px;
}

.inspeccion-edit-form {
  display: grid;
  gap: 18px;
}

.inspeccion-edit-form > .form-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.inspeccion-edit-form > .form-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
}

.inspeccion-edit-form > .form-card > * {
  position: relative;
  z-index: 1;
}

/* General — azul */
.inspeccion-edit-form > .form-card--general {
  border-color: rgba(59, 130, 246, 0.2);
}
.inspeccion-edit-form > .form-card--general::before {
  background:
    radial-gradient(ellipse 80% 70% at 0% 0%, rgba(59, 130, 246, 0.14), transparent 62%),
    linear-gradient(145deg, rgba(59, 130, 246, 0.07) 0%, transparent 48%);
}

/* CRM CIEC — cyan */
.inspeccion-edit-form > .form-card--ciec {
  border-color: rgba(34, 211, 238, 0.22);
}
.inspeccion-edit-form > .form-card--ciec::before {
  background:
    radial-gradient(ellipse 78% 68% at 100% 0%, rgba(34, 211, 238, 0.14), transparent 58%),
    linear-gradient(145deg, rgba(6, 182, 212, 0.07) 0%, transparent 50%);
}

/* 1° notificación — rosa */
.inspeccion-edit-form > .form-card--not1 {
  border-color: rgba(251, 113, 133, 0.2);
}
.inspeccion-edit-form > .form-card--not1::before {
  background:
    radial-gradient(ellipse 75% 65% at 100% 0%, rgba(225, 29, 72, 0.13), transparent 58%),
    linear-gradient(145deg, rgba(251, 113, 133, 0.06) 0%, transparent 50%);
}

/* 2° notificación — ámbar */
.inspeccion-edit-form > .form-card--not2 {
  border-color: rgba(245, 158, 11, 0.2);
}
.inspeccion-edit-form > .form-card--not2::before {
  background:
    radial-gradient(ellipse 70% 60% at 0% 100%, rgba(245, 158, 11, 0.12), transparent 55%),
    linear-gradient(145deg, rgba(234, 179, 8, 0.06) 0%, transparent 48%);
}

/* 3° notificación — violeta */
.inspeccion-edit-form > .form-card--not3 {
  border-color: rgba(139, 92, 246, 0.2);
}
.inspeccion-edit-form > .form-card--not3::before {
  background:
    radial-gradient(ellipse 72% 62% at 100% 100%, rgba(139, 92, 246, 0.13), transparent 56%),
    linear-gradient(145deg, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
}

/* Observaciones — verde */
.inspeccion-edit-form > .form-card--response {
  border-color: rgba(34, 197, 94, 0.2);
}
.inspeccion-edit-form > .form-card--response::before {
  background:
    radial-gradient(ellipse 78% 68% at 0% 50%, rgba(34, 197, 94, 0.11), transparent 58%),
    linear-gradient(145deg, rgba(34, 211, 238, 0.05) 0%, transparent 52%);
}

/* Acciones — neutro frío */
.inspeccion-edit-form > .form-card--actions {
  border-color: rgba(148, 163, 184, 0.18);
}
.inspeccion-edit-form > .form-card--actions::before {
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 0%, transparent 42%, rgba(59, 130, 246, 0.05) 100%);
}

.ciec-search {
  display: grid;
  gap: 16px;
}

.ciec-search-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.ciec-search-field {
  margin: 0;
}

.ciec-search-status {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  border: 1px solid var(--border);
}

.ciec-search-status--loading,
.ciec-search-status--info {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.22);
}

.ciec-search-status--success {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.22);
}

.ciec-search-status--warning {
  color: #fde68a;
  background: rgba(234, 179, 8, 0.1);
  border-color: rgba(234, 179, 8, 0.22);
}

.ciec-search-status--error {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.22);
}

.ciec-results {
  display: grid;
  gap: 12px;
}

.ciec-result-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.02);
}

.ciec-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ciec-result-head strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  color: #dbe4f5;
}

.ciec-result-list {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.ciec-result-list > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
}

.ciec-result-list dt {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--muted);
}

.ciec-result-list dd {
  margin: 0;
  font-size: 13px;
  color: #dbe4f5;
}

.ciec-result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ciec-use-btn {
  height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

.detail-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-section-head .section-title,
.detail-section-head h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
}

/* Fotos inspección — teal */
.form-card--photos {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(45, 212, 191, 0.22);
}

.inspeccion-edit-form + .form-card--photos {
  margin-top: 18px;
}

.inspeccion-edit-form > .form-card--photos::before,
.form-card--photos::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
  background:
    radial-gradient(ellipse 76% 66% at 0% 100%, rgba(45, 212, 191, 0.13), transparent 58%),
    linear-gradient(145deg, rgba(20, 184, 166, 0.07) 0%, transparent 50%);
}

.form-card--photos > * {
  position: relative;
  z-index: 1;
}

.inspeccion-fotos-form {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.inspeccion-galeria-wrap {
  margin-top: 4px;
}

.inspeccion-galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.inspeccion-galeria-item {
  display: grid;
  gap: 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.inspeccion-galeria-link {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.inspeccion-galeria-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.inspeccion-galeria-link:hover img {
  transform: scale(1.04);
}

.inspeccion-galeria-meta {
  padding: 0 12px 12px;
  display: grid;
  gap: 6px;
}

.inspeccion-galeria-meta p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.inspeccion-galeria-meta strong {
  color: #c9d4e8;
}

.inspeccion-galeria-delete {
  margin-top: 4px;
}

.btn-danger-sm {
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.1);
}

.btn-danger-sm:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.4);
}

.form-card .panel-head h3 {
  font-family: "Space Grotesk", sans-serif;
}

.form-card--actions {
  padding-top: 14px;
  padding-bottom: 14px;
}

.form-card--actions .form-actions {
  margin: 0;
}

.filters-form {
  padding-bottom: 0;
  border-bottom: 0;
}

.filters-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, minmax(140px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.filters-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filters-actions .btn-primary,
.filters-actions .btn-secondary {
  height: 44px;
  min-width: 44px;
  padding: 0 16px;
}

.filters-actions .btn-secondary {
  display: inline-grid;
  place-items: center;
}

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  transition: color .2s;
}

.sort-link:hover,
.sort-link.is-active {
  color: #dbe4f5;
}

.sort-link :is(i, svg) {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.cell-main {
  color: #dbe4f5;
}

.cell-sub,
.cell-muted {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.table-meta {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: color .2s, background .2s, border-color .2s;
}

.page-btn:hover:not(.disabled):not(.active) {
  color: #dbe4f5;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.25);
}

.page-btn.active {
  color: #dbe4f5;
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.35);
}

.page-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-btn :is(i, svg) {
  width: 14px;
  height: 14px;
}

/* ── Detalle inspección ── */
.hero-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #93c5fd;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-highlight {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.detail-highlight-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}

.detail-highlight-icon :is(i, svg) {
  width: 24px;
  height: 24px;
}

.detail-highlight h2 {
  margin: 0 0 4px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
}

.detail-highlight p {
  margin: 0;
  color: #dbe4f5;
  font-size: 14px;
}

.detail-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.detail-link:hover {
  color: #93c5fd;
}

.detail-link :is(i, svg) {
  width: 14px;
  height: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.detail-section {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.detail-grid .detail-section {
  margin-bottom: 0;
}

.detail-section-head .section-title,
.detail-section-head h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-item {
  display: grid;
  grid-template-columns: minmax(120px, 34%) 1fr;
  gap: 12px;
  align-items: start;
}

.detail-item dt {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-item dd {
  margin: 0;
  font-size: 14px;
  color: #dbe4f5;
  word-break: break-word;
}

.detail-empty,
.detail-empty-block {
  color: var(--muted);
  font-size: 13px;
}

.detail-empty-block {
  margin: 0;
}

.detail-dupla {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.detail-dupla li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #dbe4f5;
}

.detail-dupla :is(i, svg) {
  width: 16px;
  height: 16px;
  color: #93c5fd;
}

.detail-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.detail-card {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.detail-card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-card strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  color: #dbe4f5;
}

.detail-notes {
  font-size: 14px;
  line-height: 1.6;
  color: #dbe4f5;
  white-space: pre-wrap;
}

.file-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, border-color .2s;
}

.file-link:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.35);
}

.file-link :is(i, svg) {
  width: 15px;
  height: 15px;
}

.file-link-name {
  font-weight: 500;
  color: #dbe4f5;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-actions .btn-primary[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

a.btn-primary {
  text-decoration: none;
}

/* ── Duplas de Inspectores ── */
.duplas-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.duplas-summary > div {
  flex: 1;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.duplas-summary strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.duplas-summary span {
  font-size: 11px;
  color: var(--muted);
}

.duplas-chart-wrap {
  height: 220px;
  margin-bottom: 14px;
}

.duplas-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.duplas-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
}

.duplas-list li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duplas-list li:hover {
  background: rgba(255, 255, 255, 0.03);
}

.duplas-list b {
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  color: #93c5fd;
}

/* ── Footer ── */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  backdrop-filter: blur(16px) saturate(1.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.footer p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* ── Responsive ── */
@media (max-width: 1280px) {
  .row.bottom { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 30;
    transform: translateX(-105%);
    transition: transform .25s ease;
    width: var(--sidebar-w);
  }
  .sidebar.open { transform: none; }
  .sidebar-close {
    display: grid;
    place-items: center;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
  }
  .overlay.show { display: block; }
  .menu-btn { display: grid; margin-right: auto; z-index: 2; }
  .stats { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 24px; }
}

@media (max-width: 640px) {
  .main { padding: 14px 14px 28px; }
  .stats, .row.mid, .row.bottom { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  .btn-nuevo { padding: 0 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .filters-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-cards { grid-template-columns: 1fr 1fr; }
  .detail-item { grid-template-columns: 1fr; gap: 4px; }
  .ciec-search-bar { grid-template-columns: 1fr; }
  .ciec-result-list > div { grid-template-columns: 1fr; gap: 2px; }
  .table-footer { flex-direction: column; align-items: flex-start; }
  .form-actions { justify-content: stretch; }
  .form-actions .btn-primary,
  .form-actions .btn-secondary { flex: 1; }
  .topbar .user-card .user-meta { display: none; }
  .topbar .user-card :is(i, svg) { display: none; }
  .topbar .user-card {
    padding: 4px;
    max-width: none;
  }
  .footer { flex-wrap: wrap; }
}
