* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #f3f3f3;
    color: #1f1f1f;
}


/* ========================================
   STRUCTURE PRINCIPALE
======================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
}


/* ========================================
   SIDEBAR
======================================== */

.sidebar {
    width: 245px;
    min-height: 100vh;

    background: #111111;
    color: #ffffff;

    display: flex;
    flex-direction: column;

    position: fixed;

    top: 0;
    bottom: 0;
    left: 0;

    box-shadow:
        2px 0 8px
        rgba(0, 0, 0, 0.15);

    z-index: 30;
}


/* ========================================
   IDENTITÉ / LOGO
======================================== */

.sidebar-brand {
    padding: 28px 18px 26px;
    border-bottom: 1px solid #2d2d2d;
    text-align: center;
}

.exnet-logo {
    width: 96px;
    height: 96px;
    display: block;
    margin: 0 auto 11px;
    object-fit: contain;
}

.brand-title {
    margin-top: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.7px;
    color: #ffffff;
}

.brand-subtitle {
    margin-top: 4px;
    font-size: 11px;
    color: #9b9b9b;
    letter-spacing: 0.1px;
}


/*
   EXNET STOCK sera petit sous le logo.
   Le logo sera ajouté dans le layout ensuite.
*/

.brand-title {
    margin-top: 10px;

    font-size: 14px;
    font-weight: 700;

    letter-spacing: 1px;

    color: #ffffff;
}


.brand-subtitle {
    margin-top: 5px;

    font-size: 11px;

    color: #a7a7a7;

    letter-spacing: 0.2px;
}


/* ========================================
   NAVIGATION
======================================== */

.sidebar-nav {
    padding: 18px 12px;

    flex: 1;

    overflow-y: auto;
}


.nav-link {
    display: flex;
    align-items: center;

    gap: 12px;

    min-height: 44px;

    padding: 10px 14px;

    margin-bottom: 5px;

    color: #d6d6d6;

    text-decoration: none;

    border-radius: 7px;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}


.nav-link:hover {
    background: #242424;

    color: #ffffff;
}


.nav-link.active {
    background: #ffffff;

    color: #111111;

    font-weight: 700;
}


.nav-link.disabled {
    opacity: 0.4;

    cursor: default;
}


.nav-icon {
    width: 20px;

    text-align: center;

    font-size: 17px;

    color: inherit;
}


.nav-section {
    margin:
        24px 14px
        8px;

    font-size: 10px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 1px;

    color: #777777;
}


/* ========================================
   UTILISATEUR
======================================== */

.sidebar-footer {
    padding: 18px 20px;

    border-top:
        1px solid #2d2d2d;
}


.user-name {
    font-weight: 600;

    color: #ffffff;
}


.user-role {
    margin-top: 4px;

    font-size: 12px;

    color: #9a9a9a;
}


.logout-link {
    display: inline-block;

    margin-top: 13px;

    color: #ffffff;

    font-size: 13px;

    text-decoration: none;
}


.logout-link:hover {
    text-decoration: underline;
}


/* ========================================
   CONTENU PRINCIPAL
======================================== */

.main-wrapper {
    margin-left: 245px;

    width: calc(100% - 245px);

    min-height: 100vh;

    background: #f3f3f3;
}


.topbar {
    height: 68px;

    background: #ffffff;

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 0 28px;

    border-bottom:
        1px solid #dddddd;

    position: sticky;

    top: 0;

    z-index: 20;
}


.main-content {
    padding: 28px;
}


/* ========================================
   SÉLECTION DU SITE
======================================== */

.site-switcher {
    display: flex;

    align-items: center;

    gap: 8px;
}


.site-label {
    color: #666666;

    font-size: 13px;
}


.site-button {
    padding: 7px 13px;

    border:
        1px solid #222222;

    border-radius: 6px;

    color: #222222;

    background: #ffffff;

    text-decoration: none;

    font-size: 13px;

    transition: 0.2s ease;
}


.site-button:hover {
    color: #ffffff;

    background: #222222;
}


.site-button.active {
    color: #ffffff;

    background: #111111;

    border-color: #111111;
}


/* ========================================
   TITRES
======================================== */

h1 {
    margin-top: 0;

    font-size: 27px;

    font-weight: 600;

    color: #171717;
}


h2 {
    font-size: 21px;

    color: #202020;
}


h3 {
    color: #222222;
}


/* ========================================
   TABLEAUX
======================================== */

table {
    width: 100%;

    border-collapse: collapse;

    background: #ffffff;

    border-radius: 8px;

    overflow: hidden;

    box-shadow:
        0 2px 8px
        rgba(0, 0, 0, 0.06);
}


table th {
    background: #222222;

    color: #ffffff;

    text-align: left;

    padding: 13px;

    border-bottom:
        1px solid #333333;

    font-size: 13px;
}


table td {
    padding: 13px;

    border-bottom:
        1px solid #e5e5e5;

    font-size: 14px;

    color: #333333;
}


table tr:last-child td {
    border-bottom: none;
}


table tr:hover td {
    background: #f7f7f7;
}


/* ========================================
   LIENS
======================================== */

.main-content a {
    color: #111111;
}


.main-content a:hover {
    color: #555555;
}


/* ========================================
   BOUTONS GÉNÉRIQUES
======================================== */

.btn-action {
    display: inline-block;

    padding: 12px 18px;

    background: #111111;

    color: #ffffff !important;

    border:
        1px solid #111111;

    border-radius: 7px;

    text-decoration: none;

    font-weight: 700;

    transition: 0.2s ease;
}


.btn-action:hover {
    background: #333333;

    border-color: #333333;
}


.btn-secondary {
    padding: 9px 15px;

    border:
        1px solid #222222;

    background: #ffffff;

    color: #222222;

    border-radius: 6px;

    cursor: pointer;

    transition: 0.2s ease;
}


.btn-secondary:hover {
    background: #222222;

    color: #ffffff;
}


/* ========================================
   BADGES
======================================== */

.badge {
    display: inline-block;

    padding: 5px 9px;

    border-radius: 6px;

    font-size: 12px;

    font-weight: 700;
}


.badge-success {
    background: #222222;

    color: #ffffff;
}


.badge-danger {
    background: #555555;

    color: #ffffff;
}


.badge-warning {
    background: #d9d9d9;

    color: #222222;
}


/* ========================================
   CAISSES
======================================== */

.caisse-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;
}


.detail-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 22px;

    margin-bottom: 22px;
}


.detail-card {
    background: #ffffff;

    padding: 22px;

    margin-bottom: 22px;

    border-radius: 9px;

    box-shadow:
        0 2px 8px
        rgba(0, 0, 0, 0.06);
}


.detail-card h2 {
    margin-top: 0;
}


.detail-row {
    display: flex;

    justify-content: space-between;

    gap: 20px;

    padding: 11px 0;

    border-bottom:
        1px solid #e7e7e7;
}


/* ========================================
   STATUTS
======================================== */

.status-badge {
    display: inline-block;

    padding: 8px 14px;

    border-radius: 20px;

    font-size: 13px;

    font-weight: 700;
}


.status-disponible {
    color: #222222;

    background: #e7e7e7;
}


.status-client {
    color: #333333;

    background: #d8d8d8;
}


.status-warning {
    color: #ffffff;

    background: #444444;
}


/* ========================================
   QR CODE
======================================== */

.qr-card {
    text-align: center;
}


.caisse-qr {
    width: 190px;

    height: 190px;

    object-fit: contain;
}


.qr-placeholder {
    width: 190px;

    height: 190px;

    margin: 20px auto;

    border:
        2px dashed #a9a9a9;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    border-radius: 8px;

    color: #777777;
}


.qr-placeholder small {
    margin-top: 8px;
}


/* ========================================
   PAGE HEADER
======================================== */

.page-header-row {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}


.page-header-row h1 {
    margin-bottom: 5px;
}


.page-header-row p {
    margin: 0;

    color: #707070;
}


/* ========================================
   RECHERCHE CAISSES
======================================== */

.caisse-search-form {
    display: flex;

    gap: 10px;

    margin-bottom: 16px;
}


.caisse-search-form input[type="search"] {
    width: 100%;

    max-width: 430px;

    padding: 11px 13px;

    border:
        1px solid #cccccc;

    border-radius: 6px;

    font-size: 14px;

    background: #ffffff;
}


.caisse-search-form input[type="search"]:focus {
    outline: none;

    border-color: #333333;
}


/* ========================================
   TABLE CAISSES
======================================== */

.caisses-table th,
.expedition-table th,
.gelpacks-table th {
    background: #222222 !important;

    color: #ffffff !important;

    font-weight: 700 !important;

    opacity: 1 !important;
}


.caisses-table td {
    vertical-align: middle;
}


/* ========================================
   QR MINI
======================================== */

.qr-mini {
    width: 58px;

    height: 58px;

    object-fit: contain;
}


/* ========================================
   ACTIONS INLINE
======================================== */

.actions-inline {
    display: flex;

    align-items: center;

    gap: 6px;
}


.inline-form {
    display: inline;

    margin: 0;
}


.action-btn {
    width: 34px;

    height: 34px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    border:
        1px solid #222222;

    border-radius: 5px;

    text-decoration: none;

    cursor: pointer;

    font-size: 14px;

    transition: 0.2s ease;
}


.action-view {
    background: #222222 !important;

    color: #ffffff !important;
}


.action-edit {
    background: #ffffff !important;

    color: #222222 !important;

    border-color: #222222 !important;
}


.action-delete {
    background: #444444 !important;

    color: #ffffff !important;

    border-color: #444444 !important;
}


.action-view:hover,
.action-edit:hover,
.action-delete:hover {
    opacity: 0.85;
}


/* ========================================
   DÉTAIL CAISSE
======================================== */

.caisse-detail-page {
    display: flex;

    flex-direction: column;

    gap: 18px;
}


.detail-columns {
    display: grid;

    grid-template-columns: 2fr 1fr;

    gap: 18px;
}


.detail-card h2 {
    margin-top: 0;

    margin-bottom: 18px;
}


.detail-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 18px;
}


.info-block {
    display: flex;

    flex-direction: column;

    gap: 5px;

    padding-bottom: 12px;

    border-bottom:
        1px solid #e7e7e7;
}


.info-label {
    font-size: 13px;

    color: #707070;
}


.badge-large {
    padding: 8px 12px;

    font-size: 14px;
}


.qr-detail-card {
    text-align: center;
}


.qr-detail-image {
    width: 180px;

    height: 180px;

    object-fit: contain;

    background: #ffffff;

    padding: 8px;

    border:
        1px solid #dddddd;

    border-radius: 8px;
}


.qr-actions {
    display: flex;

    justify-content: center;

    gap: 8px;

    margin-top: 15px;
}


.history-table {
    width: 100%;

    border-collapse: collapse;
}


.history-table th {
    padding: 12px;

    background: #222222;

    color: #ffffff;

    text-align: left;
}


.history-table td {
    padding: 12px;

    border-bottom:
        1px solid #e4e4e4;

    vertical-align: middle;
}


.detail-bottom-actions {
    display: flex;

    justify-content: space-between;

    gap: 10px;
}


.card-title-row {
    display: flex;

    justify-content: space-between;

    align-items: center;
}


/* ========================================
   NOUVELLE EXPÉDITION
======================================== */

.new-expedition-box {
    display: flex;

    align-items: center;

    gap: 18px;

    padding: 18px 20px;

    background: #f7f7f7;

    border:
        1px solid #dddddd;

    border-radius: 8px;
}


.new-expedition-icon {
    display: flex;

    align-items: center;

    justify-content: center;

    width: 52px;

    height: 52px;

    flex-shrink: 0;

    font-size: 30px;

    background: #ffffff;

    border:
        1px solid #dddddd;

    border-radius: 8px;
}


.new-expedition-content {
    flex: 1;
}


.new-expedition-content h3 {
    margin: 0 0 5px;

    font-size: 18px;
}


.new-expedition-content p {
    margin: 0;

    color: #666666;

    font-size: 14px;
}


/* ========================================
   GEL PACKS
======================================== */

.gelpacks-page {
    width: 100%;
}


.gelpacks-toolbar {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}


.gelpacks-count {
    font-size: 16px;
}


.gelpacks-count strong {
    font-size: 22px;

    margin-right: 5px;
}


.gelpacks-search {
    width: 320px;

    max-width: 100%;
}


.gelpacks-search input {
    width: 100%;

    padding: 10px 12px;

    border:
        1px solid #cccccc;

    border-radius: 7px;

    font-size: 14px;

    outline: none;

    background: #ffffff;
}


.gelpacks-search input:focus {
    border-color: #333333;
}


.gelpacks-table {
    width: 100%;

    border-collapse: collapse;
}


.gelpacks-table thead {
    background: #222222;

    color: #ffffff;
}


.gelpacks-table th,
.gelpacks-table td {
    padding: 12px 10px;

    text-align: left;

    vertical-align: middle;

    border-bottom:
        1px solid #e5e5e5;
}


.gelpacks-table tbody tr:hover {
    background: #f7f7f7;
}


.qr-table-image {
    width: 44px;

    height: 44px;

    object-fit: contain;
}


.table-actions {
    display: flex;

    align-items: center;

    gap: 7px;
}


.action-button {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    width: 34px;

    height: 34px;

    border:
        1px solid #222222;

    border-radius: 6px;

    cursor: pointer;

    text-decoration: none;

    font-size: 15px;

    font-weight: 700;

    opacity: 1;

    transition:
        transform 0.15s ease,
        filter 0.15s ease,
        box-shadow 0.15s ease;
}


/* VOIR */

.action-button.action-view {
    background: #222222 !important;

    color: #ffffff !important;
}


/* MODIFIER */

.action-button.action-edit {
    background: #ffffff !important;

    color: #222222 !important;
}


/* SUPPRIMER */

.action-button.action-delete {
    background: #444444 !important;

    color: #ffffff !important;
}


.action-button:hover {
    opacity: 1;

    filter: brightness(0.92);

    transform: translateY(-1px);

    box-shadow:
        0 3px 7px
        rgba(0, 0, 0, 0.18);
}


.text-muted {
    color: #858585;
}


/* ========================================
   STOCK
======================================== */

.stock-warning-box {
    margin-top: 18px;

    padding: 14px 16px;

    background: #ededed;

    border:
        1px solid #cccccc;

    border-radius: 7px;

    font-weight: 600;

    color: #333333;
}


/* ========================================
   TABLE RESPONSIVE
======================================== */

.table-responsive {
    width: 100%;

    overflow-x: auto;
}


/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 900px) {

    .sidebar {
        width: 200px;
    }

    .main-wrapper {
        margin-left: 200px;

        width:
            calc(100% - 200px);
    }

    .detail-columns,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .page-header-row {
        align-items: flex-start;

        flex-direction: column;
    }

    .gelpacks-toolbar {
        flex-direction: column;

        align-items: stretch;
    }

    .gelpacks-search {
        width: 100%;
    }

    .detail-bottom-actions {
        flex-direction: column;
    }

    .qr-actions {
        flex-direction: column;
    }
}


@media (max-width: 800px) {

    .caisse-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .caisse-search-form {
        flex-direction: column;
    }

    .new-expedition-box {
        align-items: flex-start;

        flex-direction: column;
    }
}


@media (max-width: 700px) {

    .sidebar {
        position: static;

        width: 100%;

        min-height: auto;
    }

    .app-layout {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;

        width: 100%;
    }

    .topbar {
        position: static;

        height: auto;

        padding: 15px;

        gap: 15px;

        flex-direction: column;

        align-items: flex-start;
    }

    .main-content {
        padding: 16px;
    }
}


/* ========================================
   IMPRESSION
======================================== */

@media print {

    .sidebar,
    .topbar,
    .page-header-row,
    .detail-bottom-actions,
    .qr-actions {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0;

        width: 100%;
    }

    .qr-detail-card {
        border: none;

        box-shadow: none;
    }

    .qr-detail-image {
        width: 250px;

        height: 250px;
    }
}
.exnet-logo {
    width: 100px;
    height: 100px;

    display: block;

    margin: 0 auto 12px;

    object-fit: contain;

    border-radius: 50%;
}