/* ════════════════════════════════════════════════════════════════
   DentalCoreSystem — Design Tokens
   Modo claro + oscuro + tipografía Roboto local
   ════════════════════════════════════════════════════════════════ */

/* ── Roboto variable font (bundled locally, ~70KB total) ─────── */
@font-face {
    font-family: 'Roboto';
    src: url('/fonts/roboto-latin-ext.woff2') format('woff2');
    font-weight: 100 900;
    font-stretch: 100%;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Roboto';
    src: url('/fonts/roboto-latin.woff2') format('woff2');
    font-weight: 100 900;
    font-stretch: 100%;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Light theme (default) ────────────────────────────────────── */
:root,
[data-theme="light"] {
    /* Colors: surface */
    --color-bg: #f5f6f8;
    --color-surface: #ffffff;
    --color-surface-2: #f7f8fa;
    --color-surface-3: #eef0f3;

    /* Sidebar + header with a subtle tint so they stand out from white content */
    --color-chrome: #f4f7f8;
    --color-chrome-border: rgba(47, 138, 132, 0.14);

    /* Colors: text */
    --color-text: #1c1c1e;
    --color-text-secondary: #6e6e73;
    --color-text-tertiary: #8e8e93;
    --color-text-inverse: #ffffff;

    /* Colors: borders */
    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-strong: rgba(0, 0, 0, 0.16);
    --color-divider: rgba(0, 0, 0, 0.06);

    /* Colors: brand (overridden by ClinicBrandingProvider) */
    --color-accent: #2f8a84;
    --color-accent-deep: #1f5e60;
    --color-accent-soft: rgba(47, 138, 132, 0.10);
    --color-accent-contrast: #ffffff;

    /* Colors: semantic (iOS-like) */
    --color-success: #34c759;
    --color-success-soft: rgba(52, 199, 89, 0.12);
    --color-warning: #ff9500;
    --color-warning-soft: rgba(255, 149, 0, 0.12);
    --color-danger: #ff3b30;
    --color-danger-soft: rgba(255, 59, 48, 0.12);
    --color-info: #007aff;
    --color-info-soft: rgba(0, 122, 255, 0.12);

    /* Elevation (iOS-style tight shadows) */
    --elev-1: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
    --elev-2: 0 2px 4px rgba(0,0,0,0.05), 0 4px 8px rgba(0,0,0,0.08);
    --elev-3: 0 4px 8px rgba(0,0,0,0.06), 0 8px 16px rgba(0,0,0,0.10);
    --elev-4: 0 8px 16px rgba(0,0,0,0.08), 0 16px 32px rgba(0,0,0,0.12);

    /* Spacing (4px grid) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 999px;

    /* Typography */
    --font-sans: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;

    /* Transitions */
    --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Legacy app.css aliases (para retrocompatibilidad mientras refactorizamos) */
    --app-ink: var(--color-text);
    --app-ink-soft: var(--color-text-secondary);
    --app-accent: var(--color-accent);
    --app-accent-deep: var(--color-accent-deep);
    --app-paper: var(--color-surface);
    --app-paper-muted: var(--color-bg);
    --app-line: var(--color-border);
    --app-success: var(--color-success);
    --app-warning: var(--color-warning);
    --app-danger: var(--color-danger);
    --app-warm: var(--color-warning);
}

/* Dark theme disabled for now — will be re-enabled in a future update */

/* ── Base element resets ──────────────────────────────────────── */
html {
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

html, body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    transition: background var(--transition-base), color var(--transition-base);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.01em;
    color: var(--color-text);
}

h1 { font-size: var(--font-size-3xl); line-height: var(--line-height-tight); }
h2 { font-size: var(--font-size-2xl); line-height: var(--line-height-tight); }
h3 { font-size: var(--font-size-xl); line-height: var(--line-height-tight); font-weight: var(--font-weight-medium); }
h4, h5, h6 { font-size: var(--font-size-lg); font-weight: var(--font-weight-medium); }

/* ── SVG icons ────────────────────────────────────────────────── */
.icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    color: currentColor;
}

.icon-inline {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
