/* EcoRP — Thème bleu foncé & blanc, design pro, Material Icons */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --navy: #0f172a;
    --navy-800: #1e293b;
    --navy-700: #334155;
    --navy-600: #475569;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #dbeafe;
    --success: #059669;
    --success-bg: #d1fae5;
    --error: #dc2626;
    --error-bg: #fee2e2;
    --font: 'Inter', system-ui, sans-serif;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 1px 3px rgba(15, 23, 42, .08);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .1);
    --shadow-lg: 0 12px 28px rgba(15, 23, 42, .12);
    --sidebar-width: 280px;
    --topbar-height: 56px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--navy-800);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Material Icons */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 1.35rem;
}

/* ========== Layout ========== */
.layout-app { min-height: 100vh; }
.app-wrap { display: flex; min-height: 100vh; }

/* ========== Sidebar — bleu foncé ========== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--navy);
    color: var(--white);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1), box-shadow .3s;
    overflow-y: auto;
}
.sidebar-brand {
    padding: 1.35rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}
.brand-link {
    display: flex;
    align-items: center;
    gap: .85rem;
    color: var(--white);
    font-weight: 700;
    font-size: 1.2rem;
}
.brand-link:hover { color: var(--white); opacity: .92; }
.brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}
.brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { flex: 1; padding: 1rem 0; }
.nav-user-role {
    margin: 0 1rem .85rem;
    padding: .4rem .65rem;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255,255,255,.6);
    background: rgba(255,255,255,.06);
    border-radius: 8px;
}
.nav-group { margin-bottom: 1.35rem; }
.nav-group-title {
    display: block;
    padding: 0 .6rem .4rem 1.25rem;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.45);
}
.nav-item {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .65rem 1.25rem;
    margin: 0 .6rem;
    color: rgba(255,255,255,.88);
    border-radius: var(--radius);
    transition: background .2s, color .2s;
}
.nav-item:hover { background: rgba(255,255,255,.1); color: var(--white); }
.nav-item .nav-icon { opacity: .9; font-size: 1.25rem !important; }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.nav-group-bottom { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.08); }
.nav-item-logout { color: rgba(255,255,255,.7); }
.nav-item-logout:hover { background: rgba(220, 38, 38, .2); color: #fca5a5; }

/* ========== Main ========== */
.main-wrap {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--gray-50);
}

/* ========== Topbar — menu burger mobile ========== */
.topbar {
    display: none;
    align-items: center;
    gap: 1rem;
    height: var(--topbar-height);
    padding: 0 1rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}
.topbar-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--navy-700);
    transition: background .2s, color .2s;
}
.topbar-menu-btn:hover { background: var(--gray-100); color: var(--navy); }
.topbar-menu-btn:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.topbar-menu-icon { font-size: 1.5rem !important; }
.topbar-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== Content ========== */
.main-content {
    flex: 1;
    padding: 1.75rem 1.5rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ========== Footer ========== */
.site-footer {
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: .8125rem;
    color: var(--navy-600);
    background: var(--white);
    border-top: 1px solid var(--gray-200);
}

/* ========== Overlay & mobile sidebar ========== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 99;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}
.sidebar-overlay.is-open { opacity: 1; pointer-events: auto; }

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .main-wrap { margin-left: 0; }
    .topbar { display: flex; }
    .sidebar-overlay { display: block; }
}

/* ========== Flash ========== */
.flash {
    padding: .9rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-weight: 500;
}
.flash-success { background: var(--success-bg); color: var(--success); }
.flash-error { background: var(--error-bg); color: var(--error); }

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .65rem 1.35rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .9375rem;
    cursor: pointer;
    border: none;
    transition: background .2s, transform .05s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-hover); color: var(--white); }
.btn-secondary { background: var(--gray-200); color: var(--navy-800); }
.btn-secondary:hover { background: var(--gray-300); color: var(--navy); }

/* ========== Cards ========== */
.card {
    background: var(--white);
    padding: 1.4rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: box-shadow .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--gray-300); }
.card h2 { margin-top: 0; font-size: 1.05rem; font-weight: 600; color: var(--navy); }
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}
.account-list, .transaction-list { list-style: none; padding: 0; margin: 0; }
.account-list li, .transaction-list li {
    padding: .5rem 0;
    border-bottom: 1px solid var(--gray-200);
}
.account-list li:last-child, .transaction-list li:last-child { border-bottom: none; }
.card-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.card-list .card { display: flex; flex-direction: column; gap: .35rem; }
.card-list .slug { font-size: .875rem; color: var(--navy-600); }

/* ========== Forms ========== */
.page-auth { max-width: 420px; margin: 0 auto; }
.form-auth .form-group { margin-bottom: 1.1rem; }
.form-auth label { display: block; margin-bottom: .35rem; font-weight: 600; font-size: .9rem; color: var(--navy-800); }
.form-auth input,
.form-auth select {
    width: 100%;
    padding: .7rem .9rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--white);
    color: var(--navy-800);
    transition: border-color .2s, box-shadow .2s;
}
.form-auth input:focus,
.form-auth select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.form-auth button { margin-top: .5rem; }

/* ========== Pages ========== */
.page-home h1 { margin-top: 0; color: var(--navy); font-size: 1.75rem; }
.lead { font-size: 1.05rem; color: var(--navy-600); }
.services-list ul { list-style: none; padding: 0; }
.services-list li { margin: .5rem 0; }
.page-dashboard h1 { margin-top: 0; font-size: 1.5rem; color: var(--navy); }
.page-context .breadcrumb { margin-bottom: 1rem; font-size: .9rem; color: var(--navy-600); }
.page-context .breadcrumb a { color: var(--accent); }

@media (max-width: 480px) {
    .main-content { padding: 1rem; }
    .dashboard-grid, .card-list { grid-template-columns: 1fr; }
}

/* ========== Boutique ========== */
.shop-page-title { margin-top: 0; font-size: 1.65rem; color: var(--navy); }
.shop-page-desc { color: var(--navy-600); margin-bottom: 1.5rem; }
.card-empty { text-align: center; padding: 2rem; }
.card-empty-icon { font-size: 3rem !important; color: var(--navy-300); display: block; margin-bottom: .5rem; }
.shop-select-section { margin-bottom: 2rem; }
.shop-select-section h2, .shop-products-section h2 { font-size: 1.1rem; font-weight: 600; color: var(--navy-700); margin-bottom: 1rem; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.shop-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: 1.1rem .75rem;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    color: var(--navy-800);
    text-decoration: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.shop-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); background: var(--gray-50); }
.shop-card-active { border-color: var(--accent); background: var(--accent-light); color: var(--navy); }
.shop-card-icon { font-size: 1.75rem !important; color: var(--navy-600); }
.shop-card-active .shop-card-icon { color: var(--accent); }
.shop-card-name { font-weight: 600; font-size: .95rem; text-align: center; }
.shop-card-sector { font-size: .75rem; color: var(--navy-600); }
.product-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.product-card { display: flex; flex-direction: column; justify-content: space-between; }
.product-card-body { flex: 1; }
.product-card-name { margin: 0 0 .5rem; font-size: 1.05rem; color: var(--navy); }
.product-card-desc { font-size: .9rem; color: var(--navy-600); margin: 0 0 .5rem; }
.product-card-price { font-weight: 700; font-size: 1.2rem; color: var(--navy); margin: 0 0 .25rem; }
.product-card-price .currency { font-weight: 600; }
.product-card-vat { font-size: .8rem; font-weight: 400; color: var(--navy-600); }
.product-card-stock { font-size: .85rem; color: var(--navy-600); margin: 0 0 .75rem; }
.product-card-actions { margin-top: auto; }
.btn-buy { width: 100%; }
.btn-icon { font-size: 1.2rem !important; }
.text-muted { color: var(--navy-600); }

/* ========== Modal Paiement ========== */
.payment-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}
.payment-modal.is-open { opacity: 1; visibility: visible; }
.payment-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    cursor: pointer;
}
.payment-modal-box {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
}
.payment-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.payment-modal-header h3 { margin: 0; font-size: 1.2rem; color: var(--navy); }
.payment-modal-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--navy-600);
    transition: background .2s;
}
.payment-modal-close-btn:hover { background: var(--gray-200); }
.payment-modal-summary {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
}
.payment-modal-summary p { margin: 0 0 .35rem; font-size: .95rem; }
.payment-modal-summary .payment-total { font-weight: 700; font-size: 1.1rem; color: var(--navy); margin-top: .5rem; }
.payment-form .form-group { margin-bottom: 1rem; }
.payment-methods { display: flex; flex-direction: column; gap: .6rem; margin-top: 1.25rem; }
.payment-method {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: 1rem 1.1rem;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy-800);
    text-align: left;
    transition: border-color .2s, background .2s, transform .05s;
}
.payment-method:hover { border-color: var(--accent); background: var(--accent-light); }
.payment-method:active { transform: scale(.99); }
.payment-method-icon { font-size: 1.5rem !important; color: var(--navy-600); }
.payment-method:hover .payment-method-icon { color: var(--accent); }
.payment-method-label { flex: 1; }
.payment-method-sublabel { font-size: .8rem; font-weight: 400; color: var(--navy-600); }

/* ========== Animation carte ========== */
.card-animation {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .85);
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s, visibility .35s;
}
.card-animation.is-open { opacity: 1; visibility: visible; }
.card-animation-screen {
    position: relative;
    width: 280px;
    height: 320px;
    background: linear-gradient(145deg, var(--navy-700), var(--navy));
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,.4);
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-animation-terminal {
    position: relative;
    width: 200px;
    height: 140px;
    background: var(--navy-800);
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,.1);
}
.card-animation-label {
    position: absolute;
    top: -1.5rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: .75rem;
    font-weight: 600;
    color: rgba(255,255,255,.7);
    text-transform: uppercase;
    letter-spacing: .1em;
}
.card-animation-slot {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 4px;
    background: rgba(0,0,0,.4);
    border-radius: 2px;
}
.card-animation-card {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 95px;
    background: linear-gradient(135deg, #1e3a5f, #2d5a8b);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: .6rem .75rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    transition: bottom .6s cubic-bezier(.34, 1.56, .64, 1);
}
.card-animation.is-running .card-animation-card { bottom: 8px; }
.card-chip { font-size: 1.5rem !important; color: rgba(255,255,255,.5); }
.card-animation-card-text { font-size: .7rem; font-weight: 600; color: rgba(255,255,255,.8); letter-spacing: .05em; }
.card-animation-success {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: rgba(15, 23, 42, .95);
    border-radius: 20px;
    opacity: 0;
    transform: scale(.9);
    transition: opacity .4s, transform .4s;
}
.card-animation.is-done .card-animation-success { opacity: 1; transform: scale(1); }
.card-success-icon { font-size: 4rem !important; color: var(--success); }
.card-animation-success p { margin: 0; font-weight: 700; font-size: 1.2rem; color: var(--white); }
