/* ══════════════════════════════════════════════════════════════
   SAHRAOUI LOGISTIQUE — Revitalized Design 2026
   Contrasting Light Theme · Orange · Dark Blue · Green · Yellow
   ══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ─── Root Variables ────────────────────────────────────────── */
:root {
    /* Brand Palette */
    --orange: #F97316;
    --orange-dark: #EA580C;
    --orange-light: #FDBA74;
    --orange-bg: #FFF7ED;

    --navy: #0D1B2A;
    --navy-mid: #1E3A5F;
    --navy-light: #2D5282;

    --yellow: #FBBF24;
    --yellow-bg: #FFFBEB;
    --yellow-dark: #D97706;

    --green: #10B981;
    --green-dark: #059669;
    --green-bg: #ECFDF5;

    --red: #EF4444;
    --red-bg: #FEF2F2;

    --info: #3B82F6;
    --info-bg: #EFF6FF;

    /* Page background — warm slate, different from white cards */
    --bg-page: #E8EDF5;
    --bg-card: #FFFFFF;
    --bg-subtle: #F0F4FA;
    --border: #C8D5E8;
    --border-light: #DDE6F0;

    /* Text */
    --text-primary: #0D1B2A;
    --text-secondary: #233554;
    --text-muted: #5B7498;
    --text-light: #8FAFC9;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(13, 27, 42, .07), 0 1px 2px rgba(13, 27, 42, .05);
    --shadow-card: 0 4px 16px rgba(13, 27, 42, .09), 0 2px 6px rgba(13, 27, 42, .05);
    --shadow-hover: 0 8px 28px rgba(13, 27, 42, .13);
    --shadow-float: 0 20px 50px rgba(249, 115, 22, .22);
    --shadow-nav: 4px 0 24px rgba(0, 0, 0, .18);

    /* Radii */
    --radius-xs: 5px;
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 26px;
    --radius-full: 9999px;

    /* Layout */
    --sidebar-w: 260px;
    --header-h: 66px;

    /* Spacing */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-8: 32px;
    --s-10: 40px;
    --s-12: 48px;

    /* Typography */
    --font: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --t-fast: 180ms cubic-bezier(.2, .8, .2, 1);
    --t-smooth: 320ms cubic-bezier(.2, .8, .2, 1);
    --t-bounce: 420ms cubic-bezier(.34, 1.56, .64, 1);
}

/* ─── Reset ──────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-page);
    color: var(--text-secondary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--orange);
    text-decoration: none;
    transition: all var(--t-fast);
}

a:hover {
    opacity: .82;
}

input,
textarea,
select,
button {
    font-family: inherit;
    font-size: 1rem;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ─── Typography ─────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.25;
}

h1 {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
}

h2 {
    font-size: clamp(1.15rem, 2vw, 1.45rem);
}

h3 {
    font-size: 1.05rem;
}

h4 {
    font-size: .875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.text-xs {
    font-size: .75rem;
}

.text-sm {
    font-size: .875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--orange);
}

.text-success {
    color: var(--green);
}

.text-danger {
    color: var(--red);
}

.text-warning {
    color: var(--yellow-dark);
}

.text-center {
    text-align: center;
}

.truncate {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ─── Utilities ──────────────────────────────────────────────── */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: var(--s-1);
}

.gap-2 {
    gap: var(--s-2);
}

.gap-3 {
    gap: var(--s-3);
}

.gap-4 {
    gap: var(--s-4);
}

.gap-6 {
    gap: var(--s-6);
}

.flex-1 {
    flex: 1;
}

.w-full {
    width: 100%;
}

.mb-lg {
    margin-bottom: var(--s-6);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-6);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-6);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--s-6);
}

.mt-1 {
    margin-top: var(--s-1);
}

.mt-2 {
    margin-top: var(--s-2);
}

.mt-4 {
    margin-top: var(--s-4);
}

.mt-6 {
    margin-top: var(--s-6);
}

.mb-2 {
    margin-bottom: var(--s-2);
}

.mb-4 {
    margin-bottom: var(--s-4);
}

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-in {
    animation: fadeInUp .4s ease forwards;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR — Dark navy with orange accent
   ══════════════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, #0A1828 0%, #0D1B2A 60%, #0F2340 100%);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--t-smooth);
    box-shadow: var(--shadow-nav);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .08) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .1);
    border-radius: 4px;
}

/* Logo area */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-5) var(--s-5);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(249, 115, 22, .4);
}

.sidebar-logo-text {
    font-size: .95rem;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.sidebar-logo-text span {
    display: block;
    font-size: .65rem;
    font-weight: 600;
    color: var(--orange-light);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-top: 2px;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: var(--s-4) var(--s-3);
}

.sidebar-section {
    font-size: .6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, .28);
    text-transform: uppercase;
    letter-spacing: .14em;
    padding: var(--s-4) var(--s-3) var(--s-2);
    margin-top: var(--s-2);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: 10px var(--s-3);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, .58);
    font-size: .875rem;
    font-weight: 500;
    transition: all var(--t-fast);
    margin-bottom: 2px;
    cursor: pointer;
    text-decoration: none;
    position: relative;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-link:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, .07);
    opacity: 1;
}

.nav-link.active {
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    box-shadow: 0 4px 14px rgba(249, 115, 22, .35);
    font-weight: 600;
    opacity: 1;
}

.nav-link.active svg {
    opacity: 1;
}

/* Also support .nav-item class used in some pages */
.nav-item {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: 10px var(--s-3);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, .58);
    font-size: .875rem;
    font-weight: 500;
    transition: all var(--t-fast);
    margin-bottom: 2px;
    cursor: pointer;
    text-decoration: none;
}

.nav-item svg,
.nav-item .nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item:hover {
    color: #FFF;
    background: rgba(255, 255, 255, .07);
    opacity: 1;
}

.nav-item.active {
    color: #FFF;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    box-shadow: 0 4px 14px rgba(249, 115, 22, .35);
    font-weight: 600;
}

.nav-badge {
    margin-left: auto;
    background: var(--red);
    color: white;
    font-size: .62rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

/* Sidebar footer — user info */
.sidebar-footer {
    padding: var(--s-4);
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: white;
    font-weight: 700;
    font-size: .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   TOP HEADER
   ══════════════════════════════════════════════════════════════ */
.top-header,
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--header-h);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--s-8);
    z-index: 90;
    box-shadow: 0 2px 12px rgba(13, 27, 42, .07);
}

.menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    background: var(--bg-subtle);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--t-fast);
    flex-shrink: 0;
}

.menu-toggle:hover {
    background: var(--orange-bg);
    color: var(--orange);
    border-color: var(--orange-light);
}

.page-title,
.topbar-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    padding-left: var(--s-4);
}

.header-actions,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

/* Notification button */
.notif-btn,
.topbar-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--t-fast);
    position: relative;
}

.notif-btn:hover,
.topbar-icon-btn:hover {
    background: var(--orange-bg);
    color: var(--orange);
    border-color: var(--orange-light);
}

.notif-bubble {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--red);
    color: white;
    font-size: .6rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    padding: 0 3px;
}

/* Notification dropdown */
.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(13, 27, 42, .14);
    z-index: 300;
    overflow: hidden;
    animation: slideDown .2s ease;
}

.notif-dropdown.open {
    display: block;
}

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--s-4) var(--s-5);
    font-weight: 700;
    font-size: .9rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    padding: var(--s-4) var(--s-5);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--t-fast);
}

.notif-item:hover {
    background: var(--bg-subtle);
}

.notif-item.unread {
    background: var(--orange-bg);
}

/* Avatar in topbar */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--navy-mid), var(--navy));
    color: white;
    font-weight: 700;
    font-size: .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(13, 27, 42, .25);
}

/* ══════════════════════════════════════════════════════════════
   MAIN LAYOUT
   ══════════════════════════════════════════════════════════════ */
.main-content {
    margin-left: var(--sidebar-w);
    padding-top: var(--header-h);
    min-height: 100vh;
}

.page-content {
    padding: var(--s-8);
    max-width: 1440px;
    animation: fadeInUp .4s ease;
}

/* Keep legacy class name too */
.page-body {
    padding: var(--s-8);
    max-width: 1440px;
    animation: fadeInUp .4s ease;
}

/* ─── Page header row ──────────────────────────────────────── */
.page-header {
    margin-bottom: var(--s-6);
}

.page-header h1 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
}

.page-header p {
    color: var(--text-muted);
    margin-top: var(--s-1);
    font-size: .9rem;
}

.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--s-4);
    margin-bottom: var(--s-6);
}

/* ══════════════════════════════════════════════════════════════
   STAT CARDS — Colorful distinctive blocks
   ══════════════════════════════════════════════════════════════ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: var(--s-5);
    margin-bottom: var(--s-8);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--s-6);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
    animation: fadeInUp .4s ease both;
    border-left: 4px solid var(--border);
}

/* Coloured left-border variants — set via class on stat-card */
.stat-card.orange {
    border-left-color: var(--orange);
}

.stat-card.green {
    border-left-color: var(--green);
}

.stat-card.navy {
    border-left-color: var(--navy-mid);
}

.stat-card.yellow {
    border-left-color: var(--yellow);
}

.stat-card.red {
    border-left-color: var(--red);
}

.stat-card.info {
    border-left-color: var(--info);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--s-4);
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: #EEF4FF;
    color: var(--navy-mid);
}

.stat-icon.green {
    background: var(--green-bg);
    color: var(--green-dark);
}

.stat-icon.amber {
    background: var(--yellow-bg);
    color: var(--yellow-dark);
}

.stat-icon.orange {
    background: var(--orange-bg);
    color: var(--orange-dark);
}

.stat-icon.red {
    background: var(--red-bg);
    color: var(--red);
}

.stat-icon.slate {
    background: var(--bg-subtle);
    color: var(--text-muted);
}

.stat-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin-bottom: var(--s-2);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -.03em;
}

.stat-sub {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: var(--s-2);
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .74rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-top: var(--s-2);
}

.stat-trend.up {
    background: var(--green-bg);
    color: var(--green-dark);
}

.stat-trend.down {
    background: var(--red-bg);
    color: var(--red);
}

/* ══════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    animation: fadeInUp .45s ease both;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--s-5) var(--s-6);
    border-bottom: 1.5px solid var(--border);
    gap: var(--s-4);
    flex-wrap: wrap;
    background: var(--bg-subtle);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--s-2);
}

.card-title-icon {
    width: 30px;
    height: 30px;
    background: var(--orange-bg);
    color: var(--orange);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-body {
    padding: var(--s-6);
}

.card-footer {
    padding: var(--s-4) var(--s-6);
    border-top: 1.5px solid var(--border);
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: 10px var(--s-5);
    font-size: .875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--t-fast);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Orange = primary */
.btn-primary {
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: white;
    box-shadow: 0 4px 14px rgba(249, 115, 22, .35);
}

.btn-primary:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, .45);
}

/* Navy = secondary strong */
.btn-navy {
    background: var(--navy-mid);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 95, .25);
}

.btn-navy:hover {
    background: var(--navy);
    opacity: 1;
    transform: translateY(-1px);
}

/* Ghost / secondary */
.btn-secondary {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--orange-bg);
    color: var(--orange);
    border-color: var(--orange-light);
    opacity: 1;
}

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border: 1.5px solid rgba(239, 68, 68, .2);
}

.btn-danger:hover {
    background: var(--red);
    color: white;
    opacity: 1;
}

.btn-success {
    background: var(--green-bg);
    color: var(--green-dark);
    border: 1.5px solid rgba(16, 185, 129, .2);
}

.btn-success:hover {
    background: var(--green);
    color: white;
    opacity: 1;
}

.btn-warning {
    background: var(--yellow-bg);
    color: var(--yellow-dark);
    border: 1.5px solid rgba(251, 191, 36, .3);
}

.btn-warning:hover {
    background: var(--yellow);
    color: var(--text-primary);
    opacity: 1;
}

.btn-sm {
    padding: 6px var(--s-3);
    font-size: .8rem;
}

.btn-lg {
    padding: 14px var(--s-8);
    font-size: 1rem;
    border-radius: var(--radius);
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
}

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-group {
    margin-bottom: var(--s-5);
}

.form-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--s-2);
    letter-spacing: .01em;
}

.form-label span.required {
    color: var(--red);
    margin-left: 2px;
}

.form-input {
    width: 100%;
    padding: 11px 16px;
    font-size: .9rem;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--t-fast);
    appearance: none;
    -webkit-appearance: none;
}

.form-input::placeholder {
    color: var(--text-light);
}

.form-input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, .12);
    background: #fff;
}

/* Only show red border after the user has interacted */
.form-input:user-invalid {
    border-color: var(--red);
}

/* Fallback for browsers that don't support :user-invalid */
.form-input.touched:invalid {
    border-color: var(--red);
}

select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235B7498' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-5);
}

.form-hint {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: var(--s-1);
}

/* ══════════════════════════════════════════════════════════════
   DATA TABLE
   ══════════════════════════════════════════════════════════════ */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.data-table thead {
    background: var(--navy);
}

.data-table th {
    padding: var(--s-3) var(--s-4);
    text-align: left;
    font-size: .68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, .7);
    text-transform: uppercase;
    letter-spacing: .08em;
    white-space: nowrap;
}

.data-table td {
    padding: var(--s-4);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--t-fast);
}

.data-table tbody tr:hover {
    background: var(--orange-bg);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Zebra stripe option */
.data-table.striped tbody tr:nth-child(even) {
    background: var(--bg-subtle);
}

.data-table.striped tbody tr:nth-child(even):hover {
    background: var(--orange-bg);
}

/* ══════════════════════════════════════════════════════════════
   BADGES & STATUS
   ══════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: .7rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-success {
    background: var(--green-bg);
    color: var(--green-dark);
    border: 1px solid rgba(16, 185, 129, .2);
}

.badge-warning {
    background: var(--yellow-bg);
    color: var(--yellow-dark);
    border: 1px solid rgba(251, 191, 36, .3);
}

.badge-danger {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, .2);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, .2);
}

.badge-primary {
    background: var(--orange-bg);
    color: var(--orange-dark);
    border: 1px solid rgba(249, 115, 22, .2);
}

.badge-neutral {
    background: var(--bg-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.badge-navy {
    background: #EEF4FF;
    color: var(--navy-mid);
    border: 1px solid rgba(30, 58, 95, .15);
}

/* ══════════════════════════════════════════════════════════════
   ACTION DROPDOWN
   ══════════════════════════════════════════════════════════════ */
.action-dropdown {
    position: relative;
    display: inline-block;
}

.action-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--t-fast);
    white-space: nowrap;
    user-select: none;
}

.action-dropdown-btn:hover {
    background: var(--orange-bg);
    color: var(--orange);
    border-color: var(--orange-light);
}

.action-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 190px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(13, 27, 42, .13);
    z-index: 60;
    overflow: hidden;
    animation: slideDown .15s ease;
}

.action-dropdown-menu.open {
    display: block;
}

.action-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: 10px 16px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    text-decoration: none;
}

.action-dropdown-item:hover {
    background: var(--bg-subtle);
    color: var(--orange);
}

.action-dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* ══════════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    /* HIDDEN by default — JS adds .open to show */
    position: fixed;
    inset: 0;
    background: rgba(13, 27, 42, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: var(--s-4);
}

.modal-overlay.open {
    display: flex;
    animation: fadeIn .2s ease;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px rgba(13, 27, 42, .28);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideDown .25s var(--t-bounce);
    border: 1.5px solid var(--border);
}

.modal-lg {
    max-width: 820px;
}

.modal-sm {
    max-width: 420px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--s-6);
    border-bottom: 1.5px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
    background: var(--bg-subtle);
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    padding: var(--s-6);
}

.modal-footer {
    padding: var(--s-4) var(--s-6);
    border-top: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s-3);
    background: var(--bg-subtle);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.btn-close-modal {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--t-fast);
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

.btn-close-modal:hover {
    background: var(--red-bg);
    border-color: rgba(239, 68, 68, .2);
    color: var(--red);
}

/* ══════════════════════════════════════════════════════════════
   ALERTS & FLASH MESSAGES
   ══════════════════════════════════════════════════════════════ */
.alert {
    padding: var(--s-4) var(--s-5);
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    border: 1px solid;
    margin-bottom: var(--s-4);
}

.alert-success {
    background: var(--green-bg);
    color: var(--green-dark);
    border-color: rgba(16, 185, 129, .25);
}

.alert-warning {
    background: var(--yellow-bg);
    color: #92400E;
    border-color: rgba(251, 191, 36, .3);
}

.alert-danger {
    background: var(--red-bg);
    color: var(--red);
    border-color: rgba(239, 68, 68, .2);
}

.alert-error {
    background: var(--red-bg);
    color: var(--red);
    border-color: rgba(239, 68, 68, .2);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border-color: rgba(59, 130, 246, .2);
}

/* Toast / flash */
.flash {
    position: fixed;
    top: calc(var(--header-h) + 16px);
    right: var(--s-6);
    z-index: 500;
    max-width: 380px;
    border-radius: var(--radius);
    padding: var(--s-4) var(--s-5);
    color: white;
    font-weight: 600;
    font-size: .875rem;
    animation: slideDown .3s ease;
    box-shadow: var(--shadow-float);
}

.flash-success {
    background: var(--green);
}

.flash-error {
    background: var(--red);
}

.flash-warning {
    background: var(--yellow-dark);
}

.flash-messages {
    margin-bottom: var(--s-4);
}

/* ══════════════════════════════════════════════════════════════
   TOOLBAR (search + filters + actions)
   ══════════════════════════════════════════════════════════════ */
.toolbar {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    flex-wrap: wrap;
    padding: var(--s-4) var(--s-6);
    background: var(--bg-subtle);
    border-bottom: 1.5px solid var(--border);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    flex: 1;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    flex-shrink: 0;
}

.search-box {
    position: relative;
    min-width: 220px;
}

.search-box-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.search-box .form-input {
    padding-left: 38px;
}

/* ══════════════════════════════════════════════════════════════
   FILTER TABS
   ══════════════════════════════════════════════════════════════ */
.filter-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1.5px solid var(--border);
    flex-wrap: wrap;
}

.filter-tab {
    padding: 7px 16px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--t-fast);
    border: none;
    background: none;
    white-space: nowrap;
}

.filter-tab.active {
    background: var(--orange);
    color: white;
    box-shadow: 0 2px 8px rgba(249, 115, 22, .3);
}

.filter-tab:hover:not(.active) {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, .04);
}

/* ══════════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: var(--s-12) var(--s-8);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--s-4);
    opacity: .45;
}

.empty-state h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--s-2);
}

.empty-state p {
    font-size: .875rem;
    color: var(--text-muted);
    max-width: 320px;
    margin: 0 auto var(--s-5);
}

/* ══════════════════════════════════════════════════════════════
   MOBILE / BOTTOM NAV
   ══════════════════════════════════════════════════════════════ */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 24, 40, .96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    z-index: 100;
    gap: 2px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .06) inset;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    color: rgba(255, 255, 255, .48);
    font-size: .6rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--t-fast);
    cursor: pointer;
    border: none;
    background: none;
    min-width: 50px;
}

.mobile-nav-item svg {
    width: 20px;
    height: 20px;
}

.mobile-nav-item.active {
    color: white;
    background: var(--orange);
}

.mobile-nav-item:hover {
    color: rgba(255, 255, 255, .85);
    background: rgba(255, 255, 255, .08);
}

/* ══════════════════════════════════════════════════════════════
   MISC COMPONENTS
   ══════════════════════════════════════════════════════════════ */
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(249, 115, 22, .2);
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: var(--s-5) 0;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-4);
    background: var(--bg-subtle);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
}

.qr-container img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

/* Detail rows */
.detail-row {
    display: flex;
    align-items: flex-start;
    gap: var(--s-4);
    padding: var(--s-2) 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 140px;
}

.detail-value {
    font-size: .875rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 99;
}

.sidebar-overlay.open {
    display: block;
}

/* Notifications panel (legacy class) */
.notifications-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(13, 27, 42, .15);
    z-index: 300;
    overflow: hidden;
    animation: slideDown .2s ease;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    padding: var(--s-4) var(--s-5);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--t-fast);
}

.notification-item:hover {
    background: var(--bg-subtle);
}

.notification-item.unread {
    background: var(--orange-bg);
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange);
    flex-shrink: 0;
    margin-top: 5px;
}

/* Subscription alert */
.subscription-alert {
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: white;
    padding: var(--s-4) var(--s-6);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    font-size: .875rem;
    font-weight: 600;
    margin-bottom: var(--s-6);
    box-shadow: 0 4px 16px rgba(249, 115, 22, .3);
}

/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE — Keep the dark navy style
   ══════════════════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #050E1A 0%, #0D1B2A 45%, #1A3050 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-6);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(249, 115, 22, .14) 0%, transparent 70%);
    top: -120px;
    right: -80px;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(251, 191, 36, .07) 0%, transparent 70%);
    bottom: -60px;
    left: -60px;
    pointer-events: none;
}

/* Decorative animated circles */
.login-page .deco-circle {
    position: absolute;
    border-radius: 50%;
    opacity: .04;
    border: 2px solid white;
    animation: pulse 4s ease-in-out infinite;
}

.login-box {
    background: rgba(255, 255, 255, .04);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius-xl);
    padding: var(--s-10);
    width: 100%;
    max-width: 430px;
    position: relative;
    z-index: 1;
    box-shadow: 0 30px 60px rgba(0, 0, 0, .5);
    animation: fadeInUp .5s ease;
}

.login-box h1 {
    color: #fff;
    font-size: 1.75rem;
    margin-bottom: var(--s-1);
}

.login-box p {
    color: rgba(255, 255, 255, .48);
    margin-bottom: var(--s-8);
    font-size: .9rem;
}

.login-box .login-brand {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin-bottom: var(--s-8);
}

.login-box .login-brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 6px 18px rgba(249, 115, 22, .45);
}

.login-box .login-brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.login-box .login-brand-name span {
    display: block;
    font-size: .65rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .45);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-top: 2px;
}

.login-box .form-label {
    color: rgba(255, 255, 255, .72);
}

.login-box .form-input {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .12);
    color: white;
}

.login-box .form-input::placeholder {
    color: rgba(255, 255, 255, .28);
}

.login-box .form-input:focus {
    background: rgba(255, 255, 255, .11);
    border-color: var(--orange-light);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, .18);
}

/* ══════════════════════════════════════════════════════════════
   FINANCIAL / MONEY DISPLAY
   ══════════════════════════════════════════════════════════════ */
.money-positive {
    color: var(--green-dark);
    font-weight: 700;
}

.money-negative {
    color: var(--red);
    font-weight: 700;
}

.money-neutral {
    color: var(--text-primary);
    font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════
   DASHBOARD WELCOME BANNER
   ══════════════════════════════════════════════════════════════ */
.welcome-banner {
    background: linear-gradient(135deg, var(--navy), var(--navy-mid));
    border-radius: var(--radius-lg);
    padding: var(--s-6) var(--s-8);
    margin-bottom: var(--s-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-6);
    color: white;
    box-shadow: 0 6px 24px rgba(13, 27, 42, .25);
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: linear-gradient(90deg, transparent, rgba(249, 115, 22, .08));
    pointer-events: none;
}

.welcome-banner h2 {
    font-size: 1.3rem;
    color: white;
    margin-bottom: 4px;
}

.welcome-banner p {
    font-size: .875rem;
    color: rgba(255, 255, 255, .6);
    margin: 0;
}

.welcome-banner .welcome-badge {
    background: rgba(249, 115, 22, .18);
    border: 1px solid rgba(249, 115, 22, .3);
    color: var(--orange-light);
    font-size: .75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-bottom: var(--s-2);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile First
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    :root {
        --sidebar-w: 0px;
        --header-h: 60px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 270px;
        z-index: 200;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .menu-toggle {
        display: flex;
    }

    .top-header,
    .topbar {
        left: 0;
        padding: 0 var(--s-4);
    }

    .main-content {
        margin-left: 0;
        padding-bottom: 90px;
    }

    .page-content,
    .page-body {
        padding: var(--s-4);
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--s-3);
    }

    .stat-card {
        padding: var(--s-4);
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .mobile-nav {
        display: flex;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .page-header-row {
        flex-direction: column;
    }

    .data-table th,
    .data-table td {
        padding: var(--s-3);
    }

    .notif-dropdown {
        width: 300px;
        right: -60px;
    }

    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: var(--s-5);
    }

    .welcome-banner::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .login-box {
        padding: var(--s-6);
    }

    .filter-tabs {
        gap: 2px;
    }
}

@media (min-width: 769px) {
    .mobile-nav {
        display: none !important;
    }

    .sidebar {
        transform: translateX(0);
    }
}

/* ══════════════════════════════════════════════════════════════
   SCROLLBAR (Webkit)
   ══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ══════════════════════════════════════════════════════════════
   FONT MONO (for serial numbers etc.)
   ══════════════════════════════════════════════════════════════ */
.font-mono {
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: .02em;
}

/* ══════════════════════════════════════════════════════════════
   PRINT OVERRIDES — keep print pages clean
   ══════════════════════════════════════════════════════════════ */
@media print {

    .sidebar,
    .top-header,
    .topbar,
    .mobile-nav,
    .menu-toggle {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }

    body {
        background: white;
    }
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR OVERLAY — JS adds .active class
   ══════════════════════════════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 99;
}

.sidebar-overlay.open,
.sidebar-overlay.active {
    display: block;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE NAV — badge and wrapper
   ══════════════════════════════════════════════════════════════ */
.mobile-nav-items {
    display: flex;
    align-items: center;
    gap: 2px;
}

.mobile-nav-badge {
    position: absolute;
    top: -2px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: var(--red);
    color: white;
    font-size: .55rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 1.5px solid transparent;
}

.mobile-nav-item {
    position: relative;
}

/* ══════════════════════════════════════════════════════════════
   NOTIFICATION ITEM INTERNALS
   ══════════════════════════════════════════════════════════════ */
.notif-item-title {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notif-item-msg {
    font-size: .8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.notif-item-time {
    font-size: .72rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════
   UPLOAD ZONE
   ══════════════════════════════════════════════════════════════ */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: var(--s-8);
    text-align: center;
    cursor: pointer;
    transition: all var(--t-fast);
    background: var(--bg-subtle);
    color: var(--text-muted);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--orange);
    background: var(--orange-bg);
    color: var(--orange);
}

/* ══════════════════════════════════════════════════════════════
   TABS
   ══════════════════════════════════════════════════════════════ */
.tab-link {
    padding: 8px 18px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--t-fast);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    text-decoration: none;
    display: inline-block;
}

.tab-link:hover {
    color: var(--text-secondary);
}

.tab-link.active {
    color: var(--orange);
    border-bottom-color: var(--orange);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn .25s ease;
}

/* ══════════════════════════════════════════════════════════════
   MISC UTILITY — PIN input
   ══════════════════════════════════════════════════════════════ */
.pin-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color var(--t-fast);
}

.pin-input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, .12);
}

/* ══════════════════════════════════════════════════════════════
   STATUS DOT
   ══════════════════════════════════════════════════════════════ */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}

.status-dot.green {
    background: var(--green);
}

.status-dot.orange {
    background: var(--orange);
}

.status-dot.red {
    background: var(--red);
}

.status-dot.navy {
    background: var(--navy-mid);
}

.status-dot.yellow {
    background: var(--yellow-dark);
}

.status-dot.gray {
    background: var(--text-light);
}

/* ══════════════════════════════════════════════════════════════
   MISSING ALIASES — classes used in PHP but not yet defined
   ══════════════════════════════════════════════════════════════ */

/* Ghost button (used in modal footers as Annuler) */
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    opacity: 1;
}

/* Outline button */
.btn-outline {
    background: transparent;
    color: var(--orange);
    border: 1.5px solid var(--orange);
}

.btn-outline:hover {
    background: var(--orange);
    color: white;
    opacity: 1;
}

/* Modal close X button */
.modal-close,
.btn-close-modal {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--t-fast);
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

.modal-close:hover,
.btn-close-modal:hover {
    background: var(--red-bg);
    border-color: rgba(239, 68, 68, .2);
    color: var(--red);
}

/* .table is used in some PHP files as alias for data-table */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.table thead {
    background: var(--navy);
}

.table th {
    padding: var(--s-3) var(--s-4);
    text-align: left;
    font-size: .68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, .75);
    text-transform: uppercase;
    letter-spacing: .08em;
    white-space: nowrap;
}

.table td {
    padding: var(--s-4);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: middle;
}

.table tbody tr {
    transition: background var(--t-fast);
}

.table tbody tr:hover {
    background: var(--orange-bg);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Spacing shorthands used in PHP (--spacing-* pattern) */
.mb-md {
    margin-bottom: var(--s-5);
}

.mt-md {
    margin-top: var(--s-5);
}

.mb-sm {
    margin-bottom: var(--s-3);
}

.mt-sm {
    margin-top: var(--s-3);
}

.gap-sm {
    gap: var(--s-3);
}

.gap-md {
    gap: var(--s-5);
}

.gap-lg {
    gap: var(--s-8);
}

/* Modal title */
.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Search bar wrapper used in agences / livreurs etc. */
.search-bar {
    position: relative;
    align-items: center;
}

.search-bar-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    display: flex;
    align-items: center;
    z-index: 1;
}

.search-bar .form-input {
    padding-left: 38px;
}

/* Initials avatar (used in agency/livreur lists) */
.initials-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--orange-bg);
    color: var(--orange-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .75rem;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   LIVREUR CARD COMPONENT
   ══════════════════════════════════════════════════════════════ */
.livreur-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
    animation: fadeInUp .4s ease both;
}

.livreur-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Navy header band */
.livreur-card-header {
    background: linear-gradient(135deg, var(--navy), var(--navy-mid));
    padding: 16px 16px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.livreur-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: white;
    font-weight: 800;
    font-size: .9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, .15);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}

.livreur-info {
    flex: 1;
    min-width: 0;
}

.livreur-name {
    font-size: .95rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.livreur-phone {
    font-size: .75rem;
    color: rgba(255, 255, 255, .55);
    margin-top: 2px;
}

.livreur-actions-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.livreur-edit-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    color: rgba(255, 255, 255, .8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--t-fast);
}

.livreur-edit-btn:hover {
    background: var(--orange);
    border-color: var(--orange);
    color: white;
}

/* Body sections */
.livreur-email {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 12px 16px;
    font-size: .82rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
}

.livreur-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid var(--border-light);
}

.livreur-stat-chip {
    padding: 12px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.livreur-stat-chip:first-child {
    border-right: 1px solid var(--border-light);
}

.livreur-stat-val {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.03em;
}

.livreur-stat-lbl {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
}

/* Camions section */
.livreur-camions {
    padding: 12px 16px;
    flex: 1;
    border-bottom: 1px solid var(--border-light);
}

.livreur-camions-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.livreur-no-item {
    font-size: .8rem;
    color: var(--text-light);
    margin-bottom: 8px;
    font-style: italic;
}

/* Footer */
.livreur-card-footer {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-subtle);
}

.livreur-id-link {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--orange);
    text-decoration: none;
    transition: opacity var(--t-fast);
}

.livreur-id-link:hover {
    opacity: .75;
}