/* ===================================================================
   TravFlow — feuille de style
   Thème teal ; page de connexion fidèle à la maquette ; app responsive.
   =================================================================== */
:root{
    --brand:#15b6c9; --brand-d:#119aab; --brand-soft:#e7f6f8;
    --navy:#0f2733; --navy-2:#163b49;
    --ink:#13323b; --muted:#6b7b82; --line:#e6edef; --bg:#f4f7f8;
    --ok:#1f9d57; --ok-soft:#e7f7ee; --warn:#c98a16; --warn-soft:#fcf3e2;
    --bad:#c5483f; --bad-soft:#fdecea;
    --radius:16px; --shadow:0 10px 30px rgba(15,39,51,.08);
    --sidebar-w:252px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;overflow-x:hidden;max-width:100%;position:relative}
*{ -webkit-tap-highlight-color:transparent }
body{font-family:"Segoe UI",system-ui,-apple-system,Tahoma,"Noto Sans Arabic",sans-serif;
    background:var(--bg);color:var(--ink);font-size:15px;line-height:1.5;-webkit-text-size-adjust:100%}
a{color:inherit}
h1,h2,h3{margin:0}

/* ============ PAGE DE CONNEXION (maquette) ============ */
.tf-login{
    min-height:100vh;width:100%;
    background-color:#0c2236;
    background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221600%22%20height%3D%221000%22%20viewBox%3D%220%200%201600%201000%22%20preserveAspectRatio%3D%22xMidYMid%20slice%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22sky%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%220%22%20y2%3D%221%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%230b2447%22%2F%3E%3Cstop%20offset%3D%2238%25%22%20stop-color%3D%22%231f5a86%22%2F%3E%3Cstop%20offset%3D%2262%25%22%20stop-color%3D%22%234f97b8%22%2F%3E%3Cstop%20offset%3D%2280%25%22%20stop-color%3D%22%23f0b066%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23ffd79a%22%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%22sun%22%20cx%3D%2276%25%22%20cy%3D%2270%25%22%20r%3D%2220%25%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%23fff6e2%22%2F%3E%3Cstop%20offset%3D%2242%25%22%20stop-color%3D%22%23ffdf9c%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23ffdf9c%22%20stop-opacity%3D%220%22%2F%3E%3C%2FradialGradient%3E%3ClinearGradient%20id%3D%22sea%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%220%22%20y2%3D%221%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%232b7fa6%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%2314506e%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%221600%22%20height%3D%221000%22%20fill%3D%22url%28%23sky%29%22%2F%3E%3Crect%20width%3D%221600%22%20height%3D%221000%22%20fill%3D%22url%28%23sun%29%22%2F%3E%3Ccircle%20cx%3D%221216%22%20cy%3D%22700%22%20r%3D%2286%22%20fill%3D%22%23fff1cf%22%2F%3E%3Cg%20fill%3D%22%23eaf6ff%22%3E%3Ccircle%20cx%3D%22180%22%20cy%3D%22120%22%20r%3D%222.2%22%2F%3E%3Ccircle%20cx%3D%22340%22%20cy%3D%2280%22%20r%3D%221.5%22%2F%3E%3Ccircle%20cx%3D%22520%22%20cy%3D%22150%22%20r%3D%221.8%22%2F%3E%3Ccircle%20cx%3D%22900%22%20cy%3D%2290%22%20r%3D%221.6%22%2F%3E%3Ccircle%20cx%3D%221080%22%20cy%3D%22150%22%20r%3D%222%22%2F%3E%3Ccircle%20cx%3D%221320%22%20cy%3D%2290%22%20r%3D%221.6%22%2F%3E%3Ccircle%20cx%3D%221460%22%20cy%3D%22190%22%20r%3D%221.8%22%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%22%23ffffff%22%20opacity%3D%22.15%22%3E%3Cellipse%20cx%3D%22380%22%20cy%3D%22300%22%20rx%3D%22170%22%20ry%3D%2228%22%2F%3E%3Cellipse%20cx%3D%221180%22%20cy%3D%22250%22%20rx%3D%22150%22%20ry%3D%2224%22%2F%3E%3C%2Fg%3E%3Cpath%20d%3D%22M120%20470%20Q%20640%20250%201360%20250%22%20fill%3D%22none%22%20stroke%3D%22%23ffffff%22%20stroke-width%3D%224%22%20stroke-dasharray%3D%222%2020%22%20stroke-linecap%3D%22round%22%20opacity%3D%22.8%22%2F%3E%3Cg%20transform%3D%22translate%281300%20232%29%20rotate%28-12%29%20scale%281.7%29%22%20fill%3D%22%23f4f8fb%22%20stroke%3D%22%23cdd9e0%22%20stroke-width%3D%221%22%3E%3Cpath%20d%3D%22M0%200%20L60%208%20L60%20-8%20Z%22%2F%3E%3Cpath%20d%3D%22M14%200%20L40%20-34%20L54%20-30%20L34%202%20Z%22%2F%3E%3Cpath%20d%3D%22M14%200%20L40%2034%20L54%2030%20L34%20-2%20Z%22%2F%3E%3Cpath%20d%3D%22M52%200%20L70%20-10%20L74%20-6%20L60%202%20Z%22%2F%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%220%22%20r%3D%224%22%20fill%3D%22%2315b6c9%22%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%22%23fff%22%20opacity%3D%22.85%22%3E%3Cpath%20d%3D%22M300%20210%20q%2010%20-8%2020%200%20q%2010%20-8%2020%200%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222.4%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M360%20250%20q%208%20-6%2016%200%20q%208%20-6%2016%200%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222.2%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fg%3E%3Cpath%20d%3D%22M0%20720%20Q%20260%20660%20520%20700%20T%201040%20700%20T%201600%20700%20L1600%201000%20L0%201000%20Z%22%20fill%3D%22url%28%23sea%29%22%2F%3E%3Cg%20opacity%3D%22.5%22%20fill%3D%22%23bfe3ef%22%3E%3Crect%20x%3D%22200%22%20y%3D%22780%22%20width%3D%2290%22%20height%3D%223%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%22160%22%20y%3D%22820%22%20width%3D%22140%22%20height%3D%223%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%22900%22%20y%3D%22800%22%20width%3D%22120%22%20height%3D%223%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%221100%22%20y%3D%22840%22%20width%3D%2290%22%20height%3D%223%22%20rx%3D%221.5%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28560%20612%29%22%3E%3Cpath%20d%3D%22M-70%2060%20L70%2060%20L52%2096%20L-52%2096%20Z%22%20fill%3D%22%233a2b22%22%2F%3E%3Crect%20x%3D%22-3%22%20y%3D%22-86%22%20width%3D%226%22%20height%3D%22150%22%20fill%3D%22%235b4636%22%2F%3E%3Cpath%20d%3D%22M3%20-84%20L3%2044%20L96%2044%20Z%22%20fill%3D%22%23ffffff%22%2F%3E%3Cpath%20d%3D%22M-3%20-70%20L-3%2030%20L-74%2030%20Z%22%20fill%3D%22%23d65a4e%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%281180%20690%29%22%3E%3Cpath%20d%3D%22M0%20-40%20C%20-16%20-12%20-16%200%200%200%20C%2016%200%2016%20-12%200%20-40%20Z%22%20fill%3D%22%231f7a3d%22%2F%3E%3Cpath%20d%3D%22M0%20-64%20C%20-18%20-36%20-18%20-22%200%20-22%20C%2018%20-22%2018%20-36%200%20-64%20Z%22%20fill%3D%22%232c9450%22%2F%3E%3Crect%20x%3D%22-4%22%20y%3D%220%22%20width%3D%228%22%20height%3D%2234%22%20fill%3D%22%236b4a2a%22%2F%3E%3C%2Fg%3E%3Cpath%20d%3D%22M0%20880%20Q%20360%20840%20760%20868%20T%201600%20872%20L1600%201000%20L0%201000%20Z%22%20fill%3D%22%230e3a52%22%2F%3E%3Crect%20width%3D%221600%22%20height%3D%221000%22%20fill%3D%22%2308203a%22%20opacity%3D%22.30%22%2F%3E%3C%2Fsvg%3E");
    background-size:cover;
    background-position:center top;
    background-repeat:no-repeat;
    background-attachment:scroll;
    display:flex;align-items:flex-start;justify-content:center;
}
.tf-inner{width:100%;max-width:1440px;padding:26px 24px 32px}
.tf-logo{display:flex;align-items:center;justify-content:center;gap:14px;margin:6px 0 26px}
.tf-logo-mark{width:46px;height:46px;flex:none}
.tf-logo-text{display:flex;align-items:center;gap:12px}
.tf-logo-text b{font-size:30px;font-weight:800;letter-spacing:1px;color:#fff;line-height:1}
.tf-logo-text b span{color:var(--brand)}
.tf-logo-text i{font-style:normal;font-size:22px;font-weight:700;color:var(--brand)}

.tf-grid{display:grid;grid-template-columns:1fr minmax(360px,420px) 1fr;gap:24px;align-items:start}
.tf-side{display:flex;flex-direction:column;gap:20px}
.tf-group-title{color:#eaf6f8;font-size:15px;font-weight:700;margin-bottom:10px;text-align:center}
.tf-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.tf-feat{background:#fff;border-radius:14px;padding:13px 8px;display:flex;flex-direction:column;
    align-items:center;gap:9px;text-align:center;box-shadow:0 3px 10px rgba(0,0,0,.12);min-height:92px;justify-content:center}
.tf-feat-ico{color:var(--brand);display:flex;align-items:center;justify-content:center}
.tf-feat-ico svg{width:30px;height:30px}
.tf-feat-label{font-size:12px;font-weight:600;color:#22404a;line-height:1.3}

/* carte de connexion */
.tf-center{display:flex;justify-content:center}
.tf-card{background:#fff;border-radius:20px;padding:32px 30px;width:100%;max-width:420px;
    box-shadow:0 10px 28px rgba(0,0,0,.25)}
.tf-card-title{font-size:23px;font-weight:800;color:#10303b;text-align:center;margin-bottom:6px}
.tf-card-sub{font-size:13px;color:#7c8b91;text-align:center;margin-bottom:24px}
.tf-input{display:flex;align-items:center;gap:8px;background:#f2f7f8;border:1px solid #e2eaec;
    border-radius:12px;padding:0 14px;margin-bottom:13px}
.tf-input:focus-within{border-color:var(--brand);background:#fff}
.tf-input input{flex:1;min-width:0;border:0;background:transparent;padding:13px 2px;font-size:15px;color:#0f2733;outline:none;font-family:inherit}
.tf-input-ico{color:#9fb3ba;display:flex}.tf-input-ico svg{width:20px;height:20px}
.tf-eye{border:0;background:transparent;color:#9fb3ba;cursor:pointer;padding:4px;display:flex}
.tf-eye svg{width:20px;height:20px}
.tf-remember{display:flex;align-items:center;gap:8px;font-size:14px;color:#5e6e75;margin:2px 0 16px;cursor:pointer}
.tf-remember input{width:16px;height:16px;accent-color:var(--brand)}
.tf-submit{width:100%;background:var(--brand);color:#fff;border:0;border-radius:12px;padding:14px;
    font-size:16px;font-weight:700;cursor:pointer;font-family:inherit}
.tf-submit:hover{background:var(--brand-d)}
.tf-forgot{display:block;text-align:center;margin-top:16px;color:var(--brand);text-decoration:none;font-size:14px}
.tf-forgot:hover{text-decoration:underline}
.tf-alert{background:var(--bad-soft);border:1px solid #f3c4c4;color:#b42323;padding:10px 12px;
    border-radius:10px;margin-bottom:14px;font-size:14px;text-align:center}
.tf-footer{text-align:center;color:#9fb8bf;font-size:12px;margin-top:26px}

@media (max-width:980px){
    .tf-grid{grid-template-columns:1fr;gap:22px}
    .tf-center{order:-1}
    .tf-cards{grid-template-columns:repeat(auto-fill,minmax(92px,1fr))}
    .tf-logo-text b{font-size:26px}.tf-logo-text i{font-size:19px}
    .tf-card{box-shadow:0 6px 20px rgba(0,0,0,.3)}
}

/* ============ COQUE APPLICATIVE ============ */
.app-shell{display:grid;grid-template-columns:var(--sidebar-w) 1fr;height:100vh;height:100dvh;overflow:hidden}
.sidebar{background:linear-gradient(185deg,#123544 0%,#0d2733 60%,#0a212c 100%);position:relative;height:100%;overflow-y:auto}
.nav{display:flex;flex-direction:column;padding:12px 12px 28px}
.nav-item{display:flex;align-items:center;gap:11px;padding:11px 14px;border-radius:11px;color:#aec4cc;
    text-decoration:none;font-weight:600;font-size:14.5px;margin-bottom:3px;transition:background .12s,color .12s}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}
.nav-item.active{background:linear-gradient(90deg,#15b6c9,#0f9fb2);color:#fff;box-shadow:0 6px 16px rgba(21,182,201,.3)}
.nav-ico{width:22px;text-align:center;font-size:16px;opacity:.95}
.nav-section{font-size:11px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:#5f7c87;margin:18px 14px 8px}
.nav-badge{margin-inline-start:auto;background:#15b6c9;color:#fff;border-radius:20px;padding:1px 8px;font-size:12px}
.sidebar-brand{display:flex;align-items:center;gap:10px;padding:18px 16px 8px;color:#fff}
.sidebar-brand b{font-size:19px;letter-spacing:.5px}
.sidebar-brand b span{color:#15b6c9}
.sidebar-brand i{font-style:normal;font-size:14px;color:#15b6c9;font-weight:700}

.main{display:flex;flex-direction:column;min-width:0;height:100%;overflow:hidden}
.topbar{display:flex;align-items:center;gap:16px;padding:12px 22px;
    background:linear-gradient(90deg,#0d2733 0%,#11566010 100%),linear-gradient(90deg,#0e2c39,#124a57);
    background:linear-gradient(90deg,#0e2c39 0%,#13505e 100%);
    color:#fff;flex:none;z-index:20}
.topbar-logo{display:flex;align-items:center;gap:9px;color:#fff;text-decoration:none;white-space:nowrap}
.topbar-logo b{font-size:17px;letter-spacing:.5px;font-weight:800}
.topbar-logo b span{color:#5fd6e4}
.topbar-logo i{font-style:normal;font-size:13px;color:#5fd6e4;font-weight:700}
.topbar-search{flex:1;max-width:520px;display:flex;align-items:center;gap:8px;background:rgba(255,255,255,.14);
    border:1px solid rgba(255,255,255,.18);border-radius:12px;padding:0 14px;height:42px}
.topbar-search input{flex:1;background:transparent;border:0;outline:none;color:#fff;font-size:14px;font-family:inherit}
.topbar-search input::placeholder{color:rgba(255,255,255,.7)}
.topbar-search button{background:transparent;border:0;color:rgba(255,255,255,.85);cursor:pointer;font-size:16px}
.page-title{font-size:19px;font-weight:700;color:var(--navy)}
.topbar-right{margin-inline-start:auto;display:flex;align-items:center;gap:12px}
.user-chip{display:flex;align-items:center;gap:10px;color:#fff}
.user-chip .ucinfo{display:flex;flex-direction:column;line-height:1.2;text-align:end}
.user-name{font-weight:700;font-size:14px}
.user-role{font-size:12px;color:rgba(255,255,255,.7)}
.user-avatar{width:38px;height:38px;border-radius:50%;background:linear-gradient(135deg,#15b6c9,#0f9fb2);
    display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:15px;flex:none}
.content{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:24px 26px;width:100%}
.content > *{max-width:1280px;margin-inline:auto;min-width:0}
/* Empêche le débordement des grilles (enfants de grille = min-width:auto par défaut → débordent à gauche en RTL) */
.kpi-grid > *,.dash-cols > *,.dash-col > *,.grid2 > *,.grid2-panels > *,.stats > *,.qlinks > *,.tf-grid > *,.tf-cards > *{min-width:0}
.kpi,.card,.panel,.stat-card,.tf-card,.tf-feat,.tf-side{min-width:0}
.menu-toggle{display:none;border:0;background:transparent;font-size:22px;cursor:pointer;color:#fff}

/* ============ COMPOSANTS ============ */
.panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:20px;margin-bottom:20px;box-shadow:var(--shadow)}
.panel-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.panel-head h2{font-size:17px;font-weight:700;color:var(--navy)}
.panel-head .btn,.panel-head .search-bar{margin-inline-start:auto}

.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}
.stat-card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:18px 18px 16px;
    box-shadow:var(--shadow);display:flex;flex-direction:column;gap:8px;position:relative;overflow:hidden}
.stat-card::before{content:"";position:absolute;inset-block-start:0;inset-inline:0;height:3px;background:var(--brand)}
.stat-card.stat-accent::before{background:var(--warn)}
.stat-label{font-size:13px;color:var(--muted)}
.stat-value{font-size:24px;font-weight:800;color:var(--navy)}

.quick-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.quick{display:flex;flex-direction:column;align-items:center;gap:9px;padding:18px 10px;border:1px solid var(--line);
    border-radius:14px;text-decoration:none;color:var(--ink);font-weight:600;font-size:13.5px;text-align:center}
.quick:hover{border-color:var(--brand);background:var(--brand-soft)}
.quick-ico{color:var(--brand)}.quick-ico svg{width:28px;height:28px}

.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:12px 12px;text-align:start;border-bottom:1px solid var(--line);font-size:14px}
.table th{font-size:12px;text-transform:uppercase;letter-spacing:.4px;color:var(--muted);font-weight:700}
.table tbody tr:hover{background:#fafcfc}
.row-actions{display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap}
html[dir="rtl"] .row-actions{justify-content:flex-start}

.btn{display:inline-flex;align-items:center;gap:7px;padding:10px 16px;border-radius:11px;border:1px solid transparent;
    font-size:14px;font-weight:600;cursor:pointer;text-decoration:none;font-family:inherit;transition:.15s;white-space:nowrap}
.btn-primary{background:var(--brand);color:#fff}.btn-primary:hover{background:var(--brand-d)}
.btn-ghost{background:#fff;border-color:var(--line);color:#3f5158}.btn-ghost:hover{border-color:var(--brand);color:var(--brand-d)}
.btn-sm{padding:7px 12px;font-size:13px;border-radius:9px}
.btn-install{padding:9px 16px;font-size:13.5px;font-weight:700;background:#15b6c9;color:#fff;border:0;white-space:nowrap}.btn-install:hover{background:#0f9fb2}
.btn-remove{background:transparent;border:0;color:var(--bad);cursor:pointer;font-size:13px;font-weight:600;padding:7px 10px;border-radius:9px;font-family:inherit}
.btn-remove:hover{background:var(--bad-soft)}

.badge{display:inline-block;padding:3px 11px;border-radius:20px;font-size:12px;font-weight:700}
.badge-ok2{background:var(--ok-soft);color:var(--ok)}
.badge-pending{background:var(--warn-soft);color:var(--warn)}
.badge-cancel{background:var(--bad-soft);color:var(--bad)}
.tag-soft{display:inline-block;padding:3px 11px;border-radius:8px;background:#eef3f4;color:#46606a;font-size:12.5px;font-weight:600}

.search-bar input{padding:10px 14px;border:1px solid var(--line);border-radius:11px;font-size:14px;min-width:220px;font-family:inherit;outline:none}
.search-bar input:focus{border-color:var(--brand)}

.filter-tabs{display:flex;gap:8px;flex-wrap:wrap}
.tab{padding:8px 14px;border-radius:20px;background:#f1f6f7;color:#52666d;text-decoration:none;font-size:13.5px;font-weight:600}
.tab:hover{background:#e6eff0}
.tab.active{background:var(--brand);color:#fff}

.grid2{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.grid2-panels{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:start}
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.field label{font-size:13px;font-weight:600;color:#42565d}
.field input,.field select,.field textarea{padding:11px 12px;border:1px solid var(--line);border-radius:11px;
    font-size:14.5px;font-family:inherit;background:#fff;color:var(--ink);outline:none;width:100%}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--brand)}
.form-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:8px}
html[dir="rtl"] .form-actions{justify-content:flex-start}
.check{display:flex;align-items:center;gap:9px;font-size:14px;color:#42565d;margin:6px 0 14px;cursor:pointer}
.check input{width:17px;height:17px;accent-color:var(--brand)}

.inv-meta{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;font-size:14px}
.inv-meta b{color:var(--navy)}
.empty{color:var(--muted);text-align:center;padding:24px 8px}

.alert{padding:13px 16px;border-radius:12px;margin-bottom:16px;font-size:14px}
.alert-ok{background:var(--ok-soft);border:1px solid #bfe6cf;color:#1c7a44}
.alert-error{background:var(--bad-soft);border:1px solid #f3c4c4;color:#b42323}
.alert-update{display:flex;align-items:center;gap:14px;flex-wrap:wrap;background:var(--brand-soft);border:1px solid #bfe6ec;color:#0e6b78}
.alert-update form{margin-inline-start:auto}

.sidebar-backdrop{display:none;position:fixed;inset:0;background:rgba(15,39,51,.45);z-index:40}
.scroll-top{position:fixed;bottom:20px;right:20px;left:auto;width:46px;height:46px;border-radius:50%;
    border:0;background:var(--brand);color:#fff;font-size:22px;cursor:pointer;box-shadow:0 8px 24px rgba(21,182,201,.45);
    display:none;align-items:center;justify-content:center;z-index:30}
html[dir="rtl"] .scroll-top{right:auto;left:20px}
.scroll-top.show{display:flex}

/* ============ RESPONSIVE ============ */
@media (max-width:920px){
    .app-shell{grid-template-columns:1fr;min-height:100vh}
    .sidebar{position:fixed;top:0;bottom:0;inset-inline-start:0;width:280px;height:100vh;z-index:50;
        transform:translateX(-100%);transition:transform .22s ease;box-shadow:0 0 40px rgba(0,0,0,.2);-webkit-overflow-scrolling:touch}
    html[dir="rtl"] .sidebar{transform:translateX(100%)}
    .sidebar.open,html[dir="rtl"] .sidebar.open{transform:translateX(0)}
    .sidebar-backdrop.show{display:block}
    .menu-toggle{display:block}
    .nav{padding-bottom:96px}
    .stats{grid-template-columns:repeat(2,1fr)}
    .grid2,.grid2-panels,.inv-meta{grid-template-columns:1fr}
    .content{padding:16px;padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
    .page-title{display:none}
    .topbar{gap:10px;padding:10px 14px}
    .topbar-logo{display:none}
    .user-chip{display:flex}
    .user-chip .ucinfo{display:none}
    .tb-logout{display:none}
    .panel,.stat-card{box-shadow:0 2px 8px rgba(15,39,51,.05)}
    .quick:hover,.stat-card:hover{background:inherit}

    /* tableaux -> cartes */
    .table thead{display:none}
    .table,.table tbody,.table tr,.table td{display:block;width:100%}
    .table tr{border:1px solid var(--line);border-radius:12px;margin-bottom:12px;padding:6px 12px}
    .table td{border:0;display:flex;justify-content:space-between;gap:14px;padding:8px 0;text-align:end}
    .table td::before{content:attr(data-label);font-weight:700;color:var(--muted);font-size:12.5px;text-align:start}
    .row-actions{justify-content:flex-start;padding-top:8px}
    .table td.row-actions::before{display:none}
}
@media (max-width:480px){
    .stats{grid-template-columns:1fr}
    .tf-inner{padding:18px 16px 28px;padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
}

/* Cloche de notifications */
.bell{position:relative;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:10px;text-decoration:none;font-size:18px;background:rgba(255,255,255,.14);color:#fff}
.bell:hover{background:rgba(255,255,255,.24)}
.bell-badge{position:absolute;top:2px;inset-inline-end:2px;background:var(--bad);color:#fff;font-size:10px;font-weight:700;min-width:16px;height:16px;border-radius:9px;display:flex;align-items:center;justify-content:center;padding:0 4px}

/* ===== Dashboard façon maquette ===== */
.dash-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:18px;flex-wrap:wrap}
.dash-head h1{font-size:22px;font-weight:800;color:var(--navy)}
.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}
.kpi{background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px 18px;box-shadow:var(--shadow);position:relative;overflow:hidden}
.kpi .k-label{font-size:13px;color:var(--muted);margin-bottom:4px}
.kpi .k-value{font-size:26px;font-weight:800;color:var(--navy);line-height:1.1}
.kpi .k-sub{font-size:11px;color:var(--muted);margin-top:2px}
.kpi .k-spark{margin-top:8px}
.kpi .k-spark svg{width:100%;height:38px;display:block}

.dash-cols{display:grid;grid-template-columns:1.4fr 1fr;gap:18px;align-items:start}
.dash-col{display:flex;flex-direction:column;gap:18px}
.card{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);overflow:hidden}
.card-h{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid var(--line)}
.card-h h2{font-size:15px;font-weight:700;color:var(--navy)}
.card-b{padding:14px 18px}
.card-b.tight{padding:6px 10px}

.dep-item{display:flex;align-items:center;gap:12px;padding:11px 8px;border-bottom:1px solid var(--line)}
.dep-item:last-child{border-bottom:0}
.dep-when{min-width:84px;text-align:center;background:#eaf7f9;border-radius:10px;padding:6px;color:#0e6b78}
.dep-when .d{font-weight:800;font-size:13px}.dep-when .t{font-size:11px;color:#5b8b94}
.dep-main{flex:1}.dep-main .tt{font-weight:700;font-size:13.5px}.dep-main .ss{font-size:12px;color:var(--muted)}
.dep-ico{color:var(--brand)}

.feed-item{display:flex;gap:12px;padding:11px 8px;border-bottom:1px solid var(--line)}
.feed-item:last-child{border-bottom:0}
.feed-ico{width:34px;height:34px;border-radius:9px;background:#eaf7f9;color:#0e9fb2;display:flex;align-items:center;justify-content:center;flex:none}
.feed-main .tt{font-weight:600;font-size:13px}.feed-main .ss{font-size:11.5px;color:var(--muted)}

.qlinks{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.qlink{display:flex;flex-direction:column;align-items:center;gap:8px;padding:16px;border:1px solid var(--line);border-radius:12px;text-decoration:none;color:var(--ink);font-weight:600;font-size:13px}
.qlink:hover{border-color:var(--brand);background:var(--brand-soft)}
.qlink svg{width:26px;height:26px;color:var(--brand)}

.ama-status{display:flex;align-items:center;gap:10px;padding:4px 2px;font-weight:700}
.ama-dot{width:10px;height:10px;border-radius:50%}
.ama-on{color:#1f9d57}.ama-on .ama-dot{background:#1f9d57;box-shadow:0 0 0 4px rgba(31,157,87,.15)}
.ama-off{color:#c5483f}.ama-off .ama-dot{background:#c5483f;box-shadow:0 0 0 4px rgba(197,72,63,.12)}

.fin-table{width:100%;border-collapse:collapse}
.fin-table th,.fin-table td{padding:9px 12px;font-size:13px;text-align:start;border-bottom:1px solid var(--line)}
.fin-table th{font-size:11px;text-transform:uppercase;color:var(--muted);letter-spacing:.3px}
.fin-neg{color:#c5483f;font-weight:700}.fin-pos{color:#1f9d57;font-weight:700}

@media (max-width:1100px){ .kpi-grid{grid-template-columns:repeat(2,1fr)} .dash-cols{grid-template-columns:1fr} }
@media (max-width:560px){ .kpi-grid{grid-template-columns:1fr} .qlinks{grid-template-columns:1fr} }

/* Séparateur de section dans les formulaires */
.form-sep{margin:18px 0 12px;padding-top:14px;border-top:1px dashed var(--line);font-weight:700;color:var(--brand-d);font-size:14px}

/* Barre de recherche du tableau de bord */
.dash-search{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:8px 14px;margin-bottom:20px;box-shadow:var(--shadow)}
.dash-search-ico{font-size:18px;color:var(--brand);flex:none}
.dash-search input{flex:1;min-width:0;border:0;outline:none;background:transparent;font-size:15px;font-family:inherit;color:var(--ink)}
.dash-search .btn{flex:none}
@media (max-width:560px){ .dash-search .btn{padding:9px 14px} .dash-search input{font-size:14px} }

/* Pagination */
.pagination{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:16px}
.pagination .page{min-width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;padding:0 10px;border:1px solid var(--line);border-radius:9px;text-decoration:none;color:var(--ink);font-weight:600;font-size:14px;background:#fff}
.pagination .page:hover{border-color:var(--brand);color:var(--brand-d)}
.pagination .page.active{background:var(--brand);color:#fff;border-color:var(--brand)}
.pagination .page-dots{color:var(--muted);padding:0 2px}
.pagination .page-info{margin-inline-start:auto;color:var(--muted);font-size:13px}

.badge-info{background:#e6f0fb;color:#2c6ecb}

/* ===== Barre de défilement élégante (intégrée au design) ===== */
.content{scroll-behavior:smooth}
.content{scrollbar-width:thin;scrollbar-color:rgba(21,182,201,.45) transparent}
.content::-webkit-scrollbar{width:10px}
.content::-webkit-scrollbar-track{background:transparent;margin:6px 0}
.content::-webkit-scrollbar-thumb{background:rgba(21,182,201,.35);border-radius:10px;border:3px solid transparent;background-clip:content-box}
.content::-webkit-scrollbar-thumb:hover{background:rgba(15,159,178,.6);background-clip:content-box}
.content::-webkit-scrollbar-thumb:active{background:rgba(15,159,178,.8);background-clip:content-box}
/* RTL : la barre passe à gauche, on garde un rendu net */
html[dir="rtl"] .content{direction:rtl}

/* Sidebar : barre discrète sur fond foncé */
.sidebar{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.22) transparent}
.sidebar::-webkit-scrollbar{width:7px}
.sidebar::-webkit-scrollbar-track{background:transparent}
.sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);border-radius:8px}
.sidebar::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.32)}

/* Permissions personnalisées + commission */
.perm-box{margin-top:14px;padding:14px;border:1px dashed var(--line);border-radius:12px;background:#fafcfd}
.perm-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:8px;margin-top:6px}
.perm-grid .check{background:#fff;border:1px solid var(--line);border-radius:9px;padding:8px 10px;margin:0;font-size:13.5px}

.period-tabs{display:flex;gap:6px;flex-wrap:wrap}

/* Alias de couleurs de badge (statuts paiement/visa/devis) */
.badge-ok{background:var(--ok-soft);color:var(--ok)}
.badge-warn{background:var(--warn-soft);color:var(--warn)}
.badge-bad{background:var(--bad-soft);color:var(--bad)}

.page-nav{font-weight:700}

/* Autocomplétion client */
.client-ac{position:relative}
.ac-list{position:absolute;top:100%;inset-inline:0;z-index:30;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.12);max-height:240px;overflow:auto;margin-top:4px}
.ac-item{padding:9px 12px;cursor:pointer;font-size:14px;border-bottom:1px solid #f0f4f5}
.ac-item:last-child{border-bottom:0}
.ac-item:hover{background:#e6f7f9}
.ac-hint{display:block;color:var(--muted);margin-top:4px;font-size:12px}

/* Sous-menu Réservations (par type) */
.nav-group{margin:0}
.nav-parent{display:flex;align-items:center;gap:6px}
.nav-parent-link{flex:1;min-width:0}
.nav-toggle{flex:none;width:24px;height:24px;border:1px solid var(--line);background:#fff;border-radius:7px;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--ink);padding:0}
.nav-toggle span{transition:transform .2s;display:inline-block;font-size:10px;line-height:1;font-weight:700}
.nav-group.open .nav-toggle span{transform:rotate(180deg)}
.nav-toggle:hover{background:#e6f7f9;border-color:var(--brand)}
.nav-sub{display:none;flex-direction:column;gap:2px;margin:4px 0 6px;padding-inline-start:18px}
.nav-group.open .nav-sub{display:flex}
.nav-sub .nav-item{font-size:13.5px;padding-top:7px;padding-bottom:7px;opacity:.92}
.nav-sub .nav-item .nav-ico{font-size:13px}

/* Récapitulatif transactions : cadre clair à colonnes (lisible mobile) */
.tx-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(135px,1fr));gap:10px;margin-top:14px}
.tx-sum-card{background:#fff;border:1px solid var(--line);border-radius:11px;padding:10px 13px;display:flex;flex-direction:column;gap:3px}
.tx-sum-label{font-size:11px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.03em}
.tx-sum-val{font-size:16px;font-weight:800;color:var(--ink);line-height:1.15}
.tx-sum-ok{border-color:var(--ok);background:var(--ok-soft)}
.tx-sum-ok .tx-sum-val{color:var(--ok)}
.tx-sum-bad{border-color:var(--bad);background:var(--bad-soft)}
.tx-sum-bad .tx-sum-val{color:var(--bad)}
.tx-sum-net{border-color:#0f2733;background:#0f2733}
.tx-sum-net .tx-sum-label{color:#9fd9e2}
.tx-sum-net .tx-sum-val{color:#fff}
.tx-sum-brand{border-color:var(--brand);background:#e6f7f9}
.tx-sum-brand .tx-sum-val{color:var(--brand-d)}
@media (max-width:920px){ .tx-table tfoot{display:none} }

/* Commission par type (form utilisateur) */
.com-rules{display:flex;flex-direction:column;gap:8px}
.com-row{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:8px;align-items:center}
.com-row .com-type{font-size:13.5px;font-weight:600;color:var(--ink)}
.com-row select,.com-row input{width:100%}
@media (max-width:560px){ .com-row{grid-template-columns:1fr 1fr;gap:6px} .com-row .com-type{grid-column:1/-1;margin-bottom:-2px} }

/* Sélecteur / badge filiale (topbar) */
.branch-switch{background:rgba(255,255,255,.14);color:#fff;border:1px solid rgba(255,255,255,.22);border-radius:9px;padding:7px 10px;font-size:13px;font-weight:600;max-width:170px;cursor:pointer}
.branch-switch option{color:#0f2733}
.branch-badge{display:inline-flex;align-items:center;gap:5px;background:rgba(255,255,255,.14);color:#fff;border:1px solid rgba(255,255,255,.22);border-radius:9px;padding:7px 11px;font-size:13px;font-weight:700;white-space:nowrap}
@media (max-width:760px){ .branch-switch{max-width:120px} .branch-badge{font-size:12px;padding:6px 9px} }

/* Sélecteur de langue */
.lang-login{display:flex;justify-content:flex-end;gap:6px;margin-bottom:4px}
.lang-login a{background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.28);color:#eaf6f8;border-radius:9px;padding:6px 13px;font-size:13px;font-weight:700;text-decoration:none}
.lang-login a.on{background:#fff;color:#0f2733;border-color:#fff}
.lang-top{display:inline-flex;gap:3px}
.lang-top a{background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.22);color:#fff;border-radius:8px;padding:6px 9px;font-size:12px;font-weight:800;text-decoration:none;line-height:1.1}
.lang-top a.on{background:#fff;color:#0f2733;border-color:#fff}

/* Offres de l'agence */
.offer-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px;margin-top:14px}
.offer-card{border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff;display:flex;flex-direction:column;box-shadow:0 2px 8px rgba(0,0,0,.05)}
.offer-thumb{position:relative;height:120px;background:#eef4f6 center/cover no-repeat;display:flex;align-items:center;justify-content:center}
.offer-thumb-ico{font-size:42px;opacity:.8}
.offer-type{position:absolute;top:8px;inset-inline-start:8px;background:rgba(15,39,51,.78);color:#fff;font-size:11px;font-weight:700;padding:3px 9px;border-radius:20px}
.offer-off{position:absolute;top:8px;inset-inline-end:8px;background:#c5483f;color:#fff;font-size:10.5px;font-weight:700;padding:3px 9px;border-radius:20px}
.offer-body{padding:11px 13px 13px;display:flex;flex-direction:column;gap:5px;flex:1}
.offer-title{font-weight:700;color:var(--ink);font-size:14.5px;line-height:1.3}
.offer-desc{color:var(--muted);font-size:12.5px;line-height:1.45}
.offer-price{display:flex;align-items:baseline;gap:8px;margin-top:2px}
.offer-price strong{color:var(--brand-d);font-size:17px}
.offer-old{color:#9aa7ac;text-decoration:line-through;font-size:13px}
.offer-valid{color:var(--muted);font-size:12px}
.offer-actions{display:flex;gap:6px;align-items:center;margin-top:auto;padding-top:8px}
