:root {
  --ink: #10223d;
  --muted: #71809a;
  --line: #e4eaf3;
  --paper: #f7f9fc;
  --white: #fff;
  --cobalt: #3654d4;
  --cobalt-soft: #eef1ff;
  --mint: #d8f6ea;
  --mint-ink: #0c7358;
  --amber: #fff2cf;
  --amber-ink: #8b5a07;
  --shadow: 0 18px 48px rgba(16, 34, 61, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 85% -10%, #e8edff 0, transparent 34%), var(--paper); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.topbar { height: 68px; padding: 0 clamp(20px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(228, 234, 243, .9); background: rgba(255,255,255,.82); backdrop-filter: blur(18px); }
.brand { display: flex; gap: 10px; align-items: center; font-weight: 800; letter-spacing: -.03em; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--ink); color: #fff; font-weight: 900; }
.topbar-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #21b783; box-shadow: 0 0 0 4px var(--mint); }
.shell { width: min(1220px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 84px; }
.auth-view { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 32px 20px 80px; }
.auth-panel { width: min(440px, 100%); padding: clamp(28px, 6vw, 54px); border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.86); box-shadow: var(--shadow); }
.auth-panel h1 { font-size: clamp(36px, 8vw, 54px); }
.auth-form { display: grid; gap: 14px; margin-top: 30px; }
.auth-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.auth-form input { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--ink); background: var(--white); outline-color: var(--cobalt); }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 36px; }
.eyebrow, .card-kicker { margin: 0 0 10px; color: var(--cobalt); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { max-width: 670px; margin: 0; font-size: clamp(34px, 5vw, 62px); line-height: .98; letter-spacing: -.065em; }
.hero-copy { max-width: 620px; margin: 22px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.hero-note { width: min(270px, 100%); padding: 18px 20px; border: 1px solid #cfe7dd; border-radius: 16px; background: rgba(216, 246, 234, .62); color: var(--mint-ink); font-size: 13px; line-height: 1.5; }
.hero-note strong, .hero-note span { display: block; }
.hero-note strong { margin-bottom: 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .09em; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.metric { min-height: 122px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.78); box-shadow: 0 8px 22px rgba(16,34,61,.03); }
.metric-accent { border-color: #cfd6ff; background: var(--cobalt-soft); }
.metric-label, .metric-hint { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin: 12px 0 4px; font-size: 32px; letter-spacing: -.06em; }
.toolbar { display: flex; gap: 10px; margin-bottom: 26px; }
.search, .select-wrap { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.search { flex: 1; gap: 8px; padding: 0 14px; color: var(--muted); }
.search input, .select-wrap select { width: 100%; min-height: 44px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.select-wrap { min-width: 190px; padding: 0 12px; }
.button { border: 1px solid var(--ink); border-radius: 11px; min-height: 44px; padding: 0 16px; color: #fff; background: var(--ink); font-weight: 700; }
.button:hover { background: #1b365d; }
.button-quiet { border-color: var(--line); color: var(--ink); background: var(--white); }
.button-small { min-height: 34px; padding: 0 12px; border-color: var(--line); color: var(--ink); background: var(--white); font-size: 12px; }
.state { min-height: 24px; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.state.error { color: #a23a3a; }
.lead-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lead-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--white); box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.lead-card:hover { transform: translateY(-3px); box-shadow: 0 24px 56px rgba(16, 34, 61, .13); }
.card-visual { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, #132b4c, #5068db); }
.card-image { width: 100%; height: 100%; display: block; object-fit: cover; }
.card-image:not([src]) { display: none; }
.card-visual:has(.card-image:not([src]))::after { content: "Sin mockup todavía"; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.86); font-size: 13px; font-weight: 700; }
.card-status { position: absolute; top: 12px; right: 12px; padding: 7px 10px; border-radius: 999px; color: var(--ink); background: rgba(255,255,255,.9); font-size: 11px; font-weight: 800; }
.card-body { padding: 18px; }
.card-heading { display: flex; justify-content: space-between; gap: 10px; }
.card-kicker { margin-bottom: 6px; color: var(--muted); letter-spacing: .09em; }
.card-title { margin: 0; font-size: 20px; letter-spacing: -.04em; }
.score-badge { flex: none; align-self: start; padding: 7px 9px; border-radius: 9px; color: var(--mint-ink); background: var(--mint); font-size: 12px; font-weight: 800; }
.card-url { display: block; overflow: hidden; margin: 12px 0 14px; color: var(--cobalt); font-size: 12px; text-overflow: ellipsis; text-decoration: none; white-space: nowrap; }
.card-url:hover { text-decoration: underline; }
.card-quote { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quote-package { color: var(--muted); font-size: 11px; }
.quote-range { white-space: nowrap; font-size: 16px; letter-spacing: -.04em; }
.issue-list { min-height: 58px; margin: 14px 0; padding: 0 0 0 17px; color: #53627a; font-size: 12px; line-height: 1.55; }
.issue-list li::marker { color: var(--cobalt); }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-contact { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.detail-dialog { width: min(760px, calc(100% - 28px)); max-height: min(860px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 22px; color: var(--ink); box-shadow: 0 30px 100px rgba(8, 21, 42, .3); }
.detail-dialog::backdrop { background: rgba(11, 26, 49, .5); backdrop-filter: blur(4px); }
.dialog-inner { position: relative; padding: 30px; }
.dialog-close { position: absolute; top: 16px; right: 18px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--muted); background: var(--paper); font-size: 24px; line-height: 1; }
.detail-head { display: flex; justify-content: space-between; gap: 22px; padding-right: 28px; }
.detail-head h2 { margin: 0; font-size: 32px; letter-spacing: -.06em; }
.detail-head a { display: inline-block; margin-top: 8px; color: var(--cobalt); font-size: 13px; }
.detail-score { padding: 12px 14px; border-radius: 13px; color: var(--mint-ink); background: var(--mint); font-weight: 800; white-space: nowrap; }
.detail-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 26px; }
.detail-section { margin-top: 24px; }
.detail-section h3 { margin: 0 0 10px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.detail-section p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.detail-image { width: 100%; max-height: 260px; object-fit: cover; border-radius: 14px; background: var(--ink); }
.detail-meta { display: grid; gap: 8px; margin: 0; }
.detail-meta div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.detail-meta dt { color: var(--muted); }
.detail-meta dd { margin: 0; text-align: right; font-weight: 700; }
.detail-form { display: grid; gap: 10px; }
.detail-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.detail-form input, .detail-form textarea, .detail-form select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px; color: var(--ink); background: var(--white); }
.detail-form textarea { min-height: 86px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.timeline { display: grid; gap: 10px; max-height: 170px; overflow: auto; }
.timeline-item { padding: 10px 12px; border-left: 3px solid #d6dcf9; background: var(--paper); font-size: 12px; }
.timeline-item time { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.draft-link { display: inline-flex; margin-top: 10px; color: var(--cobalt); font-size: 12px; font-weight: 700; }

@media (max-width: 920px) {
  .hero { align-items: flex-start; flex-direction: column; }
  .hero-note { width: 100%; }
  .lead-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .topbar { height: 58px; }
  .topbar-meta { font-size: 10px; }
  .shell { width: min(100% - 28px, 560px); padding-top: 34px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .toolbar { flex-wrap: wrap; }
  .search { flex-basis: 100%; }
  .select-wrap { flex: 1; min-width: 0; }
  .lead-grid { grid-template-columns: 1fr; }
  .detail-columns { grid-template-columns: 1fr; }
  .dialog-inner { padding: 22px; }
}
