/* ==========================================================================
   ERP TIZAYUCA — THEME CSS (GENEROUS SPACING SCALE & PROFESSIONAL TYPOGRAPHY)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Institutional Color Palette */
    --brand-primary: #6D1B3D;        /* Guinda Oficial Tizayuca */
    --brand-primary-light: #8E2B54;  /* Borgoña Agradable y Luminoso */
    --brand-primary-dark: #52132C;   /* Guinda Profundo */
    --brand-accent: #C59B27;         /* Dorado Institucional */
    --brand-accent-light: #E5C158;   /* Dorado Luminoso */
    
    --nav-bg: #6D1B3D;               /* Barra Superior Guinda */
    --nav-sub-bg: #56142F;           /* Barra de Menú */
    --nav-hover: rgba(255, 255, 255, 0.15);
    
    --body-bg: #F4F6F9;              /* Fondo Agradable, Limpio y Luminoso */
    --card-bg: #FFFFFF;
    --border-color: #E2E8F0;
    --border-subtle: #F1F5F9;
    
    --text-primary: #1E293B;         /* Texto Principal Legible */
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    
    /* 8px Spacing System Scale */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Typography Scale */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-base: 13.5px;
    --font-size-md: 15px;
    --font-size-lg: 16.5px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Shadows */
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 14px 30px rgba(0, 0, 0, 0.12);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body, div, p, span, a, button, input, select, textarea, table, th, td, h1, h2, h3, h4, h5, h6, .form-control, .btn, .nav-link, .modal, .dropdown-menu {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

body {
    background-color: var(--body-bg);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    font-size: var(--font-size-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   TOP INSTITUTIONAL HEADER & USER CONTROLS (BREATHING ROOM & POLISH)
   ========================================================================== */

.top-brand-header {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 100%);
    color: #FFFFFF;
    padding: 16px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 3px 10px rgba(109, 27, 61, 0.25);
    position: relative;
    z-index: 1065;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    text-decoration: none;
    color: #FFFFFF;
}

.brand-wrapper:hover {
    text-decoration: none;
    color: #FFFFFF;
}

.brand-badge-logo {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--brand-accent) 0%, #D4AF37 100%);
    color: #FFFFFF;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.brand-text-block .system-title {
    font-size: 15.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #FFFFFF;
    line-height: 1.25;
}

.brand-text-block .entity-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.header-user-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    position: relative;
}

.fiscal-year-pill {
    background: rgba(255, 255, 255, 0.15);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.user-pill-btn {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 8px 18px;
    border-radius: 20px;
    color: #FFFFFF;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-pill-btn:hover,
.user-pill-btn:focus {
    background: rgba(0, 0, 0, 0.38);
    color: #FFFFFF;
    text-decoration: none;
}

.header-user-dropdown {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    right: 0 !important;
    left: auto !important;
    z-index: 2000 !important;
    background: #FFFFFF !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 10px !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2) !important;
    min-width: 260px !important;
    padding: 6px 0 !important;
    overflow: hidden;
}

.header-user-dropdown .user-info-header {
    background: #F8FAFC;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

.header-user-dropdown .user-info-header strong {
    color: #0F172A;
    font-size: 14px;
    font-weight: 700;
}

.header-user-dropdown .user-info-header small {
    color: #64748B;
    font-size: 12px;
}

.header-user-dropdown .user-info-header .badge-role {
    font-size: 11px;
    font-weight: 700;
    margin-top: 6px;
    background: var(--brand-primary);
    color: #FFFFFF;
    border-radius: 4px;
    padding: 3px 8px;
    display: inline-block;
    letter-spacing: 0.3px;
}

.header-user-dropdown .dropdown-item {
    padding: 11px 20px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    display: flex;
    align-items: center;
    transition: all 0.15s;
    gap: 8px;
}

.header-user-dropdown .dropdown-item:hover {
    background: #FDF2F4;
    color: var(--brand-primary);
    font-weight: 600;
}

.header-user-dropdown .dropdown-item i {
    width: 20px;
}

.header-user-dropdown .btn-logout {
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    color: #DC2626 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.15s;
}

.header-user-dropdown .btn-logout:hover {
    background: #FEF2F2;
    color: #991B1B !important;
}

/* ==========================================================================
   ORIGINAL TOP NAVBAR (HORIZONTAL WITH MULTI-LEVEL FLYOUTS)
   ========================================================================== */

.main-navbar-bar {
    background: var(--nav-sub-bg);
    border-bottom: 3px solid var(--brand-accent);
    padding: 0 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1050;
}

.nav-horizontal {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-wrap: wrap;
}

.nav-horizontal > li {
    position: relative;
}

.nav-horizontal > li > a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 18px;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.nav-horizontal > li > a:hover,
.nav-horizontal > li.active > a,
.nav-horizontal > li:hover > a {
    background: rgba(255, 255, 255, 0.14);
    color: var(--brand-accent-light);
    border-bottom-color: var(--brand-accent);
    text-decoration: none;
}

.nav-horizontal > li > a i {
    font-size: 13px;
    color: var(--brand-accent-light);
}

.nav-horizontal .dropdown-menu {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    min-width: 245px;
    margin-top: 0;
    font-size: 12.5px;
    display: none;
}

.nav-horizontal li:hover > .dropdown-menu {
    display: block;
}

.nav-horizontal .dropdown-menu > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s;
}

.nav-horizontal .dropdown-menu > li > a:hover {
    background: #FDF2F4;
    color: var(--brand-primary);
    font-weight: 600;
    padding-left: 24px;
}

.nav-horizontal .dropdown-menu > li > a i {
    color: var(--brand-primary);
    width: 20px;
    text-align: center;
    margin-right: 8px;
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -6px;
    margin-left: 1px;
    border-radius: 8px;
    display: none;
}

.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

.dropdown-divider {
    border-top: 1px solid var(--border-color);
    margin: 6px 0;
}

/* Breadcrumb Sub-Bar */
.sub-breadcrumb-bar {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumb-list a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb-list a:hover {
    color: var(--brand-primary);
}

.breadcrumb-list .active {
    color: var(--brand-primary);
    font-weight: 700;
}

/* ==========================================================================
   MAIN CONTENT CONTAINER (GENEROUS PADDING & BREATHING ROOM)
   ========================================================================== */

.main-content-container {
    padding: 28px 36px 48px 36px;
    max-width: 100%;
}

/* ==========================================================================
   PANELS & CONTAINERS (.x_panel - ROOMY, ELEVATED & AIRY)
   ========================================================================== */

.x_panel {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-top: 3.5px solid var(--brand-primary);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-xl);
    padding: 0;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.x_panel:hover {
    box-shadow: var(--shadow-md);
}

.x_title {
    padding: 18px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 0;
}

.x_title h2 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.x_title h2 small {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 8px;
}

.x_content {
    padding: var(--spacing-lg) 28px;
}

.x_panel > form {
    padding: var(--spacing-lg) 28px;
}

.panel-body-padded,
.x_panel .panel-body {
    padding: var(--spacing-lg) 28px;
}

.panel_actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   FORMS & CONTROLS (AIRY SPACING, CLEAR LABELS & HIGH-CONTRAST PLACEHOLDERS)
   ========================================================================== */

.form-group {
    margin-bottom: 22px;
}

label,
.form-group label {
    display: inline-block;
    margin-bottom: var(--spacing-sm);
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    color: #334155;
    letter-spacing: 0.15px;
}

label .text-danger,
.form-group label .text-danger {
    margin-left: 3px;
    font-weight: var(--font-weight-bold);
}

.form-control,
.custom-select,
select.form-control {
    font-family: var(--font-sans);
    font-size: 13.5px;
    padding: 10px 14px;
    height: auto;
    border-radius: 6px;
    border: 1px solid #CBD5E1;
    color: #0F172A;
    background-color: #FFFFFF;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.custom-select:focus,
select.form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(109, 27, 61, 0.14);
    outline: none;
}

/* Placeholder Contrast Enhancement (Requirement 2) */
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: #64748B !important;
    opacity: 0.85;
}

.form-control-file {
    padding: 8px 12px;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    background-color: #F8FAFC;
}

/* Form Action Buttons Bar (Generous separation from last field) */
.form-actions-bar,
.x_panel form > .d-flex.justify-content-between.mt-4,
.x_panel form > .d-flex.justify-content-end.mt-4,
.x_panel form > .d-flex.justify-content-between.mt-3,
.x_panel form > .d-flex.justify-content-end.mt-3 {
    margin-top: var(--spacing-xl) !important;
    padding-top: var(--spacing-lg) !important;
    border-top: 1px solid var(--border-color);
    gap: var(--spacing-md);
}

/* ==========================================================================
   STANDARDIZED TAB NAVIGATION SYSTEM (<x-tab-nav>)
   ========================================================================== */

ul.app-tab-nav,
.nav-tabs.app-tab-nav {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 0 22px 0 !important;
    padding: 0 24px !important;
    border-bottom: 2px solid #E2E8F0 !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    background-color: #FFFFFF !important;
}

ul.app-tab-nav li,
.app-tab-nav .app-tab-item,
.app-tab-nav .nav-item {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 !important;
    padding: 0 !important;
    margin-bottom: -2px !important;
    display: inline-block !important;
}

ul.app-tab-nav li::before,
.app-tab-nav .app-tab-item::before {
    display: none !important;
    content: "" !important;
}

.app-tab-nav .app-tab-link,
.app-tab-nav .nav-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 12px 18px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #64748B !important;
    text-decoration: none !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    background: transparent !important;
    transition: all 0.2s ease-in-out !important;
    border-radius: 6px 6px 0 0 !important;
}

.app-tab-nav .app-tab-link i,
.app-tab-nav .nav-link i {
    font-size: 14px !important;
    color: #94A3B8 !important;
    transition: color 0.2s ease-in-out !important;
}

.app-tab-nav .app-tab-link:hover,
.app-tab-nav .nav-link:hover {
    color: var(--brand-primary) !important;
    background-color: #F8FAFC !important;
    text-decoration: none !important;
}

.app-tab-nav .app-tab-link:hover i,
.app-tab-nav .nav-link:hover i {
    color: var(--brand-primary) !important;
}

.app-tab-nav .app-tab-link.active,
.app-tab-nav .nav-link.active {
    color: #1D4ED8 !important; /* Solid Institutional Blue Accent */
    font-weight: 700 !important;
    border-bottom: 3px solid #2563EB !important;
    background-color: #EFF6FF !important;
}

.app-tab-nav .app-tab-link.active i,
.app-tab-nav .nav-link.active i {
    color: #2563EB !important;
}

.app-tab-badge {
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 2px 7px !important;
    border-radius: 10px !important;
    margin-left: 4px !important;
    background-color: #E2E8F0 !important;
    color: #475569 !important;
}

.app-tab-nav .app-tab-link.active .app-tab-badge,
.app-tab-nav .nav-link.active .app-tab-badge {
    background-color: #DBEAFE !important;
    color: #1E40AF !important;
}

.app-tab-link.active .app-tab-badge {
    background-color: #DBEAFE;
    color: #1E40AF;
}

/* ==========================================================================
   METRIC KPI CARDS
   ========================================================================== */

.kpi-card-exec {
    border-radius: 10px;
    padding: 22px 24px;
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.kpi-card-primary {
    background: linear-gradient(135deg, #6D1B3D 0%, #8E2B54 100%);
}

.kpi-card-dark {
    background: linear-gradient(135deg, #2C3E50 0%, #1A252F 100%);
}

.kpi-card-success {
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
}

.kpi-card-blue {
    background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
}

.kpi-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.kpi-title-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.9);
}

.kpi-icon-pill {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #FFFFFF;
}

.kpi-big-value {
    font-size: 26px;
    font-weight: 800;
    color: #FFFFFF;
    margin: 4px 0 8px 0;
    letter-spacing: -0.5px;
}

.kpi-card-dark .kpi-big-value {
    color: #FBBF24;
}

.kpi-footer-note {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.88);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   BUTTONS & ACTION WIDGETS
   ========================================================================== */

.btn {
    border-radius: 6px;
    font-weight: 600;
    padding: 8px 18px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12.5px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
    line-height: 1.4;
    border-radius: 4px;
}

.btn-brand-primary {
    background: var(--brand-primary);
    color: #FFFFFF;
    border: none;
    font-weight: 600;
}

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

.btn-brand-success {
    background: var(--success);
    color: #FFFFFF;
    border: none;
    font-weight: 600;
}

.btn-brand-success:hover,
.btn-brand-success:focus {
    background: #059669;
    color: #FFFFFF;
}

/* ==========================================================================
   TABLES & DATATABLES (GENEROUS, WIDE, ROOMY & HIGH LEGIBILITY)
   ========================================================================== */

.table-responsive {
    width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    margin-bottom: 0;
    border-radius: 0 0 10px 10px;
}

.table {
    width: 100% !important;
    color: var(--text-primary);
    margin-bottom: 0;
    font-size: 13.5px;
    border-collapse: collapse;
}

.table thead th {
    background: #F8FAFC;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-top: none;
    border-bottom: 2px solid #CBD5E1;
    padding: 14px 18px;
    vertical-align: middle;
    white-space: nowrap;
}

.table tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid #E2E8F0;
    vertical-align: middle;
    line-height: 1.5;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #FAFBFD;
}

.table-hover tbody tr:hover {
    background-color: #F1F5F9 !important;
}

.table tbody td.text-nowrap,
.table tbody td code,
.table tbody td .badge,
.table th.text-nowrap {
    white-space: nowrap;
}

.table-totals-row th {
    background: #1E293B !important;
    color: #FFFFFF !important;
    font-weight: 800;
    font-size: 14px;
    padding: 16px 18px;
    letter-spacing: 0.3px;
}

/* DataTables Sorting Arrows */
table.dataTable thead th {
    position: relative;
    cursor: pointer;
    user-select: none;
    padding-right: 28px !important;
}

table.dataTable thead th.no-sort,
table.dataTable thead th.sorting_disabled {
    cursor: default;
    padding-right: 18px !important;
}

table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::after {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 11px;
    opacity: 0.35;
    transition: opacity 0.15s ease-in-out;
}

table.dataTable thead th.sorting::after {
    content: "\f0dc"; /* fa-sort */
}

table.dataTable thead th.sorting_asc::after {
    content: "\f0de"; /* fa-sort-up */
    opacity: 0.95;
    color: var(--brand-primary);
}

table.dataTable thead th.sorting_desc::after {
    content: "\f0dd"; /* fa-sort-down */
    opacity: 0.95;
    color: var(--brand-primary);
}

table.dataTable thead th.no-sort::after,
table.dataTable thead th.sorting_disabled::after {
    display: none !important;
}

table.dataTable thead th:hover:not(.no-sort) {
    background-color: #F1F5F9 !important;
    color: var(--brand-primary) !important;
}

/* ==========================================================================
   MODALS (GENEROUS SPACING & CLEAN SHADOWS)
   ========================================================================== */

.modal-content {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
    border: none;
}

.modal-header {
    padding: 18px 26px;
}

.modal-body {
    padding: 26px 30px;
}

.modal-footer {
    padding: 16px 26px;
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   BADGES & STATUS PILLS
   ========================================================================== */

.badge {
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
}

/* ==========================================================================
   LOGIN SCREEN STYLING
   ========================================================================== */
.login-split-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: #F4F6F9;
}

.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    background: #FFFFFF;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06);
    z-index: 10;
}

.login-brand-panel {
    flex: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, #3B0E1E 0%, #6D1B3D 50%, #8C224E 100%);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

.login-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -15%;
    left: -15%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, rgba(212, 175, 55, 0) 70%);
    pointer-events: none;
}

@media (max-width: 991px) {
    .login-split-container {
        flex-direction: column-reverse;
    }
    .login-brand-panel {
        padding: 40px 20px;
        flex: auto;
    }
    .login-form-panel {
        padding: 30px 20px;
        flex: auto;
    }
}

/* ==========================================================================
   FORM CONTAINER POLISH & COMPACT MAX-WIDTH (DEDICATED CRUD FORMS ONLY)
   ========================================================================== */
.form-view-panel,
.x_panel.form-panel,
.form-container-1350,
.x_panel.form-container-1350 {
    max-width: 1350px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.form-section-header {
    margin-top: 24px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid #E2E8F0;
}

.form-section-header strong {
    font-size: 13px;
    font-weight: 700;
    color: #1E293B;
    letter-spacing: 0.3px;
}

/* ==========================================================================
   EXECUTIVE DASHBOARD STYLING (INSTITUTIONAL FORMALITY & PRESTIGE)
   ========================================================================== */
.exec-header-banner {
    background: linear-gradient(135deg, #4A1028 0%, #6D1B3D 50%, #8E2B54 100%);
    border-radius: 12px;
    padding: 24px 32px;
    margin-bottom: 24px;
    color: #FFFFFF;
    box-shadow: 0 8px 24px rgba(109, 27, 61, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.3);
    position: relative;
    overflow: hidden;
}

.exec-header-banner::after {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0) 70%);
    pointer-events: none;
}

.exec-banner-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(212, 175, 55, 0.22);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 20px;
    color: #FDE68A;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.exec-banner-title {
    font-size: 22px;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0 0 4px 0;
    letter-spacing: -0.3px;
}

.exec-banner-subtitle {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-weight: 400;
}

.exec-banner-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.exec-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.14);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    color: #FFFFFF;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.exec-meta-item select {
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    outline: none;
}

.exec-meta-item select option {
    background: #6D1B3D;
    color: #FFFFFF;
}

/* Secondary Quick Metrics Strip */
.exec-quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.exec-stat-pill {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, box-shadow 0.15s;
}

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

.exec-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.exec-stat-icon.icon-gold { background: #FEF3C7; color: #D97706; }
.exec-stat-icon.icon-blue { background: #DBEAFE; color: #2563EB; }
.exec-stat-icon.icon-green { background: #D1FAE5; color: #059669; }
.exec-stat-icon.icon-purple { background: #EDE9FE; color: #7C3AED; }

.exec-stat-val {
    font-size: 19px;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.2;
}

.exec-stat-label {
    font-size: 11.5px;
    color: #64748B;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Pagination SVG containment - Strictly eliminates giant Tailwind SVG arrows */
.pagination svg,
nav[role="navigation"] svg,
.relative.inline-flex.items-center svg,
svg.w-5.h-5 {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Clear duplicate DataTables floating info */
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font-size: 12px;
    color: var(--text-secondary);
    padding-top: 8px;
}

/* ==========================================================================
   BOOTSTRAP 4 PAGINATION REFINEMENT (CLEAN, COMPACT & CRISP)
   ========================================================================== */
.pagination {
    margin-bottom: 0;
    gap: 4px;
}

.pagination .page-item .page-link {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 6px 13px;
    background-color: #FFFFFF;
    transition: all 0.15s ease-in-out;
}

.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link {
    border-radius: 6px;
}

.pagination .page-item .page-link:hover {
    color: #1D4ED8;
    background-color: #EFF6FF;
    border-color: #BFDBFE;
}

.pagination .page-item.active .page-link {
    background-color: #1D4ED8;
    border-color: #1D4ED8;
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3);
}

.pagination .page-item.disabled .page-link {
    color: #94A3B8;
    background-color: #F8FAFC;
    border-color: #E2E8F0;
}

/* Status Badge Styles */
.badge-status-activo {
    background-color: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
}

.badge-status-inactivo {
    background-color: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}

.badge-status-proceso {
    background-color: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
}

/* ==========================================================================
   HIGH PERFORMANCE INSTANT MODALS & INTERACTIVE FEEDBACK
   ========================================================================== */
.modal.fade .modal-dialog {
    transform: scale(0.97) translateY(-8px) !important;
    transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s linear !important;
    will-change: transform, opacity;
}

.modal.show .modal-dialog {
    transform: none !important;
}

/* Instant button loading feedback state */
.btn.is-btn-loading,
.btn-detalle-modal.is-btn-loading {
    opacity: 0.8 !important;
    pointer-events: none !important;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15) !important;
}

.btn.is-btn-loading i,
.btn-detalle-modal.is-btn-loading i {
    animation: fa-spin 0.7s infinite linear !important;
}

.modal-backdrop.fade {
    transition: opacity 0.12s linear !important;
}

/* ==========================================================================
   SEGUIMIENTO VISUAL SEMAPHORE (SLA & URGENCY DOTS)
   ========================================================================== */
.semaphore-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}

.semaphore-dot:hover {
    transform: scale(1.3);
}

.semaphore-green {
    background-color: #10B981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.semaphore-yellow {
    background-color: #F59E0B !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.semaphore-red {
    background-color: #EF4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
    animation: pulse-red 2s infinite ease-in-out;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.1); }
}

/* ==========================================================================
   CENTRALIZED SPACING & PADDING FOR TABLES, CARDS, MODALS, AND FILTER BARS
   ========================================================================== */

/* 1. Table Cells (th / td) Spacing */
.table th,
.table td,
.dataTable th,
.dataTable td {
    padding: 12px 14px !important;
    vertical-align: middle !important;
}

.table thead th {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    letter-spacing: 0.3px;
}

/* 2. Container of Table / Card / X_Panel */
.x_panel,
.card {
    padding: 24px 26px !important;
    margin-bottom: 24px !important;
    border-radius: 10px !important;
    border: 1px solid #E2E8F0 !important;
    background-color: #FFFFFF !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

.x_title {
    padding: 6px 0 16px 0 !important;
    margin-bottom: 20px !important;
    border-bottom: 1px solid #E2E8F0 !important;
}

.table-responsive {
    padding: 6px 4px !important;
    margin-bottom: 18px !important;
}

/* 3. Modals: Dialog, Content, Header, Body, Footer */
.modal-dialog {
    margin: 1.75rem auto !important;
}

.modal-content {
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22) !important;
    overflow: hidden !important;
}

.modal-header {
    padding: 18px 26px !important;
    background-color: #F8FAFC !important;
    border-bottom: 1px solid #E2E8F0 !important;
}

.modal-body {
    padding: 26px 30px !important;
    font-size: 13.5px !important;
    line-height: 1.6 !important;
    background-color: #FFFFFF !important;
}

.modal-footer {
    padding: 18px 26px !important;
    background-color: #F8FAFC !important;
    border-top: 1px solid #E2E8F0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
}

/* 4. Forms inside Modals */
.modal-body form {
    padding: 6px 2px !important;
}

.modal-body .form-group {
    margin-bottom: 18px !important;
}

.modal-body .form-group label {
    margin-bottom: 6px !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    color: #475569 !important;
}

.modal-body .form-control {
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
}

/* 5. Filter Bar (Bandejas, Reportes, Bancos) */
.filter-bar,
.filters-container,
.bg-light.p-3.border.rounded,
.x_panel .bg-light {
    padding: 20px 24px !important;
    margin-bottom: 22px !important;
    border-radius: 10px !important;
    background-color: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

.filter-bar .form-group,
.filters-container .form-group,
.bg-light.p-3.border.rounded .form-group {
    margin-bottom: 10px !important;
}

.filter-bar label,
.filters-container label,
.bg-light.p-3.border.rounded label {
    margin-bottom: 6px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #475569 !important;
}
