/**
 * Marca RocketWeb: tipografías + colores del manual, sobre Bootstrap 5.3.
 * Se aplica por override de variables CSS (no se recompila Bootstrap).
 * Cargar DESPUÉS de bootstrap y sidebar. No toca los colores fiscales del
 * comprobante (invoice_document.css / layout/pdf.php), que van aparte.
 *
 * Paleta (manual de marca, pág. 6):
 *   Azul Profundo #004D6A · Azul Marino #1B435D · Celeste #D5EEFF
 *   Blanco Cielo #F4FBFF · Rojo Cohete #EF333D · Gris Carbón #333333
 * Tipografías (pág. 7): Poppins (títulos) + Roboto (texto/interfaz).
 */

/* -------------------------------------------------------------------------
   Tipografías (woff2 locales en webroot/font, sin CDN)
   ------------------------------------------------------------------------- */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../font/poppins-600-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../font/poppins-700-latin.woff2') format('woff2');
}

/* Roboto v51 es variable: un archivo cubre todo el eje de peso */
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../font/roboto-latin.woff2') format('woff2');
}

/* -------------------------------------------------------------------------
   Colores de marca (tokens propios)
   ------------------------------------------------------------------------- */
:root {
    --brand-azul-profundo: #004D6A;
    --brand-azul-marino: #1B435D;
    --brand-celeste: #D5EEFF;
    --brand-blanco-cielo: #F4FBFF;
    --brand-rojo-cohete: #EF333D;
    --brand-gris-carbon: #333333;
}

/* -------------------------------------------------------------------------
   Bootstrap: primario = Azul Profundo. Rojo Cohete queda de acento.
   Se pisan las variables globales y las de los componentes que las
   derivan (botones, links, focus ring).
   ------------------------------------------------------------------------- */
:root,
[data-bs-theme='light'] {
    --bs-primary: #004D6A;
    --bs-primary-rgb: 0, 77, 106;

    --bs-link-color: #004D6A;
    --bs-link-color-rgb: 0, 77, 106;
    --bs-link-hover-color: #1B435D;
    --bs-link-hover-color-rgb: 27, 67, 93;

    --bs-btn-focus-shadow-rgb: 0, 77, 106;
    --bs-focus-ring-color: rgba(0, 77, 106, 0.25);
}

/* Botón primario: superficie azul, hover más oscuro (Azul Marino) */
.btn-primary {
    --bs-btn-bg: #004D6A;
    --bs-btn-border-color: #004D6A;
    --bs-btn-hover-bg: #1B435D;
    --bs-btn-hover-border-color: #1B435D;
    --bs-btn-active-bg: #143247;
    --bs-btn-active-border-color: #143247;
    --bs-btn-disabled-bg: #004D6A;
    --bs-btn-disabled-border-color: #004D6A;
}

.btn-outline-primary {
    --bs-btn-color: #004D6A;
    --bs-btn-border-color: #004D6A;
    --bs-btn-hover-bg: #004D6A;
    --bs-btn-hover-border-color: #004D6A;
    --bs-btn-active-bg: #004D6A;
    --bs-btn-active-border-color: #004D6A;
}

/* Rojo Cohete como acento: logo del sidebar */
.app-sidebar__logo-icon {
    color: var(--brand-rojo-cohete);
}

/* -------------------------------------------------------------------------
   Tema oscuro: aclarar el azul para contraste sobre fondos oscuros
   ------------------------------------------------------------------------- */
[data-bs-theme='dark'] {
    --bs-primary: #4FA3C7;
    --bs-primary-rgb: 79, 163, 199;

    --bs-link-color: #7FC4E3;
    --bs-link-color-rgb: 127, 196, 227;
    --bs-link-hover-color: #A9D8EF;
    --bs-link-hover-color-rgb: 169, 216, 239;

    --bs-btn-focus-shadow-rgb: 79, 163, 199;
    --bs-focus-ring-color: rgba(79, 163, 199, 0.3);
}

[data-bs-theme='dark'] .btn-primary {
    --bs-btn-bg: #1B6E8F;
    --bs-btn-border-color: #1B6E8F;
    --bs-btn-hover-bg: #2586AC;
    --bs-btn-hover-border-color: #2586AC;
    --bs-btn-active-bg: #15586F;
    --bs-btn-active-border-color: #15586F;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-disabled-bg: #1B6E8F;
    --bs-btn-disabled-border-color: #1B6E8F;
}

[data-bs-theme='dark'] .btn-outline-primary {
    --bs-btn-color: #7FC4E3;
    --bs-btn-border-color: #4FA3C7;
    --bs-btn-hover-bg: #1B6E8F;
    --bs-btn-hover-border-color: #1B6E8F;
    --bs-btn-hover-color: #fff;
}

/* -------------------------------------------------------------------------
   Tipografía: Roboto de base, Poppins en los títulos
   ------------------------------------------------------------------------- */
:root {
    --bs-body-font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-heading-font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body {
    font-family: var(--bs-body-font-family);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--bs-heading-font-family);
    font-weight: 600;
}

/* La marca del sidebar también en Poppins */
.app-sidebar__brand {
    font-family: var(--bs-heading-font-family);
}

/* -------------------------------------------------------------------------
   Inbox: cada sección en un bloque con fondo apenas distinto del cuerpo
   (más claro en oscuro, más oscuro en claro) para que se lea la separación.
   ------------------------------------------------------------------------- */
.inbox-section {
    background-color: var(--bs-tertiary-bg);
    border-radius: var(--bs-border-radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.inbox-section > h5 {
    margin-bottom: 0.75rem;
}

.inbox-section .table-responsive:last-child,
.inbox-section .table:last-child {
    margin-bottom: 0;
}

/* Empty section = just its title line (green badge at 0), no bottom gap. */
.inbox-section > h5:last-child {
    margin-bottom: 0;
}

/* Inline "Vincular" selector in the actions column: narrow and fixed, so it
   doesn't widen the table; the full candidate label shows in the open list. */
.inbox-link-form .form-select {
    flex: 0 0 11rem;
    width: 11rem;
    text-overflow: ellipsis;
}
