body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #F8F9FA;
    background-image:
        radial-gradient(at 0% 0%, rgba(98, 43, 32, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(212, 175, 55, 0.04) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(98, 43, 32, 0.02) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(212, 175, 55, 0.03) 0px, transparent 50%),
        url("../img/natural-paper.png");
    background-attachment: fixed;
    min-height: 100vh;
}

/* Reset global pour supprimer les puces indésirables dans la navigation */
#sidebar-wrapper ul,
#sidebar-wrapper li,
#sidebarAccordion,
#sidebarAccordion ul,
#sidebarAccordion li,
.dropdown-menu,
.dropdown-menu li {
    list-style: none !important;
    list-style-type: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

#wrapper {
    display: flex;
    transition: all 0.3s ease;
    min-height: 100vh;
}

#page-content-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0 !important; /* FIX MAJEUR FLEXBOX: empêche les tableaux larges de faire scroller toute la page */
}

#page-content-wrapper>.container-fluid {
    flex: 1;
}

#page-content-wrapper {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

#wrapper.toggled #page-content-wrapper {
    margin-left: 0;
    width: 100%;
}

.navbar {
    position: relative;
    z-index: 1100;
    border-bottom: 1px solid #e0e0e0;
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
    #sidebar-wrapper {
        margin-left: -280px;
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
    }

    #page-content-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .topbar-container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .topbar-user-wrap {
        min-width: 0;
    }

    .user-nav-link {
        min-width: 0;
        max-width: calc(100vw - 110px);
        padding: 0.4rem;
    }

    .user-name-wrap {
        min-width: 0;
    }

    .user-name-text {
        display: block;
        max-width: 170px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

footer {
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

footer a {
    color: #6c757d;
    transition: color 0.2s;
}

footer a:hover {
    color: #0d6efd;
}

/* User Dropdown */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.user-avatar-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #622B20 0%, #8D4133 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-nav-link {
    color: #444;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.user-nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
}

.leading-none {
    line-height: 1.1;
}

.dropdown-menu {
    z-index: 1060 !important;
    /* Above sidebar if necessary, but mainly above content */
}

/* Add other styles here... */

/* Styles pour le sidebar amélioré - Premium Edition */
#sidebar-wrapper {
    height: 100vh;
    width: 280px;
    background: linear-gradient(180deg, #622B20 0%, #4A1F17 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.15);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#wrapper.toggled #sidebar-wrapper {
    left: -280px;
}

.sidebar-header {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    position: relative;
    backdrop-filter: blur(10px);
}

/* No Presidential Pattern */

.logo-container {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 0.75rem;
}

/* Sidebar Scrollbar Premium */
.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none !important;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    border-radius: 10px;
    position: relative;
    margin: 0.15rem 0.25rem;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(4px);
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(100, 181, 246, 0.3) 0%, rgba(100, 181, 246, 0.1) 100%);
    color: white;
    border-left: 4px solid #64b5f6;
    font-weight: 500;
}

/* Removed Gold pseudo-elements */

.sidebar-link.sidebar-sublink {
    font-size: 0.88rem;
    padding: 0.65rem 1rem;
    margin-left: 1.5rem; /* Ajusté à 1.5rem pour l'icône, au lieu de 2rem */
    opacity: 0.8;
}

.sidebar-link i:first-child {
    width: 24px;
    margin-right: 1rem;
    font-size: 1.2rem;
}

.sidebar-section-title {
    display: block;
    padding: 1.5rem 1.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1.5rem 0;
}

.sidebar-footer {
    padding: 1.25rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border-top: 2px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

.user-profile {
    display: block;
}

.avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: white;
}

/* Animations Accordion */
.collapse-transition {
    transition: all 0.3s ease-out;
}

/* Mobile Adjustments */
@media (max-width: 991px) {
    #sidebar-wrapper {
        width: 100%;
        max-width: 300px;
        left: -300px;
        z-index: 1200;
    }

    #wrapper.toggled #sidebar-wrapper {
        left: 0;
    }

    /* Simple Overlay when open */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 1150;
        display: none;
    }

    #wrapper.toggled .sidebar-overlay {
        display: block;
    }

    .navbar {
        z-index: 1100;
    }
}

/* Mes Dossiers Tabs */
.status-tabs-container {
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 14px;
    margin: 0.5rem;
    border: 1px solid rgba(212, 175, 55, 0.05);
}

.status-tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0.4rem;
    border-radius: 10px;
    transition: all 0.3s;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.4);
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status-tab i {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 0.4rem;
}

.status-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #D4AF37;
}

.status-tab.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.status-tab.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #64b5f6, #42a5f5);
    border-radius: 3px 3px 0 0;
}


/* ==========================================================================
   PRESIDENTIAL DESIGN SYSTEM 2.0 - REGISTRY OVERHAUL
   ========================================================================== */

:root {
    --pres-gold: #D4AF37;
    --pres-maroon: #622B20;
    --pres-maroon-dark: #4A1F17;
    --pres-maroon-light: #8D4133;
    --pres-glass-bg: rgba(255, 255, 255, 0.7);
    --pres-glass-border: rgba(255, 255, 255, 0.4);
    --pres-shadow: 0 10px 30px rgba(98, 43, 32, 0.05);
    --pres-glow: 0 0 15px rgba(212, 175, 55, 0.3);
}

/* Glassmorphism Stats Cards */
.stat-card-presidential {
    background: var(--pres-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--pres-glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--pres-shadow);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card-presidential:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 40px rgba(98, 43, 32, 0.12);
}

.stat-card-presidential .icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card-presidential:hover .icon-box {
    transform: scale(1.1) rotate(-5deg);
}

.stat-card-presidential .stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--pres-maroon);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card-presidential .stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--pres-maroon-light);
    opacity: 0.8;
}

/* Presidential Table (Card-Row System) */
.table-view-container {
    background: white;
    border-radius: 24px;
    box-shadow: var(--pres-shadow);
    border: 1px solid rgba(0, 0, 0, 0.03);
    margin-bottom: 2rem;
}

.presidential-table {
    border-collapse: separate !important;
    border-spacing: 0 12px !important;
    width: 100% !important;
}

.presidential-table thead th {
    border: none !important;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
    color: var(--pres-maroon-light);
    padding: 1rem 1.5rem !important;
}

.presidential-table tbody tr {
    background-color: #fff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.3s ease !important;
    border-radius: 12px;
}

.presidential-table tbody tr:hover {
    transform: scale(1.005) translateY(-2px);
    box-shadow: 0 8px 25px rgba(98, 43, 32, 0.08) !important;
    z-index: 10;
    position: relative;
}

.presidential-table tbody td {
    padding: 1.25rem 1.5rem !important;
    border: none !important;
    vertical-align: middle !important;
}

.presidential-table tbody td:first-child {
    border-radius: 12px 0 0 12px;
}

.presidential-table tbody td:last-child {
    border-radius: 0 12px 12px 0;
}

/* Status Soft Glow Pills */
.status-glow {
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.status-glow::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

.status-glow.en_creation {
    background: #FFF8E1;
    color: #F57F17;
}

.status-glow.en_cours {
    background: #E3F2FD;
    color: #1976D2;
}

.status-glow.cloture {
    background: #E8F5E9;
    color: #388E3C;
}

.status-glow.urgence {
    background: #FFEBEE;
    color: #D32F2F;
    animation: pulse-red 2s infinite;
}

.status-glow.ME_en_cours {
    background: #E0F7FA;
    color: #00838F;
}

.status-glow.conclu {
    background: #E8EAF6;
    color: #3F51B5;
}

.status-glow.juge {
    background: #E8F5E9;
    color: #388E3C;
}

.status-glow.en_attente_validation {
    background: #FFF8E1;
    color: #F57F17;
}

.status-glow.en_delibere {
    background: #FFF3E0;
    color: #E65100;
}

.status-glow.suspendu {
    background: #ECEFF1;
    color: #37474F;
}

.status-glow.en_recours {
    background: #FFEBEE;
    color: #D32F2F;
}

.status-glow.definitif {
    background: #E0F2F1;
    color: #00796B;
}


@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(211, 47, 47, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0);
    }
}

/* Action Buttons Premium */
.btn-presidential {
    background: var(--pres-maroon);
    border: none;
    color: white !important;
    border-radius: 12px;
    padding: 0.6rem 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(98, 43, 32, 0.2);
}

.btn-presidential:hover {
    background: var(--pres-maroon-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(98, 43, 32, 0.3);
}

/* Badge ID Ribbon */
.id-ribbon {
    display: inline-block;
    background: var(--pres-maroon);
    color: white;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

/* Mobile Card View (Registry) */
.mobile-list-container {
    display: none;
    padding: 1rem;
    gap: 1rem;
    flex-direction: column;
}

.presidential-mobile-card {
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 4px 15px rgba(98, 43, 32, 0.05);
}

/* Floating Action Button */
.pres-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--pres-maroon);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 10px 30px rgba(98, 43, 32, 0.4);
    border: 3px solid var(--pres-gold);
    z-index: 1000;
    transition: all 0.3s;
}

.pres-fab:hover {
    transform: scale(1.1) rotate(90deg);
    background: var(--pres-maroon-dark);
}

/* Smart Inbox Tabs */
.presidential-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #E0E0E0;
    padding-bottom: 0;
}

.pres-tab {
    padding: 0.8rem 1.5rem;
    font-weight: 700;
    color: #888;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.pres-tab:hover,
.pres-tab.active {
    color: var(--pres-maroon);
}

.pres-tab.active {
    border-bottom-color: var(--pres-maroon);
}

/* Status Filter Pills */
.status-filter-pill {
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #E0E0E0;
    background: white;
    color: #666;
    transition: all 0.2s;
}

.status-filter-pill:hover,
.status-filter-pill.active {
    border-color: var(--pres-maroon);
    background: var(--pres-maroon);
    color: white;
}

/* Instruction Badges */
.instruction-badge {
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.3s;
}

.instruction-pending {
    background: #E3F2FD;
    color: #1976D2;
    border: 1px solid #BBDEFB;
}

.instruction-urgent {
    background: #FFF3E0;
    color: #E65100;
    border: 1px solid #FFE0B2;
    animation: pulse 2s infinite;
}

.instruction-overdue {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@media (max-width: 991px) {
    .table-view-container {
        display: none !important;
    }

    .mobile-list-container {
        display: flex !important;
    }
}

/* Presidential Horizontal Stats Bar */
.presidential-stats-bar {
    display: flex;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--pres-glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid var(--pres-glass-border);
    box-shadow: var(--pres-shadow);
    margin: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.presidential-stats-bar::-webkit-scrollbar {
    display: none;
}

.stat-item-horizontal {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.25rem 1.5rem;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    min-width: max-content;
    flex: 1;
}

.stat-item-horizontal:last-child {
    border-right: none;
}

.stat-item-horizontal .icon-box-sm {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
}

.stat-info-wrap {
    display: flex;
    flex-direction: column;
}

.stat-info-wrap .stat-label {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--pres-maroon-light);
    margin-bottom: 2px;
    opacity: 0.7;
}

.stat-info-wrap .stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--pres-maroon);
    line-height: 1;
}

@media (max-width: 768px) {
    .presidential-stats-bar {
        margin: 1rem;
        padding: 1rem;
        gap: 0.75rem;
    }

    .stat-item-horizontal {
        padding: 0.25rem 0.75rem;
    }
}

/* Presidential Header & Title */
.presidential-header {
    background: linear-gradient(135deg, #6b4423 0%, #8b5a2b 100%);
    padding: 1.5rem 2rem;
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(107, 68, 35, 0.25);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.presidential-header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.08));
    pointer-events: none;
}

.title-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.official-seal {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(5px);
    color: white !important;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.presidential-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.85rem;
    font-weight: 800;
    margin: 0;
    color: #FFFFFF !important;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: initial;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

@media (max-width: 768px) {
    .presidential-title {
        font-size: 1.35rem;
    }

    .presidential-header {
        padding: 1.25rem;
    }
}

/* Enhanced Checkbox Styles */
.form-check-input {
    width: 1.25rem !important;
    height: 1.25rem !important;
    border: 2px solid #6b4423 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    background-color: white !important;
    transition: all 0.2s ease !important;
}

.form-check-input:hover {
    border-color: #8b5a2b !important;
    box-shadow: 0 0 0 3px rgba(107, 68, 35, 0.1) !important;
}

.form-check-input:checked {
    background-color: #6b4423 !important;
    border-color: #6b4423 !important;
    box-shadow: 0 0 0 3px rgba(107, 68, 35, 0.2) !important;
}

.form-check-input:focus {
    border-color: #8b5a2b !important;
    box-shadow: 0 0 0 4px rgba(107, 68, 35, 0.15) !important;
    outline: none !important;
}

/* Checkbox in table cells */
.presidential-table td .form-check-input,
.presidential-table th .form-check-input {
    margin: 0 auto !important;
    display: block !important;
}

/* ========================================
   RESPONSIVE DESIGN ENHANCEMENTS
   ======================================== */

/* Tablet Optimization (768px - 1024px) */
@media (max-width: 1024px) {
    .presidential-stats-bar {
        gap: 0.75rem;
    }

    .stat-card-presidential {
        padding: 1rem;
        min-width: 140px;
    }

    .stat-card-presidential .stat-value {
        font-size: 1.75rem;
    }

    .presidential-header {
        padding: 1.25rem 1.5rem;
    }

    .presidential-title {
        font-size: 1.5rem;
    }

    .official-seal {
        width: 44px;
        height: 44px;
    }
}

/* Mobile Optimization (max 768px) */
@media (max-width: 768px) {

    /* Container Spacing - Optimized for mobile */
    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* Page content wrapper optimization */
    #page-content-wrapper>.container-fluid {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    /* Header Responsive */
    .presidential-header {
        padding: 1rem;
        border-radius: 16px;
        margin-bottom: 1.5rem;
    }

    .presidential-header .d-flex {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start !important;
    }

    .title-group {
        gap: 1rem;
        width: 100%;
    }

    .official-seal {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .presidential-title {
        font-size: 1.25rem;
        line-height: 1.3;
    }

    /* Stats Bar Mobile - Improved */
    .presidential-stats-bar {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
        margin: 0 0 1rem 0 !important;
        border-radius: 16px;
    }

    .stat-item-horizontal {
        padding: 0.75rem;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        min-width: unset;
    }

    .stat-item-horizontal:last-child {
        border-bottom: none;
    }

    .stat-card-presidential {
        width: 100%;
        min-width: unset;
        padding: 0.875rem;
        border-radius: 14px;
    }

    .stat-card-presidential .stat-icon {
        order: 2;
        font-size: 1.75rem;
        margin-bottom: 0;
    }

    .stat-card-presidential .stat-label {
        order: 1;
        font-size: 0.85rem;
        text-align: left;
        margin-bottom: 0.25rem;
    }

    .stat-card-presidential .stat-value {
        order: 3;
        font-size: 1.5rem;
        text-align: left;
    }

    /* Tabs Mobile */
    .presidential-tabs {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .pres-tab {
        width: 100%;
        justify-content: space-between;
        padding: 0.875rem 1rem;
    }

    /* Filters Mobile */
    .filter-container {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .filter-label {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .status-filter-pill {
        flex: 1 1 auto;
        min-width: calc(50% - 0.25rem);
        text-align: center;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    /* Table Responsive */
    .table-view-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .presidential-table {
        font-size: 0.85rem;
    }

    .presidential-table th,
    .presidential-table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }

    /* Mobile Cards Enhancement */
    .presidential-mobile-card {
        margin-bottom: 0.75rem;
        border-radius: 12px;
    }

    .presidential-mobile-card .card-header {
        padding: 0.875rem;
    }

    .presidential-mobile-card .card-body {
        padding: 0.875rem;
    }

    /* Buttons Mobile */
    .btn-presidential,
    .btn-pres-gold {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    /* FAB Mobile - Touch Optimized */
    .pres-fab {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
        box-shadow: 0 8px 24px rgba(98, 43, 32, 0.35);
    }

    .pres-fab:active {
        transform: scale(0.95);
    }
}

/* Small Mobile (max 480px) */
@media (max-width: 480px) {
    .presidential-title {
        font-size: 1.1rem;
    }

    .official-seal {
        width: 36px;
        height: 36px;
    }

    .stat-card-presidential .stat-value {
        font-size: 1.35rem;
    }

    .stat-card-presidential .stat-icon {
        font-size: 1.5rem;
    }

    .status-filter-pill {
        min-width: 100%;
        font-size: 0.75rem;
    }

    .presidential-table {
        font-size: 0.8rem;
    }

    .btn-presidential,
    .btn-pres-gold {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Large Desktop (min 1400px) */
@media (min-width: 1400px) {
    .container-fluid {
        max-width: 1600px;
        margin: 0 auto;
    }

    .presidential-stats-bar {
        gap: 1.5rem;
    }

    .stat-card-presidential {
        min-width: 200px;
        padding: 1.5rem;
    }

    .presidential-title {
        font-size: 2rem;
    }
}

/* Print Styles */
@media print {

    .presidential-header,
    .presidential-stats-bar,
    .presidential-tabs,
    .filter-container {
        break-inside: avoid;
    }

    .pres-fab,
    .btn-presidential,
    .btn-pres-gold {
        display: none !important;
    }

    .presidential-table {
        font-size: 10pt;
    }

    body {
        background: white !important;
    }
}

/* ========================================
   PROFESSIONAL WIZARD & FORM STYLES
   ======================================== */

/* Wizard Container */
.wizard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Wizard Header */
.wizard-header {
    background: linear-gradient(135deg, #6b4423 0%, #8b5a2b 100%);
    padding: 1.5rem 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(107, 68, 35, 0.2);
    margin-bottom: 2rem;
}

.wizard-title {
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wizard-title i {
    font-size: 1.5rem;
}

/* Step Indicator Modern */
.step-indicator-modern {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.step-indicator {
    padding: 30px 0;
    background: linear-gradient(to bottom, #f5f0ed 0%, #ffffff 100%);
    border-radius: 10px;
    margin-bottom: 30px;
}

.progress-container {
    padding: 20px;
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e9ecef;
    border: 3px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: #6c757d;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.step-item.active .step-circle {
    background: linear-gradient(135deg, #6b4423 0%, #8b5a2b 100%);
    border-color: #6b4423;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(107, 68, 35, 0.4);
}

.step-item.completed .step-circle {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #28a745;
    color: white;
    animation: checkmark 0.5s ease;
}

@keyframes checkmark {
    0% {
        transform: scale(0.8);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.step-label {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
    text-align: center;
    max-width: 120px;
    transition: all 0.3s ease;
}

.step-item.active .step-label {
    color: #6b4423;
    font-size: 14px;
}

.step-item.completed .step-label {
    color: #28a745;
}

.step-line {
    flex: 1;
    height: 3px;
    background-color: #dee2e6;
    position: relative;
    margin: 0 10px;
    transition: all 0.3s ease;
}

.step-line.completed {
    background: linear-gradient(to right, #28a745 0%, #20c997 100%);
}

/* Professional Form Fields */
.form-group-pro {
    margin-bottom: 1.5rem;
}

.form-label-pro {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    display: block;
}

.form-control-pro {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.form-control-pro:focus {
    border-color: #6b4423;
    box-shadow: 0 0 0 4px rgba(107, 68, 35, 0.1);
    outline: none;
}

.form-control-pro.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

.form-control-pro.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
}

/* Wizard Navigation */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f0f0;
}

.btn-wizard-prev,
.btn-wizard-next {
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn-wizard-prev {
    background: white;
    border: 2px solid #6b4423;
    color: #6b4423;
}

.btn-wizard-prev:hover {
    background: #6b4423;
    color: white;
    transform: translateX(-3px);
}

.btn-wizard-next {
    background: linear-gradient(135deg, #6b4423 0%, #8b5a2b 100%);
    color: white;
}

.btn-wizard-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(107, 68, 35, 0.3);
}

/* Form Content Card */
.wizard-form-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

/* Error Alert Enhancement */
.alert-danger {
    border-left: 4px solid #dc3545;
    border-radius: 12px;
    background: #fff5f5;
}

/* Select2 Enhancement */
.select2-container--default .select2-selection--single {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    height: auto;
    padding: 0.5rem;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #6b4423;
    box-shadow: 0 0 0 4px rgba(107, 68, 35, 0.1);
}

/* Responsive Wizard Styles */
@media (max-width: 768px) {
    .wizard-header {
        padding: 1.25rem 1.5rem;
        border-radius: 16px;
    }

    .wizard-title {
        font-size: 1.35rem;
    }

    /* Vertical Step Indicator for Mobile */
    .progress-container {
        overflow-x: visible;
        padding: 10px 5px;
    }

    .progress-steps {
        flex-direction: column;
        align-items: flex-start;
        min-width: unset !important;
    }

    .step-line {
        width: 3px;
        height: 40px;
        margin: 10px 0 10px 23px;
        flex: none;
    }

    .step-item {
        flex-direction: row;
        width: 100%;
        text-align: left;
        align-items: center;
    }

    .step-circle {
        width: 46px;
        height: 46px;
        font-size: 16px;
        flex-shrink: 0;
    }

    .step-label {
        margin-top: 0;
        margin-left: 15px;
        text-align: left;
        max-width: none;
        font-size: 13px;
    }

    .step-item.active .step-label {
        font-size: 14px;
    }

    .wizard-form-card {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .wizard-nav {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .btn-wizard-prev,
    .btn-wizard-next {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .wizard-title {
        font-size: 1.15rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .step-label {
        font-size: 12px;
    }

    .form-control-pro {
        font-size: 0.95rem;
        padding: 0.65rem 0.875rem;
    }
}

/* ========================================
   PROFESSIONAL FORM TABLES
   ======================================== */

/* Wizard Form Tables */
.wizard-form-card table,
.wizard-container table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wizard-form-card table thead,
.wizard-container table thead {
    background: linear-gradient(135deg, #6b4423 0%, #8b5a2b 100%);
}

.wizard-form-card table thead th,
.wizard-container table thead th {
    color: white;
    font-weight: 600;
    padding: 1rem 0.75rem;
    border: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wizard-form-card table tbody tr,
.wizard-container table tbody tr {
    transition: all 0.2s ease;
    background: white;
}

.wizard-form-card table tbody tr:nth-child(even),
.wizard-container table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.wizard-form-card table tbody tr:hover,
.wizard-container table tbody tr:hover {
    background: #f5f0ed;
    transform: translateX(2px);
}

.wizard-form-card table tbody td,
.wizard-container table tbody td {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.wizard-form-card table tbody tr:last-child td,
.wizard-container table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Actions */
.wizard-form-card table .btn-sm,
.wizard-container table .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

/* Responsive Table Wrapper */
.table-responsive-wizard {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

/* Mobile Table Optimization */
@media (max-width: 768px) {

    .wizard-form-card table,
    .wizard-container table {
        font-size: 0.85rem;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    }

    .wizard-form-card table thead th,
    .wizard-container table thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }

    .wizard-form-card table tbody td,
    .wizard-container table tbody td {
        padding: 0.65rem 0.5rem;
        font-size: 0.85rem;
    }

    /* Stack table on very small screens */
    .table-responsive-wizard {
        margin: 0 -1rem 1.5rem -1rem;
        border-radius: 0;
    }
}

@media (max-width: 480px) {

    .wizard-form-card table,
    .wizard-container table {
        font-size: 0.8rem;
    }

    .wizard-form-card table thead th,
    .wizard-container table thead th {
        padding: 0.625rem 0.375rem;
        font-size: 0.75rem;
    }

    .wizard-form-card table tbody td,
    .wizard-container table tbody td {
        padding: 0.5rem 0.375rem;
        white-space: nowrap;
    }

    .wizard-form-card table .btn-sm,
    .wizard-container table .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}