/* ============================================================
   Diabate Multiservices — Premium UI
   ============================================================ */

/* ============================================================
   Premium scrollbars (Chrome, Edge, Safari, Firefox)
   ============================================================ */
* {
    scrollbar-width: thin;
    scrollbar-color: #006837 #e8f5ee;
}
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
*::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #f0faf4 0%, #e8f5ee 100%);
    border-radius: 10px;
}
*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #008a4a 0%, #006837 50%, #004d29 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    min-height: 40px;
}
*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #F15A24 0%, #e04a12 100%);
    background-clip: padding-box;
    border: 2px solid transparent;
}
*::-webkit-scrollbar-thumb:active {
    background: #c2410c;
    background-clip: padding-box;
}
*::-webkit-scrollbar-corner {
    background: transparent;
}
.app-sidebar {
    scrollbar-color: rgba(241,90,36,.85) rgba(0,0,0,.15);
}
.app-sidebar::-webkit-scrollbar-track {
    background: rgba(0,0,0,.15);
}
.app-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #F15A24, #c2410c);
    border: 2px solid transparent;
    background-clip: padding-box;
}
body.theme-dark * {
    scrollbar-color: #006837 #1e293b;
}
body.theme-dark *::-webkit-scrollbar-track {
    background: #1e293b;
}
body.theme-dark *::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #008a4a, #006837);
    background-clip: padding-box;
    border: 2px solid transparent;
}

:root {
    --orange: #F15A24;
    --orange-light: #FF7A45;
    --orange-dark: #D14A1A;
    --green: #006837;
    --green-dark: #004D29;
    --green-light: #008C4A;
    --sidebar-w: 260px;
    --sidebar-collapsed: 78px;
    --header-h: 64px;
    --radius: 14px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
    --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    overflow-x: hidden;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse-soft {
    0%, 100% { box-shadow: 0 0 0 0 rgba(241, 90, 36, 0.35); }
    50%      { box-shadow: 0 0 0 10px rgba(241, 90, 36, 0); }
}

.anim-fade-in     { animation: fadeIn 0.45s ease both; }
.anim-fade-up     { animation: fadeInUp 0.5s ease both; }
.anim-slide-left  { animation: slideInLeft 0.45s ease both; }
.anim-scale       { animation: scaleIn 0.4s ease both; }

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.12s; }
.stagger-3 { animation-delay: 0.19s; }
.stagger-4 { animation-delay: 0.26s; }
.stagger-5 { animation-delay: 0.33s; }

/* ---------- Sidebar ---------- */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, var(--green-dark) 0%, #00331c 50%, #001f12 100%);
    color: #fff;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width var(--transition);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-decoration: none;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    padding: 3px;
    object-fit: contain;
    flex-shrink: 0;
    border: 2px solid var(--orange);
    transition: transform var(--transition);
}

.sidebar-brand:hover img {
    transform: scale(1.06) rotate(-3deg);
}

.sidebar-brand .brand-text {
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-brand .brand-text strong {
    display: block;
    font-size: 0.95rem;
    letter-spacing: 0.4px;
}

.sidebar-brand .brand-text small {
    font-size: 0.65rem;
    opacity: 0.6;
    font-weight: 400;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    padding: 6px 10px 8px;
    overflow: hidden; /* pas de scroll — tout visible */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1px;
}

.sidebar-nav .nav-label {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.45;
    padding: 6px 10px 2px;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    margin-bottom: 0;
    border-radius: 9px;
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.84rem;
    transition: all var(--transition);
    white-space: nowrap;
    flex: 0 1 auto;
    min-height: 0;
    line-height: 1.2;
}

.sidebar-nav a i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar-nav a:hover i {
    transform: scale(1.15);
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(241, 90, 36, 0.35);
}

.sidebar-nav a.active i {
    transform: scale(1.1);
}

.sidebar-footer {
    padding: 8px 12px 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.85);
    font-size: 0.88rem;
}

.sidebar-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* ---------- Main content ---------- */
.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    transition: margin-left var(--transition);
    display: flex;
    flex-direction: column;
}

.app-topbar {
    height: var(--header-h);
    background: #fff;
    border-bottom: 1px solid #e8eaed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}

.app-topbar .page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--green-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-content {
    flex: 1;
    padding: 28px;
}

/* ---------- Cards ---------- */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: #fff;
    transition: transform var(--transition), box-shadow var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #fff;
    border: none;
    font-weight: 600;
    padding: 14px 20px;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* Stat cards */
.stat-card {
    border-radius: var(--radius);
    border: none;
    overflow: hidden;
    position: relative;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
}

.stat-card.orange-card {
    background: linear-gradient(135deg, #fff 0%, #fff8f5 100%);
    border-left: 4px solid var(--orange);
}
.stat-card.orange-card .stat-icon {
    background: rgba(241, 90, 36, 0.12);
    color: var(--orange);
}

.stat-card.green-card {
    background: linear-gradient(135deg, #fff 0%, #f0faf5 100%);
    border-left: 4px solid var(--green);
}
.stat-card.green-card .stat-icon {
    background: rgba(0, 104, 55, 0.12);
    color: var(--green);
}

/* ---------- Buttons ---------- */
.btn-orange {
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.55rem 1.3rem;
    transition: all var(--transition);
    box-shadow: 0 4px 14px rgba(241, 90, 36, 0.3);
}
.btn-orange:hover, .btn-orange:focus {
    background: linear-gradient(135deg, var(--orange-dark) 0%, #b83a10 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(241, 90, 36, 0.4);
}

.btn-green {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.55rem 1.3rem;
    transition: all var(--transition);
    box-shadow: 0 4px 14px rgba(0, 104, 55, 0.25);
}
.btn-green:hover, .btn-green:focus {
    background: linear-gradient(135deg, var(--green-dark) 0%, #00331c 100%);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-orange {
    border: 2px solid var(--orange);
    color: var(--orange);
    font-weight: 600;
    border-radius: 10px;
    background: transparent;
    transition: all var(--transition);
}
.btn-outline-orange:hover {
    background: var(--orange);
    color: #fff;
}

.btn-outline-primary, .btn-outline-success, .btn-outline-secondary {
    border-radius: 10px;
    font-weight: 500;
}

/* ---------- Forms ---------- */
.form-control, .form-select {
    border-radius: 10px;
    border: 1.5px solid #e0e4e8;
    padding: 0.6rem 0.9rem;
    transition: all var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.15);
}
.form-label {
    font-weight: 600;
    color: var(--green-dark);
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}

/* ---------- Tables ---------- */
.table { margin-bottom: 0; }
.table thead {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #fff;
}
.table thead th {
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 12px 16px;
    white-space: nowrap;
}
.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-color: #f0f2f5;
}
.table-hover tbody tr { transition: background var(--transition); }
.table-hover tbody tr:hover { background: #f8faf9; }

.badge-statut {
    font-size: 0.78rem;
    padding: 0.4em 0.75em;
    border-radius: 8px;
    font-weight: 600;
}

/* ---------- Modal premium ---------- */
.modal-content {
    border: none;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18);
    animation: scaleIn 0.3s ease;
    max-height: min(92vh, 92dvh);
    display: flex;
    flex-direction: column;
}
.modal-content.modal-colis {
    /* form is the flex container (header sticky + body scroll) */
}
.modal-dialog-scrollable {
    max-height: min(92vh, 92dvh);
    margin-top: 1rem;
    margin-bottom: 1rem;
}
.modal-dialog-scrollable .modal-content {
    max-height: inherit;
}
.modal-dialog-scrollable .modal-form-flex {
    display: flex;
    flex-direction: column;
    max-height: inherit;
    min-height: 0;
    flex: 1 1 auto;
}
.modal-dialog-scrollable .modal-body {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    flex: 1 1 auto;
    min-height: 0;
}
.modal-header {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: #fff;
    border: none;
    padding: 14px 16px 14px 20px;
    flex-shrink: 0;
}
.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}
.modal-form-flex {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: inherit;
    flex: 1 1 auto;
}
.modal-header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 5;
}
.modal-header-actions .modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}
.modal-header-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.btn-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-modal-icon:active { transform: scale(0.94); }
.btn-modal-reset {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.btn-modal-reset:hover {
    background: rgba(255,255,255,0.28);
    color: #fff;
}
.btn-modal-cancel {
    background: rgba(255,255,255,0.18);
    color: #fff;
}
.btn-modal-cancel:hover {
    background: rgba(255,255,255,0.3);
    color: #fff;
}
.btn-modal-save {
    background: #F15A24;
    color: #fff;
    box-shadow: 0 4px 12px rgba(241, 90, 36, 0.4);
}
.btn-modal-save:hover {
    background: #e04e1a;
    color: #fff;
}
.modal-body { padding: 24px; }
.modal-footer {
    border-top: 1px solid #f0f2f5;
    padding: 16px 24px;
    flex-shrink: 0;
    background: #fff;
    z-index: 2;
}

/* Mobile modal: sticky header actions + scrollable body */
@media (max-width: 767.98px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    .modal-dialog-centered {
        align-items: flex-start;
        min-height: calc(100% - 1rem);
    }
    .modal-dialog-scrollable,
    .modal-dialog-scrollable .modal-content {
        max-height: calc(100dvh - 1rem);
        max-height: calc(100vh - 1rem);
    }
    .modal-form-flex {
        max-height: inherit;
    }
    .modal-dialog-scrollable .modal-body {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        flex: 1 1 auto;
        min-height: 0;
        padding: 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    .modal-header-actions {
        position: sticky;
        top: 0;
        z-index: 5;
        padding-top: max(12px, env(safe-area-inset-top));
    }
    .btn-modal-icon {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
    .colis-line-row {
        padding-right: 36px;
    }
}

/* ---------- Login page ---------- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--green-dark) 0%, #001f12 40%, #002819 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(241,90,36,0.15) 0%, transparent 70%);
    top: -120px;
    right: -100px;
    animation: pulse-soft 4s ease-in-out infinite;
}
.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,140,74,0.2) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
}

.login-card {
    max-width: 420px;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35);
    position: relative;
    z-index: 1;
    animation: scaleIn 0.5s ease;
}

.login-header {
    background: #fff;
    text-align: center;
    padding: 2.2rem 1.5rem 1rem;
}
.login-header img {
    width: 130px;
    height: 130px;
    object-fit: contain;
    margin-bottom: 0.4rem;
    animation: fadeInUp 0.6s ease;
}
.login-header h5 {
    color: var(--green);
    font-weight: 600;
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.login-body {
    background: #fff;
    padding: 1.2rem 2rem 2rem;
}
.login-body .form-control {
    border-radius: 12px;
    padding: 0.7rem 1rem;
}
.login-body .btn-orange {
    border-radius: 12px;
    padding: 0.75rem;
    font-size: 1rem;
}

/* ---------- Print ---------- */
@media print {
    body * { visibility: hidden; }
    .print-area, .print-area * { visibility: visible; }
    .print-area { position: absolute; left: 0; top: 0; width: 100%; }
    .no-print, .app-sidebar, .app-topbar { display: none !important; }
}

.ticket-label {
    max-width: 800px;
    margin: 0 auto;
    border: 3px solid var(--orange);
    border-radius: 16px;
    overflow: hidden;
    background: white;
    font-family: Arial, sans-serif;
}
.ticket-header {
    background: linear-gradient(90deg, var(--orange) 0%, #FF8A50 50%, var(--green) 100%);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}
.ticket-header .logo-box {
    background: white;
    border-radius: 50%;
    padding: 6px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ticket-header .logo-box img {
    max-width: 58px;
    max-height: 58px;
    object-fit: contain;
}
.ticket-title { color: white; flex: 1; }
.ticket-title h1 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 2px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}
.ticket-title .subtitle {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ticket-values {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 8px;
    background: #fff8f5;
    border-bottom: 2px solid var(--orange);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--green);
}
.ticket-body { padding: 16px 24px; }
.ticket-row {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.ticket-field {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--orange);
}
.ticket-field.green-border { border-left-color: var(--green); }
.ticket-field .icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}
.ticket-field .icon.orange { background: var(--orange); }
.ticket-field .icon.green { background: var(--green); }
.ticket-field .label { font-size: 0.75rem; color: #666; margin-bottom: 0; }
.ticket-field .value { font-weight: 700; font-size: 1.05rem; color: var(--orange); }
.ticket-field .value.green { color: var(--green); }
.ticket-footer {
    display: flex;
    background: linear-gradient(90deg, var(--orange) 0%, var(--green) 100%);
    color: white;
    font-size: 0.85rem;
}
.ticket-footer > div {
    flex: 1;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ticket-footer .divider { width: 1px; background: rgba(255,255,255,0.4); }

.facture {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}
.facture-header {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.facture-body { padding: 24px; }
.facture table th { background: var(--green); color: white; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: linear-gradient(to bottom, var(--orange), var(--green));
    border-radius: 2px;
}
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.timeline-item.latest .timeline-dot {
    border-color: var(--green);
    background: var(--green);
    color: white;
    box-shadow: 0 0 0 4px rgba(0, 104, 55, 0.2);
}
.timeline-card {
    background: #fff;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border-left: 4px solid var(--orange);
}
.timeline-item.latest .timeline-card { border-left-color: var(--green); }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .app-sidebar { width: var(--sidebar-collapsed); }
    .app-sidebar .brand-text,
    .app-sidebar .nav-label,
    .app-sidebar a span,
    .app-sidebar .sidebar-user .user-info { display: none; }
    .app-sidebar a { justify-content: center; padding: 12px; }
    .app-sidebar a i { font-size: 1.35rem; }
    .sidebar-brand { justify-content: center; padding: 16px 8px; }
    .app-main { margin-left: var(--sidebar-collapsed); }
    .sidebar-footer { display: flex; justify-content: center; }
}

@media (max-width: 576px) {
    .app-content { padding: 16px; }
    .app-topbar { padding: 0 16px; }
}

.text-orange { color: var(--orange) !important; }
.text-green { color: var(--green) !important; }

/* ========== PREMIUM UPGRADES ========== */

/* Topbar enhanced */
.app-topbar {
    height: auto;
    min-height: var(--header-h);
    padding: 12px 28px;
    flex-wrap: wrap;
    gap: 12px;
}
.topbar-left { display: flex; flex-direction: column; gap: 2px; }
.topbar-greeting {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}
.topbar-greeting strong { color: var(--green-dark); }
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.topbar-clock {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--green-dark);
    background: #f0f2f5;
    padding: 6px 12px;
    border-radius: 20px;
}
.topbar-meta {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Premium stat cards with solid/gradient backgrounds */
.stat-card-premium {
    border: none;
    border-radius: 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
    min-height: 110px;
}
.stat-card-premium::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    top: -30px;
    right: -30px;
}
.stat-card-premium::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    bottom: -20px;
    left: 40%;
}
.stat-card-premium .card-body {
    position: relative;
    z-index: 1;
}
.stat-card-premium .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}
.stat-card-premium .stat-label {
    font-size: 0.82rem;
    opacity: 0.9;
    font-weight: 500;
}
.stat-card-premium .stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.2;
}
.stat-bg-orange {
    background: linear-gradient(135deg, #F15A24 0%, #e03e0b 50%, #c43508 100%);
    box-shadow: 0 8px 24px rgba(241, 90, 36, 0.3);
}
.stat-bg-amber {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.28);
}
.stat-bg-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.28);
}
.stat-bg-green {
    background: linear-gradient(135deg, #006837 0%, #004d29 100%);
    box-shadow: 0 8px 24px rgba(0, 104, 55, 0.3);
}
.stat-bg-soft-orange {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    color: var(--orange-dark);
    border: 1px solid #fed7aa;
}
.stat-bg-soft-orange .stat-icon { background: rgba(241,90,36,0.15); color: var(--orange); }
.stat-bg-soft-green {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: var(--green-dark);
    border: 1px solid #a7f3d0;
}
.stat-bg-soft-green .stat-icon { background: rgba(0,104,55,0.12); color: var(--green); }

/* Table dropdown fix - prevent clipping */
.table-responsive { overflow: visible !important; }
.card-body.p-0 { overflow: visible; }
.table { overflow: visible; }
.dropdown-menu {
    z-index: 1050;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border: none;
    border-radius: 10px;
    padding: 6px;
}
.dropdown-menu .dropdown-item {
    border-radius: 8px;
    font-size: 0.88rem;
    padding: 8px 12px;
}
.dropdown-menu .dropdown-item:hover {
    background: rgba(0,104,55,0.08);
}

/* Multi-colis rows */
.colis-line-row {
    background: #f8faf9;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px dashed #d1d5db;
    position: relative;
}
.colis-line-row .remove-line {
    position: absolute;
    top: 8px;
    right: 8px;
}

/* Guide & FAQ */
.guide-step {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    margin-bottom: 12px;
    transition: all var(--transition);
}
.guide-step:hover {
    border-color: var(--orange);
    box-shadow: var(--shadow);
}
.guide-step .step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}
.accordion-button:not(.collapsed) {
    background: rgba(0,104,55,0.06);
    color: var(--green-dark);
    box-shadow: none;
}
.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.15);
}

/* PWA install banner */
.pwa-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    padding: 14px 20px;
    display: none;
    align-items: center;
    gap: 14px;
    max-width: 420px;
    width: calc(100% - 32px);
}
.pwa-banner.show { display: flex; }

/* Bouton menu hamburger */
.btn-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #1e293b;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: all .2s ease;
    cursor: pointer;
}
.btn-menu-toggle:hover, .btn-menu-toggle:active {
    background: linear-gradient(135deg, var(--orange), #e04a12);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(241,90,36,.35);
}
.topbar-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}
.topbar-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* Overlay + bottom nav hidden on desktop */
.sidebar-overlay { display: none; }
.mobile-bottom-nav { display: none; }

/* Mobile : drawer premium + bottom nav 4 items */
@media (max-width: 767px) {
    .btn-menu-toggle { display: inline-flex; }

    .app-sidebar {
        width: min(300px, 86vw);
        height: 100%;
        height: 100dvh;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        flex-direction: column;
        z-index: 1060;
        transform: translateX(-105%);
        transition: transform .28s cubic-bezier(.4,0,.2,1);
        box-shadow: 8px 0 40px rgba(0,0,0,.25);
        background: linear-gradient(180deg, #004d29 0%, #002918 100%);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }
    .sidebar-brand, .sidebar-footer, .nav-label {
        display: flex !important;
    }
    .sidebar-brand { display: flex !important; }
    .sidebar-nav {
        display: flex;
        flex-direction: column;
        padding: 8px 12px 24px;
        overflow: visible;
    }
    .sidebar-nav a {
        flex-direction: row;
        gap: 12px;
        padding: 12px 14px;
        font-size: 0.95rem;
        margin: 2px 0;
        text-align: left;
        min-width: 0;
        border-radius: 12px;
    }
    .sidebar-nav a i { font-size: 1.15rem; width: 22px; }
    .sidebar-nav a span {
        display: inline;
        white-space: normal;
        overflow: visible;
        max-width: none;
        font-size: 0.95rem;
    }
    .sidebar-nav a.active {
        background: linear-gradient(135deg, var(--orange), #e04a12);
        color: #fff;
        box-shadow: 0 4px 16px rgba(241,90,36,.35);
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 1055;
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
        backdrop-filter: blur(2px);
    }
    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1040;
        background: linear-gradient(180deg, #003d22 0%, #001a0f 100%);
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
        justify-content: space-around;
        box-shadow: 0 -4px 24px rgba(0,0,0,.18);
        border-top: 1px solid rgba(255,255,255,.06);
    }
    .mobile-bottom-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 8px 4px;
        color: rgba(255,255,255,.65);
        text-decoration: none;
        font-size: 0.65rem;
        font-weight: 600;
        border-radius: 14px;
        max-width: 90px;
        transition: all .2s ease;
    }
    .mobile-bottom-nav a i { font-size: 1.3rem; }
    .mobile-bottom-nav a.active {
        color: #fff;
        background: linear-gradient(145deg, var(--orange), #d94812);
        box-shadow: 0 4px 16px rgba(241,90,36,.4);
    }

    .app-main {
        margin-left: 0;
        margin-bottom: 72px;
    }
    .app-topbar { padding: 10px 14px; }
    .app-content { padding: 14px; }
    .stat-card-premium .stat-value { font-size: 1.4rem; }
    .topbar-greeting { font-size: 0.78rem; }
    .page-title { font-size: 1.1rem; }
}

/* Ticket premium redesign matching original label style */
.ticket-pro {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 2px solid #e5e7eb;
}
.ticket-pro-header {
    background: linear-gradient(90deg, #F15A24 0%, #ff7a45 40%, #006837 100%);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
}
.ticket-pro-header .logo-circle {
    width: 72px;
    height: 72px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.5);
}
.ticket-pro-header .logo-circle img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.ticket-pro-header h1 {
    font-size: 2.2rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: 3px;
    text-shadow: 1px 2px 4px rgba(0,0,0,0.2);
}
.ticket-pro-header .sub {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 4px;
    opacity: 0.95;
}
.ticket-pro-values {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 10px;
    background: #fff8f5;
    border-bottom: 2px solid var(--orange);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--green);
    flex-wrap: wrap;
}
.ticket-pro-body { padding: 20px 24px; }
.ticket-pro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.ticket-pro-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f9fafb;
    border-radius: 12px;
    border-left: 4px solid var(--orange);
}
.ticket-pro-field.green { border-left-color: var(--green); }
.ticket-pro-field.full { grid-column: 1 / -1; }
.ticket-pro-field .ico {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.ticket-pro-field .ico.o { background: var(--orange); }
.ticket-pro-field .ico.g { background: var(--green); }
.ticket-pro-field .lbl { font-size: 0.72rem; color: #6b7280; margin: 0; }
.ticket-pro-field .val { font-weight: 700; font-size: 1.05rem; color: var(--orange); }
.ticket-pro-field.green .val { color: var(--green); }
.ticket-pro-footer {
    display: flex;
    background: linear-gradient(90deg, var(--orange) 0%, #c2410c 33%, #166534 66%, var(--green) 100%);
    color: #fff;
    font-size: 0.82rem;
}
.ticket-pro-footer > div {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-right: 1px solid rgba(255,255,255,0.2);
}
.ticket-pro-footer > div:last-child { border-right: none; }
@media (max-width: 640px) {
    .ticket-pro-grid { grid-template-columns: 1fr; }
    .ticket-pro-header h1 { font-size: 1.5rem; }
    .ticket-pro-footer { flex-direction: column; }
    .ticket-pro-footer > div { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.2); }
}

/* Dark theme support */
body.theme-dark {
    background: #0f172a;
    color: #e2e8f0;
}
body.theme-dark .app-main { background: #0f172a; }
body.theme-dark .app-topbar,
body.theme-dark .card,
body.theme-dark .modal-content {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}
body.theme-dark .table tbody td { border-color: #334155; color: #e2e8f0; }
body.theme-dark .form-control,
body.theme-dark .form-select {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
body.theme-dark .text-muted { color: #94a3b8 !important; }
body.theme-dark .app-topbar .page-title { color: #f1f5f9; }

/* ============================================================
   Responsive tables — card layout on mobile
   ============================================================ */
@media (max-width: 767.98px) {
    .table-responsive {
        overflow: visible !important;
        border: none !important;
        box-shadow: none !important;
    }
    .table-mobile-cards thead {
        display: none;
    }
    .table-mobile-cards,
    .table-mobile-cards tbody,
    .table-mobile-cards tr,
    .table-mobile-cards td {
        display: block;
        width: 100%;
    }
    .table-mobile-cards tbody tr {
        background: #fff;
        border: 1px solid rgba(0,0,0,.06);
        border-radius: 14px;
        margin-bottom: 12px;
        padding: 12px 14px;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    }
    .table-mobile-cards tbody td {
        border: none !important;
        padding: 6px 0 !important;
        text-align: left !important;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
    }
    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-size: 0.72rem;
        font-weight: 700;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        flex-shrink: 0;
        max-width: 42%;
        padding-top: 2px;
    }
    .table-mobile-cards tbody td[data-label=""] {
        justify-content: flex-end;
        padding-top: 10px !important;
        border-top: 1px dashed #e5e7eb !important;
        margin-top: 4px;
    }
    .table-mobile-cards tbody td[data-label=""]::before {
        display: none;
    }
    .table-mobile-cards .dropdown-menu {
        position: absolute !important;
    }
}

/* Premium action menu */
.btn-actions {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    transition: all .2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.btn-actions:hover, .btn-actions:focus, .btn-actions.show {
    background: linear-gradient(135deg, var(--orange), #e04a12);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(241,90,36,.35);
}
.dropdown-menu-actions {
    border: none;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(15,23,42,.15);
    padding: 8px;
    min-width: 210px;
}
.dropdown-menu-actions .dropdown-item {
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dropdown-menu-actions .dropdown-item i {
    width: 18px;
    text-align: center;
}
.dropdown-menu-actions .dropdown-item:hover {
    background: #fff7ed;
    color: var(--orange);
}
.dropdown-menu-actions .dropdown-item.text-danger:hover {
    background: #fef2f2;
    color: #dc2626;
}
.dropdown-menu-actions .dropdown-divider {
    margin: 6px 4px;
}


/* Mobile drawer — compact premium, one screen */
@media (max-width: 767px) {
    .app-sidebar {
        width: min(280px, 82vw) !important;
        height: 100dvh !important;
        overflow: hidden !important;
    }
    .sidebar-brand {
        padding: 14px 14px 10px !important;
        gap: 10px !important;
    }
    .sidebar-brand img {
        width: 40px !important;
        height: 40px !important;
    }
    .sidebar-brand .brand-text strong {
        font-size: 1.05rem !important;
    }
    .sidebar-brand .brand-text small {
        font-size: 0.68rem !important;
    }
    .sidebar-nav {
        padding: 4px 10px 6px !important;
        gap: 0 !important;
        overflow: hidden !important;
    }
    .sidebar-nav .nav-label {
        font-size: 0.58rem !important;
        letter-spacing: 1.2px !important;
        padding: 5px 10px 2px !important;
        margin: 0 !important;
        opacity: 0.55;
    }
    .sidebar-nav a {
        padding: 6px 12px !important;
        font-size: 0.82rem !important;
        margin: 0 !important;
        border-radius: 9px !important;
        gap: 10px !important;
        min-height: 0 !important;
    }
    .sidebar-nav a i {
        font-size: 1.05rem !important;
        width: 20px !important;
    }
    .sidebar-footer {
        padding: 10px 12px 14px !important;
    }
    .sidebar-user .avatar {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.85rem !important;
    }
    .sidebar-user .user-info strong {
        font-size: 0.85rem !important;
    }
    .sidebar-user .user-info div {
        font-size: 0.68rem !important;
    }
    .mobile-bottom-nav a {
        font-size: 0.6rem !important;
        padding: 6px 2px !important;
    }
    .mobile-bottom-nav a i {
        font-size: 1.2rem !important;
    }
}

/* ============================================================
   UI v26 — densité, tableaux, menus actions, responsive
   ============================================================ */
:root {
    --font-size-base: 0.9rem;
}
html { font-size: 15px; }
body {
    font-size: var(--font-size-base);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}
h1, .h1 { font-size: 1.35rem; font-weight: 700; }
h2, .h2 { font-size: 1.2rem; font-weight: 650; }
h3, .h3, .card-header { font-size: 0.95rem; font-weight: 600; }
.card-header { opacity: 0.98; }
strong, .fw-bold { font-weight: 600 !important; }
.fw-semibold { font-weight: 550 !important; }
.text-muted, .form-text { opacity: 0.85; }

.app-content, .app-main { max-width: 100%; }
.card { border-radius: 14px; }
.card-body { padding: 0.95rem 1rem; }
.form-label { font-size: 0.8rem; font-weight: 550; margin-bottom: 0.25rem; }
.form-control, .form-select {
    font-size: 0.88rem;
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
}
.btn { font-size: 0.85rem; font-weight: 550; border-radius: 10px; }
.btn-sm { font-size: 0.78rem; }
.badge { font-weight: 550; font-size: 0.72rem; }

/* Tables: always show Actions, avoid clipping dropdowns */
.table-responsive {
    overflow-x: auto;
    overflow-y: visible !important;
}
.table {
    font-size: 0.84rem;
    margin-bottom: 0;
}
.table th {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    vertical-align: middle;
}
.table td {
    vertical-align: middle;
    padding: 0.55rem 0.55rem;
}
.table .col-actions,
.table th.col-actions {
    position: sticky;
    right: 0;
    background: #fff;
    z-index: 2;
    min-width: 52px;
    box-shadow: -6px 0 10px -8px rgba(0,0,0,.12);
}
.table thead th.col-actions { z-index: 3; background: #f8faf9; }

/* Premium actions menu — never clipped */
.dropdown-menu-actions {
    z-index: 1080 !important;
    min-width: 210px;
    border: none;
    border-radius: 14px;
    padding: 0.4rem;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15,23,42,0.06);
}
.dropdown-menu-actions .dropdown-item {
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dropdown-menu-actions .dropdown-item i {
    width: 1.1rem;
    text-align: center;
    opacity: 0.9;
}
.dropdown-menu-actions .dropdown-item:hover {
    background: #f0faf4;
}
.btn-actions {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-actions:hover, .btn-actions:focus {
    background: #F15A24;
    border-color: #F15A24;
    color: #fff;
}
.btn-open-paiement {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

/* Payment modal stats */
.pay-stat { border: 1px solid transparent; }
.pay-stat-total { background: #fff7ed; border-color: #fed7aa; }
.pay-stat-paid { background: #f0fdf4; border-color: #bbf7d0; }
.pay-stat-rest { background: #fef3c7; border-color: #fde68a; }
.pay-stat-lbl { font-size: 0.68rem; color: #64748b; font-weight: 550; margin-bottom: 2px; }
.pay-stat strong { font-size: 0.88rem; }

/* Sticky modal headers already exist — ensure all modals use flex */
.modal-form-flex {
    display: flex;
    flex-direction: column;
    max-height: min(92vh, 720px);
}
.modal-form-flex .modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
}
.modal-header-actions {
    position: sticky;
    top: 0;
    z-index: 5;
    flex-shrink: 0;
}

/* Responsive density */
@media (max-width: 991px) {
    html { font-size: 14.5px; }
    .table .col-actions { position: static; box-shadow: none; }
}
@media (max-width: 767px) {
    html { font-size: 14px; }
    .card-body { padding: 0.85rem; }
    .app-topbar, .topbar { padding-left: 0.75rem; padding-right: 0.75rem; }
    .table-mobile-cards tbody tr {
        border: 1px solid #e8eef2;
        border-radius: 12px;
        margin: 0.5rem;
        padding: 0.65rem 0.75rem;
        display: block;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0,0,0,.04);
    }
    .table-mobile-cards thead { display: none; }
    .table-mobile-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        border: none !important;
        padding: 0.28rem 0 !important;
        text-align: right !important;
    }
    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.72rem;
        color: #64748b;
        text-transform: uppercase;
        text-align: left;
        flex: 0 0 42%;
    }
    .table-mobile-cards tbody td.col-actions,
    .table-mobile-cards tbody td[data-label="Actions"] {
        justify-content: flex-end;
        padding-top: 0.5rem !important;
    }
    .table-mobile-cards tbody td.col-actions::before,
    .table-mobile-cards tbody td[data-label="Actions"]::before {
        content: '';
        flex: 0;
    }
}
@media (min-width: 1400px) {
    .app-content > .container-fluid,
    .app-main .container-fluid {
        max-width: 1320px;
        margin-inline: auto;
    }
}


/* ============================================================
   Responsive + density v27
   ============================================================ */
img, svg { max-width: 100%; height: auto; }
.icon-svg { width: 1.1em; height: 1.1em; vertical-align: -0.15em; flex-shrink: 0; }

@media (max-width: 1199.98px) {
  .app-content { padding: 0.85rem 0.9rem 1.25rem; }
}

@media (max-width: 991.98px) {
  .card-body { padding: 0.85rem; }
  .bulk-bar { flex-wrap: wrap; gap: 0.5rem !important; }
  .table th, .table td { padding: 0.45rem 0.4rem; }
}

@media (max-width: 767.98px) {
  html { font-size: 14px; }
  .app-content { padding: 0.65rem 0.55rem 4.5rem; }
  .card { border-radius: 12px; }
  .card-header { padding: 0.65rem 0.85rem; font-size: 0.88rem; }
  .btn { padding: 0.4rem 0.75rem; }
  .modal-dialog { margin: 0.5rem; }
  .modal-header-actions { padding: 0.65rem 0.85rem; }
  .modal-body { padding: 0.85rem; }
  .pay-stat strong { font-size: 0.8rem; }
  .form-control, .form-select { font-size: 16px; /* avoid iOS zoom */ }
}

@media (max-width: 575.98px) {
  .page-title, h1.h4, .topbar-title { font-size: 1.05rem !important; }
  .badge-statut, .badge { font-size: 0.68rem; }
  .dropdown-menu-actions { min-width: 190px; }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .table { font-size: 0.8rem; }
}

@media (min-width: 1400px) {
  .app-content { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media print {
  .app-sidebar, .sidebar-overlay, .mobile-bottom-nav, .app-topbar, .topbar,
  .btn, .toolbar, .bulk-bar, .no-print { display: none !important; }
  .app-main, .app-content { margin: 0 !important; padding: 0 !important; width: 100% !important; }
}


/* Sidebar: toujours visible sans scroll (tous écrans / hauteurs) */
.app-sidebar {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden !important;
}
.sidebar-user .avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.8rem !important;
}
.sidebar-user .user-info strong {
    font-size: 0.8rem !important;
}
.sidebar-user .user-info div {
    font-size: 0.65rem !important;
    opacity: 0.65;
}

@media (max-height: 780px) {
    .sidebar-brand { padding: 8px 12px !important; gap: 8px !important; }
    .sidebar-brand img { width: 34px !important; height: 34px !important; }
    .sidebar-brand .brand-text strong { font-size: 0.88rem !important; }
    .sidebar-nav { padding: 4px 8px !important; gap: 0 !important; }
    .sidebar-nav .nav-label { padding: 4px 10px 1px !important; font-size: 0.55rem !important; }
    .sidebar-nav a { padding: 5px 10px !important; font-size: 0.78rem !important; border-radius: 8px !important; }
    .sidebar-nav a i { font-size: 0.95rem !important; width: 18px !important; }
    .sidebar-footer { padding: 6px 10px 8px !important; }
}

@media (max-height: 640px) {
    .sidebar-nav .nav-label { display: none; }
    .sidebar-nav a { padding: 4px 10px !important; font-size: 0.75rem !important; }
    .sidebar-brand .brand-text small { display: none; }
    .sidebar-footer .user-info div { display: none; }
}

@media (max-height: 520px) {
    .sidebar-brand img { width: 28px !important; height: 28px !important; }
    .sidebar-nav a { padding: 3px 8px !important; gap: 8px !important; }
    .sidebar-user .avatar { width: 26px !important; height: 26px !important; }
}


/* SIDEBAR_NO_SCROLL_FINAL — force fit */
.app-sidebar,
.app-sidebar .sidebar-nav {
    overflow: hidden !important;
}

/* ============================================================
   Tableau colis — adapté 100% tous écrans
   ============================================================ */
.table-colis-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 14px 14px;
}
.table-colis {
    width: 100%;
    min-width: 0;
    table-layout: auto;
    font-size: 0.8rem;
}
.table-colis th,
.table-colis td {
    vertical-align: middle;
    padding: 0.5rem 0.45rem;
}
.table-colis th {
    white-space: nowrap;
    font-size: 0.68rem;
}
.table-colis .col-code {
    font-weight: 700;
    white-space: nowrap;
}
.table-colis .col-prix {
    white-space: nowrap;
}
.table-colis .col-actions {
    position: sticky;
    right: 0;
    background: #fff;
    z-index: 3;
    min-width: 48px;
    width: 52px;
    box-shadow: -4px 0 8px -4px rgba(0,0,0,.1);
}
.table-colis thead .col-actions {
    background: #f8faf9;
    z-index: 4;
}
.table-colis tbody tr:hover .col-actions {
    background: #f8fafc;
}

/* Écrans moyens : table scrollable, actions toujours visibles */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .table-colis {
        font-size: 0.75rem;
    }
    .table-colis th,
    .table-colis td {
        padding: 0.4rem 0.35rem;
    }
    .table-colis .col-exp,
    .table-colis .col-rec {
        max-width: 110px;
    }
    .table-colis .col-exp small,
    .table-colis .col-rec small {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100px;
    }
}

/* Grand écran : tout visible sans scroll horizontal */
@media (min-width: 1200px) {
    .table-colis-wrap {
        overflow-x: visible !important;
    }
    .table-colis {
        font-size: 0.82rem;
    }
}

/* Mobile : cartes */
@media (max-width: 767.98px) {
    .table-colis-wrap {
        overflow: visible !important;
    }
    .table-colis thead {
        display: none;
    }
    .table-colis,
    .table-colis tbody {
        display: block;
        width: 100%;
    }
    .table-colis tbody tr {
        display: block;
        width: calc(100% - 0.5rem);
        margin: 0.5rem auto;
        padding: 0.75rem 0.85rem;
        border: 1px solid #e8eef2;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 2px 10px rgba(15,23,42,.05);
    }
    .table-colis tbody td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        border: none !important;
        padding: 0.3rem 0 !important;
        text-align: right !important;
        max-width: none !important;
        white-space: normal !important;
    }
    .table-colis tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.7rem;
        color: #64748b;
        text-transform: uppercase;
        text-align: left;
        flex: 0 0 38%;
    }
    .table-colis tbody td.col-actions,
    .table-colis tbody td[data-label="Actions"] {
        justify-content: flex-end;
        padding-top: 0.55rem !important;
        border-top: 1px dashed #e2e8f0 !important;
        margin-top: 0.25rem;
        position: static !important;
        box-shadow: none !important;
        background: transparent !important;
        width: 100%;
    }
    .table-colis tbody td.col-actions::before,
    .table-colis tbody td[data-label="Actions"]::before {
        content: none;
        flex: 0;
    }
    /* checkbox row */
    .table-colis tbody td[data-label=""] {
        justify-content: flex-start;
    }
    .table-colis tbody td[data-label=""]::before {
        content: none;
    }
    /* restore lieu/date on mobile cards */
    .table-colis tbody td.col-lieu,
    .table-colis tbody td.col-date {
        display: flex !important;
    }
}

/* Clients */
.client-cmd-badge {
    font-size: 0.85rem;
    padding: 0.4em 0.65em;
    border-radius: 8px;
    transition: transform .15s ease, box-shadow .15s ease;
}
.client-cmd-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13,110,253,.35);
    color: #fff !important;
}
.clients-card .card-header {
    background: linear-gradient(135deg, #006837, #004d29);
    color: #fff;
}

/* Dashboard recent table mobile */
@media (max-width: 767.98px) {
    .table-dashboard-recent thead { display: none; }
    .table-dashboard-recent,
    .table-dashboard-recent tbody,
    .table-dashboard-recent tr,
    .table-dashboard-recent td {
        display: block;
        width: 100%;
    }
    .table-dashboard-recent tbody tr {
        margin: 0.65rem;
        padding: 0.75rem 0.85rem;
        border: 1px solid #e8eef2;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(15,23,42,.04);
    }
    .table-dashboard-recent tbody td {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        border: none !important;
        padding: 0.28rem 0 !important;
        text-align: right !important;
    }
    .table-dashboard-recent tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.7rem;
        color: #64748b;
        text-transform: uppercase;
        text-align: left;
        flex: 0 0 40%;
    }
    .table-dashboard-recent tbody td[data-label="Actions"] {
        justify-content: flex-end;
        padding-top: 0.5rem !important;
        border-top: 1px dashed #e2e8f0 !important;
        margin-top: 0.25rem;
    }
    .table-dashboard-recent tbody td[data-label="Actions"]::before {
        content: none;
        flex: 0;
    }
}
