/* Growth workspace: Hoy, Solicitudes, Conversiones and the side panels that link them. */

:root {
    --seo-bar-pub: #15803D;
    --seo-bar-draft: #A1A1AA;
    --seo-bar-none: #E4E4E7;
}

[data-theme="dark"] {
    --seo-bar-pub: #22C55E;
    --seo-bar-draft: #71717A;
    --seo-bar-none: #3F3F46;
}

.sh-peek--wide { width: 460px; }
.sh-peek--wide .sh-peek__body { display: flex; flex-direction: column; gap: 16px; }

.sh-peek__foot {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--sh-border);
    flex-wrap: wrap;
    align-items: center;
    background: var(--sh-bg-surface);
}

@media (max-width: 900px) {
    .sh-peek--wide { width: calc(100vw - 1.5rem); }
}

/* A reading pane, not a dialog: on a wide screen the list stays usable beside the open record. */
@media (min-width: 1180px) {
    .sh-peek__scrim--pane { display: none; }
    body:has(.sh-peek__rail--pane) .sh-content { padding-right: calc(472px + var(--sh-content-padding)); }
}

.seo-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.seo-stack { display: flex; flex-direction: column; gap: 16px; }
.seo-grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .seo-grid-2 { grid-template-columns: minmax(0, 1fr); } }
.seo-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }

.seo-muted { color: var(--sh-text-tertiary); }
.seo-sec { color: var(--sh-text-secondary); }
.seo-mono { font-family: var(--sh-font-mono, ui-monospace, monospace); font-size: 12px; }
.seo-num { font-variant-numeric: tabular-nums; }

.seo-link {
    color: var(--sh-accent-text);
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    text-align: left;
}

.seo-link:hover { text-decoration: underline; text-underline-offset: 2px; }

.seo-route { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.seo-route i[data-lucide] { width: 12px; height: 12px; opacity: 0.6; }

.seo-card {
    background: var(--sh-bg-surface);
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius-lg, 12px);
    overflow: hidden;
}

.seo-card--pad { padding: 16px; }

.seo-h {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--sh-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.seo-h i[data-lucide] { width: 15px; height: 15px; color: var(--sh-text-tertiary); }
.seo-card--pad > .seo-h { margin-bottom: 10px; }

.seo-table-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--sh-border);
    flex-wrap: wrap;
}

.sh-table-wrap { transition: opacity 120ms ease; }
.sh-table-wrap.seo-busy { opacity: .5; pointer-events: none; transition-delay: 150ms; }

.sh-table-wrap tbody tr.seo-tr { cursor: pointer; }
.sh-table-wrap tbody tr.seo-tr--open,
.sh-table-wrap tbody tr.seo-tr--open:hover { background: var(--sh-accent-subtle); }
.sh-table-wrap td .seo-sub { font-size: 11.5px; color: var(--sh-text-tertiary); margin-top: 2px; }
.sh-table-wrap td.seo-cell--check { width: 34px; }

.sh-table-wrap--dense thead th,
.sh-table-wrap--dense tbody td { padding: 7px 12px; }
.sh-table-wrap--dense thead th { letter-spacing: .03em; }

/* max-width:0 is what lets an auto-layout column give up width instead of pushing the numbers out. */
.sh-table-wrap tbody td.seo-cell--fill { width: 100%; max-width: 0; }
.sh-table-wrap tbody td.seo-cell--fill > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.seo-check { accent-color: var(--sh-accent); width: 15px; height: 15px; cursor: pointer; }

/* ── Hoy ────────────────────────────────────────────────────────────────── */

.seo-attn { display: flex; flex-direction: column; }

.seo-attn__item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    border: 0;
    border-top: 1px solid var(--sh-border);
    background: var(--sh-bg-surface);
    text-align: left;
    width: 100%;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.seo-attn__item:first-child { border-top: 0; }
.seo-attn__item:hover { background: var(--sh-hover); }

.seo-attn__ico { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.seo-attn__ico i[data-lucide] { width: 17px; height: 17px; }
.seo-attn__ico--danger { background: var(--sh-red-bg); color: var(--sh-red-text); }
.seo-attn__ico--warning { background: var(--sh-amber-bg); color: var(--sh-amber-text); }
.seo-attn__ico--info { background: var(--sh-blue-bg); color: var(--sh-blue-text); }
.seo-attn__ico--ok { background: var(--sh-green-bg); color: var(--sh-green-text); }

.seo-attn__title { display: block; font-size: 13.5px; font-weight: 600; color: var(--sh-text-primary); }
.seo-attn__title .seo-num { font-size: 15px; margin-right: 4px; }
.seo-attn__why { display: block; font-size: 12.5px; color: var(--sh-text-secondary); margin-top: 2px; line-height: 1.45; }
.seo-attn__go { font-size: 12px; color: var(--sh-text-tertiary); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.seo-attn__go i[data-lucide] { width: 14px; height: 14px; }

.seo-funnel { display: flex; flex-direction: column; gap: 2px; }

.seo-funnel__step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    padding: 8px 0;
    border: 0;
    border-top: 1px dashed var(--sh-border);
    cursor: pointer;
    background: none;
    text-align: left;
    font: inherit;
    color: inherit;
    width: 100%;
}

.seo-funnel__step:first-child { border-top: 0; }
.seo-funnel__step:disabled { cursor: default; }
.seo-funnel__step:not(:disabled):hover .seo-funnel__label { color: var(--sh-text-primary); }
.seo-funnel__label { font-size: 12.5px; color: var(--sh-text-secondary); }
.seo-funnel__value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.seo-funnel__bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--sh-bg-sunken); overflow: hidden; }
.seo-funnel__bar span { display: block; height: 100%; background: var(--sh-accent); border-radius: 3px; }
.seo-funnel__rate { grid-column: 1 / -1; font-size: 11.5px; color: var(--sh-text-tertiary); }

.seo-progress { height: 6px; border-radius: 3px; background: var(--sh-bg-sunken); overflow: hidden; }
.seo-progress span { display: block; height: 100%; background: var(--sh-accent); }

/* ── Chips and deadlines ────────────────────────────────────────────────── */

.seo-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid transparent;
    line-height: 18px;
}

.seo-chip i[data-lucide] { width: 12px; height: 12px; }
.seo-chip--ok { background: var(--sh-green-bg); color: var(--sh-green-chip); border-color: var(--sh-green-border); }
.seo-chip--warn { background: var(--sh-amber-bg); color: var(--sh-amber-chip); border-color: var(--sh-amber-border); }
.seo-chip--bad { background: var(--sh-red-bg); color: var(--sh-red-chip); border-color: var(--sh-red-border); }
.seo-chip--info { background: var(--sh-blue-bg); color: var(--sh-blue-text); border-color: var(--sh-blue-border); }
.seo-chip--mute { background: var(--sh-gray-bg); color: var(--sh-text-secondary); border-color: var(--sh-gray-border); }
.seo-chip--ads { background: var(--sh-purple-bg); color: var(--sh-purple-text); border-color: var(--sh-purple-border); }
[data-theme="dark"] .seo-chip--ok { color: var(--sh-green-text); }
[data-theme="dark"] .seo-chip--warn { color: var(--sh-amber-text); }
[data-theme="dark"] .seo-chip--bad { color: var(--sh-red-text); }

.seo-sla { font-size: 11.5px; white-space: nowrap; }
.seo-sla--late { color: var(--sh-red-text); font-weight: 600; }
.seo-sla--soon { color: var(--sh-amber-text); font-weight: 600; }

.seo-tabs-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: 999px;
    background: var(--sh-bg-sunken);
    font-size: 11px;
    color: var(--sh-text-secondary);
    font-variant-numeric: tabular-nums;
}

.seo-tabs-count--hot { background: var(--sh-accent); color: #fff; }

/* ── Lists ──────────────────────────────────────────────────────────────── */

.seo-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.seo-filters .sh-input, .seo-filters select { height: var(--sh-control-height); }

.seo-filters select {
    border: 1px solid var(--sh-border);
    background: var(--sh-bg-surface);
    color: var(--sh-text-primary);
    border-radius: var(--sh-radius-md, 8px);
    padding: 0 28px 0 10px;
    font: inherit;
    font-size: 13px;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717A' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
}

.seo-filters select.is-set { border-color: var(--sh-accent); color: var(--sh-accent-text); }

.seo-search { position: relative; flex: 1 1 260px; max-width: 360px; }
.seo-search i[data-lucide] { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--sh-text-tertiary); }
.seo-search input { width: 100%; padding-left: 30px; }

.seo-pager {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    padding: 10px 14px;
    border-top: 1px solid var(--sh-border);
    font-size: 12.5px;
    color: var(--sh-text-secondary);
    flex-wrap: wrap;
}

.seo-pager__nav { display: flex; align-items: center; gap: 6px; }

.seo-selall {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--sh-blue-bg);
    border-bottom: 1px solid var(--sh-blue-border);
    font-size: 12.5px;
    color: var(--sh-text-primary);
    flex-wrap: wrap;
}

.seo-empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--sh-text-secondary);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.seo-empty i[data-lucide] { width: 28px; height: 28px; color: var(--sh-text-tertiary); }
.seo-empty b { color: var(--sh-text-primary); font-size: 14px; }

.seo-note-line { margin: -4px 0 12px; font-size: 13px; color: var(--sh-text-secondary); }

.seo-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--sh-border);
    background: var(--sh-bg-surface);
    margin-bottom: 16px;
    font-size: 13px;
    flex-wrap: wrap;
}

.seo-banner > i[data-lucide] { width: 18px; height: 18px; flex-shrink: 0; }
.seo-banner--off { background: var(--sh-amber-bg); border-color: var(--sh-amber-border); }
.seo-banner--bad { background: var(--sh-red-bg); border-color: var(--sh-red-border); }
.seo-banner__text { flex: 1; min-width: 220px; line-height: 1.45; }

/* ── Side panels ────────────────────────────────────────────────────────── */

.seo-psec { display: flex; flex-direction: column; gap: 8px; }

.seo-psec > h4 {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sh-text-tertiary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.seo-psec__aside { text-transform: none; letter-spacing: 0; font-weight: 400; }

.seo-kv {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 6px 12px;
    font-size: 12.5px;
    align-items: baseline;
    margin: 0;
}

.seo-kv dt { color: var(--sh-text-tertiary); }
.seo-kv dd { margin: 0; color: var(--sh-text-primary); min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

@media (max-width: 900px) {
    .seo-kv { grid-template-columns: 110px minmax(0, 1fr); }
}

.seo-tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.seo-tl li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; position: relative; padding-bottom: 12px; }
.seo-tl li:not(:last-child)::before { content: ''; position: absolute; left: 10px; top: 22px; bottom: 0; width: 1px; background: var(--sh-border); }

.seo-tl__dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sh-bg-sunken);
    color: var(--sh-text-secondary);
}

.seo-tl__dot i[data-lucide] { width: 12px; height: 12px; }
.seo-tl__dot--ok { background: var(--sh-green-bg); color: var(--sh-green-text); }
.seo-tl__dot--ads { background: var(--sh-purple-bg); color: var(--sh-purple-text); }
.seo-tl__dot--bad { background: var(--sh-red-bg); color: var(--sh-red-text); }
.seo-tl__dot--warn { background: var(--sh-amber-bg); color: var(--sh-amber-text); }
.seo-tl__dot--off { background: transparent; border: 1px dashed var(--sh-border-strong); color: var(--sh-text-tertiary); }
.seo-tl__t { font-size: 12.5px; color: var(--sh-text-primary); line-height: 1.4; }
.seo-tl__s { font-size: 11.5px; color: var(--sh-text-tertiary); margin-top: 1px; line-height: 1.4; }

.seo-note {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 6px;
    background: var(--sh-bg-sunken);
    font-size: 12.5px;
    white-space: pre-wrap;
}

.seo-note small { color: var(--sh-text-tertiary); font-size: 11px; white-space: normal; }

.seo-textarea { height: auto; min-height: 56px; padding: 8px 10px; resize: vertical; width: 100%; font: inherit; font-size: 13px; }

.seo-evid { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.seo-evid li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; align-items: start; }
.seo-evid i[data-lucide] { width: 14px; height: 14px; margin-top: 2px; }
.seo-evid .ok { color: var(--sh-green-text); }
.seo-evid .no { color: var(--sh-red-text); }
.seo-evid .meh { color: var(--sh-amber-text); }

.seo-code {
    font-family: var(--sh-font-mono, ui-monospace, monospace);
    font-size: 11.5px;
    background: var(--sh-bg-sunken);
    border: 1px solid var(--sh-border);
    border-radius: 6px;
    padding: 10px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin: 0;
    color: var(--sh-text-primary);
    line-height: 1.5;
}

.seo-mini {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--sh-border);
    border-radius: 8px;
    background: var(--sh-bg-surface);
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
    width: 100%;
}

.seo-mini:hover { background: var(--sh-hover); }
.seo-mini i[data-lucide] { width: 14px; height: 14px; color: var(--sh-text-tertiary); }
.seo-mini__sub { display: block; font-size: 11.5px; color: var(--sh-text-tertiary); margin-top: 1px; }

.seo-live {
    font-size: 12.5px;
    color: var(--sh-text-secondary);
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--sh-bg-sunken);
}

.seo-live b { color: var(--sh-text-primary); }

.seo-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seo-figures div { display: flex; flex-direction: column; gap: 2px; }
.seo-figures small { font-size: 11px; color: var(--sh-text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.seo-figures b { font-size: 17px; font-variant-numeric: tabular-nums; }

/* ── Contenido ──────────────────────────────────────────────────────────── */

.seo-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
@media (max-width: 520px) { .seo-types { grid-template-columns: minmax(0, 1fr); } }
.seo-type { display: flex; flex-direction: column; gap: 12px; }
.seo-type__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.seo-type__head > :first-child { min-width: 0; }
.seo-type__head > .seo-row { flex: none; flex-wrap: nowrap; }
.seo-type__name { margin: 0; font-size: 15px; font-weight: 600; }
.seo-type__url { font-family: var(--sh-font-mono, ui-monospace, monospace); font-size: 12px; color: var(--sh-text-tertiary); margin-top: 3px; }

.seo-cover { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--seo-bar-none); }
.seo-cover span { display: block; height: 100%; }
.seo-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--sh-text-secondary); margin-top: 8px; }
.seo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.seo-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.seo-field { display: flex; flex-direction: column; gap: 4px; }
.seo-field > span { font-size: 12px; color: var(--sh-text-tertiary); }
.seo-field small { font-size: 11.5px; color: var(--sh-text-tertiary); }
