/* ══════════════════════════════════════════════════════════════
   LOGIN
   ══════════════════════════════════════════════════════════════ */

.login-body {
    position: relative;
    min-height: 100vh;
    background: #063C41;
    display: flex; align-items: center; justify-content: center;
    overflow-x: hidden;
}
.login-body::before {
    content: '';
    position: fixed; inset: 0; z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3Cpath d='M0 20 Q15 5 30 20 Q45 35 60 20 Q75 5 90 20 Q105 35 120 20' fill='none' stroke='rgba(0,210,190,0.10)' stroke-width='1.5'/%3E%3C/svg%3E");
    background-size: 120px 40px;
    pointer-events: none;
}

.login-center {
    position: relative; z-index: 1;
    width: 100%; padding: 40px 20px;
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
}

/* ── Card principal ── */
.login-split {
    position: relative;
    display: grid;
    grid-template-columns: 38% 1fr;
    grid-template-rows: 1fr auto;
    width: 100%; max-width: 960px;
    min-height: 440px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
}

/* Fondo continuo columna izquierda */
.login-split::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 38%;
    background: #042d31;
    z-index: 0;
}

.brand-logo--mobile  { display: none; }
.brand-logo--desktop { display: block; }

/* ── Panel izquierdo ── */
.login-split__brand {
    grid-column: 1; grid-row: 1;
    position: relative; z-index: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 48px 36px 26px; text-align: center;
    gap: 18px;
}
.login-split__brand img  { height: 150px; width: auto; object-fit: contain; }
.brand-logo--desktop     { filter: brightness(0) invert(1); }
.login-split__brand-name {
    color: rgba(255,255,255,.92); font-size: 15px; font-weight: 600;
    letter-spacing: .1px; line-height: 1.4; margin: 0;
}

/* ── Datos de contacto (parte baja izquierda) ── */
.login-split__info {
    grid-column: 1; grid-row: 2;
    position: relative; z-index: 1;
    padding: 20px 36px 36px;
    border-top: 1px solid rgba(255,255,255,.1);
    display: flex; flex-direction: column; gap: 12px;
}
.login-split__info-row {
    display: flex; align-items: flex-start; gap: 11px;
    font-size: 13px; color: rgba(255,255,255,.9); text-align: left;
    line-height: 1.4;
}
.login-split__info-row i { width: 15px; flex-shrink: 0; margin-top: 2px; }

/* ── Panel derecho: formulario ── */
.login-split__form {
    grid-column: 2; grid-row: 1 / -1;
    padding: 0 52px;
    display: flex; flex-direction: column; justify-content: center;
    align-self: stretch;
    background: #fff;
}
.login-split__title {
    font-size: 24px; font-weight: 800;
    color: #0f2233; margin: 0 0 6px;
    letter-spacing: -.3px;
}
.login-split__sub { font-size: 14px; color: #0e1113; margin: 0 0 26px; }

.login-label {
    display: block; font-size: 13.5px; font-weight: 700;
    color: #1e2b38; margin-bottom: 6px;
}
.login-input {
    display: block; width: 100%;
    padding: 11px 15px; font-size: 15px;
    border: 1.5px solid #d0d9e3; border-radius: 8px;
    color: #1e2b38; background: #fff;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.login-input::placeholder { color: #a0adb8; }
.login-input:focus {
    border-color: #00D2BE;
    box-shadow: 0 0 0 3px rgba(0,210,190,.15);
}
.login-btn {
    width: 100%; padding: 12px;
    background: #009587; color: #fff;
    font-size: 15.5px; font-weight: 700;
    border: none; border-radius: 8px; cursor: pointer;
    letter-spacing: .2px;
    transition: background .15s;
}
.login-btn:hover { background: #1CBFA6; }

/* Márgenes Bootstrap dentro del form */
.login-split__form .mb-3 { margin-bottom: 18px !important; }
.login-split__form .mb-4 { margin-bottom: 24px !important; }

/* ── Mobile ── */
@media (max-width: 600px) {
    .login-body   { display: block; overflow-y: auto; }
    .login-center { display: block; padding: 20px 16px; min-height: unset; }

    /* Una sola columna, sin split */
    .login-split {
        display: flex; flex-direction: column;
        min-height: unset;
        border-radius: 12px; max-width: 100%;
    }
    .login-split::before { display: none; }

    /* Logo — centrado, fondo blanco */
    .login-split__brand {
        flex-direction: column;
        align-items: center; justify-content: center;
        gap: 10px; padding: 28px 24px 16px;
        background: #fff;
        text-align: center;
    }
    .login-split__brand img        { height: auto; width: 220px; }
    .login-split__brand-name       { display: none; }
    .brand-logo--desktop           { display: none; }
    .brand-logo--mobile            { display: block; }

    /* Formulario */
    .login-split__form {
        padding: 0 24px 24px;
        justify-content: flex-start;
        background: #fff;
    }

    /* Contacto — discreta, gris claro */
    .login-split__info {
        padding: 14px 24px 22px;
        background: #fff;
        border-top: 1px solid #edf0f4;
    }
    .login-split__info-row {
        color: #4a5a6a;
        font-size: 12.5px;
    }
    .login-split__info-row i { opacity: .65; }
}

/* ══════════════════════════════════════════════════════════════
   PERFIL / INFORMADOR / QUILL
   ══════════════════════════════════════════════════════════════ */
.perfil-panel { animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.informador-prose { min-height: 360px; outline: none; }
.informador-prose h3 { font-size: 14px; font-weight: 700; color: #1b6ca8; border-bottom: 1px solid #e2e8f0; padding-bottom: 4px; margin: 16px 0 8px; }
.informador-prose p  { margin: 0 0 8px; }
.informador-prose ul { padding-left: 20px; margin: 0 0 8px; }

.inf-tb-btn { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px; padding: 3px 8px; font-size: 12px; cursor: pointer; color: #4a5568; transition: background .12s; }
.inf-tb-btn:hover, .inf-tb-btn.active { background: #1b6ca8; color: #fff; border-color: #1b6ca8; }

.btn-preset { font-size: 12px; font-weight: 600; padding: 4px 10px; border-color: var(--border); color: var(--text-soft); }
.btn-preset.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-preset:hover:not(.active) { background: var(--blue-light); border-color: #7baed6; color: var(--blue); }

/* ══════════════════════════════════════════════════════════════
   NUEVA ORDEN
   ══════════════════════════════════════════════════════════════ */
.orden-section {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: visible;
    margin-bottom: 16px;
}
.orden-section-hdr {
    background: #e7eaed;
    padding: 9px 18px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .6px;
    color: var(--text-soft);
    display: flex; align-items: center; gap: 7px;
    border-bottom: 1px solid var(--border);
}
.orden-section-body { padding: 20px 18px; }
.orden-section--disabled { pointer-events: none; user-select: none; }

/* Datos del estudio — layout con fila superior gris */
.orden-body-datos { padding: 0 0 10px; }
.orden-body-datos .orden-sup-row {
    background: #f5f7fa;
    padding: 20px 18px 24px;
    border-bottom: 0;
}
.orden-body-datos .orden-inf-row {
    background: #ffffff;
    padding: 28px 18px 32px;
}
.orden-body-datos .form-label { margin-bottom: 6px; }
.orden-section--disabled .orden-section-hdr { background: #f2f4f6; color: var(--text-xmuted); }
.orden-section--disabled .orden-section-body { position: relative; }
.orden-section.h-100 { display: flex; flex-direction: column; }
.orden-section.h-100 .orden-section-body { flex: 1; }
/* Pac placeholder vacío */
.pac-placeholder {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 0 16px;

    background: #e8eef5;

    border-radius: 12px;

    color: #1a1a1a;
    font-size: 13px;
    font-weight: 400;

    height: 44px;
}

.pac-placeholder-icon {
    font-size: 16px;
    opacity: .45;
}

/* Pac card */
.pac-card {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 14px;

    border-radius: 12px;

    background: #e0eaf5;
    border: 1px solid #a8c5e0;

    min-height: 58px;

    box-shadow:
        0 1px 2px rgba(15,23,42,.05);

    transition:
        background .15s ease,
        border-color .15s ease,
        box-shadow .15s ease,
        transform .15s ease;
}

.pac-card:hover {
    background: #d4e3f2;
    border-color: #8fb8d8;
}

/* Success */
.pac-card--ok {
    background: #d0e4fc;
    border: 0;
}
.pac-card--ok:hover {
    background: #b8d4f8;
    border: 0;
}

/* Error */
.pac-card--err {
    background: #fff3f3;
    border-color: #f3b6b6;
}

/* Avatar */
.pac-card-avatar {
    width: 32px;
    height: 32px;

    border-radius: 50%;

    background: #1565c0;
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;
    font-weight: 700;

    flex-shrink: 0;

    text-transform: uppercase;
    letter-spacing: .3px;
}

/* Info */
.pac-card-info {
    flex: 1;
    min-width: 0;
}

.pac-card-nombre {
    font-size: 13px;
    font-weight: 600;

    color: #0a0a0a;

    line-height: 1.2;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pac-card-det {
    margin-top: 2px;

    font-size: 12px;
    font-weight: 400;

    color: #2a2a2a;
}

.pac-det-label {
    color: #4a4a4a;
}

.pac-det-val {
    color: #1a1a1a;
}

.pac-det-sep {
    margin: 0 3px;
    color: #9aa8b6;
}

.pac-fnac-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 7px 1px 5px;
    border-radius: 10px;
    border: none;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    vertical-align: middle;
    transition: background .15s;
}
.pac-fnac-badge:hover { background: #fecaca; }
.pac-fnac-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #dc2626;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(220,38,38,.5);
    animation: fnac-pulse 1.6s ease-in-out infinite;
}
@keyframes fnac-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(220,38,38,.5); }
    70%  { box-shadow: 0 0 0 4px rgba(220,38,38,0); }
    100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}

/* Dismiss */
.pac-card-dismiss {
    width: 28px;
    height: 28px;

    border: none;
    border-radius: 50%;

    background: transparent;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    cursor: pointer;

    color: #22c55e;
    font-size: 16px;

    transition:
        background .15s ease,
        color .15s ease;
}

.pac-card-dismiss:hover {
    background: rgba(255,255,255,.65);
}

.pac-card-dismiss .pac-dismiss-x {
    display: none;
    font-size: 13px;
}

.pac-card--ok:hover .pac-card-dismiss .pac-dismiss-check {
    display: none;
}

.pac-card--ok:hover .pac-card-dismiss .pac-dismiss-x {
    display: inline;
}

.pac-card--ok:hover .pac-card-dismiss {
    color: #dc2626;
    background: #fff1f2;
}

/* Error icon */
.pac-card-err-icon {
    font-size: 20px;
    color: #dc2626;

    flex-shrink: 0;
}

/* Autocomplete búsqueda paciente */
.pac-search-wrap { position: relative; }
.pac-search-wrap .input-group { position: static; }
.pac-autocomplete {
    position: absolute;
    top: 100%; left: 0; right: 0;
    z-index: 9999;
    margin-top: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    max-height: 240px; overflow-y: auto;
}
.pac-ac-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; cursor: pointer;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px; transition: background .1s;
}
.pac-ac-item:last-child { border-bottom: none; }
.pac-ac-item:hover      { background: var(--blue-light); }
.pac-ac-item-nombre     { font-weight: 600; color: var(--text-h); }
.pac-ac-item-det        { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.pac-ac-empty           { padding: 12px 14px; font-size: 13px; color: var(--text-muted); text-align: center; }

/* Sugerencias descripción — dropdown custom (reemplaza datalist nativo) */
.nt-sug-dropdown {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
    overflow: hidden;
    width: 100%;
}
.nt-sug-item {
    padding: 9px 14px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text);
    border-bottom: 1px solid var(--border-soft);
    transition: background .1s;
    display: flex; align-items: center; gap: 8px;
}
.nt-sug-item:last-child { border-bottom: none; }
.nt-sug-item::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); opacity: .5; flex-shrink: 0; }
.nt-sug-item:hover,
.nt-sug-item.is-active { background: var(--blue-light); color: var(--blue); }
.nt-sug-item.is-active::before { opacity: 1; }
.nt-sug-text { flex: 1; }
.nt-sug-lumen {
    display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0;
    font-size: 9px; font-weight: 700; letter-spacing: .5px;
    color: #16a34a; background: #dcfce7;
    padding: 1px 5px; border-radius: 10px; margin-left: auto;
}
.nt-sug-lumen-dot {
    width: 5px; height: 5px; border-radius: 50%; background: #16a34a; flex-shrink: 0;
}

.lumen-sug-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10px; font-weight: 700; letter-spacing: .6px;
    color: #16a34a; background: #dcfce7;
    padding: 2px 7px; border-radius: 20px;
}
.lumen-sug-dot {
    width: 6px; height: 6px; border-radius: 50%; background: #16a34a; flex-shrink: 0;
    animation: lumen-pulse 1.4s ease-in-out infinite;
}
@keyframes lumen-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(22,163,74,.4); }
    50%       { opacity: .8; box-shadow: 0 0 0 4px rgba(22,163,74,0); }
}


.pac-registro-form { margin-top: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pac-registro-hdr  { background: var(--blue); color: #fff; padding: 9px 14px; font-size: 12.5px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.pac-registro-close{ background: none; border: none; color: rgba(255,255,255,.7); font-size: 14px; cursor: pointer; padding: 0; line-height: 1; transition: color .15s; }
.pac-registro-close:hover { color: #fff; }
.pac-registro-body { padding: 14px; background: var(--surface-2); }
.pac-registro-hint { margin-top: 6px; font-size: 12px; color: #92400e; background: #fffbeb; border: 1.5px solid #f59e0b; border-radius: 6px; padding: 7px 11px; font-weight: 600; }

/* Condición toggle — segmented pill control */
.cond-toggle {
    display: inline-flex;
    background: #e0e6eb;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
    height: 38px;
    align-items: center;
    width: 100%;
}
.cond-opt {
    display: flex; align-items: center; justify-content: center;
    flex: 1;
    padding: 0 10px; height: 30px;
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    border: none; border-radius: 6px;
    background: transparent;
    color: #3a3a3a;
    transition: background .15s, color .15s, box-shadow .15s;
    user-select: none;
    white-space: nowrap;
}
.cond-opt input { display: none; }
.cond-opt:has(input:checked) {
    background: #f8f8f8;
    color: #0a0a0a;
    font-weight: 700;
    box-shadow: none;
}
.cond-opt:not(:has(input:checked)):hover { color: #1a1a1a; }

/* Triaje toggle — global (modals y página add orden) */
.triage-toggle { display: flex; gap: 6px; align-items: center; }
.triage-opt {
display: flex; align-items: center; gap: 6px; height: 40px;
border: 0;
border-radius: var(--radius);
padding: 0 12px;
cursor: pointer;
background: #e8ecf0;
transition: background .12s;
}
.triage-opt input { display: none; }
.triage-opt .triage-badge {
display: inline-flex; align-items: center; justify-content: center;
width: 23px; height: 23px;
font-size: 12px; font-weight: 400; line-height: 1;
border-radius: var(--radius-sm);
}
.triage-lbl { font-size: 13px; font-weight: 600; color: #1a1a1a; }
.triage-opt:has(input:checked) {
    border-color: currentColor;
}
.triage-opt--n:has(input:checked) { background: #d9dce0; }
.triage-opt--p:has(input:checked) { background: #f5eeca; }
.triage-opt--u:has(input:checked) { background: #f5d5d5; }
.triage-opt:not(:has(input:checked)) .triage-badge { opacity: .65; filter: grayscale(.15); }
.triage-opt:not(:has(input:checked)) .triage-lbl { color: #3a3a3a; }

/* ── Compact triage toggle (badges only: N, P, U) ───────────────────────
   3 botones simples tipo switch
   Usage: <div class="triage-toggle triage-toggle--compact">...
──────────────────────────────────────────────────────────────────────── */
.triage-toggle--compact {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-top: 0;
    padding: 0;
    width: max-content;
    background: none;
    border: none;
}
.triage-toggle--compact .triage-opt {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: #e8ecf0;
    box-shadow: none;
    transition: background .14s ease, box-shadow .14s ease;
}
.triage-toggle--compact .triage-opt input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.triage-toggle--compact .triage-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    margin: 0;
    opacity: .38;
    filter: grayscale(.6);
    box-shadow: none;
    transition: opacity .14s ease, filter .14s ease;
}
.triage-toggle--compact .triage-opt:hover .triage-badge {
    opacity: .7;
    filter: grayscale(.2);
}
/* Badge seleccionado */
.triage-toggle--compact .triage-opt:has(input:checked) {
    background: #f8f8f8;
}
.triage-toggle--compact .triage-opt input:checked + .triage-badge {
    opacity: 1;
    filter: none;
    transform: scale(1.22);
}
/* Ocultar texto en modo compacto */
.triage-toggle--compact .triage-lbl { display: none; }

/* Lock overlay */
.bloque-lock,
.seccion-lock-overlay {
    position: absolute; inset: 0;
    background: rgba(244,247,250,.7);
    backdrop-filter: blur(1.5px);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px; z-index: 2;
    border-radius: 0 0 var(--radius) var(--radius);
}
.bloque-lock-icon, .seccion-lock-icon { font-size: 22px; color: var(--text-xmuted); }
.bloque-lock span, .seccion-lock-text  { font-size: 12px; color: var(--text-xmuted); font-weight: 500; margin: 0; }
.seccion-lock-card {
    display: flex; flex-direction: column;
    align-items: center; gap: 6px;
}

/* Turno matching */
.turno-match-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.turno-match-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border: none;
    border-radius: var(--radius);
    background: #e4eefc;
    cursor: pointer; min-width: 190px; max-width: 260px;
    transition: background .15s; user-select: none;
}
.turno-match-item input[type="radio"] { display: none; }
.turno-match-item:hover, .turno-match-item.selected { background: var(--blue-light); }
.tmi-inner { flex: 1; min-width: 0; }
.tmi-tipo  { font-size: 13px; font-weight: 700; color: var(--text-h); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmi-fecha { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.tmi-check { color: var(--sistema); font-size: 16px; opacity: 0; transition: opacity .15s; }
.turno-match-item.selected .tmi-check { opacity: 1; }
.sin-turno-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border: 1.5px dashed var(--border); border-radius: var(--radius);
    background: transparent; cursor: pointer; min-width: 160px;
    color: var(--text-muted); font-size: 13px;
    transition: border-color .15s, color .15s; user-select: none;
}
.sin-turno-card:hover, .sin-turno-card.selected { border-color: var(--text-muted); color: var(--text-h); }
.sin-turno-card input[type="radio"] { display: none; }

.modal-seccion-lbl {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: var(--text-xmuted); margin-bottom: 6px;
    padding-bottom: 4px; border-bottom: 1px solid var(--border-soft);
}

/* ══════════════════════════════════════════════════════════════
   ADJUNTAR ESTUDIO
   ══════════════════════════════════════════════════════════════ */
.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 36px 24px;
    text-align: center; cursor: pointer;
    transition: border-color .2s, background .2s;
    background: var(--surface-2);
}
.upload-dropzone:hover, .upload-dropzone--active { border-color: var(--blue); background: var(--blue-light); }
.upload-dropzone input[type="file"] { display: none; }
.upload-dropzone-icon  { font-size: 36px; color: var(--text-xmuted); display: block; margin-bottom: 10px; }
.upload-dropzone-title { font-size: 14px; font-weight: 600; color: var(--text-h); margin: 0 0 4px; }
.upload-dropzone-sub   { font-size: 12px; color: var(--text-muted); margin: 0 0 14px; }

.upload-lista-hdr { font-size: 13px; font-weight: 600; color: var(--text-h); margin-bottom: 8px; }
.upload-lista     { list-style: none; padding: 0; margin: 0; font-size: 12.5px; color: var(--text-soft); }
.upload-lista li  { padding: 3px 0; border-bottom: 1px solid var(--border-soft); }
.upload-lista li:last-child { border-bottom: none; }
.upload-lista-size { color: var(--text-xmuted); margin-left: 6px; }

.orden-resumen-card { padding: 0; overflow: hidden; }
.orden-resumen-hdr  { background: #ebebeb; padding: 12px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.orden-resumen-id   { font-size: 13px; font-weight: 700; color: var(--text-h); }
.orden-resumen-body { padding: 14px 16px; }
.orden-resumen-row  {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 8px; padding: 5px 0;
    border-bottom: 1px solid var(--border-soft); font-size: 13px;
}
.orden-resumen-row:last-child { border-bottom: none; }
.orden-resumen-row span   { color: var(--text-muted); flex-shrink: 0; }
.orden-resumen-row strong { color: var(--text-h); text-align: right; }

/* Modal confirm */
.modal-confirm-txt  { font-size: 13.5px; margin-bottom: .25rem; }
.modal-confirm-sub  { font-size: 13px; color: #4a5568; }
.modal-confirm-note { font-size: 12px; }
.modal-pac-card     { min-height: 44px; padding: 8px 12px; }

/* Items autocomplete pac (turnos) */
.pac-item { font-size: 13px; cursor: pointer; }
.pac-msg  { font-size: 13px; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   TURNOS — fechas / labels específicos
   ══════════════════════════════════════════════════════════════ */
.turno-horario-cell { line-height: 1.1; }
.turno-fecha-lbl { font-size: 11px; color: #000000; display: block; font-weight: 400; text-transform: uppercase; letter-spacing: .4px;}
.turno-hora-lbl  { font-size: 14px; color: #0f172a; display: block; font-weight: 700; letter-spacing: .2px; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .app-sidebar { transform: translateX(calc(-1 * var(--sb-width))); transition: transform .25s; }
    .app-sidebar.open { transform: translateX(0); }
    .app-content  { margin-left: 0; padding: 14px 16px; }
    .app-header__logo a { width: auto; }
    .sidebar-toggle { display: flex; }
    .dash-grid { grid-template-columns: repeat(2,1fr); }
    .dash-row  { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }

    /* Tabla compacta en mobile */
    .tabla-base thead th,
    .tabla-base td { font-size: 12px; padding: 5px 8px; }
    .tabla-base.tabla-compacta thead th,
    .tabla-base.tabla-compacta td { padding: 8px 8px; }

    /* Filtros — evitar overflow horizontal */
    .ph-search { width: 100% !important; flex-shrink: 1; }
    .ph-select, #filterAccion { min-width: 0 !important; width: 100% !important; }
    .turnos-quick-filters { flex-shrink: 0; flex-wrap: nowrap; padding: 3px; }
    .tqf-btn { flex: 0 0 auto; min-width: 0; justify-content: center; font-size: 12px; padding: 0 10px; height: 30px; }
    .tqf-btn .tqf-label { display: none; }
    .page-header--turnos .ph-row1,
    .page-header--turnos .ph-right { flex-wrap: wrap; gap: 6px; }
    .page-header--turnos .ph-right { width: 100%; }
    .page-header--estudios { flex-wrap: wrap; gap: 6px; }
    .page-header--ordenes .ph-row1 { flex-wrap: wrap; }
    .page-header--ordenes .ph-right { width: 100%; flex-wrap: wrap; }
    .page-header--ordenes .ph-right .btn { flex: 1; justify-content: center; }
}
@media (max-width: 480px)  { .stat-tile__num { font-size: 24px; } }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 769px)  { .sidebar-toggle { display: none; } }

/* ══════════════════════════════════════════════════════════════
   PACIENTES — dot online / offline
   ══════════════════════════════════════════════════════════════ */
.dot-online {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,.22);
}
.dot-offline {
    background: #cbd5e1;
    box-shadow: 0 0 0 2px rgba(0,0,0,.06);
}

/* ── Columna QR (solo icono, ancho fijo) ── */
.col-qr-solo {
    width: 48px;
    text-align: center;
}


/* ══════════════════════════════════════════════════════════════
   PACIENTES — dot online/offline (versión pequeña para tabla)
   ══════════════════════════════════════════════════════════════ */
.patient-dot--sm {
    width: 8px;
    height: 8px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}
.dot-online  {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34,197,94,.25);
    animation: dotPulse 2s infinite;
    cursor: help;
}
.dot-offline { background: #94a3b8; box-shadow: 0 0 0 2px rgba(0,0,0,.06); cursor: help; }
@keyframes dotPulse {
    0%,100% { box-shadow: 0 0 0 2px rgba(34,197,94,.25); }
    50%      { box-shadow: 0 0 0 5px rgba(34,197,94,.08); }
}

/* ── Columna QR separada ── */
.col-qr-solo { width: 72px; text-align: center; }

/* ── Llenar fecha de nacimiento — badge rojo ── */
.fnac-llenar {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #dc2626;
    background: #fef2f2;
    border: 1px dashed #fca5a5;
    border-radius: 4px;
    padding: 1px 7px;
    cursor: pointer;
    letter-spacing: .3px;
    transition: background .12s, border-color .12s;
    white-space: nowrap;
}
.fnac-llenar:hover {
    background: #fee2e2;
    border-color: #f87171;
}

/* ── Columna Sexo ── */
.col-pac-sexo { width: 44px; text-align: center; }

/* ===== BADGES SEXO ===== */
.sexo-m, .sexo-f, .sexo-n {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 3px 7px; border-radius: 4px;
    font-size: 11px; font-weight: 600;
    line-height: 1;
}

.sexo-m { background: #e8f0fe; color: #4a6fa5; }
.sexo-f { background: #fce8f3; color: #994070; }
.sexo-n { background: #f1f3f5; color: #8a9aaa; }

/* ===== QR (alineado con tipo-badge) ===== */
.badge-qr {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px; font-weight: 600;
    background: rgb(213, 215, 218);
    color: #26333f;
    border: none;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: background .13s;
}
.badge-qr:hover {
    background: #a9acaf;
    color: #232323;
}

.badge-qr .fa {
    font-size: 11px;
    opacity: .8;
}

/* ══════════════════════════════════════════════════════════════
   TURNOS — barra de contadores
   ══════════════════════════════════════════════════════════════ */
.turnos-counters-bar {
    display: flex;
    align-items: stretch;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.tc-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 10px;
    min-width: 0;
}
.tc-block .tc-num { font-size: 26px; font-weight: 800; line-height: 1; }
.tc-block .tc-lbl { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-top: 3px; }
.tc-block .tc-sub { font-size: 10.5px; color: var(--text-xmuted); margin-top: 2px; }
.tc-sep           { width: 1px; background: var(--border); align-self: stretch; flex-shrink: 0; }

.tc-block--esperados .tc-num,
.tc-block--esperados .tc-lbl { color: #1a3570; }
.tc-block--atendido  .tc-num,
.tc-block--atendido  .tc-lbl { color: #14532d; }
.tc-block--ausente   .tc-num,
.tc-block--ausente   .tc-lbl { color: #713f12; }
.tc-block--cancelado .tc-num,
.tc-block--cancelado .tc-lbl { color: #7f1d1d; }
.tc-block--total     .tc-num { color: var(--text-h); }
.tc-block--total     .tc-lbl { color: var(--text-muted); }


/* ══════════════════════════════════════════════════════════════
   TURNOS — slots de horario (compacto + full width)
   ══════════════════════════════════════════════════════════════ */

.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, max-content));
    gap: 8px;
    margin-top: 6px;
    padding: 6px;
    background: #F9FAFB;
    border-radius: 8px;
}
.slot-item {
    height: 52px;
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0,0,0,0.05);
    transition: all .12s ease;
    user-select: none;
    padding: 0 4px;
}
.slot-item.libre          { background: #DFF0D8; color: #1E3A1E; cursor: pointer; }
.slot-item.libre:hover    { background: #7FBF4D; transform: scale(1.04); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.slot-item.libre.selected { background: #3E6B2A; color: #fff; transform: scale(1.05); box-shadow: 0 3px 10px rgba(0,0,0,0.15); border-color: #2F4F1F; }
.slot-item.ocupado        { background: #FCA5A5; color: #450a0a; cursor: not-allowed; opacity: .85; font-weight:600; }
.slot-with-actions        { cursor: pointer; }
.slot-hora { font-size: 12px; font-weight: 700; line-height: 1; }
.slot-dur  { font-size: 9px; margin-top: 1px; }
.slot-obra               { display:block; font-size:9px; font-weight:700; line-height:1; color:#fff;
                           border-radius:3px; padding:1px 5px; letter-spacing:.04em; margin-top:3px;
                           max-width:90%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.slot-obra--ioma         { background:#1e3a5f; }
.slot-obra--pami         { background:#134e4a; }
.slot-obra--default      { background:#5c2b2b; }

.slot-leg            { font-size: 11px; padding: 3px 8px; border-radius: 5px; font-weight: 500; }
.slot-leg--libre     { background: #CFE8C4; color: #1E3A1E; }
.slot-leg--ocupado   { background: #FECACA; color: #7F1D1D; }
.slot-leg--sel       { background: #3E6B2A; color: #fff; }

/* ══════════════════════════════════════════════════════════════
/* ══════════════════════════════════════════════════════════════
   TURNOS — celdas de tabla
   ══════════════════════════════════════════════════════════════ */

/* estados — vivid, same size as tipo-badge */
.estado-programado   { background: #1a5c85; color: #fff; }
.estado-reprogramado { background: #0e7490; color: #fff; }
.estado-atendido     { background: #16a34a; color: #fff; }
.estado-ausente      { background: #d97706; color: #fff; }
.estado-cancelado    { background: #64748b; color: #fff; }



/* ══════════════════════════════════════════════════════════════
   FILTROS BAR — contenedor reutilizable para filtros + buscador
   Usar: <div class="filtros-bar mb-3">...</div>
   ══════════════════════════════════════════════════════════════ */
.filtros-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: #f5f7f9;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    min-width: 0;
    max-width: 100%;
}
/* Altura unificada para todos los elementos del filtros-bar */
.filtros-bar .form-select,
.filtros-bar .form-control,
.filtros-bar .input-group-sm .form-control,
.filtros-bar .input-group-sm .input-group-text,
.filtros-bar .input-group .form-control,
.filtros-bar .input-group .input-group-text { height: 38px; font-size: 13px; color: #000; }
.filtros-bar .form-control::placeholder { color: #0f172a; }
.filtros-bar .input-group .input-group-text { color: #000; background: #dde3ee; }
.filtros-bar .form-select { padding-top: 0; padding-bottom: 0; }
/* Botón acción en page-header — compacto y elegante */
.page-header .btn-sistema,
.page-header .btn-accion,
.page-header .btn-sm,
.page-header .btn-outline-secondary {
    padding: 4px 14px;
    font-size: 12.5px;
    font-weight: 600;
    height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--radius-sm);
    letter-spacing: .2px;
}
/* Selects más anchos */
.filtros-bar .ph-select,
.filtros-bar .form-select { min-width: 130px; }
/* Buscador */
.filtros-bar__search { width: 220px; flex-shrink: 0; }
/* Ocultar picker nativo del browser — AirDatepicker lo reemplaza */
.filtros-bar input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
.filtros-bar input[type="date"] { -webkit-appearance: none; appearance: none; }
/* Rango de fechas histórico */
.filtros-bar .turnos-rango-fechas .input-group { width: 160px; }
@media (max-width: 768px) {
    .filtros-bar { gap: 6px; padding: 8px 10px; }
    .filtros-bar__search { width: 100% !important; }
    .filtros-bar .ph-select,
    .filtros-bar .form-select { width: 100% !important; min-width: unset; }
    .filtros-bar .input-group { width: 100% !important; }
    .filtros-bar .turnos-quick-filters { width: 100%; justify-content: stretch; }
    .filtros-bar .tqf-btn { flex: 1; justify-content: center; }
    .filtros-bar .turnos-rango-fechas { width: 100%; }
    .filtros-bar .turnos-rango-fechas.visible { width: 100%; }
    .filtros-bar .turnos-rango-fechas .input-group,
    .filtros-bar .turnos-rango-fechas.visible .input-group { flex: 1; width: auto !important; min-width: 0; }
    .filtros-bar .btn.btn-sm { width: 100%; justify-content: center; }
}
.filtros-bar .btn.btn-sm {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.filtros-bar .input-group .form-select { height: 38px; font-size: 13px; color: #000; }

/* Panel colapsable de filtros (debajo de filtros-bar) */
.filtros-panel {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: var(--surface-2);
}
.filtros-panel-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px; color: var(--text-muted); margin-bottom: 4px;
}
.filtros-bar.mb-0 { border-radius: var(--radius-sm) var(--radius-sm) var(--radius-sm) var(--radius-sm); }
.filtros-bar.mb-0.panel-open { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.filtros-panel .btn {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}


.page-header--turnos {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.page-header--turnos .ph-row1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.page-header--turnos .ph-left  { display: flex; align-items: center; gap: 10px; }
.page-header--turnos .ph-right { display: flex; align-items: center; gap: 8px; }
.page-header--turnos .ph-row2  {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Quick filter pills */
.turnos-quick-filters{
  display:flex;
  gap:3px;
  background:#e9ecf0;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:3px;
  flex-shrink:0;
  align-items: center;
  height: 38px;
}

.tqf-btn{
  padding: 0 13px;
  height: 32px;
  font-size:13px;
  font-weight:600;
  border:1px solid transparent;
  border-radius:4px;
  background:transparent;
  color: #0f0f0f;
  cursor:pointer;
  transition:all .15s;
  white-space:nowrap;
  display:flex;align-items:center;gap:5px;
  display: inline-flex;
  align-items: center;
}

.tqf-btn:hover{
  background:var(--surface);
  color: #0f172a;
}

.tqf-btn.active{
  background:var(--blue);
  color:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.15);
}

/* ── Buscador global: +20% más ancho en page-header ── */
.ph-search { width: 230px; flex-shrink: 0; }

/* ── Columnas de la tabla de turnos ── */
.col-turno-pac      { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-turno-acciones { min-width: 220px; }
.turno-pac-nombre   { font-size: 13px; font-weight: 500; }


/* ══════════════════════════════════════════════════════════════
   TURNOS — fixes y mejoras v2
   ══════════════════════════════════════════════════════════════ */


/* Select de filtro en page-header */
.ph-select { width: auto; min-width: 190px; }
#filterAccion { min-width: 160px; }
.ph-filter-btn { border-color: var(--border) !important; color: var(--text-soft); }
.ph-filter-btn:hover,
.ph-filter-btn.active { color: var(--blue); background: var(--blue-light); }

/* ── Contadores clickeables con fondo de color suave ── */
.tc-clickable {
    cursor: pointer;
    transition: filter .15s, box-shadow .15s, transform .08s;
    border-radius: 0;
}
.tc-clickable:hover { filter: brightness(.95); }
.tc-clickable.tc-active { filter: brightness(.88); }
.tc-clickable.tc-active .tc-num,
.tc-clickable.tc-active .tc-lbl { font-weight: 800; }

/* ── Base (colores plenos, oscurecidos) ── */
.tc-block--esperados { background: #a8cbf0; }
.tc-block--atendido  { background: #b8dfc2; }
.tc-block--ausente   { background: #e4d0a8; }
.tc-block--cancelado { background: #e4bdc2; }
.tc-block--total     { background: #e2e4e8; }

/* ── Hover ── */
.tc-block--esperados:hover { background: #b0c6e0; }
.tc-block--atendido:hover  { background: #a2d4b0; }
.tc-block--ausente:hover   { background: #d8c294; }
.tc-block--cancelado:hover { background: #d8adb4; }
.tc-block--total:hover     { background: #d4d6dc; }

/* ── Estado badge — sizing heredado de components.css ── */

/* ── Modal sección header moderno ── */
.turno-modal-section-hdr--disabled { background: #f2f4f6; color: var(--text-xmuted); }
.turno-modal-section-hdr {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #eef4f9;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-soft);
}

/* ── Date input con más presencia visual ── */
.turno-form-date {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-h);
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color .15s;
}
.turno-form-date:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26,92,133,.12);
    outline: none;
}

/* ── Avatar en autocomplete de paciente (sin inline style) ── */
.pac-ac-avatar {
    width: 30px;
    height: 30px;
    font-size: 11px;
    flex-shrink: 0;
}

/* ── Columnas tabla turnos ── */
.col-turno-pac      { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-turno-acciones { min-width: 220px; }
.turno-pac-nombre   { font-size: 13px; font-weight: 500; text-transform: uppercase; }


/* ══════════════════════════════════════════════════════════════
   DATE INPUTS — estilo global en todo el sistema
   Aplica a cualquier input[type=date] dentro de form o page-header
   ══════════════════════════════════════════════════════════════ */
input[type="date"].form-control,
input[type="date"].form-control-sm,
.turno-form-date {
    font-weight: 600;
    color: var(--text-h);
    border: 1.5px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
input[type="date"].form-control:hover,
.turno-form-date:hover {
    border-color: #a0b0c0;
}
input[type="date"].form-control:focus,
.turno-form-date:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26,92,133,.12);
    outline: none;
}
/* Ocultar ícono nativo del calendario — AirDatepicker lo reemplaza */
input[type="date"]::-webkit-calendar-picker-indicator {
    display: none !important;
    -webkit-appearance: none;
}
input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
}

/* Wrapper de campo de fecha con label arriba */
.turno-date-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.turno-date-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text-muted);
}



/* ═══════════════════════════════════════════════════════════════════

/* ── Sidebar badge (órdenes pendientes) ───────────────────────────
   Estilo pill como live-badge — gradiente suave, sin dot
   Colores: urgente=rojo, prioritario=amarillo, normal=gris
─────────────────────────────────────────────────────────────────── */
.sb-badge {
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: 2px;
    padding: 4px 8px;
    min-width: 18px;
    border-radius: 7px;
    line-height: 1;
    font-size: 11px; font-weight: 700;
    transition: background .25s ease, color .25s ease, opacity .25s ease;
    will-change: background, color;
}
/* Estados por prioridad — mismos colores que triage en tabla */
.sb-badge--normal       { background: #6b7280; color: #fff; }
.sb-badge--prioritario  { background: #ca8a04; color: #fff; }
.sb-badge--urgente      { background: #b91c1c; color: #fff; }

/* ── Live badge (sidebar — estado pantalla) ──────────────────── */
.live-badge {
    display: inline-flex; align-items: center;
    margin-left: 2px; padding: 4px 8px;
    border-radius: 7px; line-height: 1;
    transform: translateY(1px);
}
.live-badge.on  { background: linear-gradient(135deg, #ef6969, #dc2626); color: #fff; }
.live-badge.off { background: rgba(255,255,255,.12); color: rgba(255,255,255,.5); }
.live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; flex-shrink: 0;
}
.live-badge.on .live-dot  { background: #fff; animation: livePulse 1.6s infinite; }
.live-badge.off .live-dot { opacity: .5; animation: none; }
@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 rgba(255,255,255,.6); }
    70%  { box-shadow: 0 0 0 5px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* ── Modal Pantalla TV ───────────────────────────────────────── */
.modal-tv .modal-dialog  { max-width: 88vw; height: 86vh; margin: 5vh auto; }
.modal-tv .modal-content  { height: 100%; display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; border: none; }
.modal-tv .modal-header   { background: #0e6e9a; color: #fff; padding: 10px 16px; border: none; }
.modal-tv .modal-title    { font-size: 14px; font-weight: 600; margin: 0; }
.modal-tv .modal-body     { flex: 1; padding: 0; overflow: hidden; position: relative; }
.modal-tv iframe          { width: 100%; height: 100%; border: 0; }
.modal-tv .modal-footer   { padding: 8px 14px; background: var(--surface-2, #f0f4f8); border: none; }

/* Info panel overlay (¿Qué es esto?) */
.modal-tv .info-panel {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.55); z-index: 10;
}
.modal-tv .info-box {
    background: #fff; border-radius: 10px; padding: 28px 32px;
    max-width: 440px; text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.modal-tv .info-title {
    font-size: 16px; font-weight: 700; margin-bottom: 10px; color: #1a1a2e;
}
.modal-tv .info-box p {
    font-size: 13.5px; line-height: 1.6; color: #475569; margin-bottom: 16px;
}

/* ── Botón Modo calendario ─────────────────────────────────────── */
#btnModoCalendario {
    background: #4EA8D8;
    border-color: #4EA8D8;
    color: #fff;
}
#btnModoCalendario:hover {
    background: #3A8EC4;
    border-color: #3A8EC4;
    color: #fff;
}

/* ── Nav prev/next del calendario ─────────────────────────────── */
#calPrev, #calNext {
    background: #4EA8D8; border-color: #4EA8D8; color: #fff;
}
#calPrev:hover, #calNext:hover {
    background: #3A8EC4; border-color: #3A8EC4; color: #fff;
}

/* ── Perfil médico — secciones ──────────────────────────────────── */
.perfil-sections    { display: flex; flex-direction: column; }
.perfil-section     { padding: 18px 20px; border-bottom: 1px solid var(--border-soft); }
.perfil-section:last-child { border-bottom: none; }
.perfil-section-title {
    font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .6px;
    color: #1e2d3d;
    background: #E7EAED;
    margin: -18px -20px 14px;
    padding: 8px 20px;
    display: flex; align-items: center;
    border-bottom: 1px solid var(--border);
}
.perfil-label { font-size: 12px; font-weight: 700; color: #1e2d3d; margin-bottom: 5px; }
.perfil-field[disabled] { background: var(--surface-2) !important; border-color: var(--border) !important; box-shadow: none !important; opacity: 1; color: var(--text-h) !important; }

/* ── Filas de info de acceso (dentro de .perfil-section) ──────── */
.perfil-acceso-grid { display: flex; flex-direction: column; gap: 8px; }
.perfil-acceso-row  { display: flex; align-items: baseline; gap: 12px; }
.perfil-acceso-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted, #5d6f80);
    width: 140px;
    flex-shrink: 0;
}
.perfil-acceso-val {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-h, #0d1e2e);
}
/* Disabled input-group spans */
.input-group:has(.perfil-field[disabled]) .input-group-text { background: var(--surface-2); border-color: var(--border); opacity: 1; }

/* ── Nav tabs — fondo gris, letra más grande ─────────────────────── */
.nav-tabs {
    background: #f0f3f7;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 4px 4px 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0 !important;
}
.nav-tabs .nav-link {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    border-radius: var(--radius) var(--radius) 0 0;
    border: 1px solid transparent;
    margin-bottom: -2px;
    transition: background .12s, color .12s;
}
.nav-tabs .nav-link:hover { background: rgba(255,255,255,.7); color: var(--text-h); }
.nav-tabs .nav-link.active {
    background: var(--surface);
    color: var(--blue);
    border-color: var(--border) var(--border) var(--surface);
    font-weight: 700;
}
/* Card conectado a las tabs: sin borde top ni esquinas superiores */
.nav-tabs + .tab-content .app-card.table-card {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
}
/* Tab-pane inactivo no ocupa espacio */
.tab-pane:not(.active) { display: none !important; }

/* ══ LOADING OVERLAY — único para todo el sistema ══════════════════ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1055;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .15s;
}
.loading-overlay__card {
    background: var(--surface, #fff);
    border-radius: 10px;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-h, #1e2b38);
    box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
.loading-overlay__card .fa-spinner { color: var(--blue, #1a5c85); font-size: 16px; }

/* Staff rows: subtle disabled look */
.row-staff td { opacity: .55; }
.row-staff td * { pointer-events: none !important; cursor: not-allowed !important; }

/* ── Formularios pacientes — secciones (add/edit modal) ─────────── */
.pac-form-section { border-bottom: 1px solid var(--border-soft); }
.pac-form-section:last-child { border-bottom: none; }
.pac-form-section-title {
    font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .6px;
    color: #3a4b5c;
    background: #E7EAED;
    padding: 8px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
}

/* ── Badge bloqueado — llamativo ─────────────────────────────────── */
.badge-bloqueado {
    display: inline-flex; align-items: center;
    background: #dc2626; color: #fff;
    font-size: 10px; font-weight: 800;
    padding: 2px 6px; border-radius: 3px;
    letter-spacing: .4px;
    vertical-align: middle;
    animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
    0%,100% { opacity: 1; }
    50%      { opacity: .7; }
}

/* ── Placeholder: color suave, sin cursiva ───────────────────────── */
::placeholder { font-style: normal; color: #aab0ba !important; opacity: 1; font-size: 12.5px; }
::-webkit-input-placeholder { font-style: normal; color: #aab0ba !important; font-size: 12.5px; }
::-moz-placeholder { font-style: normal; color: #aab0ba !important; font-size: 12.5px; }

/* ── Sexo radio group — formularios pacientes ────────────────────── */
.sexo-radio-group {
    display: flex;
    gap: 6px;
    height: calc(1.5em + .75rem + 2px); /* match form-control height */
    align-items: center;
}
.sexo-radio-opt {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    padding: 0 10px;
    height: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-soft);
    transition: background .12s, border-color .12s, color .12s;
    white-space: nowrap;
}
.sexo-radio-opt input[type="radio"] { accent-color: var(--blue); cursor: pointer; }
.sexo-radio-opt:has(input:checked) {
    background: var(--blue-light);
    border-color: var(--blue);
    color: var(--blue);
    font-weight: 600;
}
.sexo-radio-opt:hover { border-color: var(--blue); }

/* ── Modo Calendario Turnos ──────────────────────────────────── */
.cal-grid,
.cal-grid-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    background: #f1f5f9;
    padding: 8px;
}
.cal-grid {
    border-radius: var(--radius) var(--radius) 0 0;
}
.cal-grid-body {
    border-radius: 0 0 var(--radius) var(--radius);
    grid-template-rows: repeat(6, 1fr);
}
.cal-day-name {
    text-align: center; font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .5px;
    color: #fff; padding: 6px 0;
    background: #4EA8D8; border-radius: 4px;
}
.cal-day {
    border: 1px solid #cbd5e1; border-radius: var(--radius-sm);
    min-height: 72px; padding: 6px; cursor: pointer;
    transition: background .12s, border-color .12s;
    background: var(--surface);
}
.cal-day:hover { background: #e8f4fb; border-color: #4EA8D8; }
.cal-day.cal-today { border-color: #4EA8D8; background: #e8f4fb; }
.cal-day.cal-other { opacity: .3; cursor: default; pointer-events: none; }
.cal-day.cal-selected { background: #4EA8D8; border-color: #4EA8D8; color: #fff; }
.cal-day.cal-selected .cal-day-num,
.cal-day.cal-selected .cal-day-count { color: #fff; }
.cal-day-num { font-size: 13px; font-weight: 700; color: #1e293b; margin-bottom: 2px; }
/* Barra de progreso ocupados/disponibles */
.cal-prog {
    height: 12px; background: #e2e8f0; border-radius: 4px;
    margin-top: 7px; overflow: hidden;
}
.cal-prog-fill            { height: 100%; border-radius: 4px; }
.cal-prog-fill.cal-full   { background: #ef4444; }
.cal-prog-fill.cal-busy   { background: #f59e0b; }
.cal-prog-fill.cal-free   { background: #22c55e; }
.cal-prog-lbl {
    display: flex; justify-content: space-between;
    margin-top: 4px; font-size: 11px; font-weight: 500;
    color: #374151; line-height: 1.2;
}
.cal-lib-free { color: #16a34a; }
.cal-lib-full { color: #dc2626; font-style: italic; }
/* Fallback badge (cuando no hay capacidad calculada) */
.cal-day-count {
    display: inline-block; font-size: 11px; font-weight: 800;
    padding: 2px 8px; border-radius: 4px; color: #fff; margin-top: 6px;
    letter-spacing: .01em;
}
.cal-day-count.cal-full  { background: #ef4444; }
.cal-day-count.cal-busy  { background: #f59e0b; }
.cal-day-count.cal-free  { background: #22c55e; }
.cal-day-count.cal-empty { background: #e2e8f0; color: #6b7280; }
.cal-day-disp            { display:block; font-size:11px; font-weight:600; color:#16a34a; margin-top:7px; line-height:1; }
.cal-day.cal-selected .cal-day-count,
.cal-day.cal-selected .cal-day-disp   { color: #fff; }
.cal-day.cal-selected .cal-prog       { background: rgba(255,255,255,.25); }
.cal-day.cal-selected .cal-prog-lbl,
.cal-day.cal-selected .cal-lib-free,
.cal-day.cal-selected .cal-lib-full   { color: rgba(255,255,255,.9); }
.cal-day.cal-day--off    { opacity:.35; cursor:default !important; pointer-events:none; }

/* ── Turnos: clases utilitarias (antes inline) ───────────── */
.turno-page-title       { font-size: 19px; font-weight: 800; color: var(--text-h); }
.turno-dia-title        { font-size: 16px; font-weight: 600; white-space: nowrap; }
.turno-dia-medico       { font-size: 16px; font-weight: 800; color: #111827; }
.turno-dia-horario      { font-size: 13px; font-weight: 600; color: var(--text-body, var(--text)); }
.cal-titulo             { min-width: 130px; text-align: center; }
.filter-select-sm       { max-width: 160px; }
.date-group-sm          { width: 160px; }
.tipo-section-hdr       { border-bottom: 1px solid var(--border-soft); }
.tipo-section-lbl       { font-size: 13px; font-weight: 600; color: var(--text-h); }
.slots-libre-lbl        { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.slot-plus-icon         { font-size: 11px; opacity: .6; }
.alert-sm               { font-size: 12px; }
/* Selector médico en cabecera calendario */
.input-group--medico                    { max-width: 220px; }
.input-group--medico .input-group-text  { background: #eff6ff; border-color: #93c5fd; }
.input-group--medico .input-group-text i{ color: #2563eb; }
.input-group--medico .form-select       { color: #111827; font-weight: 600; border-color: #93c5fd; }
/* Modal adjuntar */
.upload-info-text        { font-size: 12px; color: #111827; font-weight: 400; }
.batch-control--disabled { opacity: .4; pointer-events: none; }
.adj-titulo-text         { font-size: 13px; }
.adj-detalle-text        { font-size: 12px; }
/* Botón llamar en sala */
.btn-llamar { background: #4EA8D8; color: #fff; border: none; font-weight: 600; }
.btn-llamar:hover { background: #3a8fbf; color: #fff; }

/* ── Slot: panel flotante (vive en body, escapa al grid) ──── */
.slot-with-actions              { position: relative; }
.slot-actions                   { display: none; }
#slotFloatPanel                 { position: fixed; z-index: 9999; display: none;
                                  background: #fff; border: 1px solid #d1d5db;
                                  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.18);
                                  padding: 5px 6px; gap: 4px; align-items: center; }
.slot-action-btn                { border: none; background: transparent; color: #111827;
                                  width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
                                  display: flex; align-items: center; justify-content: center;
                                  font-size: 14px; padding: 0; transition: background .1s; }
.slot-action-btn:hover          { background: #f3f4f6; }
.slot-action-btn.btn-cancelar:hover { background: #fee2e2; color: #dc2626; }
/* ── Slot: médico requerido ──────────────────────────────── */
.slots-medico-req {
    padding: 12px 4px; font-size: 13px; font-weight: 600;
    color: #4b5563; display: flex; align-items: center; gap: 10px; grid-column: 1 / -1;
}
.slots-medico-req i { color: #9ca3af; font-size: 15px; }

/* ── Slot: sin turno (médico no trabaja ese día) ─────────── */
.slot-sin-turno {
    background: #fff5f5; border: 1.5px solid #fca5a5; border-radius: 8px;
    padding: 12px 16px; font-size: 13px; font-weight: 600; box-shadow: none;
    display: flex; align-items: center; gap: 10px; grid-column: 1 / -1;
}
.slot-sin-turno i    { color: #dc2626; font-size: 15px; flex-shrink: 0; }
.slot-sin-turno span { color: #7f1d1d; }

/* ── Estilos específicos de turnos (antes inline) ─────────────── */
.turno-spinner-icon     { color: #80C643; }
.turno-tipo-info        { font-size: 13px; }
.turno-fecha-icon       { cursor: pointer; }
.nt-sug-wrap            { position: relative; }
.turno-slots-label      { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #64748b; }
.turno-slots-fecha      { font-size: 17px; font-weight: 900; color: #0f172a; letter-spacing: -.3px; }
.turno-id-num           { font-size: 13px; }
.turno-btn-accion       { min-width: 90px; justify-content: center; }


/* ══════════════════════════════════════════════════════════════
   PAC-AC KEYBOARD NAV
   ══════════════════════════════════════════════════════════════ */
.pac-ac-item.is-active { background: var(--blue-light); }

/* ══════════════════════════════════════════════════════════════
   PAGE-HEADER — ESTUDIOS (título + exportar; filtros en .filtros-bar)
   ══════════════════════════════════════════════════════════════ */
.page-header--estudios {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
}

/* ══════════════════════════════════════════════════════════════
   PAGE-HEADER — ORDENES (identico a turnos)
   ══════════════════════════════════════════════════════════════ */
.page-header--ordenes {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.page-header--ordenes .ph-row1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.page-header--ordenes .ph-left  { display: flex; align-items: center; gap: 10px; }
.page-header--ordenes .ph-right { display: flex; align-items: center; gap: 8px; }
@media (max-width: 768px) {
    .page-header--ordenes .ph-row1 { flex-wrap: wrap; gap: 8px; }
    .page-header--ordenes .ph-right { width: 100%; }
    .page-header--ordenes .ph-right .btn { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════
   TABLA RESPONSIVE — paginado fijo, columnas con scroll
   Aplica a TODAS las tablas del sistema con .tabla-wrap
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* El wrapper scroll ya tiene overflow-x:auto — solo fijamos el paginado */
    .tabla-wrap .dataTables_paginate {
        position: sticky;
        left: 0;
    }
    /* Info texto (mostrando X a Y de Z) también fijo a la izquierda */
    .tabla-wrap .dataTables_info {
        position: sticky;
        left: 0;
    }
    /* Aseguramos que el wrapper de DataTables no corte el sticky */
    .tabla-wrap .dataTables_wrapper {
        overflow: visible;
    }
}

/* Órdenes: filtros rápidos = mismas clases que Turnos (.turnos-quick-filters + .tqf-btn) */
