/* ═══════════════════════════════════════════════════════════════
   COLOR BLUE · Malla Horaria — Sistema de diseño enterprise (2026)
   Alineado al design system canónico de los portales Comercial /
   Mercadeo (packages/cb-shell): accent navy #1F323A + teal soft,
   tipografía Inter compacta, superficies claras, sombras sutiles,
   shell sidebar + topbar estilo Linear / Shopify.

   Los tokens viven en :root. Se conservan los nombres legacy
   (--cb-azul, --cb-gris-line, …) remapeados a la paleta nueva para
   que los estilos inline existentes adopten la marca sin tocarlos.
   ═══════════════════════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
    /* ── Marca: navy + teal (COLOR BLUE real) ─────────────────── */
    --cb-navy:        #1F323A;
    --cb-navy-dark:   #16252B;
    --cb-navy-soft:   #2C4651;
    --cb-teal:        #AEC9CE;
    --cb-teal-soft:   #E4ECEE;

    /* Accent = navy. Legacy "azul" remapeado a la marca. */
    --accent:         #1F323A;
    --accent-hover:   #162830;
    --accent-soft:    #E4ECEE;
    --cb-azul:        #1F323A;
    --cb-azul-vivo:   #162830;
    --cb-azul-soft:   #E4ECEE;

    /* ── Neutros ──────────────────────────────────────────────── */
    --bg:             #F5F6FA;
    --surface:        #FFFFFF;
    --bg-secondary:   #EEF0F6;
    --bg-tertiary:    #E8EAF0;
    --border:         #E8EAF0;
    --border-strong:  #C8CCD6;
    --cb-gris-bg:     #F5F6FA;
    --cb-gris-line:   #E8EAF0;
    --cb-gris-soft:   #F4F6F9;

    --text:           #0E0D13;
    --text-secondary: #4F4F4F;
    --cb-texto:       #0E0D13;
    --cb-muted:       #8C8F94;
    --cb-muted-soft:  #B6BAC2;

    /* ── Estados ──────────────────────────────────────────────── */
    --cb-success:       #0A7B5A;
    --cb-success-soft:  #E1F0EB;
    --cb-success-text:  #075E45;
    --cb-warning:       #C87A00;
    --cb-warning-soft:  #FBF0DB;
    --cb-warning-text:  #8F5800;
    --cb-danger:        #B41933;
    --cb-danger-soft:   #F8E1E5;
    --cb-danger-text:   #8F1429;
    --cta:              #B41933;

    /* ── Spacing scale (base 4px) ─────────────────────────────── */
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
    --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
    --sp-12: 48px; --sp-16: 64px;

    /* ── Radius ───────────────────────────────────────────────── */
    --radius-sm:   8px;
    --radius-md:   12px;
    --radius-lg:   16px;
    --radius-xl:   20px;
    --radius-full: 999px;

    /* ── Sombras (sutiles, multicapa) ─────────────────────────── */
    --shadow-xs:  0 1px 2px rgba(14, 13, 19, 0.04);
    --shadow-sm:  0 1px 3px rgba(14, 13, 19, 0.05), 0 1px 2px rgba(14, 13, 19, 0.03);
    --shadow-md:  0 2px 8px rgba(14, 13, 19, 0.06), 0 1px 3px rgba(14, 13, 19, 0.04);
    --shadow-lg:  0 8px 24px rgba(14, 13, 19, 0.10), 0 2px 6px rgba(14, 13, 19, 0.05);
    --shadow-xl:  0 16px 40px rgba(14, 13, 19, 0.16);

    /* ── Transitions ──────────────────────────────────────────── */
    --tx-fast: 130ms cubic-bezier(0.16, 1, 0.3, 1);
    --tx-base: 220ms cubic-bezier(0.16, 1, 0.3, 1);
    --tx-slow: 360ms cubic-bezier(0.16, 1, 0.3, 1);

    /* ── Layout shell ─────────────────────────────────────────── */
    --sidebar-w: 248px;
    --topbar-h:  56px;

    /* ── Z-index ──────────────────────────────────────────────── */
    --z-sticky: 1020;
    --z-topbar: 1030;
    --z-sidebar: 1040;
    --z-backdrop: 1035;
    --z-dropdown: 1050;
    --z-modal: 1060;
}

/* ═══════════════════════════════════════════════════════════════
   Base
   ═══════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    font-feature-settings: "cv11", "ss01", "tnum";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.014em;
}
h1 { font-size: 1.5rem;   line-height: 1.2; }
h2 { font-size: 1.25rem;  line-height: 1.25; }
h3 { font-size: 1.0625rem; line-height: 1.3; }
h4 { font-size: 0.95rem;  line-height: 1.35; }

.text-muted { color: var(--cb-muted) !important; }

a, .text-primary { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

::selection { background: var(--cb-teal); color: var(--cb-navy); }

/* Scrollbar fino enterprise */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--cb-muted); background-clip: content-box; }

/* ═══════════════════════════════════════════════════════════════
   Shell: sidebar + topbar
   ═══════════════════════════════════════════════════════════════ */

.cb-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sidebar);
    transition: transform var(--tx-base);
}

.cb-sidebar-header {
    height: var(--topbar-h);
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 0 var(--sp-4);
    border-bottom: 1px solid var(--border);
}
.cb-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    text-decoration: none;
    min-width: 0;
}
.cb-brand-logo {
    height: 17px;
    width: auto;
    color: var(--cb-navy);   /* SVG usa fill:currentColor */
    flex-shrink: 0;
}
.cb-brand-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cb-muted);
    padding-left: var(--sp-2);
    border-left: 1px solid var(--border);
    white-space: nowrap;
}
.cb-sidebar-close {
    display: none;
    margin-left: auto;
    background: none; border: none;
    color: var(--cb-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: var(--sp-1);
}

.cb-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-3) var(--sp-3) var(--sp-4);
}
.cb-nav-section { margin-bottom: var(--sp-4); }
.cb-nav-section-title {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--cb-muted-soft);
    padding: 0 var(--sp-3);
    margin-bottom: var(--sp-2);
}
.cb-nav-link {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    height: 36px;
    padding: 0 var(--sp-3);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    border-left: 2px solid transparent;
    transition: background var(--tx-fast), color var(--tx-fast);
}
.cb-nav-link i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
    color: var(--cb-muted);
    transition: color var(--tx-fast);
    flex-shrink: 0;
}
.cb-nav-link:hover {
    background: var(--bg-secondary);
    color: var(--text);
}
.cb-nav-link:hover i { color: var(--text-secondary); }
.cb-nav-link.active {
    background: var(--accent-soft);
    color: var(--cb-navy);
    font-weight: 600;
}
.cb-nav-link.active i { color: var(--cb-navy); }

.cb-sidebar-footer {
    border-top: 1px solid var(--border);
    padding: var(--sp-3);
}
.cb-user {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2);
    border-radius: var(--radius-sm);
}
.cb-user-avatar {
    width: 34px; height: 34px;
    border-radius: var(--radius-full);
    background: var(--cb-navy);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
    flex-shrink: 0;
}
.cb-user-meta { min-width: 0; flex: 1; }
.cb-user-name {
    font-size: 0.8125rem; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cb-user-role { font-size: 0.7rem; color: var(--cb-muted); }
.cb-user-logout {
    color: var(--cb-muted);
    font-size: 1.05rem;
    padding: var(--sp-1) var(--sp-2);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: background var(--tx-fast), color var(--tx-fast);
}
.cb-user-logout:hover { background: var(--cb-danger-soft); color: var(--cb-danger); }

/* Main column */
.cb-shell-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.cb-topbar {
    position: sticky; top: 0;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 0 var(--sp-6);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
    z-index: var(--z-topbar);
}
.cb-topbar-toggle {
    display: none;
    background: none; border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center; justify-content: center;
}
.cb-topbar-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.cb-topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}
.cb-topbar-user { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); }
.cb-topbar-chip {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--cb-navy);
    background: var(--accent-soft);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    text-transform: capitalize;
}

.cb-content {
    flex: 1;
    padding: var(--sp-6);
    max-width: 1480px;
    width: 100%;
}
.cb-flash { margin-bottom: var(--sp-4); }

.cb-backdrop {
    position: fixed; inset: 0;
    background: rgba(14, 13, 19, 0.4);
    z-index: var(--z-backdrop);
}

/* Pantallas públicas (login, recuperación) */
.cb-public {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-6);
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(174, 201, 206, 0.18), transparent 60%),
        var(--bg);
}
.cb-public-inner { width: 100%; max-width: 960px; }

/* Responsive: colapsar a off-canvas */
@media (max-width: 991.98px) {
    .cb-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
        width: 280px;
    }
    .cb-sidebar.open { transform: translateX(0); }
    .cb-sidebar-close { display: inline-flex; }
    .cb-shell-main { margin-left: 0; }
    .cb-topbar-toggle { display: inline-flex; }
}
@media (min-width: 992px) {
    .cb-backdrop { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   Botones
   ═══════════════════════════════════════════════════════════════ */

.btn {
    font-weight: 600;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.9rem;
    letter-spacing: -0.005em;
    transition: background var(--tx-fast), border-color var(--tx-fast),
                box-shadow var(--tx-fast), transform var(--tx-fast), color var(--tx-fast);
}
.btn:active { transform: translateY(0.5px); }

.btn-primary, .btn-cb {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-primary:hover, .btn-cb:hover, .btn-primary:focus, .btn-cb:focus {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text-secondary);
}
.btn-secondary:hover, .btn-secondary:focus {
    background: var(--bg-secondary);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-success {
    background-color: var(--cb-success);
    border-color: var(--cb-success);
    color: #fff;
}
.btn-success:hover, .btn-success:focus {
    background-color: #075E45; border-color: #075E45; color: #fff;
}

.btn-danger {
    background-color: var(--cb-danger);
    border-color: var(--cb-danger);
    color: #fff;
}
.btn-danger:hover, .btn-danger:focus { background-color: #8F1429; border-color: #8F1429; color: #fff; }

.btn-warning {
    background-color: var(--cb-warning);
    border-color: var(--cb-warning);
    color: #fff;
}
.btn-warning:hover, .btn-warning:focus { background-color: #8F5800; border-color: #8F5800; color: #fff; }

.btn-light {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-secondary);
}
.btn-light:hover { background: var(--bg-secondary); color: var(--text); }

.btn-outline-primary, .btn-outline-cb {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--cb-navy);
}
.btn-outline-primary:hover, .btn-outline-cb:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-outline-secondary {
    border-color: var(--border-strong);
    color: var(--text-secondary);
}
.btn-outline-secondary:hover { background: var(--bg-secondary); color: var(--text); border-color: var(--border-strong); }

.btn-outline-danger { border-color: var(--cb-danger); color: var(--cb-danger); }
.btn-outline-danger:hover { background: var(--cb-danger); color: #fff; }
.btn-outline-success { border-color: var(--cb-success); color: var(--cb-success); }
.btn-outline-success:hover { background: var(--cb-success); color: #fff; }

.btn-sm { font-size: 0.75rem; padding: 0.3rem 0.6rem; border-radius: var(--radius-sm); }
.btn-lg { font-size: 0.95rem; padding: 0.65rem 1.3rem; border-radius: var(--radius-md); }

.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(31, 50, 58, 0.18); }

/* ═══════════════════════════════════════════════════════════════
   Inputs / forms
   ═══════════════════════════════════════════════════════════════ */

.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.35rem; }
.form-text { font-size: 0.74rem; color: var(--cb-muted); }

.form-control, .form-select {
    font-size: 0.8125rem;
    color: var(--text);
    background-color: var(--surface);
    border-color: var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.7rem;
    transition: border-color var(--tx-fast), box-shadow var(--tx-fast);
}
.form-control::placeholder { color: var(--cb-muted-soft); }
.form-control:focus, .form-select:focus {
    border-color: var(--cb-navy);
    box-shadow: 0 0 0 3px rgba(31, 50, 58, 0.12);
}
.form-control-lg, .form-select-lg { padding: 0.65rem 0.9rem; font-size: 0.9rem; border-radius: var(--radius-md); }
.form-control-sm, .form-select-sm { font-size: 0.75rem; padding: 0.3rem 0.5rem; }

.input-group-text {
    background: var(--bg-secondary);
    border-color: var(--border-strong);
    color: var(--cb-muted);
    font-size: 0.8125rem;
}
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { border-color: var(--cb-navy); box-shadow: 0 0 0 3px rgba(31, 50, 58, 0.12); }

/* ═══════════════════════════════════════════════════════════════
   Cards + componentes CB
   ═══════════════════════════════════════════════════════════════ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: var(--text);
    padding: var(--sp-4) var(--sp-5);
}
.card-body { padding: var(--sp-5); }
.card-title { color: var(--text); font-weight: 700; }

.cb-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--sp-5);
}
.cb-card-interactive {
    transition: box-shadow var(--tx-base), transform var(--tx-base), border-color var(--tx-base);
    cursor: pointer; text-decoration: none; color: inherit; display: block;
}
.cb-card-interactive:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--cb-teal);
    color: inherit;
}

/* ── Hero / encabezado de página ────────────────────────────── */
.cb-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--cb-navy) 0%, var(--cb-navy-soft) 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: var(--sp-6) var(--sp-6);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--sp-6);
}
.cb-hero::after {
    content: "";
    position: absolute;
    top: -40%; right: -10%;
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(174, 201, 206, 0.22), transparent 70%);
    pointer-events: none;
}
.cb-hero h1, .cb-hero h2 { color: #fff; margin: 0; position: relative; }
.cb-hero .cb-hero-subtitle {
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.9rem;
    margin-top: var(--sp-2);
    position: relative;
}

/* ── KPI cards ──────────────────────────────────────────────── */
.cb-kpi {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--tx-base), transform var(--tx-base);
    text-decoration: none; color: inherit; display: block;
    overflow: hidden;
}
.cb-kpi:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); color: inherit; }
a.cb-kpi::after {
    content: "\F138"; /* bi chevron-right */
    font-family: "bootstrap-icons";
    position: absolute; top: var(--sp-4); right: var(--sp-4);
    color: var(--cb-muted-soft);
    font-size: 0.8rem; opacity: 0;
    transition: opacity var(--tx-fast), transform var(--tx-fast);
}
a.cb-kpi:hover::after { opacity: 1; transform: translateX(2px); }
.cb-kpi-label {
    color: var(--cb-muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--sp-2);
}
.cb-kpi-value {
    color: var(--text);
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.cb-kpi-suffix { color: var(--cb-muted); font-size: 0.78rem; margin-top: var(--sp-2); }
.cb-kpi-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius-md);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft);
    color: var(--cb-navy);
    font-size: 1.15rem;
    margin-bottom: var(--sp-3);
}
.cb-kpi-icon.warn   { background: var(--cb-warning-soft); color: var(--cb-warning); }
.cb-kpi-icon.danger { background: var(--cb-danger-soft);  color: var(--cb-danger); }
.cb-kpi-icon.ok     { background: var(--cb-success-soft); color: var(--cb-success); }

.cb-kpi.cb-kpi-danger  { border-color: rgba(180, 25, 51, 0.30); }
.cb-kpi.cb-kpi-danger  .cb-kpi-value { color: var(--cb-danger); }
.cb-kpi.cb-kpi-warning { border-color: rgba(200, 122, 0, 0.30); }
.cb-kpi.cb-kpi-warning .cb-kpi-value { color: var(--cb-warning); }
.cb-kpi.cb-kpi-success .cb-kpi-value { color: var(--cb-success); }

/* ── Action tiles ───────────────────────────────────────────── */
.cb-action {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
    display: flex; align-items: flex-start; gap: var(--sp-4);
    text-decoration: none; color: inherit;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--tx-base), transform var(--tx-base), border-color var(--tx-base);
}
.cb-action:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--cb-teal);
    color: inherit;
}
.cb-action-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-md);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft);
    color: var(--cb-navy);
    font-size: 1.25rem;
    flex-shrink: 0;
}
.cb-action-title { color: var(--text); font-weight: 700; font-size: 0.95rem; margin: 0; }
.cb-action-desc { color: var(--cb-muted); font-size: 0.8rem; margin-top: 2px; margin-bottom: 0; }

/* ── Login chooser / auth cards ─────────────────────────────── */
.cb-login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: var(--sp-8) var(--sp-6);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: box-shadow var(--tx-base), transform var(--tx-base);
    height: 100%;
}
.cb-login-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.cb-login-card.cb-login-admin { border-top-color: var(--cb-success); }
.cb-login-card-icon {
    width: 60px; height: 60px;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--cb-navy);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    margin-bottom: var(--sp-4);
}
.cb-login-card.cb-login-admin .cb-login-card-icon { background: var(--cb-success-soft); color: var(--cb-success); }

/* ── Logo en pantallas standalone ───────────────────────────── */
.login-brand-mark, .cb-brand-mark {
    height: 30px; width: auto; display: block;
    color: var(--cb-navy);
    margin: 0 auto var(--sp-4) auto;
}
.cb-brand-mark-lg { height: 44px; width: auto; display: block; color: var(--cb-navy); margin: 0 auto var(--sp-5) auto; }

/* ═══════════════════════════════════════════════════════════════
   Tablas
   ═══════════════════════════════════════════════════════════════ */

.table {
    --bs-table-bg: transparent;
    color: var(--text);
    font-size: 0.8125rem;
    margin-bottom: 0;
}
.table th {
    white-space: nowrap;
    color: var(--cb-muted);
    font-weight: 600;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--cb-gris-soft);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0.75rem;
}
.table-light th { background-color: var(--cb-gris-soft); }
.table td {
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    padding: 0.6rem 0.75rem;
}
.table > :not(caption) > * > * { border-bottom-color: var(--border); }
.table-hover > tbody > tr:hover > * { background-color: rgba(174, 201, 206, 0.10); }
.table-success td, .table-success th { background-color: rgba(10, 123, 90, 0.08) !important; }

/* Tabla envuelta como tarjeta enterprise */
.cb-table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.cb-table-card .table { border-radius: 0; }
.cb-table-card .table th:first-child { padding-left: var(--sp-5); }
.cb-table-card .table td:first-child { padding-left: var(--sp-5); }
.cb-table-card .table tr:last-child td { border-bottom: none; }

/* Estados de horario (badges en grilla) */
.estado-descansa    { background-color: var(--cb-muted); }
.estado-vacaciones  { background-color: var(--cb-navy); }
.estado-incapacidad { background-color: var(--cb-warning); color: #fff; }
.estado-compensa    { background-color: #6f42c1; }
.estado-licencia    { background-color: var(--cb-navy-soft); }

.table input[type="time"] {
    min-width: 86px; font-size: 0.78rem; padding: 2px 4px; border-radius: var(--radius-sm);
}
.table select.form-select-sm { font-size: 0.78rem; border-radius: var(--radius-sm); }

/* ═══════════════════════════════════════════════════════════════
   Badges
   ═══════════════════════════════════════════════════════════════ */

.badge {
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.01em;
    border-radius: var(--radius-full);
    padding: 0.32em 0.7em;
}
.bg-primary { background-color: var(--accent) !important; }
.bg-secondary { background-color: var(--cb-muted) !important; }
.bg-success { background-color: var(--cb-success) !important; }
.bg-danger  { background-color: var(--cb-danger) !important; }
.bg-warning { background-color: var(--cb-warning) !important; color: #fff !important; }
.bg-info    { background-color: var(--cb-navy-soft) !important; }
.bg-light   { background-color: var(--bg-secondary) !important; color: var(--text-secondary) !important; }
.text-bg-light { background-color: var(--bg-secondary) !important; color: var(--text) !important; }

.cb-badge {
    display: inline-flex; align-items: center; gap: var(--sp-1);
    background: var(--accent-soft); color: var(--cb-navy);
    font-weight: 600; font-size: 0.72rem;
    padding: 0.25rem 0.6rem; border-radius: var(--radius-full);
}
.cb-badge.cb-badge-success { background: var(--cb-success-soft); color: var(--cb-success-text); }
.cb-badge.cb-badge-warning { background: var(--cb-warning-soft); color: var(--cb-warning-text); }
.cb-badge.cb-badge-danger  { background: var(--cb-danger-soft);  color: var(--cb-danger-text); }
.cb-badge.cb-badge-neutral { background: var(--bg-tertiary);     color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════
   Alertas
   ═══════════════════════════════════════════════════════════════ */

.alert {
    border: 1px solid transparent;
    border-left-width: 3px;
    border-radius: var(--radius-md);
    padding: var(--sp-3) var(--sp-4);
    font-size: 0.85rem;
    box-shadow: var(--shadow-xs);
}
.alert-info, .alert-primary {
    background: var(--accent-soft); color: var(--cb-navy);
    border-color: var(--cb-teal); border-left-color: var(--cb-navy);
}
.alert-success { background: var(--cb-success-soft); color: var(--cb-success-text); border-left-color: var(--cb-success); }
.alert-warning { background: var(--cb-warning-soft); color: var(--cb-warning-text); border-left-color: var(--cb-warning); }
.alert-danger  { background: var(--cb-danger-soft);  color: var(--cb-danger-text);  border-left-color: var(--cb-danger); }

/* ═══════════════════════════════════════════════════════════════
   Section labels / dropdowns / modales / nav-pills / tabs
   ═══════════════════════════════════════════════════════════════ */

.cb-section-label {
    color: var(--cb-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: var(--sp-6) 0 var(--sp-3);
}
.cb-section-label:first-child { margin-top: 0; }

.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--sp-2);
    font-size: 0.8125rem;
}
.dropdown-item { border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); color: var(--text-secondary); }
.dropdown-item:hover { background: var(--bg-secondary); color: var(--text); }
.dropdown-item.text-danger:hover { background: var(--cb-danger-soft); color: var(--cb-danger) !important; }
.dropdown-divider { border-color: var(--border); }

.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}
.modal-header { border-bottom: 1px solid var(--border); padding: var(--sp-4) var(--sp-5); }
.modal-body { padding: var(--sp-5); }
.modal-footer { border-top: 1px solid var(--border); padding: var(--sp-4) var(--sp-5); }
.modal-title { font-weight: 700; }

.nav-pills .nav-link { color: var(--text-secondary); border-radius: var(--radius-sm); font-size: 0.8125rem; font-weight: 600; }
.nav-pills .nav-link.active { background: var(--accent); color: #fff; }
.nav-tabs { border-bottom: 1px solid var(--border); }
.nav-tabs .nav-link { color: var(--cb-muted); border: none; border-bottom: 2px solid transparent; font-weight: 600; font-size: 0.8125rem; }
.nav-tabs .nav-link.active { color: var(--cb-navy); background: transparent; border-bottom-color: var(--cb-navy); }

.page-link { color: var(--accent); border-color: var(--border); font-size: 0.8125rem; }
.page-item.active .page-link { background: var(--accent); border-color: var(--accent); }

.list-group-item { border-color: var(--border); font-size: 0.85rem; }

/* ═══════════════════════════════════════════════════════════════
   Utilidades
   ═══════════════════════════════════════════════════════════════ */

.cb-stack > * + * { margin-top: var(--sp-3); }
.cb-stack-sm > * + * { margin-top: var(--sp-2); }
.cb-stack-lg > * + * { margin-top: var(--sp-6); }
.cb-cluster { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }

hr { border-color: var(--border); opacity: 1; }
code { color: var(--cb-danger); background: var(--cb-danger-soft); padding: 1px 5px; border-radius: 4px; font-size: 0.85em; }

@media (max-width: 768px) {
    .cb-content { padding: var(--sp-4); }
    .cb-hero { padding: var(--sp-5) var(--sp-4); }
    .cb-kpi-value { font-size: 1.6rem; }
    .cb-topbar { padding: 0 var(--sp-4); }
}

/* ═══════════════════════════════════════════════════════════════
   BLUE Talent — shell del "universo" (puerta /bluetalent). Distinto del
   shell enfocado de la Malla: topbar navy + home de tiles de módulos.
   ═══════════════════════════════════════════════════════════════ */
.bt-topbar {
    position: sticky; top: 0; z-index: var(--z-topbar);
    height: var(--topbar-h); display: flex; align-items: center;
    gap: var(--sp-3); padding: 0 var(--sp-6);
    background: linear-gradient(135deg, var(--cb-navy) 0%, var(--cb-navy-soft) 100%);
    color: #fff;
}
.bt-brand { display: flex; align-items: center; gap: var(--sp-2); color: #fff;
    text-decoration: none; font-weight: 800; letter-spacing: .01em; font-size: 1.05rem; }
.bt-brand .bt-accent { color: var(--cb-teal); }
.bt-logo-img { height: 30px; width: auto; display: block; }
/* Hero de marca del home (imagen oficial BLUE Talent). */
.bt-banner-img { width: 100%; max-width: 100%; display: block; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); margin-bottom: var(--sp-5); }
.bt-topbar-right { margin-left: auto; display: flex; align-items: center;
    gap: var(--sp-4); font-size: .85rem; }
.bt-topbar-right a { color: var(--cb-teal); }
.bt-topbar-right a:hover { color: #fff; }
.bt-content { max-width: 1100px; margin: 0 auto; padding: var(--sp-8) var(--sp-5); }
.bt-hero { margin-bottom: var(--sp-6); }
.bt-hero h1 { font-size: 1.5rem; font-weight: 800; margin: 0 0 4px; }
.bt-hero p { color: var(--cb-muted); margin: 0; }
.bt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--sp-4); }
.bt-tile { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-5);
    border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface);
    box-shadow: var(--shadow-sm); text-decoration: none; color: inherit; min-height: 160px;
    transition: box-shadow var(--tx-base), transform var(--tx-base), border-color var(--tx-base); }
.bt-tile-activo:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px);
    border-color: var(--cb-teal); }
.bt-tile-inactivo { opacity: .6; cursor: default; }
.bt-tile-icon { width: 44px; height: 44px; border-radius: var(--radius-md);
    background: var(--accent-soft); color: var(--cb-navy); display: grid; place-content: center;
    font-size: 1.3rem; }
.bt-tile-titulo { font-weight: 700; font-size: 1.05rem; }
.bt-tile-desc { color: var(--cb-muted); font-size: .85rem; }
.bt-tile-badge { align-self: flex-start; margin-top: auto; font-size: .68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; color: var(--cb-warning-text);
    background: var(--cb-warning-soft); padding: 2px 8px; border-radius: var(--radius-full); }

/* Resumen (home): comunicados NOTIBLUE/INFOBLUE + cumpleaños del mes */
.bt-cat { display: inline-block; font-size: .66rem; font-weight: 800; letter-spacing: .07em;
    text-transform: uppercase; padding: 2px 9px; border-radius: var(--radius-full); }
.bt-cat-notiblue { background: var(--cb-navy); color: #fff; }
.bt-cat-infoblue { background: var(--cb-teal); color: var(--cb-navy); }
.bt-cat-general  { background: var(--bg-tertiary); color: var(--text-secondary); }
.bt-noticia-cuerpo { white-space: pre-line; color: var(--text-secondary); font-size: .9rem; }
.bt-noticia-meta { color: var(--cb-muted); font-size: .75rem; }
.bt-cumple { display: flex; align-items: center; gap: var(--sp-3);
    padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.bt-cumple:last-child { border-bottom: 0; }
.bt-cumple-dia { flex: none; width: 38px; height: 38px; border-radius: var(--radius-md);
    background: var(--accent-soft); color: var(--cb-navy); display: grid; place-content: center;
    font-weight: 800; line-height: 1; }
.bt-cumple-hoy .bt-cumple-dia { background: var(--cb-navy); color: #fff; }

/* Calificación por estrellas (Bienestar / Atención al colaborador) */
.bt-stars { display: inline-flex; align-items: center; gap: 2px; color: #f5b301;
    font-size: .82rem; white-space: nowrap; }
.bt-stars .bi-star { color: var(--cb-muted); }
.bt-stars-n { margin-left: 4px; color: var(--text-secondary); font-size: .72rem; font-weight: 600; }
/* Input interactivo: radios en orden inverso + resaltado por hover con el
   selector de hermano general (~), técnica CSS pura sin JS. */
.bt-rate { display: inline-flex; flex-direction: row-reverse; align-items: center; }
.bt-rate input { position: absolute; opacity: 0; width: 0; height: 0; }
.bt-rate label { color: var(--cb-muted); font-size: 1.15rem; cursor: pointer; padding: 0 1px;
    line-height: 1; transition: color .1s ease; }
.bt-rate input:checked ~ label,
.bt-rate label:hover, .bt-rate label:hover ~ label { color: #f5b301; }
.bt-rate input:focus-visible + label { outline: 2px solid var(--cb-navy); outline-offset: 2px; border-radius: 2px; }

/* Reconocimientos (kudos) */
.bt-kudo { display: flex; align-items: flex-start; gap: var(--sp-3); }
.bt-kudo-icon { flex: none; width: 42px; height: 42px; border-radius: var(--radius-full);
    background: var(--accent-soft); color: var(--cb-navy); display: grid; place-content: center;
    font-size: 1.15rem; }
.bt-kudo-msg { margin-top: 4px; }
/* Chips de valor: radios ocultos + label como chip seleccionable */
.bt-valor-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bt-valor-chips input { position: absolute; opacity: 0; width: 0; height: 0; }
.bt-valor-chips label { display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-full);
    font-size: .78rem; font-weight: 600; color: var(--text-secondary); cursor: pointer;
    transition: all .12s ease; }
.bt-valor-chips input:checked + label { background: var(--cb-navy); color: #fff; border-color: var(--cb-navy); }
.bt-valor-chips input:focus-visible + label { outline: 2px solid var(--cb-navy); outline-offset: 2px; }

/* Analíticas de Bienestar */
.bt-kpi { text-align: center; padding: var(--sp-3); }
.bt-kpi-n { font-size: 1.9rem; font-weight: 800; line-height: 1.1; color: var(--cb-navy); }
.bt-kpi-l { font-size: .74rem; color: var(--text-secondary); margin-top: 4px; }
.bt-bar-row { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.bt-bar-label { flex: none; width: 8.5rem; font-size: .8rem; color: var(--text-secondary); }
.bt-bar-track { flex: 1; height: 12px; background: var(--bg-tertiary); border-radius: var(--radius-full); overflow: hidden; }
.bt-bar-fill { height: 100%; background: var(--cb-navy); border-radius: var(--radius-full); min-width: 2px; transition: width .3s ease; }
.bt-bar-val { flex: none; width: 2.5rem; text-align: right; font-size: .8rem; font-weight: 700;
    font-variant-numeric: tabular-nums; }
.bt-ranking { list-style: none; counter-reset: r; margin: 0; padding: 0; }
.bt-ranking li { counter-increment: r; display: flex; align-items: center; gap: var(--sp-2);
    padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.bt-ranking li:last-child { border-bottom: 0; }
.bt-ranking li::before { content: counter(r); flex: none; width: 22px; height: 22px;
    border-radius: var(--radius-full); background: var(--accent-soft); color: var(--cb-navy);
    display: grid; place-content: center; font-size: .72rem; font-weight: 800; }
