/* RoPrint — design tokens. Fuente única de verdad de paleta, tipografía, motion y geometría. */

:root,
[data-rp-theme="light"] {
    /* === Marca === */
    --rp-brand-lime: #8BC34A;
    --rp-brand-lime-soft: #DCEDC8;
    --rp-brand-green: #43A047;
    --rp-brand-forest: #1B5E20;
    --rp-brand-deep: #0F2912;

    /* === Texto y superficies === */
    --rp-ink: #0F1115;
    --rp-ink-muted: #5C6660;
    --rp-line: #E2E8E2;
    --rp-surface: #FFFFFF;
    --rp-surface-2: #F5F7F5;

    /* === Estados semánticos === */
    --rp-success: #43A047;
    --rp-success-soft: #DCEDC8;
    --rp-warning: #F57C00;
    --rp-warning-soft: #FFE0B2;
    --rp-danger: #D32F2F;
    --rp-danger-soft: #FFCDD2;
    --rp-info: #1976D2;
    --rp-info-soft: #BBDEFB;

    /* === Geometría === */
    --rp-radius-xs: 4px;
    --rp-radius-sm: 6px;
    --rp-radius-md: 10px;
    --rp-radius-lg: 16px;
    --rp-radius-pill: 9999px;

    /* === Sombras (rampa completa) === */
    --rp-shadow-xs: 0 1px 2px rgba(15, 41, 18, 0.04);
    --rp-shadow-sm: 0 1px 2px rgba(15, 41, 18, 0.04), 0 1px 3px rgba(15, 41, 18, 0.06);
    --rp-shadow-md: 0 4px 12px rgba(15, 41, 18, 0.08), 0 2px 4px rgba(15, 41, 18, 0.06);
    --rp-shadow-lg: 0 12px 24px rgba(15, 41, 18, 0.12), 0 4px 8px rgba(15, 41, 18, 0.08);
    --rp-shadow-xl: 0 20px 40px rgba(15, 41, 18, 0.16), 0 8px 16px rgba(15, 41, 18, 0.10);
    --rp-shadow-hero: 0 24px 48px rgba(15, 41, 18, 0.18), 0 8px 16px rgba(15, 41, 18, 0.12);
    --rp-shadow-inset: inset 0 1px 2px rgba(15, 41, 18, 0.06);
    --rp-shadow-glow-lime: 0 0 0 4px color-mix(in srgb, var(--rp-brand-lime) 25%, transparent);

    /* === Focus rings === */
    --rp-focus-ring: 0 0 0 3px color-mix(in srgb, var(--rp-brand-green) 30%, transparent);
    --rp-focus-ring-danger: 0 0 0 3px color-mix(in srgb, var(--rp-danger) 30%, transparent);

    /* === Motion / easing === */
    --rp-motion-fast: 150ms;
    --rp-motion-base: 200ms;
    --rp-motion-slow: 300ms;
    --rp-easing-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --rp-easing-decelerate: cubic-bezier(0, 0, 0.2, 1);
    --rp-easing-accelerate: cubic-bezier(0.4, 0, 1, 1);
    --rp-easing-spring: cubic-bezier(0.16, 1, 0.3, 1);

    /* === Z-index scale === */
    --rp-z-sticky: 100;
    --rp-z-drawer: 1200;
    --rp-z-dropdown: 1300;
    --rp-z-modal: 1400;
    --rp-z-toast: 1500;
    --rp-z-tooltip: 1600;

    /* === Densidad de tablas === */
    --rp-row-height-comfortable: 48px;
    --rp-row-height-compact: 36px;
    --rp-cell-padding-comfortable: 12px 16px;
    --rp-cell-padding-compact: 6px 10px;

    /* === Spacing scale (alias) === */
    --rp-space-1: 4px;
    --rp-space-2: 8px;
    --rp-space-3: 12px;
    --rp-space-4: 16px;
    --rp-space-5: 24px;
    --rp-space-6: 32px;
    --rp-space-7: 48px;

    /* === Gradientes de marca === */
    --rp-gradient-brand: linear-gradient(135deg, var(--rp-brand-lime) 0%, var(--rp-brand-green) 50%, var(--rp-brand-forest) 100%);
    --rp-gradient-hero: linear-gradient(160deg, var(--rp-brand-forest) 0%, var(--rp-brand-deep) 100%);

    /* === Layout === */
    --rp-drawer-width: 260px;
    --rp-drawer-width-mini: 72px;
    --rp-appbar-height: 56px;

    /* === Tipografía === */
    --rp-font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --rp-font-display: 'Bebas Neue', 'Inter', sans-serif;
}

[data-rp-theme="dark"] {
    --rp-brand-lime: #9CCC65;
    --rp-brand-lime-soft: #33691E;
    --rp-brand-green: #66BB6A;
    --rp-brand-forest: #0F3D12;
    --rp-brand-deep: #08160A;

    --rp-ink: #E8EDE8;
    --rp-ink-muted: #9BA59E;
    --rp-line: #1F2A22;
    --rp-surface: #0E1612;
    --rp-surface-2: #131D17;

    --rp-success: #66BB6A;
    --rp-success-soft: #1B3A1D;
    --rp-warning: #FFA726;
    --rp-warning-soft: #4D3415;
    --rp-danger: #EF5350;
    --rp-danger-soft: #4A1F1F;
    --rp-info: #42A5F5;
    --rp-info-soft: #14304A;

    --rp-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --rp-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.5);
    --rp-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.4);
    --rp-shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.55), 0 4px 8px rgba(0, 0, 0, 0.45);
    --rp-shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6), 0 8px 16px rgba(0, 0, 0, 0.5);
    --rp-shadow-hero: 0 24px 48px rgba(0, 0, 0, 0.6), 0 8px 16px rgba(0, 0, 0, 0.5);
    --rp-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.4);
    --rp-shadow-glow-lime: 0 0 0 4px color-mix(in srgb, var(--rp-brand-lime) 30%, transparent);

    --rp-focus-ring: 0 0 0 3px color-mix(in srgb, var(--rp-brand-green) 40%, transparent);
    --rp-focus-ring-danger: 0 0 0 3px color-mix(in srgb, var(--rp-danger) 40%, transparent);

    --rp-gradient-brand: linear-gradient(135deg, var(--rp-brand-lime) 0%, var(--rp-brand-green) 50%, var(--rp-brand-forest) 100%);
    --rp-gradient-hero: linear-gradient(160deg, var(--rp-brand-forest) 0%, var(--rp-brand-deep) 100%);
}

/* === Reducción de movimiento === */
@media (prefers-reduced-motion: reduce) {
    :root,
    [data-rp-theme="light"],
    [data-rp-theme="dark"] {
        --rp-motion-fast: 0.01ms;
        --rp-motion-base: 0.01ms;
        --rp-motion-slow: 0.01ms;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* === Reset tipográfico mínimo === */
html, body {
    font-family: var(--rp-font-ui);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--rp-ink);
    background-color: var(--rp-surface-2);
}

.rp-tabular-nums,
.mud-table-cell.rp-amount,
td.rp-amount {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

.rp-display {
    font-family: var(--rp-font-display);
    letter-spacing: 0.04em;
    font-weight: 400;
}

/* === Scrollbar discreto en navegadores Webkit/Blink === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--rp-surface-2); }
::-webkit-scrollbar-thumb { background: var(--rp-line); border-radius: 8px; border: 2px solid var(--rp-surface-2); }
::-webkit-scrollbar-thumb:hover { background: var(--rp-ink-muted); }
