@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ═══════════════════════════════════════════════════════════════════
   CDI v4 — CSS limpio para producción
   - 1 sistema de tabla único: .tabla-base + .tabla-wrap
   - 0 IDs como selector
   - 0 !important salvo en overrides obligados de DataTables/Bootstrap
   - 0 reglas duplicadas, 0 sintaxis rota
   ═══════════════════════════════════════════════════════════════════ */


/* ── CARET NEGRO EN INPUTS ────────────────────────────────── */
input, textarea, [contenteditable] { caret-color: #1a1a1a; }

/* ── VARIABLES ────────────────────────────────────────────── */
:root {
    /* Layout */
    --sb-width:    195px;
    --hdr-height:  70px;

    /* Sidebar */
    --sb-bg:       #0d5c65;
    --sb-hover:    rgba(255,255,255,.08);
    --sb-active:   rgba(0,0,0,.22);
    --sb-text:     #ffffff;
    --sb-accent:   #00D2BE;

    /* Botones de acción en tabla */
    --btn-accion:      #009587;
    --btn-accion-dark: #063C41;

    /* Sistema (teal primario, ej. Nueva orden) */
    --sistema:      #00a898;
    --sistema-dark: #009587;

    /* Acción dropdown (Adjuntar / Ver / Informar) */
    --btn-accion-bg:       #009587;
    --btn-accion-border:   #007a6f;
    --btn-accion-hover:    #063C41;
    --btn-accion-split-bg: #007d75;

    /* Colores principales */
    --blue:        #009587;
    --blue-hover:  #063C41;
    --blue-light:  #e0f5f3;
    --navy:        #063C41;
    --navy-dark:   #042d31;

    /* Fondos */
    --bg:          #ffffff;
    --surface:     #ffffff;
    --surface-2:   #f4f7fa;

    /* Bordes */
    --border:      #c8d4dc;
    --border-soft: #dae2ea;

    /* Texto */
    --text-h:      #0d1e2e;
    --text:        #333333;
    --text-soft:   #1c2b3a;
    --text-muted:  #5d6f80;
    --text-xmuted: #8d9fae;

    /* Semánticos */
    --green:       #059669;
    --green-bg:    #ecfdf5;
    --green-border:#a7f3d0;
    --red:         #dc2626;
    --red-bg:      #fef2f2;
    --amber:       #b45309;

    /* Forma */
    --radius-sm:   5px;
    --radius:      8px;

    /* Sombras */
    --shadow-sm:   0 1px 3px rgba(0,0,0,.07);
    --shadow:      0 2px 8px rgba(0,0,0,.09);
    --shadow-md:   0 4px 16px rgba(0,0,0,.11);

    /* Tabla */
    --tbl-head-bg:     #f0f3f8;
    --tbl-head-color:  #3a4b5c;
    --tbl-head-border: #d8dfe8;
    --tbl-row-border:  #eaecef;
    --tbl-stripe:      #f6f8fb;
    --tbl-hover:       #e8f2fc;

    /* Botón tabla unificado */
    --btn-tabla-h:  26px;
    --btn-tabla-px: 10px;
    --btn-tabla-fs: 12.5px;
}

/* ── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'DM Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}


/* ── Form controls — reducir font-size de Bootstrap (16px → 13.5px) ── */
.form-control,
.form-select,
.input-group-text {
    font-size: 13.5px;
    color: #111827;
}
.form-control::placeholder { color: #6b7280; }
.form-label {
    font-size: 13px;
    margin-bottom: 4px;
}
.form-control-lg { font-size: 14.5px; }

/* ── Form switch — moderno, azul sistema ─────────────────────────── */
.form-check.form-switch {
    min-height: unset;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 0;
}
.form-switch .form-check-input {
    margin-left: 0;
    margin-top: 0;
    flex-shrink: 0;
    width:  2.6em;
    height: 1.4em;
    cursor: pointer;
    background-color: #d1d5db;
    border: none;
    border-radius: 2em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e");
    box-shadow: inset 0 1px 3px rgba(0,0,0,.15);
    transition: background-color .2s ease, box-shadow .2s ease;
}
.form-switch .form-check-input:checked {
    background-color: var(--blue);
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26,92,133,.18), inset 0 1px 3px rgba(0,0,0,.1);
}
.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(26,92,133,.25);
    outline: none;
}
.form-switch .form-check-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    line-height: 1.4em;
    vertical-align: middle;
}

/* ── Air Datepicker — colores ────────────────────────────────────── */
/* Override CSS variables used by Air Datepicker */
.air-datepicker {
    --adp-day-name-color: var(--blue, #1a5c85) !important;
    --adp-accent-color:   var(--blue, #1a5c85) !important;
    --adp-color-secondary: var(--blue, #1a5c85) !important;
    --adp-z-index: 9999 !important;
}
.air-datepicker-global-container { z-index: 9999 !important; }
.air-datepicker-button {
    background: var(--blue, #1a5c85) !important;
    color: #fff !important; font-weight: 700 !important;
    border-radius: 4px !important; border: none !important;
    padding: 4px 14px !important; font-size: 12px !important; cursor: pointer !important;
}
.air-datepicker-button:hover { background: var(--blue-hover, #134a6c) !important; }
.air-datepicker-cell.-selected-                { background: var(--blue, #1a5c85) !important; color: #fff !important; }
.air-datepicker-cell.-selected-:hover          { background: var(--blue-hover, #134a6c) !important; color: #fff !important; }
.air-datepicker-cell.-selected-.-current-      { background: var(--blue, #1a5c85) !important; color: #fff !important; }
.air-datepicker-cell.-current-:not(.-selected-) { color: var(--blue, #1a5c85) !important; font-weight: 700 !important; }
/* Forzar color día-nombre por si no toma la variable */
.air-datepicker--day-name { color: var(--blue, #1a5c85) !important; font-weight: 600 !important; }
