/* PanelFreeka — sistema visual del panel.
   Tokens en :root; modo oscuro según el sistema operativo. Sin dependencias externas. */

:root {
    --bg: #f5f4f1;
    --surface: #ffffff;
    --surface-2: #faf9f7;
    --surface-3: #f1efeb;
    --border: #e6e3dd;
    --border-strong: #d6d2ca;
    --text: #1d1c1a;
    --text-2: #57534c;
    --text-3: #8b867c;

    --accent: #b9532f;
    --accent-hover: #a2461f;
    --accent-soft: #f8ebe5;
    --accent-text: #ffffff;

    --success: #2c7a4b;
    --success-soft: #e4f3e9;
    --warning: #9a6200;
    --warning-soft: #fcf1d9;
    --danger: #b42318;
    --danger-soft: #fde9e7;
    --info: #2d5cad;
    --info-soft: #e7eefb;

    --sidebar-bg: #000000;
    --sidebar-text: #c9c5bd;
    --sidebar-text-strong: #f4efe6;
    --sidebar-muted: #7d786f;
    --sidebar-hover: rgba(255, 255, 255, .06);
    --sidebar-active: rgba(224, 118, 80, .16);
    --sidebar-accent: #e07650;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(29, 28, 26, .05);
    --shadow: 0 1px 3px rgba(29, 28, 26, .06), 0 4px 14px rgba(29, 28, 26, .05);
    --shadow-lg: 0 12px 40px rgba(29, 28, 26, .16);
    --focus: 0 0 0 3px rgba(185, 83, 47, .25);

    --sidebar-w: 248px;
    --topbar-h: 60px;
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #000000;
        --surface: #0d0d0d;
        --surface-2: #141414;
        --surface-3: #1e1e1e;
        --border: #262626;
        --border-strong: #3a3a3a;
        --text: #eceae5;
        --text-2: #b4afa5;
        --text-3: #847f76;
        --accent: #e07650;
        --accent-hover: #ea8964;
        --accent-soft: rgba(224, 118, 80, .14);
        --accent-text: #000000;
        --success: #5cc287;
        --success-soft: rgba(92, 194, 135, .13);
        --warning: #e5b04a;
        --warning-soft: rgba(229, 176, 74, .13);
        --danger: #f07a6c;
        --danger-soft: rgba(240, 122, 108, .13);
        --info: #7da7f0;
        --info-soft: rgba(125, 167, 240, .13);
        --sidebar-bg: #000000;
        --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .2);
        --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
        --focus: 0 0 0 3px rgba(224, 118, 80, .35);
        color-scheme: dark;
    }
}
/* Elegido a mano con el botón de tema (cookie "tema"): manda sobre la preferencia del sistema. */
:root[data-theme="dark"] {
        --bg: #000000;
        --surface: #0d0d0d;
        --surface-2: #141414;
        --surface-3: #1e1e1e;
        --border: #262626;
        --border-strong: #3a3a3a;
        --text: #eceae5;
        --text-2: #b4afa5;
        --text-3: #847f76;
        --accent: #e07650;
        --accent-hover: #ea8964;
        --accent-soft: rgba(224, 118, 80, .14);
        --accent-text: #000000;
        --success: #5cc287;
        --success-soft: rgba(92, 194, 135, .13);
        --warning: #e5b04a;
        --warning-soft: rgba(229, 176, 74, .13);
        --danger: #f07a6c;
        --danger-soft: rgba(240, 122, 108, .13);
        --info: #7da7f0;
        --info-soft: rgba(125, 167, 240, .13);
        --sidebar-bg: #000000;
        --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .2);
        --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
        --focus: 0 0 0 3px rgba(224, 118, 80, .35);
        color-scheme: dark;

}

/* ── Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 .75em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-lg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.hidden { display: none !important; }
.mt-section { margin-top: 26px; }
form.inline { display: inline; }
.config-card { display: flex; align-items: center; gap: 14px; padding: 18px; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.config-card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow); }
.config-card__text { flex: 1; display: flex; flex-direction: column; gap: 2px; }

/* ── Estructura ───────────────────────────────────────── */
.shell { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
    background: var(--sidebar-bg); color: var(--sidebar-text);
    display: flex; flex-direction: column; z-index: 40;
    transition: transform .22s ease;
}
.sidebar { border-right: 1px solid rgba(255, 255, 255, .08); }
.sidebar__brand { height: 76px; display: flex; align-items: center; padding: 0 18px; flex-shrink: 0; }
.brand__logo { height: 50px; width: auto; display: block; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--sidebar-text-strong); font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 30px; height: 30px; }
.brand__sub { display: block; font-size: 11px; font-weight: 500; color: var(--sidebar-muted); letter-spacing: .02em; }
.sidebar__nav { flex: 1; overflow-y: auto; padding: 8px 10px 16px; scrollbar-width: thin; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 4px; }
.nav-group__title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--sidebar-muted); padding: 6px 10px; font-weight: 600; }
.nav-item {
    position: relative; display: flex; align-items: center; gap: 11px;
    padding: 8px 10px; border-radius: 8px; color: var(--sidebar-text); font-weight: 500;
    margin: 1px 0;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); text-decoration: none; }
.nav-item.is-active { background: var(--sidebar-active); color: var(--sidebar-text-strong); }
.nav-item.is-active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sidebar-accent); }
.nav-item.is-active .icon { color: var(--sidebar-accent); }
.sidebar__footer { padding: 12px 18px; font-size: 11.5px; color: var(--sidebar-muted); border-top: 1px solid rgba(255, 255, 255, .06); }
.sidebar-backdrop { display: none; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
    display: flex; align-items: center; gap: 12px; padding: 0 28px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--border);
}
.icon-btn.topbar__menu { display: none; }
.topbar__title { flex: 1; min-width: 0; }
.topbar__title h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { display: flex; align-items: center; gap: 6px; }
.content { padding: 24px 28px 48px; width: 100%; max-width: 1360px; }

/* ── Botones ──────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer;
    white-space: nowrap; transition: background .15s, border-color .15s, color .15s; text-decoration: none;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled, .btn.is-loading { opacity: .6; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn--block { width: 100%; }
.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .icon, .btn.is-loading .icon-sm { display: none; }
.icon-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 9px; border: 0; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn .count {
    position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
    background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
    border: 2px solid var(--bg);
}
.spinner {
    width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
    animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Encabezado de página ─────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head__text p { margin: 0; color: var(--text-2); }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title:first-child { margin-top: 0; }

/* ── Tarjetas ─────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card__head h2, .card__head h3 { font-size: 15px; }
.card__head p { margin: 2px 0 0; color: var(--text-3); font-size: 13px; }
.card__body { padding: 20px; }
.card__body--flush { padding: 0; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.grid { display: grid; gap: 16px; }
.grid--kpi { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--main-side { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-height: 118px; position: relative; }
.kpi__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi__label { font-size: 13px; color: var(--text-2); font-weight: 550; }
.kpi__icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.kpi__icon--accent { background: var(--accent-soft); color: var(--accent); }
.kpi__icon--success { background: var(--success-soft); color: var(--success); }
.kpi__icon--warning { background: var(--warning-soft); color: var(--warning); }
.kpi__icon--danger { background: var(--danger-soft); color: var(--danger); }
.kpi__icon--info { background: var(--info-soft); color: var(--info); }
.kpi__value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi__value--money { font-size: 22px; }
.kpi__hint { font-size: 12.5px; color: var(--text-3); margin-top: auto; }
.kpi--pending .kpi__value { color: var(--text-3); font-size: 20px; font-weight: 600; }

/* ── Tablas ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
    text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em;
    padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; }
.table .cell-main { font-weight: 600; color: var(--text); }
.table .cell-sub { font-size: 12.5px; color: var(--text-3); }
.table--compact td { padding: 9px 16px; }

/* ── Badges y estados ─────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap;
    background: var(--surface-3); color: var(--text-2);
}
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex-shrink: 0; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.status--ok { color: var(--success); }
.status--error { color: var(--danger); }
.status--none { color: var(--text-3); }
.status .dot { box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); }

/* ── Formularios ──────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-weight: 600; font-size: 13px; color: var(--text); }
.label .opt { font-weight: 400; color: var(--text-3); }
.hint { font-size: 12.5px; color: var(--text-3); }
.error-text { font-size: 12.5px; color: var(--danger); font-weight: 500; }
.input, .select, .textarea {
    width: 100%; height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.select {
    appearance: none; padding-right: 34px;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
    background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.input::placeholder { color: var(--text-3); }
.field.has-error .input, .field.has-error .select { border-color: var(--danger); }
.input-group { position: relative; display: flex; }
.input-group .input { padding-right: 42px; }
.input-group__btn { position: absolute; right: 3px; top: 3px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--text-3); border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.input-group__btn:hover { color: var(--text); background: var(--surface-3); }
.input-icon { position: relative; }
.input-icon .icon-sm { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 36px; }
.check { display: inline-flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 22px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex-shrink: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.secret-field { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; padding: 8px 12px; border-radius: 8px; background: var(--surface-3); color: var(--text-2); overflow-wrap: anywhere; }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); }

/* ── Alertas ──────────────────────────────────────────── */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid transparent; margin-bottom: 18px; }
.alert__body { flex: 1; min-width: 0; }
.alert__body strong { display: block; margin-bottom: 2px; }
.alert--exito { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert--error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert--aviso { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert--info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert__close { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 2px; opacity: .7; }
.alert__close:hover { opacity: 1; }
.alert .alert__body, .alert .alert__body p { color: var(--text); }
.alert--inline { margin: 0; }

/* ── Dropdowns ────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown__panel {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; z-index: 50;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 6px; display: none;
}
.dropdown.is-open .dropdown__panel { display: block; }
.dropdown__item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 7px; border: 0;
    background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.dropdown__item:hover { background: var(--surface-3); text-decoration: none; }
.dropdown__item--danger { color: var(--danger); }
.dropdown__sep { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown__header { padding: 8px 10px 10px; }
.user-btn { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 10px; border: 0; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.user-btn:hover { background: var(--surface-3); }
.user-btn__text { text-align: left; line-height: 1.2; }
.user-btn__name { font-weight: 600; font-size: 13px; display: block; }
.user-btn__role { font-size: 11.5px; color: var(--text-3); }
.avatar { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12.5px; flex-shrink: 0; }
.avatar--lg { width: 52px; height: 52px; border-radius: 14px; font-size: 18px; }

.notif-panel { width: 370px; padding: 0; }
.notif-panel__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-panel__head h3 { font-size: 14px; }
.notif-panel__list { max-height: 380px; overflow-y: auto; }
.notif-panel__foot { padding: 10px 14px; border-top: 1px solid var(--border); text-align: center; font-size: 13px; }
.notif { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif__icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-3); color: var(--text-2); }
.notif--info .notif__icon { background: var(--info-soft); color: var(--info); }
.notif--exito .notif__icon { background: var(--success-soft); color: var(--success); }
.notif--aviso .notif__icon { background: var(--warning-soft); color: var(--warning); }
.notif--error .notif__icon { background: var(--danger-soft); color: var(--danger); }
.notif__body { flex: 1; min-width: 0; }
.notif__title { font-weight: 600; font-size: 13.5px; }
.notif__msg { font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.notif__time { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.notif.is-unread .notif__title::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 7px; vertical-align: middle; }
.notif-empty { padding: 30px 14px; text-align: center; color: var(--text-3); }
.notif-page { max-height: none; }

/* ── Pestañas ─────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--text-2); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Listas de datos ──────────────────────────────────── */
.dl { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 10px 20px; margin: 0; }
.dl dt { color: var(--text-3); font-size: 13px; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.list { list-style: none; margin: 0; padding: 0; }
.list__item { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.list__item:last-child { border-bottom: 0; }
.list__icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex-shrink: 0; }
.list__body { flex: 1; min-width: 0; }
.list__title { font-weight: 550; font-size: 13.5px; }
.list__meta { font-size: 12.5px; color: var(--text-3); }

/* ── Estados vacíos ───────────────────────────────────── */
.empty { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--surface-3); color: var(--text-3); }
.empty h3 { color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty p { margin: 0 auto; max-width: 380px; }

/* ── Filtros y paginación ─────────────────────────────── */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.filters .field { min-width: 150px; }
.filters .field--grow { flex: 1; min-width: 200px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); flex-wrap: wrap; }
.pagination__links { display: flex; gap: 6px; }

/* ── Matriz de permisos ───────────────────────────────── */
.perm-module { border-bottom: 1px solid var(--border); padding: 14px 20px; display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
.perm-module:last-child { border-bottom: 0; }
.perm-module__name { font-weight: 650; display: flex; flex-direction: column; gap: 6px; }
.perm-module__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 20px; }
.perm-item small { display: block; color: var(--text-3); font-family: var(--mono); font-size: 11.5px; }

/* ── Modal ────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.is-open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(15, 14, 13, .5); }
.modal__dialog { position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal__head h3 { font-size: 16px; }
.modal__body { padding: 20px; }
.modal__foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ── Resultado de prueba / sync ───────────────────────── */
.result { border-radius: var(--radius); padding: 12px 14px; margin-top: 14px; display: none; }
.result.is-visible { display: block; }
.result--ok { background: var(--success-soft); color: var(--success); }
.result--error { background: var(--danger-soft); color: var(--danger); }
.result .dl { margin-top: 8px; }
.result .dl dd { color: var(--text); }
.stat-row { display: flex; gap: 24px; flex-wrap: wrap; }
.stat-row__item span { display: block; font-size: 12px; color: var(--text-3); }
.stat-row__item strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.pre { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 12px; border-radius: var(--radius-sm); overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; max-height: 360px; }

/* ── Login ────────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth__art {
    position: relative; overflow: hidden; color: #f4efe6; padding: 40px 48px 48px; display: flex; flex-direction: column; justify-content: space-between;
    background: #151312 url("../img/login-arte.svg") center / cover no-repeat;
}
/* Oscurece arriba y abajo para que el logo y el texto se lean sobre la obra. */
.auth__art::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, rgba(10, 9, 8, .55) 0%, rgba(10, 9, 8, 0) 22%, rgba(10, 9, 8, 0) 52%, rgba(10, 9, 8, .88) 82%);
}
.auth__logo { position: relative; z-index: 1; display: inline-flex; align-self: flex-start; padding: 10px 14px; border-radius: 14px; background: #000; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); }
.auth__logo img { display: block; width: 92px; height: auto; image-rendering: auto; }
.auth__logo--movil { display: none; margin-bottom: 24px; }
.auth__quote { max-width: 440px; position: relative; z-index: 1; }
.auth__quote h2 { font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; margin-bottom: 12px; }
.auth__quote p { color: rgba(244, 239, 230, .7); font-size: 15px; }
.auth__panel { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--surface); }
.auth__box { width: 100%; max-width: 380px; }
.auth__box h1 { font-size: 24px; margin-bottom: 6px; }
.auth__box > p { color: var(--text-2); margin-bottom: 24px; }
.auth__links { display: flex; justify-content: space-between; font-size: 13px; margin-top: 4px; }

/* ── Páginas de error ─────────────────────────────────── */
.minimal { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.error-page { text-align: center; max-width: 480px; }
.error-page__code { font-size: 64px; font-weight: 800; letter-spacing: -.04em; color: var(--accent); line-height: 1; }
.error-page h1 { font-size: 20px; margin: 12px 0 8px; }
.error-page p { color: var(--text-2); }
.error-page .pre { text-align: left; margin-top: 16px; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1100px) {
    .grid--main-side { grid-template-columns: 1fr; }
    .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .shell.is-nav-open .sidebar { transform: translateX(0); }
    .shell.is-nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(15, 14, 13, .45); }
    .main { margin-left: 0; }
    .topbar { padding: 0 14px; }
    .icon-btn.topbar__menu { display: inline-flex; }
    .content { padding: 18px 16px 40px; }
    .user-btn__text { display: none; }
    /* Celular: la misma estética que en PC, apilada (obra arriba, formulario como tarjeta debajo). */
    .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth__art { min-height: 46vh; padding: 22px 22px 52px; gap: 24px; }
    .auth__art::before { background: linear-gradient(180deg, rgba(10, 9, 8, .5) 0%, rgba(10, 9, 8, 0) 20%, rgba(10, 9, 8, .35) 45%, rgba(10, 9, 8, .92) 78%); }
    .auth__logo { padding: 8px 12px; border-radius: 12px; }
    .auth__logo img { width: 74px; }
    .auth__quote h2 { font-size: 23px; margin-bottom: 8px; }
    .auth__quote p { font-size: 14px; }
    .auth__panel { position: relative; z-index: 2; align-items: flex-start; margin-top: -28px; padding: 30px 20px 36px; border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .18); }
    .perm-module { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 640px) {
    .grid--2, .grid--3, .form-grid { grid-template-columns: 1fr; }
    .grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi { padding: 14px; min-height: 108px; }
    .kpi__value { font-size: 22px; }
    .kpi__value--money { font-size: 17px; }
    .notif-panel { width: calc(100vw - 24px); right: -60px; }
    .dl { grid-template-columns: 1fr; gap: 2px; }
    .dl dd { margin-bottom: 8px; }
    .page-head { align-items: stretch; }
    .table-responsive thead { display: none; }
    .table-responsive tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
    .table-responsive td { display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr); column-gap: 12px; justify-items: end; border: 0; padding: 6px 16px; text-align: right; overflow-wrap: anywhere; }
    .table-responsive td > * { grid-column: 2; }
    .table-responsive td::before { content: attr(data-label); color: var(--text-3); font-size: 12.5px; text-align: left; grid-column: 1; grid-row: 1 / span 4; justify-self: start; }
    .table-responsive td.actions { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
    .table-responsive td.actions::before { content: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Sistema: versión e historial de cambios ──────────── */
.version-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.version-hero__text { flex: 1; min-width: 160px; }
.version-hero__text h2 { font-size: 22px; }
.card__foot--start { justify-content: flex-start; }
.plain-list { margin: 6px 0 0; padding-left: 18px; }
.plain-list li { margin: 3px 0; }
.changelog { display: flex; flex-direction: column; gap: 22px; }
.changelog__version h3 { font-size: 15px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.changelog__group { margin-top: 10px; }

/* ── Cuadros ──────────────────────────────────────────── */
.cuadros-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; padding: 16px; }
.cuadro-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); color: var(--text); transition: box-shadow .15s, border-color .15s, transform .15s; }
.cuadro-card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.cuadro-card__img { position: relative; aspect-ratio: 4 / 3; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); overflow: hidden; }
.cuadro-card__img img { width: 100%; height: 100%; object-fit: cover; }
.cuadro-card__estado { position: absolute; top: 10px; left: 10px; }
.cuadro-card__estado .badge { box-shadow: var(--shadow-sm); }
.cuadro-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.cuadro-card__codigo { font-size: 12px; color: var(--text-3); }
.cuadro-card__nombre { font-weight: 650; font-size: 14.5px; line-height: 1.3; }
.cuadro-card__meta { font-size: 12.5px; color: var(--text-2); }
.cuadro-card__pie { display: flex; align-items: baseline; gap: 6px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
.cuadro-card__pie .badge { margin-left: auto; }
.cuadro-hero { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; overflow: hidden; }
.cuadro-hero__img { background: var(--surface-3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 240px; color: var(--text-3); text-align: center; padding: 0; }
.cuadro-hero__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cuadro-hero__body { padding: 20px 24px; }
.cuadro-hero__body h2 { font-size: 22px; margin: 2px 0 4px; }
.cuadro-hero__badges { display: flex; gap: 6px; flex-wrap: wrap; }
.thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; display: block; }
.thumb--vacio { display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); }
.thumb-cell { width: 60px; }
.input--sm { height: 32px; font-size: 13px; padding: 0 10px; }
.catalogo-alta { flex-direction: row; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--border); }
.catalogo-alta .input { flex: 1; min-width: 140px; height: 32px; }
.catalogo-alta .select { width: auto; height: 32px; }
.catalogo-item { align-items: center; gap: 4px 8px; padding: 8px 14px; flex-wrap: wrap; }
.catalogo-item .list__meta { flex: 1; padding-left: 2px; }
.catalogo-item__form { display: flex; gap: 4px; flex: 1 1 100%; min-width: 0; }
.catalogo-item.is-inactivo .input { color: var(--text-3); text-decoration: line-through; }
@media (max-width: 640px) {
    .cuadros-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px; }
    .cuadro-hero { grid-template-columns: 1fr; }
    .cuadro-hero__img { min-height: 200px; }
    .catalogo-item { flex-wrap: wrap; }
}

/* ── Alquileres ───────────────────────────────────────── */
.items-alquiler td:first-child { min-width: 190px; }
.items-alquiler th, .items-alquiler td { padding-left: 8px; padding-right: 8px; }
.items-alquiler input[type="date"] { min-width: 132px; padding: 0 8px; }
.items-alquiler .input, .items-alquiler .select { height: 34px; }
.items-alquiler td:nth-child(4) { width: 105px; }
.table tfoot td { padding: 12px 16px; background: var(--surface-2); border-top: 1px solid var(--border); }
.cliente-nuevo summary { cursor: pointer; color: var(--accent); font-weight: 550; font-size: 13px; }
select[size] { height: auto; padding: 4px; background-image: none; }
select[size] option { padding: 4px 6px; border-radius: 4px; }
.tab .badge { margin-left: 2px; line-height: 16px; padding: 1px 7px; font-size: 11px; }
.seleccion-barra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.seleccion-barra .hint { flex-basis: 100%; }

/* ── Select con búsqueda ──────────────────────────────── */
.combo { position: relative; width: 100%; }
.combo__lista { position: fixed; z-index: 120; display: none; margin: 0; padding: 4px; list-style: none; max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.combo__lista.is-open { display: block; }
.combo__lista li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.combo__lista li.is-activo, .combo__lista li[data-i]:hover { background: var(--accent-soft); }
.combo__vacio { color: var(--text-3); cursor: default; }

/* ── Gráficos (SVG generado en el servidor, App\Services\Graficos) ── */
.grafico { display: block; width: 100%; height: auto; overflow: visible; }
.grafico-wrap { width: 100%; }
.grafico-dona { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.grafico--dona { width: 168px; height: 168px; flex: 0 0 168px; transform: rotate(0deg); }
.grafico__centro { font-size: 7px; font-weight: 650; fill: var(--text); }
.grafico__eje { font-size: 11px; fill: var(--text-3); font-family: var(--font); }
.grafico__grilla { stroke: var(--border); stroke-width: 1; }
.g-line { stroke-linejoin: round; stroke-linecap: round; }
.g-track { stroke: var(--surface-3); }
.g-track-fill { fill: var(--surface-3); }
.g-accent { stroke: var(--accent); } .g-fill-accent { fill: var(--accent); } .g-bg-accent { background: var(--accent); }
.g-info { stroke: var(--info); } .g-fill-info { fill: var(--info); } .g-bg-info { background: var(--info); }
.g-info-2 { stroke: var(--info); opacity: .5; } .g-fill-info-2 { fill: var(--info); opacity: .5; } .g-bg-info-2 { background: var(--info); opacity: .5; }
.g-success { stroke: var(--success); } .g-fill-success { fill: var(--success); } .g-bg-success { background: var(--success); }
.g-warning { stroke: var(--warning); } .g-fill-warning { fill: var(--warning); } .g-bg-warning { background: var(--warning); }
.g-warning-2 { stroke: var(--warning); opacity: .55; } .g-fill-warning-2 { fill: var(--warning); opacity: .55; } .g-bg-warning-2 { background: var(--warning); opacity: .55; }
.g-danger { stroke: var(--danger); } .g-fill-danger { fill: var(--danger); } .g-bg-danger { background: var(--danger); }
.g-danger-2 { stroke: var(--danger); opacity: .55; } .g-fill-danger-2 { fill: var(--danger); opacity: .55; } .g-bg-danger-2 { background: var(--danger); opacity: .55; }
.g-neutral { stroke: var(--text-3); } .g-fill-neutral { fill: var(--text-3); } .g-bg-neutral { background: var(--text-3); }
.g-neutral-2 { stroke: var(--border-strong); } .g-fill-neutral-2 { fill: var(--border-strong); } .g-bg-neutral-2 { background: var(--border-strong); }
.leyenda { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; min-width: 180px; flex: 1; }
.leyenda li { display: flex; align-items: center; gap: 8px; }
.leyenda li strong { margin-left: auto; }
.leyenda--fila { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.leyenda--fila li strong { margin-left: 4px; }
.leyenda__marca { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.ranking { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ranking__fila { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.ranking__nombre { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking__barra { display: block; width: 100%; height: 6px; margin-top: 4px; }
.empty--grafico { padding: 28px 16px; }
.variacion { font-size: 12px; font-weight: 650; white-space: nowrap; }
.variacion--sube { color: var(--success); }
.variacion--baja { color: var(--danger); }
.variacion--igual, .variacion--na { color: var(--text-3); }
.kpi__comparacion { display: flex; gap: 6px; align-items: baseline; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.kpi--parcial .kpi__value::after { content: " *"; color: var(--warning); }
.page-head__actions form { display: inline-flex; }

/* ── Finanzas ──────────────────────────────────────────── */
.atajos { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.atajos .is-active { background: var(--accent-soft); color: var(--accent); }
.detalle-config { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; background: var(--surface-2); }
.detalle-config summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.detalle-config[data-inactivo] summary strong { color: var(--text-3); text-decoration: line-through; }
.table tr.muted td { color: var(--text-3); }

/* ── Reportes ──────────────────────────────────────────── */
.reporte-config .filters { border-bottom: 1px solid var(--border); }
.reporte-config__fila { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.reporte-config__filtros { background: var(--surface-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; background: var(--surface); cursor: pointer; }
.chip input { margin: 0; }
.chip--fijo { cursor: default; background: var(--surface-2); color: var(--text-2); font-size: 12px; }
.chips--criterios { margin-top: 6px; }
.kpi--plano { padding: 0; border: 0; box-shadow: none; background: transparent; }
.tabla-reporte tfoot td { background: var(--surface-2); }

/* ── Vista imprimible / PDF ───────────────────────────── */
.impresion { background: #fff; color: #111; }
.impresion__hoja { max-width: 1100px; margin: 0 auto; padding: 24px; }
.impresion__cabecera { display: flex; justify-content: space-between; gap: 12px; border-bottom: 2px solid #111; padding-bottom: 8px; margin-bottom: 16px; font-size: 13px; }
.impresion h1 { font-size: 22px; margin: 0 0 4px; }
.impresion__criterios { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 0; margin: 10px 0 16px; list-style: none; font-size: 12px; color: #444; }
.impresion__grafico { margin-bottom: 16px; }
.impresion .table th, .impresion .table td { font-size: 12px; padding: 6px 8px; }
@media print {
    .no-imprimir, .sidebar, .topbar, .sidebar-backdrop { display: none !important; }
    .impresion__hoja { padding: 0; max-width: none; }
    .table-wrap { overflow: visible; }
    .table thead { display: table-header-group; }
    .table tr { page-break-inside: avoid; }
    .card { box-shadow: none; border: 0; }
    .main { margin: 0; }
}
:root[data-theme="light"] { color-scheme: light; }

/* ── Botón de tema (claro / oscuro) ───────────────────── */
.tema-btn .tema-btn__sol { display: none; }
:root[data-theme="dark"] .tema-btn .tema-btn__sol { display: inline; }
:root[data-theme="dark"] .tema-btn .tema-btn__luna { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .tema-btn .tema-btn__sol { display: inline; }
    :root:not([data-theme="light"]) .tema-btn .tema-btn__luna { display: none; }
}

/* ── Distribución del alquiler ────────────────────────── */
.detalle-linea { margin-top: 4px; font-size: 12.5px; }
.detalle-linea summary { cursor: pointer; color: var(--accent); }
.detalle-linea ul { margin-top: 6px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.input--sm.num { width: 90px; text-align: right; }

/* ── Tareas ───────────────────────────────────────────── */
.tarea { align-items: center; }
.tarea form { display: inline-flex; }
.tarea__check {
    width: 24px; height: 24px; flex-shrink: 0; display: grid; place-items: center; padding: 0;
    border: 1.5px solid var(--border-strong); border-radius: 50%; background: transparent; color: transparent; cursor: pointer;
}
button.tarea__check:hover, button.tarea__check:focus-visible { border-color: var(--success); color: var(--success); background: var(--success-soft); outline: none; }
span.tarea__check { cursor: default; color: var(--text-3); }
.tarea__check.is-hecha { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.tarea--cerrada .list__title, .tarea--cerrada .list__title a { color: var(--text-3); text-decoration: line-through; }
.tarea .list__title a { color: inherit; }
.tarea .list__title .badge { margin-left: 6px; text-decoration: none; }
.tarea__desc { font-size: 13px; color: var(--text-2); margin: 2px 0; overflow-wrap: anywhere; }
.tarea__vencida { color: var(--danger); font-weight: 600; }
.tarea__acciones { display: flex; gap: 2px; flex-shrink: 0; }
@media (max-width: 640px) { .tarea { flex-wrap: wrap; } .tarea__acciones { width: 100%; padding-left: 36px; } }

/* ── Avisar al cliente (WhatsApp) ─────────────────────── */
.stack--sm { gap: 12px; }
.copy-field .btn { flex-shrink: 0; }
.wa-texto { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; padding: 10px 12px; border-radius: 4px 12px 12px 12px; background: var(--success-soft); border: 1px solid color-mix(in srgb, var(--success) 22%, transparent); }
.wa-acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.wa-acciones .btn { flex: 1; justify-content: center; white-space: nowrap; }
.btn--whatsapp { background: #128c4a; border-color: #128c4a; color: #fff; }
.btn--whatsapp:hover { background: #0f7a40; border-color: #0f7a40; color: #fff; text-decoration: none; }

/* ── Página pública de seguimiento ────────────────────── */
.publico { background: var(--bg); }
.publico__top { background: #000; display: flex; justify-content: center; padding: 14px 16px; }
.publico__top img { height: 56px; width: auto; display: block; }
.publico__main { max-width: 560px; margin: 0 auto; padding: 20px 16px 8px; display: flex; flex-direction: column; gap: 16px; }
.publico__pie { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 16px 16px 32px; }
.seg-cabecera { padding: 22px 20px; }
.seg-cabecera__num { margin: 0 0 4px; font-size: 12.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.seg-cabecera h1 { font-size: 24px; letter-spacing: -.02em; margin: 0 0 6px; }
.seg-cabecera p { margin: 0; color: var(--text-2); }
.seg-fechas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.seg-fechas div { padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.seg-fechas span { display: block; font-size: 12px; color: var(--text-3); }
.seg-fechas strong { font-size: 15px; }
.seg-pasos { list-style: none; margin: 0; padding: 18px 20px; }
.seg-paso { position: relative; display: flex; gap: 14px; padding-bottom: 20px; color: var(--text-3); }
.seg-paso:last-child { padding-bottom: 0; }
.seg-paso::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: var(--border); }
.seg-paso:last-child::before { display: none; }
.seg-paso.is-hecho::before { background: var(--success); }
.seg-paso.is-actual::before { background: var(--border); }
.seg-paso__punto { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); background: var(--surface); color: #fff; position: relative; z-index: 1; }
.seg-paso.is-hecho .seg-paso__punto { background: var(--success); border-color: var(--success); }
.seg-paso.is-actual .seg-paso__punto { box-shadow: 0 0 0 4px var(--success-soft); }
.seg-paso__titulo { font-weight: 600; line-height: 26px; }
.seg-paso.is-hecho .seg-paso__titulo { color: var(--text); }
.seg-paso__fecha { font-size: 12.5px; }
.seg-item { align-items: center; }
.seg-item__foto { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0; display: block; background: var(--surface-3); }
.seg-item__foto--vacia { display: grid; place-items: center; color: var(--text-3); }
.seg-importes { grid-template-columns: 1fr auto; }
.seg-importes dd { text-align: right; }
.dash-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; margin-bottom: 26px; }

/* ── Alertas y tarjetas con enlace ────────────────────── */
a.kpi--link { color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.kpi--link:hover, a.kpi--link:focus-visible { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); outline: none; }
.alerta-icono--error { background: var(--danger-soft); color: var(--danger); }
.alerta-icono--aviso { background: var(--warning-soft); color: var(--warning); }
.alerta-icono--info { background: var(--info-soft); color: var(--info); }
.alerta-regla { align-items: center; }
.alerta-regla__plazo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.alerta-regla__plazo .input { width: 76px; }
.check-cell { width: 36px; }
@media (max-width: 640px) { .alerta-regla { flex-wrap: wrap; } .alerta-regla__plazo { width: 100%; padding-left: 42px; } }
