*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:'Inter',-apple-system,'Helvetica Neue',Arial,sans-serif;background:#f4f4f2;color:#0a0a0a;-webkit-font-smoothing:antialiased}
::-webkit-scrollbar{width:9px;height:9px}
::-webkit-scrollbar-thumb{background:#d0d0cd;border-radius:6px}
::-webkit-scrollbar-track{background:transparent}
a{color:#0a0a0a}
input,button,select,textarea{font-family:inherit}
input:focus,textarea:focus{outline:none;border-color:#0a0a0a}
button{cursor:pointer}

@keyframes opFade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes opBlink{0%,100%{opacity:.25}50%{opacity:1}}
@keyframes opToast{from{opacity:0;transform:translate(-50%,10px)}to{opacity:1;transform:translate(-50%,0)}}

.app{display:flex;height:100vh;width:100%;overflow:hidden;background:#f4f4f2}

/* SIDEBAR */
.sidebar{width:248px;flex:none;background:#0a0a0a;color:#fff;display:flex;flex-direction:column;padding:22px 16px}
.sidebar-logo{padding:6px 8px 26px}
.sidebar-logo img{height:38px;width:auto;display:block}
.nav{display:flex;flex-direction:column;gap:3px}
.nav-btn{display:flex;align-items:center;gap:11px;padding:11px 13px;border-radius:11px;border:0;cursor:pointer;text-align:left;font-size:13.5px;font-weight:500;width:100%;background:transparent;color:rgba(255,255,255,.62);transition:background .15s}
.nav-btn.active{font-weight:600;background:rgba(255,255,255,.12);color:#fff}
.local-ai-side-btn{margin-top:20px;display:flex;align-items:center;gap:10px;padding:12px 13px;border-radius:11px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.05);color:#fff;cursor:pointer;text-align:left;transition:background .15s}
.local-ai-side-btn:hover{background:rgba(255,255,255,.12)}
.local-ai-side-title{font-size:13px;font-weight:600}
.local-ai-side-sub{font-size:10.5px;color:rgba(255,255,255,.5)}
.sidebar-user{margin-top:auto;display:flex;align-items:center;gap:11px;padding:11px 8px;border-top:1px solid rgba(255,255,255,.1)}
.avatar{width:30px;height:30px;border-radius:50%;background:#2a2a2a;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;color:#fff;flex:none}
.user-name{font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-email{font-size:10.5px;color:rgba(255,255,255,.45);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* MAIN */
.main{flex:1;display:flex;flex-direction:column;min-width:0}
.topbar{flex:none;height:64px;background:#fff;border-bottom:1px solid #e7e7e4;display:flex;align-items:center;gap:16px;padding:0 26px}
.search-box{display:flex;align-items:center;gap:9px;flex:1;max-width:420px;height:38px;padding:0 13px;background:#f4f4f2;border-radius:10px;border:1px solid transparent}
.search-box input{border:0;background:transparent;font-size:13.5px;flex:1;color:#0a0a0a}
.spacer{flex:1}
.btn-dark{display:flex;align-items:center;gap:8px;height:38px;padding:0 15px;border-radius:10px;border:1px solid #0a0a0a;background:#0a0a0a;color:#fff;font-size:13px;font-weight:600}
.icon-btn{width:38px;height:38px;border-radius:10px;border:1px solid #e7e7e4;background:#fff;display:flex;align-items:center;justify-content:center}
.content{flex:1;overflow-y:auto;padding:30px 34px 60px}
.page{max-width:1180px;margin:0 auto;animation:opFade .2s}
.page-narrow{max-width:960px;margin:0 auto;animation:opFade .2s}
.page-narrower{max-width:900px;margin:0 auto;animation:opFade .2s}

.page-head{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:24px}
.greeting{font-size:12.5px;color:#8a8a86;font-weight:500;margin-bottom:4px}
h1{margin:0;font-size:27px;font-weight:700;letter-spacing:-.7px}
.btn-outline{height:38px;padding:0 15px;border-radius:10px;border:1px solid #e7e7e4;background:#fff;font-size:13px;font-weight:500;display:flex;align-items:center;gap:7px}

/* KPI */
.kpi-row{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:16px}
.card{background:#fff;border:1px solid #e7e7e4;border-radius:14px}
.kpi-card{padding:17px 18px}
.kpi-label{font-size:12px;color:#8a8a86;font-weight:500;margin-bottom:10px}
.kpi-value{font-size:25px;font-weight:700;letter-spacing:-.8px;line-height:1}
.kpi-delta{display:flex;align-items:center;gap:5px;margin-top:9px;font-size:11.5px;font-weight:600}
.kpi-delta span.sub{color:#a0a09c;font-weight:400}

/* Copilot insight */
.insight{background:#0a0a0a;color:#fff;border-radius:16px;padding:22px 24px;margin-bottom:16px}
.insight-head{display:flex;align-items:center;gap:9px;margin-bottom:13px}
.insight-icon{width:26px;height:26px;border-radius:8px;background:rgba(255,255,255,.12);display:flex;align-items:center;justify-content:center}
.insight-title{font-size:12.5px;font-weight:600;letter-spacing:.2px}
.insight-badge{font-size:10.5px;font-weight:600;color:#0a0a0a;background:#fff;padding:2px 8px;border-radius:20px}
.insight p{margin:0;font-size:17px;line-height:1.5;max-width:760px;font-weight:400;letter-spacing:-.2px}
.insight-actions{display:flex;align-items:center;gap:10px;margin-top:18px}
.btn-white{height:40px;padding:0 18px;border-radius:10px;border:0;background:#fff;color:#0a0a0a;font-size:13.5px;font-weight:600}
.btn-ghost-w{height:40px;padding:0 16px;border-radius:10px;border:1px solid rgba(255,255,255,.25);background:transparent;color:#fff;font-size:13.5px;font-weight:500}
.reco-applied{height:40px;padding:0 18px;border-radius:10px;background:rgba(255,255,255,.14);color:#fff;font-size:13.5px;font-weight:600;display:flex;align-items:center;gap:8px}

/* chart + methods */
.grid2{display:grid;grid-template-columns:1.7fr 1fr;gap:14px}
.chart-card{padding:20px 22px}
.chart-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}
.chart-title{font-size:13px;font-weight:600}
.chart-sub{font-size:11.5px;color:#8a8a86;margin-top:2px}
.chart-total{font-size:20px;font-weight:700;letter-spacing:-.5px}
.bars{display:flex;align-items:flex-end;gap:14px;height:150px}
.bar-col{flex:1;display:flex;flex-direction:column;align-items:center;gap:9px;height:100%;justify-content:flex-end}
.bar{width:100%;max-width:34px;border-radius:6px 6px 3px 3px;background:#0a0a0a}
.bar-label{font-size:10.5px;color:#a0a09c;font-weight:500}
.methods-card{padding:20px 22px}
.methods-title{font-size:13px;font-weight:600;margin-bottom:18px}
.method-row{display:flex;flex-direction:column;gap:15px}
.method-top{display:flex;justify-content:space-between;font-size:12.5px;margin-bottom:6px}
.method-name{font-weight:500}
.method-pct{color:#8a8a86}
.method-bar-bg{height:7px;border-radius:5px;background:#efefec;overflow:hidden}
.method-bar-fill{height:100%;border-radius:5px;background:#0a0a0a}

/* Paiements */
.page-head-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px}
.btn-primary{height:40px;padding:0 16px;border-radius:10px;border:0;background:#0a0a0a;color:#fff;font-size:13.5px;font-weight:600;display:flex;align-items:center;gap:7px}
.btn-secondary{height:40px;padding:0 16px;border-radius:10px;border:1px solid #e7e7e4;background:#fff;font-size:13.5px;font-weight:600}
.chips{display:flex;gap:8px;margin-bottom:16px;flex-wrap:wrap}
.chip{height:34px;padding:0 14px;border-radius:20px;font-size:12.5px;font-weight:600;border:1px solid #e7e7e4;background:#fff;color:#333}
.chip.active{border:1px solid #0a0a0a;background:#0a0a0a;color:#fff}
.chip .count{opacity:.55}
.search-row{display:flex;align-items:center;gap:9px;height:42px;padding:0 14px;background:#fff;border:1px solid #e7e7e4;border-radius:11px;margin-bottom:14px}
.search-row input{border:0;background:transparent;font-size:13.5px;flex:1}
.table{background:#fff;border:1px solid #e7e7e4;border-radius:14px;overflow:hidden}
.table-head{display:grid;grid-template-columns:130px 150px 1fr 130px 120px 40px;gap:14px;padding:13px 20px;border-bottom:1px solid #eeeeeb;font-size:11px;font-weight:600;color:#8a8a86;text-transform:uppercase;letter-spacing:.4px}
.table-row{display:grid;grid-template-columns:130px 150px 1fr 130px 120px 40px;gap:14px;padding:15px 20px;border-bottom:1px solid #f2f2ef;align-items:center;font-size:13px;cursor:pointer}
.table-row:hover{background:#fafaf8}
.table-row:last-child{border-bottom:0}
.tx-amount{font-weight:600;font-variant-numeric:tabular-nums}
.tx-cur{color:#a0a09c;font-weight:400;font-size:11px}
.tx-method{color:#555;font-size:12.5px}
.tx-client{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tx-id{font-family:'JetBrains Mono',monospace;font-size:11px;color:#a0a09c;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tx-date{color:#666;font-size:12.5px}
.badge{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;padding:3px 10px;border-radius:20px}
.badge-ok{background:#0a0a0a;color:#fff}
.badge-ref{background:#e9e9e6;color:#555}
.badge-dis{border:1px solid #0a0a0a;color:#0a0a0a}
.badge-inc{border:1px solid #d8d8d4;color:#8a8a86}
.tx-more{color:#c0c0bc;font-weight:700;text-align:center}

/* Relevés */
.subtabs{display:flex;gap:6px;margin-bottom:20px;background:#ececea;padding:4px;border-radius:11px;width:fit-content}
.subtab{padding:8px 16px;border-radius:8px;font-size:13px;font-weight:500;color:#555;cursor:pointer}
.subtab.active{background:#0a0a0a;color:#fff;font-weight:600}
.stmt-head{display:flex;justify-content:space-between;padding:14px 22px;border-bottom:1px solid #eeeeeb;font-size:11px;font-weight:600;color:#8a8a86;text-transform:uppercase;letter-spacing:.4px}
.stmt-row{display:flex;justify-content:space-between;align-items:center;padding:16px 22px;border-bottom:1px solid #f2f2ef}
.stmt-row:last-child{border-bottom:0}
.stmt-row:hover{background:#fafaf8}
.stmt-left{display:flex;align-items:center;gap:13px}
.stmt-icon{width:34px;height:34px;border-radius:8px;background:#f4f4f2;display:flex;align-items:center;justify-content:center}
.stmt-month{font-size:14px;font-weight:600}
.stmt-detail{font-size:11.5px;color:#a0a09c}
.pdf-btn{display:flex;align-items:center;gap:7px;height:34px;padding:0 13px;border-radius:9px;border:1px solid #e7e7e4;background:#fff;font-size:12.5px;font-weight:600}
.stmt-custom{padding:22px}
.stmt-custom-title{font-size:15px;font-weight:600;margin-bottom:18px}
.form-grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px;margin-bottom:20px}
label{font-size:12px;font-weight:500;color:#666;display:block;margin-bottom:7px}
.field{width:100%;height:42px;padding:0 13px;border:1px solid #e7e7e4;border-radius:10px;font-size:13.5px}
.form-actions{display:flex;gap:10px;justify-content:flex-end}
.mb18{margin-bottom:18px}

/* Compte */
.acc-flex{display:flex;flex-direction:column;gap:14px}
.acc-card{padding:22px}
.acc-title{font-size:15px;font-weight:600;margin-bottom:18px}
.form-grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.span2{grid-column:1/3}
.acc-save{margin-top:20px;display:flex;justify-content:flex-end}
.bank-box{border:1px solid #e7e7e4;border-radius:12px;padding:18px 20px;display:flex;align-items:center;justify-content:space-between}
.bank-left{display:flex;align-items:center;gap:15px}
.bank-icon{width:44px;height:44px;border-radius:10px;background:#0a0a0a;display:flex;align-items:center;justify-content:center}
.bank-name{font-size:14px;font-weight:600}
.bank-iban{font-family:'JetBrains Mono',monospace;font-size:12.5px;color:#666;margin-top:3px}
.bank-verified{font-size:11.5px;font-weight:600;color:#fff;background:#0a0a0a;padding:4px 11px;border-radius:20px}
.bank-edit{margin-top:16px;display:flex;justify-content:flex-end}
.acc-sub{font-size:12.5px;color:#8a8a86;margin-bottom:20px}
.api-key-row{border:1px solid #e7e7e4;border-radius:12px;padding:15px 18px;display:flex;align-items:center;justify-content:space-between}
.api-key-name{font-size:13px;font-weight:600;margin-bottom:4px}
.api-key-value{font-family:'JetBrains Mono',monospace;font-size:12.5px;color:#666;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.copy-btn{flex:none;margin-left:14px;height:34px;padding:0 13px;border-radius:9px;border:1px solid #e7e7e4;background:#fff;font-size:12.5px;font-weight:600}
.users-head{display:flex;justify-content:space-between;align-items:center;padding:20px 22px 16px}
.invite-btn{height:36px;padding:0 14px;border-radius:9px;border:0;background:#0a0a0a;color:#fff;font-size:12.5px;font-weight:600}
.user-row{display:flex;align-items:center;justify-content:space-between;padding:14px 22px;border-top:1px solid #f2f2ef}
.user-left{display:flex;align-items:center;gap:12px}
.user-avatar{width:36px;height:36px;border-radius:50%;background:#0a0a0a;color:#fff;display:flex;align-items:center;justify-content:center;font-size:12.5px;font-weight:600}
.user-name2{font-size:13.5px;font-weight:600}
.user-email2{font-size:11.5px;color:#a0a09c}
.user-role{font-size:12px;font-weight:500;color:#555;border:1px solid #e7e7e4;padding:4px 11px;border-radius:20px}

/* Intégrations */
.int-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:16px}
.int-card{padding:20px}
.int-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.int-logo{width:40px;height:40px;border-radius:10px;background:#f4f4f2;border:1px solid #eeeeeb;display:flex;align-items:center;justify-content:center}
.int-logo svg{width:22px;height:22px}
.int-status{font-size:11px;font-weight:600;color:#8a8a86;border:1px solid #e7e7e4;padding:3px 10px;border-radius:20px;display:inline-flex;align-items:center;gap:5px}
.int-status.ok{color:#fff;background:#0a0a0a;border-color:#0a0a0a}
.int-name{font-size:15.5px;font-weight:700;margin-bottom:6px}
.int-desc{font-size:12.5px;color:#8a8a86;line-height:1.45;margin-bottom:18px;min-height:36px}
.int-btn{width:100%;justify-content:center}
.int-code{margin-top:2px;padding:24px;display:flex;gap:20px;align-items:flex-start}
.int-code-icon{width:44px;height:44px;border-radius:10px;background:#0a0a0a;display:flex;align-items:center;justify-content:center;flex:none}
.int-code-title{font-size:15.5px;font-weight:700;margin-bottom:6px}
.int-code-desc{font-size:12.5px;color:#8a8a86;line-height:1.5;margin-bottom:14px}
.int-snippet{background:#0a0a0a;border-radius:12px;padding:16px 18px;overflow-x:auto}
.int-snippet pre{margin:0}
.int-snippet code{font-family:'JetBrains Mono',monospace;font-size:12px;color:#e6e6e2;line-height:1.6;white-space:pre}

/* Local AI panel */
.local-ai-panel{width:400px;flex:none;background:#fff;border-left:1px solid #e7e7e4;display:flex;flex-direction:column;height:100vh}
.local-ai-head{flex:none;height:64px;border-bottom:1px solid #e7e7e4;display:flex;align-items:center;justify-content:space-between;padding:0 20px}
.local-ai-head-left{display:flex;align-items:center;gap:10px}
.local-ai-head-icon{width:28px;height:28px;border-radius:8px;background:#0a0a0a;display:flex;align-items:center;justify-content:center}
.local-ai-head-title{font-size:14px;font-weight:600}
.local-ai-head-sub{font-size:10.5px;color:#a0a09c}
.close-btn{width:32px;height:32px;border-radius:8px;border:1px solid #e7e7e4;background:#fff;display:flex;align-items:center;justify-content:center}
.chat-scroll{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column}
.chat-row{display:flex;flex-direction:column;margin-bottom:14px}
.chat-row.user{align-items:flex-end}
.chat-row.bot{align-items:flex-start}
.bubble{max-width:86%;padding:12px 15px;border-radius:14px;font-size:13.5px;line-height:1.5;white-space:pre-line}
.bubble.user{background:#0a0a0a;color:#fff}
.bubble.bot{background:#f4f4f2;color:#111}
.chat-action{margin-top:9px;height:36px;padding:0 15px;border-radius:9px;border:0;background:#0a0a0a;color:#fff;font-size:12.5px;font-weight:600;align-self:flex-start}
.typing{display:flex;gap:4px;padding:12px 15px;background:#f4f4f2;border-radius:14px;width:fit-content}
.typing span{width:7px;height:7px;border-radius:50%;background:#b0b0ac;animation:opBlink 1s infinite}
.typing span:nth-child(2){animation-delay:.2s}
.typing span:nth-child(3){animation-delay:.4s}
.local-ai-footer{flex:none;padding:14px 16px;border-top:1px solid #e7e7e4}
.suggestions{display:flex;flex-direction:column;gap:7px;margin-top:auto;padding-top:14px}
.suggestion-btn{text-align:left;padding:10px 14px;border-radius:12px;border:1px solid #e7e7e4;background:#fff;font-size:12.5px;font-weight:500;color:#333;white-space:normal;line-height:1.4}
.suggestion-btn:hover{border-color:#0a0a0a;background:#fafaf8}
.composer{display:flex;align-items:flex-end;gap:9px;border:1px solid #e7e7e4;border-radius:12px;padding:8px 8px 8px 14px}
.composer textarea{flex:1;border:0;resize:none;font-size:13.5px;line-height:1.4;max-height:100px;background:transparent}
.send-btn{flex:none;width:36px;height:36px;border-radius:9px;border:0;background:#0a0a0a;display:flex;align-items:center;justify-content:center}

/* Modal */
.modal-overlay{position:fixed;inset:0;background:rgba(10,10,10,.45);display:flex;align-items:center;justify-content:center;z-index:50;animation:opFade .15s}
.modal-box{width:440px;max-width:92vw;background:#fff;border-radius:16px;padding:26px;box-shadow:0 30px 60px rgba(0,0,0,.25)}
.modal-title{font-size:18px;font-weight:700;letter-spacing:-.4px;margin-bottom:4px}
.modal-sub{font-size:12.5px;color:#8a8a86;margin-bottom:20px}
.modal-field{width:100%;height:44px;padding:0 14px;border:1px solid #e7e7e4;border-radius:10px;font-size:14px;margin-bottom:14px}
.modal-actions{display:flex;gap:10px;justify-content:flex-end}
.btn-cancel{height:42px;padding:0 18px;border-radius:10px;border:1px solid #e7e7e4;background:#fff;font-size:13.5px;font-weight:600}
.btn-submit{height:42px;padding:0 18px;border-radius:10px;border:0;background:#0a0a0a;color:#fff;font-size:13.5px;font-weight:600}

/* Toast */
.toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);background:#0a0a0a;color:#fff;padding:13px 20px;border-radius:12px;font-size:13.5px;font-weight:500;z-index:60;display:flex;align-items:center;gap:10px;box-shadow:0 12px 30px rgba(0,0,0,.3);animation:opToast .2s}
