html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}
/* ========== LOGIN ========== */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-card {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    padding: 36px;
    text-align: center;
    color: white;
}

.login-icon {
    font-size: 48px;
}

.login-header h1 {
    margin: 12px 0 4px;
    font-size: 28px;
    font-weight: 800;
}

.login-header p {
    margin: 0;
    opacity: 0.7;
    font-size: 15px;
}

.login-body {
    padding: 32px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

    .form-group label {
        font-size: 13px;
        font-weight: 600;
        color: #374151;
    }

.form-input {
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}

    .form-input:focus {
        border-color: #1d4ed8;
    }

.alert-erreur {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 16px;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #1d4ed8;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn-login:hover {
        background: #1e40af;
    }

    .btn-login:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }
/* ========== PAGE CONTAINER ========== */
.page-container {
    padding: 28px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

    .page-header h2 {
        margin: 0 0 4px;
        font-size: 22px;
        font-weight: 800;
        color: #111827;
    }

.text-muted {
    color: #6b7280;
    margin: 0;
    font-size: 14px;
}

.btn-logout {
    background: transparent;
    border: 1.5px solid #fecaca;
    color: #dc2626;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

    .btn-logout:hover {
        background: #fef2f2;
    }

/* ========== STATS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.stat-card {
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.stat-icon {
    width: 52px;
    height: 52px;
    background: #eff6ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 3px;
}

/* ========== APP LAYOUT ========== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #f1f5f9;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 240px;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-icon {
    font-size: 24px;
}

.sidebar-title {
    color: white;
    font-weight: 800;
    font-size: 16px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 4px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s;
}

    .nav-item:hover {
        background: #1e293b;
        color: white;
    }

    .nav-item.active {
        background: #1d4ed8;
        color: white;
    }

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid #1e293b;
}

.user-info {
    padding: 10px 14px;
    margin-bottom: 8px;
}

.user-name {
    color: white;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.role-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
}

.role-admin {
    background: #ef444422;
    color: #ef4444;
    border: 1px solid #ef444444;
}

.role-magasinier {
    background: #3b82f622;
    color: #3b82f6;
    border: 1px solid #3b82f644;
}

.role-lecture {
    background: #6b728022;
    color: #9ca3af;
    border: 1px solid #6b728044;
}

.btn-deconnexion {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

    .btn-deconnexion:hover {
        background: #1e293b;
    }

/* CONTENU PRINCIPAL */
.main-content {
    flex: 1;
    overflow-y: auto;
}

/* ========== HEADER ACTIONS ========== */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    width: 220px;
}

/* ========== BUTTONS ========== */
.btn {
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    padding: 10px 18px;
    font-size: 14px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    margin-left: 6px;
}

.btn-primary {
    background: #1d4ed8;
    color: white;
}

    .btn-primary:hover {
        background: #1e40af;
    }

.btn-success {
    background: #16a34a;
    color: white;
}

    .btn-success:hover {
        background: #15803d;
    }

.btn-warning {
    background: #d97706;
    color: white;
}

    .btn-warning:hover {
        background: #b45309;
    }

.btn-ghost {
    background: transparent;
    border: 1.5px solid #d1d5db;
    color: #374151;
}

    .btn-ghost:hover {
        background: #f3f4f6;
    }

/* ========== CARD ========== */
.card {
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* ========== DATA TABLE ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .data-table thead tr {
        background: #f8fafc;
        border-bottom: 2px solid #e5e7eb;
    }

    .data-table th {
        padding: 12px 16px;
        text-align: left;
        font-weight: 700;
        color: #374151;
        font-size: 13px;
    }

    .data-table td {
        padding: 13px 16px;
        border-bottom: 1px solid #f1f5f9;
        color: #374151;
    }

    .data-table tbody tr:hover {
        background: #f8fafc;
    }

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-danger {
    color: #dc2626;
    font-weight: 600;
}

.text-success {
    color: #16a34a;
    font-weight: 600;
}

/* ========== BADGE ========== */
.badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.badge-success {
    background: #16a34a22;
    color: #16a34a;
    border: 1px solid #16a34a44;
}

.badge-gray {
    background: #6b728022;
    color: #6b7280;
    border: 1px solid #6b728044;
}

.badge-blue {
    background: #1d4ed822;
    color: #1d4ed8;
    border: 1px solid #1d4ed844;
}

.badge-red {
    background: #ef444422;
    color: #ef4444;
    border: 1px solid #ef444444;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-box {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1.5px solid #f1f5f9;
}

    .modal-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
    }

.modal-close {
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    font-size: 18px;
    color: #6b7280;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 8px;
}

/* ========== FORM ========== */
.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

    .form-group label {
        font-size: 13px;
        font-weight: 600;
        color: #374151;
    }

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

    .form-checkbox label {
        font-size: 14px;
        font-weight: 600;
        color: #374151;
    }

/* ========== MODAL CONFIRMATION ========== */
.modal-confirm {
    max-width: 440px;
}

.confirm-text {
    font-size: 15px;
    color: #374151;
    margin: 0 0 8px;
    line-height: 1.5;
}

.confirm-warning {
    font-size: 13px;
    color: #dc2626;
    margin: 0 0 16px;
}

/* ========== MAGASINS GRID ========== */
.magasins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.magasin-card {
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.magasin-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.magasin-icon {
    font-size: 36px;
}

.magasin-card h3 {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    color: #111827;
}

.magasin-adresse {
    margin: 0 0 12px;
    font-size: 13px;
    color: #6b7280;
}

.magasin-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #374151;
}

.magasin-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
}

    .magasin-actions .btn-ghost {
        flex: 1;
    }

/* POUR LES UTILISATEUR */
.text-primary {
    color: #1d4ed8;
    font-weight: 600;
}


/* ========== EMPTY STATE ========== */
.empty-state {
    padding: 48px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.empty-state h3 {
    margin: 0 0 8px;
    color: #374151;
}

/* ========== ALERTS ========== */
.alert-success {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
}

    .alert-success strong {
        color: #15803d;
        font-size: 16px;
    }

    .alert-success p {
        margin: 2px 0 0;
        color: #16a34a;
        font-size: 13px;
    }

.alert-icon {
    font-size: 28px;
}

.alert-warning {
    background: #fefce8;
    border: 1.5px solid #fde68a;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #92400e;
    font-size: 13px;
}

/* ========== SAISIE INVENTAIRE ========== */
.saisie-table-header {
    display: grid;
    grid-template-columns: 3fr 1fr 2fr;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
}

.saisie-row {
    display: grid;
    grid-template-columns: 3fr 1fr 2fr;
    gap: 8px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
}

    .saisie-row:nth-child(even) {
        background: #fafafa;
    }

.saisie-article-nom {
    font-weight: 600;
    color: #111827;
    font-size: 14px;
}

.saisie-article-detail {
    font-size: 12px;
    color: #9ca3af;
}

.saisie-qte-input {
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    width: 100%;
}

.saisie-comment-input {
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    width: 100%;
}

.saisie-footer {
    padding: 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 15px;
}

/* ========== BOUTON IMPRIMER ========== */
.btn-print {
    background: #475569;
    color: white;
}

    .btn-print:hover {
        background: #334155;
    }

/* ========== IMPRESSION ========== */
@media print {
    .sidebar,
    .page-header .btn,
    .header-actions,
    .search-input,
    .saisie-footer .btn,
    .magasin-actions,
    .btn-print,
    th.text-right,
    td.text-right {
        display: none !important;
    }

    .main-content {
        width: 100% !important;
    }

    .page-container {
        padding: 0 !important;
        max-width: 100% !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }

    body {
        background: white !important;
    }

    .print-header {
        display: block !important;
        margin-bottom: 20px;
        border-bottom: 2px solid #111827;
        padding-bottom: 12px;
    }
}

.print-header {
    display: none;
}
/* ========== LIGNE INVENTAIRE CLIQUABLE ========== */
.inventaire-ligne-cliquable {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.15s;
}

    .inventaire-ligne-cliquable:hover {
        background: #f8fafc;
        border-color: #93c5fd;
    }

.inventaire-ligne-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.inventaire-ligne-info {
    flex: 1;
}

.inventaire-ligne-titre {
    font-weight: 700;
    font-size: 16px;
    color: #111827;
}

.inventaire-ligne-sub {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

.inventaire-ligne-arrow {
    font-size: 24px;
    color: #9ca3af;
}

.badge-orange {
    background: #d9770622;
    color: #d97706;
    border: 1px solid #d9770644;
}

.ligne-mouvement-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

    .ligne-mouvement-row .form-input {
        flex: 1;
    }
/* ========== AUTOCOMPLETE ========== */
.autocomplete-container {
    position: relative;
    flex: 1;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid #f1f5f9;
}

    .autocomplete-item:last-child {
        border-bottom: none;
    }

    .autocomplete-item:hover {
        background: #eff6ff;
    }

.autocomplete-code {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.autocomplete-nom {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.autocomplete-unite {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}
/* ========== STOCK INITIAL ========== */
.stock-initial-famille-header {
    font-size: 15px;
    font-weight: 700;
    color: #374151;
    padding: 8px 4px 10px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 8px;
}
/* ========== IMPORT EXCEL ========== */
.import-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    margin-bottom: 16px;
    transition: all 0.2s;
    background: #fafafa;
}

    .import-dropzone.dragover {
        border-color: #1d4ed8;
        background: #eff6ff;
    }

.import-resultat {
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 8px;
}

    .import-resultat.success {
        background: #f0fdf4;
        border: 1.5px solid #bbf7d0;
        color: #15803d;
    }

    .import-resultat.warning {
        background: #fefce8;
        border: 1.5px solid #fde68a;
        color: #92400e;
    }