/**
 * PushCenter — sistema de diseño
 * ---------------------------------------------------------------------------
 * Variables, reinicio, tipografía y utilidades. El color primario lo inyecta
 * el layout con el color de la empresa activa, y todos los tonos derivan de
 * él, así que la marca se propaga a toda la interfaz sin tocar el CSS.
 */

/* ------------------------------------------------------------------ */
/* Variables                                                           */
/* ------------------------------------------------------------------ */

:root {
    /* La empresa activa sobrescribe estas dos desde el layout. */
    --pc-primary: #4f46e5;
    --pc-primary-hover: #4338ca;
    --pc-primary-text: #ffffff;
    --pc-primary-soft: #eef2ff;
    --pc-secondary: #7c3aed;

    /* Semánticos */
    --pc-success: #10b981;
    --pc-success-soft: #ecfdf5;
    --pc-warning: #f59e0b;
    --pc-warning-soft: #fffbeb;
    --pc-danger: #ef4444;
    --pc-danger-soft: #fef2f2;
    --pc-info: #3b82f6;
    --pc-info-soft: #eff6ff;

    /* Superficies y texto (tema claro) */
    --pc-bg: #f6f7fb;
    --pc-surface: #ffffff;
    --pc-surface-2: #fafbfd;
    --pc-surface-hover: #f3f4f6;
    --pc-border: #e5e7eb;
    --pc-border-strong: #d1d5db;
    --pc-text: #111827;
    --pc-text-soft: #6b7280;
    --pc-text-faint: #9ca3af;
    --pc-sidebar-bg: #ffffff;
    --pc-sidebar-text: #4b5563;

    /* Formas */
    --pc-radius-sm: 6px;
    --pc-radius: 10px;
    --pc-radius-lg: 14px;
    --pc-radius-xl: 20px;

    --pc-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --pc-shadow: 0 1px 3px rgba(16, 24, 40, .1), 0 1px 2px rgba(16, 24, 40, .06);
    --pc-shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
    --pc-shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
    --pc-shadow-xl: 0 24px 56px rgba(16, 24, 40, .18);

    --pc-sidebar-width: 260px;
    --pc-sidebar-collapsed: 76px;
    --pc-topbar-height: 62px;

    --pc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Inter, Arial, "Noto Sans", sans-serif;
    --pc-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    --pc-transition: .18s cubic-bezier(.4, 0, .2, 1);
}

/* Tema oscuro: por preferencia del sistema o por elección explícita. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --pc-bg: #0b1020;
        --pc-surface: #151b2e;
        --pc-surface-2: #1b2237;
        --pc-surface-hover: #232b42;
        --pc-border: #2a3350;
        --pc-border-strong: #3b466b;
        --pc-text: #e8eaf2;
        --pc-text-soft: #9aa3bd;
        --pc-text-faint: #6f7899;
        --pc-sidebar-bg: #111728;
        --pc-sidebar-text: #b9c0d6;
        --pc-primary-soft: #1e2547;
        --pc-success-soft: #0d2b22;
        --pc-warning-soft: #2e2413;
        --pc-danger-soft: #34161a;
        --pc-info-soft: #12203c;
        --pc-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --pc-shadow: 0 1px 3px rgba(0, 0, 0, .5);
        --pc-shadow-md: 0 4px 14px rgba(0, 0, 0, .5);
        --pc-shadow-lg: 0 12px 34px rgba(0, 0, 0, .55);
        --pc-shadow-xl: 0 24px 60px rgba(0, 0, 0, .6);
    }
}

:root[data-theme="dark"] {
    --pc-bg: #0b1020;
    --pc-surface: #151b2e;
    --pc-surface-2: #1b2237;
    --pc-surface-hover: #232b42;
    --pc-border: #2a3350;
    --pc-border-strong: #3b466b;
    --pc-text: #e8eaf2;
    --pc-text-soft: #9aa3bd;
    --pc-text-faint: #6f7899;
    --pc-sidebar-bg: #111728;
    --pc-sidebar-text: #b9c0d6;
    --pc-primary-soft: #1e2547;
    --pc-success-soft: #0d2b22;
    --pc-warning-soft: #2e2413;
    --pc-danger-soft: #34161a;
    --pc-info-soft: #12203c;
    --pc-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --pc-shadow: 0 1px 3px rgba(0, 0, 0, .5);
    --pc-shadow-md: 0 4px 14px rgba(0, 0, 0, .5);
    --pc-shadow-lg: 0 12px 34px rgba(0, 0, 0, .55);
    --pc-shadow-xl: 0 24px 60px rgba(0, 0, 0, .6);
}

/* ------------------------------------------------------------------ */
/* Reinicio                                                            */
/* ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

/* El `display:none` que trae el atributo `hidden` lo gana en especificidad
   cualquier clase que fije un `display` —y aquí casi todas lo fijan—, así que
   ocultar algo por código dejaba de funcionar en cuanto tenía clase. */
[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--pc-font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--pc-text);
    background: var(--pc-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 .5em;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -.011em;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.28rem; }
h3 { font-size: 1.08rem; }
h4 { font-size: .98rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a {
    color: var(--pc-primary);
    text-decoration: none;
    transition: color var(--pc-transition);
}

a:hover { text-decoration: underline; }

img, svg, video { max-width: 100%; height: auto; vertical-align: middle; }

hr {
    border: 0;
    border-top: 1px solid var(--pc-border);
    margin: 1.5rem 0;
}

code, pre, kbd {
    font-family: var(--pc-mono);
    font-size: .875em;
}

:focus-visible {
    outline: 2px solid var(--pc-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection {
    background: var(--pc-primary);
    color: var(--pc-primary-text);
}

/* Barras de desplazamiento discretas. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--pc-border-strong) transparent;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }

*::-webkit-scrollbar-thumb {
    background: var(--pc-border-strong);
    border-radius: 6px;
    border: 3px solid transparent;
    background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover { background-color: var(--pc-text-faint); background-clip: content-box; }

/* ------------------------------------------------------------------ */
/* Tipografía auxiliar                                                 */
/* ------------------------------------------------------------------ */

.pc-title      { font-size: 1.5rem; font-weight: 680; letter-spacing: -.02em; margin: 0; }
.pc-subtitle   { color: var(--pc-text-soft); font-size: .93rem; margin: .25rem 0 0; }
.pc-section    { font-size: .78rem; font-weight: 700; text-transform: uppercase;
                 letter-spacing: .07em; color: var(--pc-text-faint); }
.pc-muted      { color: var(--pc-text-soft); }
.pc-faint      { color: var(--pc-text-faint); }
.pc-small      { font-size: .86rem; }
.pc-xs         { font-size: .78rem; }
.pc-strong     { font-weight: 650; }
.pc-num        { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.pc-truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-break      { word-break: break-word; overflow-wrap: anywhere; }
.pc-center     { text-align: center; }
.pc-right      { text-align: right; }
.pc-mono       { font-family: var(--pc-mono); font-size: .85em; }

.pc-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ------------------------------------------------------------------ */
/* Disposición                                                         */
/* ------------------------------------------------------------------ */

.pc-flex     { display: flex; }
.pc-inline   { display: inline-flex; }
.pc-col      { flex-direction: column; }
.pc-wrap     { flex-wrap: wrap; }
.pc-center-y { align-items: center; }
.pc-center-x { justify-content: center; }
.pc-between  { justify-content: space-between; }
.pc-end      { justify-content: flex-end; }
.pc-grow     { flex: 1 1 auto; min-width: 0; }
.pc-shrink-0 { flex-shrink: 0; }

.pc-gap-1 { gap: .25rem; }
.pc-gap-2 { gap: .5rem; }
.pc-gap-3 { gap: .75rem; }
.pc-gap-4 { gap: 1rem; }
.pc-gap-5 { gap: 1.5rem; }
.pc-gap-6 { gap: 2rem; }

.pc-grid { display: grid; gap: 1.25rem; }

.pc-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pc-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pc-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pc-grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Rejilla de dos columnas para editores: contenido + vista previa. */
.pc-grid-editor { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }

.pc-mt-0 { margin-top: 0; }
.pc-mt-1 { margin-top: .25rem; }
.pc-mt-2 { margin-top: .5rem; }
.pc-mt-3 { margin-top: .75rem; }
.pc-mt-4 { margin-top: 1rem; }
.pc-mt-5 { margin-top: 1.5rem; }
.pc-mt-6 { margin-top: 2rem; }
.pc-mb-0 { margin-bottom: 0; }
.pc-mb-2 { margin-bottom: .5rem; }
.pc-mb-3 { margin-bottom: .75rem; }
.pc-mb-4 { margin-bottom: 1rem; }
.pc-mb-5 { margin-bottom: 1.5rem; }
.pc-mb-6 { margin-bottom: 2rem; }

.pc-w-full { width: 100%; }
.pc-hidden { display: none !important; }

.pc-sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ------------------------------------------------------------------ */
/* Colores de texto y fondo semánticos                                 */
/* ------------------------------------------------------------------ */

.pc-text-success { color: var(--pc-success); }
.pc-text-danger  { color: var(--pc-danger); }
.pc-text-warning { color: var(--pc-warning); }
.pc-text-info    { color: var(--pc-info); }
.pc-text-primary { color: var(--pc-primary); }

/* ------------------------------------------------------------------ */
/* Impresión                                                           */
/* ------------------------------------------------------------------ */

@media print {
    .pc-sidebar, .pc-topbar, .pc-no-print, .pc-toasts { display: none !important; }
    .pc-main { margin: 0 !important; padding: 0 !important; }
    body { background: #fff; }
    .pc-card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ------------------------------------------------------------------ */
/* Adaptación a pantallas pequeñas                                     */
/* ------------------------------------------------------------------ */

@media (max-width: 1200px) {
    .pc-grid-editor { grid-template-columns: minmax(0, 1fr); }
    .pc-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .pc-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    body { font-size: 14.5px; }
    .pc-grid-2, .pc-grid-3, .pc-grid-4 { grid-template-columns: minmax(0, 1fr); }
    .pc-title { font-size: 1.3rem; }
}
