/* =========================================================
   Evallish BPO - Enterprise design system
   Paleta corporativa tomada del logo (azul royal profundo).
   Estetica: enterprise SaaS premium (Linear / Stripe / Notion).
   ========================================================= */

:root {
    /* Neutros --------------------------------------------------- */
    --c-bg: #f6f8fb;
    --c-bg-soft: #eef2f7;
    --c-surface: #ffffff;
    --c-surface-muted: #f8fafc;
    --c-surface-sunken: #eef2f7;

    /* Tinta ----------------------------------------------------- */
    --c-ink: #0f172a;
    --c-ink-strong: #020617;
    --c-ink-muted: #475569;
    --c-ink-faint: #94a3b8;
    --c-ink-on-accent: #ffffff;

    /* Bordes ---------------------------------------------------- */
    --c-border: #e2e8f0;
    --c-border-strong: #cbd5e1;

    /* Marca (del logo) ----------------------------------------- */
    --c-accent: #1e3a8a;          /* azul royal profundo, matches logo core */
    --c-accent-hover: #172554;
    --c-accent-soft: #e0e7ff;
    --c-accent-softer: #eef2ff;
    --c-accent-deep: #0b1e4f;
    --c-accent-bright: #3b82f6;   /* azul highlight para acentos secundarios */
    --c-accent-tint: #dbeafe;

    /* Sidebar oscuro (look BI enterprise) --------------------- */
    --c-nav-bg: #0b1220;
    --c-nav-bg-soft: #111a2e;
    --c-nav-ink: #cbd5e1;
    --c-nav-ink-faint: #64748b;
    --c-nav-ink-strong: #f1f5f9;
    --c-nav-border: #1e293b;
    --c-nav-active-bg: rgba(59, 130, 246, 0.12);
    --c-nav-active-ink: #ffffff;
    --c-nav-active-accent: #60a5fa;

    /* Semanticos ----------------------------------------------- */
    --c-success: #059669;
    --c-success-soft: #d1fae5;
    --c-success-ink: #065f46;
    --c-warning: #d97706;
    --c-warning-soft: #fef3c7;
    --c-warning-ink: #92400e;
    --c-danger: #dc2626;
    --c-danger-soft: #fee2e2;
    --c-danger-ink: #991b1b;
    --c-info: #0369a1;
    --c-info-soft: #e0f2fe;
    --c-info-ink: #075985;

    /* Shape ---------------------------------------------------- */
    --c-radius-sm: 6px;
    --c-radius: 8px;
    --c-radius-lg: 12px;
    --c-radius-xl: 16px;

    /* Shadows (sutiles, enterprise) ---------------------------- */
    --c-shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
    --c-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
    --c-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --c-shadow-lg: 0 10px 20px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
    --c-shadow-xl: 0 20px 40px -6px rgba(15, 23, 42, 0.12), 0 8px 12px -4px rgba(15, 23, 42, 0.06);
    --c-shadow-brand: 0 8px 24px -8px rgba(30, 58, 138, 0.35);

    /* Tipografia ---------------------------------------------- */
    --c-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --c-font-display: 'Inter', sans-serif;
    --c-font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
}

/* =========================================================
   DARK MODE - activado via [data-theme="dark"] en <html>
   Paleta oscura corporativa manteniendo azul de marca.
   ========================================================= */
html[data-theme="dark"] {
    --c-bg: #0a0f1c;
    --c-bg-soft: #0f172a;
    --c-surface: #111c33;
    --c-surface-muted: #172443;
    --c-surface-sunken: #0b1226;

    --c-ink: #e2e8f0;
    --c-ink-strong: #f8fafc;
    --c-ink-muted: #94a3b8;
    --c-ink-faint: #64748b;

    --c-border: #1e293b;
    --c-border-strong: #334155;

    --c-accent: #3b82f6;
    --c-accent-hover: #60a5fa;
    --c-accent-soft: rgba(59, 130, 246, 0.14);
    --c-accent-softer: rgba(59, 130, 246, 0.08);
    --c-accent-deep: #1e3a8a;
    --c-accent-bright: #60a5fa;
    --c-accent-tint: rgba(59, 130, 246, 0.22);

    --c-nav-bg: #070c17;
    --c-nav-bg-soft: #0d1426;
    --c-nav-ink: #cbd5e1;
    --c-nav-ink-faint: #64748b;
    --c-nav-ink-strong: #f8fafc;
    --c-nav-border: #1a2338;
    --c-nav-active-bg: rgba(59, 130, 246, 0.16);
    --c-nav-active-ink: #ffffff;
    --c-nav-active-accent: #60a5fa;

    --c-success: #10b981;
    --c-success-soft: rgba(16, 185, 129, 0.14);
    --c-success-ink: #6ee7b7;
    --c-warning: #f59e0b;
    --c-warning-soft: rgba(245, 158, 11, 0.14);
    --c-warning-ink: #fcd34d;
    --c-danger: #ef4444;
    --c-danger-soft: rgba(239, 68, 68, 0.14);
    --c-danger-ink: #fca5a5;
    --c-info: #38bdf8;
    --c-info-soft: rgba(56, 189, 248, 0.14);
    --c-info-ink: #7dd3fc;

    --c-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.35);
    --c-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.45), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
    --c-shadow-md: 0 6px 10px -2px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --c-shadow-lg: 0 14px 28px -4px rgba(0, 0, 0, 0.55), 0 6px 10px -4px rgba(0, 0, 0, 0.35);
    --c-shadow-xl: 0 28px 56px -8px rgba(0, 0, 0, 0.65), 0 12px 20px -6px rgba(0, 0, 0, 0.4);
    --c-shadow-brand: 0 12px 32px -8px rgba(59, 130, 246, 0.55);
}

/* Base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
    background: var(--c-bg);
    color: var(--c-ink);
    font-family: var(--c-font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01';
    font-size: 14px;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Transiciones globales para cambio de tema sin parpadeo */
body, .c-sidebar, .c-card, .c-panel, .c-input, .c-select, .c-textarea,
.c-btn-secondary, .c-stat, .c-alert, .c-table-wrap, .c-table thead th,
.c-table tbody td, .c-badge, .c-toolbar, .c-topbar-mobile {
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease;
}

/* Scrollbar global sutil */
html[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--c-bg); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--c-border-strong); border-radius: 10px; border: 2px solid var(--c-bg); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: var(--c-ink-faint); }

a { color: var(--c-accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--c-accent-hover); }

::selection { background: var(--c-accent-soft); color: var(--c-accent-deep); }

/* Tipografia escalas ----------------------------------------- */
.c-display, .c-h1, .c-h2, .c-h3 {
    font-family: var(--c-font-display);
    color: var(--c-ink-strong);
    letter-spacing: -0.02em;
    line-height: 1.2;
    font-weight: 600;
}

.c-h1 { font-size: 1.75rem; font-weight: 700; }
.c-h2 { font-size: 1.3rem; font-weight: 600; }
.c-h3 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }

@media (min-width: 768px) {
    .c-h1 { font-size: 2rem; }
    .c-h2 { font-size: 1.45rem; }
}

.c-display {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.c-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--c-accent);
    margin-bottom: 0.4rem;
}

.c-muted { color: var(--c-ink-muted); }
.c-faint { color: var(--c-ink-faint); }
.c-subtitle { color: var(--c-ink-muted); font-size: 0.92rem; }

/* Page shell --------------------------------------------------- */
.c-app-main { min-height: 100vh; background: var(--c-bg); }

.c-page {
    padding: 1.75rem 1.5rem 3rem;
    max-width: 88rem;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .c-page { padding: 2rem 2rem 3rem; }
}

.c-page-hero {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--c-border);
}

.c-page-hero__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.c-page-hero__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Cards ------------------------------------------------------- */
.c-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--c-radius-lg);
    box-shadow: var(--c-shadow-sm);
}

.c-card-bd { padding: 1.2rem 1.4rem; }

.c-card-hd {
    padding: 0.95rem 1.4rem;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    min-height: 56px;
}

.c-card-ft {
    padding: 0.75rem 1.4rem;
    border-top: 1px solid var(--c-border);
    background: var(--c-surface-muted);
    border-bottom-left-radius: var(--c-radius-lg);
    border-bottom-right-radius: var(--c-radius-lg);
}

.c-panel {
    background: var(--c-surface-muted);
    border: 1px solid var(--c-border);
    border-radius: var(--c-radius);
    padding: 0.9rem 1.1rem;
}

/* Buttons ----------------------------------------------------- */
.c-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.5rem 0.95rem;
    border-radius: var(--c-radius-sm);
    border: 1px solid transparent;
    font-size: 0.87rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
    text-decoration: none;
    line-height: 1.3;
    white-space: nowrap;
    font-family: inherit;
}
.c-btn:active { transform: translateY(0.5px); }
.c-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--c-accent-tint); }

.c-btn-primary {
    background: var(--c-accent);
    color: var(--c-ink-on-accent);
    box-shadow: 0 1px 2px rgba(30, 58, 138, 0.15);
}
.c-btn-primary:hover { background: var(--c-accent-hover); color: #fff; }

.c-btn-secondary {
    background: var(--c-surface);
    color: var(--c-ink);
    border-color: var(--c-border-strong);
    box-shadow: var(--c-shadow-sm);
}
.c-btn-secondary:hover { background: var(--c-surface-muted); border-color: var(--c-ink-faint); }

.c-btn-ghost { background: transparent; color: var(--c-ink-muted); }
.c-btn-ghost:hover { color: var(--c-ink-strong); background: var(--c-surface-muted); }

.c-btn-danger { background: var(--c-danger); color: #fff; }
.c-btn-danger:hover { background: #b91c1c; color: #fff; }

.c-btn-success { background: var(--c-success); color: #fff; }
.c-btn-success:hover { background: #047857; color: #fff; }

.c-btn-warning { background: var(--c-warning); color: #fff; }
.c-btn-warning:hover { background: #b45309; color: #fff; }

.c-btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.c-btn-lg { padding: 0.7rem 1.25rem; font-size: 0.95rem; font-weight: 600; }
.c-btn-block { width: 100%; }
.c-btn[disabled], .c-btn.is-disabled { opacity: 0.5; pointer-events: none; }

.c-btn-group {
    display: inline-flex;
    background: var(--c-surface);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--c-radius-sm);
    overflow: hidden;
    box-shadow: var(--c-shadow-sm);
}
.c-btn-group > .c-btn {
    border-radius: 0;
    border-color: transparent;
    box-shadow: none;
    border-right: 1px solid var(--c-border);
}
.c-btn-group > .c-btn:last-child { border-right: none; }

/* Forms ------------------------------------------------------- */
.c-field { display: flex; flex-direction: column; gap: 0.35rem; }
.c-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--c-ink);
    letter-spacing: 0;
}
.c-help { font-size: 0.78rem; color: var(--c-ink-muted); }

.c-input, .c-select, .c-textarea {
    width: 100%;
    padding: 0.5rem 0.8rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--c-radius-sm);
    font-size: 0.87rem;
    color: var(--c-ink);
    font-family: inherit;
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: var(--c-shadow-sm);
}
.c-input:hover, .c-select:hover, .c-textarea:hover { border-color: var(--c-ink-faint); }
.c-input:focus, .c-select:focus, .c-textarea:focus {
    outline: none;
    border-color: var(--c-accent-bright);
    box-shadow: 0 0 0 3px var(--c-accent-tint);
}
.c-input::placeholder, .c-textarea::placeholder { color: var(--c-ink-faint); }

.c-select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    padding-right: 2.1rem;
    appearance: none;
    -webkit-appearance: none;
}

.c-textarea { min-height: 6.5rem; resize: vertical; }

.c-check {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    font-size: 0.87rem;
    color: var(--c-ink);
}
.c-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--c-accent);
}

/* Tables ------------------------------------------------------ */
.c-table-wrap {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--c-radius-lg);
    overflow: hidden;
    box-shadow: var(--c-shadow-sm);
}
.c-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}
.c-table thead th {
    background: var(--c-surface-muted);
    text-align: left;
    padding: 0.7rem 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-ink-muted);
    border-bottom: 1px solid var(--c-border);
}
.c-table tbody td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--c-border);
    color: var(--c-ink);
    vertical-align: middle;
}
.c-table tbody tr:last-child td { border-bottom: none; }
.c-table tbody tr { transition: background 0.12s ease; }
.c-table tbody tr:hover { background: var(--c-surface-muted); }

.c-table-empty {
    padding: 2.75rem 1.5rem;
    text-align: center;
    color: var(--c-ink-muted);
    font-size: 0.9rem;
}

/* Badges ------------------------------------------------------ */
.c-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--c-surface-muted);
    color: var(--c-ink-muted);
    border: 1px solid var(--c-border);
    line-height: 1.4;
}
.c-badge-accent { background: var(--c-accent-soft); color: var(--c-accent-deep); border-color: #c7d2fe; }
.c-badge-success { background: var(--c-success-soft); color: var(--c-success-ink); border-color: #a7f3d0; }
.c-badge-warning { background: var(--c-warning-soft); color: var(--c-warning-ink); border-color: #fde68a; }
.c-badge-danger { background: var(--c-danger-soft); color: var(--c-danger-ink); border-color: #fecaca; }
.c-badge-info { background: var(--c-info-soft); color: var(--c-info-ink); border-color: #bae6fd; }
.c-badge-neutral { background: var(--c-surface-muted); color: var(--c-ink); border-color: var(--c-border-strong); }

.c-badge-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--c-ink);
}
.c-badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-ink-faint);
}
.c-badge-dot.is-success::before { background: var(--c-success); }
.c-badge-dot.is-warning::before { background: var(--c-warning); }
.c-badge-dot.is-danger::before { background: var(--c-danger); }
.c-badge-dot.is-accent::before { background: var(--c-accent); }

/* Stat card (KPI) -------------------------------------------- */
.c-stat {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--c-radius-lg);
    padding: 1.15rem 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    box-shadow: var(--c-shadow-sm);
    position: relative;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.c-stat:hover { border-color: var(--c-border-strong); box-shadow: var(--c-shadow); }

.c-stat-label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--c-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.c-stat-value {
    font-family: var(--c-font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--c-ink-strong);
    letter-spacing: -0.025em;
    line-height: 1.1;
    font-feature-settings: 'tnum';
}
.c-stat-help {
    font-size: 0.78rem;
    color: var(--c-ink-faint);
}
.c-stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}
.c-stat-trend.is-up { color: var(--c-success); }
.c-stat-trend.is-down { color: var(--c-danger); }

.c-stat-accent { border-color: #c7d2fe; }
.c-stat-accent .c-stat-value { color: var(--c-accent); }
.c-stat-danger .c-stat-value { color: var(--c-danger); }
.c-stat-success .c-stat-value { color: var(--c-success); }
.c-stat-warning .c-stat-value { color: var(--c-warning); }

.c-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
}

/* Alerts ------------------------------------------------------ */
.c-alert {
    border-radius: var(--c-radius);
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    font-size: 0.88rem;
    color: var(--c-ink);
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}
.c-alert-success { background: var(--c-success-soft); border-color: #a7f3d0; color: var(--c-success-ink); }
.c-alert-warning { background: var(--c-warning-soft); border-color: #fde68a; color: var(--c-warning-ink); }
.c-alert-danger  { background: var(--c-danger-soft); border-color: #fecaca; color: var(--c-danger-ink); }
.c-alert-info    { background: var(--c-info-soft); border-color: #bae6fd; color: var(--c-info-ink); }

/* ============================================================
   Sidebar - Dark navy enterprise BI look
   ============================================================ */
.c-sidebar {
    flex: 0 0 260px;
    width: 260px;
    min-height: 100vh;
    background: var(--c-nav-bg);
    color: var(--c-nav-ink);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform 0.25s ease;
    position: sticky;
    top: 0;
    align-self: stretch;
    height: 100vh;
    border-right: 1px solid var(--c-nav-border);
}

.c-sidebar-brand {
    padding: 1.2rem 1.2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid var(--c-nav-border);
}
.c-sidebar-brand a { display: flex; align-items: center; gap: 0.65rem; }
.c-sidebar-brand img { max-height: 30px; width: auto; filter: brightness(0) invert(1); opacity: 0.96; }
.c-sidebar-brand-name {
    color: var(--c-nav-ink-strong);
    font-weight: 700;
    letter-spacing: -0.015em;
    font-size: 0.95rem;
}

.c-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 0.7rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.c-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.7rem;
    border-radius: var(--c-radius-sm);
    color: var(--c-nav-ink);
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    position: relative;
}
.c-sidebar-link:hover {
    background: var(--c-nav-bg-soft);
    color: var(--c-nav-ink-strong);
}
.c-sidebar-link.is-active {
    background: var(--c-nav-active-bg);
    color: var(--c-nav-active-ink);
    font-weight: 600;
}
.c-sidebar-link.is-active::before {
    content: '';
    position: absolute;
    left: -0.7rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--c-nav-active-accent);
    border-radius: 0 3px 3px 0;
}
.c-sidebar-link svg {
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    color: currentColor;
    opacity: 0.85;
}
.c-sidebar-link.is-active svg { opacity: 1; color: var(--c-nav-active-accent); }

.c-sidebar-label {
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--c-nav-ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.9rem 0.75rem 0.35rem;
}

.c-sidebar-foot {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--c-nav-border);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: var(--c-nav-bg-soft);
}
.c-sidebar-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-bright) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: -0.01em;
}
.c-sidebar-user {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    overflow: hidden;
}
.c-sidebar-user strong {
    font-size: 0.85rem;
    color: var(--c-nav-ink-strong);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.c-sidebar-user a {
    font-size: 0.74rem;
    color: var(--c-nav-ink-faint);
}
.c-sidebar-user a:hover { color: var(--c-nav-ink); }

/* Scrollbar del sidebar */
.c-sidebar-nav::-webkit-scrollbar { width: 5px; }
.c-sidebar-nav::-webkit-scrollbar-thumb { background: var(--c-nav-border); border-radius: 3px; }
.c-sidebar-nav::-webkit-scrollbar-track { background: transparent; }

/* Layout ------------------------------------------------------ */
.c-app-wrap {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}
.c-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--c-bg);
}

.c-topbar-mobile { display: none; }

@media (max-width: 767px) {
    .c-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        height: 100vh;
        transform: translateX(-100%);
    }
    .c-sidebar.is-open { transform: translateX(0); box-shadow: var(--c-shadow-xl); }
    .c-topbar-mobile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 56px;
        padding: 0 1rem;
        background: var(--c-surface);
        border-bottom: 1px solid var(--c-border);
        position: sticky;
        top: 0;
        z-index: 30;
    }
    .c-topbar-mobile img { max-height: 24px; }
}

.c-scrim {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.c-scrim.is-open { opacity: 1; pointer-events: auto; }

/* Utility --------------------------------------------------- */
.c-divider { height: 1px; background: var(--c-border); border: 0; margin: 1.25rem 0; }

.c-code-inline {
    font-family: var(--c-font-mono);
    font-size: 0.8em;
    padding: 0.1rem 0.35rem;
    background: var(--c-surface-muted);
    border: 1px solid var(--c-border);
    border-radius: 4px;
    color: var(--c-ink);
}

.c-pill-row { display: inline-flex; gap: 0.3rem; flex-wrap: wrap; }
.c-pill {
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 999px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    color: var(--c-ink-muted);
    cursor: pointer;
    transition: all 0.12s ease;
}
.c-pill:hover { color: var(--c-ink); border-color: var(--c-border-strong); }
.c-pill.is-active { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }

/* Toolbar / filter row --------------------------------------- */
.c-toolbar {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--c-radius-lg);
    padding: 0.9rem 1.1rem;
    display: flex;
    gap: 0.75rem;
    align-items: end;
    flex-wrap: wrap;
    box-shadow: var(--c-shadow-sm);
}

/* Brand emblem (para hero / cards) --------------------------- */
.c-brand-emblem {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-bright) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.015em;
    box-shadow: var(--c-shadow-brand);
}

/* Progress bar minimal --------------------------------------- */
.c-progress {
    height: 6px;
    background: var(--c-surface-sunken);
    border-radius: 999px;
    overflow: hidden;
}
.c-progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--c-accent) 0%, var(--c-accent-bright) 100%);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* ============================================================
   Overrides para Tailwind legacy: mapear grises cálidos del
   skin previo a la paleta azul corporativa.
   ============================================================ */
body .bg-gray-50 { background-color: var(--c-bg) !important; }
body .bg-gray-100 { background-color: var(--c-bg-soft) !important; }
body .bg-white { background-color: var(--c-surface); }
body .border-gray-100 { border-color: var(--c-border) !important; }
body .border-gray-200 { border-color: var(--c-border) !important; }
body .border-gray-300 { border-color: var(--c-border-strong) !important; }
body .shadow-lg { box-shadow: var(--c-shadow-md) !important; }
body .shadow-xl { box-shadow: var(--c-shadow-lg) !important; }
body .shadow-md { box-shadow: var(--c-shadow) !important; }
body .shadow-sm { box-shadow: var(--c-shadow-sm) !important; }

body .rounded-xl { border-radius: var(--c-radius-lg); }
body .rounded-2xl { border-radius: var(--c-radius-xl); }

body main, body section { background-color: transparent; }

/* ============================================================
   Micro-interacciones & pulido
   ============================================================ */

/* Page enter animation (fade + slide up sutil) */
.c-page {
    animation: c-page-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes c-page-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards: hover con elevacion suave */
.c-card, .c-stat {
    transition:
        background-color 0.25s ease,
        border-color 0.2s ease,
        box-shadow 0.25s ease,
        transform 0.2s ease;
}
.c-card:hover, .c-stat:hover {
    border-color: var(--c-border-strong);
}

/* Panels clickeables (los <a class="c-panel">) */
a.c-panel {
    transition: all 0.18s ease;
}
a.c-panel:hover {
    border-color: var(--c-accent) !important;
    background: var(--c-accent-softer) !important;
    transform: translateY(-1px);
    box-shadow: var(--c-shadow);
}

/* Botones: ripple lite via inset shadow al click */
.c-btn { position: relative; overflow: hidden; }
.c-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.3s ease;
    pointer-events: none;
}
.c-btn:active::after { background: rgba(255,255,255,0.08); transition: none; }
html[data-theme="dark"] .c-btn:active::after { background: rgba(255,255,255,0.06); }

/* Focus rings refinados */
.c-btn:focus-visible { box-shadow: 0 0 0 3px var(--c-accent-tint); outline: none; }
.c-input:focus, .c-select:focus, .c-textarea:focus {
    border-color: var(--c-accent-bright);
    box-shadow: 0 0 0 3px var(--c-accent-tint);
}

/* Theme toggle switch --------------------------------------- */
.c-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid var(--c-nav-border);
    color: var(--c-nav-ink);
    border-radius: var(--c-radius-sm);
    padding: 0.35rem 0.55rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.c-theme-toggle:hover {
    background: var(--c-nav-bg-soft);
    color: var(--c-nav-ink-strong);
    border-color: var(--c-nav-active-accent);
}
.c-theme-toggle__icon {
    width: 16px;
    height: 16px;
    display: block;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.c-theme-toggle[data-mode="dark"] .c-theme-toggle__icon.sun { display: none; }
.c-theme-toggle[data-mode="light"] .c-theme-toggle__icon.moon { display: none; }
.c-theme-toggle:hover .c-theme-toggle__icon { transform: rotate(-18deg); }

/* Variante standalone (login) */
.c-theme-toggle--standalone {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 60;
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--c-border);
    color: var(--c-ink);
    box-shadow: var(--c-shadow-sm);
    backdrop-filter: blur(8px);
}
html[data-theme="dark"] .c-theme-toggle--standalone {
    background: rgba(17, 28, 51, 0.92);
    border-color: var(--c-border);
    color: var(--c-ink);
}

/* Skeleton loader (usage: <div class="c-skel c-skel-line"></div>) */
.c-skel {
    background: linear-gradient(
        90deg,
        var(--c-surface-muted) 0%,
        var(--c-surface-sunken) 50%,
        var(--c-surface-muted) 100%
    );
    background-size: 200% 100%;
    animation: c-skel-shimmer 1.4s linear infinite;
    border-radius: 6px;
}
.c-skel-line { height: 0.9rem; width: 100%; }
.c-skel-title { height: 1.3rem; width: 60%; }
.c-skel-block { height: 4rem; width: 100%; }
@keyframes c-skel-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Scroll shadow en tablas overflow-x (indicador visual) */
.c-table-wrap { position: relative; }
.c-table-wrap::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 24px;
    background: linear-gradient(to left, var(--c-surface), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.c-table-wrap.is-scrollable::after { opacity: 0.8; }

/* Input y select en dark mode: bg mas sutil */
html[data-theme="dark"] .c-input,
html[data-theme="dark"] .c-select,
html[data-theme="dark"] .c-textarea {
    background: var(--c-surface-muted);
}

/* Select caret en dark (cambia color) */
html[data-theme="dark"] .c-select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}

/* iframe (preview correo) con fondo claro incluso en dark */
html[data-theme="dark"] iframe[id="preview-frame"] {
    background: #ffffff !important;
}

/* Details / summary refinado */
details > summary { list-style: none; outline: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details > summary::after {
    content: '▾';
    margin-left: auto;
    color: var(--c-ink-faint);
    transition: transform 0.2s ease;
}
details[open] > summary::after { transform: rotate(180deg); }

/* Link states mejorados en dark */
html[data-theme="dark"] a { color: var(--c-accent-bright); }
html[data-theme="dark"] a:hover { color: var(--c-ink-strong); }

/* Table stripes opcionales (activate with .c-table--striped) */
.c-table--striped tbody tr:nth-child(even) { background: var(--c-surface-muted); }

/* Hero dotted pattern helper (para gradient cards) */
.c-pattern-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

/* Respeta preferencia de usuario reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   TOPBAR PERSISTENTE (desktop) - breadcrumbs + search + actions
   ============================================================ */
.c-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--c-border);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 56px;
}
html[data-theme="dark"] .c-topbar {
    background: rgba(10, 15, 28, 0.78);
    border-bottom-color: var(--c-border);
}

.c-topbar-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.84rem;
    color: var(--c-ink-muted);
    flex: 1;
    min-width: 0;
}
.c-topbar-breadcrumb a { color: var(--c-ink-muted); }
.c-topbar-breadcrumb a:hover { color: var(--c-accent); }
.c-topbar-breadcrumb .sep { color: var(--c-ink-faint); font-weight: 500; opacity: 0.6; }
.c-topbar-breadcrumb strong {
    color: var(--c-ink);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.c-topbar-search {
    position: relative;
    flex: 1;
    max-width: 420px;
}
.c-topbar-search input {
    width: 100%;
    padding: 0.45rem 0.85rem 0.45rem 2.1rem;
    background: var(--c-surface-muted);
    border: 1px solid transparent;
    border-radius: var(--c-radius-sm);
    color: var(--c-ink);
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}
.c-topbar-search input:hover { background: var(--c-surface-sunken); }
.c-topbar-search input:focus {
    outline: none;
    background: var(--c-surface);
    border-color: var(--c-accent-bright);
    box-shadow: 0 0 0 3px var(--c-accent-tint);
}
.c-topbar-search svg {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--c-ink-faint);
    pointer-events: none;
}
.c-topbar-search kbd {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.c-topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.c-topbar-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--c-ink-muted);
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--c-radius-sm);
    transition: all 0.15s ease;
    position: relative;
}
.c-topbar-btn:hover {
    background: var(--c-surface-muted);
    color: var(--c-ink-strong);
    border-color: var(--c-border);
}
.c-topbar-btn .c-dot-pulse {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: var(--c-danger);
    border-radius: 50%;
    border: 2px solid var(--c-bg);
    box-shadow: 0 0 0 0 var(--c-danger);
    animation: c-pulse 2s infinite;
}
@keyframes c-pulse {
    0% { box-shadow: 0 0 0 0 rgba(220,38,38,0.5); }
    70% { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
    100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}

@media (max-width: 767px) {
    .c-topbar { padding: 0.6rem 1rem; }
    .c-topbar-search { display: none; }
    .c-topbar-breadcrumb { font-size: 0.78rem; }
}

/* ============================================================
   KEYBOARD HINT / kbd (shadcn-style)
   ============================================================ */
kbd, .c-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 0.35rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border-strong);
    border-bottom-width: 2px;
    border-radius: 4px;
    color: var(--c-ink-muted);
    font-family: var(--c-font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
}
html[data-theme="dark"] kbd, html[data-theme="dark"] .c-kbd {
    background: var(--c-surface-muted);
    border-color: var(--c-border-strong);
    color: var(--c-ink);
}

/* ============================================================
   TABS (underline animado - shadcn/vercel style)
   ============================================================ */
.c-tabs {
    display: inline-flex;
    border-bottom: 1px solid var(--c-border);
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    position: relative;
}
.c-tab {
    padding: 0.6rem 0.9rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--c-ink-muted);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.2s ease;
    text-decoration: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.c-tab:hover { color: var(--c-ink); }
.c-tab.is-active {
    color: var(--c-accent);
    border-bottom-color: var(--c-accent);
    font-weight: 600;
}
html[data-theme="dark"] .c-tab.is-active { color: var(--c-accent-bright); border-bottom-color: var(--c-accent-bright); }

.c-tab-count {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    background: var(--c-surface-muted);
    color: var(--c-ink-muted);
    border-radius: 999px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}
.c-tab.is-active .c-tab-count {
    background: var(--c-accent-soft);
    color: var(--c-accent-deep);
}
html[data-theme="dark"] .c-tab.is-active .c-tab-count { color: var(--c-accent-bright); }

/* ============================================================
   SEGMENTED CONTROL (iOS/macOS-style)
   ============================================================ */
.c-segmented {
    display: inline-flex;
    background: var(--c-surface-muted);
    border: 1px solid var(--c-border);
    border-radius: var(--c-radius-sm);
    padding: 3px;
    gap: 2px;
}
.c-segmented__item {
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--c-ink-muted);
    background: transparent;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
}
.c-segmented__item:hover { color: var(--c-ink); }
.c-segmented__item.is-active {
    background: var(--c-surface);
    color: var(--c-ink-strong);
    box-shadow: var(--c-shadow-sm);
    font-weight: 600;
}
html[data-theme="dark"] .c-segmented__item.is-active {
    background: var(--c-bg-soft);
    color: #fff;
}

/* ============================================================
   PROGRESS RING (SVG circular)
   ============================================================ */
.c-ring {
    position: relative;
    width: 72px;
    height: 72px;
}
.c-ring svg { transform: rotate(-90deg); }
.c-ring__track { stroke: var(--c-border); fill: none; }
.c-ring__fill {
    stroke: var(--c-accent);
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}
.c-ring--success .c-ring__fill { stroke: var(--c-success); }
.c-ring--warning .c-ring__fill { stroke: var(--c-warning); }
.c-ring--danger .c-ring__fill { stroke: var(--c-danger); }
.c-ring__label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--c-ink-strong);
    letter-spacing: -0.02em;
    font-feature-settings: 'tnum';
}

/* ============================================================
   TREND INDICATOR (used in stat cards)
   ============================================================ */
.c-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    line-height: 1.3;
}
.c-trend.is-up { color: var(--c-success-ink); background: var(--c-success-soft); }
.c-trend.is-down { color: var(--c-danger-ink); background: var(--c-danger-soft); }
.c-trend.is-flat { color: var(--c-ink-muted); background: var(--c-surface-muted); }

/* ============================================================
   GRADIENT HERO (mesh sutil)
   ============================================================ */
.c-gradient-hero {
    position: relative;
    border-radius: var(--c-radius-lg);
    padding: 1.5rem 1.75rem;
    overflow: hidden;
    background:
        radial-gradient(600px 240px at 0% 0%, var(--c-accent-soft), transparent 60%),
        radial-gradient(500px 300px at 100% 100%, var(--c-accent-softer), transparent 55%),
        var(--c-surface);
    border: 1px solid var(--c-border);
    box-shadow: var(--c-shadow-sm);
}
html[data-theme="dark"] .c-gradient-hero {
    background:
        radial-gradient(600px 240px at 0% 0%, rgba(59,130,246,0.18), transparent 60%),
        radial-gradient(500px 300px at 100% 100%, rgba(96,165,250,0.08), transparent 55%),
        var(--c-surface);
}

/* ============================================================
   TOOLTIP NATIVO ([data-tooltip])
   ============================================================ */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--c-ink-strong);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.3rem 0.55rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 50;
    letter-spacing: -0.005em;
}
[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--c-ink-strong);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 50;
}
[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
html[data-theme="dark"] [data-tooltip]::after {
    background: var(--c-surface);
    color: var(--c-ink);
    border: 1px solid var(--c-border-strong);
}
html[data-theme="dark"] [data-tooltip]::before { border-top-color: var(--c-surface); }

/* ============================================================
   EMPTY STATE con iconografia
   ============================================================ */
.c-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--c-ink-muted);
}
.c-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--c-surface-muted);
    color: var(--c-ink-faint);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}
.c-empty-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--c-ink);
    margin-bottom: 0.25rem;
}
.c-empty-help { font-size: 0.84rem; color: var(--c-ink-muted); max-width: 320px; margin: 0 auto; }

/* ============================================================
   SPARKLINE inline (mini chart)
   ============================================================ */
.c-sparkline {
    display: inline-block;
    vertical-align: middle;
    width: 100%;
    max-width: 140px;
    height: 32px;
}
.c-sparkline path { fill: none; stroke: var(--c-accent); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.c-sparkline .area { fill: var(--c-accent-soft); stroke: none; opacity: 0.6; }
.c-sparkline--success path { stroke: var(--c-success); }
.c-sparkline--danger path { stroke: var(--c-danger); }

/* ============================================================
   PODIUM (top performers top 3)
   ============================================================ */
.c-podium {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    align-items: end;
}
.c-podium__item {
    position: relative;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--c-radius-lg);
    padding: 1rem 0.85rem 0.95rem;
    text-align: center;
    transition: all 0.2s ease;
}
.c-podium__item:hover {
    transform: translateY(-2px);
    box-shadow: var(--c-shadow-md);
    border-color: var(--c-accent);
}
.c-podium__rank {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    background: var(--c-ink-muted);
    box-shadow: var(--c-shadow);
    font-family: var(--c-font-mono);
}
.c-podium__item--gold .c-podium__rank {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #fff;
}
.c-podium__item--silver .c-podium__rank {
    background: linear-gradient(135deg, #cbd5e1 0%, #64748b 100%);
}
.c-podium__item--bronze .c-podium__rank {
    background: linear-gradient(135deg, #d97706 0%, #78350f 100%);
}
.c-podium__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-bright) 100%);
    letter-spacing: -0.02em;
}
.c-podium__name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--c-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}
.c-podium__score {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--c-accent);
    font-feature-settings: 'tnum';
}
html[data-theme="dark"] .c-podium__score { color: var(--c-accent-bright); }

/* ============================================================
   ACTIVITY FEED
   ============================================================ */
.c-feed { display: flex; flex-direction: column; }
.c-feed__item {
    display: flex;
    gap: 0.75rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--c-border);
}
.c-feed__item:last-child { border-bottom: none; }
.c-feed__avatar {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--c-accent-deep);
    background: var(--c-accent-soft);
    letter-spacing: -0.02em;
}
html[data-theme="dark"] .c-feed__avatar { color: var(--c-accent-bright); }
.c-feed__body { min-width: 0; flex: 1; }
.c-feed__text { font-size: 0.88rem; color: var(--c-ink); line-height: 1.45; }
.c-feed__text strong { color: var(--c-ink-strong); font-weight: 600; }
.c-feed__meta { font-size: 0.75rem; color: var(--c-ink-faint); margin-top: 2px; }

/* ============================================================
   CHIP dismissible (para filtros activos)
   ============================================================ */
.c-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem 0.2rem 0.65rem;
    background: var(--c-accent-soft);
    color: var(--c-accent-deep);
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}
html[data-theme="dark"] .c-chip { color: var(--c-accent-bright); background: rgba(59, 130, 246, 0.14); }
.c-chip button { all: unset; cursor: pointer; opacity: 0.6; display: inline-flex; }
.c-chip button:hover { opacity: 1; }

/* ============================================================
   SHADOW system v2 (Material 3 tier)
   ============================================================ */
.c-elev-1 { box-shadow: var(--c-shadow-sm); }
.c-elev-2 { box-shadow: var(--c-shadow); }
.c-elev-3 { box-shadow: var(--c-shadow-md); }
.c-elev-4 { box-shadow: var(--c-shadow-lg); }
.c-elev-5 { box-shadow: var(--c-shadow-xl); }

/* ============================================================
   SWITCH (toggle) premium
   ============================================================ */
.c-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}
.c-switch input { opacity: 0; width: 0; height: 0; }
.c-switch__slider {
    position: absolute;
    inset: 0;
    background: var(--c-border-strong);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.c-switch__slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--c-shadow-sm);
}
.c-switch input:checked + .c-switch__slider { background: var(--c-accent); }
.c-switch input:checked + .c-switch__slider::before { transform: translateX(16px); }
.c-switch input:focus-visible + .c-switch__slider { box-shadow: 0 0 0 3px var(--c-accent-tint); }

/* ============================================================
   SECTION HEADER (tipografica jerarquica)
   ============================================================ */
.c-section-hd {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.c-section-hd__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--c-ink-strong);
    letter-spacing: -0.015em;
    margin: 0;
    line-height: 1.3;
}
.c-section-hd__help {
    font-size: 0.82rem;
    color: var(--c-ink-muted);
    margin-top: 2px;
}

/* Print --------------------------------------------------------- */
@media print {
    .c-sidebar, .c-topbar-mobile, .c-topbar, .c-scrim, .c-theme-toggle { display: none !important; }
    .c-content { margin-left: 0 !important; }
    body { background: #fff !important; color: #000 !important; }
    .c-card, .c-stat { box-shadow: none !important; border-color: #ddd !important; }
}

/* ============================================================== */
/* Polish v2 — referencia SaaS pro                                 */
/* Refinamiento de cards, KPI tiles, tablas y formularios          */
/* ============================================================== */

/* Contenedor raiz: fondo sutil graduado para profundidad ------- */
body {
    background:
        radial-gradient(1200px 600px at 95% -10%, rgba(59, 89, 152, 0.04), transparent 60%),
        radial-gradient(800px 400px at -10% 100%, rgba(59, 89, 152, 0.03), transparent 60%),
        var(--c-bg, #f7f8fb);
}

/* Cards: bordes mas definidos, sombra sutil, hover --------------- */
.c-card {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.02);
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.c-card:hover {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 28px rgba(15, 23, 42, 0.05);
}

.c-card-hd {
    padding: 1.1rem 1.3rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.c-card-bd {
    padding: 1.1rem 1.3rem;
}

/* KPI tiles: numeros mas grandes y peso visual --------------- */
.c-stat {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    padding: 1.15rem 1.25rem 1rem;
    background: var(--c-surface, #ffffff);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform .18s ease, box-shadow .18s ease;
    position: relative;
    overflow: hidden;
}
.c-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 28px rgba(15, 23, 42, 0.06);
}
.c-stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--c-ink-muted, #64748b);
    letter-spacing: .01em;
}
.c-stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -.025em;
    color: var(--c-ink-strong, #0b1220);
    line-height: 1.1;
}
.c-stat-help {
    font-size: 0.74rem;
    color: var(--c-ink-faint, #94a3b8);
    display: block;
    margin-top: .55rem;
}

/* Mini-trend chip al lado del numero (verde/rojo, like reference) */
.c-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    line-height: 1;
}
.c-trend.is-up   { background: rgba(16,185,129,.10); color: #047857; }
.c-trend.is-down { background: rgba(239,68,68,.10);  color: #b91c1c; }
.c-trend.is-flat { background: rgba(100,116,139,.10);color: #475569; }

/* Tablas: header denso, rows hover, separadores sutiles --------- */
table.min-w-full thead, .c-card table thead {
    background: linear-gradient(180deg, rgba(248,250,252,1) 0%, rgba(241,245,249,1) 100%);
}
table.min-w-full thead th, .c-card table thead th {
    font-size: .68rem;
    letter-spacing: .06em;
    color: var(--c-ink-muted, #64748b);
    text-transform: uppercase;
    font-weight: 700;
    padding: .8rem 1rem;
    border-bottom: 1px solid rgba(15,23,42,0.07);
}
table.min-w-full tbody tr, .c-card table tbody tr {
    transition: background .14s ease;
}
table.min-w-full tbody tr:hover, .c-card table tbody tr:hover {
    background: rgba(99, 102, 241, 0.03);
}
table.min-w-full tbody td, .c-card table tbody td {
    padding: .85rem 1rem;
    border-bottom: 1px solid rgba(15,23,42,0.04);
    font-size: .87rem;
}

/* Botones globales (incluso los de Tailwind) -------------------- */
.bg-indigo-600, button.bg-indigo-600 {
    background: linear-gradient(135deg, #2c4a8a 0%, #1e3a8a 100%) !important;
    box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 16px rgba(30, 58, 138, 0.22);
    transition: transform .12s ease, box-shadow .18s ease, filter .18s ease;
}
.bg-indigo-600:hover, button.bg-indigo-600:hover, .hover\:bg-indigo-700:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 10px 22px rgba(30, 58, 138, 0.30);
}

/* Form inputs: foco accesible y bordes refinados ---------------- */
input[type="text"], input[type="email"], input[type="number"], input[type="password"],
input[type="search"], input[type="tel"], input[type="url"], input[type="date"],
input[type="datetime-local"], input[type="time"], select, textarea {
    transition: border-color .14s ease, box-shadow .14s ease, background-color .14s ease;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="number"]:focus,
input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus,
input[type="url"]:focus, input[type="date"]:focus, input[type="datetime-local"]:focus,
input[type="time"]:focus, select:focus, textarea:focus {
    border-color: #1e3a8a !important;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12) !important;
    outline: none;
}

/* Pills/badges: sutiles y modernas ------------------------------ */
.rounded-full {
    font-weight: 600;
    letter-spacing: .005em;
}

/* Sparklines: trazo mas grueso y suave -------------------------- */
.c-sparkline path {
    fill: none;
    stroke: var(--c-accent, #1e3a8a);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.c-sparkline path.area {
    stroke: none;
    fill: url(#c-spark-gradient, rgba(30, 58, 138, 0.10));
}

/* Empty states centrados ---------------------------------------- */
.c-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--c-ink-muted, #64748b);
}
.c-empty-icon {
    width: 44px; height: 44px;
    margin: 0 auto .6rem;
    border-radius: 50%;
    background: rgba(99,102,241,0.06);
    color: var(--c-accent, #1e3a8a);
    display: flex; align-items: center; justify-content: center;
}
.c-empty-title { font-weight: 700; color: var(--c-ink-strong, #0b1220); margin-bottom: .15rem; }
.c-empty-help { font-size: .82rem; }

/* Smooth scroll suaves en listas -------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.22);
    background-clip: content-box;
}

/* Detalles colapsables (transcripcion) ------------------------- */
details > summary {
    list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
    content: "▸";
    display: inline-block;
    transition: transform .15s ease;
    margin-right: .35rem;
    color: var(--c-ink-faint, #94a3b8);
}
details[open] > summary::before {
    transform: rotate(90deg);
}

/* ============================================================== */
/* Dark mode v2 — overrides para clases Tailwind literales         */
/* Las vistas usan bg-white, text-gray-*, border-gray-* directos,  */
/* aqui los traducimos al sistema de tokens en tema oscuro.        */
/* ============================================================== */

html[data-theme="dark"] body {
    background:
        radial-gradient(1200px 600px at 95% -10%, rgba(59, 130, 246, 0.06), transparent 60%),
        radial-gradient(800px 400px at -10% 100%, rgba(59, 130, 246, 0.04), transparent 60%),
        var(--c-bg) !important;
}

/* Surface backgrounds */
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-gray-50,
html[data-theme="dark"] .bg-slate-50 {
    background-color: var(--c-surface) !important;
}
html[data-theme="dark"] .bg-gray-100,
html[data-theme="dark"] .bg-slate-100 {
    background-color: var(--c-surface-muted) !important;
}
html[data-theme="dark"] .bg-gray-200 {
    background-color: var(--c-surface-sunken) !important;
}

/* Borders */
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-gray-100,
html[data-theme="dark"] .border-gray-200,
html[data-theme="dark"] .border-gray-300,
html[data-theme="dark"] .border-slate-100,
html[data-theme="dark"] .border-slate-200 {
    border-color: var(--c-border) !important;
}
html[data-theme="dark"] .divide-y > :not([hidden]) ~ :not([hidden]),
html[data-theme="dark"] .divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--c-border) !important;
}

/* Text */
html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-slate-900,
html[data-theme="dark"] .text-black {
    color: var(--c-ink-strong) !important;
}
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-slate-800 {
    color: var(--c-ink) !important;
}
html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-slate-700,
html[data-theme="dark"] .text-slate-600 {
    color: var(--c-ink) !important;
}
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-slate-500 {
    color: var(--c-ink-muted) !important;
}
html[data-theme="dark"] .text-gray-400,
html[data-theme="dark"] .text-slate-400 {
    color: var(--c-ink-faint) !important;
}

/* Hover surfaces */
html[data-theme="dark"] .hover\:bg-gray-50:hover,
html[data-theme="dark"] .hover\:bg-gray-100:hover {
    background-color: var(--c-surface-muted) !important;
}

/* Tablas: header gradient en dark */
html[data-theme="dark"] table.min-w-full thead,
html[data-theme="dark"] .c-card table thead {
    background: linear-gradient(180deg, var(--c-surface) 0%, var(--c-surface-muted) 100%) !important;
}
html[data-theme="dark"] table.min-w-full thead th,
html[data-theme="dark"] .c-card table thead th {
    color: var(--c-ink-muted) !important;
    border-bottom-color: var(--c-border) !important;
}
html[data-theme="dark"] table.min-w-full tbody td,
html[data-theme="dark"] .c-card table tbody td {
    border-bottom-color: var(--c-border) !important;
    color: var(--c-ink);
}
html[data-theme="dark"] table.min-w-full tbody tr:hover,
html[data-theme="dark"] .c-card table tbody tr:hover {
    background: rgba(59, 130, 246, 0.06) !important;
}

/* Inputs / select / textarea */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="datetime-local"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: var(--c-surface-sunken) !important;
    border-color: var(--c-border-strong) !important;
    color: var(--c-ink) !important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: var(--c-ink-faint) !important;
}

/* Badges con colores fijos -> ajustar para dark */
html[data-theme="dark"] .bg-yellow-100 { background-color: rgba(245, 158, 11, 0.18) !important; }
html[data-theme="dark"] .text-yellow-800 { color: #fcd34d !important; }
html[data-theme="dark"] .bg-green-100 { background-color: rgba(16, 185, 129, 0.18) !important; }
html[data-theme="dark"] .text-green-700, html[data-theme="dark"] .text-green-800 { color: #6ee7b7 !important; }
html[data-theme="dark"] .bg-red-100, html[data-theme="dark"] .bg-red-50 { background-color: rgba(239, 68, 68, 0.16) !important; }
html[data-theme="dark"] .text-red-600, html[data-theme="dark"] .text-red-700, html[data-theme="dark"] .text-red-800 { color: #fca5a5 !important; }
html[data-theme="dark"] .bg-amber-100 { background-color: rgba(245, 158, 11, 0.18) !important; }
html[data-theme="dark"] .text-amber-700, html[data-theme="dark"] .text-amber-800 { color: #fcd34d !important; }
html[data-theme="dark"] .bg-indigo-50 { background-color: rgba(59, 130, 246, 0.14) !important; }
html[data-theme="dark"] .bg-indigo-100 { background-color: rgba(59, 130, 246, 0.20) !important; }
html[data-theme="dark"] .text-indigo-600, html[data-theme="dark"] .text-indigo-700 { color: #93c5fd !important; }
html[data-theme="dark"] .border-indigo-100 { border-color: rgba(59, 130, 246, 0.30) !important; }

/* Modales y header inline (calls/index usa bg-white explicito) */
html[data-theme="dark"] header.bg-white { background-color: var(--c-surface) !important; border-color: var(--c-border) !important; }

/* Audio player frame oscuro corporativo (calls/show ya usa bg-gray-900) */
html[data-theme="dark"] .bg-gray-900 { background-color: #050a18 !important; }

/* Cards Tailwind con shadow */
html[data-theme="dark"] .shadow,
html[data-theme="dark"] .shadow-sm,
html[data-theme="dark"] .shadow-md,
html[data-theme="dark"] .shadow-lg,
html[data-theme="dark"] .shadow-xl {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 28px rgba(0, 0, 0, 0.25) !important;
}

/* Links */
html[data-theme="dark"] a.text-indigo-600,
html[data-theme="dark"] a.text-indigo-700,
html[data-theme="dark"] a.hover\:text-indigo-800:hover {
    color: #93c5fd !important;
}

/* ============================================================== */
/* Polish v3 — refinamientos finales para tablas y cards            */
/* ============================================================== */

/* Tablas de listado tipo reference: filas mas altas, separadores tenues */
table.min-w-full tbody td,
.c-card table tbody td {
    line-height: 1.45;
}

/* Avatar circles uniformes */
.h-10.w-10.rounded-full {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

/* Chips/pills mas suaves con peso medio */
.rounded-full.px-2,
.rounded-full.px-2\.5 {
    padding-top: 3px;
    padding-bottom: 3px;
    font-weight: 600;
}

/* Loading spinner accesible (usado en AI Coach modal) */
.animate-spin { will-change: transform; }

/* Search inputs estilo reference (con icono opcional) */
input[type="search"],
input[type="text"][placeholder*="Buscar"],
input[type="text"][placeholder*="Search"] {
    border-radius: 10px;
    padding-top: .55rem;
    padding-bottom: .55rem;
}

/* Modales: fondo blur suave (caso AI Coach modal) */
.fixed.inset-0.z-50 {
    animation: modalIn .15s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.fixed.inset-0.z-50 > div {
    animation: modalContentIn .2s ease-out;
}
@keyframes modalContentIn {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Botones disabled (AI buttons) */
button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
