
:root {
    --primary: #198754;
    --primary-dark: #146c43;
    --primary-light: #e8f5ee;

    --background: #f5f7f9;
    --surface: #ffffff;
    --text: #17211b;
    --muted: #6c757d;

    --border: #e4e8eb;
    --danger: #dc3545;
    --warning: #ffc107;

    --radius: 14px;
    --shadow: 0 4px 18px rgba(0, 0, 0, 0.06);

    --header-height: 64px;
    --bottom-nav-height: 68px;
}


/* ==========================================================
   RESET
   ========================================================== */

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    background: var(--background);
    color: var(--text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}


/* ==========================================================
   LOGIN
   ========================================================== */

.login-container {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 18px;

    padding: 32px;

    box-shadow: var(--shadow);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header h1 {
    margin: 0 0 6px;

    color: var(--primary);

    font-size: 1.8rem;
    font-weight: 700;
}

.login-header p {
    margin: 0;

    color: var(--muted);
}


/* ==========================================================
   FORMULAIRES
   ========================================================== */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    font-size: 0.92rem;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;

    min-height: 48px;

    padding: 11px 13px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: #fff;
    color: var(--text);

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(25, 135, 84, 0.12);
}


/* ==========================================================
   RESTER CONNECTÉ
   ========================================================== */

.remember-row {
    margin: 4px 0 20px;
}

.remember-row label {
    display: flex;
    align-items: center;
    gap: 9px;

    color: var(--muted);

    font-size: 0.9rem;

    cursor: pointer;
}

.remember-row input {
    width: 17px;
    height: 17px;

    accent-color: var(--primary);
}


/* ==========================================================
   BOUTONS
   ========================================================== */

.btn-login,
.btn-primary {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 100%;

    min-height: 48px;

    padding: 11px 18px;

    border: 0;
    border-radius: 10px;

    background: var(--primary);
    color: #fff;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.1s ease;
}

.btn-login:hover,
.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-login:active,
.btn-primary:active {
    transform: translateY(1px);
}


/* ==========================================================
   MOT DE PASSE OUBLIÉ
   ========================================================== */

.forgot-password {
    margin-top: 20px;

    text-align: center;
}

.forgot-password a {
    color: var(--primary);

    font-size: 0.9rem;
    font-weight: 500;
}

.forgot-password a:hover {
    text-decoration: underline;
}


/* ==========================================================
   ALERTES
   ========================================================== */

.alert {
    padding: 12px 14px;

    margin-bottom: 18px;

    border-radius: 10px;

    font-size: 0.9rem;
}

.alert-danger {
    background: #fdebed;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.alert-warning {
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}


/* ==========================================================
   HEADER APPLICATION
   ========================================================== */

.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    height: var(--header-height);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 16px;

    background: var(--surface);

    border-bottom: 1px solid var(--border);
}

.app-header-left {
    display: flex;
    align-items: center;

    gap: 12px;
}

.app-header-left strong {
    font-size: 1.08rem;
}

.app-header-user {
    color: var(--muted);

    font-size: 0.88rem;
}

.menu-button {
    width: 40px;
    height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 9px;

    background: var(--primary-light);
    color: var(--primary);

    cursor: pointer;

    font-size: 1.2rem;
}


/* ==========================================================
   DASHBOARD
   ========================================================== */

.dashboard-container {
    width: 100%;
    max-width: 1200px;

    margin: 0 auto;

    padding: 24px 16px 100px;
}

.dashboard-welcome {
    margin-bottom: 22px;
}

.dashboard-welcome h1 {
    margin: 0 0 4px;

    font-size: 1.5rem;
}

.dashboard-welcome p {
    margin: 0;

    color: var(--muted);
}


/* ==========================================================
   STATISTIQUES
   ========================================================== */

.dashboard-stats {
    display: grid;

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

    gap: 12px;

    margin-bottom: 28px;
}

.stat-card {
    padding: 17px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.stat-label {
    display: block;

    margin-bottom: 7px;

    color: var(--muted);

    font-size: 0.82rem;
}

.stat-value {
    display: block;

    font-size: 1.12rem;

    line-height: 1.3;
}

.stat-card small {
    display: block;

    margin-top: 5px;

    color: var(--muted);

    font-size: 0.75rem;
}


/* ==========================================================
   SECTIONS
   ========================================================== */

.quick-actions,
.shoe-types {
    margin-bottom: 28px;
}

.quick-actions h2,
.section-heading h2 {
    margin: 0;

    font-size: 1.05rem;
}

.quick-actions-grid {
    display: grid;

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

    gap: 10px;

    margin-top: 13px;
}

.quick-action {
    min-height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 10px;

    background: var(--primary);

    border-radius: 10px;

    color: #fff;

    font-size: 0.9rem;
    font-weight: 600;

    text-align: center;
}

.quick-action:hover {
    background: var(--primary-dark);
}


/* ==========================================================
   EN-TÊTE DE SECTION
   ========================================================== */

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 13px;
}

.section-heading span {
    color: var(--muted);

    font-size: 0.82rem;
}


/* ==========================================================
   CARTES DES TYPES
   ========================================================== */

.shoe-types-grid {
    display: grid;

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

    gap: 12px;
}

.shoe-type-card {
    min-height: 125px;

    display: flex;
    align-items: center;

    gap: 13px;

    padding: 16px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);

    transition:
        transform 0.12s ease,
        border-color 0.12s ease;
}

.shoe-type-card:hover {
    border-color: var(--primary);
}

.shoe-type-card:active {
    transform: scale(0.98);
}

.shoe-type-icon {
    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: var(--primary-light);

    color: var(--primary);

    font-size: 0.7rem;
    font-weight: 700;

    text-align: center;
}

.shoe-type-card h3 {
    margin: 0 0 4px;

    font-size: 0.95rem;
}

.shoe-type-card strong {
    display: block;

    font-size: 1rem;
}

.shoe-type-card small {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 0.75rem;
}


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

.dashboard-alert {
    padding: 15px;

    background: #fff3cd;

    border: 1px solid #ffecb5;
    border-radius: var(--radius);
}

.dashboard-alert strong {
    display: block;

    margin-bottom: 3px;

    color: #664d03;
}

.dashboard-alert p {
    margin: 0 0 8px;

    color: #664d03;

    font-size: 0.88rem;
}

.dashboard-alert a {
    color: #664d03;

    font-size: 0.85rem;
    font-weight: 600;

    text-decoration: underline;
}


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

.bottom-nav {
    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;

    z-index: 1100;

    height: var(--bottom-nav-height);

    display: grid;

    grid-template-columns: repeat(5, 1fr);

    background: rgba(255, 255, 255, 0.97);

    border-top: 1px solid var(--border);

    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav a {
    display: flex;

    align-items: center;
    justify-content: center;

    color: var(--muted);

    font-size: 0.72rem;
    font-weight: 500;

    text-align: center;
}

.bottom-nav a.active {
    color: var(--primary);

    font-weight: 700;
}


/* ==========================================================
   RESPONSIVE TABLET / PC
   ========================================================== */

@media (min-width: 768px) {

    .dashboard-container {
        padding-left: 24px;
        padding-right: 24px;
    }

    .dashboard-stats {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

    .quick-actions-grid {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

    .shoe-types-grid {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

    .bottom-nav {
        display: none;
    }

    .dashboard-container {
        padding-bottom: 40px;
    }
}


/* ==========================================================
   PETITS ÉCRANS
   ========================================================== */

@media (max-width: 380px) {

    .dashboard-container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .stat-card {
        padding: 13px;
    }

    .stat-value {
        font-size: 0.98rem;
    }

    .shoe-type-card {
        padding: 12px;
    }

    .shoe-type-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }
}


/* ==========================================================
   ACCESSIBILITÉ
   ========================================================== */

:focus-visible {
    outline: 3px solid rgba(25, 135, 84, 0.25);
    outline-offset: 2px;
}


/* ==========================================================
   RÉDUCTION DES ANIMATIONS
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}

/* ==========================================================
   FORMULAIRES — CARTES
   ========================================================== */

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
}

.form-card h1 {
    margin: 0 0 20px;
    font-size: 1.15rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-help {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 400;
}


/* ==========================================================
   CATÉGORIES
   ========================================================== */

.categories-section {
    margin-bottom: 30px;
}

.category-group {
    margin-bottom: 24px;
}

.category-group > h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.empty-category {
    margin: 0;
    padding: 15px;

    background: var(--surface);

    border: 1px dashed var(--border);
    border-radius: 10px;

    color: var(--muted);
    font-size: 0.85rem;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.category-card {
    display: grid;

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

    align-items: center;
    gap: 14px;

    padding: 14px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 12px;

    box-shadow: var(--shadow);
}

.category-card-info h4 {
    margin: 0 0 3px;
    font-size: 0.92rem;
}

.category-code {
    color: var(--muted);
    font-size: 0.76rem;
}

.category-card-stock {
    text-align: center;
}

.category-card-stock strong {
    display: block;
    font-size: 1rem;
}

.category-card-stock span {
    color: var(--muted);
    font-size: 0.7rem;
}

.category-card-price {
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.category-card-actions {
    grid-column: 1 / -1;

    display: flex;
    gap: 8px;
}

.btn-small {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 38px;

    padding: 8px 12px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface);
    color: var(--text);

    font-size: 0.8rem;
    font-weight: 600;
}

.btn-small:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.text-warning {
    color: #b58105;
}

.empty-state {
    padding: 28px 20px;

    background: var(--surface);

    border: 1px dashed var(--border);
    border-radius: var(--radius);

    text-align: center;
}

.empty-state strong {
    display: block;
    margin-bottom: 5px;
}

.empty-state p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 0.88rem;
}

.back-button {
    width: 38px;
    height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: var(--primary-light);
    color: var(--primary);

    font-size: 1.3rem;
}

.header-action {
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 480px) {

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .category-card {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }

    .category-card-price {
        grid-column: 1;
    }

    .category-card-actions {
        grid-column: 1 / -1;
    }
}

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

.stock-filters {
    display: flex;
    gap: 8px;

    margin-bottom: 20px;

    overflow-x: auto;
    padding-bottom: 4px;

    scrollbar-width: none;
}

.stock-filters::-webkit-scrollbar {
    display: none;
}

.stock-filters a {
    flex: 0 0 auto;

    padding: 9px 14px;

    border: 1px solid var(--border);
    border-radius: 20px;

    background: var(--surface);
    color: var(--muted);

    font-size: 0.82rem;
    font-weight: 600;

    white-space: nowrap;
}

.stock-filters a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}


/* Liste */

.stock-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


/* Carte stock */

.stock-card {
    padding: 16px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.stock-card-main {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;
}

.stock-type {
    display: block;

    margin-bottom: 3px;

    color: var(--muted);

    font-size: 0.75rem;
}

.stock-card h2 {
    margin: 0;

    font-size: 1rem;
}

.stock-card-main small {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 0.75rem;
}


/* Quantité */

.stock-quantity {
    min-width: 70px;

    text-align: right;
}

.stock-quantity strong {
    display: block;

    color: var(--primary);

    font-size: 1.35rem;
    line-height: 1.1;
}

.stock-quantity span {
    color: var(--muted);

    font-size: 0.7rem;
}

.stock-quantity.low strong {
    color: var(--danger);
}


/* Pied de carte */

.stock-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-top: 14px;
    padding-top: 12px;

    border-top: 1px solid var(--border);

    color: var(--muted);

    font-size: 0.78rem;
}

.stock-warning {
    color: var(--danger);

    font-weight: 600;
}


/* Actions */

.stock-card-actions {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 8px;

    margin-top: 12px;
}

.stock-card-actions .primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.stock-card-actions .primary:hover {
    background: var(--primary-dark);
}


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

@media (min-width: 768px) {

    .stock-list {
        display: grid;

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

        gap: 14px;
    }

}

@media (min-width: 1100px) {

    .stock-list {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}