:root {
  /* Premium Dark Theme variables */
  --bg-color: #0b1121;
  /* Deep navy blue almost black */
  --card-bg-light: rgba(18, 27, 47, 0.72);
  --card-bg-dark: rgba(11, 19, 36, 0.88);
  --panel-bg-strong: rgba(7, 12, 24, 0.6);
  --card-border: rgba(148, 163, 184, 0.14);
  --text-main: #f8fafc;
  --text-muted: #b0bfd3;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-slate: #cbd5e1;
  --accent-sky: #7dd3fc;
  --accent-mist: rgba(125, 211, 252, 0.14);
  --shadow-soft: 0 18px 40px rgba(2, 8, 23, 0.28);
  --shadow-deep: 0 28px 70px rgba(2, 8, 23, 0.42);
  --glow-cyan: rgba(6, 182, 212, 0.2);
  --glow-blue: rgba(59, 130, 246, 0.2);
  --font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Accessibility: skip-to-content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 10000;
  padding: 0.75rem 1.5rem;
  background: var(--accent-cyan);
  color: var(--bg-color);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 0.5rem 0;
}
.skip-link:focus {
  top: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  /* Add an elegant radial gradient glow at the top */
  background-image:
    radial-gradient(circle at 12% 0%, rgba(59, 130, 246, 0.24) 0%, transparent 36%),
    radial-gradient(circle at 88% 0%, rgba(6, 182, 212, 0.2) 0%, transparent 32%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.86) 0%, rgba(11, 17, 33, 0.98) 48%, rgba(4, 10, 24, 1) 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(28px);
}

body::before {
  width: 28rem;
  height: 28rem;
  top: 5rem;
  right: -10rem;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(6, 182, 212, 0.18) 0%, rgba(6, 182, 212, 0.06) 38%, transparent 68%);
}

body::after {
  width: 22rem;
  height: 22rem;
  bottom: 4rem;
  left: -8rem;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(59, 130, 246, 0.16) 0%, rgba(59, 130, 246, 0.05) 42%, transparent 70%);
}

/* Glassmorphism Classes */
.glass-panel {
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.42) 0%, rgba(15, 23, 42, 0.8) 100%),
    var(--card-bg-light);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 35%),
    linear-gradient(180deg, rgba(148, 163, 184, 0.04) 0%, transparent 28%);
  pointer-events: none;
}

.glass-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 15, 28, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 10px 35px rgba(2, 8, 23, 0.2);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  border-radius: 1.1rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.brand-logo:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(2, 8, 23, 0.16);
}

.brand-logo:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.7);
  outline-offset: 4px;
}

.brand-logo__text {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
  white-space: nowrap;
}

.brand-logo__dot {
  color: var(--accent-cyan);
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  white-space: nowrap;
}

.nav-link [data-lucide] {
  width: 18px;
  height: 18px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 6px;
  left: 0.8rem;
  background: linear-gradient(to right, var(--accent-blue), var(--accent-cyan));
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: calc(100% - 1.6rem);
}

main {
  flex-grow: 1;
  padding: 2rem 2rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.page-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 0.6rem;
}

.page-title {
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.1;
  background: linear-gradient(90deg, #ffffff 0%, #dbeafe 34%, #8be9fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 60ch;
}

.header-badge {
  cursor: default;
  padding-inline: 1rem;
  border-radius: 999px;
  min-height: 3.2rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Stylish Buttons */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  justify-content: center;
  text-align: center;
  line-height: 1.35;
  min-height: 3rem;
  white-space: normal;
  position: relative;
  z-index: 1;
  overflow: hidden;
  isolation: isolate;
  transform: translateZ(0);
  transition:
    transform 0.24s ease,
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    background 0.24s ease,
    color 0.24s ease,
    opacity 0.24s ease;
}

.btn [data-lucide] {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.12) 32%, transparent 58%);
  transform: translateX(-135%);
  transition: transform 0.6s ease;
  pointer-events: none;
  z-index: -1;
}

.btn:hover::before {
  transform: translateX(135%);
}

.btn:active {
  transform: translateY(1px) scale(0.985);
}

.btn.is-busy {
  pointer-events: none;
  opacity: 0.82;
}

.btn.is-busy [data-lucide] {
  animation: spin 1s linear infinite;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: white;
  box-shadow: 0 12px 26px rgba(14, 165, 233, 0.18);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(14, 165, 233, 0.26);
}

.btn-success {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.14), rgba(6, 95, 70, 0.18));
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.22));
  border-color: var(--accent-green);
  box-shadow: 0 16px 30px rgba(16, 185, 129, 0.16);
}

.btn-danger {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.12), rgba(127, 29, 29, 0.16));
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.18), rgba(153, 27, 27, 0.18));
  border-color: var(--accent-red);
  box-shadow: 0 16px 30px rgba(239, 68, 68, 0.14);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid var(--card-border);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  box-shadow: 0 14px 28px rgba(2, 8, 23, 0.14);
}

.btn:focus-visible,
.nav-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.22);
}

.btn-action-detail {
  box-shadow: 0 16px 32px rgba(14, 165, 233, 0.18);
}

.btn-action-map {
  border-color: rgba(45, 212, 191, 0.34);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(13, 148, 136, 0.18));
  color: #99f6e4;
}

.btn-action-map:hover {
  box-shadow: 0 18px 36px rgba(13, 148, 136, 0.18);
}

.btn-action-archive {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.1), rgba(51, 65, 85, 0.2));
  border-color: rgba(148, 163, 184, 0.22);
  color: #dbeafe;
}

.btn-action-archive:hover {
  border-color: rgba(148, 163, 184, 0.34);
  box-shadow: 0 16px 30px rgba(30, 41, 59, 0.2);
}

.btn-action-discard {
  box-shadow: 0 12px 26px rgba(127, 29, 29, 0.1);
}

/* Form inputs */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
}

.helper-text {
  color: var(--text-muted);
  font-size: 0.84rem;
  margin-top: 0.5rem;
  display: block;
  line-height: 1.5;
}

.form-control {
  width: 100%;
  padding: 0.9rem 1rem;
  background: rgba(10, 18, 34, 0.58);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--glow-cyan);
  background: rgba(15, 23, 42, 0.8);
}

.form-control::placeholder {
  color: rgba(176, 191, 211, 0.72);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Match Badge (AI) */
.status-badge,
.match-badge,
.priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.42rem 0.84rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  max-width: 100%;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.status-badge [data-lucide],
.match-badge [data-lucide],
.priority-badge [data-lucide] {
  width: 0.88rem;
  height: 0.88rem;
  flex-shrink: 0;
}

.status-badge::before,
.match-badge::before,
.priority-badge::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 72%);
  pointer-events: none;
}

.status-badge {
  text-transform: uppercase;
}

.status-badge--pending {
  color: #bfdbfe;
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.3), rgba(8, 47, 73, 0.42));
  border-color: rgba(125, 211, 252, 0.24);
}

.status-badge--approved {
  color: #d1fae5;
  background: linear-gradient(135deg, rgba(6, 95, 70, 0.42), rgba(16, 185, 129, 0.18));
  border-color: rgba(52, 211, 153, 0.28);
  box-shadow: 0 10px 24px rgba(6, 95, 70, 0.14);
}

.status-badge--archived {
  color: #e2e8f0;
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.4), rgba(15, 23, 42, 0.46));
  border-color: rgba(148, 163, 184, 0.22);
}

.status-badge--discard,
.status-badge--discarded {
  color: #fecaca;
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.42), rgba(69, 10, 10, 0.42));
  border-color: rgba(248, 113, 113, 0.22);
}

.match-high {
  color: #d1fae5;
  background: linear-gradient(135deg, rgba(6, 95, 70, 0.46), rgba(16, 185, 129, 0.18));
  border-color: rgba(52, 211, 153, 0.3);
  box-shadow: 0 10px 24px rgba(6, 95, 70, 0.14);
}

.match-medium {
  color: #fef3c7;
  background: linear-gradient(135deg, rgba(146, 64, 14, 0.42), rgba(245, 158, 11, 0.18));
  border-color: rgba(251, 191, 36, 0.28);
  box-shadow: 0 10px 24px rgba(146, 64, 14, 0.12);
}

.match-low {
  color: #fee2e2;
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.42), rgba(239, 68, 68, 0.16));
  border-color: rgba(248, 113, 113, 0.24);
  box-shadow: 0 10px 24px rgba(127, 29, 29, 0.12);
}

.priority-badge {
  color: #dbeafe;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(8, 47, 73, 0.36));
  border-color: rgba(125, 211, 252, 0.24);
  box-shadow: 0 10px 24px rgba(30, 64, 175, 0.12);
}

.priority-badge--high {
  color: #d1fae5;
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.34), rgba(6, 95, 70, 0.3));
  border-color: rgba(52, 211, 153, 0.28);
}

.priority-badge--medium {
  color: #fef3c7;
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.3), rgba(120, 53, 15, 0.28));
  border-color: rgba(251, 191, 36, 0.24);
}

.priority-badge--low {
  color: #fee2e2;
  background: linear-gradient(135deg, rgba(153, 27, 27, 0.32), rgba(69, 10, 10, 0.26));
  border-color: rgba(248, 113, 113, 0.22);
}

/* Base animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  background: var(--card-bg-dark);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  color: var(--text-main);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: fadeIn 0.3s ease, slideOut 0.3s ease 4s forwards;
  border-left: 4px solid var(--accent-blue);
  max-width: min(26rem, calc(100vw - 2rem));
  box-shadow: var(--shadow-deep);
}

.toast-success {
  border-left-color: var(--accent-green);
}

.toast-error {
  border-left-color: var(--accent-red);
}

.toast-info {
  border-left-color: var(--accent-blue);
}

@keyframes slideOut {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.records-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.records-grid:has(.record-card:not(.record-card--collapsed)) {
  gap: 1.2rem;
}

.record-card {
  padding: 1.45rem;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  min-width: 0;
  min-height: 100%;
  transition:
    transform 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease,
    background 0.28s ease;
}

.record-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 1rem;
  right: 1rem;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, rgba(125, 211, 252, 0.75) 18%, rgba(59, 130, 246, 0.72) 50%, rgba(125, 211, 252, 0.75) 82%, transparent 100%);
  opacity: 0.68;
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}

.record-card--approved::after {
  background: linear-gradient(90deg, transparent 0%, rgba(52, 211, 153, 0.72) 18%, rgba(16, 185, 129, 0.78) 50%, rgba(45, 212, 191, 0.72) 82%, transparent 100%);
}

.record-card--archived::after {
  background: linear-gradient(90deg, transparent 0%, rgba(148, 163, 184, 0.5) 18%, rgba(203, 213, 225, 0.62) 50%, rgba(148, 163, 184, 0.5) 82%, transparent 100%);
}

.record-card:hover {
  transform: translateY(-5px);
  border-color: rgba(125, 211, 252, 0.24);
  box-shadow: var(--shadow-deep);
  background:
    linear-gradient(180deg, rgba(36, 49, 70, 0.46) 0%, rgba(15, 23, 42, 0.84) 100%),
    var(--card-bg-light);
}

.record-card:hover::after {
  opacity: 1;
  transform: scaleX(1.02);
}

.record-card.is-filter-hit {
  animation: cardFilterPulse 0.28s ease;
}

.record-card.is-hidden,
.empty-state.is-hidden {
  display: none;
}

.record-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.9rem;
}

.record-card__header-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
  flex-shrink: 0;
}

.record-card__header-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.record-card__eyebrow-line {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.record-card__code {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  word-break: break-word;
}

.record-card__source {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.record-card__source--rss {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.22);
}

.record-card__source--mp {
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.22);
}
.record-card__source--ca {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.22);
}

.record-card__title {
  font-size: 1.15rem;
  line-height: 1.35;
  font-weight: 700;
  text-wrap: balance;
}

.record-card__key-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0.4rem 0 0.5rem;
}

.record-card__info-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.record-card__info-item svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.record-card__info-item--monto {
  color: var(--accent-green);
  font-weight: 500;
}

.record-card__info-item--cierre {
  color: var(--accent-amber);
}

.record-card__description {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border-left: 3px solid var(--accent-cyan);
}

.record-card__summary {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 62ch;
}

.record-card__quote {
  background: var(--panel-bg-strong);
  padding: 1rem 1rem 1rem 1.1rem;
  border-radius: 0.9rem;
  border-left: 3px solid var(--accent-cyan);
  position: relative;
  transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.record-card--approved .record-card__quote {
  border-left-color: rgba(52, 211, 153, 0.72);
}

.record-card--archived .record-card__quote {
  border-left-color: rgba(148, 163, 184, 0.58);
}

.record-card:hover .record-card__quote {
  transform: translateY(-1px);
  background: rgba(8, 15, 28, 0.74);
}

.record-card__quote::before {
  content: '“';
  position: absolute;
  top: 0.35rem;
  right: 0.85rem;
  font-size: 2.1rem;
  line-height: 1;
  color: rgba(148, 163, 184, 0.18);
  font-weight: 700;
}

.record-card__quote p {
  font-size: 0.95rem;
  color: var(--text-main);
  opacity: 0.92;
  font-style: italic;
  line-height: 1.7;
}

.record-card__quote-label,
.record-card__insight-label {
  display: inline-flex;
  margin-bottom: 0.45rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.record-card__insight {
  padding: 0.95rem 1rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(125, 211, 252, 0.12);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.08), rgba(8, 15, 28, 0.42));
}

.record-card__insight--high {
  border-color: rgba(52, 211, 153, 0.18);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.12), rgba(8, 15, 28, 0.42));
}

.record-card__insight--medium {
  border-color: rgba(251, 191, 36, 0.18);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.12), rgba(8, 15, 28, 0.42));
}

.record-card__insight--low {
  border-color: rgba(248, 113, 113, 0.16);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.1), rgba(8, 15, 28, 0.42));
}

.record-card__insight p {
  color: var(--text-main);
  font-size: 0.92rem;
  line-height: 1.6;
}

.record-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin-top: auto;
}

.record-card__meta-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.8rem 0.9rem;
  border-radius: 0.95rem;
  background: rgba(8, 15, 28, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

.record-card__meta-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-sky);
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.14);
}

.record-card__meta-icon [data-lucide] {
  width: 1.05rem;
  height: 1.05rem;
}

.record-card__meta-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.record-card__meta-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.record-card__meta-value {
  min-width: 0;
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.record-card__meta-note {
  color: rgba(248, 113, 113, 0.92);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.35;
}

.record-card__decision-note {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.record-card__decision-label {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.record-card__decision-help {
  color: rgba(176, 191, 211, 0.78);
  font-size: 0.8rem;
  line-height: 1.45;
}

.record-card__decision-input {
  width: 100%;
  min-height: 4.6rem;
  resize: vertical;
  border-radius: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(8, 15, 28, 0.54);
  color: var(--text-main);
  padding: 0.85rem 0.95rem;
  font: inherit;
  line-height: 1.55;
  transition:
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    background 0.24s ease;
}

.record-card__decision-input::placeholder {
  color: rgba(176, 191, 211, 0.7);
}

.record-card__decision-input:focus {
  outline: none;
  border-color: rgba(125, 211, 252, 0.3);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
  background: rgba(8, 15, 28, 0.72);
}

.record-card__decision-readonly {
  width: 100%;
  border-radius: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.08);
  background: rgba(8, 15, 28, 0.42);
  color: var(--text-main);
  padding: 0.85rem 0.95rem;
  line-height: 1.55;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.record-card__actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding-top: 1rem;
  align-items: stretch;
}

.record-card__actions .btn,
.record-card__actions form {
  flex: 1 1 11rem;
}

.record-card__actions form {
  display: flex;
}

/* ── Tarjetas colapsables (dashboard) ── */

.record-card--collapsed {
  padding: 0.9rem 1.2rem;
  gap: 0;
  min-height: auto;
}

.record-card--collapsed:hover {
  transform: translateY(-2px);
}

.record-card--collapsed .record-card__header {
  gap: 0.6rem;
  align-items: center;
}

.record-card--collapsed .record-card__header-main {
  gap: 0.3rem;
}

.record-card--collapsed .record-card__title {
  font-size: 0.95rem;
  line-height: 1.3;
}

.record-card--collapsed .record-card__header-aside {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

.record-card--collapsed .priority-badge,
.record-card--collapsed .match-badge,
.record-card--collapsed .status-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
}

.record-card__compact {
  cursor: pointer;
}

.record-card__expand-icon {
  display: inline-flex;
  align-items: center;
  transition: transform 0.25s ease;
}

.record-card__expand-icon [data-lucide] {
  width: 1rem;
  height: 1rem;
  opacity: 0.35;
}

.record-card--collapsed .record-card__detail {
  display: none;
}

.record-card:not(.record-card--collapsed) .record-card__expand-icon {
  transform: rotate(180deg);
}

.record-card:not(.record-card--collapsed) .record-card__compact-meta {
  display: none;
}

.record-card__compact-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 0.4rem;
}

.record-card__compact-sep {
  opacity: 0.3;
}

.record-card__compact-org {
  max-width: 20ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-card__compact-cierre,
.record-card__compact-monto {
  white-space: nowrap;
}

.record-card__compact-monto {
  font-weight: 500;
  color: var(--text-main);
}

.record-card__detail {
  animation: cardDetailIn 0.2s ease;
  margin-top: 1rem;
}

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

.empty-state {
  grid-column: 1 / -1;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state h2 {
  font-size: 1.5rem;
  margin: 0.5rem 0;
}

.empty-state p {
  color: var(--text-muted);
}

.empty-state [data-lucide] {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-pill {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-color: rgba(125, 211, 252, 0.12);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  cursor: default;
}

.stat-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(125, 211, 252, 0.26);
  box-shadow: 0 16px 32px rgba(2, 8, 23, 0.22);
}

.stat-pill__value {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(90deg, #f8fafc 0%, #dbeafe 45%, #7dd3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-pill__label {
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* ── Sync health banner ── */
.sync-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(125, 211, 252, 0.1);
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
}

.sync-banner__indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.sync-banner__indicator svg {
  width: 1.15rem;
  height: 1.15rem;
}

.sync-banner__body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.sync-banner__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sync-banner__title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
}

.sync-banner__ago {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0.7;
}

.sync-banner__detail {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.3;
}

.sync-banner__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sync-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22rem;
  padding: 0.18rem 0.5rem;
  border-radius: 0.375rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sync-stat__val {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary, #e2e8f0);
}

.sync-stat__lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sync-stat--warn {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.2);
}
.sync-stat--warn .sync-stat__val { color: #fbbf24; }

.sync-stat--crit {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.2);
}
.sync-stat--crit .sync-stat__val { color: #f87171; }

.sync-stat--debt {
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.2);
}
.sync-stat--debt .sync-stat__val { color: #a78bfa; }

.sync-banner__strategy {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.75;
}

.sync-banner__strategy svg {
  width: 0.7rem;
  height: 0.7rem;
  flex-shrink: 0;
}

/* State: ok */
.sync-banner--ok {
  border-color: rgba(74, 222, 128, 0.25);
  background: rgba(74, 222, 128, 0.06);
}
.sync-banner--ok .sync-banner__indicator {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}
.sync-banner--ok .sync-banner__title {
  color: #86efac;
}

/* State: parcial */
.sync-banner--parcial {
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.06);
}
.sync-banner--parcial .sync-banner__indicator {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}
.sync-banner--parcial .sync-banner__title {
  color: #fde68a;
}

/* State: critico */
.sync-banner--critico {
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.06);
}
.sync-banner--critico .sync-banner__indicator {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}
.sync-banner--critico .sync-banner__title {
  color: #fca5a5;
}

/* State: sin_datos */
.sync-banner--sin_datos {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.04);
}
.sync-banner--sin_datos .sync-banner__indicator {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}
.sync-banner--sin_datos .sync-banner__title {
  color: #94a3b8;
}

.filter-toolbar {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.filter-toolbar--dashboard {
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
}

.filter-toolbar--pipeline {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.filter-toolbar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 0.25s ease, opacity 0.25s ease;
  opacity: 0;
}

.filter-toolbar:focus-within,
.filter-toolbar.has-active-filters {
  border-color: rgba(125, 211, 252, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 20px 40px rgba(2, 8, 23, 0.18);
}

.filter-toolbar:focus-within::after,
.filter-toolbar.has-active-filters::after {
  opacity: 1;
  border-color: rgba(125, 211, 252, 0.18);
}

.filter-group {
  min-width: 0;
  transition: transform 0.22s ease;
}

.filter-toolbar:focus-within .filter-group,
.filter-toolbar.has-active-filters .filter-group {
  transform: translateY(-1px);
}

.filter-group--search {
  grid-column: auto;
}

.filter-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.filter-input,
.filter-select {
  width: 100%;
  min-height: 3rem;
  border-radius: 0.95rem;
  border: 1px solid var(--card-border);
  background: rgba(9, 15, 28, 0.68);
  color: var(--text-main);
  padding: 0.8rem 0.95rem;
  font: inherit;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease,
    transform 0.25s ease;
}

.filter-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.filter-input::placeholder {
  color: var(--text-muted);
}

.filter-input:hover,
.filter-select:hover {
  border-color: rgba(125, 211, 252, 0.18);
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.16);
  background: rgba(15, 23, 42, 0.72);
  transform: translateY(-1px);
}

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

@keyframes cardFilterPulse {
  0% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-2px) scale(1.004);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

.settings-panel {
  padding: 2rem;
  box-shadow: var(--shadow-deep);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
}

.settings-section {
  min-width: 0;
  padding: 1.4rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.32), rgba(9, 15, 28, 0.52)),
    rgba(9, 15, 28, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.settings-section__title {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.02rem;
  font-weight: 600;
}

.settings-section__title [data-lucide] {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.settings-section__title--cyan  { color: var(--accent-cyan); }
.settings-section__title--green  { color: var(--accent-green); }
.settings-section__title--purple { color: #a855f7; }
.settings-section__title--blue   { color: var(--accent-blue); }

.settings-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

/* ── API status indicator ── */
.api-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.api-status__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.api-status--ok .api-status__dot {
  background: var(--accent-green);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.api-status--ok {
  color: #6ee7b7;
}

.api-status--missing .api-status__dot {
  background: rgba(148, 163, 184, 0.4);
}

.api-status--missing {
  color: var(--text-muted);
}

.panel-footer {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  display: flex;
  justify-content: flex-end;
}

.panel-footer .btn {
  padding: 0.8rem 2rem;
  font-size: 1.05rem;
}

@media (max-width: 980px) {
  .glass-nav {
    padding: 1rem 1.25rem;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
  }

  main {
    padding: 1.5rem 1.25rem 2.5rem;
  }

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

  .stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .filter-group--search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .glass-nav {
    flex-direction: column;
  }

  .nav-links {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    margin-inline: -0.1rem;
  }

  .nav-link {
    flex: 0 0 auto;
  }

  .page-header {
    align-items: flex-start;
  }

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

  .record-card__meta,
  .settings-inline-grid,
  .filter-toolbar {
    grid-template-columns: 1fr;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .toast {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .brand-logo__text {
    font-size: 1.2rem;
  }

  .page-title {
    font-size: 1.75rem;
  }

  main {
    padding: 1.1rem 0.9rem 2rem;
  }

  .settings-panel,
  .record-card,
  .empty-state {
    padding: 1.15rem;
  }

  .settings-section {
    padding: 1rem;
  }

  .stat-strip {
    grid-template-columns: 1fr;
  }

  .record-card__actions .btn,
  .record-card__actions form {
    flex-basis: 100%;
  }

  .panel-footer {
    justify-content: stretch;
  }

  .panel-footer .btn {
    width: 100%;
  }
}

/* ── Pipeline tabs ── */
.pipeline-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.pipeline-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  white-space: nowrap;
  transition:
    background 0.24s ease,
    border-color 0.24s ease,
    color 0.24s ease,
    transform 0.24s ease,
    box-shadow 0.24s ease;
}

.pipeline-tab [data-lucide] {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.pipeline-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.pipeline-tab--active {
  color: var(--text-main);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(6, 182, 212, 0.14));
  border-color: rgba(125, 211, 252, 0.3);
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.12);
}

.pipeline-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
}

.pipeline-tab--active .pipeline-tab__count {
  background: rgba(125, 211, 252, 0.2);
}

/* ── Pipeline badges ── */
.pipeline-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.pipeline-badge [data-lucide] {
  width: 0.82rem;
  height: 0.82rem;
  flex-shrink: 0;
}

.pipeline-badge--nueva {
  color: #bfdbfe;
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.3), rgba(8, 47, 73, 0.42));
  border-color: rgba(125, 211, 252, 0.24);
}

.pipeline-badge--en_preparacion {
  color: #fef3c7;
  background: linear-gradient(135deg, rgba(146, 64, 14, 0.38), rgba(245, 158, 11, 0.16));
  border-color: rgba(251, 191, 36, 0.28);
}

.pipeline-badge--postulada {
  color: #d1fae5;
  background: linear-gradient(135deg, rgba(6, 95, 70, 0.42), rgba(16, 185, 129, 0.18));
  border-color: rgba(52, 211, 153, 0.28);
}

.pipeline-badge--adjudicada {
  color: #fef3c7;
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.46), rgba(217, 119, 6, 0.22));
  border-color: rgba(245, 158, 11, 0.36);
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.12);
}

.pipeline-badge--no_adjudicada {
  color: #fecaca;
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.36), rgba(69, 10, 10, 0.36));
  border-color: rgba(248, 113, 113, 0.22);
}

.pipeline-badge--urgente {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(248, 113, 113, 0.3);
  animation: urgentPulse 2s ease-in-out infinite;
}

@keyframes urgentPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@media (max-width: 760px) {
  .pipeline-tabs {
    gap: 0.35rem;
  }

  .pipeline-tab {
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
  }

  .pipeline-tab__label {
    display: none;
  }
}

/* ── Glassmorphism Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(2, 8, 23, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

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

.modal-panel {
  width: 100%;
  max-width: 28rem;
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.72) 0%, rgba(15, 23, 42, 0.92) 100%),
    rgba(11, 19, 36, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.25rem;
  box-shadow: 0 32px 80px rgba(2, 8, 23, 0.5);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.25s ease;
  position: relative;
  overflow: hidden;
}

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

.modal-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 35%),
    linear-gradient(180deg, rgba(148, 163, 184, 0.04) 0%, transparent 28%);
  pointer-events: none;
}

.modal-panel::after {
  content: '';
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, rgba(125, 211, 252, 0.75) 18%, rgba(59, 130, 246, 0.72) 50%, rgba(125, 211, 252, 0.75) 82%, transparent 100%);
  opacity: 0.68;
}

.modal-panel--danger::after {
  background: linear-gradient(90deg, transparent 0%, rgba(248, 113, 113, 0.75) 18%, rgba(239, 68, 68, 0.72) 50%, rgba(248, 113, 113, 0.75) 82%, transparent 100%);
}

.modal__title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal__title [data-lucide] {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
}

.modal__body {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.modal__body strong {
  color: var(--text-main);
}

.modal__input {
  width: 100%;
  min-height: 3rem;
  border-radius: 0.95rem;
  border: 1px solid var(--card-border);
  background: rgba(9, 15, 28, 0.68);
  color: var(--text-main);
  padding: 0.8rem 0.95rem;
  font: inherit;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.modal__input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.16);
  background: rgba(15, 23, 42, 0.72);
}

.modal__input::placeholder {
  color: var(--text-muted);
}

.modal__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.modal__actions .btn {
  min-width: 7rem;
}

/* ── Toast close button ── */
.toast {
  padding-right: 2.8rem;
  position: relative;
}

.toast__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
  padding: 0;
}

.toast__close:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.toast__close [data-lucide] {
  width: 0.9rem;
  height: 0.9rem;
}

.toast-error {
  animation: fadeIn 0.3s ease;
}

/* ── Card stagger animation ── */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.record-card {
  animation: fadeSlideUp 0.35s ease backwards;
  animation-delay: calc(var(--card-index, 0) * 50ms);
}

/* ── Badge overflow fix ── */
.record-card__header-aside {
  flex-wrap: wrap;
}

@media (max-width: 400px) {
  .record-card__header-aside {
    align-items: flex-start;
  }
  .record-card__header {
    flex-direction: column;
  }
}

/* ── Countdown badge ── */
.countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.14);
}

.countdown-badge [data-lucide] {
  width: 0.78rem;
  height: 0.78rem;
  flex-shrink: 0;
}

.countdown-badge--warning {
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.18);
}

.countdown-badge--critical {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
  background: rgba(239, 68, 68, 0.18);
  animation: urgentPulse 2s ease-in-out infinite;
}

/* ── Filter toolbar archivadas ── */
.filter-toolbar--archivadas {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

/* ── Empty state clear filters button ── */
.empty-state__clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-cyan);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.24s ease;
}

.empty-state__clear-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(125, 211, 252, 0.3);
  transform: translateY(-1px);
}

.empty-state__clear-btn [data-lucide] {
  width: 0.9rem;
  height: 0.9rem;
}

/* ── Keyboard shortcut hint ── */
.kbd-hint {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .kbd-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.35rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.18);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    margin-left: 0.35rem;
    vertical-align: middle;
  }
}

/* ── Pagination ── */
.pagination-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem 1.5rem;
  background: var(--card-bg-light);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  backdrop-filter: blur(12px);
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pagination-info__total {
  opacity: 0.7;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 8px;
  color: var(--text-muted);
  transition: all 0.2s ease;
  text-decoration: none;
  min-width: 2rem;
  justify-content: center;
}

.pagination-btn:hover {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
}

.pagination-btn--current {
  background: var(--accent-cyan);
  color: var(--bg-color);
  font-weight: 700;
  pointer-events: none;
}

.pagination-ellipsis {
  padding: 0.4rem 0.3rem;
  color: var(--text-muted);
  opacity: 0.5;
  font-size: 0.85rem;
}
