/* Typography & Reset */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fc;
    color: #495057;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: #2c3e50;
}

/* Navbar Enhancements */
.navbar {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}
.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}
.nav-link {
    font-weight: 500;
    color: #5a5c69 !important;
    transition: color 0.2s;
}
.nav-link:hover, .nav-link.active {
    color: #4e73df !important;
}

/* Modern Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}
.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    padding: 1rem 1.25rem;
}

/* Forms & Inputs */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e3e6f0;
    padding: 0.5rem 1rem;
    background-color: #fcfcfc;
    transition: all 0.2s;
}
.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(78, 115, 223, 0.15);
    border-color: #4e73df;
    background-color: #ffffff;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}
.btn-primary {
    background-color: #4e73df;
    border-color: #4e73df;
}
.btn-primary:hover {
    background-color: #2e59d9;
    border-color: #2653d4;
    box-shadow: 0 4px 10px rgba(78, 115, 223, 0.3);
}

/* Custom Dashboard Borders */
.border-left-primary { border-left: 4px solid #4e73df !important; }
.border-left-success { border-left: 4px solid #1cc88a !important; }
.border-left-warning { border-left: 4px solid #f6c23e !important; }
.border-left-danger  { border-left: 4px solid #e74a3b !important; }

/* Text Utilities */
.text-gray-800 { color: #5a5c69 !important; }
.text-primary { color: #4e73df !important; }
.text-success { color: #1cc88a !important; }
.text-warning { color: #f6c23e !important; }
.text-danger { color: #e74a3b !important; }

/* Table Adjustments */
.table th {
    font-weight: 600;
    color: #5a5c69;
    border-bottom-width: 2px;
}
.table td {
    vertical-align: middle;
}

/* Micro-animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.container-fluid {
    animation: fadeIn 0.4s ease-out;
}

/* ===================================================
   MOBILE-FIRST UX & ERGONOMICS (Screens < 992px)
   =================================================== */
@media (max-width: 991.98px) {
    /* Padding bottom on body so fixed bottom navigation never hides content */
    body {
        padding-bottom: 78px !important;
    }

    /* Fixed Top Navbar on mobile */
    .navbar.sticky-top {
        z-index: 1030;
    }

    /* Mobile Bottom Navigation Bar */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: #ffffff;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
        display: flex;
        align-items: center;
        justify-content: space-around;
        z-index: 1045;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .mobile-bottom-nav .nav-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #64748b;
        background: transparent;
        border: none;
        height: 100%;
        padding: 6px 2px;
        font-size: 0.70rem;
        font-weight: 500;
        transition: color 0.15s ease, transform 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-bottom-nav .nav-tab i {
        font-size: 1.25rem;
        margin-bottom: 3px;
        transition: transform 0.15s ease, color 0.15s ease;
    }

    .mobile-bottom-nav .nav-tab.active,
    .mobile-bottom-nav .nav-tab:active {
        color: #2563eb !important;
        font-weight: 700;
    }

    .mobile-bottom-nav .nav-tab.active i {
        transform: scale(1.18);
        color: #2563eb !important;
    }

    /* Prevent mobile auto-zoom in iOS Safari on input focus */
    .form-control, .form-select, input[type="text"], input[type="number"], input[type="date"], select {
        font-size: 16px !important;
    }

    /* Card adjustments on mobile */
    .card {
        border-radius: 10px;
    }
    .card-body {
        padding: 1rem !important;
    }
    .card-header {
        padding: 0.75rem 1rem !important;
    }

    /* Touch targets */
    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .btn-sm {
        min-height: 38px;
    }

    /* Page title responsive size */
    h1.h3 {
        font-size: 1.35rem;
    }

    /* Horizontal table scroll indicators on mobile */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }

    /* Offcanvas Mobile Drawer styling */
    .offcanvas-mobile-menu {
        max-width: 82% !important;
        border-top-left-radius: 16px;
        border-bottom-left-radius: 16px;
    }

    /* Formulaire Lignes de BL & Démarque : Mode Cartes Tactiles Mobiles */
    #table-lignes-livraison thead,
    #table-lignes-demarque thead {
        display: none !important;
    }

    #table-lignes-livraison, 
    #table-lignes-livraison tbody, 
    #table-lignes-livraison tr.ligne-item,
    #table-lignes-demarque,
    #table-lignes-demarque tbody,
    #table-lignes-demarque tr.ligne-demarque-item {
        display: block;
        width: 100%;
    }

    #table-lignes-livraison tr.ligne-item,
    #table-lignes-demarque tr.ligne-demarque-item {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    }

    #table-lignes-livraison tr.ligne-item td,
    #table-lignes-demarque tr.ligne-demarque-item td {
        display: block;
        width: 100% !important;
        padding: 4px 0 !important;
        border: none !important;
    }

    #table-lignes-livraison tfoot,
    #table-lignes-demarque tfoot {
        display: none !important;
    }
}

