/* ═══════════════════════════════════════════════════════════
   MINDSIGN · Design System
   Plataforma SaaS de firmas institucionales.
   Marca: índigo (distinta del color de cada tenant).
   Estilo: flat premium · modo claro · Plus Jakarta Sans.
   ═══════════════════════════════════════════════════════════ */
:root {
    /* — Escala índigo de marca (Entregable A) — */
    --indigo-50:#EEF0FE; --indigo-100:#E2E5FD; --indigo-200:#C7CCFB;
    --indigo-300:#A5ABF8; --indigo-400:#8B8FF0; --indigo-500:#6366F1;
    --indigo-600:#4F46E5; --indigo-700:#4338CA; --indigo-800:#3730A3;
    --indigo-900:#1E1B4B;
    --brand: #4F46E5;
    --brand-600: #4338CA;
    --brand-500: #6366F1;
    --brand-tint: #EEF0FE;       /* indigo-50 */
    --brand-tint-2: #E2E5FD;     /* indigo-100 */
    --brand-grad: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    --ink: #1E1B4B;

    /* — Neutros fríos (tinte índigo) — */
    --bg: #F6F7FB;
    --surface: #FFFFFF;
    --surface-2: #FBFBFD;
    --n-100:#EDEEF3; --n-200:#E2E3EB; --n-300:#C9CAD6;
    --n-400:#9A9BAE; --n-500:#6B6B85; --n-600:#43435A;
    /* aliases de texto */
    --text: var(--n-600);
    --text-2: var(--n-500);
    --muted: var(--n-500);
    --faint: var(--n-400);

    /* — Hairlines — */
    --line: rgba(30,27,75,.08);
    --line-2: rgba(30,27,75,.12);
    --border: var(--line);
    --border-2: var(--line-2);

    /* — Acento chispa (micro-acentos / estados, nunca superficies) — */
    --spark: #F97316;

    /* — Semánticos — */
    --ok:#1F8A5B; --ok-bg:#E7F5EE;
    --warn:#B45309; --warn-bg:#FBF1E3; --warn-bd:#FCD9A8;
    --danger:#DC2626; --danger-bg:#FCEDED; --danger-bd:#FECACA;
    --success: var(--ok); --success-bg: var(--ok-bg); --success-bd:#BDE6CF;

    /* — Tipo — */
    --font: 'Plus Jakarta Sans', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;

    /* — Radios — */
    --r-sm: 8px; --r: 12px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;

    /* — Sombras (índigo-tinted, premium) — */
    --sh-xs: 0 1px 2px rgba(30,27,75,.05);
    --sh-sm: var(--sh-xs);
    --shadow-sm: var(--sh-xs);
    --sh: 0 1px 2px rgba(30,27,75,.04), 0 10px 28px -14px rgba(30,27,75,.16);
    --shadow: var(--sh);
    --sh-md: 0 2px 4px rgba(30,27,75,.05), 0 24px 56px -22px rgba(30,27,75,.26);
    --sh-lg: var(--sh-md);
    --shadow-lg: var(--sh-md);
    --glow: 0 6px 20px -10px rgba(79,70,229,.32);

    /* — Motion — */
    --ease: cubic-bezier(.2,.7,.3,1);
    --t: 180ms;
    --dur: 180ms;

    /* color de institución — solo vive dentro de la firma */
    --tenant: #A52414;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1, h2, h3 { color: var(--ink); letter-spacing: -.02em; margin: 0; }
::selection { background: var(--brand-tint-2); color: var(--ink); }

/* Iconos */
.ic { display: inline-block; vertical-align: -.18em; flex: 0 0 auto; }

/* Focus accesible */
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }

/* ── Layout ─────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 252px; background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
}
.content { flex: 1; padding: 0 40px 56px; max-width: 1320px; min-width: 0; }

.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 22px; }
.brand--center { justify-content: center; padding-bottom: 26px; }
.brand__mark {
    width: 38px; height: 38px; border-radius: 10px; flex: 0 0 38px;
    background: var(--brand-grad); color: #fff; display: grid; place-items: center;
    font-size: 18px; font-weight: 800; box-shadow: var(--sh-sm), inset 0 1px 0 rgba(255,255,255,.25);
}
.brand strong { font-weight: 800; font-size: 16px; letter-spacing: -.03em; color: var(--ink); }
.brand small { display: block; color: var(--faint); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav__group { font-size: 10px; text-transform: uppercase; color: var(--faint); margin: 16px 10px 6px; letter-spacing: .14em; font-weight: 700; }
.nav__item {
    display: flex; align-items: center; gap: 11px;
    text-decoration: none; color: var(--text-2); padding: 9px 12px; border-radius: var(--r-sm);
    font-size: 13.5px; font-weight: 600; position: relative;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav__item .ic { color: var(--faint); transition: color var(--dur) var(--ease); }
.nav__item:hover { background: var(--surface-2); color: var(--ink); }
.nav__item:hover .ic { color: var(--text-2); }
.nav__item.is-active { background: var(--brand-tint); color: var(--brand-600); }
.nav__item.is-active .ic { color: var(--brand); }
.nav__item.is-active::before {
    content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav__item.is-disabled { color: var(--faint); pointer-events: none; opacity: .6; }

.sidebar__foot { display: flex; align-items: center; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: grid; place-items: center; font-weight: 700; flex: 0 0 36px; box-shadow: var(--sh-xs); }
.sidebar__user { flex: 1; overflow: hidden; }
.sidebar__user strong { font-size: 13px; display: block; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user small { color: var(--faint); font-size: 11px; }
.logout { display: grid; place-items: center; color: var(--faint); border-radius: var(--r-sm); padding: 6px; transition: color var(--dur), background var(--dur); }
.logout:hover { color: var(--danger); background: var(--danger-bg); }

/* ── Topbar ─────────────────────────────────────────── */
.topbar { display: flex; align-items: center; gap: 12px; padding: 28px 0 20px; }
.topbar h1 { font-size: 23px; font-weight: 800; }
.badge { font-size: 10px; padding: 4px 10px; border-radius: var(--r-pill); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 4px; }
.badge--trial { background: var(--brand-tint); color: var(--brand-600); }
.badge--ok { background: var(--success-bg); color: var(--success); }
.badge--off { background: #F1F3F9; color: var(--muted); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }

.tenant-pill {
    display: inline-flex; align-items: center; gap: 8px; margin-left: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill);
    padding: 7px 14px; font-size: 12.5px; color: var(--text-2); font-weight: 600; box-shadow: var(--sh-xs);
}
.tenant-pill strong { color: var(--ink); font-weight: 700; }
.tenant-pill__dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 3px rgba(0,0,0,.04); }

.flash {
    display: flex; align-items: center; gap: 9px;
    background: var(--success-bg); border: 1px solid var(--success-bd); color: #0b6b43;
    padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 18px; font-size: 13.5px; font-weight: 600;
    animation: pop var(--dur) var(--ease) both;
}
.flash--error { background: var(--danger-bg); border-color: var(--danger-bd); color: #b42318; }

/* Entrada suave del contenido */
.page { animation: fadeUp .42s var(--ease) both; }

/* ── KPIs ───────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-grid--3 { grid-template-columns: repeat(3, 1fr); }
.kpi-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
    padding: 18px 20px; box-shadow: var(--sh-sm); position: relative; overflow: hidden;
    transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.kpi-card:hover { box-shadow: var(--sh); transform: translateY(-2px); }
.kpi-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-grad); }
.kpi-card__label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.kpi-card__value { display: block; font-size: 30px; margin-top: 6px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-card__value--sm { font-size: 17px; }

/* ── Cards ──────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 22px 24px; margin-bottom: 20px; box-shadow: var(--sh-sm); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card__head h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--muted); }
.card--warn { border-color: var(--warn-bd); background: var(--warn-bg); }
.card--warn .card__head h2 { color: var(--warn); }
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ── Tablas ─────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.table th, .table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.table thead th { background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; }
.table tbody tr { transition: background var(--dur) var(--ease); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table td strong { color: var(--ink); font-weight: 700; }
.chip { background: #F1F3F9; color: var(--text-2); border-radius: 6px; padding: 3px 9px; font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.chip--default { background: var(--brand-tint); color: var(--brand-600); }

/* ── Botones ────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer; text-decoration: none;
    border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
    padding: 9px 16px; border-radius: var(--r-sm); font: inherit; font-size: 13.5px; font-weight: 700;
    box-shadow: var(--sh-xs);
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
                transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur);
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); color: var(--ink); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn .ic { color: currentColor; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--sh-sm); }
.btn--primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; box-shadow: var(--sh); }
.btn--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--dark:hover { background: #2e2a63; color: #fff; }
.btn--ghost { background: transparent; color: var(--muted); border-color: transparent; box-shadow: none; }
.btn--ghost:hover { color: var(--brand-600); background: var(--brand-tint); }
.btn--secondary { background: var(--surface); border-color: var(--border-2); color: var(--ink); }
.btn--secondary:hover { background: var(--surface-2); border-color: var(--faint); color: var(--ink); }
.btn--sm { padding: 7px 12px; font-size: 12.5px; }
.btn--lg { padding: 12px 22px; font-size: 15px; font-weight: 700; border-radius: var(--r-md); }
.btn--block { width: 100%; justify-content: center; padding: 12px; }

/* ── Cards grid (plantillas / orgs) ─────────────────── */
.page__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 18px; }
.tpl-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
    padding: 18px; box-shadow: var(--sh-sm);
    transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur);
}
.tpl-card:hover { box-shadow: var(--sh-md); transform: translateY(-3px); border-color: var(--border-2); }
.tpl-card__head { display: flex; align-items: center; justify-content: space-between; }
.tpl-card__head h3 { font-size: 16px; font-weight: 800; }
.tpl-card__preview { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 20px; margin: 14px 0; background: var(--surface-2); overflow: auto; }
.tpl-card__actions { display: flex; gap: 8px; align-items: center; }
.tpl-card__actions form { margin: 0; }
.org-stats { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); margin-top: 8px; }
.org-stats strong { color: var(--ink); font-weight: 800; }
.empty { padding: 52px; text-align: center; color: var(--muted); border: 1.5px dashed var(--border-2); border-radius: var(--r); grid-column: 1 / -1; }

/* ── Editor ─────────────────────────────────────────── */
.editor__bar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.input-title { flex: 1; min-width: 240px; padding: 11px 14px; border: 1px solid var(--border-2); border-radius: var(--r-sm); font: inherit; font-size: 15px; font-weight: 700; color: var(--ink); background: var(--surface); transition: border-color var(--dur), box-shadow var(--dur); }
.input-title:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.switch { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.switch input { accent-color: var(--brand); width: 16px; height: 16px; }
.editor__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.editor__col { display: flex; flex-direction: column; gap: 10px; }
.editor__label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.editor__vars { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.chip--var { border: 1px solid var(--brand-tint-2); background: var(--brand-tint); color: var(--brand-600); border-radius: 6px; padding: 3px 9px; font-size: 11.5px; cursor: pointer; font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 600; transition: background var(--dur) var(--ease), color var(--dur), transform var(--dur); }
.chip--var:hover { background: var(--brand); color: #fff; transform: translateY(-1px); }
.code { width: 100%; min-height: 420px; font-family: 'JetBrains Mono', "SF Mono", Menlo, monospace; font-size: 12.5px; line-height: 1.65; padding: 16px; border: 1px solid var(--border-2); border-radius: var(--r-sm); resize: vertical; background: var(--surface-2); color: var(--text); transition: border-color var(--dur), box-shadow var(--dur); }
.code:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); background: var(--surface); }
/* Columna: la firma puede traer banner de campaña y disclaimer como hermanos — van apilados. */
.preview-box { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 24px; background: var(--surface); min-height: 420px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; box-shadow: var(--sh-xs); }

/* ── Formularios ────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field input, .select {
    padding: 11px 14px; border: 1px solid var(--border-2); border-radius: var(--r-sm);
    font: inherit; font-size: 14px; font-weight: 500; background: var(--surface); color: var(--text); width: 100%;
    transition: border-color var(--dur), box-shadow var(--dur);
}
.field input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.emp-editor .card { margin-bottom: 0; }
.org-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }

.search { display: flex; gap: 8px; align-items: center; flex: 1; max-width: 540px; }
.search__input { flex: 1; padding: 10px 14px; border: 1px solid var(--border-2); border-radius: var(--r-sm); font: inherit; font-size: 14px; background: var(--surface); transition: border-color var(--dur), box-shadow var(--dur); }
.search__input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; white-space: nowrap; }
.row-actions form { margin: 0; }
.hidden { display: none; }

/* ── Configuración de institución ───────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.settings-grid .card { margin-bottom: 0; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-input { width: 48px; height: 36px; padding: 2px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }
.logo-row { display: flex; align-items: center; gap: 12px; }
.logo-preview { width: 72px; height: 56px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.settings-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.tip-box { margin-top: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px 16px; font-size: 12.5px; color: var(--text-2); }
.tip-box strong { color: var(--ink); display: block; margin-bottom: 6px; }
.tip-box ol { margin: 0; padding-left: 18px; line-height: 1.7; }
.tip-box code { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-family: 'JetBrains Mono', monospace; font-size: 11px; }
@media (max-width: 1000px) { .settings-grid { grid-template-columns: 1fr; } }

/* ── Login ──────────────────────────────────────────── */
.login-body { display: grid; place-items: center; min-height: 100vh; background:
    radial-gradient(1200px 600px at 50% -10%, var(--brand-tint) 0%, transparent 60%), var(--bg); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 38px; width: 392px; box-shadow: var(--sh-lg); animation: pop .42s var(--ease) both; }
.form { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.form input { padding: 11px 14px; border: 1px solid var(--border-2); border-radius: var(--r-sm); font: inherit; font-size: 14px; font-weight: 500; background: var(--surface); transition: border-color var(--dur), box-shadow var(--dur); }
.form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.login-hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }
.login-hint code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-family: 'JetBrains Mono', monospace; border: 1px solid var(--border); }

/* ── Animaciones ────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.98) translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1000px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .editor__grid { grid-template-columns: 1fr; }
    .cards-grid { grid-template-columns: 1fr; }
    .org-form__grid { grid-template-columns: 1fr; }
    .content { padding: 0 20px 40px; }
}

/* ── Accesibilidad: menos movimiento ────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ═══ Entregable A · refinamientos de marca ═══════════════ */
body { font-family: var(--font); }

/* Wordmark "mindsign" dos tonos */
.wm { font-weight: 800; letter-spacing: -.035em; line-height: 1; font-size: 17px; }
.wm .a { color: var(--ink); }
.wm .b { color: var(--brand); }
.brand__iso { display: block; flex: 0 0 auto; }
.brand__iso path { transition: stroke-dashoffset 1.25s var(--ease); }

/* Escala tipográfica (uso puntual) */
.t-eyebrow { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.t-mono { font-family: var(--mono); font-size: 12px; color: var(--n-500); }
.accent-i { font-style: italic; font-weight: 700; color: var(--brand); }

/* Badge dot (estado) */
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Glow índigo en botón primario */
.btn--primary:hover { box-shadow: var(--glow); transform: translateY(-1px); }

/* Tabs segmentadas (Firma Pro / previews) */
.seg { display: inline-flex; background: var(--n-100); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.seg button { font-family: var(--font); border: none; background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--n-500); padding: 7px 14px; border-radius: 9px; transition: all var(--t) var(--ease); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-xs); }

/* Skeleton shimmer */
.skeleton { height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--n-100), var(--n-200), var(--n-100)); background-size: 200% 100%; animation: ms-sk 1.4s linear infinite; }
@keyframes ms-sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Reveal on load */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } .brand__iso path { stroke-dashoffset: 0 !important; } }

/* Vista en correo · claro / oscuro (Firma Pro) */
.preview-mail { transition: background var(--t) var(--ease), border-color var(--t); }
.preview-mail.dark { background: #0E0E12; border-color: rgba(255,255,255,.08); }

/* ═══ Header grande (Entregable B) ═══════════════════════ */
.topbar { align-items: flex-start; justify-content: space-between; gap: 16px; }
.topbar__title { min-width: 0; }
.topbar__title .t-eyebrow { display: block; margin-bottom: 10px; }
.topbar h1 { font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
.topbar__sub { margin: 10px 0 0; color: var(--n-500); font-size: 14.5px; font-weight: 500; }
.topbar__sub b { color: var(--ink); font-weight: 700; }
.topbar__right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; padding-top: 4px; }
.tenant-pill .lbl { color: var(--n-400); font-weight: 500; font-size: 12px; }
.tenant-pill .tenant-pill__dot { width: 16px; height: 16px; border-radius: 5px; box-shadow: none; }

/* ═══ Tarjetas de organización (consola de plataforma) ═══ */
.filterbar { display: flex; align-items: center; gap: 12px; margin: 4px 0 22px; }
.filterbar .input-search { flex: 1; max-width: 380px; }
.org-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(372px, 1fr)); gap: 18px; }
.org-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); overflow: hidden; position: relative; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.org-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.org-card__strip { height: 5px; width: 100%; }
.org-card__body { padding: 20px 22px; }
.org-card__head { display: flex; align-items: center; gap: 14px; }
.org-avatar { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; flex: none; letter-spacing: .02em; }
.org-card__name { font-weight: 800; font-size: 16px; color: var(--ink); letter-spacing: -.01em; }
.org-card__sub { color: var(--n-500); font-size: 12.5px; margin-top: 1px; }
.org-card__badges { display: flex; gap: 8px; margin-top: 15px; flex-wrap: wrap; align-items: center; }
.gw-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--n-500); }
.gw-badge svg { width: 15px; height: 15px; }
.org-card__stats { display: flex; gap: 26px; margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.org-stat__value { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; line-height: 1; }
.org-stat__label { font-family: var(--mono); font-size: 10.5px; color: var(--n-400); margin-top: 5px; }
.org-card__foot { margin-top: 18px; display: flex; align-items: center; gap: 12px; }
.org-card__foot .btn { flex: 1; }
.org-card__sync { font-family: var(--mono); font-size: 11px; color: var(--n-400); white-space: nowrap; }
.org-card__menu { position: absolute; top: 16px; right: 16px; color: var(--n-400); cursor: pointer; }

/* ═══ Login split-screen (Entregable B) ═══════════════════ */
.auth { display: flex; min-height: 100vh; }
.auth__form { flex: 1 1 50%; display: flex; flex-direction: column; padding: 40px 48px; }
.auth__brand { display: flex; align-items: center; gap: 11px; }
.auth__center { margin: auto; width: 100%; max-width: 392px; }
.auth__center h1 { font-size: 38px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; margin: 0 0 8px; }
.auth__lead { font-size: 15px; line-height: 1.55; color: var(--n-500); margin: 0 0 30px; }
.auth__foot { font-family: var(--mono); font-size: 11px; color: var(--n-400); }
.auth__divider { display: flex; align-items: center; gap: 12px; margin: 4px 0; }
.auth__divider span { font-family: var(--mono); font-size: 11px; color: var(--n-400); white-space: nowrap; }
.auth__divider i { flex: 1; height: 1px; background: var(--line); }
.auth__visual { flex: 1 1 50%; background: linear-gradient(160deg, #F1F2FB, #EAEBF6); border-left: 1px solid var(--line); display: grid; place-items: center; position: relative; overflow: hidden; }
.auth__visual-in { text-align: center; max-width: 420px; padding: 40px; position: relative; z-index: 1; }
.glow-field { position: relative; overflow: hidden; }
.glow-field::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(99,102,241,.10), transparent 72%); top: -180px; left: -120px; pointer-events: none; }
.card--glow { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh), 0 30px 60px -30px rgba(79,70,229,.30); }
.toast { display: inline-flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-md); box-shadow: var(--sh-md); font-size: 14px; font-weight: 500; }
.toast .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ok); }
.gw-logo { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 600; color: var(--n-500); }
.field__label { font-size: 13px; font-weight: 600; color: var(--n-600); }
.input { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); height: 44px; padding: 0 14px; width: 100%; transition: border-color var(--t), box-shadow var(--t); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--indigo-50); }
@media (max-width: 920px) { .auth__visual { display: none; } .auth__form { flex: 1 1 100%; } }

/* ═══════════════════════════════════════════════════════════
   POLISH · chrome de la app (sidebar móvil, flash, modal, toasts)
   ═══════════════════════════════════════════════════════════ */

/* ── Hamburguesa + scrim (sólo móvil) ───────────────────── */
.hamb { display: none; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--ink);
  border-radius: var(--r-sm); cursor: pointer; flex: none; box-shadow: var(--sh-xs); margin-top: 2px; }
.hamb:hover { background: var(--surface-2); }
.scrim { position: fixed; inset: 0; background: rgba(30,27,75,.42); z-index: 40; opacity: 0;
  transition: opacity .22s var(--ease); backdrop-filter: blur(2px); }
.scrim.is-on { opacity: 1; }

@media (max-width: 860px) {
  .hamb { display: inline-flex; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-104%);
    transition: transform .26s var(--ease); box-shadow: var(--sh-md); width: 260px; }
  .sidebar.is-open { transform: none; }
  .content { padding: 0 18px 40px; }
  .topbar { padding-top: 18px; }
  .topbar h1 { font-size: 26px; }
  .topbar__right { display: none; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ── Flash tipado (success / error / info / warn) ────────── */
.flash { gap: 10px; align-items: flex-start; line-height: 1.45; }
.flash__ic { flex: none; display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; margin-top: -1px; }
.flash__msg { flex: 1; }
.flash__x { flex: none; background: transparent; border: none; cursor: pointer; color: inherit;
  opacity: .55; padding: 2px; border-radius: 5px; display: grid; place-items: center; transition: opacity var(--dur); }
.flash__x:hover { opacity: 1; }
.flash--success { background: var(--success-bg); border-color: var(--success-bd); color: #0b6b43; }
.flash--success .flash__ic { background: rgba(31,138,91,.16); color: var(--ok); }
.flash--error { background: var(--danger-bg); border-color: var(--danger-bd); color: #b42318; }
.flash--error .flash__ic { background: rgba(220,38,38,.14); color: var(--danger); }
.flash--info { background: var(--brand-tint); border-color: var(--brand-tint-2); color: var(--brand-700, #4338CA); }
.flash--info .flash__ic { background: rgba(79,70,229,.14); color: var(--brand); }
.flash--warn { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn); }
.flash--warn .flash__ic { background: rgba(180,83,9,.14); color: var(--warn); }
.flash.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity .3s var(--ease), transform .3s var(--ease); }

/* ── Toasts (esquina inferior) ──────────────────────────── */
.toast-host { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toastmsg { pointer-events: auto; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-md);
  box-shadow: var(--sh-md); font-size: 13.5px; font-weight: 600; max-width: 360px;
  opacity: 0; transform: translateY(12px) scale(.97); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.toastmsg.is-on { opacity: 1; transform: none; }
.toastmsg--success { background: #0b5a3a; }
.toastmsg--error { background: #9b1c1c; }
.toastmsg--info { background: var(--ink); }
@media (max-width: 520px) { .toast-host { left: 16px; right: 16px; bottom: 16px; } .toastmsg { max-width: none; } }

/* ── Modal de confirmación ──────────────────────────────── */
.modal-back { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px;
  background: rgba(30,27,75,.5); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s var(--ease); }
.modal-back.is-on { opacity: 1; }
.modal { background: var(--surface); border-radius: var(--r-lg); padding: 28px; width: 100%; max-width: 420px;
  box-shadow: var(--sh-lg); text-align: center; transform: scale(.96) translateY(8px); transition: transform .22s var(--ease); }
.modal-back.is-on .modal { transform: none; }
.modal__ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px;
  background: var(--brand-tint); color: var(--brand); }
.modal__ic--danger { background: var(--danger-bg); color: var(--danger); }
.modal__title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.modal__msg { color: var(--text-2); font-size: 14px; margin: 0 0 22px; line-height: 1.55; }
.modal__actions { display: flex; gap: 10px; justify-content: center; }
.modal__actions .btn { min-width: 120px; justify-content: center; }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: var(--sh-sm); }
.btn--danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; box-shadow: 0 6px 20px -10px rgba(220,38,38,.5); }

/* ── Spinner / loading en botones ───────────────────────── */
.spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  display: inline-block; animation: ms-spin .6s linear infinite; flex: none; }
@keyframes ms-spin { to { transform: rotate(360deg); } }
.btn.is-loading { opacity: .85; cursor: progress; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Página de error (404 / 403 …) ──────────────────────── */
.errpage { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px; gap: 6px; background:
    radial-gradient(1200px 600px at 50% -10%, var(--brand-tint) 0%, transparent 60%), var(--bg); }
.errpage__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.errpage__code { font-family: var(--mono); font-size: 64px; font-weight: 600; color: var(--brand); letter-spacing: -.04em; line-height: 1; }
.errpage__title { font-size: 24px; font-weight: 800; margin: 8px 0 4px; }
.errpage__msg { color: var(--text-2); font-size: 15px; max-width: 420px; margin: 0 0 24px; }

/* ── KPI con ícono ──────────────────────────────────────── */
.kpi-card__top { display: flex; align-items: center; justify-content: space-between; }
.kpi-card__ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand); flex: none; }

/* ── Componentes de IA ──────────────────────────────────── */
.ai-panel { border: 1.5px solid var(--brand-tint-2); background: linear-gradient(180deg, var(--indigo-50), var(--surface)); border-radius: var(--r-md); padding: 14px; }
.ai-panel__head { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 9px; display: flex; align-items: center; gap: 8px; }
.ai-badge { font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #fff; background: linear-gradient(135deg, #6366F1, #4F46E5); padding: 3px 8px; border-radius: var(--r-pill); }
.ai-textarea { width: 100%; font-family: var(--font); font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-sm); padding: 10px 12px; resize: vertical; line-height: 1.5; transition: border-color var(--dur), box-shadow var(--dur); }
.ai-textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.ai-msg { margin-top: 9px; font-size: 12px; padding: 8px 11px; border-radius: var(--r-sm); line-height: 1.45; }
.ai-msg--ok { background: var(--success-bg); color: #0b6b43; }
.ai-msg--warn { background: var(--warn-bg); color: var(--warn); }
.ai-msg a { font-weight: 700; }
.ai-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--brand); background: var(--indigo-50); border: 1px solid var(--brand-tint-2); border-radius: var(--r-pill); padding: 5px 11px; cursor: pointer; transition: background var(--dur); }
.ai-inline:hover { background: var(--brand-tint-2); }

/* ── Editor de campaña (preview en vivo) ────────────────── */
.campaign-editor { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
.campaign-editor__form { display: flex; flex-direction: column; gap: 18px; }
.campaign-editor__form .card { margin: 0; }
.campaign-editor__preview { position: sticky; top: 18px; }
.camp-preview-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; box-shadow: var(--sh-sm); }
.camp-mail { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: var(--sh-xs); }
.camp-mail__head { padding: 13px 18px; border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--ink); }
.camp-mail__body { padding: 18px 20px; }
.camp-mail__body p { font-size: 13px; color: #52525B; margin: 0; }
.camp-banner-ph { height: 64px; border: 1.5px dashed var(--border-2); border-radius: 10px; display: grid; place-items: center; color: var(--faint); font-size: 12px; background: var(--surface-2); }
.camp-stats { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.camp-stat { display: flex; flex-direction: column; gap: 3px; }
.camp-stat__label { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.camp-stat__value { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.camp-stat__url { font-family: var(--mono); font-size: 11px; color: var(--brand); word-break: break-all; line-height: 1.5; }
@media (max-width: 980px) { .campaign-editor { grid-template-columns: 1fr; } .campaign-editor__preview { position: static; } }

/* ── Conexión Google (pasos + copiar) ───────────────────── */
.conn-step { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.conn-step:first-of-type { border-top: none; }
.conn-step__n { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; }
.conn-step strong { font-size: 14px; color: var(--ink); }
.copy-row { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 7px 8px 7px 12px; margin-bottom: 7px; }
.copy-row__lbl { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); flex: none; }
.copy-row__val { font-family: var(--mono); font-size: 11.5px; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-row .btn { flex: none; }

/* ── Kit de marca (Institución) ─────────────────────────── */
.settings-stack { display: flex; flex-direction: column; gap: 18px; max-width: 920px; }
.settings-stack .card { margin: 0; }
.settings-section { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 12px; }
.brand-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.brand-slot { display: flex; flex-direction: column; gap: 7px; }
.brand-slot__label { font-size: 11.5px; font-weight: 700; color: var(--n-600); }
.brand-slot__drop { height: 88px; border: 1.5px dashed var(--border-2); border-radius: var(--r-md); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; transition: border-color var(--dur); }
.brand-slot__drop--dark { background: #0E0E12; border-color: rgba(255,255,255,.12); }
.brand-slot__drop img { max-width: 88%; max-height: 76%; object-fit: contain; }
.brand-slot__empty { color: var(--n-300); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.brand-slot input[type=file] { font-size: 11px; }
.brand-slot__hint { font-size: 10.5px; color: var(--faint); }
.brand-palette { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.brand-color { display: flex; align-items: center; gap: 8px; position: relative; }
.brand-color .color-input { width: 44px; height: 40px; flex: none; }
.brand-color__hex { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; height: 40px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: var(--r-sm); width: 92px; color: var(--ink); background: var(--surface); }
.brand-color__hex:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.brand-color__lbl { font-size: 12px; font-weight: 600; color: var(--n-500); }
.brand-font-sample { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; background: var(--surface-2); font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.brand-font-sample span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 4px; }
@media (max-width: 760px) { .brand-slots, .brand-palette { grid-template-columns: 1fr; } }

/* ── Pill de tenant con logo ────────────────────────────── */
.tenant-pill__logo { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
  overflow: hidden; flex: none; border: 1px solid var(--line); }
.tenant-pill__logo img { max-width: 90%; max-height: 90%; object-fit: contain; display: block; }

/* ── Toggle switch (Firma Pro / variantes) ──────────────── */
.switch { position: relative; display: inline-flex; width: 44px; height: 26px; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { position: absolute; inset: 0; background: var(--n-200); border-radius: var(--r-pill); transition: background var(--t) var(--ease); }
.switch__thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--sh-xs); transition: transform var(--t) var(--ease); }
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(18px); }

/* ── Firma Pro · editor visual ──────────────────────────── */
.fpro { display: grid; grid-template-columns: 1.55fr 1fr; min-height: calc(100vh - 0px); }
.fpro__preview { padding: 32px 36px; background: var(--bg); position: relative; overflow: auto; transition: background var(--t) var(--ease); }
.fpro__preview.dark { background: #0E0E12; }
.fpro__controls { padding: 28px 26px; border-left: 1px solid var(--line); background: var(--surface); overflow: auto; }
.fpro__email { max-width: 620px; background: #fff; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--sh); overflow: hidden; transition: background var(--t), border-color var(--t); }
.fpro__preview.dark .fpro__email { background: #1A1A20; border-color: rgba(255,255,255,.08); }
.fpro__email-head { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.fpro__preview.dark .fpro__email-head { border-color: rgba(255,255,255,.07); }
.fpro__email-subj { font-size: 13px; font-weight: 700; color: var(--ink); }
.fpro__preview.dark .fpro__email-subj { color: #fff; }
.fpro__email-to { font-size: 11.5px; color: var(--n-400); margin-top: 3px; }
.fpro__email-body { padding: 22px 24px; }
.fpro__email-body p { font-size: 13.5px; color: #52525B; margin: 0 0 6px; line-height: 1.6; }
.fpro__preview.dark .fpro__email-body p { color: rgba(255,255,255,.8); }
.fpro__sig { animation: sigReveal .7s var(--ease) both; }
@keyframes sigReveal { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
.fpro__note { display: flex; align-items: center; gap: 8px; margin-top: 16px; max-width: 620px; font-size: 12.5px; color: var(--n-500); }
.fpro__note.dark { color: rgba(255,255,255,.6); }
.fpro__note .ok { width: 18px; height: 18px; border-radius: 50%; background: var(--ok); display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 900; flex: none; }
.fpro-layouts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 24px; }
.fpro-layout { padding: 10px 8px; border-radius: 10px; cursor: pointer; text-align: center; border: 1.5px solid var(--border-2); background: var(--surface); transition: all .15s var(--ease); }
.fpro-layout:hover { border-color: var(--n-300); }
.fpro-layout.on { border-color: var(--brand); background: var(--indigo-50); }
.fpro-layout svg { display: block; margin: 0 auto 6px; }
.fpro-layout span { font-size: 11px; font-weight: 600; color: var(--n-500); }
.fpro-layout.on span { color: var(--brand); }
.field-mini { display: flex; flex-direction: column; gap: 5px; }
.field-mini label { font-size: 11.5px; font-weight: 600; color: var(--n-500); }
.field-mini input { font-family: var(--font); font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--border-2); border-radius: 9px; height: 38px; padding: 0 11px; width: 100%; transition: border-color .18s, box-shadow .18s; }
.field-mini input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--indigo-50); }
.tog { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; }
.tog span.lbl { font-size: 13px; font-weight: 600; color: var(--ink); }
.fpro-apply-overlay { position: fixed; inset: 0; background: rgba(246,247,251,.93); backdrop-filter: blur(5px); display: grid; place-items: center; z-index: 90; }
.fpro-apply-overlay[hidden] { display: none; }
[hidden] { display: none !important; }
.fpro-apply-overlay.dark { background: rgba(14,14,18,.9); }
.t-h3 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
@media (max-width: 980px) { .fpro { grid-template-columns: 1fr; } .fpro__controls { border-left: none; border-top: 1px solid var(--line); } }

/* ── Dashboard · accesos a funciones ────────────────────── */
.dash-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.dash-feat { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-sm); text-decoration: none;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur); }
.dash-feat:hover { transform: translateY(-2px); box-shadow: var(--sh); border-color: var(--border-2); }
.dash-feat__ic { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-tint); color: var(--brand);
  display: grid; place-items: center; flex: none; }
.dash-feat__body { flex: 1; min-width: 0; }
.dash-feat__body strong { display: block; color: var(--ink); font-size: 14.5px; font-weight: 700; }
.dash-feat__body span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.dash-feat__arrow { color: var(--faint); flex: none; transition: transform var(--dur) var(--ease), color var(--dur); }
.dash-feat:hover .dash-feat__arrow { color: var(--brand); transform: translateX(3px); }
@media (max-width: 760px) { .dash-feats { grid-template-columns: 1fr; } }

/* ── Empty state rico ───────────────────────────────────── */
.empty-rich { text-align: center; padding: 48px 32px; border: 1.5px dashed var(--border-2);
  border-radius: var(--r-lg); background: var(--surface-2); }
.empty-rich__ic { width: 56px; height: 56px; border-radius: 16px; background: var(--surface); color: var(--brand);
  display: grid; place-items: center; margin: 0 auto 16px; box-shadow: var(--sh-sm); border: 1px solid var(--border); }
.empty-rich h3 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.empty-rich p { color: var(--text-2); font-size: 13.5px; max-width: 380px; margin: 0 auto 18px; line-height: 1.6; }

/* ── Institución activa en sidebar (logo grande) ── */
.org-brand { display: flex; align-items: center; gap: 11px; padding: 12px; margin: 2px 0 6px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; }
.org-brand__logo { width: 46px; height: 46px; flex: none; border-radius: 11px; background: #fff;
  border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden;
  font-weight: 800; font-size: 18px; }
.org-brand__logo img { max-width: 84%; max-height: 84%; object-fit: contain; display: block; }
.org-brand__meta { min-width: 0; flex: 1; }
.org-brand__meta strong { display: block; font-size: 13.5px; font-weight: 800; color: var(--ink);
  letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-brand__status { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px;
  font-weight: 600; margin-top: 3px; }
.org-brand__status .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.org-brand__status.is-on { color: #0E7A5F; } .org-brand__status.is-on .dot { background: #16A34A; }
.org-brand__status.is-off { color: var(--n-400); } .org-brand__status.is-off .dot { background: var(--n-300); }

/* topbar: logo de tenant un poco más grande y nítido */
.tenant-pill__logo { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  overflow: hidden; border: 1px solid var(--border); flex: none; }
.tenant-pill__logo img { max-width: 86%; max-height: 86%; object-fit: contain; display: block; }

/* ── Editor de diseño de tarjeta (settings) ── */
.card-styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.card-style { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 12px; border: 1.5px solid var(--border-2); border-radius: 14px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s; background: var(--surface); }
.card-style:hover { border-color: var(--n-300); }
.card-style.is-on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); background: var(--surface); }
.card-style input { position: absolute; opacity: 0; pointer-events: none; }
.card-style strong { font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 8px; }
.card-style small { font-size: 11px; color: var(--n-500); line-height: 1.4; }
.card-style__demo { width: 100%; height: 58px; border-radius: 10px; border: 1px solid var(--border);
  position: relative; overflow: hidden; display: grid; place-items: center; background: #F6F8FC; }
.card-style__demo i { position: absolute; }
/* mini-mock aurora */
.card-style__demo--aurora { background: radial-gradient(60px 60px at 75% 20%, color-mix(in srgb, var(--c) 30%, transparent), transparent), radial-gradient(50px 50px at 20% 80%, color-mix(in srgb, var(--a) 30%, transparent), transparent), #F6F8FC; }
.card-style__demo--aurora i:first-child { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(from 0deg, var(--c), var(--a), var(--c)); }
.card-style__demo--aurora i:last-child { display: none; }
/* mini-mock minimal */
.card-style__demo--minimal { background: #fff; }
.card-style__demo--minimal i:first-child { width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--c) 22%, #fff); border: 2px solid var(--c); }
.card-style__demo--minimal i:last-child { display: none; }
/* mini-mock bold */
.card-style__demo--bold i:first-child { position: absolute; top: 0; left: 0; right: 0; height: 26px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 62%, #000)); }
.card-style__demo--bold i:last-child { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); margin-top: 8px; z-index: 1; }
/* mini-mock dark */
.card-style__demo--dark { background: #0A1020; }
.card-style__demo--dark i:first-child { width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--c) 70%, #fff); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 70%, transparent); }
.card-style__demo--dark i:last-child { position: absolute; bottom: 8px; left: 12px; right: 12px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--a) 60%, #1A2540); }
/* mini-mock editorial */
.card-style__demo--editorial { background: #FBFAF7; }
.card-style__demo--editorial i:first-child { width: 22px; height: 22px; border-radius: 4px; background: var(--c); position: absolute; top: 14px; left: 14px; }
.card-style__demo--editorial i:last-child { position: absolute; top: 18px; left: 44px; right: 14px; height: 8px; border-radius: 2px; background: repeating-linear-gradient(var(--ink, #0A1A3A) 0 2px, transparent 2px 5px); opacity: .5; }
/* mini-mock glass */
.card-style__demo--glass { background: linear-gradient(135deg, var(--c), var(--a)); }
.card-style__demo--glass i:first-child { width: 70%; height: 60%; border-radius: 10px; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.45); backdrop-filter: blur(4px); }
.card-style__demo--glass i:last-child { display: none; }
/* mini-mock mono */
.card-style__demo--mono { background: #F2F2F0; }
.card-style__demo--mono i:first-child { width: 30px; height: 24px; background: #fff; border: 2px solid #111; box-shadow: 4px 4px 0 var(--c); }
.card-style__demo--mono i:last-child { display: none; }
/* mini-mock gradient */
.card-style__demo--gradient { background: linear-gradient(150deg, var(--c), var(--a)); }
.card-style__demo--gradient i:first-child { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.9); }
.card-style__demo--gradient i:last-child { display: none; }
/* mini-mock soft */
.card-style__demo--soft { background: color-mix(in srgb, var(--c) 10%, #fff); }
.card-style__demo--soft i:first-child { width: 62%; height: 58%; border-radius: 14px; background: #fff; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--c) 50%, transparent); }
.card-style__demo--soft i:last-child { display: none; }

.card-toggles { display: flex; flex-wrap: wrap; gap: 18px; }
.card-toggle { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600;
  color: var(--ink); cursor: pointer; user-select: none; }
.card-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.card-toggle__sw { width: 38px; height: 22px; border-radius: 999px; background: var(--n-200); position: relative;
  transition: background .18s; flex: none; }
.card-toggle__sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .18s; }
.card-toggle input:checked + .card-toggle__sw { background: var(--brand); }
.card-toggle input:checked + .card-toggle__sw::after { transform: translateX(16px); }
.card-toggle input:focus-visible + .card-toggle__sw { box-shadow: 0 0 0 3px var(--brand-tint); }
@media (max-width: 600px) { .card-styles { grid-template-columns: 1fr; } }

/* ── Tipografía de marca (settings) ── */
.bfont__opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bfont__opt { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--border-2);
  border-radius: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s; background: var(--surface); }
.bfont__opt:hover { border-color: var(--n-300); }
.bfont__opt.is-on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.bfont__opt input { position: absolute; opacity: 0; pointer-events: none; }
.bfont__opt strong { font-size: 13px; font-weight: 700; color: var(--ink); }
.bfont__opt small { font-size: 11px; color: var(--n-500); }
.bfont__panel { display: none; margin-top: 14px; }
@media (max-width: 600px) { .bfont__opts { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════════
   PANEL OVERHAUL v2 (2026-06) — pulido cohesivo, premium
   ═══════════════════════════════════════════════════════════ */
/* Ritmo de contenido y topbar */
.content { padding: 0 44px 64px; }
.topbar { padding: 30px 0 20px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.topbar h1 { letter-spacing: -.035em; }
.page { padding-top: 22px; }

/* Sidebar más respirada + items redondeados */
.sidebar { padding: 22px 16px; }
.nav__item { border-radius: 11px; padding: 9px 12px; font-weight: 600; }
.nav__item.is-active { font-weight: 700; }
.nav__group { margin: 18px 12px 8px; }

/* KPI cards — más presencia, icono en chip, número grande, hover suave */
.kpi-card { border: 1px solid var(--border); border-radius: 18px; padding: 20px 20px 18px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; overflow: hidden; }
.kpi-card::before { display: none; }
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -22px rgba(16,24,40,.3); border-color: var(--brand-tint-2); }
.kpi-card__ic { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-tint); color: var(--brand); }
.kpi-card__label { font-size: 11px; }
.kpi-card__value { font-size: 34px; margin-top: 16px; }
.kpi-card__value--sm { font-size: 18px; margin-top: 18px; }
.kpi-grid { gap: 18px; margin-bottom: 26px; }

/* Cards / secciones — radio mayor, sombra sutil, aire */
.card { border-radius: 18px; padding: 24px 26px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card__head { margin-bottom: 16px; }
.card__head h2 { font-size: 12.5px; letter-spacing: .12em; }

/* Tablas — esquinas y cabecera */
.table { border-radius: 14px; }
.table thead th { font-size: 11px; letter-spacing: .1em; }
.table th, .table td { padding: 14px 18px; }

/* dash-feat / tpl-card — radios consistentes */
.dash-feats { gap: 18px; }
.dash-feat { border-radius: 16px; padding: 18px 20px; }
.dash-feat__ic { background: var(--brand-tint); color: var(--brand); }
.tpl-card { border-radius: 18px; }
.tpl-card__preview { border-radius: 12px; }

/* page__head con un poco más de aire */
.page__head { margin-bottom: 24px; }

/* Topbar tenant pill un poco más sólida */
.tenant-pill { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 7px 14px 7px 10px; display: inline-flex; align-items: center; gap: 9px; box-shadow: var(--sh-xs); }

/* Flash más premium */
.flash { border-radius: 14px; }

@media (max-width: 720px) {
  .content { padding: 0 20px 48px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .dash-feats { grid-template-columns: 1fr; }
}

/* ════════ CONEXIÓN GOOGLE WORKSPACE v2 ════════ */
.gwc__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.gwc__head-l { display: flex; align-items: flex-start; gap: 13px; min-width: 0; }
.gwc__glogo { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: #fff; display: grid; place-items: center; flex: none; box-shadow: var(--sh-xs); }
.gwc__glogo svg { width: 23px; height: 23px; }
.gwc__sub { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); max-width: 520px; line-height: 1.5; }
.gwc__status { display: inline-flex; align-items: center; gap: 7px; flex: none; font-size: 12px; font-weight: 700; padding: 6px 13px; border-radius: 999px; }
.gwc__status .dot { width: 7px; height: 7px; border-radius: 50%; }
.gwc__status.is-ok { color: var(--success); background: var(--ok-bg, #ecfdf5); border: 1px solid #a7f3d0; }
.gwc__status.is-ok .dot { background: var(--success); box-shadow: 0 0 0 3px rgba(5,150,105,.15); }
.gwc__status.is-off { color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }
.gwc__status.is-off .dot { background: var(--n-400, #9ca3af); }

.gwc__ok { display: flex; align-items: center; gap: 13px; background: var(--ok-bg, #ecfdf5); border: 1px solid #a7f3d0; border-radius: var(--r); padding: 14px 16px; }
.gwc__ok-ic { width: 34px; height: 34px; border-radius: 50%; background: var(--success); color: #fff; display: grid; place-items: center; flex: none; }
.gwc__ok-txt { flex: 1; min-width: 0; }
.gwc__ok-txt strong { display: block; color: var(--ink); font-size: 14px; }
.gwc__ok-txt p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); }
.gwc__ok-txt code { font-family: var(--mono); font-size: 11.5px; background: #fff; border: 1px solid #a7f3d0; border-radius: 5px; padding: 1px 6px; color: var(--ink); }

.gwc__reconf { margin-top: 14px; }
.gwc__reconf > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--brand); user-select: none; padding: 6px 0; }
.gwc__reconf > summary::-webkit-details-marker { display: none; }
.gwc__reconf > summary svg { width: 14px; height: 14px; }

.gwc__intro { font-size: 13px; color: var(--text-2); margin: 14px 0 16px; line-height: 1.55; }

.gwc__steps { list-style: none; margin: 0; padding: 0; }
.gwc__step { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.gwc__step::before { content: ''; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.gwc__step:last-child { padding-bottom: 0; }
.gwc__step:last-child::before { display: none; }
.gwc__num { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-grad, var(--brand)); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; z-index: 1; box-shadow: 0 2px 8px rgba(79,70,229,.3); }
.gwc__step-body { flex: 1; min-width: 0; padding-top: 4px; }
.gwc__step-body > strong { font-size: 14px; color: var(--ink); }
.gwc__hint { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

.gwc__path { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 9px 0 11px; }
.gwc__path span { font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; }
.gwc__path span.is-cta { color: var(--brand); background: var(--brand-tint); border-color: #d9deff; font-weight: 700; }
.gwc__path i { color: var(--n-400, #9ca3af); font-style: normal; font-size: 12px; }

.copy-btn.is-copied { color: var(--success) !important; border-color: #a7f3d0 !important; background: var(--ok-bg, #ecfdf5) !important; }
.copy-btn svg { width: 14px; height: 14px; }
