/* ProcureData: portal público y zona privada.
   Mismo aire que procuredata.space (blanco, azul, menú lateral, tarjetas) sin
   su código. Modo claro y oscuro con variables. */
:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-muted: #f1f5f9;
  --text: #0f172a;
  --text-soft: #475569;
  --text-faint: #94a3b8;
  --border: #e2e8f0;
  --primary: #2f80ed;
  --primary-strong: #1d4ed8;
  --primary-soft: #eff6ff;
  --accent: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --sidebar: 256px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1120;
  --bg-soft: #0f172a;
  --bg-muted: #1e293b;
  --text: #e2e8f0;
  --text-soft: #94a3b8;
  --text-faint: #64748b;
  --border: #1e293b;
  --primary: #60a5fa;
  --primary-strong: #3b82f6;
  --primary-soft: #172554;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--bg-muted); padding: .1em .35em; border-radius: 6px; word-break: break-all; }
.muted { color: var(--text-soft); }
.faint { color: var(--text-faint); font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- botones, chips, campos ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .45rem; justify-content: center;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  padding: .55rem 1rem; border-radius: 10px; font: inherit; font-weight: 600; font-size: .92rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--bg-muted); text-decoration: none; }
.btn.primary { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }
.btn.primary:hover { background: var(--primary); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: .35rem .7rem; font-size: .84rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--border); border-radius: 999px;
  padding: .15rem .6rem; font-size: .78rem; font-weight: 600; color: var(--text-soft); background: var(--bg);
}
.chip.blue { color: var(--primary-strong); background: var(--primary-soft); border-color: transparent; }
.chip.green { color: #15803d; background: #dcfce7; border-color: transparent; }
.chip.amber { color: #b45309; background: #fef3c7; border-color: transparent; }
.chip.red { color: #b91c1c; background: #fee2e2; border-color: transparent; }
:root[data-theme="dark"] .chip.green { background: #052e16; color: #86efac; }
:root[data-theme="dark"] .chip.amber { background: #451a03; color: #fcd34d; }
:root[data-theme="dark"] .chip.red { background: #450a0a; color: #fca5a5; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: .55rem .75rem; width: 100%;
}
label { font-weight: 600; font-size: .88rem; display: block; margin-bottom: .3rem; }

/* ---------- portada pública ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.site-header .inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 1.5rem; padding: .8rem 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 32px; height: 32px; border-radius: 50%; border: 4px solid var(--primary); position: relative; flex: none;
}
.brand .mark::before, .brand .mark::after { content: ""; position: absolute; top: 7px; width: 4px; height: 7px; background: var(--primary); border-radius: 2px; }
.brand .mark::before { left: 6px; }
.brand .mark::after { right: 6px; }
.site-nav { display: flex; gap: 1.3rem; margin-left: auto; align-items: center; }
.site-nav a { color: var(--text); font-weight: 500; font-size: .95rem; }
.header-tools { display: flex; gap: .5rem; align-items: center; }
.hero { max-width: 980px; margin: 0 auto; text-align: center; padding: 5rem 1.5rem 3rem; }
.hero .version { display: inline-block; background: var(--bg-muted); border-radius: 999px; padding: .2rem .8rem; font-weight: 600; font-size: .82rem; margin-bottom: 1.6rem; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
.hero h1 .grad { background: linear-gradient(90deg, var(--primary-strong), #38bdf8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.2rem; color: var(--text-soft); max-width: 760px; margin: 1rem auto 1.4rem; }
.badges { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 2rem; }
.hero .ctas { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }
.section { max-width: 1240px; margin: 0 auto; padding: 4rem 1.5rem; }
.section.alt { background: var(--bg-soft); max-width: none; }
.section.alt > .wrap { max-width: 1240px; margin: 0 auto; }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 2.5rem; }
.section-head .kicker { color: var(--primary-strong); font-weight: 700; text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.grid { display: grid; gap: 1rem; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card h3 { font-size: 1.05rem; }
button.card { font: inherit; color: var(--text); background: var(--bg); width: 100%; }
.card .tag { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-strong); }
.nxm { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.5rem; align-items: center; }
.nxm .side { text-align: center; }
.nxm .arrow { font-size: 2rem; color: var(--text-faint); }
.lines { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; margin: 1rem auto; max-width: 260px; }
.lines span { height: 8px; border-radius: 4px; background: var(--danger); opacity: .55; }
.lines.ok span { background: var(--accent); }
.actors { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.5rem; }
.actor { display: flex; align-items: center; gap: .4rem; border: 1px solid var(--border); border-radius: 999px; padding: .35rem .8rem; font-weight: 600; font-size: .88rem; background: var(--bg); }
.actor i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.step-num { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; margin-bottom: .6rem; }
.cta-band { text-align: center; background: linear-gradient(120deg, var(--primary-strong), #0ea5e9); color: #fff; border-radius: 20px; padding: 3rem 1.5rem; }
.cta-band .btn { background: #fff; color: var(--primary-strong); border-color: #fff; }
.cta-band .btn.outline { background: transparent; color: #fff; }
.site-footer { border-top: 1px solid var(--border); padding: 2.5rem 1.5rem; }
.site-footer .inner { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; }
.site-footer h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.site-footer a { color: var(--text); }

/* ---------- zona privada ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--border); background: var(--bg); padding: .7rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.org-switch { position: relative; margin-bottom: 1rem; }
.org-button {
  width: 100%; display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border: 1px solid var(--border);
  border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; cursor: pointer; text-align: left;
}
.org-avatar { width: 34px; height: 34px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-strong); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.org-avatar img { width: 100%; height: 100%; object-fit: cover; }
.org-name { font-weight: 700; font-size: .92rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-role { color: var(--text-soft); font-size: .78rem; }
.org-menu { position: absolute; top: calc(100% + 4px); left: 0; right: -40px; z-index: 30; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(15,23,42,.15); padding: .4rem; }
.org-menu .section-label { padding: .4rem .6rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); font-weight: 700; }
.org-menu a, .org-menu .item { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border-radius: 8px; color: var(--text); font-size: .9rem; }
.org-menu a:hover { background: var(--bg-muted); text-decoration: none; }
.nav-label { font-size: .78rem; color: var(--text-soft); font-weight: 600; padding: .6rem .6rem .3rem; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: .65rem; padding: .48rem .6rem; border-radius: 8px; color: var(--text); font-size: .93rem; }
.nav a:hover { background: var(--bg-muted); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.nav svg, .icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar .spacer { flex: 1; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .8rem; padding: .7rem 1.5rem; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); }
.search { flex: 1; max-width: 420px; position: relative; }
.search input { padding-left: 2.1rem; background: var(--bg-soft); }
.search .icon { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.user-chip { display: flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .9rem; }
.user-chip .av { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-strong); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800; }
.content { padding: 1.8rem 2rem 3rem; max-width: 1280px; }
.page-head { display: flex; align-items: flex-start; gap: 1rem; justify-content: space-between; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.85rem; }
.page-head .kicker { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--primary-strong); background: var(--primary-soft); border-radius: 999px; padding: .15rem .6rem; margin-bottom: .5rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.kpi .label { color: var(--text-soft); font-weight: 600; font-size: .9rem; display: flex; justify-content: space-between; }
.kpi .value { font-size: 1.8rem; font-weight: 800; margin: .3rem 0 .1rem; }
.kpi .value.none { font-size: 1.05rem; color: var(--text-faint); font-weight: 600; padding: .55rem 0 .35rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-soft); }
.empty .icon-wrap { width: 54px; height: 54px; border-radius: 50%; background: var(--bg-muted); margin: 0 auto .9rem; display: flex; align-items: center; justify-content: center; }
.empty .icon-wrap svg { width: 24px; height: 24px; stroke: var(--text-faint); fill: none; stroke-width: 1.8; }
.empty h3 { color: var(--text); }
.empty .next { display: inline-block; margin-top: .6rem; font-size: .85rem; background: var(--bg-muted); border-radius: 8px; padding: .3rem .6rem; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1.2rem; overflow-x: auto; }
.tabs a { padding: .55rem .85rem; border-bottom: 2px solid transparent; color: var(--text-soft); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { border-color: var(--primary-strong); color: var(--primary-strong); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-soft); padding: .55rem .6rem; border-bottom: 1px solid var(--border); }
.table td { padding: .65rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.dl { display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: .55rem 1rem; font-size: .93rem; }
.dl dt { color: var(--text-soft); font-weight: 600; }
.dl dd { margin: 0; min-width: 0; }
.catalog-layout { display: grid; grid-template-columns: 250px 1fr; gap: 1.4rem; }
.catalog-hero { background: linear-gradient(120deg, var(--primary-strong), #3b82f6); color: #fff; border-radius: 18px; padding: 2rem 2rem 2.2rem; margin-bottom: 1.5rem; }
.catalog-hero h1 { font-size: 2rem; }
.catalog-hero .kicker { display: inline-block; background: rgba(255,255,255,.18); color: #fff; border-radius: 999px; padding: .15rem .6rem; font-size: .78rem; font-weight: 700; margin-bottom: .5rem; }
.catalog-hero input { max-width: 460px; border: none; margin-top: .6rem; }
.asset-card { display: flex; flex-direction: column; gap: .45rem; position: relative; overflow: hidden; }
.asset-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--accent), var(--primary)); }
.asset-card h3 { margin: .3rem 0 0; }
.asset-card .provider { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; border: 1px solid var(--border); border-radius: 999px; padding: .1rem .55rem; align-self: flex-start; }
.asset-card .desc { color: var(--text-soft); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.asset-card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding-top: .5rem; }
.filter-group { margin-bottom: 1rem; }
.notice { border: 1px dashed var(--border); border-radius: 10px; padding: .8rem 1rem; color: var(--text-soft); font-size: .9rem; background: var(--bg-soft); }
.notice.warn { border-style: solid; border-color: #fcd34d; background: #fffbeb; color: #92400e; }
:root[data-theme="dark"] .notice.warn { background: #451a03; color: #fcd34d; border-color: #92400e; }
.loading { color: var(--text-soft); padding: 2rem 0; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 1rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--text-faint); }
.status-dot.ok { background: var(--accent); }
.status-dot.bad { background: var(--danger); }
.hamburger { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: 280px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
  .sidebar.open { transform: none; }
  .hamburger { display: inline-flex; }
  .catalog-layout { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .content { padding: 1.2rem; }
  .nxm { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
}
