:root {
  --pscp-bg: #eef2f7;
  --pscp-bg-accent: radial-gradient(1200px 600px at 10% -10%, rgba(30, 79, 216, 0.12), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(14, 165, 164, 0.1), transparent 50%),
    #eef2f7;
  --pscp-primary: #1e4fd8;
  --pscp-primary-hover: #163ea8;
  --pscp-accent: #0d9488;
  --pscp-surface: #ffffff;
  --pscp-surface-muted: #f8fafc;
  --pscp-border: #e2e8f0;
  --pscp-text: #0f172a;
  --pscp-muted: #475569;
  --pscp-radius: 16px;
  --pscp-radius-sm: 10px;
  --pscp-shadow: 0 4px 24px rgba(15, 23, 42, 0.07);
  --pscp-shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
  --pscp-header-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--pscp-bg-accent);
  color: var(--pscp-text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--pscp-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.app-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--pscp-text);
  font-weight: 700;
  font-size: 1rem;
  min-width: 0;
}

.app-brand-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: block;
}

.login-brand-logo {
  max-width: 200px;
  height: auto;
  display: inline-block;
}

.app-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--pscp-primary), var(--pscp-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.app-brand-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-brand-text small {
  display: block;
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--pscp-muted);
  line-height: 1.2;
}

.app-brand-text .app-slogan {
  font-weight: 600;
  font-style: italic;
  color: var(--pscp-primary);
  opacity: 0.9;
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

.lang-switch a {
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--pscp-muted);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.lang-switch a:hover {
  color: var(--pscp-primary);
  background: rgba(30, 79, 216, 0.06);
}

.lang-switch a.active {
  color: var(--pscp-primary);
  font-weight: 600;
  background: rgba(30, 79, 216, 0.1);
  border-color: rgba(30, 79, 216, 0.2);
}

.app-nav-wrap {
  border-top: 1px solid rgba(226, 232, 240, 0.7);
}

.app-nav-toggle {
  border: 1px solid var(--pscp-border);
  background: var(--pscp-surface);
  color: var(--pscp-text);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  line-height: 1.2;
  flex-shrink: 0;
}

.app-nav-toggle[aria-expanded="true"] {
  background: rgba(30, 79, 216, 0.1);
  border-color: rgba(30, 79, 216, 0.25);
  color: var(--pscp-primary);
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.45rem 1rem;
  padding: 0.45rem 1rem 0.6rem;
  max-width: 1400px;
  margin: 0 auto;
}

.app-nav-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.45rem;
  min-width: 0;
}

.app-nav-group-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pscp-muted);
  white-space: nowrap;
  padding: 0.15rem 0.25rem;
}

.app-nav-group-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.cpv-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cpv-subnav-link {
  display: inline-flex;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--pscp-muted);
  border: 1px solid var(--pscp-border, #e2e8f0);
  background: #fff;
}

.cpv-subnav-link:hover {
  color: var(--pscp-text);
  border-color: #cbd5e1;
}

.cpv-subnav-link.is-active {
  color: var(--pscp-primary, #1e4fd8);
  border-color: rgba(30, 79, 216, 0.35);
  background: rgba(30, 79, 216, 0.06);
}

.app-nav-break {
  flex-basis: 100%;
  width: 0;
  height: 0;
  overflow: hidden;
}

.app-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--pscp-muted);
  white-space: nowrap;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.app-nav a:hover {
  color: var(--pscp-primary);
  background: rgba(30, 79, 216, 0.06);
}

.app-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--pscp-primary), #2563eb);
  box-shadow: 0 4px 12px rgba(30, 79, 216, 0.35);
}

.app-nav-ai-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.4rem;
  padding: 0.05rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--pscp-primary);
  background: rgba(30, 79, 216, 0.12);
  border: 1px solid rgba(30, 79, 216, 0.2);
}

.app-nav a.active .app-nav-ai-tag {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
}

.ai-credits-banner {
  border: 1px solid rgba(30, 79, 216, 0.2);
  background: linear-gradient(135deg, rgba(30, 79, 216, 0.06), rgba(37, 99, 235, 0.03));
  color: var(--pscp-text);
}

.ai-credits-banner--admin {
  border-color: rgba(15, 23, 42, 0.15);
  background: rgba(15, 23, 42, 0.04);
}

.ai-credits-balance {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.app-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #ef4444;
}

.app-nav a.active .app-nav-badge {
  background: #fff;
  color: #ef4444;
}

.admin-log-workbench {
  position: relative;
  overflow: hidden;
}

.admin-log-actions,
.admin-log-toolbar,
.admin-log-toggle-group {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem;
}

.admin-log-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.85rem;
  background: rgba(248, 250, 252, 0.96);
  backdrop-filter: blur(8px);
}

.admin-log-toolbar > div:first-child {
  min-width: min(100%, 20rem);
  flex: 1 1 20rem;
}

.admin-log-toolbar > div:nth-child(2) {
  min-width: min(100%, 18rem);
  flex: 1 1 18rem;
}

.admin-log-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.admin-log-pill {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  min-width: 11rem;
  max-width: 16rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 0.75rem;
  color: #334155;
  background: #fff;
  text-decoration: none;
}

.admin-log-pill span {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-log-pill small {
  color: #64748b;
}

.admin-log-pill.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--pscp-primary), #2563eb);
}

.admin-log-pill.active small {
  color: rgba(255, 255, 255, 0.78);
}

.admin-log-frame {
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 0.95rem;
  background: #0f172a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.admin-log-pre {
  max-height: min(72vh, 820px);
  min-height: 460px;
  overflow: auto;
  padding: 1rem;
  color: #dbeafe;
  background: transparent;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.45;
  tab-size: 2;
}

.admin-log-pre.no-wrap {
  white-space: pre;
  word-break: normal;
}

.nav-link .app-nav-ai-tag {
  margin-left: 0.35rem;
}

.app-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.page-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e4fd8 45%, #0d9488 100%);
  color: #fff;
  border-radius: var(--pscp-radius);
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--pscp-shadow-lg);
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15), transparent 40%);
  pointer-events: none;
}

.page-hero > * { position: relative; z-index: 1; }

.page-hero h1 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.page-hero .lead {
  opacity: 0.9;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.page-hero .page-slogan {
  font-size: 1.05rem;
  font-weight: 600;
  font-style: italic;
  opacity: 0.95;
  margin-bottom: 0.75rem;
}

.page-hero .stats {
  font-size: 0.85rem;
  opacity: 0.85;
}

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card, .pscp-card {
  background: var(--pscp-surface);
  border: 1px solid var(--pscp-border);
  border-radius: var(--pscp-radius);
  box-shadow: var(--pscp-shadow);
}

.card { border: 1px solid var(--pscp-border); box-shadow: var(--pscp-shadow); border-radius: var(--pscp-radius); }

.card-body { padding: 1.25rem 1.35rem; }

@media (min-width: 768px) {
  .card-body { padding: 1.5rem 1.65rem; }
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pscp-muted);
  margin-bottom: 0.35rem;
}

.form-control, .form-select {
  border-radius: var(--pscp-radius-sm);
  border-color: var(--pscp-border);
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--pscp-primary);
  box-shadow: 0 0 0 3px rgba(30, 79, 216, 0.15);
}

.form-text { font-size: 0.78rem; color: var(--pscp-muted); }

.btn {
  border-radius: var(--pscp-radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  transition: all 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--pscp-primary), #2563eb);
  border: none;
  box-shadow: 0 2px 8px rgba(30, 79, 216, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--pscp-primary-hover), #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 79, 216, 0.35);
}

.btn-outline-primary {
  border-color: rgba(30, 79, 216, 0.4);
  color: var(--pscp-primary);
}

.btn-outline-primary:hover {
  background: rgba(30, 79, 216, 0.08);
  border-color: var(--pscp-primary);
  color: var(--pscp-primary-hover);
}

.btn-outline-secondary {
  border-color: var(--pscp-border);
  color: var(--pscp-muted);
}

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8125rem; }

.table {
  --bs-table-bg: transparent;
  font-size: 0.875rem;
}

.table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pscp-muted);
  border-bottom-width: 1px;
  padding: 0.75rem 0.65rem;
  white-space: nowrap;
}

.table tbody td {
  padding: 0.85rem 0.65rem;
  vertical-align: middle;
  border-color: var(--pscp-border);
}

.table-hover tbody tr:hover {
  background: rgba(30, 79, 216, 0.03);
}

.table-responsive {
  border-radius: var(--pscp-radius-sm);
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.badge { font-weight: 600; border-radius: 6px; }

.badge-soft, .badge.text-bg-secondary.badge-soft {
  background: rgba(30, 79, 216, 0.1) !important;
  color: var(--pscp-primary) !important;
}

.text-bg-info { background: rgba(13, 148, 136, 0.15) !important; color: #0f766e !important; }

.muted-small, .text-muted.small { font-size: 0.8125rem; color: var(--pscp-muted) !important; }

.origin-badges .badge {
  font-size: 0.68rem;
  padding: 0.2rem 0.45rem;
  line-height: 1.15;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.filter-panel {
  background: var(--pscp-surface);
  border: 1px solid var(--pscp-border);
  border-radius: var(--pscp-radius);
  box-shadow: var(--pscp-shadow);
  margin-bottom: 1.25rem;
}

.filter-panel .card-body { padding: 1.25rem; }

.compare-bar {
  position: sticky;
  top: calc(var(--pscp-header-h) + 0.5rem);
  z-index: 1020;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--pscp-border);
  border-radius: var(--pscp-radius-sm);
  box-shadow: var(--pscp-shadow);
  margin-bottom: 1rem;
}

.pick-cell { width: 52px; text-align: center; }
.pick-cell input { transform: scale(1.15); cursor: pointer; }
tr.is-selected { background: rgba(30, 79, 216, 0.06) !important; }

.req-text { white-space: pre-wrap; font-size: 0.875rem; }

.valuation-criteria-table .valuation-criteria-subrow td {
  border-top-style: dashed;
}
.valuation-criteria-table .valuation-criteria-subrow td:not([rowspan]) {
  background: rgba(30, 79, 216, 0.03);
}

#organ_suggest, #cpv-suggest {
  max-height: 280px;
  overflow: auto;
  z-index: 1050;
  border-radius: var(--pscp-radius-sm);
  border: 1px solid var(--pscp-border);
  box-shadow: var(--pscp-shadow-lg);
}

#organ_suggest .list-group-item,
#cpv-suggest .list-group-item {
  border-color: var(--pscp-border);
  font-size: 0.875rem;
}

#organ_suggest .list-group-item:hover,
#cpv-suggest .list-group-item:hover {
  background: rgba(30, 79, 216, 0.06);
}

.cpv-mono, .font-monospace { font-family: "JetBrains Mono", ui-monospace, monospace; }

.loading-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  backdrop-filter: blur(4px);
}

.loading-overlay.show { display: flex; }

.loading-card {
  background: #fff;
  border-radius: var(--pscp-radius);
  padding: 1.35rem 1.5rem;
  min-width: min(320px, 90vw);
  box-shadow: var(--pscp-shadow-lg);
  border: 1px solid var(--pscp-border);
}

.loading-spin {
  width: 28px;
  height: 28px;
  border: 3px solid #dbeafe;
  border-top-color: var(--pscp-primary);
  border-radius: 50%;
  animation: pscp-spin 0.8s linear infinite;
  flex-shrink: 0;
}

.loading-overlay-message {
  min-height: 1.25rem;
  transition: opacity 0.25s ease;
}

.loading-overlay-message--pulse {
  animation: loading-overlay-fade 0.45s ease;
}

.loading-overlay--offer .loading-card,
.loading-overlay--nl .loading-card,
.loading-overlay--pliego .loading-card {
  min-width: min(380px, 92vw);
}

.loading-overlay--offer #loadingOverlayTitle,
.loading-overlay--nl #loadingOverlayTitle,
.loading-overlay--pliego #loadingOverlayTitle {
  color: var(--pscp-primary);
}

.pliego-thinking-modal {
  position: fixed;
  inset: 0;
  z-index: 5100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pliego-thinking-modal[hidden] {
  display: none !important;
}

.pliego-thinking-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(5px);
}

.pliego-thinking-modal__card {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  background: #fff;
  border-radius: var(--pscp-radius);
  border: 1px solid var(--pscp-border);
  box-shadow: var(--pscp-shadow-lg);
  padding: 1.5rem 1.35rem 1.25rem;
  text-align: left;
}

.pliego-thinking-modal__icon {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.pliego-thinking-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pscp-primary);
  animation: pliego-thinking-bounce 1.2s ease-in-out infinite;
}

.pliego-thinking-dot:nth-child(2) { animation-delay: 0.15s; }
.pliego-thinking-dot:nth-child(3) { animation-delay: 0.3s; }

.pliego-thinking-modal__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pscp-primary);
  margin: 0 0 0.25rem;
  text-align: center;
}

.pliego-thinking-modal__subtitle {
  font-size: 0.95rem;
  color: var(--pscp-text-muted, #475569);
  margin: 0 0 1rem;
  text-align: center;
}

.pliego-thinking-modal__progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.pliego-thinking-modal__progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--pscp-primary), #3b82f6);
  border-radius: 999px;
  transition: width 0.55s ease;
}

.pliego-thinking-modal__step {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--pscp-text, #1e293b);
  margin: 0 0 0.85rem;
  min-height: 1.35rem;
  text-align: center;
}

.pliego-thinking-modal__steps {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--pscp-border);
  border-radius: calc(var(--pscp-radius) - 2px);
  background: #f8fafc;
}

.pliego-thinking-modal__steps-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  line-height: 1.35;
  border-bottom: 1px solid #e2e8f0;
}

.pliego-thinking-modal__steps-item:last-child {
  border-bottom: none;
}

.pliego-thinking-modal__steps-item.is-done {
  color: #64748b;
}

.pliego-thinking-modal__steps-item.is-done .pliego-thinking-modal__steps-icon {
  color: #16a34a;
}

.pliego-thinking-modal__steps-item.is-active {
  background: #eff6ff;
  color: var(--pscp-primary);
  font-weight: 600;
}

.pliego-thinking-modal__steps-item.is-active .pliego-thinking-modal__steps-icon {
  color: var(--pscp-primary);
}

.pliego-thinking-modal__steps-item.is-pending {
  color: #475569;
}

.pliego-thinking-modal__steps-icon {
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.35;
}

.pliego-thinking-modal__steps-label {
  flex: 1;
}

.pliego-thinking-modal__step--pulse {
  animation: loading-overlay-fade 0.45s ease;
}

.pliego-thinking-modal__hint {
  font-size: 0.78rem;
  color: var(--pscp-text-muted, #475569);
  margin: 0;
  text-align: center;
}

body.pliego-thinking-modal-open {
  overflow: hidden;
}

.pliego-clauses-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pliego-clauses-modal[hidden] {
  display: none !important;
}

.pliego-clauses-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.pliego-clauses-modal__card {
  position: relative;
  width: min(920px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: var(--pscp-surface, #fff);
  border: 1px solid var(--pscp-border, #dee2e6);
  border-radius: 0.75rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  padding: 1rem 1.1rem 1.2rem;
}

.pliego-clauses-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.pliego-clauses-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
}

.pliego-clauses-source {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  margin: 0;
}

.pliego-clauses-list {
  display: grid;
  gap: 0.75rem;
}

.pliego-clause-card {
  border: 1px solid var(--pscp-border, #dee2e6);
  border-radius: 0.55rem;
  padding: 0.75rem 0.85rem;
  background: rgba(0, 0, 0, 0.015);
}

.pliego-clause-card__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 0.35rem;
}

.pliego-clause-card__organ {
  font-weight: 600;
  font-size: 0.92rem;
}

.pliego-clause-card__tender {
  font-size: 0.85rem;
  color: var(--bs-secondary-color, #64748b);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.pliego-clause-card__file {
  margin-bottom: 0.35rem;
}

.pliego-clauses-summary {
  padding: 0.45rem 0.65rem;
  background: #f8fafc;
  border: 1px solid var(--pscp-border, #e5e7eb);
  border-radius: 0.375rem;
}

.pliego-clause-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  font-size: 0.78rem;
  color: var(--pscp-muted, #6c757d);
  margin-top: 0.15rem;
}

.pliego-clause-card__title {
  font-size: 0.92rem;
  margin: 0 0 0.35rem;
}

.pliego-clause-card__preview {
  font-size: 0.82rem;
  color: var(--pscp-muted, #6c757d);
  white-space: pre-wrap;
  margin: 0 0 0.55rem;
}

.pliego-clause-card__actions {
  display: flex;
  gap: 0.45rem;
}

body.pliego-clauses-modal-open {
  overflow: hidden;
}

.pliego-cpv-modal-item:last-child {
  border-bottom: none !important;
}

.pliego-cpv-modal .pliego-clauses-modal__card {
  width: min(720px, 100%);
}

@keyframes pliego-thinking-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-6px); opacity: 1; }
}

@keyframes loading-overlay-fade {
  from { opacity: 0.35; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

.value { font-weight: 500; }

.doc-list a { word-break: break-all; }

.detail-grid .card { height: 100%; }

.lcsp-article-btn {
  border: 0;
  cursor: pointer;
  font-size: inherit;
  line-height: inherit;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.lcsp-article-btn:hover,
.lcsp-article-btn:focus {
  filter: brightness(0.95);
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 1px;
}

.pliego-clause-link {
  border: 0;
  cursor: pointer;
  font-size: inherit;
  line-height: inherit;
  color: var(--bs-link-color);
  text-decoration: underline;
  text-underline-offset: 2px;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.pliego-clause-link:hover,
.pliego-clause-link:focus {
  color: var(--bs-link-hover-color);
}

.bidder-history-link {
  border: 0;
  cursor: pointer;
  font-size: inherit;
  line-height: inherit;
  color: var(--bs-link-color);
  text-decoration: underline;
  text-underline-offset: 2px;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.bidder-history-link:hover,
.bidder-history-link:focus {
  color: var(--bs-link-hover-color);
}

.pliego-clause-text {
  white-space: pre-wrap;
  font-size: 0.92rem;
  line-height: 1.55;
}

.lcsp-article-text,
.lcsp-article-excerpt {
  white-space: pre-wrap;
  font-size: 0.92rem;
  line-height: 1.55;
  max-height: 50vh;
  overflow: auto;
}

.tribunal-lcsp-top-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tribunal-lcsp-top-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.tribunal-lcsp-top-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.tribunal-lcsp-top-item-title {
  display: block;
  line-height: 1.35;
}

.tribunal-lcsp-top-count {
  flex-shrink: 0;
}

.tribunal-lcsp-top-count:hover {
  filter: brightness(0.92);
}

#tribunal-results {
  scroll-margin-top: calc(var(--pscp-header-h, 64px) + 1rem);
}

.tribunal-recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tribunal-recent-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--pscp-border, #e5e7eb);
}

.tribunal-recent-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.tribunal-recent-item-main {
  min-width: 0;
}

.xml {
  white-space: pre-wrap;
  max-height: 420px;
  overflow: auto;
  background: #101828;
  color: #e8eefc;
  border-radius: var(--pscp-radius);
  padding: 1rem;
  font-size: 0.8rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

@media (max-width: 767.98px) {
  .app-header-top { padding: 0.55rem 0.75rem; flex-wrap: wrap; }
  .app-brand-text span { display: none; }
  .app-main { padding: 1rem 0.75rem 2rem; }
  .app-nav-wrap {
    display: none;
    background: rgba(255, 255, 255, 0.98);
  }
  .app-nav-wrap.is-open {
    display: block;
  }
  .app-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 0.65rem 0.75rem 0.85rem;
  }
  .app-nav-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }
  .app-nav-group-label {
    padding: 0 0.15rem;
  }
  .app-nav-group-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
  }
  .app-nav a {
    justify-content: flex-start;
    border-radius: var(--pscp-radius-sm);
  }
  .offer-analysis-tab-select {
    font-size: 0.92rem;
  }
  .offer-analysis-panel[hidden] {
    display: none !important;
  }
  .page-hero { padding: 1.25rem 1rem; border-radius: 12px; }
  .filter-panel .row > [class*="col-"] { margin-bottom: 0; }
  .table thead { display: none; }
  .table tbody tr {
    display: block;
    border: 1px solid var(--pscp-border);
    border-radius: var(--pscp-radius-sm);
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--pscp-surface);
  }
  .table tbody td {
    display: block;
    border: none;
    padding: 0.25rem 0;
    text-align: left !important;
  }
  .table tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--pscp-muted);
    margin-bottom: 0.15rem;
  }
  .table tbody td:last-child {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--pscp-border);
  }
  .table tbody td:last-child::before { display: none; }
  .pick-cell { width: auto; text-align: left; margin-bottom: 0.5rem; }
}

@media (min-width: 768px) {
  :root { --pscp-header-h: 112px; }

  .app-nav a {
    font-size: 0.8rem;
    padding: 0.4rem 0.78rem;
  }
}

@media (min-width: 1200px) {
  :root { --pscp-header-h: 104px; }

  .app-nav {
    gap: 0.32rem 0.4rem;
  }

  .app-nav a {
    font-size: 0.8125rem;
    padding: 0.42rem 0.82rem;
  }
}

.page-hero--compact {
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}

.page-hero--compact .page-slogan {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.home-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  max-height: 11.5rem;
  overflow-y: auto;
  padding-bottom: 0.15rem;
}

.home-stat-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  background: var(--pscp-surface);
  border: 1px solid var(--pscp-border);
  box-shadow: var(--pscp-shadow);
  min-width: 5.5rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.home-stat-chip--link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  border-color: color-mix(in srgb, var(--chip-accent, var(--pscp-primary)) 35%, var(--pscp-border));
}

.home-stat-chip.is-active {
  border-color: var(--chip-accent, var(--pscp-primary));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--chip-accent, var(--pscp-primary)) 18%, transparent);
  background: color-mix(in srgb, var(--chip-accent, var(--pscp-primary)) 6%, var(--pscp-surface));
}

.home-stat-chip.is-active .home-stat-value {
  color: var(--chip-accent, var(--pscp-primary));
}

.home-stat-chip.muted .home-stat-value {
  font-size: 1rem;
  color: var(--pscp-text);
}

.home-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--pscp-primary);
  line-height: 1.1;
}

.home-stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pscp-muted);
}

.home-stat-hint {
  font-size: 0.62rem;
  color: var(--pscp-muted);
  line-height: 1.2;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.dash-kpi-help {
  max-width: 52rem;
  line-height: 1.45;
}

.dash-source-hero {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--pscp-radius) + 4px);
  border: 1px solid color-mix(in srgb, var(--dash-accent) 28%, var(--pscp-border));
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--dash-accent) 14%, var(--pscp-surface)) 0%,
    var(--pscp-surface) 55%,
    color-mix(in srgb, var(--dash-accent) 8%, var(--pscp-surface-muted)) 100%
  );
}

.dash-source-hero-glow {
  position: absolute;
  inset: -40% auto auto -10%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--dash-accent) 35%, transparent), transparent 70%);
  pointer-events: none;
}

.dash-source-hero-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
}

.dash-source-hero-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dash-accent);
  margin-bottom: 0.25rem;
}

.dash-source-hero-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dash-source-hero-sub {
  color: var(--pscp-muted);
  font-size: 0.92rem;
}

.dash-source-hero-clear {
  flex-shrink: 0;
  font-weight: 700;
}

.dash-card--filtered {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.dash-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--pscp-surface);
  border: 1px solid var(--pscp-border);
  border-radius: var(--pscp-radius);
  box-shadow: var(--pscp-shadow);
  overflow: hidden;
}

.dash-card--today { border-top: 4px solid #2563eb; }
.dash-card--deadline { border-top: 4px solid #ea580c; }
.dash-card--latest { border-top: 4px solid #0d9488; }

.dash-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.75rem;
}

.dash-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--pscp-surface-muted);
  flex-shrink: 0;
}

.dash-card--today .dash-card-icon { background: rgba(37, 99, 235, 0.1); }
.dash-card--deadline .dash-card-icon { background: rgba(234, 88, 12, 0.1); }
.dash-card--latest .dash-card-icon { background: rgba(13, 148, 136, 0.1); }

.dash-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
  letter-spacing: -0.01em;
}

.dash-card-sub {
  font-size: 0.78rem;
  color: var(--pscp-muted);
}

.cpv-family-cell .cpv-mono {
  text-decoration: none;
}
.cpv-family-cell .cpv-mono:hover {
  text-decoration: underline;
}

.dash-card-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--pscp-text);
}

.dash-card-body {
  padding: 0 1.1rem;
  flex: 1 1 auto;
}

.dash-card-footer {
  padding: 0.75rem 1.1rem 1rem;
  border-top: 1px solid var(--pscp-border);
  background: var(--pscp-surface-muted);
}

.dash-card-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--pscp-primary);
  text-decoration: none;
}

.dash-card-link:hover {
  color: var(--pscp-primary-hover);
  text-decoration: underline;
}

.dash-tender-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dash-tender-item {
  border-radius: 10px;
  transition: background 0.15s ease;
}

.dash-tender-item:hover {
  background: rgba(30, 79, 216, 0.04);
}

.dash-tender-link {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.1rem 0.75rem;
  padding: 0.55rem 0.45rem;
  text-decoration: none;
  color: inherit;
}

.dash-tender-title {
  grid-column: 1;
  grid-row: 1;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--pscp-text);
}

.dash-tender-meta {
  grid-column: 1;
  grid-row: 2;
  font-size: 0.72rem;
  color: var(--pscp-muted);
  line-height: 1.3;
}

.dash-tender-amount {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pscp-accent);
  white-space: nowrap;
}

.dash-empty {
  font-size: 0.85rem;
  color: var(--pscp-muted);
  padding: 0.5rem 0 0.75rem;
}

/* —— Dashboard tipo Bid —— */
.bid-dashboard {
  margin-bottom: 1.5rem;
}

.bid-dashboard-greeting {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
}

.bid-dashboard-sub {
  margin: 0;
  color: var(--pscp-muted);
  font-size: 0.95rem;
}

.bid-smart-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.25rem 0 1rem;
  padding: 0.35rem 0.35rem 0.35rem 1rem;
  background: var(--pscp-surface);
  border: 1px solid var(--pscp-border);
  border-radius: 999px;
  box-shadow: var(--pscp-shadow);
}

.bid-smart-search-icon {
  color: #8b5cf6;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.bid-smart-search-input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 1rem;
  padding: 0.65rem 0;
  outline: none;
  min-width: 0;
}

.bid-smart-search-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.bid-smart-search-btn:hover {
  filter: brightness(1.05);
}

.bid-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.bid-workspace-quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.bid-workspace-quick--page {
  margin-bottom: 1.5rem;
}

.bid-workspace-quick-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: var(--pscp-radius);
  border: 1px solid var(--pscp-border);
  background: var(--pscp-surface);
  box-shadow: var(--pscp-shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.bid-workspace-quick-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 8px 24px rgba(30, 79, 216, 0.1);
  transform: translateY(-1px);
  color: inherit;
}

.bid-workspace-quick-card.is-active {
  border-color: rgba(30, 79, 216, 0.45);
  box-shadow: 0 0 0 3px rgba(30, 79, 216, 0.12);
}

.bid-workspace-quick-card--favorites .bid-workspace-quick-icon {
  color: #e11d48;
  background: rgba(225, 29, 72, 0.1);
}

.bid-workspace-quick-card--projects .bid-workspace-quick-icon {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
}

.bid-workspace-quick-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  font-size: 1.15rem;
}

.bid-workspace-quick-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.bid-workspace-quick-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
}

.bid-workspace-quick-meta {
  font-size: 0.78rem;
  color: var(--pscp-muted);
  line-height: 1.35;
}

.bid-workspace-quick-count {
  flex-shrink: 0;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: #1e4fd8;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-nav-badge--soft {
  background: rgba(30, 79, 216, 0.12);
  color: #1e4fd8;
}

.user-workspace-hero .lead {
  max-width: 42rem;
}

@media (max-width: 767px) {
  .bid-workspace-quick {
    grid-template-columns: minmax(0, 1fr);
  }
}

.bid-filter-tab {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--pscp-border);
  background: var(--pscp-surface);
  color: var(--pscp-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.bid-filter-tab:hover {
  border-color: #c7d2fe;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

.bid-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 991px) {
  .bid-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .bid-kpi-grid { grid-template-columns: minmax(0, 1fr); }
}

.bid-kpi-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.1rem 1.15rem;
  background: var(--pscp-surface);
  border: 1px solid var(--pscp-border);
  border-radius: var(--pscp-radius);
  box-shadow: var(--pscp-shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}

.bid-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--pscp-shadow-lg);
  color: inherit;
}

.bid-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  background: var(--pscp-surface-muted) center/22px no-repeat;
}

.bid-kpi-icon--doc { background-color: #eff6ff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%233b82f6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'/%3E%3C/svg%3E"); }
.bid-kpi-icon--award { background-color: #ecfdf5; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2322c55e'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z'/%3E%3C/svg%3E"); }
.bid-kpi-icon--clock { background-color: #fffbeb; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23f59e0b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E"); }
.bid-kpi-icon--today { background-color: #f5f3ff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238b5cf6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'/%3E%3C/svg%3E"); }

.bid-kpi-label {
  font-size: 0.8rem;
  color: var(--pscp-muted);
  margin-bottom: 0.15rem;
}

.bid-kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.bid-kpi-delta {
  font-size: 0.75rem;
  color: #16a34a;
  margin-top: 0.35rem;
}

.bid-panel {
  background: var(--pscp-surface);
  border: 1px solid var(--pscp-border);
  border-radius: var(--pscp-radius);
  box-shadow: var(--pscp-shadow);
  padding: 1.15rem 1.25rem;
  min-height: 0;
}

.bid-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.bid-panel-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.bid-panel-meta {
  font-size: 0.8rem;
  color: var(--pscp-muted);
}

.bid-chart-wrap {
  position: relative;
  height: 220px;
  min-height: 220px;
  width: 100%;
}

.bid-chart-wrap--tribunal {
  height: 240px;
  min-height: 240px;
}

.bid-chart-wrap canvas,
.bid-donut-wrap canvas {
  display: block;
  max-width: 100%;
}

.bid-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--pscp-muted);
}

.bid-legend-item strong {
  color: var(--pscp-text);
  margin-right: 0.35rem;
}

.bid-legend-item--pub strong { color: #3b82f6; }
.bid-legend-item--adj strong { color: #22c55e; }
.bid-legend-item--tribunal-res strong { color: #6366f1; }
.bid-legend-item--tribunal-parse strong { color: #f97316; }
.bid-legend-item--tribunal-link strong { color: #14b8a6; }

.bid-tribunal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
  gap: 1.25rem;
  align-items: stretch;
}

.bid-tribunal-stats {
  display: grid;
  gap: 0.75rem;
}

.bid-tribunal-stats > div,
.bid-tribunal-stats > a.bid-tribunal-stat-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.85rem;
  background: rgba(248, 250, 252, 0.78);
}

.bid-tribunal-stats > a.bid-tribunal-stat-link {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.bid-tribunal-stats > a.bid-tribunal-stat-link:hover,
.bid-tribunal-stats > a.bid-tribunal-stat-link:focus-visible {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(238, 242, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

a.bid-tribunal-filter-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: 0.35rem;
  transition: background-color 0.15s ease;
}

a.bid-tribunal-filter-link:hover,
a.bid-tribunal-filter-link:focus-visible {
  background: rgba(148, 163, 184, 0.12);
}

.bid-tribunal-stats span {
  color: var(--pscp-text);
  font-size: 1.35rem;
  font-weight: 750;
  line-height: 1.1;
}

.bid-tribunal-stats small {
  margin-top: 0.25rem;
  color: var(--pscp-muted);
  font-size: 0.78rem;
}

.bid-donut-wrap {
  position: relative;
  height: 200px;
  min-height: 200px;
  width: 100%;
  margin-bottom: 1rem;
}

.bid-donut-center {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}

.bid-donut-value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.bid-donut-label {
  font-size: 0.7rem;
  color: var(--pscp-muted);
  max-width: 6rem;
}

.bid-source-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  border-top: 1px solid var(--pscp-border);
}

.bid-source-list li:first-child { border-top: 0; }

.bid-source-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bid-source-name { flex: 1; color: var(--pscp-muted); }
.bid-source-count { font-weight: 600; }

.home-dashboard--compact .home-stat-row,
.home-dashboard--compact .dash-kpi-help,
.home-dashboard--compact .dash-source-hero {
  display: none;
}

.bid-panel-link {
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--pscp-primary);
}

.bid-pipeline-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 1rem;
  align-items: center;
}

.bid-panel--stacked {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-height: 100%;
}

.bid-panel-block--grow {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.bid-panel-head--compact {
  margin-bottom: 0.65rem;
}

.bid-panel-head--compact .bid-panel-title {
  font-size: 1rem;
}

.bid-pipeline-legend--compact li {
  padding: 0.28rem 0;
}

.bid-regions-vertical {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.2rem;
  max-height: 26rem;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.bid-region-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.42rem 0.45rem;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}

.bid-region-row:hover {
  background: rgba(15, 23, 42, 0.04);
  color: inherit;
}

.bid-region-row .bid-source-dot {
  background: var(--region-accent, #334155);
}

.bid-region-row__main {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.bid-region-row__label {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bid-region-row__track {
  height: 5px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.bid-region-row__fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--region-accent, #334155);
  opacity: 0.82;
}

.bid-region-row__count {
  font-size: 0.8rem;
  font-weight: 700;
  min-width: 4.75rem;
  text-align: right;
  color: var(--region-accent, #334155);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 575px) {
  .bid-pipeline-layout { grid-template-columns: minmax(0, 1fr); }
  .bid-regions-vertical { max-height: none; }
}

.bid-donut-wrap--sm {
  height: 180px;
  min-height: 180px;
}

/* Filas Bootstrap: altura uniforme en Safari */
.bid-panels.row {
  align-items: stretch;
}

.bid-panels.row > [class*="col-"] {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bid-panels.row .bid-panel {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

.bid-panel--regions .bid-panel-head {
  align-items: flex-start;
}

.bid-regions-help {
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: var(--bs-secondary-color, #64748b);
  max-width: 42rem;
}

.bid-regions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.65rem;
}

.bid-region-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 4.5rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-left: 3px solid var(--region-accent, #334155);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.bid-region-card:hover {
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
  color: inherit;
}

.bid-region-count {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--region-accent, #334155);
}

.bid-region-label {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  color: #334155;
}

.bid-smart-search-input {
  -webkit-appearance: none;
  appearance: none;
}

.bid-pipeline-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.82rem;
}

.bid-pipeline-label { flex: 1; color: var(--pscp-muted); }
.bid-pipeline-count { font-weight: 600; min-width: 4.5rem; text-align: right; }

.bid-recent-list { display: flex; flex-direction: column; gap: 0.35rem; }

.bid-recent-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.65rem 0.5rem;
  border-radius: var(--pscp-radius-sm);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}

.bid-recent-main {
  min-width: 0;
  overflow: hidden;
}

.bid-recent-title,
.bid-recent-organ {
  overflow: hidden;
  text-overflow: ellipsis;
}

.bid-recent-link:hover {
  background: var(--pscp-surface-muted);
  color: inherit;
}

.bid-status-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
  margin-top: 0.15rem;
}

.bid-status-pill--success { background: #dcfce7; color: #166534; }
.bid-status-pill--primary { background: #dbeafe; color: #1e40af; }
.bid-status-pill--warning { background: #fef3c7; color: #92400e; }
.bid-status-pill--danger { background: #fee2e2; color: #991b1b; }
.bid-status-pill--muted { background: #f1f5f9; color: #475569; }

.organ-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.organ-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  text-decoration: none;
  white-space: nowrap;
}

.organ-badge--link {
  background: #dbeafe;
  color: #1d4ed8;
}

.organ-badge--link:hover {
  background: #bfdbfe;
  color: #1e3a8a;
}

.organ-badge--region {
  background: #ede9fe;
  color: #5b21b6;
}

.organ-badge--location {
  background: #fef3c7;
  color: #92400e;
}

.organ-badge--platform {
  background: #cffafe;
  color: #0e7490;
}

.organ-badge--muted {
  background: #f1f5f9;
  color: #64748b;
  font-weight: 500;
}

.organ-badge--warning {
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
}

.elected-official-alert {
  margin-top: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #78350f;
  font-size: 0.875rem;
}

.elected-official-alert__title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.elected-official-alert__list {
  margin: 0;
  padding-left: 1.1rem;
}

.elected-official-alert__list li {
  margin: 0.15rem 0;
}

.elected-official-detail-banner {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #78350f;
}

.tender-detail-organ .organ-badges {
  margin-top: 0.35rem;
}

.organ-badges--compact {
  margin-top: 0.25rem;
  max-width: 18rem;
}

.offer-competition-table td:first-child {
  min-width: 10rem;
  max-width: 20rem;
}

.offer-competition-table .organ-badges--compact .organ-badge {
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
}

.bid-recent-exp {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.bid-recent-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
}

.bid-recent-organ {
  display: block;
  font-size: 0.75rem;
  color: var(--pscp-muted);
  margin-top: 0.1rem;
}

.bid-recent-amount {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pscp-accent);
  white-space: nowrap;
}

.bid-recent-item--favorite {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bid-favorite-notify {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0.5rem 0.35rem 0.5rem;
  font-size: 0.82rem;
  color: var(--pscp-muted);
  cursor: pointer;
  user-select: none;
}

.bid-favorite-notify-input {
  margin: 0;
  cursor: pointer;
}

.bid-favorite-notify-label {
  line-height: 1.2;
}

.bid-insights-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.bid-insight-card {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, #faf5ff 0%, #f8fafc 100%);
  border: 1px solid #e9d5ff;
  border-radius: var(--pscp-radius);
  min-height: 100%;
}

.bid-insight-icon {
  color: #8b5cf6;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.bid-insight-text {
  font-size: 0.88rem;
  color: var(--pscp-text);
  line-height: 1.45;
}

/* —— Buscador (estilo panel comercial) —— */
.search-browser {
  margin-bottom: 2rem;
}

.search-browser-crumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--pscp-muted);
  margin-bottom: 0.75rem;
}

.search-browser-crumb a {
  color: var(--pscp-primary);
  text-decoration: none;
}

.search-browser-crumb a:hover { text-decoration: underline; }

.search-browser-head { margin-bottom: 1rem; }

.search-browser-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-browser-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-browser-results-count {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--pscp-text);
}

.search-browser-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.search-browser-lead {
  font-size: 0.9rem;
  color: var(--pscp-muted);
  margin-top: 0.35rem;
}

.search-browser-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 991px) {
  .search-browser-layout {
    grid-template-columns: 1fr;
  }

  .search-browser-main {
    order: 1;
    min-width: 0;
  }

  .search-browser-sidebar {
    order: 2;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 92vw);
    z-index: 1050;
    max-height: none;
    border-radius: 0;
    border-right: 1px solid var(--pscp-border);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0.22s;
  }

  .search-browser.is-filters-open .search-browser-sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  .search-browser-filters-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15, 23, 42, 0.45);
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
  }

  .search-browser-filters-backdrop[hidden] {
    display: none;
  }

  .search-browser-filters-toggle {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.75rem;
  }

  .search-browser-filters-close {
    display: block;
    flex-shrink: 0;
  }

  .search-browser-sidebar-head-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
  }

  body.search-filters-open {
    overflow: hidden;
  }
}

@media (min-width: 992px) {
  .search-browser-filters-toggle,
  .search-browser-filters-backdrop,
  .search-browser-filters-close {
    display: none;
  }
}

.search-browser-sidebar {
  background: var(--pscp-surface);
  border: 1px solid var(--pscp-border);
  border-radius: var(--pscp-radius);
  box-shadow: var(--pscp-shadow);
  padding: 1rem 1rem 1.1rem;
  position: sticky;
  top: calc(var(--pscp-header-h) + 0.75rem);
  max-height: calc(100vh - var(--pscp-header-h) - 2rem);
  max-height: calc(100dvh - var(--pscp-header-h) - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.search-browser-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.search-browser-sidebar-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
}

.search-browser-clear {
  font-size: 0.78rem;
  color: var(--pscp-primary);
  text-decoration: none;
}

.search-filter-group {
  border-bottom: 1px solid var(--pscp-border);
}

.search-filter-group:last-of-type { border-bottom: none; }

.search-filter-group summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.65rem 0;
  list-style: none;
}

.search-filter-group summary::-webkit-details-marker { display: none; }

.search-filter-group summary::after {
  content: "▾";
  float: right;
  color: var(--pscp-muted);
  font-size: 0.75rem;
}

.search-filter-group[open] summary::after { transform: rotate(180deg); display: inline-block; }

.search-filter-body { padding-bottom: 0.85rem; }

.search-filter-body .form-label {
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
}

.search-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.search-filter-actions { margin-top: 0.75rem; }

.search-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin: 0 0 0.85rem;
}

.search-active-filters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1 1 100%;
  min-width: 0;
  overflow: visible;
}

.search-active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  max-width: 100%;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.04);
  font-size: 0.78rem;
  line-height: 1.3;
}

.search-active-filter-chip--off {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(251, 191, 36, 0.12);
}

.search-active-filter-chip--off .search-active-filter-value {
  color: #b45309;
  font-weight: 700;
}

.search-active-filter-label {
  font-weight: 600;
  color: #475569;
}

.search-active-filter-value {
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16rem;
}

.search-active-filters-clear {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--pscp-primary);
}

.search-active-filters-clear:hover {
  text-decoration: underline;
}

.search-browser-main > .search-active-filters {
  margin-top: -0.35rem;
}

@media (min-width: 992px) {
  .search-browser-main > .search-active-filters {
    margin-top: 0;
    margin-bottom: 0.75rem;
  }
}

.search-browser-query {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--pscp-surface);
  border: 1px solid var(--pscp-border);
  border-radius: 999px;
  padding: 0.35rem 0.5rem 0.35rem 1.1rem;
  box-shadow: var(--pscp-shadow);
  margin-bottom: 1rem;
}

.search-browser-query-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  padding: 0.45rem 0;
  outline: none;
}

.search-browser-query-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--pscp-primary);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

.search-browser-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--pscp-border);
  padding-bottom: 0.5rem;
}

.search-browser-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--pscp-radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--pscp-muted);
  transition: background 0.12s, color 0.12s;
}

.search-browser-tab:hover {
  background: var(--pscp-surface-muted);
  color: var(--pscp-text);
}

.search-browser-tab.is-active {
  background: rgba(30, 79, 216, 0.1);
  color: var(--pscp-primary);
  font-weight: 600;
}

.search-browser-tab-count {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.85;
}

.search-browser-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
}

.search-browser-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-browser-sort-label { margin: 0; min-width: 11rem; }

.search-browser-empty {
  color: var(--pscp-muted);
  padding: 2rem 1rem;
  text-align: center;
}

.search-browser.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.search-browser.is-loading .search-browser-sort-label::after {
  content: '…';
}

.search-result-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.search-result-card {
  background: var(--pscp-surface);
  border: 1px solid var(--pscp-border);
  border-radius: var(--pscp-radius);
  box-shadow: var(--pscp-shadow);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.search-result-card:hover {
  border-color: rgba(30, 79, 216, 0.35);
  box-shadow: var(--pscp-shadow-lg);
}

.search-result-card-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1rem 1.15rem;
}

@media (max-width: 575px) {
  .search-result-card-inner { grid-template-columns: 1fr; }
}

.search-result-card-main { min-width: 0; }

.search-result-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.search-result-card-id {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pscp-muted);
}

.search-result-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.35rem;
}

.search-result-card-title a {
  color: inherit;
  text-decoration: none;
}

.search-result-card-title a:hover {
  color: var(--pscp-primary);
  text-decoration: underline;
}

.search-result-card-awardee {
  font-size: 0.8rem;
  color: var(--pscp-muted);
}

.search-result-card-awardee-label { font-weight: 500; }

.search-result-card-meta,
.search-result-card-deadline {
  font-size: 0.8rem;
  color: var(--pscp-muted);
}

.search-result-card-side {
  text-align: right;
  min-width: 7rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.search-result-card-budget-label {
  font-size: 0.72rem;
  color: var(--pscp-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.search-result-card-budget {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pscp-accent);
}

.search-result-card-cta { margin-top: 0.35rem; }

.search-result-subrows {
  margin-top: 0.65rem;
  padding: 0.55rem 0 0.15rem 0.85rem;
  border-left: 3px solid rgba(30, 79, 216, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.search-result-subrow {
  font-size: 0.78rem;
  line-height: 1.35;
}

.search-result-subrow-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.15rem;
}

.search-result-subrow-lot {
  font-weight: 600;
  color: var(--pscp-text);
}

.search-result-subrow-phase {
  color: var(--pscp-muted);
}

.search-result-subrow-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  color: var(--pscp-muted);
}

.search-result-subrow-amount {
  font-weight: 600;
  color: var(--pscp-accent);
}

.search-result-subrow-link {
  font-size: 0.75rem;
}

/* —— Detalle licitación (estilo panel) —— */
.tender-detail { margin-bottom: 2.5rem; }

.tender-detail-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--pscp-muted);
  margin-bottom: 1rem;
}

.tender-detail-crumb a { color: var(--pscp-primary); text-decoration: none; }
.tender-detail-crumb a:hover { text-decoration: underline; }

.tender-detail-hero {
  position: relative;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--pscp-border);
}

.tender-detail-hero-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.tender-detail-exp {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pscp-muted);
}

.tender-detail-status.bid-status-pill--success {
  background: #0f172a;
  color: #f8fafc;
}

.tender-detail-title {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.tender-resource-alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-left: 0.4rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
  vertical-align: 0.12em;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.28);
}

.tender-resource-floating-tag {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: min(100%, 22rem);
  border: 1px solid rgba(220, 38, 38, 0.28);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: #fff1f2;
  color: #991b1b;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: var(--pscp-shadow-sm);
  cursor: pointer;
}

.tender-resource-floating-tag:hover {
  border-color: rgba(220, 38, 38, 0.45);
  background: #ffe4e6;
}

.tender-resource-floating-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.7rem;
  line-height: 1;
}

@media (max-width: 767px) {
  .tender-resource-floating-tag {
    position: static;
    margin: 0.25rem 0 0.75rem;
  }
}

.tender-detail-organ,
.tender-detail-location {
  font-size: 0.9rem;
  color: var(--pscp-muted);
}

.tender-detail-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tender-save-notify-hint {
  margin-top: 0.35rem;
}

.tender-detail-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid var(--pscp-border);
  margin-bottom: 1.25rem;
  padding-bottom: 0;
}

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

.tender-detail-tab {
  border: none;
  background: transparent;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--pscp-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  cursor: pointer;
}

.tender-detail-tab:hover { color: var(--pscp-text); }

.tender-detail-tab.is-active {
  color: var(--pscp-primary);
  border-bottom-color: var(--pscp-primary);
  font-weight: 600;
}

.tender-detail-tab-count {
  font-size: 0.8em;
  opacity: 0.85;
}

.tender-panel { display: none; }
.tender-panel.is-active { display: block; }

.tender-timeline { position: relative; padding-left: 0.25rem; }

.tender-timeline-step {
  display: flex;
  gap: 0.85rem;
  padding: 0.65rem 0;
  position: relative;
}

.tender-timeline-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 1.75rem;
  bottom: -0.35rem;
  width: 2px;
  background: var(--pscp-border);
}

.tender-timeline-step.is-done:not(:last-child)::before {
  background: var(--pscp-primary);
}

.tender-timeline-marker {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 2px solid var(--pscp-border);
  background: var(--pscp-surface);
  flex-shrink: 0;
  margin-top: 0.15rem;
  z-index: 1;
}

.tender-timeline-step.is-done .tender-timeline-marker {
  border-color: var(--pscp-primary);
  background: var(--pscp-primary);
}

.tender-timeline-step.is-current .tender-timeline-marker {
  border-color: var(--pscp-primary);
  box-shadow: 0 0 0 3px rgba(30, 79, 216, 0.2);
}

.tender-timeline-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
}

.tender-timeline-date {
  display: block;
  font-size: 0.8rem;
  color: var(--pscp-muted);
}

#tender-save-btn.active {
  background: var(--pscp-primary);
  color: #fff;
  border-color: var(--pscp-primary);
}

/* Mapa de licitaciones */
.map-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.map-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.map-page-controls-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.map-level-toggle,
.map-page-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.map-page-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 1rem;
  min-height: 70vh;
}

.map-sidebar .card-body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.map-region-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow: auto;
  max-height: 58vh;
}

.map-region-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--pscp-border);
  border-radius: var(--pscp-radius-sm);
  background: var(--pscp-surface-muted);
  color: var(--pscp-text);
  text-align: left;
  cursor: pointer;
}

.map-region-btn:hover {
  border-color: var(--pscp-primary);
  background: #fff;
}

.map-region-name {
  font-size: 0.86rem;
  font-weight: 500;
}

.map-region-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--pscp-muted);
}

.map-canvas-wrap {
  position: relative;
  overflow: visible;
}

.tender-map {
  width: 100%;
  min-height: 70vh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(219, 234, 254, 0.45), transparent 58%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  position: relative;
}

.tender-map svg {
  width: 100%;
  max-width: 980px;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 18px rgba(15, 23, 42, 0.08));
}

.tender-map .map-zone,
.tender-map .map-province {
  fill: #e8edf5;
  stroke: #94a3b8;
  stroke-width: 0.85;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
  cursor: pointer;
  transition: fill 0.15s ease, stroke 0.15s ease, filter 0.15s ease;
}

.tender-map .map-zone:hover,
.tender-map .map-province:hover {
  filter: brightness(1.03);
}

.tender-map .map-zone.is-active,
.tender-map .map-province.is-active {
  stroke: #1d4ed8 !important;
  stroke-width: 2 !important;
  filter: drop-shadow(0 0 4px rgba(29, 78, 216, 0.28));
}

.tender-map .map-zone.is-selected,
.tender-map .map-province.is-selected {
  stroke: #1d4ed8 !important;
  stroke-width: 2.5 !important;
  fill-opacity: 1 !important;
  filter: drop-shadow(0 0 8px rgba(29, 78, 216, 0.38));
}

.tender-map.has-selection .map-zone:not(.is-selected):not(:hover),
.tender-map.has-selection .map-province:not(.is-selected):not(:hover) {
  fill-opacity: 0.42;
}

.map-region-btn.is-active {
  border-color: var(--pscp-primary);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.tender-map.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.map-tooltip {
  position: absolute;
  z-index: 1200;
  transform: translate(-50%, calc(-100% - 6px));
  max-width: 220px;
  padding: 0.55rem 0.7rem;
  border-radius: var(--pscp-radius-sm);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--pscp-border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  font-size: 0.82rem;
  line-height: 1.35;
  pointer-events: none;
}

.map-tooltip--below {
  transform: translate(-50%, 6px);
}

.map-region-btn.is-active {
  border-color: var(--pscp-primary);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.tender-map.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.map-tooltip {
  position: absolute;
  z-index: 1200;
  transform: translate(-50%, calc(-100% - 6px));
  max-width: 220px;
  padding: 0.55rem 0.7rem;
  border-radius: var(--pscp-radius-sm);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--pscp-border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  font-size: 0.82rem;
  line-height: 1.35;
  pointer-events: none;
}

.map-tooltip--below {
  transform: translate(-50%, 6px);
}

.map-results-list {
  display: grid;
  gap: 0.5rem;
}

.map-result-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--pscp-border);
  border-radius: var(--pscp-radius-sm);
  background: var(--pscp-surface-muted);
}

.map-result-link {
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.map-result-link:hover .map-result-title {
  color: var(--pscp-primary);
}

.map-result-title {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
}

.map-result-meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--pscp-muted);
}

.map-legend {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--pscp-border);
  font-size: 0.78rem;
  color: var(--pscp-muted);
}

.map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.map-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.map-dot--region {
  background: rgba(59, 130, 246, 0.55);
  border: 2px solid #1e4fd8;
}

.map-dot--point {
  background: #14b8a6;
}

.map-legend-scale {
  width: 96px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e8edf5 0%, #a8c4f5 42%, #3b6fd9 78%, #1e4fd8 100%);
  border: 1px solid #cbd5e1;
}

@media (max-width: 991px) {
  .map-page-layout {
    grid-template-columns: 1fr;
  }

  .map-region-list {
    max-height: 220px;
  }

  .tender-map {
    min-height: 55vh;
  }
}

.offer-bidder-panel summary {
  cursor: pointer;
}

.offer-bidder-panel[open] summary {
  margin-bottom: 0.25rem;
}

#offer-assistant-plan textarea[data-section-field^="pcap_draft_"] {
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.55;
  font-size: 0.875rem;
}

/* Asistente de oferta — tabla de licitaciones similares */
.offer-similar-card .card-body {
  padding-bottom: 1rem;
}

.offer-similar-table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--pscp-border);
  border-radius: var(--pscp-radius-sm);
  background: var(--pscp-surface);
}

.offer-similar-table {
  width: 100%;
  min-width: 1080px;
  margin-bottom: 0;
  table-layout: fixed;
}

.offer-similar-table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--pscp-muted);
  padding: 0.55rem 0.5rem;
  white-space: nowrap;
  vertical-align: bottom;
}

.offer-similar-table tbody td {
  padding: 0.55rem 0.5rem;
  font-size: 0.8125rem;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.offer-similar-col-expedient { width: 21%; min-width: 11rem; }
.offer-similar-col-organ { width: 16%; min-width: 8.5rem; }
.offer-similar-col-date { width: 8%; min-width: 4.75rem; }
.offer-similar-col-money { width: 8%; min-width: 5.5rem; }
.offer-similar-col-discount { width: 11%; min-width: 6.5rem; }
.offer-similar-col-party { width: 15%; min-width: 7.5rem; }
.offer-similar-col-bids { width: 4%; min-width: 2.5rem; }

.offer-similar-col-organ,
.offer-similar-col-party {
  overflow: hidden;
  text-overflow: ellipsis;
}

.offer-similar-col-expedient .js-tender-detail-modal {
  font-weight: 600;
  text-decoration: none;
}

.offer-similar-col-expedient .js-tender-detail-modal:hover {
  text-decoration: underline;
}

.tender-preview-meta dt {
  margin-bottom: 0.15rem;
}

.tender-preview-meta dd {
  margin-bottom: 0.65rem;
}

.offer-similar-col-expedient .small.text-muted {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  line-height: 1.35;
}

.offer-similar-col-discount .text-muted {
  font-size: 0.72rem;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}

@media (min-width: 1200px) {
  .offer-similar-table {
    min-width: 0;
  }
}

@media (max-width: 767.98px) {
  .offer-similar-table-wrap {
    margin: 0 -0.35rem;
  }

  .offer-similar-table thead {
    display: table-header-group;
  }

  .offer-similar-table tbody tr {
    display: table-row;
    border: none;
    border-radius: 0;
    margin-bottom: 0;
    padding: 0;
    background: transparent;
  }

  .offer-similar-table tbody td {
    display: table-cell;
    border-color: var(--pscp-border);
    padding: 0.55rem 0.5rem;
  }

  .offer-similar-table tbody td::before {
    display: none;
  }

  .offer-similar-table tbody td:last-child {
    margin-top: 0;
    padding-top: 0.55rem;
    border-top: none;
  }
}

/* Admin: salud de crons */
.cron-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.65rem;
}

.cron-summary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--pscp-border);
  border-radius: 0.5rem;
  background: var(--pscp-surface);
  text-align: center;
}

.cron-summary-val {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.cron-summary-lbl {
  font-size: 0.72rem;
  color: var(--pscp-muted);
  margin-top: 0.15rem;
}

.cron-summary-card.is-ok .cron-summary-val { color: #198754; }
.cron-summary-card.is-running .cron-summary-val { color: #0d6efd; }
.cron-summary-card.is-stale .cron-summary-val { color: #fd7e14; }
.cron-summary-card.is-warning .cron-summary-val { color: #ffc107; }
.cron-summary-card.is-error .cron-summary-val { color: #dc3545; }

.cron-redis-panel {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--pscp-border);
}

.cron-redis-panel.is-ok {
  background: rgba(25, 135, 84, 0.08);
  border-color: rgba(25, 135, 84, 0.25);
}

.cron-redis-panel.is-bad {
  background: rgba(220, 53, 69, 0.08);
  border-color: rgba(220, 53, 69, 0.25);
}

.cron-health-table code {
  font-size: 0.78rem;
}

.cron-issue {
  color: #dc3545;
}

.cron-queue-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
}

.cron-queue-panel {
  padding: 0.85rem 1rem;
  border: 1px solid var(--pscp-border);
  border-radius: 0.5rem;
  background: var(--pscp-surface);
}

.cron-queue-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.5rem;
}

.cron-queue-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.45rem 0.35rem;
  border-radius: 0.35rem;
  background: rgba(0, 0, 0, 0.03);
}

.cron-queue-metric-val {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

.cron-queue-metric-lbl {
  font-size: 0.68rem;
  color: var(--pscp-muted);
  margin-top: 0.1rem;
  line-height: 1.2;
}

.cron-queue-metric-detail {
  font-size: 0.62rem;
  color: var(--pscp-muted);
  margin-top: 0.15rem;
  line-height: 1.2;
  max-width: 100%;
  word-break: break-word;
}

.cron-queue-metric.is-ok .cron-queue-metric-val { color: #198754; }
.cron-queue-metric.is-warning .cron-queue-metric-val { color: #fd7e14; }

.cron-last-batch {
  font-size: 0.72rem;
}

.cron-status-badge.cron-status-ok { background: #198754; }
.cron-status-badge.cron-status-running { background: #0d6efd; }
.cron-status-badge.cron-status-stale { background: #fd7e14; color: #212529; }
.cron-status-badge.cron-status-warning { background: #ffc107; color: #212529; }
.cron-status-badge.cron-status-error { background: #dc3545; }

.cron-live-panel {
  border: 1px solid var(--pscp-border, #e2e8f0);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.cron-live-panel.is-live {
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.12);
}
.cron-live-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.cron-live-status {
  font-size: 0.85rem;
  color: #64748b;
}
.cron-live-status.is-ok { color: #198754; }
.cron-live-status.is-error { color: #dc3545; }
.cron-live-pulse {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #94a3b8;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.cron-live-panel.is-live .cron-live-pulse {
  background: #0d6efd;
  animation: cron-live-pulse 1.4s ease-in-out infinite;
}
@keyframes cron-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}
.cron-live-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
}
@media (max-width: 992px) {
  .cron-live-grid { grid-template-columns: 1fr; }
}
.cron-live-subpanel {
  border: 1px solid var(--pscp-border, #e2e8f0);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  background: #fff;
  min-height: 6rem;
}
.cron-live-subpanel h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.65rem;
}
.cron-live-log-list,
.cron-live-event-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 220px;
  overflow: auto;
  font-size: 0.78rem;
}
.cron-live-log-list li,
.cron-live-event-list li {
  padding: 0.25rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.cron-live-row.is-working td:first-child { border-left: 3px solid #0d6efd; }
.cron-live-row.is-idle td:first-child { border-left: 3px solid #6c757d; }
.cron-live-row.is-stale td:first-child { border-left: 3px solid #fd7e14; }
.cron-live-event-ts { color: #64748b; margin-right: 0.35rem; }

.cron-pipeline-panel {
  padding: 0.85rem 1rem;
  border-radius: 0.65rem;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.cron-pipeline-list {
  display: grid;
  gap: 0.85rem;
}
@media (min-width: 768px) {
  .cron-pipeline-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cron-pipeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.cron-pipeline-label { font-weight: 600; font-size: 0.9rem; }
.cron-pipeline-pct { font-variant-numeric: tabular-nums; font-weight: 700; color: #0d6efd; }
.cron-pipeline-track {
  height: 0.55rem;
  border-radius: 999px;
  background: #e9ecef;
  overflow: hidden;
}
.cron-pipeline-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0d6efd, #4dabf7);
  transition: width 0.45s ease;
}
.cron-pipeline-item.is-ok .cron-pipeline-fill { background: linear-gradient(90deg, #198754, #51cf66); }
.cron-pipeline-item.is-warning .cron-pipeline-fill { background: linear-gradient(90deg, #fd7e14, #ffc107); }
.cron-pipeline-item.is-info .cron-pipeline-fill { background: linear-gradient(90deg, #6f42c1, #9775fa); }
.cron-pipeline-meta { margin-top: 0.25rem; }

.cron-activity-pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #e7f1ff;
  color: #0d6efd;
  font-size: 0.78rem;
}
.cron-activity-pill.is-working { background: #d1e7dd; color: #0f5132; }
.cron-activity-pill.is-idle { background: #fff3cd; color: #664d03; }
.cron-activity-pill.is-stale { background: #ffe5d0; color: #984c0c; }

.cron-health-table tr.cron-row-active {
  background: rgba(13, 110, 253, 0.04);
}
.cron-health-table tr.cron-row-working {
  box-shadow: inset 3px 0 0 #0d6efd;
}
.cron-health-table tr.cron-row-idle {
  box-shadow: inset 3px 0 0 #ffc107;
}
.cron-health-table tr.cron-row-stale {
  box-shadow: inset 3px 0 0 #fd7e14;
}
.cron-kind-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-parse-preview {
  max-height: 200px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--pscp-border, #e2e8f0);
  border-radius: 0.5rem;
  padding: 0.75rem;
  white-space: pre-wrap;
}
.admin-parse-detail-row td {
  border-top: none;
}

/* Admin health dashboard */
.health-overall {
  min-width: 12rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--pscp-border, #e2e8f0);
  background: #fff;
}
.health-overall--ok { border-color: rgba(25, 135, 84, 0.35); background: #f0fdf4; }
.health-overall--warning { border-color: rgba(253, 126, 20, 0.35); background: #fff7ed; }
.health-overall--critical { border-color: rgba(220, 53, 69, 0.35); background: #fef2f2; }
.health-overall-label {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
}
.health-overall-meta {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #64748b;
}
.health-components-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}
.health-component {
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--pscp-border, #e2e8f0);
  background: #fff;
}
.health-component--ok { border-left: 4px solid #198754; }
.health-component--warning { border-left: 4px solid #fd7e14; }
.health-component--critical { border-left: 4px solid #dc3545; }
.health-component-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}
.health-component-detail {
  margin-top: 0.35rem;
  font-size: 0.92rem;
  color: #0f172a;
  line-height: 1.45;
}
.health-severity {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}
.health-severity--critical { background: #fee2e2; color: #991b1b; }
.health-severity--warning { background: #ffedd5; color: #9a3412; }
.health-severity--info { background: #e0f2fe; color: #075985; }
.health-repair-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--pscp-border, #e2e8f0);
}
.health-repair-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
