/* ============================================================
   Sistema Médico — Design tokens
   Paleta: clínica de confianza + pulso de voz (IA en llamada)
   ============================================================ */
:root {
    --ink:            #0F2438;   /* navy profundo — sidebar, headers */
    --ink-soft:       #16324A;
    --teal:           #0D5C63;   /* primario / marca */
    --teal-light:     #4FA8A0;
    --teal-pale:      #E4F1F0;
    --mist:           #F4F8F7;   /* fondo de página */
    --card:           #FFFFFF;
    --coral:          #F2765C;   /* acento / alertas / CTA */
    --coral-pale:     #FDEBE6;
    --signal:         #2FBF71;   /* éxito / disponible */
    --signal-pale:    #E4F8ED;
    --amber:          #F2B84B;   /* pendiente / advertencia */
    --amber-pale:     #FDF3E1;
    --slate:          #5B6B73;   /* texto secundario */
    --slate-light:    #8FA0A6;
    --border:         #E1E8E7;
    --text:           #142A34;

    --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
    --font-body:    'Inter', 'Segoe UI', sans-serif;
    --font-mono:    'JetBrains Mono', 'Courier New', monospace;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --shadow-card: 0 1px 2px rgba(15,36,56,0.04), 0 8px 24px rgba(15,36,56,0.06);
    --shadow-pop:  0 12px 32px rgba(15,36,56,0.14);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--mist);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; color: var(--ink); }

a { color: var(--teal); text-decoration: none; }

:focus-visible {
    outline: 2px solid var(--teal-light);
    outline-offset: 2px;
}

/* ============================================================
   LOGIN — split screen: panel de marca (izq) + card (der)
   ============================================================ */
.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
}

@media (max-width: 860px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-brand { display: none; }
}

.login-brand {
    background: radial-gradient(120% 140% at 15% 10%, var(--ink-soft) 0%, var(--ink) 55%, #081521 100%);
    color: #fff;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.login-brand__top { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.login-brand__mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--teal-light), var(--teal));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px;
}

.login-brand__body { max-width: 420px; }
.login-brand__eyebrow {
    font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--teal-light); margin-bottom: 14px;
}
.login-brand__title { font-size: 34px; line-height: 1.2; font-weight: 600; margin-bottom: 16px; color: #fff; }
.login-brand__desc { font-family: var(--font-body); color: #B9C7CF; line-height: 1.6; font-size: 15px; }

/* Waveform / pulso: elemento firma — voz de llamada + latido */
.pulse-line {
    width: 100%; height: 64px;
    display: block;
}
.pulse-line path {
    fill: none;
    stroke: var(--teal-light);
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0.9;
}
.pulse-line .pulse-line__glow {
    stroke: var(--coral);
    stroke-width: 2;
    stroke-dasharray: 12 340;
    stroke-dashoffset: 0;
    animation: pulse-travel 3.2s linear infinite;
}
@keyframes pulse-travel {
    to { stroke-dashoffset: -352; }
}
@media (prefers-reduced-motion: reduce) {
    .pulse-line .pulse-line__glow { animation: none; }
}

.login-brand__foot { font-size: 13px; color: var(--slate-light); }

.login-panel {
    display: flex; align-items: center; justify-content: center;
    padding: 32px;
}

.login-card {
    width: 100%; max-width: 380px;
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-pop);
    border: 1px solid var(--border);
}

.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-card__sub { color: var(--slate); font-size: 14px; margin-bottom: 28px; }

.field { margin-bottom: 18px; }
.field label {
    display: block; font-size: 13px; font-weight: 600; color: var(--ink);
    margin-bottom: 6px;
}
.field input {
    width: 100%; padding: 12px 14px; font-size: 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-family: var(--font-body); background: var(--mist);
    transition: border-color .15s ease, background .15s ease;
}
.field input:focus {
    border-color: var(--teal-light); background: #fff; outline: none;
    box-shadow: 0 0 0 3px var(--teal-pale);
}

.btn-primary {
    width: 100%; padding: 13px; border: none; border-radius: var(--radius-sm);
    background: var(--teal); color: #fff; font-family: var(--font-display);
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: background .15s ease, transform .1s ease;
}
.btn-primary:hover { background: #0A4A50; }
.btn-primary:active { transform: scale(0.99); }

.alert {
    padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13.5px;
    margin-bottom: 20px; display: flex; gap: 10px; align-items: flex-start;
    line-height: 1.5;
}
.alert-error { background: var(--coral-pale); color: #A63A24; border: 1px solid #F4C4B6; }
.alert-info  { background: var(--teal-pale);  color: #0A4A50; border: 1px solid #BFE0DD; }

.login-card__foot { margin-top: 22px; font-size: 12.5px; color: var(--slate-light); text-align: center; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

.sidebar {
    background: radial-gradient(140% 100% at 100% 0%, var(--ink-soft) 0%, var(--ink) 45%, #081521 100%);
    color: #fff;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar__glow {
    position: absolute; top: -80px; left: -60px; width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(79,168,160,0.35) 0%, rgba(79,168,160,0) 70%);
    pointer-events: none; z-index: 0;
}
.sidebar__brand {
    display: flex; align-items: center; gap: 10px;
    padding: 22px 22px 18px; font-family: var(--font-display); font-weight: 600; font-size: 16px;
    letter-spacing: 0.01em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: relative; z-index: 1;
}
.sidebar__mark {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, var(--teal-light), var(--teal));
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 4px 16px rgba(79,168,160,0.45);
}
.nav-group { padding: 18px 12px; flex: 1; overflow-y: auto; position: relative; z-index: 1; }
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 10px; border-radius: var(--radius-sm);
    color: #B9C7CF; font-size: 13.5px; font-weight: 500; margin-bottom: 3px;
    position: relative;
    transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-link:hover .nav-link__icon { background: rgba(255,255,255,0.1); color: #fff; }
.nav-link.active {
    background: linear-gradient(90deg, rgba(79,168,160,0.22) 0%, rgba(79,168,160,0.06) 100%);
    color: #fff;
}
.nav-link.active::before {
    content: ''; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--teal-light);
    box-shadow: 0 0 10px 1px rgba(79,168,160,0.8);
}
.nav-link.active .nav-link__icon { background: var(--teal); color: #fff; box-shadow: 0 0 12px rgba(79,168,160,0.55); }
.nav-link__icon {
    width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px;
    background: rgba(255,255,255,0.05); color: #9FB2BA;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.nav-link__icon svg { width: 17px; height: 17px; }
.nav-link__label { letter-spacing: 0.01em; }

.sidebar__user {
    padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 10px; font-size: 13px;
    position: relative; z-index: 1;
}
.sidebar__avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--teal-light); color: var(--ink);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
    box-shadow: 0 0 0 2px rgba(79,168,160,0.25);
}
.sidebar__user-role { color: var(--slate-light); font-size: 11.5px; }
.logout-link { color: var(--coral); font-size: 12px; margin-top: 4px; display: inline-block; }

.main { padding: 28px 36px 60px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.topbar h1 { font-size: 22px; }
.topbar__sub { color: var(--slate); font-size: 13.5px; margin-top: 4px; }
.empresa-chip {
    display: flex; align-items: center; gap: 8px;
    background: var(--teal-pale); color: #0A4A50;
    padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.empresa-chip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.kpi-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 20px; box-shadow: var(--shadow-card);
}
.kpi-card__label { font-size: 12.5px; color: var(--slate); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-card__value { font-family: var(--font-display); font-size: 30px; color: var(--ink); margin: 8px 0 4px; }
.kpi-card__delta { font-size: 12.5px; font-weight: 600; }
.kpi-card__delta.up { color: var(--signal); }
.kpi-card__delta.down { color: var(--coral); }
.kpi-card__delta.neutral { color: var(--slate); font-weight: 500; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.panel {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 22px; box-shadow: var(--shadow-card);
}
.panel__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel__head h3 { font-size: 15.5px; }

.call-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--border);
}
.call-item:last-child { border-bottom: none; }
.call-item__dot {
    width: 9px; height: 9px; border-radius: 50%; background: var(--slate-light); flex-shrink: 0;
}
.call-item__dot.live { background: var(--coral); box-shadow: 0 0 0 0 rgba(242,118,92,0.5); animation: live-pulse 1.6s ease-out infinite; }
@keyframes live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(242,118,92,0.45); }
    100% { box-shadow: 0 0 0 9px rgba(242,118,92,0); }
}
.call-item__name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.call-item__meta { font-size: 12px; color: var(--slate); font-family: var(--font-mono); }
.call-item__tag {
    margin-left: auto; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
    text-transform: uppercase; letter-spacing: 0.03em;
}
.tag-live { background: var(--coral-pale); color: #A63A24; }
.tag-done { background: var(--signal-pale); color: #1E8A54; }
.tag-pending { background: var(--amber-pale); color: #93690F; }

.status-list { list-style: none; margin: 0; padding: 0; }
.status-list li { display: flex; justify-content: space-between; padding: 9px 0; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.status-list li:last-child { border-bottom: none; }
.status-list .status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }

canvas#weeklyChart { max-height: 220px; }

/* ============================================================
   CRUD — página de listado (tabla) + formulario
   ============================================================ */
.page-head {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-head__sub { color: var(--slate); font-size: 13.5px; margin-top: 4px; }

.btn-secondary {
    padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: #fff; color: var(--ink); font-family: var(--font-body); font-size: 13.5px;
    font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
    transition: border-color .15s ease, background .15s ease;
}
.btn-secondary:hover { border-color: var(--teal-light); background: var(--teal-pale); }

.btn-primary-sm {
    padding: 9px 16px; border: none; border-radius: var(--radius-sm);
    background: var(--teal); color: #fff; font-family: var(--font-body); font-size: 13.5px;
    font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary-sm:hover { background: #0A4A50; }

.btn-link-danger {
    color: var(--coral); font-size: 12.5px; font-weight: 600; background: none; border: none;
    cursor: pointer; padding: 0; text-decoration: underline;
}

.search-bar { display: flex; gap: 10px; margin-bottom: 18px; }
.search-bar input {
    flex: 1; max-width: 320px; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 13.5px; font-family: var(--font-body); background: #fff;
}
.search-bar input:focus { outline: none; border-color: var(--teal-light); box-shadow: 0 0 0 3px var(--teal-pale); }

.data-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.data-table th {
    text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--slate); background: var(--mist); padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.data-table td { padding: 13px 16px; font-size: 13.5px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #FAFCFC; }
.data-table__name { font-weight: 600; color: var(--ink); }
.data-table__muted { color: var(--slate); font-size: 12.5px; }
.data-table__empty { padding: 40px 16px; text-align: center; color: var(--slate); font-size: 13.5px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-on { background: var(--signal-pale); color: #1E8A54; }
.badge-off { background: var(--coral-pale); color: #A63A24; }

.chip-list { display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; }
.chip { background: var(--teal-pale); color: #0A4A50; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.chip-muted { color: var(--slate-light); font-size: 12px; font-style: italic; }

.row-actions { display: flex; gap: 14px; align-items: center; }

.form-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 26px 28px; box-shadow: var(--shadow-card); max-width: 720px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .field-full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.form-section-title { font-family: var(--font-display); font-size: 14px; color: var(--ink); margin: 26px 0 10px; padding-top: 18px; border-top: 1px solid var(--border); }
.form-section-title:first-of-type { border-top: none; padding-top: 0; margin-top: 4px; }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 14px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); }
.checkbox-item input { width: 16px; height: 16px; accent-color: var(--teal); cursor: pointer; }
.checkbox-item label { cursor: pointer; }

.form-actions { display: flex; gap: 10px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }

.empresa-picker { max-width: 420px; }
.empresa-picker .field select { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; background: var(--mist); font-family: var(--font-body); }

select.input-select {
    width: 100%; padding: 12px 14px; font-size: 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-family: var(--font-body); background: var(--mist);
}
select.input-select:focus { outline: none; border-color: var(--teal-light); background: #fff; box-shadow: 0 0 0 3px var(--teal-pale); }

/* ============================================================
   Pestañas (tabs) y formularios compactos en línea — usado en Horarios
   ============================================================ */
.tab-nav { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab-link {
    padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--slate);
    text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color .15s ease, border-color .15s ease;
}
.tab-link:hover { color: var(--ink); }
.tab-link.active { color: var(--teal); border-bottom-color: var(--teal); }

.inline-form {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 16px 18px; margin-bottom: 20px;
}
.inline-form .field { margin-bottom: 0; min-width: 130px; }
.inline-form .field label { font-size: 11.5px; }
.inline-form .field input, .inline-form .field select {
    padding: 9px 10px; font-size: 13.5px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--mist); font-family: var(--font-body);
}
.inline-form .field-grow { flex: 1; min-width: 160px; }

/* ============================================================
   Agenda / Calendario de turnos
   ============================================================ */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.cal-toolbar__nav { display: flex; align-items: center; gap: 10px; }
.cal-nav-btn {
    width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: #fff; display: flex; align-items: center; justify-content: center; text-decoration: none;
    color: var(--ink); font-weight: 700; font-size: 14px;
}
.cal-nav-btn:hover { background: var(--teal-pale); border-color: var(--teal-light); }
.cal-title { font-family: var(--font-display); font-size: 19px; color: var(--ink); text-transform: capitalize; min-width: 190px; text-align: center; }
.cal-vista-switch { display: flex; gap: 4px; background: var(--mist); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; }
.cal-vista-switch a { padding: 7px 13px; font-size: 12.5px; font-weight: 600; color: var(--slate); text-decoration: none; border-radius: 6px; }
.cal-vista-switch a.active { background: #fff; color: var(--teal); box-shadow: var(--shadow-card); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--border); gap: 1px; }
.cal-weekday { background: var(--mist); padding: 9px; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--slate); }
.cal-cell { background: #fff; min-height: 108px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.cal-cell.other-month { background: #FAFBFB; }
.cal-cell.other-month .cal-cell__num { color: var(--slate-light); }
.cal-cell.today { background: var(--teal-pale); }
.cal-cell__num { font-size: 12.5px; font-weight: 700; color: var(--ink); text-decoration: none; align-self: flex-end; }
.cal-cell.today .cal-cell__num {
    background: var(--teal); color: #fff; width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 11.5px;
}
.turno-pill {
    display: block; font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 5px;
    color: #fff; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-more { font-size: 10.5px; color: var(--teal); font-weight: 600; text-decoration: none; }

.day-list { display: flex; flex-direction: column; gap: 10px; }
.day-turno {
    display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow-card);
}
.day-turno__hora { font-family: var(--font-mono); font-weight: 700; font-size: 14px; color: var(--ink); width: 56px; flex-shrink: 0; }
.day-turno__bar { width: 4px; align-self: stretch; border-radius: 3px; flex-shrink: 0; }
.day-turno__body { flex: 1; }
.day-turno__paciente { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.day-turno__meta { font-size: 12px; color: var(--slate); margin-top: 2px; }

/* ============================================================
   Sidebar colapsable
   ============================================================ */
.app-shell { transition: grid-template-columns .18s ease; }
body.sidebar-collapsed .app-shell { grid-template-columns: 76px 1fr; }

.sidebar { transition: width .18s ease; }

.sidebar__brand { position: relative; }
.sidebar__toggle {
    margin-left: auto; width: 26px; height: 26px; flex-shrink: 0;
    background: rgba(255,255,255,0.06); border: none; border-radius: 7px;
    color: #C6D3D8; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .15s ease, color .15s ease;
}
.sidebar__toggle:hover { background: rgba(255,255,255,0.14); color: #fff; }
.sidebar__toggle svg { width: 15px; height: 15px; transition: transform .18s ease; }
body.sidebar-collapsed .sidebar__toggle svg { transform: rotate(180deg); }

/* Cuando está colapsado: ocultar textos, dejar solo íconos centrados */
body.sidebar-collapsed .sidebar__brand-text,
body.sidebar-collapsed .nav-link__label,
body.sidebar-collapsed .sidebar__user-text {
    display: none;
}
body.sidebar-collapsed .sidebar__brand { justify-content: center; gap: 0; padding-left: 12px; padding-right: 12px; }
body.sidebar-collapsed .sidebar__brand .sidebar__mark { display: none; }
body.sidebar-collapsed .sidebar__toggle { margin: 0 auto; }
body.sidebar-collapsed .nav-link { justify-content: center; padding-left: 8px; padding-right: 8px; }
body.sidebar-collapsed .nav-link.active::before { left: -8px; }
body.sidebar-collapsed .sidebar__user { justify-content: center; padding-left: 8px; padding-right: 8px; }

/* Tooltip nativo simple con el label, para no perder contexto al pasar el mouse */
body.sidebar-collapsed .nav-link { position: relative; }

/* ============================================================
   Espaciado del formulario en línea — antes quedaba muy apretado
   ============================================================ */
.inline-form { gap: 18px 20px; padding: 20px 22px; }
.inline-form .field { min-width: 190px; margin-bottom: 4px; }
.inline-form .field-grow { min-width: 220px; }
.inline-form .field label { display: block; margin-bottom: 7px; }

/* ============================================================
   Select2 — integrado a la paleta del sistema
   ============================================================ */
.select2-container--default .select2-selection--single {
    height: 42px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--mist);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px; padding-left: 12px; padding-right: 30px;
    font-size: 13.5px; color: var(--text); font-family: var(--font-body);
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--slate-light); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 40px; right: 8px; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--teal-light); background: #fff; box-shadow: 0 0 0 3px var(--teal-pale);
}
.select2-dropdown {
    border-color: var(--border); border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 13.5px; box-shadow: var(--shadow-pop);
}
.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; font-size: 13px;
}
.select2-results__option--highlighted[aria-selected] { background: var(--teal) !important; }
.select2-container--default .select2-results__option[aria-selected=true] { background: var(--teal-pale); }
.select2-container { width: 100% !important; }

/* ============================================================
   DataTables — integrado a la paleta del sistema
   ============================================================ */
.data-table__toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.dataTables_wrapper .dataTables_filter { margin: 0; }
.dataTables_wrapper .dataTables_filter label { font-size: 13px; color: var(--slate); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px 12px; font-size: 13.5px; font-family: var(--font-body); min-width: 220px;
}
.dataTables_wrapper .dataTables_filter input:focus {
    outline: none; border-color: var(--teal-light); box-shadow: 0 0 0 3px var(--teal-pale);
}
.data-table__footer { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 12.5px; color: var(--slate); flex-wrap: wrap; gap: 10px; }
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; font-size: 13px; margin: 0 4px;
}
.dataTables_wrapper .dataTables_paginate { display: flex; gap: 4px; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 6px 11px; border-radius: 6px; border: 1px solid var(--border);
    color: var(--ink) !important; font-size: 12.5px; cursor: pointer; background: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--teal) !important; color: #fff !important; border-color: var(--teal);
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled { opacity: .4; cursor: default; }
table.dataTable thead th { position: relative; cursor: pointer; }
table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::after { opacity: .5; font-size: 10px; margin-left: 4px; }
