/* Licitia — estilos globales */
:root {
  color-scheme: light;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-ink: #042f2e;
  --accent: #d97706;
  --ink: #0f172a;
  --ink-2: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --chart-surface: #fcfcfb;
  --chart-grid: #e1e0d9;
  --chart-axis: #c3c2b7;
  --chart-muted: #898781;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --good: #0ca30c;
  --critical: #d03b3b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 14px rgba(15, 23, 42, .06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; }
button { font: inherit; cursor: pointer; }

/* ---------- Barra superior ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 60px;
  background: var(--brand-ink); color: #fff; position: sticky; top: 0; z-index: 50;
}
.topbar .logo { font-weight: 800; font-size: 16.5px; letter-spacing: .3px; color: #fff; text-decoration: none; }
.topbar .logo span { color: #5eead4; }
.topbar nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.topbar nav a {
  color: #cbd5e1; padding: 8px 14px; border-radius: 8px; font-size: 14.5px; text-decoration: none;
}
.topbar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.topbar nav a.active { background: var(--brand); color: #fff; }

/* ---------- Layout de la app ---------- */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 60px); }
.sidebar { background: var(--card); border-right: 1px solid var(--line); padding: 18px 10px; }
.sidebar h4 { margin: 6px 12px 10px; font-size: 11.5px; letter-spacing: .8px; color: var(--muted); text-transform: uppercase; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--ink-2); font-size: 14.5px; text-decoration: none; }
.sidebar a:hover { background: #f1f5f9; }
.sidebar a.active { background: #ccfbf1; color: var(--brand-dark); font-weight: 600; }
.main { padding: 26px 30px; max-width: 1160px; }
.main h1 { margin: 0 0 4px; font-size: 26px; }
.main .sub { color: var(--muted); margin: 0 0 22px; font-size: 14.5px; }

/* ---------- Tarjetas / KPI ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi .label { font-size: 13px; color: var(--muted); }
.kpi .value { font-size: 30px; font-weight: 750; margin-top: 4px; }
.kpi .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
.panel h3 { margin: 0 0 12px; font-size: 16.5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } .shell { grid-template-columns: 1fr; } .sidebar { display: none; } }

/* ---------- Tablas ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 11px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
tr:hover td { background: #f8fafc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.title-cell { max-width: 480px; }
.title-cell a { color: var(--ink); font-weight: 550; }
.title-cell a:hover { color: var(--brand); }
.meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ---------- Chips / badges ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge.pub { background: #dcfce7; color: #166534; }
.badge.res { background: #e0e7ff; color: #3730a3; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.src { background: #f1f5f9; color: var(--ink-2); font-weight: 500; }
.badge.days-red { background: #fee2e2; color: #991b1b; }
.badge.days-amber { background: #fef3c7; color: #92400e; }
.badge.days-green { background: #dcfce7; color: #166534; }

/* ---------- Filtros ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters input, .filters select {
  font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.filters input[type=text] { min-width: 260px; flex: 1; }
.btn { background: var(--brand); color: #fff; border: 0; padding: 9px 18px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.btn:hover { background: var(--brand-dark); }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.small { padding: 5px 11px; font-size: 12.5px; }
.btn.danger { background: transparent; color: var(--critical); border: 1px solid var(--critical); }

/* ---------- Paginación ---------- */
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.pager button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 11px; }
.pager button[disabled] { opacity: .4; cursor: default; }

/* ---------- Gráficas ---------- */
.chart-wrap { position: relative; background: var(--chart-surface); border-radius: 8px; padding: 6px 4px 0; }
.chart-tip {
  position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: var(--shadow); padding: 7px 10px; font-size: 12.5px; display: none; z-index: 10; white-space: nowrap;
}
.chart-tip b { display: block; font-size: 12px; color: var(--ink-2); font-weight: 600; }

/* ---------- Pipeline favoritos ---------- */
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 20px; }
.stage-col { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; text-align: center; }
.stage-col .n { font-size: 24px; font-weight: 750; }
.stage-col .s { font-size: 12.5px; color: var(--muted); }

/* ---------- Detalle ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.detail-grid .item { background: #f8fafc; border-radius: 8px; padding: 10px 14px; }
.detail-grid .item .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.detail-grid .item .v { font-size: 15px; font-weight: 600; margin-top: 3px; }

/* ---------- Landing ---------- */
.hero { background: linear-gradient(160deg, var(--brand-ink) 0%, #134e4a 55%, #0f766e 100%); color: #fff; padding: 90px 24px 100px; }
.hero-inner { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; } }
.hero h1 { font-size: 44px; margin: 0 0 18px; }
.hero p.lead { font-size: 19px; color: #ccfbf1; margin: 0 0 28px; line-height: 1.55; }
.hero .form-card { background: #fff; color: var(--ink); border-radius: 16px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.hero .form-card h3 { margin: 0 0 4px; text-align: center; }
.hero .form-card .sub { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.hero .form-card input { width: 100%; margin-bottom: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.hero .form-card .btn { width: 100%; padding: 12px; font-size: 15px; }
.section { max-width: 1080px; margin: 0 auto; padding: 70px 24px; }
.section h2 { font-size: 32px; text-align: center; margin: 0 0 8px; }
.section .sub { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 44px; font-size: 16px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.step .n { width: 34px; height: 34px; border-radius: 99px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 14px; }
.step h3 { margin: 0 0 8px; font-size: 17.5px; }
.step p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .compare { grid-template-columns: 1fr; } }
.compare .col { border-radius: 14px; padding: 26px; }
.compare .without { background: #fef2f2; border: 1px solid #fecaca; }
.compare .with { background: #f0fdfa; border: 1px solid #99f6e4; }
.compare h3 { margin-top: 0; }
.compare ul { margin: 0; padding-left: 20px; line-height: 1.8; font-size: 14.5px; }
.cta-band { background: var(--brand-ink); color: #fff; text-align: center; padding: 64px 24px; }
.cta-band h2 { font-size: 30px; margin: 0 0 12px; }
.cta-band p { color: #99f6e4; margin: 0 0 24px; }
footer.site { background: #0b1120; color: #94a3b8; padding: 36px 24px; font-size: 13.5px; }
footer.site .inner { max-width: 1080px; margin: 0 auto; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.note { font-size: 12.5px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14.5px; }
