/* =====================================================================
   Humex - UI Platform (rediseño "HR Platform")
   ===================================================================== */

:root {
    --sidebar-width: 248px;
    --sidebar-width-collapsed: 72px;
    --sidebar-bg: #ffffff;
    --sidebar-text: #565A6B;
    --sidebar-text-muted: #AEB2C0;
    --sidebar-active-bg: #E4E7EF;
    --sidebar-active-text: #091230;
    --sidebar-hover-bg: #F7F7FA;
    --topbar-height: 60px;
    --content-bg: #F5F6F9;
    --surface-bg: #ffffff;
    --surface-muted: #FAFAFC;
    --text-color: #111427;
    --text-muted: #8B90A0;
    --text-faint: #AEB2C0;
    --border-color: #E7E9EF;
    --border-color-soft: #EEF0F4;
    --primary: #091230;
    --primary-dark: #05081C;
    --primary-soft: #E4E7EF;
    --success: #1C8A45;
    --success-bg: #EAF7EE;
    --warning: #B57A05;
    --warning-bg: #FFF6E8;
    --danger: #C0392B;
    --danger-bg: #FDECEC;
    --info: #091230;
    --radius-lg: 14px;
    --radius-md: 10px;
    --card-shadow: 0 1px 2px rgba(17, 20, 39, 0.04);
    --card-shadow-hover: 0 12px 32px rgba(20, 20, 43, 0.10);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    color: var(--text-color);
    background: var(--content-bg);
    overflow-x: hidden;
}

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

a:hover {
    color: var(--primary-dark);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: #D6D9E0;
    border-radius: 8px;
}

/* ─── Layout principal ─── */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.18s ease;
    min-width: 0;
}

.app-wrapper.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-width-collapsed);
}

.content-body {
    flex: 1;
    padding: 1.5rem;
    animation: fadeInUp 0.2s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0.65;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDrawer {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* ─── Sidebar ─── */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1040;
    transition: width 0.18s ease, transform 0.18s ease;
}

.app-wrapper.sidebar-collapsed .sidebar {
    width: var(--sidebar-width-collapsed);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color-soft);
    min-height: var(--topbar-height);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    text-decoration: none;
    min-width: 0;
}

.sidebar-brand:hover {
    color: var(--text-color);
}

.sidebar-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand-icon img {
    height: 28px;
    width: auto;
    display: block;
}

.sidebar-brand-text {
    font-family: 'Krona One', sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-wrapper.sidebar-collapsed .sidebar-brand-text,
.app-wrapper.sidebar-collapsed .sidebar-empresa,
.app-wrapper.sidebar-collapsed .sidebar-heading,
.app-wrapper.sidebar-collapsed .sidebar-link span,
.app-wrapper.sidebar-collapsed .sidebar-collapse-label {
    display: none !important;
}

.sidebar-empresa {
    padding: 0.55rem 1.1rem 0.8rem;
    border-bottom: 1px solid var(--border-color-soft);
}

.sidebar-empresa small {
    color: var(--text-muted) !important;
    font-weight: 500;
    font-size: 0.76rem;
}

#sidebarClose {
    color: var(--text-muted);
    display: none;
    margin-left: auto;
}

.sidebar-nav {
    list-style: none;
    padding: 0.5rem 0.65rem 1rem;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-heading {
    padding: 0.85rem 0.6rem 0.3rem;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
}

.sidebar-item {
    margin: 1px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 500;
    border-radius: 9px;
    transition: background-color 0.14s ease, color 0.14s ease;
    white-space: nowrap;
}

.app-wrapper.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 0;
}

.sidebar-link:hover {
    background-color: var(--sidebar-hover-bg);
    color: var(--text-color);
}

.sidebar-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.sidebar-link i {
    font-size: 1.05rem;
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color-soft);
    padding: 8px;
    flex-shrink: 0;
}

.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 34px;
    padding: 0 8px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
}

.sidebar-collapse-btn:hover {
    background: var(--sidebar-hover-bg);
}

.sidebar-collapse-btn i {
    font-size: 1rem;
    transition: transform 0.18s ease;
}

.app-wrapper.sidebar-collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

/* ─── Topbar ─── */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--topbar-height);
    padding: 0 20px;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-bg);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-shrink: 0;
}

.topbar-toggler {
    font-size: 1.15rem;
    color: var(--text-muted);
    border-radius: 9px;
    padding: 0.3rem 0.5rem;
    border: none;
    background: transparent;
}

.topbar-toggler:hover {
    background: var(--sidebar-hover-bg);
    color: var(--text-color);
}

.topbar-breadcrumb {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-search {
    flex: 1;
    min-width: 0;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--surface-muted);
    padding: 0 12px;
    cursor: pointer;
    color: var(--text-faint);
}

.topbar-search span {
    font-size: 13px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-search kbd {
    font-size: 10.5px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 1px 6px;
    color: var(--text-faint);
    background: transparent;
    flex-shrink: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--sidebar-text);
    position: relative;
    border: none;
    background: transparent;
}

.topbar-icon-btn:hover {
    background: var(--sidebar-hover-bg);
}

.topbar-icon-btn .notif-dot {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
    border: 1.5px solid #fff;
    display: none;
}

.topbar-icon-btn.has-unread .notif-dot {
    display: block;
}

.topbar-icon-btn .notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    border: 1.5px solid #fff;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
    display: none;
}

.topbar-icon-btn.has-unread .notif-badge {
    display: block;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: transparent;
    padding: 4px 8px 4px 4px;
    border-radius: 20px;
}

.topbar-user:hover {
    background: var(--sidebar-hover-bg);
}

.topbar-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

.topbar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow-hover);
}

/* ─── Command palette ─── */

.cmdk-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 18, 35, 0.45);
    z-index: 1100;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}

.cmdk-overlay.show {
    display: flex;
    animation: fadeIn 0.12s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cmdk-modal {
    width: 560px;
    max-width: 90vw;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(10, 10, 30, 0.3);
    overflow: hidden;
}

.cmdk-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color-soft);
}

.cmdk-input-row input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 15px;
}

.cmdk-results {
    max-height: 340px;
    overflow-y: auto;
    padding: 8px;
}

.cmdk-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 9px;
    cursor: pointer;
    color: #222;
    font-size: 13.5px;
}

.cmdk-item:hover,
.cmdk-item.active {
    background: var(--sidebar-hover-bg);
}

.cmdk-item i {
    color: var(--text-muted);
    flex-shrink: 0;
}

.cmdk-item .cmdk-hint {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--text-faint);
}

.cmdk-empty {
    padding: 24px 12px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ─── Drawer / Offcanvas genérico ─── */

.offcanvas {
    border: none !important;
}

.offcanvas-header {
    border-bottom: 1px solid var(--border-color-soft);
    padding: 18px 20px;
}

.offcanvas-title {
    font-size: 15.5px;
    font-weight: 700;
}

.offcanvas-body {
    padding: 20px;
}

.drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color-soft);
    display: flex;
    gap: 10px;
}

.notif-drawer .offcanvas-body {
    padding: 0;
}

.notif-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color-soft);
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.notif-item:hover {
    background: var(--surface-muted);
    color: inherit;
}

.notif-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-unread-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 4px;
    flex-shrink: 0;
}

/* ─── KPI / stat cards ─── */

.kpi-card {
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.kpi-card-watermark {
    position: absolute;
    right: 0px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 85px;
    line-height: 1;
    color: #e7e9f05c;
    pointer-events: none;
}

/* Deja libre el lado del ícono grande para que el texto nunca lo cruce
   en las tarjetas angostas (4 por fila en pantallas anchas). */
.kpi-card--watermarked {
    padding-right: 76px;
}

.kpi-card > *:not(.kpi-card-watermark) {
    position: relative;
    z-index: 1;
}

.kpi-label {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.kpi-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-color);
    margin-top: 8px;
}

.kpi-delta {
    font-size: 12px;
    font-weight: 700;
}

.kpi-compare {
    font-size: 11.5px;
    color: var(--text-faint);
    margin-top: 2px;
}

.stat-card {
    border-radius: var(--radius-lg);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ─── Cards generales ─── */

.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--surface-bg);
    box-shadow: var(--card-shadow);
}

.card-header {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    border-bottom: 1px solid var(--border-color-soft) !important;
    background: var(--surface-muted) !important;
    padding: 0.9rem 1.1rem;
}

.card-body {
    padding: 1.1rem 1.15rem;
}

/* ─── Tabs (perfil, wizard) ─── */

.nav-tabs {
    border-bottom: 1px solid var(--border-color);
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    font-weight: 700;
    border-bottom-color: var(--primary);
    background: transparent;
}

/* ─── Wizard / stepper ─── */

.wizard-steps {
    display: flex;
    align-items: center;
}

.wizard-step {
    display: flex;
    align-items: center;
    flex: 1;
}

.wizard-step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 700;
    border: 1.5px solid var(--border-color);
    background: var(--surface-muted);
    color: var(--text-faint);
    flex-shrink: 0;
}

.wizard-step.done .wizard-step-circle {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.wizard-step.active .wizard-step-circle {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary);
}

.wizard-step-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-faint);
    white-space: nowrap;
    margin-left: 8px;
}

.wizard-step.done .wizard-step-label,
.wizard-step.active .wizard-step-label {
    color: var(--text-color);
}

.wizard-step-line {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    margin: 0 8px;
}

.wizard-step.done .wizard-step-line {
    background: var(--primary);
}

/* ─── Kanban (Reclutamiento) ─── */

.kanban-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.kanban-column {
    min-width: 230px;
    flex-shrink: 0;
    background: var(--surface-muted);
    border: 1px solid var(--border-color-soft);
    border-radius: var(--radius-lg);
    padding: 12px;
}

.kanban-column.drag-over {
    outline: 2px dashed var(--primary);
    outline-offset: -2px;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 4px;
}

.kanban-column-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #333;
}

.kanban-column-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--border-color-soft);
    border-radius: 10px;
    padding: 1px 7px;
}

.kanban-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    padding: 12px;
    cursor: grab;
    margin-bottom: 8px;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card.dragging {
    opacity: 0.5;
}

/* ─── Calendario (Vacaciones) ─── */

.mini-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.mini-calendar-cell {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border-radius: 8px;
    color: #333;
}

.mini-calendar-cell.today {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.mini-calendar-cell.has-vac {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
    border: 1px solid #D9D6FA;
}

.mini-calendar-cell.selected {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
    font-weight: 700;
}

.mini-calendar-nav {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    flex-shrink: 0;
}

.mini-calendar-nav:hover {
    background: var(--surface-muted);
    color: var(--text-color);
}

/* ─── Avatares iniciales ─── */

.avatar-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 700;
    flex-shrink: 0;
}

.avatar-initials.lg {
    width: 64px;
    height: 64px;
    font-size: 20px;
}

/* ─── Foto de perfil (cuadrada) ─── */

.avatar-photo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-photo.lg {
    width: 64px;
    height: 64px;
    border-radius: 12px;
}

.avatar-photo-upload {
    width: 88px;
    height: 88px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--border-color-soft);
    background: var(--primary-soft);
    flex-shrink: 0;
}

/* ─── Tablas ─── */

.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom-width: 1px;
    border-color: var(--border-color-soft);
    white-space: nowrap;
    background-color: var(--surface-muted);
}

.table td {
    vertical-align: middle;
    font-size: 0.85rem;
    color: #333;
    border-color: var(--border-color-soft);
}

.table-hover tbody tr:hover {
    background-color: var(--surface-muted);
}

/* ─── Badges de estado ─── */

.badge {
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.01em;
}

.badge-activo, .badge-aprobada, .badge-ok { background-color: var(--success-bg); color: var(--success); }
.badge-inactivo { background-color: var(--border-color-soft); color: var(--text-muted); }
.badge-pendiente { background-color: var(--warning-bg); color: var(--warning); }
.badge-rechazada { background-color: var(--danger-bg); color: var(--danger); }
.badge-suspendido { background-color: #F1EEFE; color: #6C3FD6; }
.badge-retirado { background-color: var(--border-color-soft); color: var(--text-muted); }
.badge-en_proceso { background-color: var(--primary-soft); color: var(--primary); }

/* ─── Footer ─── */

.main-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--surface-bg);
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ─── Sidebar overlay (mobile) ─── */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(6, 12, 33, 0.45);
    z-index: 1035;
}

/* ─── Formularios ─── */

.form-label {
    font-weight: 600;
    font-size: 0.83rem;
    color: #4A4E5C;
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    border-radius: 9px;
    border-color: var(--border-color);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(9, 18, 48, 0.6);
    box-shadow: 0 0 0 0.2rem rgba(9, 18, 48, 0.12);
}

/* ─── Botones ─── */

.btn {
    font-size: 0.85rem;
    border-radius: 9px;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-watermark {
    position: relative;
    overflow: hidden;
}

.btn-watermark-icon {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 64px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

.btn-watermark-label {
    position: relative;
    z-index: 1;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-light {
    background-color: var(--surface-muted);
    border-color: var(--border-color);
    color: #425279;
}

.btn-light:hover {
    background-color: #EEF0F4;
    border-color: var(--border-color);
    color: #2f457f;
}

/* ─── DataTables override (DataTables 2.x usa el prefijo dt-, no dataTables_) ─── */

.dt-search input,
.dt-length select {
    border: 1px solid var(--border-color);
    border-radius: 9px;
    padding: 0.34rem 0.7rem;
}

.dt-length select {
    padding-right: 2.25rem;
}

.dt-container.dt-bootstrap5 {
    padding: 16px;
}

.dt-container .dt-info {
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 14px !important;
}

.dt-container .dt-paging {
    padding-top: 10px !important;
}

.dt-container .dt-paging .pagination {
    gap: 5px;
}

.dt-container .dt-paging .page-link {
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    background: var(--surface-bg) !important;
    color: var(--text-muted) !important;
    padding: 0 8px !important;
    font-size: 12.5px;
    box-shadow: none !important;
}

.dt-container .dt-paging .page-item:not(.active):not(.disabled) .page-link:hover {
    background: var(--surface-muted) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}

.dt-container .dt-paging .page-item.active .page-link {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    font-weight: 600;
}

.dt-container .dt-paging .page-item.disabled .page-link {
    color: var(--text-faint) !important;
    background: var(--surface-bg) !important;
    border-color: var(--border-color-soft) !important;
    opacity: 0.6;
}

.dt-container .dt-paging .page-link span[aria-hidden] {
    font-size: 16px;
    line-height: 1;
}

/* Tabla con búsqueda/filtros propios: oculta el buscador y el selector
   de longitud nativos de DataTables sin afectar otras instancias. */
.datatable-custom-controls .dt-search,
.datatable-custom-controls .dt-length {
    display: none !important;
}

/* ─── Select2 override ─── */

.select2-container--bootstrap-5 .select2-selection {
    border-color: var(--border-color);
    border-radius: 9px;
}

/* ─── Page header ─── */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.3rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h4 {
    margin: 0;
    font-weight: 800;
    color: var(--text-color);
}

/* ─── Portal layout polish ─── */

.navbar.navbar-light.bg-white {
    border-bottom: 1px solid var(--border-color) !important;
    background: var(--surface-bg) !important;
}

main.container.py-4 {
    animation: fadeInUp 0.2s ease;
}

/* ─── Responsive ─── */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    #sidebarClose {
        display: block;
    }

    .main-content,
    .app-wrapper.sidebar-collapsed .main-content {
        margin-left: 0;
    }

    .app-wrapper.sidebar-collapsed .sidebar-link span,
    .app-wrapper.sidebar-collapsed .sidebar-brand-text,
    .app-wrapper.sidebar-collapsed .sidebar-empresa,
    .app-wrapper.sidebar-collapsed .sidebar-heading {
        display: revert !important;
    }

    .topbar-search {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .content-body {
        padding: 1rem;
    }

    .topbar {
        padding: 0 0.9rem;
    }

    .cmdk-overlay {
        padding-top: 4vh;
    }
}

/* ─── Utilidades ─── */

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.min-w-0 {
    min-width: 0;
}

/* ─── Overlay de carga (icono de marca animado) ─── */
.hx-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(9, 18, 48, 0.72);
    backdrop-filter: blur(2px);
}

.hx-loading-overlay[hidden] {
    display: none;
}

.hx-loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
    padding: 32px;
}

.hx-loading-icon {
    width: 64px;
    height: 64px;
    animation: hx-loading-pulse 1.1s ease-in-out infinite;
}

@keyframes hx-loading-pulse {
    0%, 100% {
        transform: scale(0.85);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

.hx-loading-message {
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    max-width: 320px;
    line-height: 1.4;
}

.hx-loading-submessage {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12.5px;
    max-width: 320px;
    line-height: 1.4;
}

.hx-loading-progress-wrap {
    width: 260px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.hx-loading-progress-bar {
    height: 100%;
    width: 0%;
    background: #4f7cff;
    border-radius: 999px;
    transition: width .1s linear;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.hx-loading-progress-pct {
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .02em;
}

/* ─── Tarjetas de trámites (Portal → Mis Solicitudes) ─── */
.tramite-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--surface-bg);
    border: 1px solid var(--border-color-soft);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-color);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    height: 100%;
}

.tramite-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-1px);
    color: var(--text-color);
}

.tramite-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.tramite-card-titulo {
    font-size: 13px;
    font-weight: 600;
    flex: 1;
    line-height: 1.3;
}

.tramite-card-arrow {
    color: var(--text-faint);
    font-size: 14px;
    flex-shrink: 0;
}
