/* ==========================================================================
   HTEM UI — tema visual del sistema (reemplaza a AdminLTE).
   Referencia: HTEM\ModernizacionAdminLTE\HTEM Dashboard.dc.html
   Se carga DESPUES de bootstrap-4.3.1.min.css y de los CSS de plugins, asi que
   reestiliza los componentes de Bootstrap/select2/toastr sin tocar el markup.
   ========================================================================== */

/* ---------- Fuentes locales ---------- */
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/htem/figtree-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/htem/figtree-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/htem/figtree-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/htem/figtree-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/htem/figtree-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/htem/jetbrains-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/htem/jetbrains-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/htem/jetbrains-mono-latin-700-normal.woff2') format('woff2'); }

/* ---------- Tokens ---------- */
:root {
    --h-bg: #EEF2F7;
    --h-surface: #FFFFFF;
    --h-surface-2: #FAFCFE;
    --h-surface-3: #F6F9FC;
    --h-surface-4: #F4F7FB;
    --h-sidebar: #08203D;
    --h-sidebar-2: #14406E;
    --h-sidebar-text: #B9CDE4;
    --h-sidebar-muted: #7FA3CC;
    --h-primary: #1257A6;
    --h-primary-dark: #08203D;
    --h-primary-hover: #0A2647;
    --h-primary-soft: #E8F0FA;
    --h-text: #0F1B2D;
    --h-text-2: #3D4E63;
    --h-text-3: #5B6B80;
    --h-muted: #6B7C93;
    --h-placeholder: #93A1B3;
    --h-border: #E1E8F0;
    --h-border-input: #DDE4ED;
    --h-divider: #EDF1F6;
    --h-divider-2: #F2F5F9;
    --h-success: #1E8E5A;
    --h-success-soft: #E7F4EC;
    --h-danger: #B3261E;
    --h-danger-soft: #FDECEA;
    --h-warning: #9A6512;
    --h-warning-soft: #FDF3E1;
    --h-neutral-soft: #F1F4F8;
    --h-radius: 14px;
    --h-radius-sm: 9px;
    --h-radius-xs: 6px;
    --h-shadow: 0 1px 2px rgba(10, 38, 71, 0.04);
    --h-shadow-lg: 0 12px 32px rgba(10, 38, 71, 0.14);
    --h-ring: 0 0 0 3px rgba(18, 87, 166, 0.14);
    --h-font: 'Figtree', Helvetica, Arial, sans-serif;
    --h-mono: 'JetBrains Mono', Consolas, monospace;
    --h-sidebar-w: 264px;
}

/* ---------- Base ---------- */
html { font-size: 14px; }
body {
    margin: 0;
    background: var(--h-bg);
    color: var(--h-text);
    font-family: var(--h-font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--h-primary); text-decoration: none; }
a:hover, a:focus { color: var(--h-primary-hover); text-decoration: none; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--h-font);
    color: var(--h-text);
    font-weight: 700;
    letter-spacing: -0.01em;
}
h1, .h1 { font-size: 22px; }
h2, .h2 { font-size: 20px; }
h3, .h3 { font-size: 17px; }
h4, .h4 { font-size: 15px; }
h5, .h5 { font-size: 14.5px; }
h6, .h6 { font-size: 13px; }
b, strong { font-weight: 700; }
small, .small { font-size: 12px; }
hr { border-top-color: var(--h-divider); }
code, kbd, pre, samp, .htem-mono { font-family: var(--h-mono); }
::selection { background: rgba(18, 87, 166, 0.18); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C7D2E0; border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.text-muted { color: var(--h-muted) !important; }
.text-primary { color: var(--h-primary) !important; }
.text-success { color: var(--h-success) !important; }
.text-danger { color: var(--h-danger) !important; }
.text-warning { color: var(--h-warning) !important; }
.text-info { color: var(--h-primary) !important; }
.text-dark { color: var(--h-text) !important; }
.text-secondary { color: var(--h-text-3) !important; }
.bg-light { background-color: var(--h-surface-3) !important; }
.bg-white { background-color: #fff !important; }
.bg-primary, .bg-info { background-color: var(--h-primary) !important; color: #fff !important; }
.bg-navy, .bg-dark { background-color: var(--h-sidebar) !important; color: #fff !important; }
.bg-success { background-color: var(--h-success) !important; color: #fff !important; }
.bg-danger { background-color: var(--h-danger) !important; color: #fff !important; }
.bg-warning { background-color: #E0A43A !important; color: #fff !important; }
.border { border-color: var(--h-border) !important; }
.rounded { border-radius: var(--h-radius-sm) !important; }
.img-circle { border-radius: 50%; }
.elevation-1, .elevation-2, .elevation-3, .elevation-4, .shadow, .shadow-sm { box-shadow: var(--h-shadow) !important; }

/* ==========================================================================
   Layout: sidebar + encabezado + contenido
   ========================================================================== */
.htem-app {
    display: grid;
    grid-template-columns: var(--h-sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
    background: var(--h-bg);
}
.htem-sidebar {
    background: var(--h-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1030;
}
.htem-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 20px;
    color: #fff;
}
.htem-brand:hover { color: #fff; }
.htem-brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    overflow: hidden;
}
.htem-brand-logo img { width: 30px; height: 30px; object-fit: contain; }
.htem-brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.htem-brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.02em; color: #fff; }
.htem-brand-sub { font-size: 11px; color: var(--h-sidebar-muted); letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.htem-user {
    margin: 0 14px 18px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}
.htem-user:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.htem-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--h-sidebar-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #A7C6E8;
    flex: none;
    overflow: hidden;
}
.htem-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.htem-user-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.htem-user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.htem-user-rol { font-size: 11px; color: var(--h-sidebar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.htem-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px 10px;
    overflow-y: auto;
    flex: 1 1 auto;
}
.htem-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); background-clip: content-box; }
.htem-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--h-sidebar-text);
    transition: background 120ms, color 120ms;
    cursor: pointer;
}
.htem-nav-item:hover, .htem-nav-item:focus { background: rgba(255, 255, 255, 0.09); color: #fff; }
.htem-nav-item.active { background: var(--h-primary); color: #fff; font-weight: 600; }
.htem-nav-tag {
    width: 22px;
    text-align: center;
    font-size: 14px;
    opacity: 0.85;
    flex: none;
}
.htem-nav-label { flex: 1; min-width: 0; }
.htem-nav-section {
    margin: 14px 12px 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5F83AE;
}

.htem-sidebar-foot {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.htem-version { font-size: 11px; color: #6C90BA; font-family: var(--h-mono); }
.htem-foot-actions { display: flex; gap: 8px; }
.htem-foot-btn {
    flex: 1;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: #fff;
    border: 0;
    cursor: pointer;
    transition: background 120ms;
}
.htem-foot-btn:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.htem-foot-btn.htem-logout { flex: none; }
.htem-foot-btn.htem-logout:hover { background: var(--h-danger); }

.htem-main { display: flex; flex-direction: column; min-width: 0; }
.htem-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(238, 242, 247, 0.88);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #DDE4ED;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.htem-header-titles { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.htem-crumb { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--h-muted); }
.htem-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--h-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.htem-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--h-border-input);
    font-size: 12px;
    font-weight: 600;
    color: var(--h-text-2);
    white-space: nowrap;
}
.htem-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--h-success); flex: none; }
.htem-banner img { max-height: 40px; width: auto; border-radius: 6px; }
.htem-burger {
    display: inline-flex;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--h-border-input);
    background: #fff;
    color: var(--h-text-2);
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    flex: none;
}
.htem-content { padding: 26px 32px 40px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.htem-content > .htem-flash:empty { display: none; }
.htem-backdrop { display: none; }

/* Movil / tablet: el menu se vuelve un panel lateral */
@media (max-width: 991.98px) {
    .htem-app { grid-template-columns: minmax(0, 1fr); }
    .htem-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: var(--h-sidebar-w);
        transform: translateX(-100%);
        transition: transform 180ms ease;
        box-shadow: var(--h-shadow-lg);
    }
    body.htem-nav-open .htem-sidebar { transform: translateX(0); }
    body.htem-nav-open .htem-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(8, 32, 61, 0.45);
        z-index: 1025;
    }
    .htem-burger { display: inline-flex; }
    .htem-header { padding: 12px 16px; gap: 12px; }
    .htem-title { font-size: 18px; }
    .htem-banner { display: none; }
    .htem-content { padding: 18px 16px 32px; }
}
@media (max-width: 575.98px) {
    .htem-chip { display: none; }
}

/* ==========================================================================
   Tarjetas
   ========================================================================== */
.card {
    background: var(--h-surface);
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
    box-shadow: var(--h-shadow);
    margin-bottom: 18px;
}
.card > .card-header:first-child { border-radius: var(--h-radius) var(--h-radius) 0 0; }
.card > .card-footer:last-child { border-radius: 0 0 var(--h-radius) var(--h-radius); }
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--h-divider);
    padding: 16px 20px;
    color: var(--h-text);
}
.card-header .card-title, .card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--h-text);
    float: none;
}
.card-header .card-title small, .card-title small { font-weight: 500; }
.card-body { padding: 20px; }
.card-footer {
    background: var(--h-surface-2);
    border-top: 1px solid var(--h-divider);
    padding: 14px 20px;
}
/* Variantes de color de AdminLTE: el diseno usa tarjetas blancas neutras */
.card-primary:not(.card-outline) > .card-header,
.card-info:not(.card-outline) > .card-header,
.card-secondary:not(.card-outline) > .card-header,
.card-success:not(.card-outline) > .card-header,
.card-danger:not(.card-outline) > .card-header,
.card-warning:not(.card-outline) > .card-header,
.card-dark:not(.card-outline) > .card-header {
    background: transparent;
    color: var(--h-text);
}
.card-primary:not(.card-outline) > .card-header .card-title,
.card-info:not(.card-outline) > .card-header .card-title { color: var(--h-text); }
.card-outline { border-top: 1px solid var(--h-border); }
.card-outline.card-info, .card-outline.card-primary { border-top: 3px solid var(--h-primary); }
.card-outline.card-secondary { border-top: 3px solid #C7D2E0; }
.card-outline.card-success { border-top: 3px solid var(--h-success); }
.card-outline.card-danger { border-top: 3px solid var(--h-danger); }
.card-tools { float: right; }
.card .table { margin-bottom: 0; }

/* ==========================================================================
   Botones
   ========================================================================== */
.btn {
    font-family: var(--h-font);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--h-radius-sm);
    padding: 9px 16px;
    line-height: 1.35;
    border-width: 1px;
    transition: background 120ms, border-color 120ms, color 120ms, box-shadow 120ms;
}
.btn:focus, .btn.focus { box-shadow: var(--h-ring); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn i + span, .btn .fas, .btn .far, .btn .fa { vertical-align: -1px; }
.btn-primary, .btn-info, .bg-navy.btn, .btn.bg-navy {
    background: var(--h-primary) !important;
    border-color: var(--h-primary) !important;
    color: #fff !important;
}
.btn-primary:hover, .btn-info:hover, .btn.bg-navy:hover,
.btn-primary:not(:disabled):not(.disabled):active, .btn-info:not(:disabled):not(.disabled):active {
    background: var(--h-primary-dark) !important;
    border-color: var(--h-primary-dark) !important;
    color: #fff !important;
}
.btn-secondary, .btn-default, .btn-light {
    background: #fff;
    border-color: var(--h-border-input);
    color: var(--h-text-2);
}
.btn-secondary:hover, .btn-default:hover, .btn-light:hover,
.btn-secondary:not(:disabled):not(.disabled):active {
    background: var(--h-surface-4);
    border-color: #C9D4E1;
    color: var(--h-text);
}
.btn-dark {
    background: var(--h-sidebar);
    border-color: var(--h-sidebar);
    color: #fff;
}
.btn-dark:hover { background: var(--h-primary-hover); border-color: var(--h-primary-hover); color: #fff; }
.btn-success { background: var(--h-success); border-color: var(--h-success); color: #fff; }
.btn-success:hover { background: #17744A; border-color: #17744A; color: #fff; }
.btn-danger { background: var(--h-danger); border-color: var(--h-danger); color: #fff; }
.btn-danger:hover { background: #8F1E18; border-color: #8F1E18; color: #fff; }
.btn-warning { background: #E0A43A; border-color: #E0A43A; color: #fff; }
.btn-warning:hover { background: #C88D25; border-color: #C88D25; color: #fff; }
.btn-outline-primary, .btn-outline-info {
    background: #fff;
    border-color: var(--h-border-input);
    color: var(--h-primary);
}
.btn-outline-primary:hover, .btn-outline-info:hover {
    background: var(--h-primary-soft);
    border-color: var(--h-primary);
    color: var(--h-primary);
}
.btn-outline-secondary, .btn-outline-dark {
    background: #fff;
    border-color: var(--h-border-input);
    color: var(--h-text-2);
}
.btn-outline-secondary:hover, .btn-outline-dark:hover { background: var(--h-surface-4); color: var(--h-text); border-color: #C9D4E1; }
.btn-outline-success { background: #fff; border-color: var(--h-border-input); color: var(--h-success); }
.btn-outline-success:hover { background: var(--h-success-soft); border-color: var(--h-success); color: var(--h-success); }
.btn-outline-danger { background: #fff; border-color: var(--h-border-input); color: var(--h-danger); }
.btn-outline-danger:hover { background: var(--h-danger-soft); border-color: var(--h-danger); color: var(--h-danger); }
.btn-outline-warning { background: #fff; border-color: var(--h-border-input); color: var(--h-warning); }
.btn-outline-warning:hover { background: var(--h-warning-soft); border-color: #E0A43A; color: var(--h-warning); }
.btn-link { color: var(--h-primary); font-weight: 600; }
.btn:disabled, .btn.disabled { opacity: 0.55; }

/* Acciones dentro de tablas: cuadrados de contorno, como el diseno */
.table td .btn:not(.htem-keep), .table td a.btn:not(.htem-keep) {
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 8px;
    background: #fff !important;
    border: 1px solid var(--h-border-input) !important;
    color: var(--h-text-2) !important;
    font-size: 13px;
}
.table td .btn:not(.htem-keep):hover {
    background: var(--h-primary-soft) !important;
    border-color: var(--h-primary) !important;
    color: var(--h-primary) !important;
}
.table td .btn-danger:not(.htem-keep), .table td .btn-outline-danger:not(.htem-keep) { color: var(--h-placeholder) !important; }
.table td .btn-danger:not(.htem-keep):hover, .table td .btn-outline-danger:not(.htem-keep):hover {
    background: var(--h-danger-soft) !important;
    border-color: var(--h-danger) !important;
    color: var(--h-danger) !important;
}
.table td .btn-success:not(.htem-keep):hover {
    background: var(--h-success-soft) !important;
    border-color: var(--h-success) !important;
    color: var(--h-success) !important;
}
.table td .list-inline { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin: 0; }
.table td .list-inline-item { margin: 0 !important; }
.table td .list-inline-item form { margin: 0; }

/* ==========================================================================
   Formularios
   ========================================================================== */
label, .col-form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--h-text-3);
    margin-bottom: 6px;
}
.col-form-label { padding-top: calc(0.5rem + 1px); }
.form-group { margin-bottom: 14px; }
.form-control, .custom-select {
    font-family: var(--h-font);
    font-size: 13px;
    color: var(--h-text-2);
    background-color: var(--h-surface-2);
    border: 1px solid var(--h-border-input);
    border-radius: var(--h-radius-sm);
    padding: 9px 12px;
    height: calc(1.5em + 20px);
    transition: border-color 120ms, box-shadow 120ms, background 120ms;
}
textarea.form-control { height: auto; min-height: 80px; }
select.form-control[multiple], select.form-control[size] { height: auto; }
.form-control:hover, .custom-select:hover { border-color: #C3CFDD; }
.form-control:focus, .custom-select:focus {
    border-color: var(--h-primary);
    background-color: #fff;
    box-shadow: var(--h-ring);
    color: var(--h-text);
}
.form-control::placeholder { color: var(--h-placeholder); }
.form-control:disabled, .form-control[readonly], .custom-select:disabled {
    background-color: var(--h-surface-4);
    color: var(--h-text-3);
    border-color: var(--h-border-input);
}
.custom-select, select.form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2393A1B3' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 6px;
    padding-right: 32px;
}
select.form-control[multiple] { background-image: none; padding-right: 12px; }
.form-control-sm { height: calc(1.5em + 12px); padding: 5px 10px; font-size: 12px; }
.form-text { font-size: 12px; color: var(--h-muted); }
.invalid-feedback { font-size: 12px; color: var(--h-danger); }
.is-invalid, .form-control.is-invalid { border-color: var(--h-danger) !important; }
.form-check { padding-left: 1.5rem; }
.form-check-label { font-size: 13px; font-weight: 500; color: var(--h-text-2); margin-bottom: 0; }
.form-check-input { margin-top: 0.25rem; accent-color: var(--h-primary); width: 15px; height: 15px; }
input[type=checkbox], input[type=radio] { accent-color: var(--h-primary); }
.custom-control-label { font-size: 13px; color: var(--h-text-2); font-weight: 500; }
.custom-control-input:checked ~ .custom-control-label::before { background-color: var(--h-primary); border-color: var(--h-primary); }
.input-group-text {
    background: var(--h-surface-4);
    border: 1px solid var(--h-border-input);
    border-radius: var(--h-radius-sm);
    color: var(--h-text-3);
    font-size: 13px;
}
.input-group > .form-control:not(:last-child), .input-group > .custom-select:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .form-control:not(:first-child), .input-group > .custom-select:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group-append .btn, .input-group-prepend .btn { padding-top: 0; padding-bottom: 0; }
.custom-file-label {
    border: 1px solid var(--h-border-input);
    border-radius: var(--h-radius-sm);
    background: var(--h-surface-2);
    font-size: 13px;
    color: var(--h-text-3);
    height: calc(1.5em + 20px);
    padding: 9px 12px;
}
.custom-file-label::after { height: 100%; padding: 9px 12px; background: var(--h-surface-4); color: var(--h-text-2); border-radius: 0 var(--h-radius-sm) var(--h-radius-sm) 0; }
fieldset { border: 1px solid var(--h-border); border-radius: 12px; padding: 14px 16px; }
legend { font-size: 13px; font-weight: 700; color: var(--h-text-2); width: auto; padding: 0 6px; }

/* ---------- select2 (tema classic y default) ---------- */
.select2-container { font-family: var(--h-font); font-size: 13px; }
.select2-container--classic .select2-selection--single,
.select2-container--default .select2-selection--single {
    height: calc(1.5em + 20px) !important;
    border: 1px solid var(--h-border-input) !important;
    border-radius: var(--h-radius-sm) !important;
    background: var(--h-surface-2) !important;
    background-image: none !important;
    display: flex;
    align-items: center;
    outline: 0;
}
.select2-container--classic .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--h-text-2) !important;
    line-height: normal !important;
    padding-left: 12px !important;
    padding-right: 42px !important;
    flex: 1;
}
.select2-container--classic .select2-selection--single .select2-selection__placeholder,
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--h-placeholder) !important; }
.select2-container--classic .select2-selection--single .select2-selection__arrow,
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    right: 4px !important;
    width: 24px !important;
    border: 0 !important;
    background: transparent !important;
    background-image: none !important;
}
.select2-container--classic .select2-selection--single .select2-selection__arrow b,
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--h-placeholder) transparent transparent transparent !important;
}
.select2-container--classic .select2-selection--single .select2-selection__clear,
.select2-container--default .select2-selection--single .select2-selection__clear {
    color: var(--h-placeholder);
    font-size: 16px;
    font-weight: 500;
    margin-right: 6px;
    position: absolute;
    right: 24px;
}
.select2-container--classic .select2-selection--single .select2-selection__clear:hover { color: var(--h-danger); }
.select2-container--classic .select2-selection--multiple,
.select2-container--default .select2-selection--multiple {
    min-height: calc(1.5em + 20px) !important;
    border: 1px solid var(--h-border-input) !important;
    border-radius: var(--h-radius-sm) !important;
    background: var(--h-surface-2) !important;
    background-image: none !important;
    padding: 3px 6px !important;
    outline: 0;
}
.select2-container--classic .select2-selection--multiple .select2-selection__choice,
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--h-primary-soft) !important;
    border: 0 !important;
    border-radius: var(--h-radius-xs) !important;
    color: var(--h-primary) !important;
    font-weight: 600;
    font-size: 12px;
    padding: 3px 8px !important;
    margin-top: 4px !important;
}
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove,
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: var(--h-primary) !important; margin-right: 5px; }
.select2-container--classic .select2-search--inline .select2-search__field,
.select2-container--default .select2-search--inline .select2-search__field { margin-top: 6px; font-size: 13px; color: var(--h-text-2); }
.select2-container--classic.select2-container--open .select2-selection--single,
.select2-container--classic.select2-container--open .select2-selection--multiple,
.select2-container--classic.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--h-primary) !important;
    background: #fff !important;
    box-shadow: var(--h-ring);
}
.select2-dropdown {
    border: 1px solid var(--h-border) !important;
    border-radius: 10px !important;
    box-shadow: var(--h-shadow-lg);
    overflow: hidden;
    font-size: 13px;
}
.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--h-border-input) !important;
    border-radius: 8px !important;
    padding: 7px 10px !important;
    font-size: 13px;
    outline: 0;
}
.select2-search--dropdown .select2-search__field:focus { border-color: var(--h-primary) !important; }
.select2-results__option { padding: 8px 12px; color: var(--h-text-2); }
.select2-container--classic .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--h-primary) !important;
    color: #fff !important;
}
.select2-container--classic .select2-results__option[aria-selected=true],
.select2-container--default .select2-results__option[aria-selected=true] { background: var(--h-primary-soft); color: var(--h-primary); }

/* ==========================================================================
   Tablas
   ========================================================================== */
.table-responsive, .table-responsive-sm, .table-responsive-md, .table-responsive-lg, .table-responsive-xl {
    background: var(--h-surface);
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
    box-shadow: var(--h-shadow);
}
.card .table-responsive, .card .table-responsive-lg, .card .table-responsive-md, .card .table-responsive-sm, .modal .table-responsive {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.table {
    color: var(--h-text);
    font-size: 13px;
    background: transparent;
    margin-bottom: 0;
}
.table thead th, .table > thead > tr > th {
    background: var(--h-surface-3) !important;
    color: var(--h-muted) !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    border-top: 0 !important;
    border-bottom: 1px solid var(--h-divider) !important;
    padding: 12px 16px;
    white-space: nowrap;
    vertical-align: middle;
}
.table td, .table th { padding: 13px 16px; vertical-align: middle; border-top: 1px solid var(--h-divider-2); }
.table-sm td, .table-sm th { padding: 7px 10px; }
.table-bordered, .table-bordered td, .table-bordered th { border-left: 0 !important; border-right: 0 !important; }
.table-bordered { border: 0; }
.table-bordered thead td, .table-bordered thead th { border-bottom-width: 1px; }
.table tr.table-info, .table-info, .table-info > td, .table-info > th, .table .thead-light th, .table .thead-dark th {
    background-color: var(--h-surface-3) !important;
    color: var(--h-muted) !important;
}
.table-striped tbody tr:nth-of-type(odd) { background-color: #FBFCFE; }
.table-hover tbody tr:hover { background-color: #F5F8FC; color: var(--h-text); }
.table td[style*="font-size:80%"], .table td[style*="font-size: 80%"] { font-size: 13px !important; }
.table tfoot td, .table tfoot th { background: var(--h-surface-3); font-weight: 700; }
.htem-table-card {
    background: var(--h-surface);
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
    box-shadow: var(--h-shadow);
    overflow: hidden;
}

/* DataTables */
.dataTables_wrapper { font-size: 13px; color: var(--h-text-3); }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--h-border-input);
    border-radius: 8px;
    padding: 5px 9px;
    background: var(--h-surface-2);
}

/* ==========================================================================
   Paginacion
   ========================================================================== */
.pagination { gap: 6px; flex-wrap: wrap; margin: 0; }
.page-item .page-link {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 8px !important;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--h-mono);
    font-size: 12.5px;
    font-weight: 600;
    background: #fff;
    color: var(--h-text-3);
    margin: 0 !important;
    box-shadow: inset 0 0 0 1px var(--h-border);
}
.page-item .page-link:hover { background: var(--h-primary-soft); color: var(--h-primary); }
.page-item.active .page-link { background: var(--h-primary); color: #fff; box-shadow: none; }
.page-item.disabled .page-link { background: var(--h-surface-4); color: var(--h-placeholder); box-shadow: none; }
.page-link:focus { box-shadow: var(--h-ring); }

/* ==========================================================================
   Badges, alertas, callouts
   ========================================================================== */
.badge {
    font-family: var(--h-font);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 4px 8px;
    border-radius: var(--h-radius-xs);
}
.badge-primary { background: var(--h-primary); color: #fff; }
.badge-info { background: var(--h-primary-soft); color: var(--h-primary); }
.badge-success { background: var(--h-success-soft); color: var(--h-success); }
.badge-danger { background: var(--h-danger-soft); color: var(--h-danger); }
.badge-warning { background: var(--h-warning-soft); color: var(--h-warning); }
.badge-secondary, .badge-light { background: var(--h-neutral-soft); color: var(--h-text-3); }
.badge-dark { background: var(--h-sidebar); color: #fff; }
.badge-pill { border-radius: 99px; }

.alert {
    border: 1px solid transparent;
    border-left-width: 4px;
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 13.5px;
    box-shadow: var(--h-shadow);
}
.alert-success { background: var(--h-success-soft); border-color: #BFE3CD; border-left-color: var(--h-success); color: #145C3B; }
.alert-danger { background: var(--h-danger-soft); border-color: #F5C9C4; border-left-color: var(--h-danger); color: #7F1B15; }
.alert-warning { background: var(--h-warning-soft); border-color: #F2DDB4; border-left-color: #E0A43A; color: #6E470C; }
.alert-info, .alert-primary { background: var(--h-primary-soft); border-color: #C8DAF0; border-left-color: var(--h-primary); color: #0C3D75; }
.alert-secondary { background: var(--h-neutral-soft); border-color: var(--h-border); border-left-color: #93A1B3; color: var(--h-text-2); }
.alert .close { opacity: 0.5; text-shadow: none; font-weight: 400; }
.alert ul { margin-bottom: 0; padding-left: 18px; }

.callout {
    background: #fff;
    border: 1px solid var(--h-border);
    border-left: 4px solid #C7D2E0;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 18px;
    box-shadow: var(--h-shadow);
}
.callout h5 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.callout p:last-child { margin-bottom: 0; }
.callout-info { border-left-color: var(--h-primary); }
.callout-warning { border-left-color: #E0A43A; }
.callout-danger { border-left-color: var(--h-danger); }
.callout-success { border-left-color: var(--h-success); }

/* ==========================================================================
   Modales, pestanas, dropdowns, list-group
   ========================================================================== */
.modal-content {
    border: 0;
    border-radius: var(--h-radius);
    box-shadow: var(--h-shadow-lg);
    overflow: hidden;
}
.modal-header { border-bottom: 1px solid var(--h-divider); padding: 18px 20px; align-items: center; }
.modal-title { font-size: 16px; font-weight: 700; color: var(--h-text); }
.modal-body { padding: 20px; color: var(--h-text-2); }
.modal-footer { background: var(--h-surface-2); border-top: 1px solid var(--h-divider); padding: 14px 20px; }
.modal-backdrop.show { opacity: 0.45; background: var(--h-sidebar); }
.close { color: var(--h-muted); text-shadow: none; opacity: 0.7; }
.close:hover { color: var(--h-text); opacity: 1; }

.nav-tabs { border-bottom: 1px solid var(--h-border-input); gap: 4px; }
.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--h-muted);
    font-weight: 600;
    font-size: 13.5px;
    padding: 10px 14px;
    margin-bottom: -1px;
    background: transparent;
}
.nav-tabs .nav-link:hover { color: var(--h-text); border-bottom-color: #C7D2E0; }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
    color: var(--h-text);
    background: transparent;
    border-bottom-color: var(--h-primary);
}
.nav-pills .nav-link { border-radius: 8px; color: var(--h-text-3); font-weight: 600; }
.nav-pills .nav-link.active { background: var(--h-primary); color: #fff; }
.card-tabs .card-header { padding-bottom: 0; border-bottom: 0; }

.dropdown-menu {
    border: 1px solid var(--h-border);
    border-radius: 10px;
    box-shadow: var(--h-shadow-lg);
    font-size: 13px;
    padding: 6px;
}
.dropdown-item { border-radius: 6px; padding: 7px 10px; color: var(--h-text-2); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--h-primary-soft); color: var(--h-primary); }
.list-group-item { border-color: var(--h-divider); font-size: 13px; color: var(--h-text-2); }
.list-group-item.active { background: var(--h-primary); border-color: var(--h-primary); }
.progress { border-radius: 99px; background: var(--h-divider); height: 7px; }
.progress-bar { background: var(--h-primary); }

/* ==========================================================================
   Bloques propios del sistema
   ========================================================================== */
/* Encabezado de pagina dentro del contenido (acciones de la pantalla) */
.htem-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.htem-toolbar-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--h-text); display: flex; align-items: center; gap: 10px; }
.htem-section-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--h-muted); }
.htem-count { font-size: 13px; color: var(--h-text-3); }
.htem-count strong { color: var(--h-text); }

/* Titulos heredados de las vistas (h2 con icono): mismo peso que el diseno */
.htem-content h2 > .fas:first-child, .htem-content h2 > .far:first-child, .htem-content h2 > .fa:first-child {
    color: var(--h-primary);
    font-size: 0.85em;
    margin-right: 8px;
}

/* Tarjetas KPI del dashboard */
.htem-kpi {
    background: #fff;
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--h-shadow);
    height: 100%;
    color: var(--h-text);
}
.htem-kpi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.htem-kpi-label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--h-muted); }
.htem-kpi-tag {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: 8px;
    background: var(--h-primary-soft);
    color: var(--h-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex: none;
}
.htem-kpi-value { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.htem-kpi-sub { font-size: 13px; color: var(--h-muted); margin-top: -6px; }
.htem-kpi-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--h-divider);
    margin-top: auto;
    flex-wrap: wrap;
}
.htem-kpi-foot a { font-size: 13px; font-weight: 600; }
.htem-kpi-note { font-size: 12px; font-weight: 600; color: var(--h-muted); }
.htem-kpi.is-danger .htem-kpi-tag { background: var(--h-danger-soft); color: var(--h-danger); }
.htem-kpi.is-danger .htem-kpi-foot a, .htem-kpi.is-danger .htem-kpi-note { color: var(--h-danger); }
.htem-kpi.is-success .htem-kpi-tag { background: var(--h-success-soft); color: var(--h-success); }
.htem-kpi.is-dark { background: var(--h-sidebar); border-color: var(--h-sidebar); color: #fff; }
.htem-kpi.is-dark .htem-kpi-label, .htem-kpi.is-dark .htem-kpi-note { color: #8FB2D8; }
.htem-kpi.is-dark .htem-kpi-tag { background: rgba(255, 255, 255, 0.12); color: #A7C6E8; }
.htem-kpi.is-dark .htem-kpi-foot { border-top-color: rgba(255, 255, 255, 0.14); }
.htem-kpi.is-dark a { color: #C9DCF0; }
.htem-kpi.is-dark a:hover { color: #fff; }
.htem-year-btn {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    border: 0;
    color: #fff;
    padding: 0;
}
.htem-year-btn:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }
.htem-year { font-family: var(--h-mono); font-size: 13px; font-weight: 700; }

/* Panel/tarjeta generica del diseno */
.htem-panel {
    background: #fff;
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
    box-shadow: var(--h-shadow);
}
.htem-panel-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--h-divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.htem-panel-head h2, .htem-panel-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.htem-panel-body { padding: 20px; }

/* Restos de AdminLTE que aun aparecen en vistas: neutralizados al estilo nuevo */
.small-box { border-radius: var(--h-radius); box-shadow: var(--h-shadow); }

/* ==========================================================================
   toastr y SweetAlert2
   ========================================================================== */
#toast-container > div {
    border-radius: 12px;
    box-shadow: var(--h-shadow-lg);
    opacity: 1;
    font-family: var(--h-font);
    font-size: 13.5px;
    padding: 14px 16px 14px 50px;
}
#toast-container > .toast-success { background-color: var(--h-success); }
#toast-container > .toast-error { background-color: var(--h-danger); }
#toast-container > .toast-info { background-color: var(--h-primary); }
#toast-container > .toast-warning { background-color: #C88D25; }
.swal2-popup { border-radius: var(--h-radius) !important; font-family: var(--h-font) !important; }
.swal2-styled.swal2-confirm { background-color: var(--h-primary) !important; border-radius: var(--h-radius-sm) !important; }
.swal2-styled.swal2-cancel { border-radius: var(--h-radius-sm) !important; }

/* Impresion: sin menu */
@media print {
    .htem-sidebar, .htem-header, .htem-backdrop { display: none !important; }
    .htem-app { display: block; }
    .htem-content { padding: 0; }
}

/* ---------- Inicio (dashboard) ---------- */
.htem-kpi-row { margin-bottom: 4px; }
.htem-kpi .htem-kpi-label { text-decoration: none; }
.htem-kpi.is-dark a.htem-kpi-label { color: #8FB2D8; }
.htem-kpi.is-dark a.htem-kpi-label:hover { color: #fff; }
.htem-kpi-active { color: #fff !important; box-shadow: inset 0 -2px 0 #4E8FD6; }
.htem-kpi.is-dark .htem-year { color: #fff; padding: 2px 4px; border-radius: 6px; }
.htem-kpi.is-dark .htem-year:hover { background: rgba(255, 255, 255, 0.12); }
.htem-kpi.is-danger .htem-kpi-foot a.htem-kpi-note { color: var(--h-danger); }
.htem-chart-card .card-body { padding: 16px 18px; }
.dashboard-tabs { margin-bottom: 18px !important; }

/* ==========================================================================
   Ajustes generales de las vistas heredadas
   ========================================================================== */
.btn { white-space: nowrap; }
/* Filtros y formularios con .form-group.row: etiqueta arriba y campo a lo ancho */
.htem-content .form-group.row {
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    margin-right: 0;
}
.htem-content .form-group.row > label,
.htem-content .form-group.row > .col-form-label,
.htem-content .form-group.row > [class*="col-"] {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}
.htem-content .form-group.row > label, .htem-content .form-group.row > .col-form-label { padding-top: 0; padding-bottom: 0; }
.htem-content .form-group.row > [class*="col-"] > .row { margin-left: -6px; margin-right: -6px; }
.htem-content .form-group.row > [class*="col-"] > .row > [class*="col-"] { padding-left: 6px; padding-right: 6px; }
.htem-content .form-group.row > [class*="col-"] > .row > .form-group { margin-bottom: 0; }
/* Los .form-group.row que ademas son columnas del grid conservan su ancho */
.htem-content .row > .form-group.row[class*="col-"] { padding-left: 10px; padding-right: 10px; }

/* Columna de acciones de tablas: hasta tres botones por fila, alineados a la derecha */
.table td:last-child .list-inline { flex-wrap: wrap; width: 132px; margin-left: auto; justify-content: flex-end; }
.table td:last-child:has(.list-inline) { min-width: 162px; }

/* Titulos de pagina dentro del contenido (la vista los trae con icono y boton) */
.htem-page-header { margin-bottom: -2px; }
.htem-page-header h1, .htem-page-header h2 { font-size: 18px; font-weight: 700; margin: 0; }
.htem-content h1:not(.htem-title) { font-size: 18px; }
.htem-content > .row.justify-content-between h2,
.htem-content .d-flex.justify-content-between > h2 { font-size: 18px; margin: 0; }
.htem-content > .row.justify-content-between,
.htem-page-header > .row.justify-content-between { align-items: center; margin-bottom: 0; }
.htem-content > .row.justify-content-between > [class*="col-"],
.htem-page-header > .row.justify-content-between > [class*="col-"] { flex: 0 0 auto; width: auto; max-width: none; }
.htem-content > .row.justify-content-between > [class*="col-"] .d-flex { margin-bottom: 0 !important; }
.htem-content > .row.justify-content-between > [class*="col-"] form { margin: 0; }

/* Tablas anchas: siempre con scroll horizontal dentro de su tarjeta (no desbordan la pagina) */
.table-responsive, .table-responsive-sm, .table-responsive-md, .table-responsive-lg, .table-responsive-xl {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive > .table, .table-responsive-lg > .table, .table-responsive-md > .table { margin-bottom: 0; }
.table td, .table th { padding: 12px 14px; }

/* select2: su CSS lo cargan las vistas al final del body, por eso se refuerza con !important */
.select2-container .select2-selection--single { display: block !important; position: relative; }
.select2-container .select2-selection--single .select2-selection__rendered {
    display: block !important;
    line-height: calc(1.5em + 18px) !important;
    padding-left: 12px !important;
    padding-right: 48px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.select2-container .select2-selection--single .select2-selection__arrow b {
    top: 50% !important;
    left: 50% !important;
    margin-top: -2px !important;
    margin-left: -4px !important;
    border-width: 5px 4px 0 4px !important;
}
.select2-container .select2-selection--single .select2-selection__clear {
    position: absolute !important;
    right: 28px !important;
    top: 50% !important;
    transform: translateY(-50%);
    line-height: 1 !important;
    height: auto !important;
    margin: 0 !important;
    float: none !important;
    padding: 2px 4px;
}
.select2-container { max-width: 100%; }
/* Encabezados de tabla: pueden partirse para que la tabla quepa sin scroll */
.table thead th, .table > thead > tr > th { white-space: normal; line-height: 1.35; }

/* Checkboxes y radios con aire respecto de su texto */
.form-check { padding-left: 1.7rem; }
.form-check-input { margin-left: -1.7rem; }
.form-check-inline .form-check-input { margin-left: 0; margin-right: 0.45rem; }
label > input[type=checkbox], label > input[type=radio] { margin-right: 6px; vertical-align: -2px; }

/* Filas de estado en tablas: tonos suaves del diseno */
.table-success, .table-success > td, .table-success > th { background-color: var(--h-success-soft) !important; }
.table-danger, .table-danger > td, .table-danger > th { background-color: var(--h-danger-soft) !important; }
.table-warning, .table-warning > td, .table-warning > th { background-color: var(--h-warning-soft) !important; }
.table-primary, .table-primary > td, .table-primary > th, .table-active, .table-active > td { background-color: var(--h-primary-soft) !important; }
.table-secondary, .table-secondary > td, .table-light, .table-light > td { background-color: var(--h-surface-3) !important; }

/* Avatares, migas e imagenes de perfil */
.htem-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--h-primary-soft); flex: none; border: 1px solid var(--h-border); }
.breadcrumb { background: transparent; padding: 0; margin-bottom: 0; font-size: 13px; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--h-placeholder); }
.breadcrumb-item.active { color: var(--h-muted); }
.profile-user-img { max-width: 120px !important; max-height: 120px !important; width: 120px !important; height: 120px !important; object-fit: cover; border: 3px solid var(--h-border); padding: 0; border-radius: 50%; }
.profile-username { font-size: 15px; font-weight: 700; }
.figure-img.img-thumbnail { border-color: var(--h-border); }
.htem-content hr { border-top: 1px solid var(--h-divider); opacity: 1; }

/* ==========================================================================
   Pantallas de acceso (login, contrasena, verificacion)
   ========================================================================== */
body.htem-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 44%) 1fr;
    background: var(--h-bg);
}
.htem-auth-brand {
    background: radial-gradient(120% 90% at 0% 0%, #14406E 0%, var(--h-sidebar) 55%, #051528 100%);
    color: #fff;
    display: flex;
    align-items: flex-end;
    padding: 48px;
    position: relative;
    overflow: hidden;
}
.htem-auth-brand::after {
    content: '';
    position: absolute;
    right: -120px;
    top: -120px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    border: 60px solid rgba(255, 255, 255, 0.04);
}
.htem-auth-brand-inner { display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; }
.htem-auth-logo { width: 64px; height: 64px; border-radius: 16px; }
.htem-auth-logo img { width: 50px; height: 50px; }
.htem-auth-name { font-size: 34px; font-weight: 800; letter-spacing: 0.02em; margin-top: 10px; }
.htem-auth-sub { font-size: 15px; color: var(--h-sidebar-muted); max-width: 320px; }
.htem-auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.login-box, .register-box, .lockscreen-wrapper { width: 100%; max-width: 400px; margin: 0; }
.login-logo, .register-logo, .lockscreen-logo { display: none; }
.login-box .card, .register-box .card { border-radius: var(--h-radius); padding: 8px 6px; box-shadow: 0 12px 32px rgba(10, 38, 71, 0.08); }
.login-card-body, .register-card-body { padding: 24px; background: transparent; }
.login-box-msg, .register-box-msg {
    margin: 0 0 20px;
    padding: 0;
    text-align: left;
    font-size: 20px;
    font-weight: 700;
    color: var(--h-text);
    letter-spacing: -0.01em;
}
.login-box .input-group, .register-box .input-group { margin-bottom: 14px !important; }
.login-box .input-group .form-control, .register-box .input-group .form-control, .lockscreen-wrapper .form-control { height: 44px; font-size: 14px; }
.login-box .input-group-text, .register-box .input-group-text { background: var(--h-surface-2); color: var(--h-placeholder); border-left: 0; }
.login-box .input-group > .form-control:not(:last-child) { border-right: 0; }
.login-box .btn-block, .register-box .btn-block { height: 44px; font-size: 14px; }
.login-box .row { align-items: center; }
.login-box a, .lockscreen-wrapper a { font-weight: 600; font-size: 13px; }
.icheck-primary label { font-size: 13px; font-weight: 500; color: var(--h-text-2); margin: 0; }
.icheck-primary input { margin-right: 6px; vertical-align: -2px; accent-color: var(--h-primary); }
.lockscreen-wrapper { background: #fff; border: 1px solid var(--h-border); border-radius: var(--h-radius); padding: 28px; box-shadow: 0 12px 32px rgba(10, 38, 71, 0.08); text-align: center; }
.lockscreen-name { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.lockscreen-item { margin-bottom: 12px; }
.lockscreen-wrapper .help-block { color: var(--h-muted); font-size: 13px; margin: 12px 0; }
@media (max-width: 767.98px) {
    body.htem-auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .htem-auth-brand { padding: 24px; align-items: center; }
    .htem-auth-name { font-size: 24px; margin-top: 4px; }
    .htem-auth-logo { width: 48px; height: 48px; }
    .htem-auth-logo img { width: 36px; height: 36px; }
}

/* Sin sesion (enlace publico de HLC-07): una sola columna, sin menu */
.htem-invitado .htem-app { grid-template-columns: minmax(0, 1fr); }

/* Paginas de error */
.htem-error {
    max-width: 520px;
    margin: 40px auto;
    background: #fff;
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
    box-shadow: var(--h-shadow);
    padding: 32px;
    text-align: center;
}
.htem-error-code {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 99px;
    background: var(--h-danger-soft);
    color: var(--h-danger);
    font-family: var(--h-mono);
    font-weight: 700;
    font-size: 13px;
}
.htem-error-title { margin: 14px 0 6px; font-size: 20px; }
.htem-error-msg { color: var(--h-text-3); margin-bottom: 20px; }
.htem-error-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Titulo de la vista identico al del encabezado: no se repite */
.htem-titulo-repetido { display: none !important; }
.htem-sin-titulo { justify-content: flex-end !important; }
.htem-sin-titulo.row { margin-bottom: 0; }


/* ==========================================================================
   Movil (< 768px): listados como tarjetas
   ========================================================================== */
@media (max-width: 767.98px) {
    .table-responsive-lg { overflow-x: visible; }
    table.htem-cards, table.htem-cards tbody { display: block; width: 100%; }
    table.htem-cards thead { display: none; }
    table.htem-cards tbody tr {
        display: block;
        background: var(--h-surface);
        border: 1px solid var(--h-border);
        border-radius: var(--h-radius);
        box-shadow: var(--h-shadow);
        margin-bottom: 12px;
        padding: 6px 14px;
    }
    table.htem-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 14px;
        border: 0;
        border-bottom: 1px solid var(--h-divider);
        padding: 8px 0;
        text-align: right;
        word-break: break-word;
    }
    table.htem-cards tbody td:last-child { border-bottom: 0; }
    table.htem-cards tbody td::before {
        content: attr(data-label);
        flex: 0 0 38%;
        max-width: 38%;
        text-align: left;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--h-text-3);
        padding-top: 2px;
    }
    table.htem-cards tbody td.htem-celda-sola { display: block; text-align: center; padding: 10px 0 6px; }
    table.htem-cards tbody td.htem-celda-sola::before { display: none; }
    table.htem-cards tbody td.htem-celda-sola .btn { min-width: 44px; min-height: 40px; margin: 2px; }
}

/* Movil: ajustes generales para que nada se salga de la pantalla */
@media (max-width: 767.98px) {
    .htem-content .d-flex { flex-wrap: wrap; gap: 8px; }
    .htem-content .d-flex > * { max-width: 100%; min-width: 0; }
    .badge { white-space: normal; text-align: left; }
    .btn { white-space: normal; min-height: 40px; }
    .htem-content h1, .htem-content h2 { font-size: 20px; line-height: 1.25; }
    .htem-content h3 { font-size: 17px; }
    .htem-content img, .htem-content iframe, .htem-content video, .htem-content canvas { max-width: 100%; height: auto; }
    .htem-content pre { white-space: pre-wrap; word-break: break-word; }
    .form-control, .select2-container .select2-selection, .custom-select { font-size: 16px; min-height: 42px; }
    .pagination { flex-wrap: wrap; }
    .modal-dialog { margin: 8px; max-width: calc(100% - 16px); }
    .modal-footer { flex-wrap: wrap; gap: 8px; }
    .modal-footer .btn { flex: 1 1 auto; }
    .card-header, .card-body { padding-left: 14px; padding-right: 14px; }
    .htem-content .row { margin-left: -8px; margin-right: -8px; }
    .htem-content .row > [class*="col-"] { padding-left: 8px; padding-right: 8px; }
    /* Contenedores que son fila y columna a la vez (ej. "row col-12" del HLC-07):
       sin esto suman margen negativo + relleno y los campos quedan mas angostos. */
    .htem-content .row > .row[class*="col-"],
    .htem-content .row > .form-group.row[class*="col-"] { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
    /* Casilla que tambien es columna: el relleno de columna pisaba el espacio de
       la casilla y esta se salia de la tarjeta por la izquierda. */
    .htem-content .row > .form-check[class*="col-"] { padding-left: calc(8px + 1.7rem); }
    /* select2 guarda un ancho fijo calculado al cargar; en telefono, al ancho de su columna. */
    .htem-content .select2-container { width: 100% !important; max-width: 100%; }
    /* Piezas sueltas dentro de una fila (sin columna): botones, lineas divisorias
       y recuadros con borde. Se alinean con el borde de los campos. */
    .htem-content .row > .btn { margin-left: 8px; margin-right: 8px; }
    .htem-content .row > div[style*="border-top"]:empty { margin-left: 8px; margin-right: 8px; width: auto !important; flex: 1 1 calc(100% - 16px); }
    .htem-content form .row > .row[class*="col-"][style*="border"] {
        margin-left: 8px; margin-right: 8px;
        flex: 0 0 calc(100% - 16px); max-width: calc(100% - 16px);
    }
}

@media (max-width: 575.98px) {
    input[type="date"], input[type="datetime-local"], input[type="time"] { padding-left: 8px; padding-right: 6px; font-size: 14px; }
    .htem-title { white-space: normal; line-height: 1.2; font-size: 17px; }
}
@media (max-width: 767.98px) {
    table.htem-cards tbody tr.table-success { background: #e8f5ec; border-color: #b7dfc3; }
}

/* Telefono: en los formularios cada campo ocupa todo el ancho (antes 2 por fila, muy angostos) */
@media (max-width: 575.98px) {
    .htem-content form .row > [class*="col-"],
    .htem-content form .form-row > [class*="col-"],
    .modal form .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }
    .htem-content form .form-group.row > label.col-form-label { padding-bottom: 4px; }
}

@media (max-width: 767.98px) {
    table.htem-cards tbody td .d-flex { flex-wrap: nowrap; justify-content: flex-end; }
    /* Celda con varias piezas (historial del caso: varios CEH/GVP, hospital + zona):
       una pila a la derecha de la etiqueta, una persona por renglon. */
    table.htem-cards tbody td > .htem-celda-pila { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
    table.htem-cards tbody td > .htem-celda-pila > .d-flex { gap: 10px; }
    table.htem-cards tbody td .d-flex > span { text-align: right; }
}
@media (max-width: 575.98px) {
    body.htem-auth .btn { white-space: nowrap; }
    body.htem-auth .row > .col-4 { flex: 0 0 auto; width: auto; max-width: none; }
    body.htem-auth .row > .col-8 { flex: 1 1 0; max-width: none; }
}
@media (max-width: 767.98px) {
    table.htem-cards tbody td[colspan] { display: block; text-align: center; }
    table.htem-cards tbody td[colspan]::before { display: none; }
}

/* Escritorio: el menu lateral se puede ocultar (clase en <html>, se recuerda en localStorage) */
@media (min-width: 992px) {
    html.htem-nav-oculto .htem-app { grid-template-columns: minmax(0, 1fr); }
    html.htem-nav-oculto .htem-sidebar { display: none; }
}

/* ---------- Combos con busqueda (public_html/js/htem-combos.js) ---------- */
.select2-container { max-width: 100%; }
.select2-container .select2-selection--single .select2-selection__rendered { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select2-container .select2-selection--multiple .select2-selection__choice { max-width: 100%; white-space: normal; word-break: break-word; }
.select2-results > .select2-results__options { max-height: 280px; -webkit-overflow-scrolling: touch; }
.select2-results__option[aria-disabled=true] { color: var(--h-placeholder); }
.select2-results__message { color: var(--h-placeholder); }
.select2-results__group { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--h-text-3, #6B7A8F); padding: 8px 12px 4px; }
.select2-container--disabled .select2-selection { cursor: not-allowed; opacity: .75; }
/* Dentro de .input-group el combo ocupa el espacio que deja el boton. */
.input-group > .select2-container { flex: 1 1 auto; width: 1% !important; }

/* Telefono y tablet: dedo en vez de mouse */
@media (max-width: 991.98px) {
    /* 16px evita que iOS haga zoom al tocar el buscador */
    .select2-container,
    .select2-search--dropdown .select2-search__field,
    .select2-container--classic .select2-search--inline .select2-search__field,
    .select2-container--default .select2-search--inline .select2-search__field { font-size: 16px !important; }
    .select2-container--classic .select2-selection--single,
    .select2-container--default .select2-selection--single { height: 44px !important; }
    .select2-container--classic .select2-selection--multiple,
    .select2-container--default .select2-selection--multiple { min-height: 44px !important; }
    .select2-results__option { padding: 12px 14px; min-height: 44px; }
    .select2-container--classic .select2-selection--multiple .select2-selection__choice,
    .select2-container--default .select2-selection--multiple .select2-selection__choice { font-size: 14px; padding: 6px 10px !important; }
    .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove,
    .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { font-size: 18px; padding: 0 4px; }
    .select2-container--classic .select2-selection--single .select2-selection__clear,
    .select2-container--default .select2-selection--single .select2-selection__clear { font-size: 22px; padding: 0 6px; }
    .select2-dropdown { font-size: 16px; }
    .select2-results > .select2-results__options { max-height: 50vh; }
}

/* ---------- Mapa de ubicacion (alojamientos: public_html/js/alojamiento-mapa.js) ---------- */
.htem-mapa-barra { display: flex; gap: 8px; align-items: stretch; margin-bottom: 8px; }
.htem-mapa-barra .input-group { flex: 1 1 auto; min-width: 0; }
.htem-mapa-barra > .btn { white-space: nowrap; flex: 0 0 auto; }
.htem-mapa {
    height: 360px;
    border: 1px solid var(--h-border-input);
    border-radius: var(--h-radius-sm);
    overflow: hidden;
    z-index: 0; /* que el mapa no quede encima del menu lateral ni de los modales */
}
.htem-mapa .leaflet-control-attribution { font-size: 10px; }
.htem-mapa-resultados {
    border: 1px solid var(--h-border);
    border-radius: 10px;
    box-shadow: var(--h-shadow-lg);
    background: #fff;
    margin: 0 0 8px;
    max-height: 240px;
    overflow-y: auto;
}
.htem-mapa-resultados li + li { border-top: 1px solid var(--h-border); }
.htem-mapa-resultado {
    display: block; width: 100%; text-align: left; border: 0; background: transparent;
    padding: 9px 12px; font-size: 13px; color: var(--h-text-2); line-height: 1.35;
}
.htem-mapa-resultado:hover, .htem-mapa-resultado:focus { background: var(--h-primary-soft); color: var(--h-primary); outline: 0; }
@media (max-width: 991.98px) {
    .htem-mapa { height: 320px; }
    .htem-mapa-barra .form-control { font-size: 16px; } /* sin zoom en iPhone */
    .htem-mapa-barra .btn { min-width: 44px; min-height: 44px; }
    .htem-mapa-resultado { padding: 12px 14px; font-size: 15px; }
    .htem-mapa .leaflet-control-zoom a { width: 36px; height: 36px; line-height: 36px; }
}
@media (max-width: 575.98px) {
    .htem-mapa { height: 55vh; min-height: 260px; max-height: 380px; }
}

/* ---------- Compartir alojamiento (alojamientos/list) ---------- */
.htem-ver-mapa { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.htem-compartir-texto { font-size: 13px; line-height: 1.45; resize: vertical; background: var(--h-surface-2); }
.htem-compartir-acciones { flex-wrap: wrap; gap: 8px; }
.htem-compartir-acciones > * { margin: 0 !important; }
@media (max-width: 575.98px) {
    .htem-compartir-acciones > .btn { flex: 1 1 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; }
    .htem-compartir-acciones > #compartirWhatsapp { order: -1; } /* la accion principal arriba */
    .htem-compartir-texto { font-size: 15px; }
}

/* ---------- Orden por columnas (partials/th-orden + public_html/js/htem-orden.js) ---------- */
th.htem-th-orden { padding: 0 !important; }
th.htem-th-orden > a {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    padding: .75rem; color: inherit; text-decoration: none; cursor: pointer; user-select: none;
}
th.htem-th-orden > a:hover { color: var(--h-primary); background: var(--h-primary-soft); }
th.htem-th-orden > a:focus-visible { outline: 2px solid var(--h-primary); outline-offset: -2px; }
th.htem-th-orden i { font-size: 11px; opacity: .35; flex: 0 0 auto; }
th.htem-th-activa > a { color: var(--h-primary); }
th.htem-th-activa i { opacity: 1; }
.htem-orden-movil { display: none; }
@media (max-width: 767.98px) {
    .htem-orden-movil { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
    .htem-orden-movil label { margin: 0; font-size: 13px; font-weight: 600; color: var(--h-text-2); white-space: nowrap; }
    .htem-orden-movil select { flex: 1 1 auto; min-width: 0; height: 44px; font-size: 16px; }
}

/* ---------- Etiquetas de personas asignadas (partials/tags-personas) ---------- */
.htem-tags { display: inline-flex; flex-wrap: wrap; gap: 5px; align-items: center; max-width: 100%; }
.htem-tag {
    display: inline-flex; align-items: center; gap: 6px;
    max-width: 100%; padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; line-height: 1.35;
    background: #EEF1F5; color: var(--h-text-2); border: 1px solid transparent;
    white-space: normal; word-break: break-word; text-align: left;
}
.htem-tag-ceh { background: var(--h-primary-soft); color: var(--h-primary); border-color: rgba(18, 87, 166, .18); }
.htem-tag-gvp { background: #E7F6EC; color: #1C7A3E; border-color: rgba(28, 122, 62, .2); }
.htem-tag-fecha { font-size: 10.5px; font-weight: 500; opacity: .75; white-space: nowrap; }
.htem-tag-vacio { color: var(--h-placeholder); font-size: 12px; font-style: italic; }
.htem-tag-quitar { display: inline-flex; margin: 0; }
.htem-tag-quitar button {
    border: 0; background: transparent; color: inherit; opacity: .55; padding: 0 0 0 2px;
    line-height: 1; font-size: 11px; cursor: pointer;
}
.htem-tag-quitar button:hover, .htem-tag-quitar button:focus { opacity: 1; color: var(--h-danger); outline: 0; }
.htem-tags-fila { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
@media (max-width: 767.98px) {
    table.htem-cards tbody td > .htem-tags { justify-content: flex-end; flex: 1 1 auto; min-width: 0; }
    .htem-tag { font-size: 13px; padding: 4px 11px; }
    .htem-tag-quitar button { font-size: 14px; padding: 4px 2px 4px 6px; } /* blanco tactil mas grande */
}
/* Nombres largos: burbuja menos redonda al partir en dos lineas. */
.htem-tag { border-radius: 12px; }

/* ---------- Hospital + zona (solicitudes de alojamiento) ---------- */
.htem-hosp-zona { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.htem-tag-zona { background: #FFF4E0; color: #8A5300; border-color: rgba(138, 83, 0, .2); font-size: 11.5px; }
.htem-tag-zona i { font-size: 10px; opacity: .8; }
@media (max-width: 767.98px) {
    table.htem-cards tbody td > .htem-hosp-zona { align-items: flex-end; text-align: right; }
}

/* ---------- Filtros desplegables (form[data-filtros], public_html/js/htem-filtros.js) ---------- */
.htem-filtros-cerrado { display: none !important; }
.htem-filtros-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.htem-filtros-barra.htem-filtros-abiertos { margin-bottom: 8px; }
.htem-filtros-toggle {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--h-surface); border: 1px solid var(--h-border-input); color: var(--h-text-2);
    border-radius: var(--h-radius-sm); padding: 7px 12px; font-weight: 600; font-size: 13px;
}
.htem-filtros-toggle:hover, .htem-filtros-abiertos .htem-filtros-toggle { border-color: var(--h-primary); color: var(--h-primary); }
.htem-filtros-n {
    background: var(--h-primary); color: #fff; border-radius: 999px;
    min-width: 20px; height: 20px; padding: 0 6px; font-size: 11px; line-height: 20px; text-align: center;
}
.htem-filtros-flecha { font-size: 10px; transition: transform .15s ease; }
.htem-filtros-abiertos .htem-filtros-flecha { transform: rotate(180deg); }
.htem-filtros-activos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.htem-filtro-chip {
    display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
    background: var(--h-primary-soft); color: var(--h-primary); border: 1px solid rgba(18, 87, 166, .18);
    border-radius: 12px; padding: 3px 4px 3px 10px; font-size: 12px; line-height: 1.35; word-break: break-word;
}
.htem-filtro-chip-et { font-weight: 700; }
.htem-filtro-chip a { color: inherit; opacity: .6; padding: 0 5px; text-decoration: none; }
.htem-filtro-chip a:hover { opacity: 1; color: var(--h-danger); }
.htem-filtros-limpiar { font-size: 12px; font-weight: 600; margin-left: 4px; }
.htem-filtros-sin { font-size: 12px; color: var(--h-placeholder); }
.htem-rango-fechas { display: flex; align-items: center; gap: 8px; }
.htem-rango-fechas > .form-control { flex: 1 1 0; min-width: 0; }
.htem-rango-fechas > span { color: var(--h-placeholder); font-size: 12px; }
@media (max-width: 767.98px) {
    .htem-filtros-toggle { min-height: 44px; padding: 8px 14px; }
    .htem-filtro-chip { font-size: 13px; padding: 5px 4px 5px 11px; }
    .htem-filtro-chip a { padding: 4px 8px; font-size: 14px; } /* blanco tactil */
    .htem-filtros-sin { flex-basis: 100%; }
}
@media (max-width: 420px) {
    .htem-rango-fechas { flex-wrap: wrap; }
    .htem-rango-fechas > .form-control { flex-basis: 100%; }
    .htem-rango-fechas > span { display: none; }
}

/* ---------- Borrador automatico (form[data-autoguardado], public_html/js/htem-autoguardado.js) ---------- */
.htem-autoguardado-estado {
    display: inline-block; min-width: 15em; margin-right: 12px; vertical-align: middle;
    font-size: 12px; color: var(--h-placeholder); text-align: right; white-space: nowrap;
}
.htem-autoguardado-ok { color: #1C7A3E; }
.htem-autoguardado-aviso { color: #8A5300; white-space: normal; }
.htem-borrador-aviso {
    position: fixed; z-index: 1060; left: 50%; bottom: 20px; transform: translateX(-50%);
    width: min(560px, calc(100vw - 32px));
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: #FFF8E6; border: 1px solid #F2D58A; border-radius: 12px;
    box-shadow: var(--h-shadow-lg); padding: 12px 16px; color: #6B4A00;
    animation: htem-borrador-entra .2s ease-out;
}
@keyframes htem-borrador-entra { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .htem-borrador-aviso { animation: none; } }
.htem-borrador-aviso > i { font-size: 18px; }
.htem-borrador-texto { flex: 1 1 260px; display: flex; flex-direction: column; font-size: 13px; }
.htem-borrador-acciones { display: flex; gap: 8px; }
@media (max-width: 767.98px) {
    .htem-autoguardado-estado { display: block; min-width: 0; margin: 0 0 8px; text-align: left; white-space: normal; }
    .htem-borrador-aviso { bottom: 12px; }
    .htem-borrador-acciones { width: 100%; }
    .htem-borrador-acciones .btn { flex: 1 1 0; min-height: 44px; }
}

/* ---------- Menu lateral: grupo con opciones hijas (partials/htem-nav-grupo) ---------- */
.htem-nav-grupo > summary { list-style: none; user-select: none; }
.htem-nav-grupo > summary::-webkit-details-marker { display: none; }
.htem-nav-grupo > summary::marker { content: ''; }
.htem-nav-grupo-flecha { font-size: 10px; opacity: .6; transition: transform .15s ease; }
.htem-nav-grupo[open] > summary .htem-nav-grupo-flecha { transform: rotate(180deg); }
.htem-nav-grupo-activo > summary { color: #fff; font-weight: 600; }
.htem-nav-hijos {
    display: flex; flex-direction: column; gap: 2px;
    margin: 2px 0 4px 22px; padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
}
.htem-nav-hijos .htem-nav-item { padding: 8px 12px; font-size: 13px; }
.htem-nav-hijos .htem-nav-tag { font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .htem-nav-grupo-flecha { transition: none; } }

/* ---------- Importar solicitud desde PDF HLC-20 ---------- */
.hlc20-resumen th { width: 34%; font-weight: 600; color: var(--h-text-2); white-space: nowrap; }
.hlc20-resumen td, .hlc20-resumen th { border-top: 1px solid var(--h-divider); padding: 6px 8px; font-size: 13px; }
@media (max-width: 575.98px) {
    .hlc20-resumen th { white-space: normal; width: 40%; }
    #hlc20Modal .modal-footer .btn { flex: 1 1 100%; min-height: 44px; }
}

/* ---------- Autoguardado: indicador en la cabecera (public_html/js/htem-autoguardado.js) ---------- */
.htem-ag-cab { position: relative; flex: none; }
.htem-ag-cab-boton {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 12px; border-radius: 10px; cursor: pointer;
    background: var(--h-primary-soft); border: 1px solid rgba(18, 87, 166, .25); color: var(--h-primary);
    font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.2;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.htem-ag-cab-boton:hover, .htem-ag-cab-boton:focus-visible { border-color: var(--h-primary); outline: 0; box-shadow: var(--h-ring); }
.htem-ag-cab-boton i { font-size: 13px; }
.htem-ag-cab[data-tipo="cambios"] .htem-ag-cab-boton,
.htem-ag-cab[data-tipo="guardando"] .htem-ag-cab-boton { background: #FFF6E0; color: #8A5300; border-color: rgba(138, 83, 0, .25); }
.htem-ag-cab[data-tipo="ok"] .htem-ag-cab-boton { background: #E7F6EC; color: #1C7A3E; border-color: rgba(28, 122, 62, .25); }
.htem-ag-cab[data-tipo="aviso"] .htem-ag-cab-boton { background: #FDECEA; color: #A23B2A; border-color: rgba(162, 59, 42, .25); }
.htem-ag-cab[data-tipo="disponible"] .htem-ag-cab-boton { background: #FFF8E6; color: #6B4A00; border-color: #F2D58A; }
.htem-ag-cab-ayuda {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 1030; width: 320px;
    background: #fff; border: 1px solid var(--h-border); border-radius: 12px; box-shadow: var(--h-shadow-lg);
    padding: 14px 16px; font-size: 13px; color: var(--h-text-2); white-space: normal;
}
.htem-ag-cab-ayuda strong { display: block; margin-bottom: 6px; color: var(--h-primary); }
.htem-ag-cab-ayuda p { margin: 0 0 6px; line-height: 1.45; }
.htem-ag-cab-estado:not(:empty) { margin-top: 8px !important; padding-top: 8px; border-top: 1px solid var(--h-divider); font-weight: 600; }
.htem-autoguardado-activo { color: var(--h-primary); }
@media (prefers-reduced-motion: reduce) { .htem-ag-cab-boton i.fa-spin { animation: none; } }
@media (max-width: 575.98px) {
    /* Telefono: solo el icono (con su color de estado); al tocarlo se explica. */
    .htem-ag-cab-texto { display: none; }
    .htem-ag-cab-boton { width: 40px; height: 40px; justify-content: center; padding: 0; }
    .htem-ag-cab-boton i { font-size: 16px; }
    .htem-ag-cab-ayuda { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; }
}

/* ---------- Alerta de borradores pendientes en la cabecera (partials/htem-borradores) ---------- */
.htem-borradores { position: relative; flex: none; }
.htem-borradores-boton {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px 7px 12px; border-radius: 10px; cursor: pointer;
    background: #FFF6E0; color: #8A5300; border: 1px solid rgba(138, 83, 0, .3);
    font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.2;
}
.htem-borradores-boton:hover, .htem-borradores-boton:focus-visible { border-color: #8A5300; outline: 0; box-shadow: 0 0 0 3px rgba(138, 83, 0, .15); }
.htem-borradores-n { background: #8A5300; color: #fff; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; font-size: 11px; line-height: 20px; text-align: center; }
.htem-borradores-urgente .htem-borradores-boton { background: #FDECEA; color: #A23B2A; border-color: rgba(162, 59, 42, .35); animation: htem-borradores-pulso 2.4s ease-in-out 3; }
.htem-borradores-urgente .htem-borradores-n { background: #A23B2A; }
@keyframes htem-borradores-pulso { 0%, 100% { box-shadow: 0 0 0 0 rgba(162, 59, 42, 0); } 50% { box-shadow: 0 0 0 5px rgba(162, 59, 42, .18); } }
@media (prefers-reduced-motion: reduce) { .htem-borradores-urgente .htem-borradores-boton { animation: none; } }
.htem-borradores-lista {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 1030; width: 400px; max-height: 70vh; overflow-y: auto;
    background: #fff; border: 1px solid var(--h-border); border-radius: 12px; box-shadow: var(--h-shadow-lg);
}
.htem-borradores-cab { padding: 12px 16px; border-bottom: 1px solid var(--h-divider); background: #FFFBF2; font-size: 12.5px; color: #6B4A00; }
.htem-borradores-cab strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.htem-borradores-lista ul { list-style: none; margin: 0; padding: 0; }
.htem-borradores-lista li { padding: 12px 16px; border-bottom: 1px solid var(--h-divider); }
.htem-borradores-lista li:last-child { border-bottom: 0; }
.htem-borrador-enlace { display: flex; flex-direction: column; gap: 2px; color: var(--h-text-2); text-decoration: none; }
.htem-borrador-enlace:hover .htem-borrador-titulo { color: var(--h-primary); text-decoration: underline; }
.htem-borrador-titulo { font-weight: 700; font-size: 13.5px; color: var(--h-text); }
.htem-borrador-resumen { font-size: 13px; }
.htem-borrador-meta { font-size: 12px; color: var(--h-placeholder); }
.htem-borradores-lista li.urgente .htem-borrador-vence { color: #A23B2A; font-weight: 700; }
.htem-borrador-botones { display: flex; gap: 8px; margin-top: 8px; }
@media (max-width: 575.98px) {
    .htem-borradores-texto { display: none; }
    .htem-borradores-boton { height: 40px; padding: 0 10px; }
    .htem-borradores-lista { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; }
    .htem-borrador-botones .btn { flex: 1 1 0; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
}

/* ---------- Ultimo acceso (cabecera en escritorio; tarjeta del menu en tablet/telefono) ---------- */
.htem-ultimo-acceso {
    display: inline-flex; align-items: center; gap: 8px; flex: none;
    color: var(--h-muted); font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.15;
}
.htem-ultimo-acceso i { font-size: 15px; opacity: .8; }
.htem-ultimo-acceso small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.htem-user-acceso { display: none; font-size: 11px; color: var(--h-sidebar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
@media (max-width: 991.98px) {
    .htem-ultimo-acceso { display: none; }
    .htem-user-acceso { display: block; }
}

/* ---------- Sugerencias al escribir en los filtros (public_html/js/htem-sugerencias.js) ---------- */
.htem-sugerencias {
    position: absolute; z-index: 1065; margin: 0; padding: 4px 0; list-style: none;
    max-height: 300px; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: #fff; border: 1px solid var(--h-border); border-radius: 10px; box-shadow: var(--h-shadow-lg);
    font-size: 13px;
}
.htem-sugerencias li[role=option] {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding: 8px 12px; cursor: pointer; color: var(--h-text-2);
}
.htem-sugerencias li[role=option]:hover, .htem-sugerencias li[aria-selected=true] { background: var(--h-primary-soft); color: var(--h-primary); }
.htem-sugerencias mark { background: transparent; color: inherit; font-weight: 700; padding: 0; }
.htem-sug-valor { min-width: 0; overflow-wrap: anywhere; }
.htem-sug-extra { flex: none; max-width: 45%; font-size: 11.5px; color: var(--h-placeholder); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.htem-sugerencias-vacio { padding: 8px 12px; color: var(--h-placeholder); font-style: italic; }
@media (max-width: 767.98px) {
    .htem-sugerencias { font-size: 15px; max-height: 45vh; }
    .htem-sugerencias li[role=option] { min-height: 44px; align-items: center; padding: 10px 14px; }
}

/* ---------- Contador en burbuja (solicitudes por alojamiento, casos por contacto) ---------- */
.htem-contador {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    min-width: 28px; height: 24px; padding: 0 8px; border-radius: 999px;
    background: var(--h-primary); color: #fff !important; font-size: 12px; font-weight: 700; text-decoration: none !important;
}
a.htem-contador:hover, a.htem-contador:focus-visible { background: var(--h-primary-dark, #0B3F7A); box-shadow: var(--h-ring); outline: 0; }
.htem-contador-cero { background: #EEF1F5; color: var(--h-placeholder) !important; font-weight: 600; }
@media (max-width: 767.98px) { .htem-contador { min-width: 36px; height: 32px; font-size: 14px; } }
.htem-ultimo-caso { display: block; margin-top: 4px; font-size: 11px; color: var(--h-placeholder); white-space: nowrap; }
.htem-ultimo-caso-viejo { color: #8A5300; font-weight: 600; }
@media (max-width: 767.98px) { table.htem-cards td .htem-ultimo-caso { display: inline-block; margin: 0 0 0 8px; font-size: 12px; } }

/* ==========================================================================
   GVP — trabajo de campo y coordinacion (resources/views/gvp, js/gvp-campo.js)
   ========================================================================== */
.gvp-acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.gvp-btn-grande { min-height: 52px; font-size: 16px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 22px; }
.gvp-en-curso-aviso { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #E8F0FA; border: 1px solid rgba(18,87,166,.25); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.gvp-en-curso-aviso .gvp-pulso { flex: none; }
.gvp-pulso { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #1C7A3E; box-shadow: 0 0 0 0 rgba(28,122,62,.5); animation: gvp-pulso 1.8s infinite; }
@keyframes gvp-pulso { 0% { box-shadow: 0 0 0 0 rgba(28,122,62,.45); } 70% { box-shadow: 0 0 0 10px rgba(28,122,62,0); } 100% { box-shadow: 0 0 0 0 rgba(28,122,62,0); } }
@media (prefers-reduced-motion: reduce) { .gvp-pulso { animation: none; } }
.gvp-totales { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.gvp-total { background: #fff; border: 1px solid var(--h-border); border-radius: 12px; padding: 12px 16px; }
.gvp-total b { display: block; font-size: 22px; color: var(--h-text); }
.gvp-total span { font-size: 12px; color: var(--h-placeholder); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
/* Iniciar actividad */
.gvp-form { max-width: 640px; }
.gvp-segmentos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.gvp-segmentos button { flex: 1 1 0; min-width: 110px; min-height: 44px; border: 1px solid var(--h-border-input); background: #fff; border-radius: 10px; font-weight: 600; color: var(--h-text-2); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.gvp-segmentos button.activo { background: var(--h-primary); border-color: var(--h-primary); color: #fff; }
.gvp-opciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.gvp-opcion { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--h-border-input); border-radius: 10px; background: #fff; cursor: pointer; margin: 0; font-weight: 500; }
.gvp-opcion input { width: 18px; height: 18px; flex: none; }
.gvp-opcion:has(input:checked) { border-color: var(--h-primary); background: var(--h-primary-soft); color: var(--h-primary); font-weight: 700; }
/* Pantalla en vivo */
.gvp-vivo { max-width: 520px; margin: 0 auto; }
.gvp-vivo-tarjeta { background: #fff; border: 1px solid var(--h-border); border-radius: 16px; box-shadow: var(--h-shadow); padding: 20px; text-align: center; margin-bottom: 14px; }
.gvp-vivo-estado { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: #1C7A3E; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.gvp-vivo-tipo { font-size: 20px; font-weight: 800; margin: 10px 0 4px; color: var(--h-text); }
.gvp-vivo-caso { color: var(--h-text-2); font-size: 14px; }
.gvp-reloj { font-family: var(--h-mono, monospace); font-size: 46px; font-weight: 700; letter-spacing: .02em; color: var(--h-primary); margin: 14px 0 2px; line-height: 1; }
.gvp-vivo-datos { list-style: none; padding: 0; margin: 16px 0 0; text-align: left; }
.gvp-vivo-datos li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--h-divider); font-size: 14px; color: var(--h-text-2); }
.gvp-vivo-datos li i { width: 20px; text-align: center; color: var(--h-primary); }
.gvp-vivo-datos li.malo i, .gvp-vivo-datos li.malo span { color: #A23B2A; }
.gvp-vivo.terminada .gvp-reloj { color: var(--h-placeholder); }
dialog.gvp-dialogo { border: 0; border-radius: 16px; padding: 22px; width: min(440px, calc(100vw - 24px)); box-shadow: var(--h-shadow-lg); }
dialog.gvp-dialogo::backdrop { background: rgba(8, 32, 61, .5); }
.gvp-dialogo h3 { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.gvp-dialogo .gvp-dialogo-icono { font-size: 34px; color: var(--h-primary); margin-bottom: 8px; }
.gvp-dialogo .btn { min-height: 48px; }
/* Detalle */
.gvp-mapa { height: 340px; border-radius: 12px; border: 1px solid var(--h-border-input); z-index: 0; }
.gvp-ficha { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 20px; margin: 0; }
.gvp-ficha dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--h-placeholder); font-weight: 700; }
.gvp-ficha dd { margin: 2px 0 0; color: var(--h-text); }
.gvp-alerta { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: #8A5300; background: #FFF4E0; border-radius: 999px; padding: 2px 9px; margin: 2px 4px 2px 0; }
.gvp-nota-observacion { border-left: 3px solid #8A5300; background: #FFF8E6; padding: 8px 12px; border-radius: 6px; font-size: 13px; margin-top: 6px; }
@media (max-width: 767.98px) {
    .gvp-acciones .btn, .gvp-btn-grande { width: 100%; }
    .gvp-reloj { font-size: 40px; }
    .gvp-mapa { height: 280px; }
}

/* ---------- GVP: actividad en transito en la cabecera (gvp/partials/cabecera) ---------- */
.gvp-cabecera {
    display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 7px 12px; border-radius: 10px;
    background: #E7F5EC; color: #1C7A3E; border: 1px solid rgba(28, 122, 62, .3);
    font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.2; text-decoration: none;
}
.gvp-cabecera:hover, .gvp-cabecera:focus-visible { color: #1C7A3E; text-decoration: none; border-color: #1C7A3E; outline: 0; box-shadow: 0 0 0 3px rgba(28, 122, 62, .15); }
.gvp-cabecera .gvp-pulso { width: 9px; height: 9px; }
.gvp-cabecera-reloj { font-variant-numeric: tabular-nums; font-weight: 600; opacity: .85; }
.gvp-cabecera-n { background: #1C7A3E; color: #fff; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; font-size: 11px; line-height: 20px; text-align: center; }
.gvp-cabecera-alerta { background: #FDECEA; color: #A23B2A; border-color: rgba(162, 59, 42, .35); }
.gvp-cabecera-alerta:hover, .gvp-cabecera-alerta:focus-visible { color: #A23B2A; border-color: #A23B2A; box-shadow: 0 0 0 3px rgba(162, 59, 42, .15); }
@media (max-width: 991.98px) {
    .gvp-cabecera { height: 40px; padding: 0 10px; }
}
@media (max-width: 575.98px) {
    .gvp-cabecera-texto { display: none; }
}

/* ===== Programa de visitas por zona (programa-visitas/*) ===== */
.pv-cabecera { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.pv-zona { font-weight: 700; color: var(--h-text); font-size: 16px; }
.pv-estado { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 2px 10px; margin-top: 4px; }
.pv-estado-publicado { color: var(--h-success); background: var(--h-success-soft); }
.pv-estado-borrador { color: var(--h-warning); background: var(--h-warning-soft); }
.pv-programa { max-width: 760px; margin: 0 auto; }
.pv-titulo { text-align: center; color: #0B2E6B; font-weight: 800; font-size: 20px; line-height: 1.3; margin: 4px 0 18px; }
.pv-tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.pv-tabla thead th { background: var(--h-primary-dark); color: #fff; text-align: center; padding: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.pv-tabla tbody.pv-semana::before { content: ''; display: table-row; height: 10px; }
.pv-tabla tbody tr { background: var(--pv-color, #fff); color: #14202E; }
.pv-tabla td { padding: 8px 10px; text-align: center; border-bottom: 1px solid rgba(0, 0, 0, .12); border-right: 1px solid rgba(0, 0, 0, .08); vertical-align: middle; }
.pv-tabla td:first-child { border-left: 1px solid rgba(0, 0, 0, .08); }
.pv-tabla tbody tr:first-child td { border-top: 1px solid rgba(0, 0, 0, .12); }
.pv-dia { text-transform: uppercase; font-weight: 600; width: 16%; }
.pv-fecha { font-weight: 800; font-size: 16px; width: 10%; }
.pv-miembros { text-transform: uppercase; width: 40%; }
.pv-centro { text-transform: uppercase; width: 34%; }
.pv-dia-corto { display: none; }
.pv-tabla tr.pv-mio td { box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, .28); font-weight: 700; }
.pv-tabla tr.pv-mio td:first-child { border-left: 5px solid var(--h-primary); }
.pv-tabla tr.pv-hoy td.pv-fecha::after { content: 'hoy'; display: block; font-size: 10px; font-weight: 700; color: var(--h-primary); text-transform: uppercase; }
.pv-tu { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 700; text-transform: none; color: #fff; background: var(--h-primary); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.pv-notas { margin: 14px 0 0; font-size: 13.5px; }
.pv-proximas .list-group-item { padding: 8px 14px; }
.pv-proxima { display: flex; align-items: center; gap: 12px; color: inherit; }
.pv-proxima:hover { text-decoration: none; color: inherit; }
.pv-proxima-fecha { display: flex; flex-direction: column; align-items: center; min-width: 52px; padding: 4px 6px; border-radius: 10px; background: var(--pv-color); color: #14202E; line-height: 1.1; }
.pv-proxima-fecha b { font-size: 18px; }
.pv-proxima-fecha small { font-size: 10.5px; text-transform: uppercase; font-weight: 600; }
.pv-nuevo { max-width: 560px; }
/* Editor */
.pv-fila { display: grid; grid-template-columns: 170px minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 10px 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--h-divider); }
.pv-fila:first-child { padding-top: 0; }
.pv-etq { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--h-placeholder); font-weight: 700; margin-bottom: 3px; }
.pv-nombre-dia { display: block; font-size: 12px; color: var(--h-muted); margin-top: 3px; min-height: 16px; }
.pv-col-acciones { display: flex; gap: 6px; padding-top: 21px; }
.pv-botones { gap: 8px; }
@media (max-width: 991.98px) {
    .pv-fila { grid-template-columns: 1fr 1fr; }
    .pv-col-fecha { grid-column: 1 / 2; }
    .pv-col-acciones { grid-column: 2 / 3; grid-row: 1; justify-content: flex-end; }
    .pv-col-miembros, .pv-col-centro { grid-column: 1 / -1; }
}
@media (max-width: 575.98px) {
    .pv-titulo { font-size: 16px; }
    .pv-tabla { font-size: 12.5px; }
    .pv-tabla td { padding: 6px 5px; }
    .pv-dia-largo { display: none; }
    .pv-dia-corto { display: inline; }
    .pv-fecha { font-size: 14px; }
    .pv-cabecera .gvp-acciones { width: 100%; }
}

/* ===== GVP: sugerencias para registrar en "Mis actividades" ===== */
.gvp-sugerencias .list-group-item { padding: 10px 14px; }
.gvp-sugerencia { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gvp-sugerencia > .flex-grow-1 { min-width: 0; flex: 1 1 200px; }
.gvp-sugerencia-destacada { background: var(--h-primary-soft); }
.gvp-sugerencia-futura { opacity: .85; }
.gvp-sugerencia-icono { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 44px; border-radius: 10px; background: var(--h-neutral-soft); color: var(--h-primary); }
@media (max-width: 575.98px) {
    .gvp-sugerencia .btn { width: 100%; }
}

/* ===== Alojamientos: nivel (evaluacion 1-10) en el listado ===== */
.htem-nivel { display: inline-flex; align-items: baseline; gap: 1px; min-width: 46px; justify-content: center; padding: 2px 9px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.htem-nivel small { font-size: 10px; font-weight: 600; opacity: .75; }
.htem-nivel-alto { background: var(--h-success-soft); color: var(--h-success); }
.htem-nivel-medio { background: var(--h-warning-soft); color: var(--h-warning); }
.htem-nivel-bajo { background: var(--h-danger-soft); color: var(--h-danger); }

/* ===== Usuarios: editar y ficha (usuarios/edit, usuarios/show) ===== */
.usr-editor { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.usr-ficha { position: sticky; top: 14px; margin-bottom: 0; }
.usr-secciones > .card:last-of-type { margin-bottom: 0; }
.usr-avatar { position: relative; width: 104px; height: 104px; border-radius: 50%; margin: 0 auto; overflow: hidden;
    background: linear-gradient(135deg, var(--h-primary), var(--h-primary-dark)); color: #fff; display: flex; align-items: center; justify-content: center; }
.usr-avatar-grande { width: 128px; height: 128px; box-shadow: 0 0 0 4px var(--h-primary-soft); }
.usr-avatar-iniciales { font-size: 40px; font-weight: 800; letter-spacing: .02em; }
.usr-avatar-grande .usr-avatar-iniciales { font-size: 46px; }
.usr-avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.usr-avatar-con-foto .usr-avatar-img { display: block; }
.usr-avatar-con-foto .usr-avatar-iniciales { visibility: hidden; }
.usr-input-foto { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.usr-btn-foto { cursor: pointer; }
.usr-ficha-nombre { font-size: 19px; font-weight: 800; color: var(--h-text); margin: 14px 0 6px; line-height: 1.25; word-break: break-word; }
.usr-ficha-rol { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--h-primary); background: var(--h-primary-soft); border-radius: 999px; padding: 3px 12px; }
.usr-ficha-email { color: var(--h-muted); font-size: 13.5px; margin: 8px 0; word-break: break-all; }
.usr-estado { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 2px 10px; }
.usr-estado i { font-size: 7px; }
.usr-estado-activo { color: var(--h-success); background: var(--h-success-soft); }
.usr-estado-inactivo { color: var(--h-danger); background: var(--h-danger-soft); }
.usr-ficha-datos .list-group-item { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 9px 16px; }
.usr-ficha-datos .list-group-item span { color: var(--h-muted); }
.usr-ficha-datos .list-group-item b { text-align: right; font-weight: 600; color: var(--h-text); word-break: break-word; }
.usr-ficha-botones { display: flex; gap: 8px; }
.usr-ficha-botones .btn { flex: 1 1 0; }
.usr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.usr-grid > .form-group { margin-bottom: 14px; }
.usr-grid .usr-ancho { grid-column: 1 / -1; }
.usr-grid label { font-weight: 600; }
.usr-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 22px; margin: 0; }
.usr-datos dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--h-placeholder); font-weight: 700; }
.usr-datos dd { margin: 3px 0 0; color: var(--h-text); }
.usr-acciones { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding: 12px 16px;
    background: var(--h-surface); border: 1px solid var(--h-border); border-radius: var(--h-radius); box-shadow: var(--h-shadow-lg); }
@media (max-width: 991.98px) {
    .usr-editor { grid-template-columns: 1fr; }
    .usr-ficha { position: static; }
}
@media (max-width: 575.98px) {
    .usr-grid { grid-template-columns: 1fr; }
    .usr-acciones .btn { flex: 1 1 0; }
}
/* Rol y Zona lado a lado; el contacto debajo a todo el ancho */
.usr-grid .usr-campo-rol { order: 1; }
.usr-grid .usr-campo-zona { order: 2; }
.usr-grid .usr-campo-contacto { order: 3; }
.usr-grid .col-form-label { padding-top: 0; padding-bottom: 0; margin-bottom: .5rem; font-weight: 600; line-height: 1.5; }

/* ===== Enlace de actualizacion de datos y cuentas pendientes de alta ===== */
.enl-cuenta { background: var(--h-neutral-soft); border-radius: var(--h-radius-sm); padding: 12px 14px; margin-bottom: 12px; }
.usr-estado-pendiente { color: var(--h-warning); background: var(--h-warning-soft); }
.usr-pendientes { border-left: 4px solid #E0A800; }
.usr-pendiente { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.usr-pendiente > .flex-grow-1 { min-width: 0; flex: 1 1 260px; }
.usr-alta { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 16px; padding: 14px 16px;
    background: var(--h-warning-soft); border: 1px solid #F1D9A6; border-radius: var(--h-radius); }
.usr-alta-texto { flex: 1 1 360px; min-width: 0; }
.usr-alta-texto > b { display: block; color: var(--h-warning); margin-bottom: 2px; }
.usr-alta-texto span { font-size: 13.5px; color: var(--h-text); }
.usr-alta-botones { display: flex; gap: 8px; }
.usr-alta-botones form { margin: 0; }
@media (max-width: 575.98px) { .usr-alta-botones { width: 100%; } .usr-alta-botones form { flex: 1 1 0; } .usr-alta-botones .btn { width: 100%; } }
