/**
 * ============================================================================
 * HEROUI DESIGN SYSTEM (CSS & COMPONENT SUITE)
 * Inspired by HeroUI (formerly NextUI) - Beautiful, Fast, and Modern
 * Constructora Fernández SPA (F&U)
 * ============================================================================
 */

:root {
    /* HeroUI Color Tokens */
    --heroui-primary: #006FEE;
    --heroui-primary-hover: #005bc4;
    --heroui-primary-50: #e6f1fe;
    --heroui-primary-100: #cce3fd;
    --heroui-primary-200: #99c7fb;
    --heroui-primary-500: #006FEE;
    --heroui-primary-600: #005bc4;

    --heroui-secondary: #7828C8;
    --heroui-success: #17C964;
    --heroui-success-50: #e8faf0;
    --heroui-warning: #F5A524;
    --heroui-warning-50: #fef4e6;
    --heroui-danger: #F31260;
    --heroui-danger-50: #fee7ef;
    
    --heroui-brand-yellow: #FFC107;
    --heroui-brand-amber: #F6931E;

    /* HeroUI Neutral Scale */
    --heroui-default-50: #fafafa;
    --heroui-default-100: #f4f4f5;
    --heroui-default-200: #e4e4e7;
    --heroui-default-300: #d4d4d8;
    --heroui-default-400: #a1a1aa;
    --heroui-default-500: #71717a;
    --heroui-default-600: #52525b;
    --heroui-default-700: #3f3f46;
    --heroui-default-800: #27272a;
    --heroui-default-900: #18181b;

    /* HeroUI Surface Surfaces */
    --heroui-background: #f8fafc;
    --heroui-content1: #ffffff;
    --heroui-content2: #f4f4f5;
    --heroui-content3: #e4e4e7;
    --heroui-content4: #d4d4d8;
    --heroui-divider: rgba(0, 0, 0, 0.08);

    /* HeroUI Radii */
    --heroui-radius-sm: 8px;
    --heroui-radius-md: 12px;
    --heroui-radius-lg: 16px;
    --heroui-radius-xl: 20px;
    --heroui-radius-2xl: 24px;
    --heroui-radius-full: 9999px;

    /* HeroUI Diffused Shadows */
    --heroui-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --heroui-shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.06), 0 1px 3px -1px rgba(0, 0, 0, 0.04);
    --heroui-shadow-md: 0 8px 20px -4px rgba(0, 0, 0, 0.07), 0 4px 8px -2px rgba(0, 0, 0, 0.03);
    --heroui-shadow-lg: 0 16px 32px -6px rgba(0, 0, 0, 0.09), 0 8px 16px -4px rgba(0, 0, 0, 0.04);
    --heroui-shadow-xl: 0 24px 48px -12px rgba(0, 0, 0, 0.14);

    /* Transitions */
    --heroui-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --heroui-transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --heroui-transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   1. GLOBAL HEROUI STYLING & TYPOGRAPHY
   ============================================================================ */
body {
    background-color: var(--heroui-background) !important;
    font-family: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--heroui-default-900);
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
    letter-spacing: -0.025em !important;
    font-weight: 700;
}

/* ============================================================================
   2. HEROUI CARDS (.card & .heroui-card)
   ============================================================================ */
.card, .heroui-card {
    background-color: var(--heroui-content1) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-radius: var(--heroui-radius-xl) !important;
    box-shadow: var(--heroui-shadow-sm) !important;
    transition: transform var(--heroui-transition-normal), box-shadow var(--heroui-transition-normal), border-color var(--heroui-transition-normal) !important;
    overflow: hidden;
}

.card:hover, .heroui-card:hover {
    box-shadow: var(--heroui-shadow-md) !important;
}

.card-header, .heroui-card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--heroui-divider) !important;
    padding: 1.1rem 1.4rem !important;
    font-weight: 700;
}

.card-body, .heroui-card-body {
    padding: 1.4rem !important;
}

.card-footer, .heroui-card-footer {
    background: transparent !important;
    border-top: 1px solid var(--heroui-divider) !important;
    padding: 1rem 1.4rem !important;
}

/* HeroUI Card Blurred / Glassmorphism */
.heroui-card-blur, .card-glass {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: var(--heroui-shadow-md) !important;
}

/* ============================================================================
   3. HEROUI BUTTONS (.btn & .heroui-btn)
   ============================================================================ */
.btn, .heroui-btn {
    border-radius: var(--heroui-radius-md) !important;
    font-weight: 600 !important;
    font-size: 0.885rem !important;
    padding: 0.55rem 1.15rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s ease, background-color 0.2s ease, border-color 0.2s ease !important;
    position: relative;
    user-select: none;
    line-height: 1.35;
}

/* HeroUI Signature Micro-Interaction: Press Scale Down */
.btn:active, .heroui-btn:active {
    transform: scale(0.97) !important;
}

/* Primary Button (HeroUI Solid) */
.btn-primary {
    background-color: var(--heroui-primary) !important;
    border-color: var(--heroui-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px 0 rgba(0, 111, 238, 0.35) !important;
}

.btn-primary:hover {
    background-color: var(--heroui-primary-hover) !important;
    border-color: var(--heroui-primary-hover) !important;
    box-shadow: 0 6px 20px rgba(0, 111, 238, 0.45) !important;
    transform: translateY(-1px);
}

/* Secondary Button */
.btn-secondary {
    background-color: var(--heroui-default-200) !important;
    border-color: transparent !important;
    color: var(--heroui-default-800) !important;
}

.btn-secondary:hover {
    background-color: var(--heroui-default-300) !important;
    color: var(--heroui-default-900) !important;
}

/* Success Button */
.btn-success {
    background-color: var(--heroui-success) !important;
    border-color: var(--heroui-success) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px 0 rgba(23, 201, 100, 0.35) !important;
}

.btn-success:hover {
    filter: brightness(0.95);
    box-shadow: 0 6px 20px rgba(23, 201, 100, 0.45) !important;
    transform: translateY(-1px);
}

/* Warning Button */
.btn-warning {
    background-color: var(--heroui-warning) !important;
    border-color: var(--heroui-warning) !important;
    color: #000000 !important;
    box-shadow: 0 4px 14px 0 rgba(245, 165, 36, 0.35) !important;
}

.btn-warning:hover {
    filter: brightness(0.95);
    box-shadow: 0 6px 20px rgba(245, 165, 36, 0.45) !important;
    transform: translateY(-1px);
}

/* Danger Button */
.btn-danger {
    background-color: var(--heroui-danger) !important;
    border-color: var(--heroui-danger) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px 0 rgba(243, 18, 96, 0.35) !important;
}

.btn-danger:hover {
    filter: brightness(0.95);
    box-shadow: 0 6px 20px rgba(243, 18, 96, 0.45) !important;
    transform: translateY(-1px);
}

/* Outline Buttons (HeroUI Bordered) */
.btn-outline-primary {
    border: 2px solid var(--heroui-primary) !important;
    color: var(--heroui-primary) !important;
    background: transparent !important;
}

.btn-outline-primary:hover {
    background-color: var(--heroui-primary-50) !important;
    color: var(--heroui-primary) !important;
}

.btn-outline-secondary {
    border: 1.5px solid var(--heroui-default-300) !important;
    color: var(--heroui-default-700) !important;
    background: transparent !important;
}

.btn-outline-secondary:hover {
    background-color: var(--heroui-default-100) !important;
    border-color: var(--heroui-default-400) !important;
    color: var(--heroui-default-900) !important;
}

/* Light / Flat Buttons */
.btn-light {
    background-color: var(--heroui-default-100) !important;
    border-color: transparent !important;
    color: var(--heroui-default-800) !important;
}

.btn-light:hover {
    background-color: var(--heroui-default-200) !important;
    color: var(--heroui-default-900) !important;
}

/* Button Sizing */
.btn-sm, .heroui-btn-sm {
    padding: 0.35rem 0.75rem !important;
    font-size: 0.8rem !important;
    border-radius: var(--heroui-radius-sm) !important;
}

.btn-lg, .heroui-btn-lg {
    padding: 0.75rem 1.6rem !important;
    font-size: 1.05rem !important;
    border-radius: var(--heroui-radius-lg) !important;
}

/* ============================================================================
   4. HEROUI CHIPS & BADGES (.badge & .heroui-chip)
   ============================================================================ */
.badge, .heroui-chip {
    font-family: 'Inter', sans-serif !important;
    border-radius: var(--heroui-radius-full) !important;
    padding: 0.35em 0.75em !important;
    font-weight: 600 !important;
    font-size: 0.76rem !important;
    letter-spacing: 0.01em !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    line-height: 1.25 !important;
    transition: all var(--heroui-transition-fast) !important;
}

/* HeroUI Flat / Pastel Variants */
.badge.bg-primary, .badge-primary-flat {
    background-color: var(--heroui-primary-50) !important;
    color: var(--heroui-primary) !important;
    border: 1px solid var(--heroui-primary-100) !important;
}

.badge.bg-success, .badge-success-flat {
    background-color: var(--heroui-success-50) !important;
    color: #0e8642 !important;
    border: 1px solid #b7f4cb !important;
}

.badge.bg-warning, .badge-warning-flat {
    background-color: var(--heroui-warning-50) !important;
    color: #925403 !important;
    border: 1px solid #fddfb2 !important;
}

.badge.bg-danger, .badge-danger-flat {
    background-color: var(--heroui-danger-50) !important;
    color: #b50742 !important;
    border: 1px solid #fec0d4 !important;
}

.badge.bg-secondary, .badge-secondary-flat {
    background-color: var(--heroui-default-100) !important;
    color: var(--heroui-default-700) !important;
    border: 1px solid var(--heroui-default-200) !important;
}

/* ============================================================================
   5. HEROUI FORM CONTROLS (.form-control, .form-select, .input-group, switches)
   ============================================================================ */
.form-control, .form-select, .heroui-input {
    border-radius: var(--heroui-radius-md) !important;
    border: 1.5px solid var(--heroui-default-200) !important;
    background-color: #ffffff !important;
    color: var(--heroui-default-900) !important;
    padding: 0.55rem 0.9rem !important;
    font-size: 0.875rem !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
    transition: border-color var(--heroui-transition-fast), box-shadow var(--heroui-transition-fast), background-color var(--heroui-transition-fast), transform 0.15s ease !important;
}

.form-control::placeholder, .heroui-input::placeholder {
    color: var(--heroui-default-400, #a1a1aa) !important;
    opacity: 1 !important;
    font-size: 0.85rem !important;
}

.form-control:hover, .form-select:hover {
    border-color: var(--heroui-default-400) !important;
}

.form-control:focus, .form-select:focus, .heroui-input:focus {
    border-color: var(--heroui-primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 111, 238, 0.18) !important;
    background-color: #ffffff !important;
    outline: none !important;
}

.form-control:disabled, .form-select:disabled, .form-control[readonly] {
    background-color: var(--heroui-default-100, #f4f4f5) !important;
    border-color: var(--heroui-default-200, #e4e4e7) !important;
    color: var(--heroui-default-500, #71717a) !important;
    cursor: not-allowed !important;
    opacity: 0.78 !important;
}

/* HeroUI Input Sizes */
.form-control-sm, .form-select-sm, .heroui-input-sm {
    padding: 0.32rem 0.72rem !important;
    font-size: 0.8125rem !important;
    min-height: 32px !important;
    border-radius: var(--heroui-radius-sm, 8px) !important;
    line-height: 1.35 !important;
}

.form-control-lg, .form-select-lg, .heroui-input-lg {
    padding: 0.75rem 1.15rem !important;
    font-size: 1rem !important;
    min-height: 48px !important;
    border-radius: var(--heroui-radius-lg, 14px) !important;
}

/* HeroUI Custom Select Chevron */
.form-select {
    padding-right: 2.25rem !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2371717a' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 14px 10px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

/* HeroUI Textarea */
textarea.form-control, textarea.heroui-input {
    min-height: 85px;
    resize: vertical;
}

/* HeroUI Seamless Input Groups */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.85rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: var(--heroui-default-600) !important;
    background-color: var(--heroui-default-50, #fafafa) !important;
    border: 1.5px solid var(--heroui-default-200) !important;
    border-radius: var(--heroui-radius-md) !important;
    transition: border-color var(--heroui-transition-fast), background-color var(--heroui-transition-fast) !important;
}

.input-group-sm > .input-group-text,
.input-group-sm > .form-control,
.input-group-sm > .form-select {
    padding: 0.32rem 0.72rem !important;
    font-size: 0.8125rem !important;
    min-height: 32px !important;
    border-radius: var(--heroui-radius-sm, 8px) !important;
}

.input-group-lg > .input-group-text,
.input-group-lg > .form-control,
.input-group-lg > .form-select {
    padding: 0.75rem 1.15rem !important;
    font-size: 1rem !important;
    min-height: 48px !important;
    border-radius: var(--heroui-radius-lg, 14px) !important;
}

/* Joined corners inside input-group to prevent rounded gaps */
.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    margin-left: -1.5px !important;
}

.input-group > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group .form-control:focus,
.input-group .form-select:focus {
    z-index: 5 !important;
}

/* Standardized HeroUI Form Labels & Helper Text */
.form-label-heroui,
.form-label {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: var(--heroui-default-700) !important;
    letter-spacing: 0.015em;
    margin-bottom: 0.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.form-label-heroui .req,
.form-label .text-danger,
.form-label-required {
    color: var(--heroui-danger, #f31260) !important;
    font-weight: 700;
}

.form-text,
.heroui-helper-text {
    font-size: 0.76rem !important;
    color: var(--heroui-default-500) !important;
    margin-top: 0.3rem !important;
    display: block;
}

/* HeroUI Checkboxes & Radios */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.5rem;
    padding-left: 0 !important;
    margin-bottom: 0.35rem;
}

.form-check-input {
    width: 1.18rem !important;
    height: 1.18rem !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    float: none !important;
    vertical-align: middle !important;
    background-color: #ffffff !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    border: 2px solid var(--heroui-default-300, #d4d4d8) !important;
    border-radius: 6px !important;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

.form-check-input:hover {
    border-color: var(--heroui-default-500, #71717a) !important;
    background-color: var(--heroui-default-50, #fafafa) !important;
}

.form-check-input:checked {
    background-color: var(--heroui-primary, #006fee) !important;
    border-color: var(--heroui-primary, #006fee) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") !important;
    transform: scale(1.05);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(0, 111, 238, 0.18) !important;
    outline: none !important;
}

.form-check-input[type="radio"] {
    border-radius: 50% !important;
}

.form-check-input[type="radio"]:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e") !important;
}

.form-check-label {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: var(--heroui-default-700) !important;
    cursor: pointer !important;
    user-select: none !important;
}

/* HeroUI Switches (.form-switch) */
.form-switch {
    padding-left: 0 !important;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.form-switch .form-check-input {
    width: 2.6rem !important;
    height: 1.45rem !important;
    margin-left: 0 !important;
    border-radius: 9999px !important;
    background-color: var(--heroui-default-200, #e4e4e7) !important;
    border: 2px solid transparent !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important;
    background-position: left 2px center !important;
    background-size: 1.15rem 1.15rem !important;
    transition: background-position 0.22s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.22s ease !important;
}

.form-switch .form-check-input:hover {
    background-color: var(--heroui-default-300, #d4d4d8) !important;
}

.form-switch .form-check-input:checked {
    background-color: var(--heroui-primary, #006fee) !important;
    background-position: right 2px center !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important;
    transform: none !important;
}

/* HeroUI File Selector Button */
.form-control[type="file"] {
    padding: 0.4rem 0.6rem !important;
    cursor: pointer;
}

.form-control[type="file"]::file-selector-button {
    padding: 0.35rem 0.85rem !important;
    margin: -0.2rem 0.75rem -0.2rem -0.4rem !important;
    background-color: var(--heroui-default-100, #f4f4f5) !important;
    color: var(--heroui-default-800, #27272a) !important;
    border: 1px solid var(--heroui-default-200, #e4e4e7) !important;
    border-radius: var(--heroui-radius-sm, 8px) !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.form-control[type="file"]::file-selector-button:hover {
    background-color: var(--heroui-default-200, #e4e4e7) !important;
    color: var(--heroui-default-900, #111827) !important;
}

/* HeroUI Validation States */
.form-control.is-invalid, .was-validated .form-control:invalid,
.form-select.is-invalid, .was-validated .form-select:invalid {
    border-color: var(--heroui-danger, #f31260) !important;
    background-color: rgba(243, 18, 96, 0.02) !important;
}

.form-control.is-invalid:focus, .was-validated .form-control:invalid:focus,
.form-select.is-invalid:focus, .was-validated .form-select:invalid:focus {
    box-shadow: 0 0 0 3px rgba(243, 18, 96, 0.18) !important;
    border-color: var(--heroui-danger, #f31260) !important;
}

.invalid-feedback {
    display: block;
    font-size: 0.76rem !important;
    font-weight: 500 !important;
    color: var(--heroui-danger, #f31260) !important;
    margin-top: 0.3rem !important;
}

.form-control.is-valid, .was-validated .form-control:valid,
.form-select.is-valid, .was-validated .form-select:valid {
    border-color: var(--heroui-success, #17c964) !important;
}

.form-control.is-valid:focus, .was-validated .form-control:valid:focus,
.form-select.is-valid:focus, .was-validated .form-select:valid:focus {
    box-shadow: 0 0 0 3px rgba(23, 201, 100, 0.18) !important;
    border-color: var(--heroui-success, #17c964) !important;
}

.valid-feedback {
    display: block;
    font-size: 0.76rem !important;
    font-weight: 500 !important;
    color: var(--heroui-success, #17c964) !important;
    margin-top: 0.3rem !important;
}

/* Floating labels */
.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.25rem + 2px) !important;
    padding: 1rem 0.85rem !important;
    border-radius: var(--heroui-radius-md) !important;
}

.form-floating > label {
    font-size: 0.85rem !important;
    color: var(--heroui-default-500) !important;
    padding: 0.85rem 0.85rem !important;
}

/* HeroUI Form Section Cards */
.heroui-form-card {
    background: #ffffff;
    border: 1px solid var(--heroui-default-200);
    border-radius: var(--heroui-radius-xl, 16px);
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    margin-bottom: 1.5rem;
}

.heroui-form-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--heroui-default-900);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.heroui-form-section-subtitle {
    font-size: 0.8rem;
    color: var(--heroui-default-500);
    margin-bottom: 1.25rem;
}

/* Dark Mode Overrides for Form Controls */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .heroui-input,
html.dark .form-control,
html.dark .form-select,
html.dark .heroui-input {
    background-color: #161e31 !important;
    border-color: #2e3b52 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .heroui-input:focus,
html.dark .form-control:focus,
html.dark .form-select:focus,
html.dark .heroui-input:focus {
    background-color: #1a233a !important;
    border-color: var(--heroui-primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 111, 238, 0.25) !important;
}

[data-theme="dark"] .form-control:hover,
[data-theme="dark"] .form-select:hover,
html.dark .form-control:hover,
html.dark .form-select:hover {
    border-color: #475569 !important;
}

[data-theme="dark"] .form-control::placeholder,
html.dark .form-control::placeholder {
    color: #64748b !important;
}

[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-select:disabled,
html.dark .form-control:disabled,
html.dark .form-select:disabled {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
    color: #475569 !important;
}

[data-theme="dark"] .form-select,
html.dark .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
}

[data-theme="dark"] .input-group-text,
html.dark .input-group-text {
    background-color: #0f172a !important;
    border-color: #2e3b52 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .form-check-input,
html.dark .form-check-input {
    background-color: #161e31 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .form-check-input:checked,
html.dark .form-check-input:checked {
    background-color: var(--heroui-primary, #006fee) !important;
    border-color: var(--heroui-primary, #006fee) !important;
}

[data-theme="dark"] .form-check-label,
html.dark .form-check-label {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .form-switch .form-check-input,
html.dark .form-switch .form-check-input {
    background-color: #334155 !important;
}

[data-theme="dark"] .form-switch .form-check-input:checked,
html.dark .form-switch .form-check-input:checked {
    background-color: var(--heroui-primary, #006fee) !important;
}

[data-theme="dark"] .form-control[type="file"]::file-selector-button,
html.dark .form-control[type="file"]::file-selector-button {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .form-control[type="file"]::file-selector-button:hover,
html.dark .form-control[type="file"]::file-selector-button:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .heroui-form-card,
html.dark .heroui-form-card {
    background: #161e31 !important;
    border-color: #26334d !important;
}

[data-theme="dark"] .heroui-form-section-title,
html.dark .heroui-form-section-title {
    color: #f8fafc !important;
}

[data-theme="dark"] .heroui-form-section-subtitle,
html.dark .heroui-form-section-subtitle {
    color: #94a3b8 !important;
}

[data-theme="dark"] .form-label-heroui,
[data-theme="dark"] .form-label,
html.dark .form-label-heroui,
html.dark .form-label {
    color: var(--heroui-default-300, #cbd5e1) !important;
}

[data-theme="contrast"] .form-control,
[data-theme="contrast"] .form-select,
[data-theme="contrast"] .heroui-input,
[data-theme="contrast"] .input-group-text,
[data-theme="contrast"] .heroui-form-card {
    background-color: #000000 !important;
    border-color: #FFC107 !important;
    color: #ffffff !important;
}

[data-theme="contrast"] .form-label-heroui,
[data-theme="contrast"] .form-label,
[data-theme="contrast"] .form-check-label,
[data-theme="contrast"] .heroui-form-section-title {
    color: #FFC107 !important;
}

[data-theme="contrast"] .form-check-input:checked {
    background-color: #FFC107 !important;
    border-color: #FFC107 !important;
}

/* ============================================================================
   6. HEROUI MODALS & BACKDROP BLUR
   ============================================================================ */
.modal-backdrop.show {
    backdrop-filter: blur(12px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(160%) !important;
    background-color: rgba(15, 23, 42, 0.48) !important;
    opacity: 1 !important;
    transition: opacity 0.25s ease !important;
}

.modal-content, .heroui-modal, .heroui-modal-content {
    border-radius: var(--heroui-radius-2xl) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: var(--heroui-shadow-xl) !important;
    background: #ffffff !important;
    overflow: hidden;
}
[data-theme="dark"] .modal-content,
[data-theme="dark"] .heroui-modal,
[data-theme="dark"] .heroui-modal-content {
    background-color: #161e31 !important;
    border-color: #26334d !important;
}
[data-theme="contrast"] .modal-content,
[data-theme="contrast"] .heroui-modal,
[data-theme="contrast"] .heroui-modal-content {
    background-color: #000000 !important;
    border: 2px solid #FFC107 !important;
}

.modal-header {
    border-bottom: 1px solid var(--heroui-divider) !important;
    padding: 1.25rem 1.5rem !important;
}

.modal-body {
    padding: 1.5rem !important;
}

.modal-footer {
    border-top: 1px solid var(--heroui-divider) !important;
    padding: 1.15rem 1.5rem !important;
    background-color: var(--heroui-default-50) !important;
}
[data-theme="dark"] .modal-footer {
    background-color: #121929 !important;
    border-top-color: #222f46 !important;
}
[data-theme="contrast"] .modal-footer {
    background-color: #000000 !important;
    border-top-color: #FFC107 !important;
}

/* HeroUI Modal Icon Badge */
.heroui-modal-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--heroui-radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

/* HeroUI Confirm Icon for Destructive Modals */
.heroui-confirm-icon-danger {
    width: 56px;
    height: 56px;
    border-radius: var(--heroui-radius-full);
    background-color: var(--heroui-danger-50);
    color: var(--heroui-danger);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1rem;
}
[data-theme="dark"] .heroui-confirm-icon-danger {
    background-color: rgba(243, 18, 96, 0.15);
}
[data-theme="contrast"] .heroui-confirm-icon-danger {
    background-color: #000000 !important;
    color: #FFC107 !important;
    border: 2px solid #FFC107 !important;
}

/* Clean Modern Header Overhaul for Modals */
.modal-header.heroui-header-clean {
    background-color: transparent !important;
    border-bottom: 1px solid var(--heroui-divider) !important;
    padding: 1.2rem 1.5rem !important;
}
.modal-header.heroui-header-clean .modal-title {
    color: var(--heroui-default-900) !important;
    font-weight: 700 !important;
    font-size: 1.15rem !important;
}
[data-theme="dark"] .modal-header.heroui-header-clean .modal-title {
    color: #f8fafc !important;
}
[data-theme="contrast"] .modal-header.heroui-header-clean .modal-title {
    color: #ffffff !important;
}

/* ============================================================================
   7. HEROUI PROGRESS BARS (.progress)
   ============================================================================ */
.progress, .heroui-progress {
    height: 8px !important;
    border-radius: var(--heroui-radius-full) !important;
    background-color: var(--heroui-default-100) !important;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.progress-bar {
    border-radius: var(--heroui-radius-full) !important;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.progress-bar.bg-info {
    background: linear-gradient(90deg, #006FEE 0%, #00b4d8 100%) !important;
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, #17c964 0%, #10b981 100%) !important;
}

.progress-bar.bg-warning {
    background: linear-gradient(90deg, #f5a524 0%, #f59e0b 100%) !important;
}

/* ============================================================================
   8. HEROUI TABLES (.table & Universal Data Tables Standard)
   ============================================================================ */
.table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
    margin-bottom: 0 !important;
}

/* Encabezados de tabla estandarizados (Slate 900 Deep / HeroUI Dark) */
.table thead th,
.table th {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 0.75rem 0.9rem !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    border: none !important;
    line-height: 1.3 !important;
}

.table thead.table-dark th,
.table-dark th,
thead.table-dark th,
.table thead.bg-dark th,
thead.bg-dark th {
    background-color: #0f172a !important; /* Deep Slate estándar HeroUI */
    color: #f8fafc !important;
    border-bottom: 2px solid #334155 !important;
}

.table thead:not(.table-dark):not(.bg-dark) th {
    background-color: var(--heroui-default-100, #f1f5f9) !important;
    color: var(--heroui-default-700, #334155) !important;
    border-bottom: 2px solid var(--heroui-divider, #e2e8f0) !important;
}

.table thead th:first-child,
.table th:first-child {
    border-top-left-radius: var(--heroui-radius-md, 8px) !important;
}

.table thead th:last-child,
.table th:last-child {
    border-top-right-radius: var(--heroui-radius-md, 8px) !important;
}

/* Enlaces de ordenamiento unificados en cabeceras de tablas */
.table thead th a,
.table thead th .sort-link {
    color: inherit !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700 !important;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.table thead.table-dark th a:hover,
.table-dark th a:hover,
thead.table-dark th a:hover,
.table thead.table-dark .sort-link:hover,
.table thead.bg-dark .sort-link:hover {
    color: #f59e0b !important; /* Ámbar corporativo Constructora Fernández */
}

/* Celdas del cuerpo de la tabla */
.table td {
    padding: 0.75rem 0.9rem !important;
    border-top: 1px solid var(--heroui-divider, #e2e8f0) !important;
    border-bottom: none !important;
    vertical-align: middle !important;
    font-size: 0.835rem !important;
    color: var(--heroui-default-700, #334155);
    background-color: transparent;
}

.table tr:hover td {
    background-color: rgba(245, 158, 11, 0.035) !important; /* Micro-resalte ámbar sutil */
}

/* Tipografía de importes monetarios y números: no romper línea y cifras tabulares */
.table td .text-success,
.table td .fw-bold.text-success,
.table td .moneda-val {
    white-space: nowrap !important;
    font-variant-numeric: tabular-nums !important;
}

/* Botones de acción dentro de celdas de tablas */
.table td.text-nowrap,
.table td .table-actions-cell,
.table td .d-flex.align-items-center.justify-content-center {
    white-space: nowrap !important;
}

.table td .btn-sm.p-0,
.table td .btn-action-icon,
.btn-table-action {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 7px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease !important;
}

.table td .btn-sm.p-0:hover,
.table td .btn-action-icon:hover,
.btn-table-action:hover {
    transform: translateY(-1px) scale(1.05) !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1) !important;
}

/* ============================================================================
   9. HEROUI AVATARS (.avatar & .admin-avatar)
   ============================================================================ */
.admin-avatar, .heroui-avatar {
    border-radius: var(--heroui-radius-full) !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
}

/* ============================================================================
   10. HEROUI DROPDOWNS (.dropdown-menu)
   ============================================================================ */
.dropdown-menu {
    border-radius: var(--heroui-radius-lg) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: var(--heroui-shadow-lg) !important;
    padding: 0.45rem !important;
    background-color: #ffffff !important;
}

.dropdown-item {
    border-radius: var(--heroui-radius-sm) !important;
    padding: 0.55rem 0.85rem !important;
    font-size: 0.84rem !important;
    font-weight: 500 !important;
    transition: background-color var(--heroui-transition-fast), color var(--heroui-transition-fast) !important;
}

.dropdown-item:hover {
    background-color: var(--heroui-default-100) !important;
    color: var(--heroui-default-900) !important;
}

/* ============================================================================
   11. HEROUI SUBCONTRATISTA CARD POLISH
   ============================================================================ */
.sub-cuadro-card {
    background: #ffffff !important;
    border: 1.5px solid #edf2f7 !important;
    border-radius: var(--heroui-radius-xl) !important;
    box-shadow: var(--heroui-shadow-sm) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sub-cuadro-card:hover {
    transform: translateY(-3px) scale(1.008) !important;
    border-color: rgba(0, 111, 238, 0.3) !important;
    box-shadow: 0 14px 28px -4px rgba(0, 111, 238, 0.12), 0 8px 12px -3px rgba(0, 0, 0, 0.04) !important;
}

/* ============================================================================
   12. HEROUI RESPONSIVE DESIGN SYSTEM (ALL DEVICES & SCREEN SIZES)
   ============================================================================ */

/* Base fluid container & touch improvements */
html, body {
    overflow-x: hidden;
    width: 100%;
}

.table-responsive {
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    border-radius: var(--heroui-radius-lg, 10px);
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}

.table-responsive::-webkit-scrollbar-thumb {
    background-color: var(--heroui-default-300, #cbd5e1);
    border-radius: 9999px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background-color: var(--heroui-default-400, #94a3b8);
}

/* TABLETS & SMALL LAPTOPS (768px a 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Proteger tablas contra compresión extrema en tablets */
    .table-responsive > .table:not(.table-sm):not(.table-fit) {
        min-width: 660px;
    }
    .col-hide-tablet {
        display: none !important;
    }

    .admin-content {
        padding: 14px 12px !important;
    }
    .admin-page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }
    .admin-page-header .header-actions-group {
        width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
    .kpi-chip-group {
        gap: 6px !important;
    }
}

/* =========================================================================
   HEROUI DUAL MOBILE TABLE SYSTEM (FICHAS ESPACIOSAS O VISTA TABLA CLÁSICA)
   Soluciona definitivamente el apiñamiento y división vertical de caracteres.
   ========================================================================= */

/* Selector de Vista en Móvil (Píldora flotante/alineada de alternancia) */
.mobile-table-view-switcher {
    display: none;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 12px;
    padding: 3px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    width: fit-content;
    margin-left: auto;
}
@media (max-width: 767.98px) {
    .mobile-table-view-switcher {
        display: inline-flex;
    }
}
.mobile-table-view-switcher .btn-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    background: transparent;
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 1;
}
.mobile-table-view-switcher .btn-view-toggle svg {
    width: 13px;
    height: 13px;
}
.mobile-table-view-switcher .btn-view-toggle.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    font-weight: 700;
}
[data-theme="dark"] .mobile-table-view-switcher {
    background: #27272a;
    border-color: #3f3f46;
}
[data-theme="dark"] .mobile-table-view-switcher .btn-view-toggle {
    color: #a1a1aa;
}
[data-theme="dark"] .mobile-table-view-switcher .btn-view-toggle.active {
    background: #18181b;
    color: #f4f4f5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Etiquetas móviles de botones de acción (ocultas en escritorio) */
.btn-label-mobile {
    display: none;
}

@media (max-width: 767.98px) {
    /* Bloqueo global de desbordamiento horizontal en pantallas móviles */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }
    .admin-main-container,
    .admin-content,
    .page-header-container,
    .container-fluid,
    .card:has(.table-responsive),
    main {
        overflow-x: hidden !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* -------------------------------------------------------------------------
       1. MODO POR DEFECTO EN MÓVIL: VISTA FICHAS / TARJETAS ESTRUCTURADAS
       (Cero scroll horizontal garantizado + Organización limpia de información)
       ------------------------------------------------------------------------- */
    .table-responsive:not(.force-table-mode) {
        overflow-x: hidden !important;
        overflow-y: visible !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    .table-responsive:not(.force-table-mode) > .table {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        border: none !important;
        margin: 0 !important;
        background: transparent !important;
    }

    .table-responsive:not(.force-table-mode) > .table thead {
        display: none !important;
    }

    .table-responsive:not(.force-table-mode) > .table tbody {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Tarjeta individual por registro */
    .table-responsive:not(.force-table-mode) > .table tbody > tr {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 14px !important;
        margin-bottom: 14px !important;
        padding: 14px 16px !important;
        box-shadow: 0 2px 6px -1px rgba(15, 23, 42, 0.06), 0 1px 4px -1px rgba(15, 23, 42, 0.04) !important;
        position: relative !important;
        overflow: hidden !important;
        transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    }

    .table-responsive:not(.force-table-mode) > .table tbody > tr:hover {
        border-color: #cbd5e1 !important;
    }

    [data-theme="dark"] .table-responsive:not(.force-table-mode) > .table tbody > tr {
        background: #18181b !important;
        border-color: #27272a !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    }

    /* Reseteo general de todas las celdas dentro de la tarjeta */
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td {
        box-sizing: border-box !important;
        max-width: 100% !important;
        border-top: none !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        background: transparent !important;
        color: #0f172a !important;
    }

    [data-theme="dark"] .table-responsive:not(.force-table-mode) > .table tbody > tr > td {
        color: #f4f4f5 !important;
    }

    /* 1.1 Checkbox de Selección Masiva (Esquina superior derecha) */
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-checkbox,
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td:first-child:has(input[type="checkbox"]) {
        position: absolute !important;
        top: 14px !important;
        right: 14px !important;
        border: none !important;
        padding: 0 !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        z-index: 5 !important;
        display: block !important;
    }
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-checkbox::before,
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td:first-child:has(input[type="checkbox"])::before {
        display: none !important;
    }
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-checkbox input[type="checkbox"],
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td:first-child:has(input[type="checkbox"]) input[type="checkbox"] {
        width: 19px !important;
        height: 19px !important;
        margin: 0 !important;
        cursor: pointer !important;
    }

    /* 1.2 Cabecera de la Tarjeta (Nombre, Avatar, RUT, Tipo) */
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-primary,
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td:nth-child(2) {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 34px 10px 0 !important; /* Espacio para el checkbox a la derecha */
        margin-bottom: 6px !important;
        border-bottom: 2px solid #f1f5f9 !important;
        border-top: none !important;
    }
    [data-theme="dark"] .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-primary,
    [data-theme="dark"] .table-responsive:not(.force-table-mode) > .table tbody > tr > td:nth-child(2) {
        border-bottom-color: #27272a !important;
    }
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-primary::before,
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td:nth-child(2)::before {
        display: none !important;
    }
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-primary a,
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td:nth-child(2) a,
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-primary .fw-bold,
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td:nth-child(2) .fw-bold {
        font-size: 15.5px !important;
        font-weight: 700 !important;
        color: #0f172a !important;
        line-height: 1.3 !important;
        text-align: left !important;
    }
    [data-theme="dark"] .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-primary a,
    [data-theme="dark"] .table-responsive:not(.force-table-mode) > .table tbody > tr > td:nth-child(2) a {
        color: #f4f4f5 !important;
    }

    /* 1.3 Filas de Detalle y Atributos (Especialidad, Obras, Nacionalidad) */
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-detail,
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td:not(.resp-cell-primary):not(.resp-cell-checkbox):not(.resp-cell-block):not(.resp-cell-actions):not(:first-child):not(:nth-child(2)):not(:last-child) {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 7px 0 !important;
        border-bottom: 1px solid #f8fafc !important;
        border-top: none !important;
        font-size: 12.5px !important;
        line-height: 1.4 !important;
        clear: both !important;
    }
    [data-theme="dark"] .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-detail,
    [data-theme="dark"] .table-responsive:not(.force-table-mode) > .table tbody > tr > td:not(.resp-cell-primary):not(.resp-cell-checkbox):not(.resp-cell-block):not(.resp-cell-actions):not(:first-child):not(:nth-child(2)):not(:last-child) {
        border-bottom-color: #27272a !important;
    }

    /* Etiqueta del atributo (a la izquierda, compacta y profesional) */
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-detail[data-col-label]::before,
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td[data-col-label]:not(.resp-cell-primary):not(.resp-cell-checkbox):not(.resp-cell-block):not(.resp-cell-actions)::before {
        content: attr(data-col-label) ":" !important;
        display: inline-block !important;
        font-weight: 700 !important;
        font-size: 10.5px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.04em !important;
        color: #64748b !important;
        flex-shrink: 0 !important;
        width: 105px !important;
        max-width: 105px !important;
        text-align: left !important;
        margin-bottom: 0 !important;
    }
    [data-theme="dark"] .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-detail[data-col-label]::before,
    [data-theme="dark"] .table-responsive:not(.force-table-mode) > .table tbody > tr > td[data-col-label]:not(.resp-cell-primary):not(.resp-cell-checkbox):not(.resp-cell-block):not(.resp-cell-actions)::before {
        color: #a1a1aa !important;
    }

    /* Valor del atributo (alineado a la izquierda contiguo a la etiqueta, badges limpios) */
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-detail > *:not(::before),
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td:not(.resp-cell-primary):not(.resp-cell-checkbox):not(.resp-cell-block):not(.resp-cell-actions) > *:not(::before) {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 5px !important;
        text-align: left !important;
        box-sizing: border-box !important;
    }

    /* Asegurar que las columnas con clase col-hide-mobile se muestren en modo fichas */
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.col-hide-mobile,
    .table-responsive:not(.force-table-mode) .col-hide-mobile {
        display: flex !important;
    }

    /* 1.4 Bloque Contenedor (Contacto Directo, Observaciones, Descripción) */
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-block {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 8px 0 !important;
        border-bottom: 1px solid #f8fafc !important;
        border-top: none !important;
    }
    [data-theme="dark"] .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-block {
        border-bottom-color: #27272a !important;
    }
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-block[data-col-label]::before {
        content: attr(data-col-label) !important;
        display: block !important;
        width: 100% !important;
        font-weight: 700 !important;
        font-size: 10px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        color: #64748b !important;
        margin-bottom: 5px !important;
        text-align: left !important;
    }
    [data-theme="dark"] .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-block[data-col-label]::before {
        color: #a1a1aa !important;
    }
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-block > * {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
        background: #f8fafc !important;
        padding: 9px 12px !important;
        border-radius: 10px !important;
        border: 1px solid #e2e8f0 !important;
        box-sizing: border-box !important;
    }
    [data-theme="dark"] .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-block > * {
        background: #27272a !important;
        border-color: #3f3f46 !important;
    }
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-block a,
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-block button {
        max-width: 100% !important;
        word-break: break-all !important;
    }

    /* 1.5 Barra Inferior de Acciones (Botones Táctiles 50% / 50%) */
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-actions,
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td:last-child {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 12px 0 2px 0 !important;
        margin-top: 6px !important;
        border-top: 1px solid #f1f5f9 !important;
        border-bottom: none !important;
    }
    [data-theme="dark"] .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-actions,
    [data-theme="dark"] .table-responsive:not(.force-table-mode) > .table tbody > tr > td:last-child {
        border-top-color: #27272a !important;
    }
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-actions::before,
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td:last-child::before {
        display: none !important;
    }
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-actions > *,
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td:last-child > * {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-actions .btn,
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td:last-child .btn {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        width: 100% !important;
        height: 38px !important;
        padding: 6px 12px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    }
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td.resp-cell-actions .btn svg,
    .table-responsive:not(.force-table-mode) > .table tbody > tr > td:last-child .btn svg {
        width: 15px !important;
        height: 15px !important;
    }
    .table-responsive:not(.force-table-mode) .btn-label-mobile {
        display: inline !important;
    }

    /* Insignias y etiquetas compactas */
    .table-responsive:not(.force-table-mode) > .table .badge,
    .table-responsive:not(.force-table-mode) > .table .heroui-badge {
        font-size: 11px !important;
        padding: 4px 8px !important;
        border-radius: 6px !important;
        line-height: 1.3 !important;
        white-space: normal !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
    }

    /* Avatares */
    .table-responsive:not(.force-table-mode) > .table td .admin-avatar,
    .table-responsive:not(.force-table-mode) > .table td img.rounded-circle,
    .table-responsive:not(.force-table-mode) > .table td .rounded-circle {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        font-size: 14px !important;
    }

    /* Evitar texto truncado artificialmente en móvil */
    .table-responsive:not(.force-table-mode) > .table .text-truncate {
        max-width: 100% !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    /* -------------------------------------------------------------------------
       2. MODO ALTERNATIVO EN MÓVIL: VISTA TABLA CLÁSICA (.force-table-mode)
       (Mantiene formato cuadrícula con min-width confortable y swipe táctil)
       ------------------------------------------------------------------------- */
    .table-responsive.force-table-mode {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .table-responsive.force-table-mode > .table {
        display: table !important;
        min-width: 720px !important;
        width: 100% !important;
        table-layout: auto !important;
        margin-bottom: 0 !important;
        background: transparent !important;
    }

    .table-responsive.force-table-mode > .table thead {
        display: table-header-group !important;
    }

    .table-responsive.force-table-mode > .table thead th {
        display: table-cell !important;
        padding: 10px 12px !important;
        font-size: 11.5px !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        letter-spacing: 0.02em !important;
    }

    .table-responsive.force-table-mode > .table tbody {
        display: table-row-group !important;
    }

    .table-responsive.force-table-mode > .table tbody > tr {
        display: table-row !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }

    .table-responsive.force-table-mode > .table tbody > tr > td {
        display: table-cell !important;
        padding: 9px 12px !important;
        font-size: 12.5px !important;
        line-height: 1.35 !important;
        border-bottom: 1px solid #e2e8f0 !important;
        vertical-align: middle !important;
        white-space: nowrap !important;
        word-break: normal !important;
    }

    [data-theme="dark"] .table-responsive.force-table-mode > .table tbody > tr > td {
        border-bottom-color: #27272a !important;
    }

    .table-responsive.force-table-mode > .table tbody > tr > td::before {
        display: none !important;
    }

    .table-responsive.force-table-mode > .table tbody > tr > td.resp-cell-checkbox {
        position: static !important;
        width: 38px !important;
        padding: 9px 12px !important;
        text-align: center !important;
    }

    .table-responsive.force-table-mode > .table tbody > tr > td.resp-cell-primary {
        padding: 9px 12px !important;
        border-bottom: 1px solid #e2e8f0 !important;
        margin-bottom: 0 !important;
    }

    .table-responsive.force-table-mode > .table tbody > tr > td.resp-cell-actions {
        padding: 9px 12px !important;
        border-top: none !important;
        border-bottom: 1px solid #e2e8f0 !important;
    }

    .table-responsive.force-table-mode > .table td .btn,
    .table-responsive.force-table-mode > .table td .btn-sm {
        min-width: 28px !important;
        height: 28px !important;
        padding: 3px 6px !important;
        font-size: 11px !important;
    }

    /* Prevent disruptive iOS auto-zoom on form inputs */
    .form-control,
    .form-select,
    .heroui-input,
    input[type="text"],
    input[type="search"],
    input[type="number"],
    input[type="email"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* HeroUI Mobile Dialogs & Bottom Sheet Style */
    .modal-dialog {
        margin: 0.5rem auto !important;
        max-width: calc(100% - 1rem) !important;
        width: 100% !important;
    }

    .modal-dialog-centered {
        display: flex;
        align-items: center;
        min-height: calc(100% - 1rem);
    }

    .modal-content, .heroui-modal {
        border-radius: var(--heroui-radius-xl) !important;
    }

    .modal-header {
        padding: 0.85rem 1rem !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .modal-header .btn-close {
        margin-left: auto !important;
    }

    .modal-body {
        padding: 1rem 0.85rem !important;
    }

    .modal-footer {
        padding: 0.75rem 0.85rem !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .modal-footer > * {
        margin: 0 !important;
    }

    /* Page Navigation Pills on Mobile */
    .nav-pills-custom {
        display: flex !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
        padding: 4px !important;
        scrollbar-width: none;
    }
    .nav-pills-custom::-webkit-scrollbar {
        display: none;
    }
    .nav-pill-item {
        flex: 1 1 auto !important;
        justify-content: center !important;
        padding: 8px 12px !important;
        font-size: 12.5px !important;
    }

    /* Subcontractor Cards on Mobile */
    .sub-cuadro-card {
        padding: 0.9rem !important;
    }
    .sub-cuadro-card .d-flex.justify-content-between {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }

    /* Filter Bar on Mobile */
    .pago-filter-bar {
        padding: 10px !important;
    }
    .filter-input-container {
        width: 100% !important;
        flex: 1 1 100% !important;
    }
    .date-filter-box {
        width: 100% !important;
        flex: 1 1 100% !important;
        min-width: unset !important;
    }

    /* Bulk export floating pill */
    .bulk-export-floating-bar {
        width: calc(100% - 24px) !important;
        left: 12px !important;
        transform: none !important;
        justify-content: space-between !important;
        padding: 8px 14px !important;
        font-size: 12px !important;
        bottom: 12px !important;
    }

    /* Voucher container on mobile screens */
    .voucher-print-container {
        padding: 12px 8px !important;
        font-size: 12px !important;
    }
    .voucher-folio-box-formal {
        min-width: 160px !important;
        width: 100% !important;
        margin-top: 8px !important;
    }
}

/* EXTRA SMALL MOBILES (max-width: 480px, e.g. iPhone SE, 320px-375px) */
@media (max-width: 480px) {
    .admin-content {
        padding: 10px 8px calc(105px + var(--sab, 0px)) 8px !important;
    }

    .admin-page-title {
        font-size: 1.15rem !important;
    }

    .admin-page-subtitle {
        font-size: 0.78rem !important;
    }

    .btn, .heroui-btn {
        padding: 0.45rem 0.85rem !important;
        font-size: 0.82rem !important;
    }

    .btn-sm, .heroui-btn-sm {
        padding: 0.3rem 0.6rem !important;
        font-size: 0.75rem !important;
    }

    .badge, .heroui-chip {
        font-size: 0.7rem !important;
        padding: 0.25em 0.55em !important;
    }

    .modal-subcontratista-detalle .row.g-3.mb-3 > div {
        width: 100% !important;
    }

    .sub-cuadro-card {
        border-radius: var(--heroui-radius-lg) !important;
    }

    /* Floating Bubble Speed Dial — posición en pantallas pequeñas */
    .admin-floating-bubble-container {
        bottom: calc(12px + var(--sab, 0px)) !important;
        right: 12px !important;
    }
    .floating-fab-trigger {
        width: 48px !important;
        height: 48px !important;
    }
    .floating-menu-item {
        padding: 7px 13px !important;
        font-size: 11.5px !important;
    }
}

/* LARGE & ULTRA-WIDE SCREENS (min-width: 1400px & 4K) */
@media (min-width: 1400px) {
    .container-fluid {
        max-width: 1800px;
        margin-left: auto;
        margin-right: auto;
    }
    .sub-cuadro-card {
        border-radius: var(--heroui-radius-2xl) !important;
    }
}

/* ============================================================================
   13. UNIVERSAL ICON CONTRAST & VISIBILITY (WCAG 2.1 AA COMPLIANT)
   ============================================================================ */

/* Base SVG sizing & rendering */
svg {
    vertical-align: middle;
}

/* Force icons inside buttons to match the intended button foreground */
.btn svg,
.heroui-btn svg {
    flex-shrink: 0;
    transition: transform var(--heroui-transition-fast), color var(--heroui-transition-fast), fill var(--heroui-transition-fast);
}

/* 13.1 Primary Buttons -> Pure white icon */
.btn-primary svg,
.btn-primary:hover svg,
.btn-primary:focus svg,
.btn-primary:active svg,
.heroui-btn-primary svg {
    color: #ffffff !important;
    fill: currentColor !important;
}

/* 13.2 Danger Buttons -> Pure white icon */
.btn-danger svg,
.btn-danger:hover svg,
.btn-danger:focus svg,
.btn-danger:active svg,
.heroui-btn-danger svg {
    color: #ffffff !important;
    fill: currentColor !important;
}

/* 13.3 Success Buttons -> Pure white icon */
.btn-success svg,
.btn-success:hover svg,
.btn-success:focus svg,
.btn-success:active svg,
.heroui-btn-success svg {
    color: #ffffff !important;
    fill: currentColor !important;
}

/* 13.4 Dark Buttons & Dark Modal Headers -> High-contrast white or amber icon */
.btn-dark svg,
.btn-dark:hover svg,
.btn-dark:focus svg,
.btn-dark:active svg,
.heroui-btn-dark svg {
    color: #ffffff !important;
    fill: currentColor !important;
}

/* 13.5 Warning Buttons -> Force deep slate icon (NEVER matching yellow background) */
.btn-warning svg,
.btn-warning:hover svg,
.btn-warning:focus svg,
.btn-warning:active svg,
.heroui-btn-warning svg {
    color: #0f172a !important;
    fill: #0f172a !important;
}

/* 13.6 Outline Buttons: Normal vs Hover State Contrast */
.btn-outline-primary svg,
.btn-outline-primary:not(:hover):not(:active) svg {
    color: #006fee !important;
    fill: currentColor !important;
}
.btn-outline-primary:hover svg,
.btn-outline-primary:active svg,
.btn-outline-primary.active svg {
    color: #ffffff !important;
    fill: #ffffff !important;
}

.btn-outline-danger svg,
.btn-outline-danger:not(:hover):not(:active) svg {
    color: #f31260 !important;
    fill: currentColor !important;
}
.btn-outline-danger:hover svg,
.btn-outline-danger:active svg,
.btn-outline-danger.active svg {
    color: #ffffff !important;
    fill: #ffffff !important;
}

.btn-outline-success svg,
.btn-outline-success:not(:hover):not(:active) svg {
    color: #17c964 !important;
    fill: currentColor !important;
}
.btn-outline-success:hover svg,
.btn-outline-success:active svg,
.btn-outline-success.active svg {
    color: #ffffff !important;
    fill: #ffffff !important;
}

.btn-outline-warning svg,
.btn-outline-warning:not(:hover):not(:active) svg {
    color: #d97706 !important;
    fill: currentColor !important;
}
.btn-outline-warning:hover svg,
.btn-outline-warning:active svg,
.btn-outline-warning.active svg {
    color: #0f172a !important;
    fill: #0f172a !important;
}

.btn-outline-dark svg,
.btn-outline-dark:not(:hover):not(:active) svg {
    color: #0f172a !important;
    fill: currentColor !important;
}
.btn-outline-dark:hover svg,
.btn-outline-dark:active svg,
.btn-outline-dark.active svg {
    color: #ffffff !important;
    fill: #ffffff !important;
}

.btn-outline-secondary svg,
.btn-outline-secondary:not(:hover):not(:active) svg {
    color: #64748b !important;
    fill: currentColor !important;
}
.btn-outline-secondary:hover svg,
.btn-outline-secondary:active svg {
    color: #ffffff !important;
    fill: #ffffff !important;
}

/* 13.7 High-Contrast Warning & Info Icons on Light Surfaces */
svg.text-warning,
.text-warning > svg,
.badge.bg-warning svg {
    color: #d97706 !important;
    fill: currentColor !important;
}
.badge.bg-warning {
    color: #0f172a !important;
}
.badge.bg-warning svg {
    color: #0f172a !important;
}

/* Deep ocean blue for info icons on light surfaces */
svg.text-info,
.text-info > svg {
    color: #0284c7 !important;
    fill: currentColor !important;
}

/* Avance Físico Quick Link in Sub Cards */
.sub-avance-btn {
    color: #0284c7 !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    text-decoration: none !important;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.sub-avance-btn:hover {
    color: #0369a1 !important;
    text-decoration: underline !important;
}
.sub-avance-btn svg {
    fill: currentColor !important;
    color: inherit !important;
}

/* 13.8 Semantic Modal Header Icons Contrast */
.modal-header.bg-dark .modal-title svg,
.modal-header.bg-dark h5 svg,
.modal-header.bg-dark h6 svg {
    color: #f59e0b !important; /* Gold/amber accent on dark */
    fill: #f59e0b !important;
}

.modal-header.bg-primary .modal-title svg,
.modal-header.bg-primary h5 svg,
.modal-header.bg-primary h6 svg {
    color: #ffffff !important; /* Crisp white on primary */
    fill: #ffffff !important;
}

.modal-header.bg-danger .modal-title svg,
.modal-header.bg-danger h5 svg,
.modal-header.bg-danger h6 svg {
    color: #ffffff !important; /* Crisp white on danger */
    fill: #ffffff !important;
}

.modal-header.bg-warning .modal-title svg,
.modal-header.bg-warning h5 svg,
.modal-header.bg-warning h6 svg {
    color: #0f172a !important; /* Deep dark on yellow/warning */
    fill: #0f172a !important;
}

/* 13.9 Desplegable Tab Button Icons */
.tab-desplegable-btn svg {
    fill: currentColor !important;
}
.tab-desplegable-btn:hover svg {
    fill: currentColor !important;
}
.project-card.expanded .tab-desplegable-btn svg {
    color: #ffffff !important;
    fill: #ffffff !important;
}

/* 13.10 Dropdown Item Icons */
.dropdown-item svg {
    flex-shrink: 0;
}
.dropdown-item:hover svg,
.dropdown-item:active svg,
.dropdown-item.active svg {
    fill: currentColor !important;
}

/* ============================================================================
   14. SUBCONTRACTOR FRAMING ("ENCUADRE") & COMPACT PROFILE CARDS
   ============================================================================ */
.edp-subtable-container {
    background: #f1f5f9 !important;
    border-top: 2px solid #cbd5e1 !important;
    padding: 18px 20px !important;
    border-bottom-left-radius: var(--heroui-radius-xl) !important;
    border-bottom-right-radius: var(--heroui-radius-xl) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03) !important;
}

/* 14.1 Compact Subcontractor Profile Card (HeroUI Style) */
.sub-perfil-card {
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-top: 3.5px solid var(--heroui-primary) !important;
    border-radius: var(--heroui-radius-xl) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.sub-perfil-card.sub-card-finalizado {
    border-top-color: #10b981 !important;
}

.sub-perfil-card:hover {
    transform: translateY(-2.5px) !important;
    border-color: #cbd5e1 !important;
    border-top-color: var(--heroui-primary) !important;
    box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.1), 0 4px 6px -2px rgba(15, 23, 42, 0.04) !important;
}

.sub-perfil-card.sub-card-finalizado:hover {
    border-top-color: #10b981 !important;
}

.sub-perfil-card:active {
    transform: translateY(0) scale(0.992) !important;
}

/* Avatar Circle */
.sub-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    border: 1.5px solid #bfdbfe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    position: relative;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.08);
}

.sub-perfil-card.sub-card-finalizado .sub-avatar-circle {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46;
    border-color: #a7f3d0;
}

/* Status Dot */
.sub-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #ffffff;
}

.sub-status-dot.dot-activo {
    background-color: #10b981;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
}

.sub-status-dot.dot-finalizado {
    background-color: #94a3b8;
}

/* Workforce Dotation Pill */
.sub-personas-pill {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.sub-perfil-card:hover .sub-personas-pill {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.sub-personas-icon {
    font-size: 16px;
    line-height: 1;
}

.sub-personas-text {
    line-height: 1.2;
}

/* Hover link and arrow animation */
.sub-ver-perfil-link {
    transition: color 0.15s ease;
}

.sub-arrow-icon {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sub-perfil-card:hover .sub-ver-perfil-link {
    color: var(--heroui-primary-dark) !important;
}

.sub-perfil-card:hover .sub-arrow-icon {
    transform: translateX(3px);
}

.sub-perfil-nombre {
    transition: color 0.15s ease;
}

.sub-perfil-card:hover .sub-perfil-nombre {
    color: var(--heroui-primary) !important;
}

/* 14.2 Legacy Compatibility */
.sub-cuadro-card {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    border-top: 3.5px solid var(--heroui-primary) !important;
    border-radius: var(--heroui-radius-xl) !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sub-cuadro-card.sub-card-finalizado {
    border-top-color: #10b981 !important;
}

.sub-cuadro-card:hover {
    transform: translateY(-3px) scale(1.006) !important;
    border-color: #94a3b8 !important;
    box-shadow: 0 14px 28px -4px rgba(15, 23, 42, 0.12), 0 6px 12px -2px rgba(15, 23, 42, 0.04) !important;
}

.sub-cuadro-card .sub-finanzas-box {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 8px 10px !important;
}

.btn-sub-cuadro-action {
    transition: all 0.2s ease;
}
.sub-cuadro-card:hover .btn-sub-cuadro-action {
    color: var(--heroui-primary-dark) !important;
    transform: translateX(2px);
}

/* ============================================================================
   15. SUBCONTRACTOR ENTITY BADGES (EMPRESA VS. PERSONA NATURAL)
   ============================================================================ */
.sub-entidad-badge-empresa {
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #bfdbfe !important;
    font-weight: 700 !important;
    font-size: 10px !important;
    letter-spacing: 0.2px;
}

.sub-entidad-badge-persona {
    background-color: #ecfdf5 !important;
    color: #047857 !important;
    border-color: #a7f3d0 !important;
    font-weight: 700 !important;
    font-size: 10px !important;
    letter-spacing: 0.2px;
}

.sub-personas-num {
    color: #0f172a;
    font-weight: 700;
}

.sub-personas-label {
    color: #64748b;
}

/* ============================================================================
   16. MODO OSCURO ([data-theme="dark"] y html.dark) PARA SUBCONTRATISTAS Y HEROUI
   ============================================================================ */
[data-theme="dark"] .edp-subtable-container,
html.dark .edp-subtable-container {
    background: #14181d !important;
    border-top: 2px solid #2e353f !important;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* Tarjeta Perfil Subcontratista en Modo Oscuro */
[data-theme="dark"] .sub-perfil-card,
html.dark .sub-perfil-card {
    background: #1e232a !important;
    border: 1.5px solid #334155 !important;
    border-top: 3.5px solid #38bdf8 !important;
    color: #eff1f3 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .sub-perfil-card.sub-card-finalizado,
html.dark .sub-perfil-card.sub-card-finalizado {
    border-top-color: #10b981 !important;
}

[data-theme="dark"] .sub-perfil-card:hover,
html.dark .sub-perfil-card:hover {
    background: #252b34 !important;
    border-color: #475569 !important;
    border-top-color: #60a5fa !important;
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .sub-perfil-card.sub-card-finalizado:hover,
html.dark .sub-perfil-card.sub-card-finalizado:hover {
    border-top-color: #34d399 !important;
}

/* Nombre legible en Modo Oscuro (solución a texto blanco sobre fondo blanco) */
[data-theme="dark"] .sub-perfil-nombre,
html.dark .sub-perfil-nombre {
    color: #ffffff !important;
}

[data-theme="dark"] .sub-perfil-card:hover .sub-perfil-nombre,
html.dark .sub-perfil-card:hover .sub-perfil-nombre {
    color: #38bdf8 !important;
}

/* Pill de Trabajadores en Modo Oscuro */
[data-theme="dark"] .sub-personas-pill,
html.dark .sub-personas-pill {
    background: #161a20 !important;
    border: 1px solid #2e353f !important;
}

[data-theme="dark"] .sub-perfil-card:hover .sub-personas-pill,
html.dark .sub-perfil-card:hover .sub-personas-pill {
    background: #1a2027 !important;
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .sub-personas-pill .sub-personas-num,
[data-theme="dark"] .sub-personas-pill strong,
html.dark .sub-personas-pill .sub-personas-num,
html.dark .sub-personas-pill strong {
    color: #38bdf8 !important;
}

[data-theme="dark"] .sub-personas-pill .sub-personas-label,
[data-theme="dark"] .sub-personas-pill .text-muted,
html.dark .sub-personas-pill .sub-personas-label,
html.dark .sub-personas-pill .text-muted {
    color: #94a3b8 !important;
}

/* Avatar Circle en Modo Oscuro */
[data-theme="dark"] .sub-avatar-circle,
html.dark .sub-avatar-circle {
    background: #1e293b !important;
    color: #38bdf8 !important;
    border-color: #0284c7 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .sub-perfil-card.sub-card-finalizado .sub-avatar-circle,
html.dark .sub-perfil-card.sub-card-finalizado .sub-avatar-circle {
    background: #064e3b !important;
    color: #34d399 !important;
    border-color: #059669 !important;
}

[data-theme="dark"] .sub-status-dot,
html.dark .sub-status-dot {
    border-color: #1e232a !important;
}

/* Links y Flechas en Modo Oscuro */
[data-theme="dark"] .sub-ver-perfil-link,
html.dark .sub-ver-perfil-link {
    color: #38bdf8 !important;
}

[data-theme="dark"] .sub-perfil-card:hover .sub-ver-perfil-link,
html.dark .sub-perfil-card:hover .sub-ver-perfil-link {
    color: #7dd3fc !important;
}

[data-theme="dark"] .sub-perfil-card .border-top,
html.dark .sub-perfil-card .border-top {
    border-color: #2e353f !important;
}

/* Badges de Entidad en Modo Oscuro */
[data-theme="dark"] .sub-entidad-badge-empresa,
html.dark .sub-entidad-badge-empresa {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
    border-color: rgba(59, 130, 246, 0.45) !important;
}

[data-theme="dark"] .sub-entidad-badge-persona,
html.dark .sub-entidad-badge-persona {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.45) !important;
}

[data-theme="dark"] .sub-avance-badge,
html.dark .sub-avance-badge {
    background-color: rgba(6, 182, 212, 0.18) !important;
    color: #38bdf8 !important;
    border-color: rgba(6, 182, 212, 0.4) !important;
}

/* Modales en Modo Oscuro */
[data-theme="dark"] .modal-subcontratista-detalle .modal-body,
html.dark .modal-subcontratista-detalle .modal-body {
    background-color: #14181d !important;
}

[data-theme="dark"] .modal-subcontratista-detalle .bg-white,
html.dark .modal-subcontratista-detalle .bg-white {
    background-color: #1e232a !important;
    border-color: #334155 !important;
    color: #eff1f3 !important;
}

/* Legacy sub-cuadro-card en modo oscuro */
[data-theme="dark"] .sub-cuadro-card,
html.dark .sub-cuadro-card {
    background: #1e232a !important;
    border-color: #334155 !important;
}
[data-theme="dark"] .sub-cuadro-card .sub-finanzas-box,
html.dark .sub-cuadro-card .sub-finanzas-box {
    background: #161a20 !important;
    border-color: #2e353f !important;
}

/* ============================================================================
   17. MODO ALTO CONTRASTE ([data-theme="contrast"]) PARA SUBCONTRATISTAS Y HEROUI
   ============================================================================ */
[data-theme="contrast"] .edp-subtable-container {
    background: #000000 !important;
    border-top: 2px solid #FFC107 !important;
    box-shadow: none !important;
}

/* Tarjeta Perfil Subcontratista en Alto Contraste */
[data-theme="contrast"] .sub-perfil-card {
    background: #000000 !important;
    border: 2px solid #FFC107 !important;
    border-top: 4px solid #FFC107 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

[data-theme="contrast"] .sub-perfil-card.sub-card-finalizado {
    border-color: #00ff66 !important;
    border-top-color: #00ff66 !important;
}

[data-theme="contrast"] .sub-perfil-card:hover {
    background: #141414 !important;
    border-color: #ffffff !important;
    transform: translateY(-2px) !important;
}

[data-theme="contrast"] .sub-perfil-nombre {
    color: #FFC107 !important;
}

[data-theme="contrast"] .sub-perfil-card:hover .sub-perfil-nombre {
    color: #ffffff !important;
}

/* Pill de Trabajadores en Alto Contraste */
[data-theme="contrast"] .sub-personas-pill {
    background: #050505 !important;
    border: 2px solid #FFC107 !important;
}

[data-theme="contrast"] .sub-personas-pill .sub-personas-num,
[data-theme="contrast"] .sub-personas-pill strong {
    color: #ffffff !important;
}

[data-theme="contrast"] .sub-personas-pill .sub-personas-label,
[data-theme="contrast"] .sub-personas-pill .text-muted {
    color: #FFC107 !important;
}

/* Avatar Circle en Alto Contraste */
[data-theme="contrast"] .sub-avatar-circle {
    background: #000000 !important;
    color: #FFC107 !important;
    border: 2px solid #FFC107 !important;
    box-shadow: none !important;
}

[data-theme="contrast"] .sub-perfil-card.sub-card-finalizado .sub-avatar-circle {
    border-color: #00ff66 !important;
    color: #00ff66 !important;
}

[data-theme="contrast"] .sub-status-dot {
    border-color: #000000 !important;
    background-color: #FFC107 !important;
}

[data-theme="contrast"] .sub-status-dot.dot-finalizado {
    background-color: #00ff66 !important;
}

/* Links y Flechas en Alto Contraste */
[data-theme="contrast"] .sub-ver-perfil-link {
    color: #FFC107 !important;
}

[data-theme="contrast"] .sub-perfil-card:hover .sub-ver-perfil-link {
    color: #ffffff !important;
}

[data-theme="contrast"] .sub-arrow-icon {
    color: #FFC107 !important;
}

[data-theme="contrast"] .sub-perfil-card:hover .sub-arrow-icon {
    color: #ffffff !important;
}

[data-theme="contrast"] .sub-perfil-card .border-top {
    border-color: #FFC107 !important;
}

/* Badges de Entidad en Alto Contraste */
[data-theme="contrast"] .sub-entidad-badge-empresa {
    background: #000000 !important;
    color: #FFC107 !important;
    border: 2px solid #FFC107 !important;
}

[data-theme="contrast"] .sub-entidad-badge-persona {
    background: #000000 !important;
    color: #00ff66 !important;
    border: 2px solid #00ff66 !important;
}

[data-theme="contrast"] .sub-avance-badge {
    background: #000000 !important;
    color: #00e5ff !important;
    border: 2px solid #00e5ff !important;
}

/* Modales en Alto Contraste */
[data-theme="contrast"] .modal-subcontratista-detalle .modal-body {
    background-color: #000000 !important;
}

[data-theme="contrast"] .modal-subcontratista-detalle .bg-white {
    background-color: #050505 !important;
    border: 2px solid #FFC107 !important;
    color: #ffffff !important;
}

/* ============================================================================
   18. HEROUI FORM CHECKS, CASILLAS, SWITCHES & CONTROL DE COLISIONES
   ============================================================================ */
/* Estructura limpia y alineada para casillas de verificación */
.form-check {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-bottom: 0 !important;
    padding-left: 0 !important;
    min-height: 1.5rem !important;
}

.form-check .form-check-input {
    float: none !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    width: 1.15rem !important;
    height: 1.15rem !important;
    border: 1.5px solid var(--heroui-default-400) !important;
    background-color: var(--heroui-content1) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.form-check .form-check-input:checked {
    background-color: var(--heroui-primary) !important;
    border-color: var(--heroui-primary) !important;
    box-shadow: 0 2px 6px rgba(0, 111, 238, 0.35) !important;
}

.form-check.form-switch .form-check-input {
    width: 2.2rem !important;
    height: 1.25rem !important;
    border-radius: 9999px !important;
}

.form-check-label {
    cursor: pointer !important;
    user-select: none !important;
    margin-bottom: 0 !important;
    font-size: 0.875rem !important;
}

/* Columna de selección en tablas (evita compresión o superposición) */
th.col-check, td.col-check, .col-check {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    text-align: center !important;
    vertical-align: middle !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
}

/* Casillas en Modo Oscuro */
[data-theme="dark"] .form-check .form-check-input,
html.dark .form-check .form-check-input {
    background-color: #161a20 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .form-check .form-check-input:checked,
html.dark .form-check .form-check-input:checked {
    background-color: #006FEE !important;
    border-color: #006FEE !important;
}

[data-theme="dark"] .form-check-label,
html.dark .form-check-label {
    color: #f8fafc !important;
}

/* Casillas en Alto Contraste */
[data-theme="contrast"] .form-check .form-check-input {
    background-color: #000000 !important;
    border: 2px solid #FFC107 !important;
}

[data-theme="contrast"] .form-check .form-check-input:checked {
    background-color: #FFC107 !important;
    border-color: #FFC107 !important;
}

[data-theme="contrast"] .form-check-label {
    color: #ffffff !important;
}

/* ============================================================================
   19. RESPONSIVE ANTI-OVERLAP RULES (TODOS LOS DISPOSITIVOS Y TAMAÑOS)
   ============================================================================ */
/* Evitar colisión de botones en tarjetas y barras de acciones */
.project-header-toggle .btn {
    white-space: nowrap !important;
    max-width: 100% !important;
    flex-shrink: 0 !important;
}

.project-header-toggle .tab-desplegable-btn {
    flex-shrink: 0 !important;
}

@media (max-width: 991.98px) {
    .project-header-toggle .col-md-12 {
        margin-bottom: 0.5rem !important;
    }
}

@media (max-width: 575.98px) {
    .project-header-toggle .btn {
        font-size: 11.5px !important;
        padding: 0.35rem 0.6rem !important;
    }
    .sub-perfil-card {
        padding: 0.85rem !important;
    }
}

/* ============================================================================
   20. HEROUI ZERO HORIZONTAL SCROLL & RESPONSIVE ADAPTIVE TABLES
   ============================================================================ */
/* Asegurar que las tablas dentro de contenedores ocupen el 100% y no fuercen scroll */
.table-responsive {
    width: 100% !important;
    border-radius: var(--heroui-radius-lg, 10px) !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tablas fluidas sin anchos forzados */
.table-fluid-heroui,
.table-obras-fluid,
.table-edp-fluid {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
    margin-bottom: 0 !important;
}

/* Rompimiento de palabras en textos largos para evitar ensanchamiento de tabla */
.table-fluid-heroui td,
.table-obras-fluid td,
.table-edp-fluid td {
    word-break: normal;
    overflow-wrap: break-word;
}

.table-obras-fluid .col-obra-title,
.table-edp-fluid .col-edp-title {
    max-width: 320px;
    word-break: break-word;
}

/* Celdas con datos apilados de alta densidad y claridad */
.table-cell-stacked {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.table-cell-stacked .primary-text {
    font-weight: 700;
    line-height: 1.25;
}

.table-cell-stacked .secondary-text {
    font-size: 11.5px;
    color: var(--heroui-default-500, #64748b);
    line-height: 1.2;
}

/* Tarjeta HeroUI para Vista de Obras en Cuadrícula (Sin ningún scroll horizontal) */
.obra-card-item {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-top: 3.5px solid #006FEE;
    border-radius: var(--heroui-radius-xl, 14px);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    height: 100%;
}

.obra-card-item.obra-card-finalizado {
    border-top-color: #10b981;
}

.obra-card-item.obra-card-pendiente {
    border-top-color: #f59e0b;
}

.obra-card-item:hover {
    transform: translateY(-3px);
    border-color: #cbd5e1;
    box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.09), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
}

.obra-card-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.obra-card-item:hover .obra-card-title {
    color: #006FEE;
}

.obra-card-meta-pill {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
}

/* Modo Oscuro para Obras Cards y Tablas Fluidas */
[data-theme="dark"] .obra-card-item,
html.dark .obra-card-item {
    background: #1e232a !important;
    border-color: #334155 !important;
    border-top-color: #38bdf8 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .obra-card-item.obra-card-finalizado,
html.dark .obra-card-item.obra-card-finalizado {
    border-top-color: #10b981 !important;
}

[data-theme="dark"] .obra-card-item.obra-card-pendiente,
html.dark .obra-card-item.obra-card-pendiente {
    border-top-color: #f59e0b !important;
}

[data-theme="dark"] .obra-card-title,
html.dark .obra-card-title {
    color: #ffffff !important;
}

[data-theme="dark"] .obra-card-item:hover .obra-card-title,
html.dark .obra-card-item:hover .obra-card-title {
    color: #38bdf8 !important;
}

[data-theme="dark"] .obra-card-meta-pill,
html.dark .obra-card-meta-pill {
    background: #161a20 !important;
    border-color: #2e353f !important;
}

/* Modo Alto Contraste para Obras Cards */
[data-theme="contrast"] .obra-card-item {
    background: #000000 !important;
    border: 2px solid #FFC107 !important;
    border-top: 4px solid #FFC107 !important;
}

[data-theme="contrast"] .obra-card-title {
    color: #FFC107 !important;
}

[data-theme="contrast"] .obra-card-item:hover .obra-card-title {
    color: #ffffff !important;
}

[data-theme="contrast"] .obra-card-meta-pill {
    background: #050505 !important;
    border: 2px solid #FFC107 !important;
}

/* Modo Oscuro para Tablas Fluidas */
[data-theme="dark"] .table-fluid-heroui,
html.dark .table-fluid-heroui {
    color: #e2e8f0;
}

[data-theme="dark"] .table-fluid-heroui thead th,
html.dark .table-fluid-heroui thead th {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border-bottom: 2px solid #334155 !important;
}

[data-theme="dark"] .table-fluid-heroui tbody tr:hover,
html.dark .table-fluid-heroui tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.035) !important;
}

/* Modo Alto Contraste para Tablas Fluidas */
[data-theme="contrast"] .table-fluid-heroui {
    color: #ffffff !important;
}

[data-theme="contrast"] .table-fluid-heroui thead th {
    background-color: #000000 !important;
    color: #FFC107 !important;
    border-bottom: 2px solid #FFC107 !important;
}

[data-theme="contrast"] .table-fluid-heroui tbody td {
    border-color: #333333 !important;
}

[data-theme="contrast"] .table-fluid-heroui tbody tr:hover {
    background-color: rgba(255, 193, 7, 0.08) !important;
}






/* ============================================================================
   21. HEROUI TOOLTIP COMPONENT
   ============================================================================ */
[data-heroui-tooltip],
[data-bs-toggle="tooltip"] {
    position: relative;
}

.heroui-tooltip {
    background: var(--heroui-default-900) !important;
    color: #fff !important;
    border-radius: var(--heroui-radius-sm) !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    padding: 0.35rem 0.7rem !important;
    box-shadow: var(--heroui-shadow-md) !important;
    pointer-events: none !important;
    white-space: nowrap !important;
    z-index: 1090 !important;
}

.tooltip-inner {
    background-color: var(--heroui-default-900) !important;
    border-radius: var(--heroui-radius-sm) !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    padding: 0.35rem 0.7rem !important;
    max-width: 220px !important;
}

/* ============================================================================
   22. HEROUI SKELETON LOADER
   ============================================================================ */
.heroui-skeleton {
    background: linear-gradient(90deg,
        var(--heroui-default-100) 25%,
        var(--heroui-default-200) 50%,
        var(--heroui-default-100) 75%
    ) !important;
    background-size: 200% 100% !important;
    animation: heroui-shimmer 1.5s infinite !important;
    border-radius: var(--heroui-radius-md) !important;
    display: block !important;
}

@keyframes heroui-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.heroui-skeleton-text {
    height: 0.85rem;
    margin-bottom: 0.5rem;
    border-radius: var(--heroui-radius-full) !important;
}

.heroui-skeleton-title {
    height: 1.2rem;
    width: 60%;
    margin-bottom: 0.75rem;
    border-radius: var(--heroui-radius-full) !important;
}

/* ============================================================================
   23. HEROUI DIVIDER
   ============================================================================ */
.heroui-divider, hr.heroui-divider {
    border: none !important;
    border-top: 1px solid var(--heroui-divider) !important;
    margin: 1rem 0 !important;
    opacity: 1 !important;
}

.heroui-divider-vertical {
    width: 1px !important;
    height: auto !important;
    background-color: var(--heroui-divider) !important;
    border: none !important;
    align-self: stretch !important;
    margin: 0 0.75rem !important;
    display: inline-block !important;
}

/* ============================================================================
   24. HEROUI KPI STAT CARDS (Dashboard Cards)
   ============================================================================ */
.heroui-stat-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--heroui-radius-xl);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--heroui-shadow-sm);
    transition: all var(--heroui-transition-normal);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.heroui-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--heroui-primary) 0%, #00b4d8 100%);
    border-radius: var(--heroui-radius-xl) var(--heroui-radius-xl) 0 0;
}

.heroui-stat-card.stat-success::before {
    background: linear-gradient(90deg, var(--heroui-success) 0%, #10b981 100%);
}

.heroui-stat-card.stat-warning::before {
    background: linear-gradient(90deg, var(--heroui-warning) 0%, #f59e0b 100%);
}

.heroui-stat-card.stat-danger::before {
    background: linear-gradient(90deg, var(--heroui-danger) 0%, #be185d 100%);
}

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

.heroui-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--heroui-default-500);
}

.heroui-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--heroui-default-900);
    letter-spacing: -0.03em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.heroui-stat-desc {
    font-size: 0.75rem;
    color: var(--heroui-default-500);
}

/* Compact dashboard stat for sidebar */
.admin-card, .heroui-card-admin {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--heroui-radius-xl);
    box-shadow: var(--heroui-shadow-sm);
    transition: box-shadow var(--heroui-transition-normal);
    overflow: hidden;
}

.admin-card:hover {
    box-shadow: var(--heroui-shadow-md);
}

/* ============================================================================
   25. HEROUI FLOATING ACTION BUTTON (FAB)
   ============================================================================ */
.heroui-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: var(--heroui-radius-full) !important;
    background: var(--heroui-primary) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 6px 20px rgba(0,111,238,0.45) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--heroui-transition-fast) !important;
    z-index: 1040;
}

.heroui-fab:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 10px 28px rgba(0,111,238,0.55) !important;
}

.heroui-fab:active {
    transform: scale(0.96);
}

/* Admin Speed Dial FAB — Contenedor flotante */
.admin-floating-bubble-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.65rem;
    pointer-events: none !important;
}

.admin-floating-bubble-container.visible {
    pointer-events: none !important;
}

.admin-floating-bubble-container.visible:not(.fab-hidden-by-modal) .floating-fab-trigger {
    pointer-events: auto !important;
}

/* Botón circular principal '+' */
.floating-fab-trigger {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f7c06d 0%, #e0872d 100%);
    border: none;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5), 0 2px 8px rgba(0,0,0,0.2);
    color: #1a1204;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: none;
    flex-shrink: 0;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease;
    z-index: 2;
}

/* Menú speed dial */
.floating-fab-menu {
    position: absolute;
    bottom: calc(100% + 0.65rem);
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none !important;
    transform: translateY(12px) scale(0.92);
    transform-origin: bottom right;
    transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-fab-menu > * {
    pointer-events: none !important;
}

.admin-floating-bubble-container.fab-open .floating-fab-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: none !important;
    transform: translateY(0) scale(1);
}

.admin-floating-bubble-container.visible.fab-open:not(.fab-hidden-by-modal) .floating-fab-menu > .floating-menu-item,
.admin-floating-bubble-container.visible.fab-open:not(.fab-hidden-by-modal) .floating-fab-menu > .dropdown,
.admin-floating-bubble-container.visible.fab-open:not(.fab-hidden-by-modal) .floating-fab-menu .dropdown-menu {
    pointer-events: auto !important;
}

/* Ítems del menú */
.floating-menu-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(22, 26, 32, 0.92);
    backdrop-filter: blur(12px);
    color: #e2e8f0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none !important;
}

.floating-menu-item:hover {
    background: rgba(38, 44, 53, 0.97);
    color: #ffffff;
    border-color: rgba(245, 158, 11, 0.4);
    transform: translateX(-3px);
}

/* Compatibilidad: ocultar clases antiguas */
.floating-action-pill { display: none !important; }
.floating-btn-add, .floating-btn-export, .floating-btn-top { display: none !important; }


/* ============================================================================
   26. HEROUI TOPBAR & SIDEBAR LAYOUT
   ============================================================================ */
.admin-topbar {
    height: var(--topbar-height, 60px) !important;
    background: #ffffff !important;
    border-bottom: 1px solid var(--heroui-divider) !important;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05) !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 1.25rem !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1030 !important;
    gap: 0.75rem !important;
}

.admin-sidebar {
    width: var(--sidebar-width, 280px) !important;
    background: linear-gradient(180deg, #090d16 0%, #0d131f 60%, #070a10 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    transition: width var(--heroui-transition-normal), transform var(--heroui-transition-normal) !important;
    will-change: transform, width;
    flex-shrink: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(255,255,255,0.15) transparent !important;
    display: flex !important;
    flex-direction: column !important;
}

.admin-sidebar .sidebar-brand {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.admin-sidebar .sidebar-menu {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
}

/* Botón cerrar para móviles */
.btn-sidebar-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.btn-sidebar-close:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.45);
    color: #fca5a5;
    transform: scale(1.05);
}

/* Sidebar collapsed state (desktop) */
.admin-sidebar.sidebar-collapsed {
    width: 64px !important;
}

.admin-sidebar.sidebar-collapsed .sidebar-brand span,
.admin-sidebar.sidebar-collapsed .sidebar-nav-link span,
.admin-sidebar.sidebar-collapsed .sidebar-heading,
.admin-sidebar.sidebar-collapsed .sidebar-user-info > div,
.admin-sidebar.sidebar-collapsed .badge.ms-auto {
    display: none !important;
}

.admin-sidebar.sidebar-collapsed .sidebar-nav-link {
    justify-content: center !important;
    padding: 0.65rem !important;
    margin: 3px 6px !important;
}

/* Sidebar nav links - HeroUI interactive states */
.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    border-radius: 9px !important;
    color: #94a3b8 !important;
    font-size: 0.835rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    margin: 2px 8px !important;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    min-height: 40px;
}

.sidebar-nav-link span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.sidebar-nav-link::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 22%;
    bottom: 22%;
    width: 3.5px;
    border-radius: 3px;
    background: linear-gradient(180deg, #fbbf24, #f59e0b);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
    opacity: 0;
    transform: scaleY(0.4);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sidebar-nav-link:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    color: #ffffff !important;
    transform: translateX(2px);
}

.sidebar-nav-link:hover svg,
.sidebar-nav-link:hover i {
    opacity: 1 !important;
    color: #f59e0b !important;
    transform: scale(1.05);
}

.sidebar-nav-link.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(217, 119, 6, 0.05) 100%) !important;
    color: #fbbf24 !important;
    font-weight: 600 !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

.sidebar-nav-link.active::before {
    opacity: 1;
    transform: scaleY(1);
}

.sidebar-nav-link svg,
.sidebar-nav-link i {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    font-size: 15px;
    opacity: 0.8;
    transition: opacity var(--heroui-transition-fast), transform var(--heroui-transition-fast), color var(--heroui-transition-fast);
}

.sidebar-nav-link.active svg,
.sidebar-nav-link.active i {
    opacity: 1 !important;
    color: #fbbf24 !important;
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.5));
}

.sidebar-heading {
    font-size: 0.66rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    color: #64748b !important;
    padding: 0.75rem 1rem 0.3rem !important;
    margin: 0.25rem 8px 0 !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Footer del Sidebar con Perfil de Usuario */
.sidebar-user-footer {
    margin-top: auto;
    background: rgba(10, 14, 24, 0.9) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 0.85rem 1rem !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
    text-decoration: none !important;
    border-radius: 8px;
    padding: 3px 6px;
    margin: -3px -6px;
    transition: background 0.2s ease;
}

.sidebar-user-info:hover {
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none !important;
}

.sidebar-user-info:hover .sidebar-user-name {
    color: #fbbf24 !important;
}

.sidebar-user-info .admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px solid rgba(245, 158, 11, 0.5);
    color: #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar-user-name {
    display: block;
    color: #f1f5f9;
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.sidebar-user-role {
    display: block;
    color: #94a3b8;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.btn-sidebar-logout {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.38);
    color: #ef4444;
    transform: scale(1.06);
}

/* ============================================================================
   27. HEROUI PAGE HEADER (admin-page-header)
   ============================================================================ */
.admin-page-header, .page-header-container {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    margin-bottom: 1.25rem !important;
    flex-wrap: wrap !important;
}

.admin-page-title {
    font-size: 1.3rem !important;
    font-weight: 800 !important;
    color: var(--heroui-default-900) !important;
    letter-spacing: -0.03em !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.admin-page-title svg {
    color: var(--heroui-primary) !important;
    flex-shrink: 0;
}

.admin-page-subtitle {
    font-size: 0.82rem !important;
    color: var(--heroui-default-500) !important;
    margin: 0.2rem 0 0 !important;
    font-weight: 400 !important;
}

.header-actions-group {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
    flex-shrink: 0 !important;
}

/* ============================================================================
   28. HEROUI ALERT BANNERS
   ============================================================================ */
.heroui-alert {
    border-radius: var(--heroui-radius-lg) !important;
    border: 1px solid transparent !important;
    padding: 0.85rem 1.1rem !important;
    font-size: 0.875rem !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.65rem !important;
    line-height: 1.5 !important;
}

.heroui-alert-info {
    background: var(--heroui-primary-50) !important;
    border-color: var(--heroui-primary-100) !important;
    color: var(--heroui-primary-600) !important;
}

.heroui-alert-success {
    background: var(--heroui-success-50) !important;
    border-color: #b7f4cb !important;
    color: #0e8642 !important;
}

.heroui-alert-warning {
    background: var(--heroui-warning-50) !important;
    border-color: #fddfb2 !important;
    color: #925403 !important;
}

.heroui-alert-danger {
    background: var(--heroui-danger-50) !important;
    border-color: #fec0d4 !important;
    color: #b50742 !important;
}

/* Bootstrap alert override for HeroUI look */
.alert {
    border-radius: var(--heroui-radius-lg) !important;
    border: 1px solid transparent !important;
    padding: 0.85rem 1.1rem !important;
    font-size: 0.875rem !important;
}

.alert-dismissible .btn-close {
    padding: 0.85rem !important;
}

/* ============================================================================
   29. HEROUI EDP / PROJECT CARD SYSTEM (Pagos Module)
   ============================================================================ */
.project-card {
    border: 1px solid var(--heroui-default-200) !important;
    border-radius: var(--heroui-radius-lg) !important;
    background: #ffffff !important;
    box-shadow: var(--heroui-shadow-xs) !important;
    transition: border-color var(--heroui-transition-fast), box-shadow var(--heroui-transition-fast) !important;
    overflow: visible !important;
    position: relative !important;
}

.project-card:hover {
    border-color: var(--heroui-default-300) !important;
    box-shadow: var(--heroui-shadow-sm) !important;
}

.project-card.expanded {
    border-color: var(--heroui-default-300) !important;
    box-shadow: var(--heroui-shadow-md) !important;
}

.project-header-toggle {
    padding: 0.875rem 1.1rem !important;
    border-radius: var(--heroui-radius-lg) !important;
    cursor: pointer !important;
    transition: background-color var(--heroui-transition-fast) !important;
    user-select: none !important;
}

.project-header-toggle:hover {
    background: var(--heroui-default-50) !important;
}

.project-card.expanded .project-header-toggle {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    background: var(--heroui-default-50) !important;
}

/* Tab desplegable button - HeroUI Bordered variant */
.tab-desplegable-btn {
    background: var(--heroui-default-100) !important;
    color: var(--heroui-default-700) !important;
    border: 1px solid var(--heroui-default-200) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 5px 11px !important;
    border-radius: var(--heroui-radius-md) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    cursor: pointer !important;
    transition: all var(--heroui-transition-fast) !important;
    white-space: nowrap !important;
}

.tab-desplegable-btn:hover {
    background: var(--heroui-default-200) !important;
    border-color: var(--heroui-default-300) !important;
    color: var(--heroui-default-900) !important;
}

.project-card.expanded .tab-desplegable-btn {
    background: var(--heroui-default-900) !important;
    color: #ffffff !important;
    border-color: var(--heroui-default-900) !important;
}

.tab-chevron {
    transition: transform 0.22s cubic-bezier(0.4,0,0.2,1) !important;
    display: inline-block !important;
    font-size: 10px !important;
}

.project-card.expanded .tab-chevron {
    transform: rotate(180deg) !important;
}

/* EDP subtable container - HeroUI Card Body style */
.edp-subtable-container {
    background: var(--heroui-default-50) !important;
    border-top: 1px solid var(--heroui-divider) !important;
    padding: 0.85rem 1rem !important;
    border-bottom-left-radius: var(--heroui-radius-lg) !important;
    border-bottom-right-radius: var(--heroui-radius-lg) !important;
}

/* EDP table - HeroUI compact table */
.table-compact {
    width: 100% !important;
    margin-bottom: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.table-compact th {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.07em !important;
    color: var(--heroui-default-500) !important;
    background: var(--heroui-default-100) !important;
    padding: 0.65rem 0.9rem !important;
    border: none !important;
    white-space: nowrap !important;
}

.table-compact th:first-child { border-radius: var(--heroui-radius-sm) 0 0 var(--heroui-radius-sm) !important; }
.table-compact th:last-child  { border-radius: 0 var(--heroui-radius-sm) var(--heroui-radius-sm) 0 !important; }

.table-compact td {
    font-size: 0.82rem !important;
    padding: 0.7rem 0.9rem !important;
    vertical-align: middle !important;
    border-top: 1px solid var(--heroui-divider) !important;
    border-bottom: none !important;
}

.table-compact .edp-row:hover td {
    background: rgba(0,111,238,0.03) !important;
}

/* KPI chips (pago header) */
.kpi-chip {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 4px 10px !important;
    border-radius: var(--heroui-radius-full) !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    background: var(--heroui-default-100) !important;
    border: 1px solid var(--heroui-default-200) !important;
    color: var(--heroui-default-700) !important;
    white-space: nowrap !important;
    transition: all var(--heroui-transition-fast) !important;
}

.kpi-chip:hover {
    background: var(--heroui-default-200) !important;
    border-color: var(--heroui-default-300) !important;
}

.kpi-chip-group {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    align-items: center !important;
}

/* Pago header box - HeroUI Card */
.pago-header-box {
    background: #ffffff !important;
    border: 1px solid var(--heroui-default-200) !important;
    border-radius: var(--heroui-radius-lg) !important;
    padding: 0.85rem 1.1rem !important;
    margin-bottom: 0.85rem !important;
    box-shadow: var(--heroui-shadow-xs) !important;
}

/* Filter bar - HeroUI surface */
.pago-filter-bar {
    background: var(--heroui-default-50) !important;
    border: 1px solid var(--heroui-default-200) !important;
    border-radius: var(--heroui-radius-md) !important;
    padding: 0.65rem 0.9rem !important;
    margin-top: 0.75rem !important;
}

/* ============================================================================
   30. HEROUI NAV PILLS (Module tabs)
   ============================================================================ */
.nav-pills-custom {
    display: inline-flex !important;
    background: var(--heroui-default-100) !important;
    padding: 4px !important;
    border-radius: var(--heroui-radius-lg) !important;
    gap: 3px !important;
    border: 1px solid var(--heroui-default-200) !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    max-width: 100% !important;
    flex-shrink: 1 !important;
}

.nav-pills-custom::-webkit-scrollbar { display: none; }

.nav-pill-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 7px 16px !important;
    border-radius: var(--heroui-radius-md) !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    color: var(--heroui-default-600) !important;
    text-decoration: none !important;
    transition: all var(--heroui-transition-fast) !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    border: none !important;
    background: transparent !important;
}

.nav-pill-item:hover {
    background: rgba(255,255,255,0.75) !important;
    color: var(--heroui-default-900) !important;
}

.nav-pill-item.active {
    background: #ffffff !important;
    color: var(--heroui-default-900) !important;
    box-shadow: var(--heroui-shadow-sm) !important;
    font-weight: 700 !important;
}

.nav-pill-item .badge {
    font-size: 10.5px !important;
    padding: 2px 6px !important;
}

.nav-pill-item.active .badge.bg-warning {
    background-color: var(--heroui-warning) !important;
    color: #000 !important;
}

/* ============================================================================
   31. HEROUI RESPONSIVE SIDEBAR DRAWER (≤991px)
   ============================================================================ */
@media (max-width: 991.98px) {
    .admin-sidebar {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        width: 290px !important;
        max-width: calc(100vw - 50px) !important;
        transform: translate3d(-100%, 0, 0) !important;
        z-index: 1060 !important;
        display: flex !important;
        flex-direction: column !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease, box-shadow 0.3s ease !important;
        box-shadow: none !important;
        visibility: hidden !important;
        background: linear-gradient(180deg, #090d16 0%, #0d131f 60%, #070a10 100%) !important;
        border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
        overflow: hidden !important;
        overscroll-behavior: contain !important;
        will-change: transform;
    }

    /* Soporte universal para clases .show, .sidebar-open y body.sidebar-mobile-open */
    .admin-sidebar.show,
    .admin-sidebar.sidebar-open,
    body.sidebar-mobile-open .admin-sidebar,
    body.sidebar-collapsed .admin-sidebar.show,
    body.sidebar-collapsed .admin-sidebar.sidebar-open {
        transform: translate3d(0, 0, 0) !important;
        visibility: visible !important;
        box-shadow: 12px 0 45px -5px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
    }

    /* Backdrop interactivo con desenfoque de fondo */
    .sidebar-backdrop {
        display: none;
        position: fixed !important;
        inset: 0 !important;
        background: rgba(9, 13, 22, 0.72) !important;
        z-index: 1050 !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s ease !important;
    }

    .sidebar-backdrop.show {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* Bloqueo suave de scroll en body al abrir drawer en móvil */
    body.sidebar-mobile-open {
        overflow: hidden !important;
        touch-action: none;
    }

    .admin-main,
    .admin-main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
    }

    /* Navegación táctil optimizada para dedos (Apple HIG / Material) */
    .admin-sidebar .sidebar-nav-link {
        min-height: 42px !important;
        padding: 10px 16px !important;
        font-size: 14px !important;
        margin: 3px 10px !important;
    }

    /* Ocultar barra de scroll tosca en móviles para una sensación de App Nativa */
    .admin-sidebar .sidebar-menu {
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }
    .admin-sidebar .sidebar-menu::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
}

@media (max-width: 767.98px) {

    /* Bottom nav bar (HeroUI mobile style) */
    .admin-bottomnav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(64px + var(--sab, 0px));
        background: #ffffff;
        border-top: 1px solid var(--heroui-divider);
        box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
        display: flex;
        align-items: stretch;
        z-index: 1030;
        padding-bottom: var(--sab, 0px);
    }

    .admin-bottomnav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        text-decoration: none;
        color: var(--heroui-default-400);
        font-size: 0.625rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        padding: 6px 4px 4px;
        transition: color var(--heroui-transition-fast);
        cursor: pointer;
        border: none;
        background: none;
    }

    .admin-bottomnav-item:hover,
    .admin-bottomnav-item.active {
        color: var(--heroui-primary);
    }

    .admin-bottomnav-item svg {
        width: 22px;
        height: 22px;
    }

    .admin-content {
        padding-bottom: calc(72px + var(--sab, 0px)) !important;
    }

    /* Mobile page header: stacked layout */
    .admin-page-header, .page-header-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.65rem !important;
    }

    .header-actions-group {
        width: 100% !important;
        justify-content: flex-start !important;
    }

    /* Mobile nav-pills: scroll */
    .nav-pills-custom {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
    }

    .nav-pill-item {
        flex: 1 0 auto !important;
        justify-content: center !important;
        padding: 7px 10px !important;
        font-size: 12px !important;
    }

    /* Mobile EDP table: hide less important cols */
    .table-compact .col-hide-mobile {
        display: none !important;
    }

    .edp-subtable-container {
        padding: 0.65rem 0.5rem !important;
    }

    .edp-subtable-container .table-responsive {
        border-radius: var(--heroui-radius-md) !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .edp-subtable-container .table-responsive table {
        min-width: 520px !important;
    }

    /* Mobile pago filter: full width */
    .pago-filter-bar {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .pago-filter-bar .filter-input-container,
    .pago-filter-bar .date-filter-box {
        width: 100% !important;
        flex: 1 1 100% !important;
    }

    /* Mobile project-card action buttons: wrap */
    .project-header-toggle .row {
        gap: 0.4rem !important;
    }

    .project-header-toggle .btn,
    .project-header-toggle .tab-desplegable-btn {
        font-size: 11px !important;
        padding: 5px 9px !important;
    }

    /* Mobile KPI chips: full width scroll */
    .kpi-chip-group {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 2px !important;
        scrollbar-width: none !important;
    }
    .kpi-chip-group::-webkit-scrollbar { display: none; }

    /* HeroUI stat cards: 2-col grid on mobile */
    .heroui-stat-card .heroui-stat-value {
        font-size: 1.4rem !important;
    }

    /* Table responsive compact on mobile */
    .table-compact td,
    .table-compact th {
        padding: 0.55rem 0.6rem !important;
        font-size: 0.78rem !important;
    }

    /* Floating action pill: full-width */
    .floating-action-pill {
        width: calc(100vw - 2rem) !important;
        justify-content: space-between !important;
    }
}

/* ============================================================================
   32. HEROUI RESPONSIVE LAYOUT: TABLET (768px–991px)
   ============================================================================ */
@media (min-width: 768px) and (max-width: 991.98px) {
    .admin-page-title {
        font-size: 1.15rem !important;
    }

    .nav-pill-item {
        padding: 7px 12px !important;
        font-size: 12.5px !important;
    }

    .project-header-toggle .btn,
    .project-header-toggle .tab-desplegable-btn {
        font-size: 12px !important;
    }
}

/* ============================================================================
   33. HEROUI DARK MODE — Global extension for new components
   ============================================================================ */
[data-theme="dark"] body,
html.dark body {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .admin-topbar,
html.dark .admin-topbar {
    background: #161a20 !important;
    border-bottom-color: #2e353f !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .heroui-card,
[data-theme="dark"] .admin-card,
[data-theme="dark"] .heroui-stat-card,
[data-theme="dark"] .project-card,
[data-theme="dark"] .pago-header-box,
html.dark .card,
html.dark .heroui-card,
html.dark .admin-card,
html.dark .heroui-stat-card,
html.dark .project-card,
html.dark .pago-header-box {
    background: #1e232a !important;
    border-color: #2e353f !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .heroui-stat-value,
html.dark .heroui-stat-value {
    color: #f8fafc !important;
}

[data-theme="dark"] .nav-pills-custom,
html.dark .nav-pills-custom {
    background: #161a20 !important;
    border-color: #2e353f !important;
}

[data-theme="dark"] .nav-pill-item.active,
html.dark .nav-pill-item.active {
    background: #0f172a !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .nav-pill-item:not(.active),
html.dark .nav-pill-item:not(.active) {
    color: #94a3b8 !important;
}

[data-theme="dark"] .tab-desplegable-btn,
html.dark .tab-desplegable-btn {
    background: #161a20 !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .project-card.expanded .tab-desplegable-btn,
html.dark .project-card.expanded .tab-desplegable-btn {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #f8fafc !important;
}

[data-theme="dark"] .edp-subtable-container,
html.dark .edp-subtable-container {
    background: #14181d !important;
    border-top-color: #2e353f !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .edp-subtable-container .table-responsive,
html.dark .edp-subtable-container .table-responsive {
    background: #1a202c !important;
    border-color: #2e353f !important;
}

[data-theme="dark"] .edp-subtable-container .text-dark,
html.dark .edp-subtable-container .text-dark {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .edp-subtable-container .text-muted,
html.dark .edp-subtable-container .text-muted {
    color: #94a3b8 !important;
}

[data-theme="dark"] .table-compact th,
html.dark .table-compact th {
    background: #0f172a !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .table-compact td,
html.dark .table-compact td {
    border-top-color: #2e353f !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .kpi-chip,
html.dark .kpi-chip {
    background: #1a1f27 !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
html.dark .form-control,
html.dark .form-select {
    background-color: #1a1f27 !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .dropdown-menu,
html.dark .dropdown-menu {
    background: #1e232a !important;
    border-color: #2e353f !important;
}

[data-theme="dark"] .dropdown-item,
html.dark .dropdown-item {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .dropdown-item:hover,
html.dark .dropdown-item:hover {
    background: #262c35 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .table th,
html.dark .table th {
    background: #0f172a !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .table td,
html.dark .table td {
    border-top-color: #2e353f !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .modal-content,
html.dark .modal-content {
    background: #1e232a !important;
    border-color: #2e353f !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .modal-header,
html.dark .modal-header {
    border-bottom-color: #2e353f !important;
}

[data-theme="dark"] .modal-footer,
html.dark .modal-footer {
    background: #161a20 !important;
    border-top-color: #2e353f !important;
}

[data-theme="dark"] .admin-bottomnav,
html.dark .admin-bottomnav {
    background: #161a20 !important;
    border-top-color: #2e353f !important;
}

[data-theme="dark"] .input-group-text,
html.dark .input-group-text {
    background: #1a1f27 !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .pago-filter-bar,
html.dark .pago-filter-bar {
    background: #14181d !important;
    border-color: #2e353f !important;
}

/* ============================================================================
   33b. DARK MODE COMPREHENSIVE CONTRAST AUDIT
   ============================================================================ */

/* Footer */
[data-theme="dark"] footer,
html.dark footer {
    background: #161a20 !important;
    border-top-color: #2e353f !important;
}
[data-theme="dark"] footer small,
html.dark footer small { color: #64748b !important; }

/* Texto generico */
[data-theme="dark"] .text-dark, html.dark .text-dark { color: #f1f5f9 !important; }
[data-theme="dark"] .text-body, html.dark .text-body { color: #e2e8f0 !important; }
[data-theme="dark"] .text-muted, html.dark .text-muted { color: #94a3b8 !important; }

/* Fondos utilitarios adicionales */
[data-theme="dark"] .bg-white, [data-theme="dark"] .bg-light,
html.dark .bg-white, html.dark .bg-light {
    background-color: #1e232a !important;
    color: #e2e8f0 !important;
}

/* Cards internas bg-light */
[data-theme="dark"] .card .bg-light, [data-theme="dark"] .admin-card .bg-light,
[data-theme="dark"] .modal-content .bg-light,
html.dark .card .bg-light, html.dark .admin-card .bg-light,
html.dark .modal-content .bg-light {
    background-color: #161a20 !important;
    border-color: #2e353f !important;
    color: #e2e8f0 !important;
}

/* Texto dentro de cards */
[data-theme="dark"] .card .text-dark, [data-theme="dark"] .admin-card .text-dark,
html.dark .card .text-dark, html.dark .admin-card .text-dark { color: #f1f5f9 !important; }

/* Badges en dark (WCAG AAA) */
[data-theme="dark"] .badge.bg-light, html.dark .badge.bg-light {
    background-color: #2e353f !important; color: #e2e8f0 !important;
}
[data-theme="dark"] .badge.bg-secondary, html.dark .badge.bg-secondary {
    background-color: #334155 !important; color: #cbd5e1 !important;
}
[data-theme="dark"] .badge.bg-secondary-subtle, html.dark .badge.bg-secondary-subtle {
    background-color: rgba(100,116,139,0.25) !important; color: #cbd5e1 !important;
    border: 1px solid rgba(148,163,184,0.3) !important;
}
[data-theme="dark"] .badge.bg-secondary-subtle *, html.dark .badge.bg-secondary-subtle * {
    color: #cbd5e1 !important;
}
[data-theme="dark"] .badge.bg-warning,
[data-theme="dark"] .badge.bg-warning.text-dark,
[data-theme="dark"] .badge-warning,
[data-theme="dark"] .badge.bg-warning-subtle,
html.dark .badge.bg-warning,
html.dark .badge.bg-warning.text-dark,
html.dark .badge-warning,
html.dark .badge.bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.22) !important;
    border: 1px solid rgba(251, 191, 36, 0.5) !important;
    color: #FCD34D !important;
}
[data-theme="dark"] .badge.bg-warning *,
[data-theme="dark"] .badge.bg-warning.text-dark *,
html.dark .badge.bg-warning *,
html.dark .badge.bg-warning.text-dark * {
    color: #FCD34D !important;
}
[data-theme="dark"] .badge.bg-primary,
[data-theme="dark"] .badge.bg-primary-subtle,
[data-theme="dark"] .badge-primary,
html.dark .badge.bg-primary,
html.dark .badge.bg-primary-subtle,
html.dark .badge-primary {
    background-color: rgba(37, 99, 235, 0.25) !important;
    border: 1px solid rgba(96, 165, 250, 0.45) !important;
    color: #93c5fd !important;
}
[data-theme="dark"] .badge.bg-primary *, html.dark .badge.bg-primary * {
    color: #93c5fd !important;
}
[data-theme="dark"] .badge.bg-success,
[data-theme="dark"] .badge.bg-success-subtle,
[data-theme="dark"] .badge-success,
html.dark .badge.bg-success,
html.dark .badge.bg-success-subtle,
html.dark .badge-success {
    background-color: rgba(16, 185, 129, 0.22) !important;
    border: 1px solid rgba(52, 211, 153, 0.45) !important;
    color: #6ee7b7 !important;
}
[data-theme="dark"] .badge.bg-success *, html.dark .badge.bg-success * {
    color: #6ee7b7 !important;
}
[data-theme="dark"] .badge.bg-danger,
[data-theme="dark"] .badge.bg-danger-subtle,
[data-theme="dark"] .badge-danger,
html.dark .badge.bg-danger,
html.dark .badge.bg-danger-subtle,
html.dark .badge-danger {
    background-color: rgba(239, 68, 68, 0.22) !important;
    border: 1px solid rgba(248, 113, 113, 0.45) !important;
    color: #fca5a5 !important;
}
[data-theme="dark"] .badge.bg-danger *, html.dark .badge.bg-danger * {
    color: #fca5a5 !important;
}
[data-theme="dark"] .badge.bg-info,
[data-theme="dark"] .badge.bg-info-subtle,
[data-theme="dark"] .badge-info,
html.dark .badge.bg-info,
html.dark .badge.bg-info-subtle,
html.dark .badge-info {
    background-color: rgba(14, 165, 233, 0.22) !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    color: #7dd3fc !important;
}
[data-theme="dark"] .badge.bg-info *, html.dark .badge.bg-info * {
    color: #7dd3fc !important;
}

/* Fondos sutiles (Subtle) en dark */
[data-theme="dark"] .bg-secondary-subtle, html.dark .bg-secondary-subtle {
    background-color: rgba(100, 116, 139, 0.22) !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
    color: #cbd5e1 !important;
}
[data-theme="dark"] .bg-warning-subtle, html.dark .bg-warning-subtle {
    background-color: rgba(245, 158, 11, 0.16) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
    color: #fde68a !important;
}
[data-theme="dark"] .bg-primary-subtle, html.dark .bg-primary-subtle {
    background-color: rgba(37, 99, 235, 0.18) !important;
    border-color: rgba(59, 130, 246, 0.35) !important;
    color: #93c5fd !important;
}
[data-theme="dark"] .bg-success-subtle, html.dark .bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.16) !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
    color: #86efac !important;
}
[data-theme="dark"] .bg-info-subtle, html.dark .bg-info-subtle {
    background-color: rgba(14, 165, 233, 0.16) !important;
    border-color: rgba(14, 165, 233, 0.35) !important;
    color: #7dd3fc !important;
}
[data-theme="dark"] .bg-danger-subtle, html.dark .bg-danger-subtle {
    background-color: rgba(239, 68, 68, 0.16) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    color: #fca5a5 !important;
}

/* Text Emphasis en dark */
[data-theme="dark"] .text-warning-emphasis, html.dark .text-warning-emphasis { color: #fbbf24 !important; }
[data-theme="dark"] .text-primary-emphasis, html.dark .text-primary-emphasis { color: #60a5fa !important; }
[data-theme="dark"] .text-success-emphasis, html.dark .text-success-emphasis { color: #34d399 !important; }
[data-theme="dark"] .text-secondary-emphasis, html.dark .text-secondary-emphasis { color: #cbd5e1 !important; }
[data-theme="dark"] .text-info-emphasis, html.dark .text-info-emphasis { color: #38bdf8 !important; }
[data-theme="dark"] .text-danger-emphasis, html.dark .text-danger-emphasis { color: #f87171 !important; }
[data-theme="dark"] .text-dark-emphasis, html.dark .text-dark-emphasis { color: #f1f5f9 !important; }

/* Bordes sutiles en dark */
[data-theme="dark"] .border-secondary-subtle, html.dark .border-secondary-subtle { border-color: rgba(148, 163, 184, 0.3) !important; }
[data-theme="dark"] .border-warning-subtle, html.dark .border-warning-subtle { border-color: rgba(245, 158, 11, 0.35) !important; }
[data-theme="dark"] .border-primary-subtle, html.dark .border-primary-subtle { border-color: rgba(59, 130, 246, 0.35) !important; }
[data-theme="dark"] .border-success-subtle, html.dark .border-success-subtle { border-color: rgba(16, 185, 129, 0.35) !important; }
[data-theme="dark"] .border-info-subtle, html.dark .border-info-subtle { border-color: rgba(14, 165, 233, 0.35) !important; }
[data-theme="dark"] .border-danger-subtle, html.dark .border-danger-subtle { border-color: rgba(239, 68, 68, 0.35) !important; }

/* Indicadores de leyenda de gráficos adaptables por tema */
.legend-dot-presupuesto {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background-color: #1e293b;
    vertical-align: middle;
}
.legend-dot-pagado {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background-color: #047857;
    vertical-align: middle;
}
[data-theme="dark"] .legend-dot-presupuesto, html.dark .legend-dot-presupuesto { background-color: #38bdf8 !important; }
[data-theme="dark"] .legend-dot-pagado, html.dark .legend-dot-pagado { background-color: #34d399 !important; }

/* Alerts */
[data-theme="dark"] .alert-light, html.dark .alert-light {
    background-color: #1e232a !important; border-color: #334155 !important; color: #e2e8f0 !important;
}
[data-theme="dark"] .alert-warning, html.dark .alert-warning {
    background-color: rgba(245,158,11,0.12) !important; border-color: rgba(245,158,11,0.35) !important; color: #fde68a !important;
}
[data-theme="dark"] .alert-danger, html.dark .alert-danger {
    background-color: rgba(239,68,68,0.12) !important; border-color: rgba(239,68,68,0.35) !important; color: #fca5a5 !important;
}
[data-theme="dark"] .alert-success, html.dark .alert-success {
    background-color: rgba(34,197,94,0.12) !important; border-color: rgba(34,197,94,0.35) !important; color: #86efac !important;
}

/* Bordes */
[data-theme="dark"] .border, html.dark .border { border-color: #2e353f !important; }
[data-theme="dark"] .border-top, html.dark .border-top { border-top-color: #2e353f !important; }
[data-theme="dark"] .border-bottom, html.dark .border-bottom { border-bottom-color: #2e353f !important; }

/* Formularios en modales */
[data-theme="dark"] .modal-content .form-control, [data-theme="dark"] .modal-content .form-select,
html.dark .modal-content .form-control, html.dark .modal-content .form-select {
    background-color: #14181d !important; border-color: #334155 !important; color: #e2e8f0 !important;
}
[data-theme="dark"] .modal-content .form-label, html.dark .modal-content .form-label { color: #cbd5e1 !important; }
[data-theme="dark"] .modal-content .form-text, html.dark .modal-content .form-text { color: #64748b !important; }
[data-theme="dark"] textarea.form-control, html.dark textarea.form-control {
    background-color: #1a1f27 !important; color: #e2e8f0 !important; border-color: #334155 !important;
}
[data-theme="dark"] ::placeholder, html.dark ::placeholder { color: #4a5568 !important; }

/* Nav-tabs */
[data-theme="dark"] .nav-tabs, html.dark .nav-tabs { border-bottom-color: #2e353f !important; }
[data-theme="dark"] .nav-tabs .nav-link, html.dark .nav-tabs .nav-link { color: #94a3b8 !important; border-color: transparent !important; }
[data-theme="dark"] .nav-tabs .nav-link.active, html.dark .nav-tabs .nav-link.active {
    background: #1e232a !important; color: #f8fafc !important; border-color: #334155 #334155 #1e232a !important;
}
[data-theme="dark"] .nav-tabs .nav-link:hover, html.dark .nav-tabs .nav-link:hover { color: #e2e8f0 !important; border-color: #334155 !important; }

/* List-group */
[data-theme="dark"] .list-group-item, html.dark .list-group-item {
    background: #1e232a !important; border-color: #2e353f !important; color: #e2e8f0 !important;
}
[data-theme="dark"] .list-group-item.active, html.dark .list-group-item.active {
    background: rgba(245,158,11,0.18) !important; border-color: rgba(245,158,11,0.35) !important; color: #fde68a !important;
}

/* Speed Dial FAB en dark */
[data-theme="dark"] .floating-menu-item, html.dark .floating-menu-item {
    background: rgba(10,15,24,0.96) !important; border-color: rgba(255,255,255,0.1) !important;
    color: #e2e8f0 !important; box-shadow: 0 4px 18px rgba(0,0,0,0.6) !important;
}
[data-theme="dark"] .floating-menu-item:hover, html.dark .floating-menu-item:hover {
    background: rgba(25,35,50,0.98) !important; color: #ffffff !important; border-color: rgba(245,158,11,0.45) !important;
}
[data-theme="dark"] .floating-menu-item-top, html.dark .floating-menu-item-top {
    background: rgba(15, 23, 42, 0.96) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    color: #f1f5f9 !important;
}
[data-theme="dark"] .floating-menu-item-top:hover, html.dark .floating-menu-item-top:hover {
    background: rgba(30, 41, 59, 0.98) !important;
    color: #38bdf8 !important;
    border-color: rgba(56, 189, 248, 0.6) !important;
}

/* Dashboard icons dark */
[data-theme="dark"] .dashboard-module-icon, html.dark .dashboard-module-icon {
    background-color: rgba(245,158,11,0.15) !important; border: 1px solid rgba(245,158,11,0.25) !important; color: #fbbf24 !important;
}

/* Table striped/hover dark */
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > *,
html.dark .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255,255,255,0.03) !important; color: #e2e8f0 !important;
}
[data-theme="dark"] .table-hover tbody tr:hover, html.dark .table-hover tbody tr:hover {
    background-color: rgba(255,255,255,0.06) !important; color: #f8fafc !important;
}
[data-theme="dark"] .table thead th, html.dark .table thead th {
    background: #0f172a !important; color: #94a3b8 !important; border-color: #2e353f !important;
}

/* Modal title y separadores */
[data-theme="dark"] .modal-title, html.dark .modal-title { color: #f8fafc !important; }
[data-theme="dark"] .modal-content hr, html.dark .modal-content hr { border-color: #2e353f !important; }

/* Form-switch en dark */
[data-theme="dark"] .form-switch .form-check-input:not(:checked),
html.dark .form-switch .form-check-input:not(:checked) {
    background-color: #334155 !important; border-color: #475569 !important;
}

/* ============================================================================
   34. HEROUI SCROLLBAR GLOBAL (HeroUI thin style)
   ============================================================================ */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--heroui-default-200) transparent;
}

*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background-color: var(--heroui-default-300);
    border-radius: var(--heroui-radius-full);
}
*::-webkit-scrollbar-thumb:hover {
    background-color: var(--heroui-default-400);
}

/* ============================================================================
   35. HEROUI SELECTION COLOR (brand-aligned highlight)
   ============================================================================ */
::selection {
    background-color: var(--heroui-primary-100);
    color: var(--heroui-primary-600);
}

/* ============================================================================
   36. HEROUI FOCUS VISIBLE (Accessibility ring)
   ============================================================================ */
:focus-visible {
    outline: 2px solid var(--heroui-primary) !important;
    outline-offset: 2px !important;
    border-radius: var(--heroui-radius-sm) !important;
}

/* ============================================================================
   37. HEROUI EMPTY STATE COMPONENT
   ============================================================================ */
.heroui-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--heroui-default-400);
    gap: 0.75rem;
}

.heroui-empty-state svg {
    opacity: 0.45;
    width: 48px;
    height: 48px;
}

.heroui-empty-state-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--heroui-default-600);
    margin: 0;
}

.heroui-empty-state-desc {
    font-size: 0.8rem;
    color: var(--heroui-default-400);
    margin: 0;
    max-width: 280px;
}

/* ============================================================================
   38. HEROUI INPUT GROUP ADDON RESET (fix double border)
   ============================================================================ */
.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > .input-group-text:first-child {
    border-top-left-radius: var(--heroui-radius-md) !important;
    border-bottom-left-radius: var(--heroui-radius-md) !important;
    border-right: none !important;
}

.input-group > .input-group-text:last-child {
    border-top-right-radius: var(--heroui-radius-md) !important;
    border-bottom-right-radius: var(--heroui-radius-md) !important;
    border-left: none !important;
}

/* ============================================================================
   39. HEROUI TABLE OVERFLOW & RESPONSIVE DATA TABLE STANDARD
   ============================================================================ */
.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    position: relative;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@media (min-width: 768px) and (max-width: 991.98px) {
    /* Hide less critical columns in tables across all modules on tablet */
    .table-responsive .col-hide-tablet,
    .col-hide-tablet { 
        display: none !important; 
    }

    /* Table min-width guard for tablet to prevent cell crushing */
    .table-responsive > .table:not(.table-sm):not(.table-fit) {
        min-width: 660px;
    }

    /* Project cards on tablet: tighter spacing */
    .project-card { margin-bottom: 8px !important; }
    .project-header-toggle { padding: 0.75rem !important; }
}

@media (max-width: 767.98px) {
    /* Mantener todas las columnas en datos cuando se pase a vista tabla */
    .table-responsive.force-table-mode .col-hide-mobile,
    .force-table-mode .col-hide-mobile { 
        display: table-cell !important; 
    }
}

/* ============================================================================
   40. HEROUI UNIFIED PAGINATION & RESPONSIVE TABLE CONTROLS (GLOBAL)
   ============================================================================ */
.table-pagination-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 18px;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
    color: #475569;
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.table-pagination-info {
    font-size: 12.5px;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.table-pagination-info strong {
    color: #0f172a;
    font-weight: 700;
}

.table-pagination-limits {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.table-pagination-limits .btn-limit {
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 10px;
    height: 27px;
    line-height: 22px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    color: #334155;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.table-pagination-limits .btn-limit:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.table-pagination-limits .btn-limit.active {
    background-color: #0f172a !important;
    border-color: #0f172a !important;
    color: #f59e0b !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
    font-weight: 700;
}

/* Selector moderno de cantidad de registros/tarjetas por página */
.table-pagination-size-selector {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.table-pagination-size-selector .pagination-size-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.table-pagination-select {
    width: auto !important;
    min-width: 148px;
    height: 30px;
    padding: 2px 28px 2px 9px !important;
    font-size: 11px !important;
    font-weight: 500;
    color: #1e293b;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    cursor: pointer;
    line-height: 1.45;
    vertical-align: middle;
    transition: all 0.15s ease-in-out;
}

.table-pagination-select:hover {
    border-color: #94a3b8;
    background-color: #f8fafc;
}

.table-pagination-select:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
    outline: none;
}

.table-pagination-divider {
    width: 1px;
    height: 22px;
    background-color: #e2e8f0;
    margin: 0 4px;
}

.table-pagination-page-indicator {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

.table-pagination-page-indicator strong {
    color: #0f172a;
    font-weight: 700;
}

.table-pagination-nav-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Global Pagination & Page Link Component for ALL Views */
.pagination,
.table-pagination-nav .pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin: 0 !important;
    padding: 0;
    list-style: none;
}

.pagination .page-item,
.table-pagination-nav .page-item {
    margin: 0;
}

.pagination .page-link,
.table-pagination-nav .page-link {
    font-size: 12px;
    font-weight: 600;
    padding: 0 8px;
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1;
    color: #334155;
    background-color: #ffffff;
    text-decoration: none;
    transition: all 0.15s ease;
    user-select: none;
}

.pagination .page-link:hover,
.table-pagination-nav .page-link:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.pagination .page-item.active .page-link,
.table-pagination-nav .page-item.active .page-link {
    background-color: #0f172a !important;
    border-color: #0f172a !important;
    color: #f59e0b !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25) !important;
    font-weight: 700 !important;
}

.pagination .page-item.disabled .page-link,
.table-pagination-nav .page-item.disabled .page-link {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    opacity: 0.65;
    pointer-events: none;
}

/* Adaptación Mobile para Paginación */
@media (max-width: 767.98px) {
    .table-pagination-footer {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        padding: 12px 10px !important;
        text-align: center !important;
    }
    .table-pagination-info {
        font-size: 11.5px !important;
        justify-content: center !important;
        width: 100% !important;
        text-align: center !important;
    }
    .table-pagination-limits {
        justify-content: center !important;
        width: 100% !important;
    }
    .table-pagination-nav {
        justify-content: center !important;
        width: 100% !important;
    }
    .pagination .page-link,
    .table-pagination-nav .page-link {
        min-width: 30px !important;
        height: 30px !important;
        font-size: 11.5px !important;
    }
}

/* Modo Oscuro para Paginación Global */
[data-theme="dark"] .table-pagination-footer {
    background-color: #111827 !important;
    border-top-color: #1f2937 !important;
    color: #9ca3af !important;
}
[data-theme="dark"] .table-pagination-info strong {
    color: #f9fafb !important;
}
[data-theme="dark"] .table-pagination-limits .btn-limit {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #d1d5db !important;
}
[data-theme="dark"] .table-pagination-limits .btn-limit:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
}
[data-theme="dark"] .table-pagination-limits .btn-limit.active {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #0f172a !important;
}
[data-theme="dark"] .pagination .page-link,
[data-theme="dark"] .table-pagination-nav .page-link {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #d1d5db !important;
}
[data-theme="dark"] .pagination .page-link:hover,
[data-theme="dark"] .table-pagination-nav .page-link:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
}
[data-theme="dark"] .pagination .page-item.active .page-link,
[data-theme="dark"] .table-pagination-nav .page-item.active .page-link {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #0f172a !important;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3) !important;
}
[data-theme="dark"] .pagination .page-item.disabled .page-link,
[data-theme="dark"] .table-pagination-nav .page-item.disabled .page-link {
    background-color: #111827 !important;
    border-color: #1f2937 !important;
    color: #4b5563 !important;
}

@media (max-width: 575.98px) {
    /* Modo Card-Stacked exclusivo para tablas con la clase explícita .table-card-mobile */
    .table-card-mobile thead { display: none !important; }
    .table-card-mobile tbody tr {
        display: flex !important;
        flex-direction: column !important;
        border: 1px solid var(--heroui-default-200) !important;
        border-radius: var(--heroui-radius-md) !important;
        margin-bottom: 0.5rem !important;
        padding: 0.5rem 0 !important;
        background: #ffffff !important;
    }
    .table-card-mobile tbody td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-top: none !important;
        border-bottom: 1px solid var(--heroui-default-100) !important;
        padding: 0.4rem 0.75rem !important;
        font-size: 0.8rem !important;
    }
    .table-card-mobile tbody td:last-child { border-bottom: none !important; }
    .table-card-mobile tbody td::before {
        content: attr(data-label);
        font-size: 0.68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--heroui-default-400);
        flex-shrink: 0;
        margin-right: 0.5rem;
    }
}

/* ============================================================================
   40. HEROUI PRINT RESET (prevent UI leaking into print)
   ============================================================================ */
@media print {
    .admin-sidebar,
    .admin-topbar,
    .admin-bottomnav,
    .admin-floating-bubble-container,
    .floating-action-pill,
    .bulk-export-floating-bar,
    .heroui-fab,
    .btn-close {
        display: none !important;
    }

    .admin-content {
        padding: 0 !important;
        margin: 0 !important;
    }

    .card, .heroui-card, .admin-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* ============================================================================
   41. GLOBAL HEROUI VIEW SWITCHER (TARJETAS VS TABLA)
   ============================================================================ */
.fyu-view-switcher {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
}
[data-theme="dark"] .fyu-view-switcher {
    background: #0d1527;
    border-color: #222f46;
}
.fyu-view-switcher .btn-view-mode {
    border: none !important;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 8px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    line-height: 1.3;
}
.fyu-view-switcher .btn-view-mode:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.85);
}
.fyu-view-switcher .btn-view-mode.active {
    background: #0f172a !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}
[data-theme="dark"] .fyu-view-switcher .btn-view-mode {
    color: #94a3b8;
}
[data-theme="dark"] .fyu-view-switcher .btn-view-mode:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .fyu-view-switcher .btn-view-mode.active {
    background: #0284c7 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

/* ============================================================================
   35. ALTO CONTRASTE (HIGH CONTRAST WCAG AAA EXTENSIONS FOR HEROUI)
   ============================================================================ */
[data-theme="contrast"] .heroui-segmented-group,
[data-theme="contrast"] .fyu-view-switcher,
[data-theme="contrast"] .mobile-table-view-switcher,
[data-theme="contrast"] .sub-view-switcher,
[data-theme="contrast"] .nav-pills-custom {
    background: #000000 !important;
    border: 2px solid #FFC107 !important;
}

[data-theme="contrast"] .heroui-segmented-tab,
[data-theme="contrast"] .fyu-view-switcher .btn-view-mode,
[data-theme="contrast"] .mobile-table-view-switcher .btn-view-toggle,
[data-theme="contrast"] .sub-view-switcher .btn-view-mode,
[data-theme="contrast"] .nav-pill-item {
    background: transparent !important;
    color: #ffffff !important;
    border: 1px solid transparent !important;
    text-decoration: none !important;
}

[data-theme="contrast"] .heroui-segmented-tab span,
[data-theme="contrast"] .fyu-view-switcher .btn-view-mode span,
[data-theme="contrast"] .mobile-table-view-switcher .btn-view-toggle span,
[data-theme="contrast"] .sub-view-switcher .btn-view-mode span,
[data-theme="contrast"] .nav-pill-item span {
    color: #ffffff !important;
    text-decoration: none !important;
}

[data-theme="contrast"] .heroui-segmented-tab i,
[data-theme="contrast"] .fyu-view-switcher .btn-view-mode i,
[data-theme="contrast"] .mobile-table-view-switcher .btn-view-toggle svg,
[data-theme="contrast"] .sub-view-switcher .btn-view-mode i,
[data-theme="contrast"] .sub-view-switcher .btn-view-mode svg,
[data-theme="contrast"] .nav-pill-item svg {
    color: #FFC107 !important;
    fill: #FFC107 !important;
}

[data-theme="contrast"] .heroui-segmented-tab:hover,
[data-theme="contrast"] .fyu-view-switcher .btn-view-mode:hover,
[data-theme="contrast"] .mobile-table-view-switcher .btn-view-toggle:hover,
[data-theme="contrast"] .sub-view-switcher .btn-view-mode:hover,
[data-theme="contrast"] .nav-pill-item:hover {
    background: #1a1a1a !important;
    border-color: #FFC107 !important;
    color: #FFC107 !important;
    text-decoration: none !important;
}
[data-theme="contrast"] .heroui-segmented-tab:hover span,
[data-theme="contrast"] .fyu-view-switcher .btn-view-mode:hover span,
[data-theme="contrast"] .sub-view-switcher .btn-view-mode:hover span,
[data-theme="contrast"] .nav-pill-item:hover span {
    color: #FFC107 !important;
}

[data-theme="contrast"] .heroui-segmented-tab.active,
[data-theme="contrast"] .fyu-view-switcher .btn-view-mode.active,
[data-theme="contrast"] .mobile-table-view-switcher .btn-view-toggle.active,
[data-theme="contrast"] .sub-view-switcher .btn-view-mode.active,
[data-theme="contrast"] .nav-pill-item.active {
    background: #FFC107 !important;
    border: 1px solid #FFC107 !important;
    box-shadow: none !important;
    text-decoration: none !important;
}
[data-theme="contrast"] .heroui-segmented-tab.active span,
[data-theme="contrast"] .heroui-segmented-tab.active i,
[data-theme="contrast"] .fyu-view-switcher .btn-view-mode.active span,
[data-theme="contrast"] .fyu-view-switcher .btn-view-mode.active i,
[data-theme="contrast"] .mobile-table-view-switcher .btn-view-toggle.active span,
[data-theme="contrast"] .mobile-table-view-switcher .btn-view-toggle.active svg,
[data-theme="contrast"] .sub-view-switcher .btn-view-mode.active span,
[data-theme="contrast"] .sub-view-switcher .btn-view-mode.active i,
[data-theme="contrast"] .sub-view-switcher .btn-view-mode.active svg,
[data-theme="contrast"] .nav-pill-item.active span,
[data-theme="contrast"] .nav-pill-item.active svg {
    color: #000000 !important;
    fill: #000000 !important;
    font-weight: 800 !important;
}

[data-theme="contrast"] .heroui-segmented-tab .badge,
[data-theme="contrast"] .nav-pill-item:not(.active) .badge {
    background: #000000 !important;
    color: #FFC107 !important;
    border: 1px solid #FFC107 !important;
}
[data-theme="contrast"] .heroui-segmented-tab.active .badge,
[data-theme="contrast"] .nav-pill-item.active .badge {
    background: #000000 !important;
    color: #FFC107 !important;
    border: 1px solid #000000 !important;
}

[data-theme="contrast"] .sub-count-badge,
[data-theme="contrast"] .count-badge {
    background: #000000 !important;
    border: 2px solid #FFC107 !important;
    color: #ffffff !important;
}
[data-theme="contrast"] .sub-count-badge i,
[data-theme="contrast"] .count-badge i {
    color: #FFC107 !important;
}
[data-theme="contrast"] .sub-count-badge span,
[data-theme="contrast"] .count-badge span {
    color: #ffffff !important;
}
[data-theme="contrast"] .sub-count-badge strong,
[data-theme="contrast"] .count-badge strong {
    color: #FFC107 !important;
}

/* ============================================================================
   HEROUI NOTIFICATION SYSTEM (BELL POPOVER, BADGES & TABS)
   ============================================================================ */

/* 1. Bell Trigger Button */
.heroui-notif-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.heroui-notif-btn:hover {
    background: #f8fafc;
    color: var(--heroui-primary, #006FEE);
    border-color: rgba(0, 111, 238, 0.3);
    box-shadow: 0 4px 12px rgba(0, 111, 238, 0.12);
    transform: translateY(-1px);
}

.heroui-notif-btn:active {
    transform: scale(0.95);
}

.heroui-notif-btn:hover i.fa-bell {
    animation: herouiBellWiggle 0.6s ease-in-out;
    transform-origin: top center;
}

@keyframes herouiBellWiggle {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(14deg); }
    40% { transform: rotate(-12deg); }
    60% { transform: rotate(8deg); }
    80% { transform: rotate(-5deg); }
}

/* 2. HeroUI Pulse Badge */
.heroui-badge-ping-ring {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 9999px;
    background-color: var(--heroui-danger, #F31260);
    animation: herouiPing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
    opacity: 0.75;
    pointer-events: none;
}

@keyframes herouiPing {
    75%, 100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

.heroui-notif-badge-pill {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #F31260 0%, #e11d48 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 15px;
    text-align: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(243, 18, 96, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.02em;
    z-index: 2;
}

/* 3. HeroUI Notification Popover */
.heroui-notif-popover {
    width: 460px;
    max-width: calc(100vw - 20px);
    border-radius: 20px !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.16), 0 0 1px 1px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden;
    padding: 0 !important;
    animation: herouiPopoverSlide 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top right;
}

@keyframes herouiPopoverSlide {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 4. Popover Header */
.heroui-notif-header {
    padding: 14px 18px 10px;
    background: transparent;
}

.heroui-notif-header-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.heroui-pulse-live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #059669;
}

.heroui-pulse-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: herouiPulseGreen 2s infinite;
}

@keyframes herouiPulseGreen {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* 5. HeroUI Segmented Tabs Control */
.heroui-notif-tabs-bar {
    padding: 0 14px 10px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.heroui-segmented-group {
    display: flex;
    gap: 3px;
    background: #f1f5f9;
    padding: 3.5px;
    border-radius: 12px;
}

.heroui-segmented-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 5px 8px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 9px;
    color: #64748b;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
}

.heroui-segmented-tab:hover {
    color: #0f172a;
}

.heroui-segmented-tab.active {
    background: #ffffff;
    color: #0f172a;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

.heroui-tab-pill-count {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 9999px;
    background: #e2e8f0;
    color: #475569;
    line-height: 1.2;
}

.heroui-segmented-tab.active .heroui-tab-pill-count {
    background: #0f172a;
    color: #ffffff;
}

.heroui-tab-pill-count.count-danger {
    background: #fee2e2;
    color: #dc2626;
}

.heroui-tab-pill-count.count-zero {
    background: #e2e8f0;
    color: #64748b;
    font-weight: 600;
}

/* 6. Notification Items List */
.heroui-notif-scroll-area {
    max-height: 360px;
    overflow-y: auto;
    padding: 6px 10px;
}

.heroui-notif-scroll-area::-webkit-scrollbar {
    width: 5px;
}
.heroui-notif-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}
.heroui-notif-scroll-area::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.heroui-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    margin-bottom: 6px;
    text-decoration: none !important;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.65);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.heroui-notif-item:hover {
    background: #f8fafc;
    border-color: rgba(0, 111, 238, 0.25);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    transform: translateY(-1px);
}

.heroui-notif-item:active {
    transform: scale(0.99);
}

.heroui-notif-item.is-urgent {
    border-left: 3.5px solid #ef4444 !important;
    background: #fffafa;
}

.heroui-notif-item.is-urgent:hover {
    background: #fff5f5;
}

/* 7. Avatar Squircle */
.heroui-notif-avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.heroui-notif-avatar.avatar-danger {
    background: #fee2e2;
    color: #dc2626;
}

.heroui-notif-avatar.avatar-warning {
    background: #fef3c7;
    color: #d97706;
}

.heroui-notif-avatar.avatar-primary {
    background: #e0f2fe;
    color: #0284c7;
}

.heroui-notif-avatar.avatar-rose {
    background: #ffe4e6;
    color: #e11d48;
}

.heroui-notif-avatar.avatar-pink {
    background: #fce7f3;
    color: #db2777;
}

/* 8. Text Elements & Monospace Code Badge */
.heroui-notif-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.heroui-notif-item:hover .heroui-notif-title {
    color: var(--heroui-primary, #006FEE);
}

.heroui-code-pill {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 10.5px;
    font-weight: 700;
    padding: 1.5px 5.5px;
    border-radius: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.heroui-notif-sub {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 500;
}

.heroui-notif-meta {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.heroui-notif-chevron {
    color: #cbd5e1;
    font-size: 11px;
    transition: all 0.18s ease;
    opacity: 0.6;
}

.heroui-notif-item:hover .heroui-notif-chevron {
    color: var(--heroui-primary, #006FEE);
    opacity: 1;
    transform: translateX(3px);
}

/* 9. HeroUI Chips */
.heroui-chip-soft {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7.5px;
    border-radius: 9999px;
    line-height: 1.3;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    gap: 3.5px;
}

.heroui-chip-soft.chip-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.heroui-chip-soft.chip-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.heroui-chip-soft.chip-primary {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.heroui-chip-soft.chip-pink {
    background: #fce7f3;
    color: #9d174d;
    border: 1px solid #fbcfe8;
}

/* 10. Empty State */
.heroui-notif-empty {
    padding: 32px 20px;
    text-align: center;
}

.heroui-notif-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: #f1f5f9;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
}

/* 11. Footer */
.heroui-notif-footer {
    padding: 10px 16px;
    background: rgba(248, 250, 252, 0.85);
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.heroui-notif-footer-link {
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #0f172a;
    transition: color 0.15s ease;
}

.heroui-notif-footer-link:hover {
    color: var(--heroui-primary, #006FEE);
}

.heroui-notif-footer-link.secondary {
    color: #64748b;
    font-weight: 600;
}

.heroui-notif-footer-link.secondary:hover {
    color: #0f172a;
}

/* Dark mode overrides */
[data-theme="dark"] .heroui-notif-btn {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}
[data-theme="dark"] .heroui-notif-btn:hover {
    background: #334155;
    color: #60a5fa;
}
[data-theme="dark"] .heroui-notif-popover {
    background: rgba(15, 23, 42, 0.96) !important;
    border-color: #334155 !important;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.5) !important;
}
[data-theme="dark"] .heroui-notif-header-title {
    color: #f8fafc;
}
[data-theme="dark"] .heroui-segmented-group {
    background: #0f172a;
}
[data-theme="dark"] .heroui-segmented-tab {
    color: #94a3b8;
}
[data-theme="dark"] .heroui-segmented-tab.active {
    background: #1e293b;
    color: #f8fafc;
}
[data-theme="dark"] .heroui-notif-item {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .heroui-notif-item:hover {
    background: #273549;
    border-color: #475569;
}
[data-theme="dark"] .heroui-notif-title {
    color: #f8fafc;
}
[data-theme="dark"] .heroui-code-pill {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}
[data-theme="dark"] .heroui-notif-sub {
    color: #94a3b8;
}
[data-theme="dark"] .heroui-notif-footer {
    background: rgba(15, 23, 42, 0.9);
    border-color: #334155;
}
[data-theme="dark"] .heroui-notif-footer-link {
    color: #e2e8f0;
}
[data-theme="dark"] .heroui-notif-footer-link:hover {
    color: #60a5fa;
}

/* ============================================================================
   HEROUI FORM ANIMATIONS, SPINNERS & UPLOAD / SAVING STATES
   ============================================================================ */

/* 1. HeroUI Top Indeterminate Neon Progress Bar */
.heroui-top-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3.5px;
    background: transparent;
    z-index: 100000;
    overflow: hidden;
    display: none;
    pointer-events: none;
}

.heroui-top-progress.active {
    display: block;
}

.heroui-top-progress .bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #006fee 0%, #00d2ff 35%, #ffc107 70%, #006fee 100%);
    background-size: 250% 100%;
    animation: herouiProgressShift 1.25s infinite linear;
    box-shadow: 0 0 12px rgba(0, 111, 238, 0.75);
}

@keyframes herouiProgressShift {
    0% { background-position: 250% 0; }
    100% { background-position: -250% 0; }
}

/* 2. HeroUI Button Loading State (isLoading) */
.btn.is-loading,
button.is-loading,
.heroui-btn.is-loading,
.btn-login.is-loading {
    position: relative !important;
    pointer-events: none !important;
    cursor: wait !important;
    opacity: 0.88 !important;
    transform: none !important;
}

/* Spinner dentro del botón */
.heroui-btn-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.heroui-btn-spinner svg {
    width: 100%;
    height: 100%;
    animation: herouiSpinnerRotate 0.75s linear infinite;
}

.heroui-btn-spinner .heroui-spinner-track {
    stroke: currentColor;
    opacity: 0.25;
}

.heroui-btn-spinner .heroui-spinner-fill {
    stroke: currentColor;
    stroke-linecap: round;
    stroke-dasharray: 45, 150;
    stroke-dashoffset: 0;
    animation: herouiSpinnerDash 1.2s ease-in-out infinite;
}

@keyframes herouiSpinnerRotate {
    100% { transform: rotate(360deg); }
}

@keyframes herouiSpinnerDash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 60, 150;
        stroke-dashoffset: -20;
    }
    100% {
        stroke-dasharray: 60, 150;
        stroke-dashoffset: -75;
    }
}

/* 3. HeroUI Modern Glassmorphic Loading Overlay */
.admin-loading-overlay,
.heroui-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(12px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(160%) !important;
    z-index: 99999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
}

.swal2-container {
    z-index: 100000 !important;
}

.admin-loading-overlay.d-none,
.heroui-loading-overlay.d-none {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.admin-loading-card,
.heroui-loading-card {
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    padding: 36px 32px 30px !important;
    border-radius: var(--heroui-radius-2xl, 24px) !important;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.06) !important;
    max-width: 90vw;
    width: 410px;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    animation: herouiCardPop 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    position: relative;
    overflow: hidden;
}

@keyframes herouiCardPop {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Spinner Central Dual-Ring HeroUI */
.heroui-loader-ring-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px auto;
}

.heroui-loader-ring {
    width: 64px;
    height: 64px;
    animation: herouiSpinnerRotate 1.1s linear infinite;
}

.heroui-loader-ring circle {
    fill: none;
    stroke-width: 4;
}

.heroui-loader-ring .ring-bg {
    stroke: rgba(0, 111, 238, 0.14);
}

.heroui-loader-ring .ring-val {
    stroke: var(--heroui-primary, #006fee);
    stroke-linecap: round;
    stroke-dasharray: 95, 200;
    stroke-dashoffset: 0;
    animation: herouiSpinnerDash 1.4s ease-in-out infinite;
}

.heroui-loader-core-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--heroui-warning, #f5a524);
    font-size: 19px;
    animation: herouiPulseGlow 1.8s ease-in-out infinite;
}

@keyframes herouiPulseGlow {
    0%, 100% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.85; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

.heroui-loading-title {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    color: var(--heroui-default-900, #111827) !important;
    letter-spacing: -0.01em;
    margin-bottom: 0.4rem !important;
}

.heroui-loading-subtitle {
    font-size: 0.825rem !important;
    color: var(--heroui-default-500, #71717a) !important;
    line-height: 1.45 !important;
    margin-bottom: 0 !important;
}

/* Mini barra de progreso estética debajo del texto */
.heroui-loading-bar-indicator {
    height: 3px;
    width: 100%;
    background: var(--heroui-default-100, #f4f4f5);
    border-radius: 999px;
    margin-top: 18px;
    overflow: hidden;
    position: relative;
}

.heroui-loading-bar-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 45%;
    background: linear-gradient(90deg, #006fee, #f5a524);
    border-radius: 999px;
    animation: herouiBarSlide 1.5s infinite ease-in-out;
}

@keyframes herouiBarSlide {
    0% { left: -45%; width: 40%; }
    50% { left: 35%; width: 60%; }
    100% { left: 100%; width: 30%; }
}

/* Modo Oscuro para el Overlay de Carga HeroUI */
[data-theme="dark"] .admin-loading-card,
[data-theme="dark"] .heroui-loading-card,
html.dark .admin-loading-card,
html.dark .heroui-loading-card {
    background: rgba(22, 30, 49, 0.94) !important;
    border-color: rgba(255, 255, 255, 0.09) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .heroui-loading-title,
html.dark .heroui-loading-title {
    color: #f8fafc !important;
}

[data-theme="dark"] .heroui-loading-subtitle,
html.dark .heroui-loading-subtitle {
    color: #94a3b8 !important;
}

[data-theme="dark"] .heroui-loader-ring .ring-bg,
html.dark .heroui-loader-ring .ring-bg {
    stroke: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .heroui-loading-bar-indicator,
html.dark .heroui-loading-bar-indicator {
    background: #1e293b;
}

/* Modo Alto Contraste para el Overlay */
[data-theme="contrast"] .admin-loading-card,
[data-theme="contrast"] .heroui-loading-card {
    background: #000000 !important;
    border: 3px solid #ffc107 !important;
}

[data-theme="contrast"] .heroui-loading-title {
    color: #ffc107 !important;
}

[data-theme="contrast"] .heroui-loading-subtitle {
    color: #ffffff !important;
}

/* ============================================================================
   RESPONSIVE FINAL: TOPBAR, CENTRO DE NOTIFICACIONES Y ACCIONES MÓVILES
   ============================================================================ */
.admin-topbar > div:first-child,
.admin-topbar-actions {
    min-width: 0 !important;
}

.admin-topbar-actions {
    max-width: calc(100% - 44px);
}

.heroui-notif-popover {
    width: min(460px, calc(100vw - 20px)) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: min(640px, calc(100dvh - 80px));
    overflow: hidden !important;
}

.heroui-notif-header > .d-flex:first-child,
.heroui-notif-header-title,
.heroui-notif-header .heroui-pulse-live,
.heroui-notif-item > .flex-grow-1 {
    min-width: 0 !important;
}

.heroui-notif-header-title,
.heroui-notif-header .heroui-pulse-live span:last-child,
.heroui-notif-item .heroui-notif-title,
.heroui-notif-item .heroui-notif-sub,
.heroui-notif-item .heroui-notif-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.heroui-notif-header > .heroui-chip-soft,
.heroui-notif-item .heroui-chip-soft,
.heroui-notif-item .heroui-notif-chevron {
    flex-shrink: 0;
}

.heroui-notif-tabs-bar {
    max-width: 100%;
}

.heroui-segmented-group {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 4px !important;
}

.heroui-segmented-tab {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 6px 6px !important;
    white-space: nowrap !important;
}

.heroui-notif-scroll-area {
    max-height: min(360px, calc(100dvh - 270px));
    overflow-x: hidden;
}

@media (max-width: 767.98px) {
    .admin-main-wrapper,
    .admin-content,
    .admin-content > .container-fluid,
    .page-header-container,
    .admin-page-header,
    .sub-card-container,
    #subViewContainerCards {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .admin-topbar {
        min-width: 0 !important;
        padding-left: max(8px, var(--sal, 0px)) !important;
        padding-right: max(8px, var(--sar, 0px)) !important;
        gap: 4px !important;
    }

    .admin-topbar > div:first-child {
        flex: 1 1 auto !important;
    }

    .admin-topbar-actions {
        flex: 0 1 auto !important;
        gap: 4px !important;
        overflow: visible !important;
    }

    .admin-topbar-actions > .dropdown,
    .admin-topbar-actions > .btn,
    .admin-topbar-actions > a.btn {
        flex: 0 0 auto !important;
        min-width: 0 !important;
    }

    .admin-topbar-actions > .admin-topbar-notifications {
        order: 2;
    }

    .admin-topbar-actions > .admin-topbar-profile {
        order: 3;
    }

    .admin-topbar-actions > .btn-warning,
    .admin-topbar-actions > a.btn-outline-dark {
        order: 20;
    }

    .page-header-container,
    .admin-page-header {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .page-header-container > div:first-child,
    .page-header-container .header-actions-group,
    .page-header-container .header-actions-group > .dropdown,
    .page-header-container .header-actions-group > .btn,
    .page-header-container .header-actions-group > a.btn {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-header-container .header-actions-group .dropdown > .btn {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100% !important;
    }

    .heroui-notif-popover.show {
        position: fixed !important;
        top: calc(var(--topbar-height, 60px) + 6px) !important;
        right: max(8px, var(--sar, 0px)) !important;
        bottom: auto !important;
        left: max(8px, var(--sal, 0px)) !important;
        width: auto !important;
        max-width: none !important;
        max-height: calc(100vh - var(--topbar-height, 60px) - 18px) !important;
        max-height: calc(100dvh - var(--topbar-height, 60px) - 18px) !important;
        margin: 0 !important;
        transform: none !important;
        animation: none !important;
        z-index: 1080 !important;
    }

    .heroui-notif-header {
        padding: 12px 14px 9px;
        gap: 8px;
    }

    .heroui-notif-tabs-bar {
        padding: 0 10px 9px;
    }

    .heroui-notif-scroll-area {
        max-height: calc(100vh - 250px) !important;
        max-height: calc(100dvh - 250px) !important;
    }

    .heroui-notif-item {
        gap: 9px;
        padding: 9px 10px;
    }

    .heroui-notif-footer {
        gap: 8px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .heroui-notif-footer-link {
        min-width: 0;
        white-space: nowrap;
    }
}

@media (max-width: 399.98px) {
    .page-header-container .header-actions-group > .dropdown > .btn,
    .page-header-container .header-actions-group > .btn-action-add {
        padding-left: 8px !important;
        padding-right: 8px !important;
        font-size: 11px !important;
    }

    .admin-topbar-actions .live-sync-badge {
        width: 32px !important;
        height: 32px !important;
        justify-content: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .admin-topbar-actions .live-sync-text {
        display: none !important;
    }

    /* En 320–375 px se priorizan menú, campana y perfil sobre acciones secundarias. */
    .admin-topbar-actions > .btn-warning,
    .admin-topbar-actions > a.btn-outline-dark {
        display: none !important;
    }

    .admin-topbar-actions .btn-warning,
    .admin-topbar-actions > a.btn-outline-dark {
        width: 32px !important;
        height: 32px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .heroui-notif-popover.show {
        right: max(6px, var(--sar, 0px)) !important;
        left: max(6px, var(--sal, 0px)) !important;
    }

    .heroui-notif-header {
        padding-left: 11px;
        padding-right: 11px;
    }

    .heroui-notif-header-title {
        font-size: 13px;
    }

    .heroui-notif-header .heroui-chip-soft {
        max-width: 108px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .heroui-segmented-tab {
        padding-left: 7px;
        padding-right: 7px;
        font-size: 11px;
    }
}

@media (max-width: 359.98px) {
    /* El perfil sigue disponible desde el menú lateral; aquí se reserva espacio para la campana. */
    .admin-topbar-actions > .admin-topbar-profile {
        display: none !important;
    }
}

/* Centro de notificaciones compacto y con acción de limpieza */
.heroui-notif-popover {
    width: min(360px, calc(100vw - 24px)) !important;
    border-radius: 14px !important;
}

.heroui-notif-header {
    padding: 10px 13px 7px;
}

.heroui-notif-header-title {
    font-size: 12.5px;
}

.heroui-pulse-live {
    font-size: 10px;
}

.heroui-notif-tabs-bar {
    padding: 0 10px 7px;
}

.heroui-segmented-tab {
    padding: 4px 7px;
    font-size: 10.5px;
}

.heroui-notif-scroll-area {
    max-height: 300px;
    padding: 5px 8px;
}

.heroui-notif-item {
    gap: 8px;
    padding: 7px 8px;
    margin-bottom: 4px;
    border-radius: 10px;
}

.heroui-notif-avatar {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 12px;
}

.heroui-notif-title {
    font-size: 11.5px;
}

.heroui-notif-sub {
    font-size: 10.5px;
}

.heroui-notif-meta {
    font-size: 10px;
}

.heroui-chip-soft {
    font-size: 9px;
    padding: 1px 5px;
}

.heroui-code-pill {
    font-size: 9.5px;
    padding: 1px 4px;
}

.heroui-notif-footer {
    gap: 6px;
    padding: 7px 10px;
    flex-wrap: wrap;
}

.heroui-notif-footer-link {
    font-size: 10.5px;
    gap: 4px;
}

.heroui-notif-clear-btn {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.heroui-notif-clear-btn:hover,
.heroui-notif-clear-btn:focus-visible {
    color: #dc2626;
}

.heroui-notif-clear-btn.is-cleared,
.heroui-notif-clear-btn:disabled {
    color: #94a3b8;
    cursor: default;
    opacity: 0.85;
}

@media (max-width: 575.98px) {
    .heroui-notif-header {
        padding: 9px 11px 6px;
    }

    .heroui-notif-scroll-area {
        max-height: calc(100dvh - 270px) !important;
    }

    .heroui-notif-footer-link {
        font-size: 10px;
    }
}

/* Cumpleaños dentro de la campana: texto flexible para nombres extensos. */
.heroui-notif-item[data-tipo="cumpleanos"] .heroui-notif-sub {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
