/* ============================================================
   TRACKLIFT CRM v5.0 — SIPRO-CHIM
   Design moderne · Mobile-first · Bottom Nav
   Inspiré des meilleures pratiques CRM 2025
============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

:root {
    /* Palette Sipro-Chim */
    --blue:       #1a237e;
    --blue-d:     #0d1557;
    --blue-m:     #283593;
    --blue-l:     #e8eaf6;
    --blue-f:     #f3f4fb;
    --blue-glow:  rgba(26,35,126,.15);

    --red:        #c62828;
    --red-d:      #b71c1c;
    --red-l:      #ffebee;
    --red-f:      #fff5f5;

    --green:      #2e7d32;
    --green-l:    #e8f5e9;
    --yellow:     #e65100;
    --yellow-l:   #fff3e0;
    --purple:     #6a1b9a;
    --purple-l:   #f3e5f5;
    --teal:       #00695c;
    --teal-l:     #e0f2f1;

    /* Surfaces */
    --bg:         #eef0f8;
    --surface:    #ffffff;
    --surface2:   #f5f6fb;
    --surface3:   #eef0f8;
    --border:     #dde1ef;
    --border2:    #c5cae9;

    /* Texte */
    --text:       #0d1333;
    --text-dim:   #2c3566;
    --text-muted: #6672a0;
    --text-light: #a0a8c8;

    /* Ombres */
    --shadow-xs:  0 1px 3px rgba(26,35,126,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow:     0 4px 12px rgba(26,35,126,.08), 0 1px 3px rgba(0,0,0,.05);
    --shadow-md:  0 8px 24px rgba(26,35,126,.12), 0 2px 6px rgba(0,0,0,.06);
    --shadow-lg:  0 16px 48px rgba(26,35,126,.16), 0 4px 12px rgba(0,0,0,.08);
    --shadow-blue:0 8px 24px rgba(26,35,126,.35);
    --shadow-red: 0 8px 24px rgba(198,40,40,.35);

    /* Radii */
    --r-xs:  6px;
    --r-sm:  10px;
    --r:     14px;
    --r-lg:  18px;
    --r-xl:  24px;
    --r-2xl: 32px;

    /* Layout */
    --header-h: 58px;
    --nav-h:    68px;
}

*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { font-size:16px; -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
body {
    font-family:'Plus Jakarta Sans',sans-serif;
    background:var(--bg);
    color:var(--text);
    min-height:100vh;
    padding-bottom:var(--nav-h);
    overscroll-behavior:none;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
}
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--border2); border-radius:99px; }
::-webkit-scrollbar-thumb:hover { background:var(--blue-m); }

/* ── HEADER ──────────────────────────────────────────── */
.app-header {
    position:sticky; top:0; z-index:300;
    height:var(--header-h);
    background:linear-gradient(135deg, var(--blue-d) 0%, var(--blue) 60%, var(--blue-m) 100%);
    display:flex; align-items:center; justify-content:space-between;
    padding:0 1.25rem;
    box-shadow:0 2px 20px rgba(0,0,0,.25), 0 1px 4px rgba(0,0,0,.15);
}
.app-header::after {
    content:'';
    position:absolute; bottom:0; left:0; right:0; height:1px;
    background:linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
}
.app-logo {
    display:flex; align-items:center; gap:.75rem; text-decoration:none;
}
.app-logo-img {
    height:22px; width:auto; max-width:80px;
    object-fit:contain;
    mix-blend-mode:screen;
    opacity:.95;
    flex-shrink:0;
    border-radius:3px;
}
@media(min-width:640px){
    .app-logo-img { height:26px; max-width:100px; }
}
.app-logo-text {
    font-weight:800; font-size:1.15rem;
    color:#fff; letter-spacing:-.03em;
}
.app-logo-text span { color:#ff8a80; }

.desktop-nav { display:none; gap:.15rem; }
.desktop-nav a {
    padding:.4rem .85rem; border-radius:var(--r-sm);
    color:rgba(255,255,255,.7); font-size:.8rem; font-weight:600;
    text-decoration:none; transition:all .2s; white-space:nowrap;
    letter-spacing:.01em;
}
.desktop-nav a:hover { background:rgba(255,255,255,.15); color:#fff; }
.desktop-nav a.active {
    background:rgba(255,255,255,.2);
    color:#fff;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.3);
}

.header-right { display:flex; align-items:center; gap:.75rem; }
.header-user-info { display:none; text-align:right; }
.header-user-name { font-size:.78rem; font-weight:700; color:rgba(255,255,255,.9); display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:120px; }
.header-user-role {
    font-size:.62rem; font-weight:600; font-family:'DM Mono',monospace;
    text-transform:uppercase; letter-spacing:.06em;
    color:rgba(255,255,255,.6); display:block; margin-top:.1rem;
}

.header-avatar {
    width:36px; height:36px; border-radius:50%;
    background:linear-gradient(135deg, rgba(255,255,255,.25), rgba(255,255,255,.15));
    border:2px solid rgba(255,255,255,.4);
    display:flex; align-items:center; justify-content:center;
    font-weight:800; font-size:.85rem; color:#fff;
    cursor:pointer; flex-shrink:0; user-select:none;
    transition:all .2s; backdrop-filter:blur(4px);
}
.header-avatar:hover { background:rgba(255,255,255,.3); transform:scale(1.05); }

.header-menu {
    position:absolute; top:calc(var(--header-h) + 8px); right:1rem;
    background:var(--surface); border:1px solid var(--border);
    border-radius:var(--r-lg); box-shadow:var(--shadow-lg);
    min-width:220px; z-index:400; overflow:hidden; display:none;
    animation:menuIn .15s ease;
}
@keyframes menuIn { from{opacity:0;transform:translateY(-8px) scale(.97);}to{opacity:1;transform:translateY(0) scale(1);} }
.header-menu.open { display:block; }
.header-menu-user {
    padding:1rem 1.25rem;
    background:linear-gradient(135deg, var(--blue-f), #fff);
    border-bottom:1px solid var(--border);
}
.header-menu-name { font-weight:800; font-size:.95rem; color:var(--text); }
.header-menu-email { font-size:.72rem; color:var(--text-muted); margin-top:.2rem; font-family:'DM Mono',monospace; }
.header-menu-role { margin-top:.5rem; }
.header-menu a {
    display:flex; align-items:center; gap:.75rem;
    padding:.875rem 1.25rem; font-size:.875rem; font-weight:600;
    color:var(--text-dim); text-decoration:none;
    border-bottom:1px solid var(--border); transition:background .15s;
}
.header-menu a:last-child { border-bottom:none; }
.header-menu a:hover { background:var(--blue-f); color:var(--blue); }
.header-menu a.danger { color:var(--red); }
.header-menu a.danger:hover { background:var(--red-l); }
.menu-icon { font-size:.95rem; width:20px; text-align:center; flex-shrink:0; }

/* ── BOTTOM NAV ──────────────────────────────────────── */
.bottom-nav {
    position:fixed; bottom:0; left:0; right:0; z-index:300;
    height:var(--nav-h);
    background:var(--surface);
    border-top:1.5px solid var(--border);
    display:flex; align-items:stretch;
    box-shadow:0 -4px 24px rgba(26,35,126,.10), 0 -1px 4px rgba(0,0,0,.06);
    padding-bottom:env(safe-area-inset-bottom,0px);
}
.nav-item {
    flex:1; display:flex; flex-direction:column;
    align-items:center; justify-content:center; gap:3px;
    text-decoration:none; color:var(--text-muted);
    font-size:.58rem; font-weight:700; letter-spacing:.05em;
    text-transform:uppercase; position:relative;
    -webkit-tap-highlight-color:transparent; transition:color .2s;
}
.nav-item svg { width:22px; height:22px; transition:transform .2s; }
.nav-item span { line-height:1; }
.nav-item.active { color:var(--blue); }
.nav-item.active svg { transform:scale(1.12); }
.nav-item.active::after {
    content:''; position:absolute; bottom:0; left:50%;
    transform:translateX(-50%);
    width:32px; height:3px; background:var(--blue);
    border-radius:99px 99px 0 0;
}
.nav-item:active { opacity:.7; }

/* ── PAGE CONTAINER ──────────────────────────────────── */
.page {
    padding:1.25rem 1rem calc(1.5rem + env(safe-area-inset-bottom,0px));
    max-width:100%;
}
@media(min-width:640px) {
    .page { padding:1.5rem; max-width:760px; margin:0 auto; }
    body { padding-bottom:0; }
    .bottom-nav { display:none; }
    .desktop-nav { display:flex !important; }
    .header-user-info { display:block; }
}
@media(min-width:1024px) { .page { max-width:1160px; padding:2rem; } }

/* ── PAGE TITLES ─────────────────────────────────────── */
.page-title {
    font-weight:800; font-size:1.6rem; letter-spacing:-.04em;
    color:var(--text); margin-bottom:.2rem;
    background:linear-gradient(135deg, var(--text), var(--blue));
    -webkit-background-clip:text; -webkit-text-fill-color:transparent;
    background-clip:text;
}
.page-sub {
    font-family:'DM Mono',monospace; font-size:.68rem;
    color:var(--text-muted); text-transform:uppercase;
    letter-spacing:.1em; margin-bottom:1.5rem;
}

/* ── CARDS ───────────────────────────────────────────── */
.card {
    background:var(--surface); border:1px solid var(--border);
    border-radius:var(--r-lg); padding:1.25rem;
    box-shadow:var(--shadow-xs); margin-bottom:1rem;
    transition:box-shadow .2s;
}
.card:hover { box-shadow:var(--shadow); }
.card-title {
    font-weight:700; font-size:.95rem; color:var(--text);
    margin-bottom:1rem; padding-bottom:.75rem;
    border-bottom:1px solid var(--border);
    display:flex; align-items:center; justify-content:space-between; gap:.5rem;
}

/* ── FORMS ───────────────────────────────────────────── */
.form-group { display:flex; flex-direction:column; gap:.4rem; margin-bottom:.875rem; }
.form-group:last-child { margin-bottom:0; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; }
@media(max-width:420px) { .form-row { grid-template-columns:1fr; } }

label {
    font-family:'DM Mono',monospace; font-size:.67rem;
    text-transform:uppercase; letter-spacing:.09em;
    color:var(--text-muted); font-weight:500;
}
.required-star { color:var(--red); margin-left:2px; }

input[type=text],input[type=email],input[type=password],
input[type=number],input[type=date],input[type=tel],
select, textarea {
    width:100%; padding:.875rem 1rem;
    background:var(--surface2); border:1.5px solid var(--border);
    border-radius:var(--r-sm); color:var(--text);
    font-family:'Plus Jakarta Sans',sans-serif;
    font-size:.95rem; font-weight:500;
    outline:none; transition:all .2s;
    min-height:50px; -webkit-appearance:none; appearance:none;
}
input:focus,select:focus,textarea:focus {
    border-color:var(--blue); background:#fff;
    box-shadow:0 0 0 4px rgba(26,35,126,.08);
}
input::placeholder { color:var(--text-light); font-weight:400; }
input[readonly] {
    background:linear-gradient(135deg, var(--blue-f), #fff);
    color:var(--blue); font-weight:700;
    font-family:'DM Mono',monospace; font-size:.88rem;
    cursor:default; border-color:var(--border2);
}
select {
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%236672a0' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 1rem center;
    padding-right:2.5rem; cursor:pointer;
}
select option { background:#fff; color:var(--text); }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
    display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
    padding:.875rem 1.5rem; border-radius:var(--r-sm);
    font-family:'Plus Jakarta Sans',sans-serif; font-weight:700; font-size:.9rem;
    cursor:pointer; border:none; transition:all .2s;
    min-height:48px; white-space:nowrap; text-decoration:none;
    -webkit-tap-highlight-color:transparent; letter-spacing:.01em;
    position:relative; overflow:hidden;
}
.btn::after {
    content:''; position:absolute; inset:0;
    background:linear-gradient(rgba(255,255,255,.1),rgba(255,255,255,0));
    opacity:0; transition:opacity .2s;
}
.btn:hover::after { opacity:1; }
.btn:active { transform:scale(.97); }
.btn svg { width:17px; height:17px; flex-shrink:0; }

.btn-primary {
    background:linear-gradient(135deg, var(--blue), var(--blue-m));
    color:#fff; width:100%;
    box-shadow:var(--shadow-blue);
}
.btn-primary:hover { background:linear-gradient(135deg, var(--blue-d), var(--blue)); transform:translateY(-1px); }
.btn-primary:disabled { opacity:.5; cursor:not-allowed; transform:none; box-shadow:none; }

.btn-red {
    background:linear-gradient(135deg, var(--red), var(--red-d));
    color:#fff; box-shadow:var(--shadow-red);
}
.btn-red:hover { transform:translateY(-1px); }

.btn-outline { background:transparent; color:var(--blue); border:2px solid var(--blue); }
.btn-outline:hover { background:var(--blue-l); }

.btn-ghost {
    background:var(--surface2); color:var(--text-dim);
    border:1.5px solid var(--border);
}
.btn-ghost:hover { border-color:var(--blue); color:var(--blue); background:var(--blue-f); }

.btn-sm { padding:.5rem 1rem; min-height:36px; font-size:.8rem; border-radius:var(--r-sm); }
.btn-xs { padding:.3rem .65rem; min-height:28px; font-size:.75rem; border-radius:var(--r-xs); }
.btn-icon {
    width:44px; height:44px; padding:0; border-radius:var(--r-sm);
    background:var(--surface2); border:1.5px solid var(--border);
    color:var(--text-muted); flex-shrink:0;
}
.btn-icon:hover { border-color:var(--blue); color:var(--blue); background:var(--blue-f); }
.btn-icon-sm { width:34px; height:34px; padding:0; border-radius:var(--r-xs); background:var(--surface2); border:1.5px solid var(--border); color:var(--text-muted); flex-shrink:0; }

/* ── BADGES ──────────────────────────────────────────── */
.badge {
    display:inline-flex; align-items:center; gap:.3rem;
    padding:.22rem .7rem; border-radius:99px;
    font-size:.68rem; font-weight:700; white-space:nowrap;
    font-family:'DM Mono',monospace; letter-spacing:.04em;
}
.badge-blue   { background:var(--blue-l);   color:var(--blue);   border:1px solid rgba(26,35,126,.2); }
.badge-red    { background:var(--red-l);    color:var(--red);    border:1px solid rgba(198,40,40,.2); }
.badge-green  { background:var(--green-l);  color:var(--green);  border:1px solid rgba(46,125,50,.2); }
.badge-yellow { background:var(--yellow-l); color:var(--yellow); border:1px solid rgba(230,81,0,.2); }
.badge-purple { background:var(--purple-l); color:var(--purple); border:1px solid rgba(106,27,154,.2); }
.badge-teal   { background:var(--teal-l);   color:var(--teal);   border:1px solid rgba(0,105,92,.2); }
.badge-gray   { background:var(--surface2); color:var(--text-muted); border:1px solid var(--border); }

/* ── KPI CARDS ───────────────────────────────────────── */
.stats-grid { display:grid; grid-template-columns:1fr 1fr; gap:.875rem; margin-bottom:1.25rem; }
@media(min-width:640px) { .stats-grid { grid-template-columns:repeat(4,1fr); } }

.stat-card {
    background:var(--surface); border:1px solid var(--border);
    border-radius:var(--r-lg); padding:1.1rem 1.25rem;
    box-shadow:var(--shadow-xs); position:relative; overflow:hidden;
    transition:all .2s;
}
.stat-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); }
.stat-card::before {
    content:''; position:absolute; top:0; left:0; right:0; height:3px;
    border-radius:var(--r-lg) var(--r-lg) 0 0;
}
.stat-card::after {
    content:''; position:absolute;
    top:-20px; right:-20px; width:80px; height:80px;
    border-radius:50%; opacity:.06;
}
.stat-c1::before { background:linear-gradient(90deg, var(--blue), var(--blue-m)); }
.stat-c1::after  { background:var(--blue); opacity:.08; }
.stat-c2::before { background:linear-gradient(90deg, var(--red), #e53935); }
.stat-c2::after  { background:var(--red); opacity:.08; }
.stat-c3::before { background:linear-gradient(90deg, var(--green), #43a047); }
.stat-c3::after  { background:var(--green); opacity:.08; }
.stat-c4::before { background:linear-gradient(90deg, var(--yellow), #ef6c00); }
.stat-c4::after  { background:var(--yellow); opacity:.08; }

.stat-lbl {
    font-family:'DM Mono',monospace; font-size:.62rem;
    text-transform:uppercase; letter-spacing:.12em;
    color:var(--text-muted); margin-bottom:.6rem; font-weight:500;
}
.stat-val {
    font-weight:800; font-size:1.85rem; line-height:1;
    letter-spacing:-.04em;
}
.stat-c1 .stat-val { color:var(--blue); }
.stat-c2 .stat-val { color:var(--red); }
.stat-c3 .stat-val { color:var(--green); }
.stat-c4 .stat-val { color:var(--yellow); }
.stat-trend { font-size:.72rem; color:var(--text-muted); margin-top:.4rem; display:flex; align-items:center; gap:.3rem; }

/* ── TABLE ───────────────────────────────────────────── */
.table-card {
    background:var(--surface); border:1px solid var(--border);
    border-radius:var(--r-lg); overflow:hidden;
    box-shadow:var(--shadow-xs); margin-bottom:1rem;
}
.table-header {
    padding:.875rem 1.25rem; border-bottom:1px solid var(--border);
    display:flex; align-items:center; justify-content:space-between;
    background:linear-gradient(135deg, var(--blue-f), var(--surface));
    flex-wrap:wrap; gap:.5rem;
}
.table-header-title { font-weight:700; font-size:.9rem; color:var(--text); }
.result-badge {
    font-family:'DM Mono',monospace; font-size:.68rem; font-weight:700;
    background:var(--blue-l); color:var(--blue);
    padding:.22rem .7rem; border-radius:99px;
    border:1px solid rgba(26,35,126,.15);
}
.table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
table { width:100%; border-collapse:collapse; }
thead th {
    padding:.75rem 1rem; background:var(--bg);
    font-family:'DM Mono',monospace; font-size:.6rem;
    text-transform:uppercase; letter-spacing:.09em;
    color:var(--text-muted); text-align:left; font-weight:600;
    border-bottom:1px solid var(--border); white-space:nowrap;
}
tbody td {
    padding:.8rem 1rem; font-size:.85rem;
    border-bottom:1px solid var(--border);
    vertical-align:middle; color:var(--text-dim);
    transition:background .15s;
}
tbody tr:last-child td { border-bottom:none; }
tbody tr:hover td { background:var(--blue-f); }
.td-mono { font-family:'DM Mono',monospace; font-weight:600; }
.td-blue { color:var(--blue); font-weight:700; }
.td-red  { color:var(--red);  font-weight:700; }
.td-green{ color:var(--green);font-weight:700; }

/* ── LIST ITEMS ──────────────────────────────────────── */
.list-item {
    padding:.9rem 1rem; border-bottom:1px solid var(--border);
    display:flex; align-items:center; gap:.875rem;
    transition:background .15s; -webkit-tap-highlight-color:transparent;
}
.list-item:last-child { border-bottom:none; }
.list-item:active { background:var(--blue-f); }
.list-avatar {
    width:44px; height:44px; border-radius:var(--r);
    flex-shrink:0; display:flex; align-items:center; justify-content:center;
    font-weight:800; font-size:.9rem; letter-spacing:-.02em;
}
.list-body { flex:1; min-width:0; }
.list-title {
    font-weight:700; font-size:.9rem; color:var(--text);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.list-sub { font-size:.78rem; color:var(--text-muted); margin-top:.2rem; line-height:1.4; }
.list-tags { display:flex; gap:.3rem; flex-wrap:wrap; margin-top:.35rem; }
.list-right { text-align:right; flex-shrink:0; }
.list-val { font-family:'DM Mono',monospace; font-weight:700; font-size:.88rem; color:var(--blue); }
.list-actions { display:flex; flex-direction:column; gap:.3rem; margin-top:.4rem; }

/* ── ARTICLE CARD ────────────────────────────────────── */
.article-card {
    background:var(--surface2); border:1px solid var(--border);
    border-radius:var(--r-lg); padding:1rem; margin-bottom:.75rem;
    animation:fadeUp .2s ease; transition:box-shadow .2s;
}
.article-card:hover { box-shadow:var(--shadow); }
@keyframes fadeUp { from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:translateY(0);} }
.article-head {
    display:flex; align-items:center; justify-content:space-between;
    margin-bottom:.875rem; gap:.5rem;
}
.article-num {
    font-family:'DM Mono',monospace; font-size:.67rem; color:var(--text-muted);
    background:var(--surface); border:1px solid var(--border);
    padding:.22rem .55rem; border-radius:var(--r-xs);
}
.qty-row { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; margin-top:.75rem; }
.colisage-tag {
    margin-top:.5rem; padding:.45rem .875rem;
    background:linear-gradient(135deg, var(--blue-l), var(--blue-f));
    border:1px solid rgba(26,35,126,.15);
    border-radius:var(--r-sm);
    font-family:'DM Mono',monospace; font-size:.72rem; color:var(--blue);
    display:none; font-weight:600;
}
.colisage-tag.show { display:block; }
.article-total {
    margin-top:.75rem; padding:.7rem 1rem;
    background:linear-gradient(135deg, var(--blue-f), #fff);
    border:2px solid var(--blue-l);
    border-radius:var(--r-sm);
    display:flex; justify-content:space-between; align-items:center;
}
.article-total-lbl { font-size:.8rem; color:var(--text-muted); font-weight:600; }
.article-total-val {
    font-family:'DM Mono',monospace; font-weight:800;
    font-size:1.05rem; color:var(--blue);
}

.grand-total {
    background:linear-gradient(135deg, var(--blue-d), var(--blue), var(--blue-m));
    border-radius:var(--r-lg); padding:1.1rem 1.25rem;
    display:flex; justify-content:space-between; align-items:center;
    margin-bottom:1rem; box-shadow:var(--shadow-blue); position:relative; overflow:hidden;
}
.grand-total::before {
    content:''; position:absolute; top:-30px; right:-30px;
    width:100px; height:100px; border-radius:50%;
    background:rgba(255,255,255,.08);
}
.grand-total-lbl { font-size:.8rem; color:rgba(255,255,255,.8); font-weight:600; letter-spacing:.05em; text-transform:uppercase; }
.grand-total-val {
    font-weight:800; font-size:1.6rem; color:#fff;
    font-family:'DM Mono',monospace; letter-spacing:-.02em;
}

/* ── DROPDOWN CUSTOM ─────────────────────────────────── */
.drop-wrap { position:relative; width:100%; }
.drop-btn {
    width:100%; padding:.875rem 1rem;
    background:var(--surface2); border:1.5px solid var(--border);
    border-radius:var(--r-sm); color:var(--text-muted);
    font-family:'Plus Jakarta Sans',sans-serif; font-size:.95rem; font-weight:500;
    display:flex; justify-content:space-between; align-items:center;
    cursor:pointer; transition:all .2s; min-height:50px;
    user-select:none; -webkit-tap-highlight-color:transparent;
}
.drop-btn.selected { color:var(--text); border-color:var(--blue); background:#fff; }
.drop-btn:hover { border-color:var(--blue-m); }
.drop-btn svg { width:14px; height:14px; flex-shrink:0; color:var(--text-muted); }
.drop-list {
    display:none; position:absolute;
    top:calc(100% + 6px); left:0; right:0;
    background:var(--surface); border:2px solid var(--blue);
    border-radius:var(--r-lg); z-index:450;
    max-height:260px; overflow-y:auto;
    box-shadow:var(--shadow-lg);
    animation:dropIn .15s ease;
}
@keyframes dropIn { from{opacity:0;transform:translateY(-6px);}to{opacity:1;transform:translateY(0);} }
.drop-list.open { display:block; }
.drop-option {
    padding:.875rem 1rem; cursor:pointer;
    font-size:.9rem; font-weight:500; color:var(--text-dim);
    border-bottom:1px solid var(--border);
    transition:all .15s; min-height:48px;
    display:flex; align-items:center;
    -webkit-tap-highlight-color:transparent;
}
.drop-option:last-child { border-bottom:none; }
.drop-option:hover,.drop-option:active { background:var(--blue-f); color:var(--blue); padding-left:1.25rem; }
.drop-empty { padding:.875rem 1rem; color:var(--text-muted); font-size:.85rem; font-style:italic; }

/* ── CLIENT FICHE ────────────────────────────────────── */
.client-fiche {
    background:linear-gradient(135deg, var(--blue-f), #fff);
    border:2px solid rgba(26,35,126,.15);
    border-radius:var(--r-lg); padding:1rem; margin-top:.75rem;
    display:none; animation:fadeUp .2s ease;
}
.client-fiche.show { display:block; }
.fiche-head { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:.875rem; }
.fiche-nom { font-weight:800; font-size:1.05rem; color:var(--blue); }
.fiche-marche { font-size:.78rem; color:var(--text-muted); margin-top:.2rem; font-family:'DM Mono',monospace; }
.fiche-grid { display:grid; grid-template-columns:1fr 1fr; gap:.5rem; }
.fiche-item { display:flex; flex-direction:column; gap:.15rem; }
.fiche-lbl { font-family:'DM Mono',monospace; font-size:.6rem; text-transform:uppercase; letter-spacing:.09em; color:var(--text-muted); font-weight:600; }
.fiche-val { font-size:.84rem; font-weight:600; color:var(--text-dim); }

.new-client-block {
    background:linear-gradient(135deg, var(--yellow-l), #fff);
    border:2px solid rgba(230,81,0,.2);
    border-radius:var(--r-lg); padding:1rem; margin-top:.75rem;
    display:none; animation:fadeUp .2s ease;
}
.new-client-block.show { display:block; }
.nc-title {
    font-size:.7rem; font-weight:700; color:var(--yellow);
    text-transform:uppercase; letter-spacing:.09em;
    font-family:'DM Mono',monospace; margin-bottom:.875rem;
}

/* ── FILTER BAR ──────────────────────────────────────── */
.filter-bar {
    background:var(--surface); border:1px solid var(--border);
    border-radius:var(--r-lg); padding:.875rem 1rem;
    margin-bottom:1rem; box-shadow:var(--shadow-xs);
    display:flex; flex-wrap:wrap; gap:.75rem; align-items:flex-end;
}
.filter-group { display:flex; flex-direction:column; gap:.3rem; flex:1; min-width:120px; }
.filter-group input,.filter-group select { min-height:42px; font-size:.875rem; padding:.55rem .875rem; }

/* ── MODAL ───────────────────────────────────────────── */
.modal-overlay {
    position:fixed; inset:0; background:rgba(13,19,51,.55);
    z-index:500; display:none; align-items:flex-end; justify-content:center;
    backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); padding:0;
}
.modal-overlay.open { display:flex; }
@media(min-width:640px) {
    .modal-overlay { align-items:center; padding:1.5rem; }
    .modal { border-radius:var(--r-xl) !important; max-width:500px !important; }
}
.modal {
    background:var(--surface); border-radius:var(--r-xl) var(--r-xl) 0 0;
    padding:1.5rem; width:100%; max-height:92vh; overflow-y:auto;
    animation:slideUp .25s ease;
}
@keyframes slideUp { from{transform:translateY(100%);}to{transform:translateY(0);} }
.modal-handle {
    width:36px; height:4px; background:var(--border2);
    border-radius:99px; margin:0 auto 1.25rem;
}
.modal-title { font-weight:800; font-size:1.1rem; color:var(--text); margin-bottom:1.25rem; }
.modal-footer { display:flex; gap:.75rem; margin-top:1.25rem; }

/* ── TOAST ───────────────────────────────────────────── */
.toast {
    position:fixed; bottom:calc(var(--nav-h) + 1rem); left:50%;
    transform:translateX(-50%) translateY(16px);
    border-radius:var(--r); padding:.8rem 1.4rem;
    font-size:.875rem; font-weight:700; z-index:600;
    opacity:0; transition:all .3s cubic-bezier(.34,1.56,.64,1);
    white-space:nowrap; box-shadow:var(--shadow-lg);
    pointer-events:none; max-width:calc(100vw - 2rem);
    text-align:center; letter-spacing:.01em;
}
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }
.toast.ok  { background:linear-gradient(135deg,var(--green),#388e3c); color:#fff; }
.toast.err { background:linear-gradient(135deg,var(--red),var(--red-d)); color:#fff; }
@media(min-width:640px) { .toast { bottom:1.5rem; } }

/* ── PAGINATION ──────────────────────────────────────── */
.pagination { display:flex; justify-content:center; align-items:center; gap:.4rem; padding:1rem; flex-wrap:wrap; }
.pg-btn {
    padding:.4rem .75rem; background:var(--surface2);
    border:1.5px solid var(--border); border-radius:var(--r-sm);
    color:var(--text-muted); font-size:.8rem; cursor:pointer;
    font-family:'DM Mono',monospace; transition:all .2s;
    min-width:36px; text-align:center; min-height:36px;
    display:inline-flex; align-items:center; justify-content:center;
}
.pg-btn:hover { border-color:var(--blue); color:var(--blue); background:var(--blue-f); }
.pg-btn.active { background:var(--blue); color:#fff; border-color:var(--blue); font-weight:700; box-shadow:0 2px 8px rgba(26,35,126,.3); }
.pg-btn:disabled { opacity:.3; cursor:default; }

/* ── ALERTS ──────────────────────────────────────────── */
.alert {
    padding:.9rem 1rem; border-radius:var(--r-sm);
    font-size:.875rem; font-weight:600; margin-bottom:1rem;
    display:flex; align-items:flex-start; gap:.75rem; line-height:1.5;
}
.alert-success { background:var(--green-l); color:var(--green); border:1px solid rgba(46,125,50,.2); }
.alert-error   { background:var(--red-l);   color:var(--red);   border:1px solid rgba(198,40,40,.2); }
.alert-info    { background:var(--blue-l);  color:var(--blue);  border:1px solid rgba(26,35,126,.2); }
.alert-warning { background:var(--yellow-l);color:var(--yellow);border:1px solid rgba(230,81,0,.2); }

/* ── EMPTY STATE ─────────────────────────────────────── */
.empty-state { text-align:center; padding:3rem 1.5rem; color:var(--text-muted); }
.empty-state svg { width:52px; height:52px; color:var(--border2); margin:0 auto 1rem; display:block; }
.empty-state-title { font-weight:700; font-size:.95rem; color:var(--text-dim); margin-bottom:.5rem; }
.empty-state p { font-size:.875rem; line-height:1.6; }

/* ── CHART CARDS ─────────────────────────────────────── */
.chart-grid { display:grid; grid-template-columns:1fr; gap:1rem; margin-bottom:1rem; }
@media(min-width:900px)  { .chart-grid { grid-template-columns:2fr 1fr; } }
@media(min-width:1100px) { .chart-grid-4 { grid-template-columns:1fr 1fr; } }
.chart-card {
    background:var(--surface); border:1px solid var(--border);
    border-radius:var(--r-lg); padding:1.25rem;
    box-shadow:var(--shadow-xs); transition:box-shadow .2s;
}
.chart-card:hover { box-shadow:var(--shadow); }
.chart-title { font-weight:700; font-size:.9rem; color:var(--text); margin-bottom:1rem; display:flex; align-items:center; gap:.5rem; }
.chart-wrap { position:relative; height:200px; }
@media(min-width:640px) { .chart-wrap { height:240px; } }

/* ── LOGIN ───────────────────────────────────────────── */
.login-page {
    min-height:100vh; display:flex; align-items:center;
    justify-content:center; padding:1rem; position:relative; overflow:hidden;
    background:linear-gradient(135deg, var(--blue-d) 0%, var(--blue) 50%, #1565c0 100%);
}
.login-page::before {
    content:''; position:absolute; inset:0;
    background:url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-page::after {
    content:''; position:absolute;
    bottom:-100px; right:-100px; width:400px; height:400px;
    border-radius:50%; background:rgba(255,255,255,.05);
}
.login-card {
    background:#fff; border-radius:var(--r-2xl);
    padding:2.25rem 2rem; width:100%; max-width:420px;
    box-shadow:0 24px 80px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.15);
    position:relative; z-index:1; animation:cardIn .4s ease;
}
@keyframes cardIn { from{opacity:0;transform:translateY(24px) scale(.97);}to{opacity:1;transform:translateY(0) scale(1);} }
.login-logo-wrap {
    text-align:center; margin-bottom:1.75rem; padding-bottom:1.5rem;
    border-bottom:1px solid var(--border);
}
.login-logo-img { height:48px; width:auto; max-width:200px; object-fit:contain; margin-bottom:.5rem; }
.login-brand {
    font-family:'DM Mono',monospace; font-size:.65rem;
    text-transform:uppercase; letter-spacing:.2em;
    color:var(--text-muted); display:block;
}
.login-title { font-weight:800; font-size:1.3rem; color:var(--text); margin-bottom:.3rem; }
.login-sub { font-size:.875rem; color:var(--text-muted); margin-bottom:1.5rem; }

/* ── ZONES / ADMIN ───────────────────────────────────── */
.zone-block {
    background:var(--surface); border:1px solid var(--border);
    border-radius:var(--r-lg); overflow:hidden;
    box-shadow:var(--shadow-xs); margin-bottom:.875rem;
    transition:box-shadow .2s;
}
.zone-block:hover { box-shadow:var(--shadow); }
.zone-head {
    background:linear-gradient(135deg, var(--blue-d), var(--blue));
    color:#fff; padding:.9rem 1.1rem;
    display:flex; align-items:center; justify-content:space-between;
}
.zone-head-name { font-weight:800; font-size:.95rem; }
.zone-head-count { font-family:'DM Mono',monospace; font-size:.72rem; opacity:.75; }
.marche-row {
    padding:.8rem 1.1rem; border-bottom:1px solid var(--border);
    display:flex; align-items:center; justify-content:space-between; gap:.5rem;
    transition:background .15s;
}
.marche-row:hover { background:var(--blue-f); }
.marche-row:last-child { border-bottom:none; }
.marche-nom { font-weight:600; font-size:.88rem; }
.marche-nb { font-family:'DM Mono',monospace; font-size:.72rem; color:var(--text-muted); margin-top:.15rem; }

.checkbox-grid { display:grid; grid-template-columns:1fr 1fr; gap:.5rem; }
@media(max-width:420px) { .checkbox-grid { grid-template-columns:1fr; } }
.check-item {
    display:flex; align-items:flex-start; gap:.6rem;
    padding:.75rem; background:var(--surface2);
    border:1.5px solid var(--border); border-radius:var(--r-sm);
    cursor:pointer; transition:all .15s;
    -webkit-tap-highlight-color:transparent;
}
.check-item:hover { border-color:var(--blue); background:var(--blue-f); }
.check-item.checked { border-color:var(--blue); background:var(--blue-l); }
.check-item input[type=checkbox] { width:18px; height:18px; accent-color:var(--blue); flex-shrink:0; margin-top:1px; }
.check-lbl { font-size:.83rem; font-weight:600; color:var(--text); line-height:1.3; }
.check-sub { font-size:.7rem; color:var(--text-muted); margin-top:.15rem; font-family:'DM Mono',monospace; }

/* ── TABS ────────────────────────────────────────────── */
.tabs { display:flex; gap:.4rem; margin-bottom:1.25rem; border-bottom:2px solid var(--border); padding-bottom:.75rem; flex-wrap:wrap; }
.tab-btn {
    padding:.5rem 1rem; border-radius:var(--r-sm);
    font-weight:700; font-size:.82rem; cursor:pointer;
    border:1.5px solid var(--border); background:var(--surface2);
    color:var(--text-muted); transition:all .2s; min-height:38px;
}
.tab-btn.active { background:var(--blue); color:#fff; border-color:var(--blue); box-shadow:0 2px 8px rgba(26,35,126,.3); }
.tab-btn:hover:not(.active) { border-color:var(--blue); color:var(--blue); background:var(--blue-f); }

/* ── ANNIVERSAIRES WIDGET ────────────────────────────── */
.anniv-card {
    background:linear-gradient(135deg, #fff3e0, #fff8f0);
    border:1.5px solid rgba(230,81,0,.2);
    border-radius:var(--r-lg); padding:1rem; margin-bottom:1rem;
}
.anniv-item {
    display:flex; align-items:center; gap:.75rem;
    padding:.5rem 0; border-bottom:1px solid rgba(230,81,0,.1);
}
.anniv-item:last-child { border-bottom:none; }
.anniv-avatar {
    width:38px; height:38px; border-radius:50%;
    background:linear-gradient(135deg, var(--yellow), #ef6c00);
    color:#fff; display:flex; align-items:center; justify-content:center;
    font-weight:800; font-size:.85rem; flex-shrink:0;
}
.anniv-nom { font-weight:700; font-size:.88rem; color:var(--text); }
.anniv-date { font-family:'DM Mono',monospace; font-size:.72rem; color:var(--yellow); margin-top:.1rem; }

/* ── FOOTER ──────────────────────────────────────────── */
.app-footer {
    text-align:center; padding:1.25rem 1rem;
    font-family:'DM Mono',monospace; font-size:.68rem;
    color:var(--text-muted); border-top:1px solid var(--border);
    background:var(--surface); margin-top:1.5rem;
}
.app-footer span { color:var(--blue); font-weight:700; }

/* ── SHIMMER (loading) ───────────────────────────────── */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background:linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
    background-size:200% 100%;
    animation:shimmer 1.5s infinite;
    border-radius:var(--r-sm);
}
