*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,Segoe UI,Arial,sans-serif;background:#0d1724;color:#f5f7fb}.hidden{display:none!important}
:root{--bg:#0d1724;--side:#0a1420;--panel:#111d2b;--panel2:#162333;--line:#2b3949;--muted:#9aa7b6;--gold:#ffbf00;--green:#50c56d;--red:#ff4f4f;--blue:#2c6dd2;--purple:#6550c7}
.login-screen{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at 50% 20%,#1a2a3d,#07101a 62%)}.login-card{width:380px;background:#101c29;border:1px solid #2b3949;border-radius:18px;padding:32px;box-shadow:0 25px 70px #0008;text-align:center}.login-card h1{margin:16px 0 0}.login-card .gold{font-weight:800;color:var(--gold);margin-bottom:24px}.login-card small{display:block;margin-top:14px;color:var(--muted)}.login-card label{text-align:left}
.gb-logo{width:66px;height:66px;border:3px solid var(--gold);border-radius:50%;display:grid;place-items:center;color:var(--gold);font-size:24px;font-weight:900;margin:auto}.gb-logo.small{width:50px;height:50px;font-size:18px;margin:0}
.app{display:flex;min-height:100vh}.sidebar{width:242px;background:linear-gradient(180deg,#0c1724,#09131d);border-right:1px solid #273545;display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0;z-index:5}.brand{height:78px;padding:12px 18px;display:flex;align-items:center;gap:12px;border-bottom:1px solid #283547}.brand-title{font-size:19px;font-weight:900}.brand-sub{color:var(--gold);font-size:12px;font-weight:800;text-align:center}.sidebar nav{padding:12px 11px;overflow:auto}.nav{width:100%;border:0;background:transparent;color:#f0f4f9;text-align:left;padding:12px 13px;border-radius:8px;margin:2px 0;cursor:pointer;font-size:14px}.nav span{display:inline-block;width:26px;color:#e3eaf3}.nav:hover{background:#172637}.nav.active{background:linear-gradient(90deg,#4a402a,#2c2b27);color:var(--gold);border-left:3px solid var(--gold)}.sidebar-bottom{margin-top:auto;padding:10px 12px;background:#0a1420}.cash-open-box,.user-card,.datetime-box{border:1px solid #2d3d4e;border-radius:8px;padding:11px 12px;margin-bottom:8px}.cash-open-box b{display:block;margin-top:6px}.user-card{display:flex;gap:10px;align-items:center}.user-card small{display:block;color:#31c86a;margin-top:3px}.avatar{font-size:20px}.datetime-box{display:flex;justify-content:space-between;font-size:12px}.logout{border:0;background:transparent;color:#9fb0c2;cursor:pointer;width:100%;padding:7px}
.main{margin-left:242px;width:calc(100% - 242px);min-height:100vh;background:linear-gradient(180deg,#0e1926,#0c1622);padding-bottom:50px}.topbar{height:78px;border-bottom:1px solid #283747;display:flex;align-items:center;justify-content:space-between;padding:0 24px;background:#0e1825;position:sticky;top:0;z-index:4}.top-left,.top-actions{display:flex;align-items:center;gap:12px}.topbar h1{font-size:20px;margin:0}.top-user{padding-left:8px;border-left:1px solid #2d3a49}.top-user small{display:block;color:#aab5c1;font-size:10px}
.view{display:none;padding:18px 20px}.view.active{display:block}.btn,.icon-btn{border:1px solid transparent;border-radius:7px;padding:10px 14px;font-weight:700;cursor:pointer}.icon-btn{background:transparent;color:#e8eef6;border-color:#29394b;padding:9px 11px}.goldbtn{background:var(--gold);color:#151515}.bluebtn{background:#1647ad;color:white}.darkbtn{background:#111d2a;color:white;border-color:#314152}.full{width:100%}.big{padding:14px;font-size:16px}.smallbtn{padding:7px 10px;font-size:12px}.row-actions{display:flex;gap:8px;align-items:center}
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:14px}.kpi{background:linear-gradient(180deg,#131f2d,#111b28);border:1px solid #2b3a4c;border-radius:9px;padding:16px;display:flex;align-items:center;gap:14px;min-height:101px}.kpi-icon{width:56px;height:56px;border-radius:9px;display:grid;place-items:center;font-size:26px}.kpi-icon.green{background:#143c30}.kpi-icon.blue{background:#173968}.kpi-icon.purple{background:#2c285f}.kpi-icon.amber{background:#503b1d}.kpi span{font-size:14px}.kpi b{display:block;font-size:22px;margin:7px 0}.kpi small{color:var(--muted)}
.dashboard-grid{display:grid;grid-template-columns:1.25fr 1fr;gap:14px}.right-stack{display:grid;gap:14px}.panel{background:linear-gradient(180deg,#121f2d,#101a27);border:1px solid #2b3948;border-radius:8px;overflow:hidden}.panel>h2,.panel>p,.panel>label,.panel>input,.panel>select,.panel>textarea,.panel>.segmented,.panel>.two-col,.panel>.big-total,.panel>#txAlerts,.panel>.check,.panel>.warning,.panel>.inline,.panel>.full,.panel>#manualRates,.panel>#reconcileBody{margin-left:16px;margin-right:16px}.panel h2{font-size:16px}.panel-head{height:48px;display:flex;align-items:center;justify-content:space-between;padding:0 13px;border-bottom:1px solid #283849}.panel-head h2{margin:0}.panel-head p{margin:2px 0 0}
table{width:100%;border-collapse:collapse}th,td{padding:9px 11px;border-bottom:1px solid #2b3947;text-align:left;font-size:12px;white-space:nowrap}th{color:#e7edf3;font-weight:600}td{color:#f7f8fa}.green-text{color:var(--green)!important}.red-text{color:var(--red)!important}.flag{font-size:19px;margin-right:8px}.table-wrap{overflow:auto}.currency-table td,.currency-table th{padding:8px 11px}.rate-input{width:100px!important;padding:6px 7px!important}.follow-btn{background:var(--gold);border:0;border-radius:5px;padding:6px 9px;font-size:11px;font-weight:700}.graph-btn{background:#2a323d;color:white;border:1px solid #3e4856;border-radius:5px;padding:6px 9px;font-size:11px;margin-left:5px}.table-footer{display:flex;justify-content:space-between;padding:12px;color:#bcc7d3;font-size:12px}
.chart-row{display:flex;align-items:center;gap:28px;padding:18px}.donut{width:168px;height:168px;border-radius:50%;background:conic-gradient(#2d6fd3 0 52%,#55a94f 52% 74%,#f1b51b 74% 85%,#6646a6 85% 100%);position:relative}.donut:after{content:"";position:absolute;inset:34px;background:#111d2a;border-radius:50%}.donut-center{position:absolute;z-index:1;inset:0;display:grid;place-content:center;text-align:center}.donut-center b{font-size:22px}.donut-center span{font-size:12px;color:#b8c4d0}.legend{flex:1}.legend-item{display:flex;justify-content:space-between;gap:14px;padding:6px 0;font-size:12px}.legend-dot{width:10px;height:10px;border-radius:2px;display:inline-block;margin-right:7px}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:14px}.two-col.compact{gap:9px}.two-col>.panel{padding-bottom:18px}label{display:block;font-size:12px;font-weight:700;margin-top:12px;margin-bottom:5px;color:#c8d1dc}input,select,textarea{width:100%;background:#0b1520;border:1px solid #334457;color:white;border-radius:7px;padding:10px 11px;font:inherit}.inline{display:flex;gap:7px}.segmented{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:15px}.segmented button{padding:11px;background:#0b1520;border:1px solid #34465a;color:white;border-radius:7px;font-weight:800}.segmented button.selected{background:var(--gold);color:#171717}.big-total{background:#0a1520;border:1px solid #324458;border-radius:9px;padding:16px;margin-top:15px;display:flex;justify-content:space-between;align-items:center}.big-total b{font-size:24px;color:var(--gold)}.check{display:flex;gap:8px;align-items:center;background:#0b1520;border:1px solid #334457;border-radius:7px;padding:10px;margin-top:12px}.check input{width:auto}.badge{padding:6px 9px;background:#422;color:#f99;border-radius:14px;font-size:11px}.badge.good{background:#163b2b;color:#67dc8a}.alert{margin:10px 16px 0;padding:10px;border-radius:7px;font-size:12px}.alert.warn{background:#4a3b16;color:#ffd773}.alert.danger{background:#4a1e24;color:#ff9c9c}.search{width:220px}.muted{color:var(--muted);font-size:12px}.warning{background:#4a3b16;color:#ffd773;border-radius:7px;padding:12px;margin-top:14px}
.reconcile-row{display:grid;grid-template-columns:1fr 140px 120px;gap:8px;align-items:center;padding:8px 0;border-bottom:1px solid #283746}.good-diff{color:var(--green)}.bad-diff{color:var(--red)}
.modal{position:fixed;inset:0;background:#000a;display:grid;place-items:center;z-index:99;padding:20px}.modal-card{background:#111c29;border:1px solid #34465a;border-radius:12px;max-width:520px;width:100%;padding:18px}.receipt{width:80mm;max-width:100%;margin:auto;background:white;color:#111;padding:7mm;font-family:ui-monospace,monospace;font-size:12px}.receipt h3{text-align:center}.receipt hr{border:0;border-top:1px dashed #777}.receipt-row{display:flex;justify-content:space-between;gap:10px;margin:4px 0}footer{position:absolute;left:242px;right:0;bottom:0;height:38px;border-top:1px solid #263545;background:#0b1520;display:flex;justify-content:space-between;align-items:center;padding:0 20px;color:#9ca9b7;font-size:11px}
@media(max-width:1200px){.dashboard-grid{grid-template-columns:1fr}.kpis{grid-template-columns:1fr 1fr}}@media(max-width:800px){.sidebar{transform:translateX(-100%)}.sidebar.open{transform:translateX(0)}.main{margin-left:0;width:100%}.kpis,.two-col{grid-template-columns:1fr}.top-user{display:none}footer{left:0}}@media print{body *{visibility:hidden}.receipt,.receipt *{visibility:visible}.receipt{position:absolute;left:0;top:0}}
.gold-text{color:var(--gold)!important}
.ticket-actions{display:flex;align-items:center;gap:10px;margin:10px 16px 0}
.basket-panel{margin-bottom:14px}
.empty-basket{padding:24px;text-align:center;color:var(--muted)}
.basket-summary{padding:12px 16px;display:grid;grid-template-columns:1fr 1fr;gap:10px;border-top:1px solid #2b3947}
.basket-summary div{background:#0b1520;border:1px solid #314153;border-radius:7px;padding:10px}
.basket-summary span{display:block;color:var(--muted);font-size:11px}.basket-summary b{display:block;margin-top:4px}
.remove-line{border:0;background:#4a1e24;color:#ff9b9b;border-radius:5px;padding:5px 8px;cursor:pointer}
body.light-theme{--bg:#f4f7fb;--side:#ffffff;--panel:#ffffff;--panel2:#f8fafc;--line:#d9e1ea;--muted:#6b7785;--gold:#e7ad00;--green:#1d9a4c;--red:#d83b3b;--blue:#2d62c8;--purple:#6a55bd;background:#eef2f6;color:#18212b}
body.light-theme .sidebar{background:linear-gradient(180deg,#ffffff,#f5f7fa);color:#1a2430;border-color:#d8e0e8}
body.light-theme .brand{border-color:#dce3eb}.light-theme .brand-title{color:#111b26}.light-theme .nav{color:#253140}.light-theme .nav span{color:#657385}.light-theme .nav:hover{background:#edf2f7}.light-theme .nav.active{background:#fff4c6;color:#8a6500;border-left-color:#e2aa00}
body.light-theme .sidebar-bottom{background:#f5f7fa}.light-theme .cash-open-box,.light-theme .user-card,.light-theme .datetime-box{border-color:#d5dde6;background:white}
body.light-theme .main{background:#f2f5f8}.light-theme .topbar{background:#ffffff;border-color:#d7dfe8}.light-theme .topbar h1,.light-theme .top-user b{color:#17212b}.light-theme .icon-btn{color:#233244;border-color:#cfd8e2;background:#fff}
body.light-theme .panel,.light-theme .kpi{background:#ffffff;border-color:#d8e0e8;box-shadow:0 2px 10px #1d2f420d}.light-theme .panel h2,.light-theme .kpi,.light-theme td,.light-theme th{color:#1d2732}
body.light-theme th,body.light-theme td{border-bottom-color:#e7ecf1}.light-theme input,.light-theme select,.light-theme textarea{background:#ffffff;color:#18212b;border-color:#cfd8e2}
body.light-theme .darkbtn{background:#f3f6f9;color:#1d2b3a;border-color:#cfd8e2}.light-theme .big-total,.light-theme .check,.light-theme .basket-summary div{background:#f6f8fa;border-color:#d9e1ea}
body.light-theme .segmented button{background:#f5f7fa;color:#263240;border-color:#d5dde6}.light-theme .segmented button.selected{background:var(--gold);color:#111}
body.light-theme .modal-card{background:#fff;border-color:#d7dfe8}.light-theme footer{background:#fff;border-color:#d8e0e8;color:#687687}
body.light-theme .table-footer,.light-theme .muted{color:#6c7886}
body.light-theme .graph-btn{background:#eef2f6;color:#253140;border-color:#d5dde6}
body.light-theme .table-wrap{background:#fff}
@media(max-width:900px){.exchange-layout{grid-template-columns:1fr}}

/* ============================
   V4 — Convertisseur style XE
   ============================ */
.converter-panel{overflow:visible!important}
.converter-panel .panel-head{height:auto;min-height:58px;padding:12px 16px}
.converter-panel .panel-head h2{margin:0 0 3px}
.converter-panel .panel-head p{margin:0}
.converter-mode{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px}
.converter-mode button{height:42px;border-radius:22px;border:1px solid #35475a;background:#0b1520;color:#d6dee8;font-weight:900;letter-spacing:.4px;cursor:pointer}
.converter-mode button.selected{background:#31496b;color:#fff;border-color:#49678e}
.xe-converter{position:relative;display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:12px 16px 10px}
.xe-box{position:relative;border:1px solid #3a4b5d;border-radius:13px;padding:14px 15px 11px;background:#0c1723;min-width:0;transition:.15s ease}
.xe-box:focus-within{border-color:#d6a800;box-shadow:0 0 0 2px rgba(255,191,0,.12)}
.xe-label{position:absolute;top:-10px;left:18px;background:#111d2b;padding:0 7px;color:#aab7c6;font-size:12px;font-weight:700}
.xe-main-row{display:flex;align-items:center;gap:10px;min-width:0}
.xe-amount{flex:1;min-width:0!important;border:0!important;background:transparent!important;padding:14px 0!important;font-size:30px!important;font-weight:800!important;outline:0!important;box-shadow:none!important}
.xe-amount::-webkit-inner-spin-button,.xe-amount::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.xe-currency{display:flex;align-items:center;gap:7px;min-width:180px;justify-content:flex-end}
.xe-flag{font-size:25px}
.xe-select{width:auto!important;max-width:175px;border:0!important;background:transparent!important;font-size:16px!important;font-weight:800;padding:8px 3px!important;outline:0}
.xe-currency-name{font-size:11px;color:var(--muted);padding-top:4px;text-align:right}
.swap-btn{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:3;width:48px;height:48px;border-radius:50%;border:1px solid #405166;background:#142231;color:#eef4fb;font-size:23px;cursor:pointer;box-shadow:0 4px 18px #0005}
.swap-btn:hover{border-color:var(--gold);color:var(--gold)}
.converter-info{display:flex;justify-content:space-between;align-items:center;margin:15px 16px 8px;padding:12px 14px;border-radius:9px;background:#0a1520;border:1px solid #304153}
.converter-info span{display:block;color:var(--muted);font-size:11px;margin-bottom:3px}.converter-info b{font-size:14px}
.rate-fee-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 16px}
.xe-rate-note{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:12px 16px;padding:13px 14px;border-radius:9px;background:rgba(255,191,0,.08);border:1px solid rgba(255,191,0,.28)}
.xe-rate-note span{font-size:12px;color:#c7d0dc}.xe-rate-note b{font-size:20px;color:var(--gold);white-space:nowrap}
.light-theme .converter-mode button{background:#f4f7fa;color:#344253;border-color:#d4dde6}.light-theme .converter-mode button.selected{background:#344c70;color:white}
.light-theme .xe-box{background:#fff;border-color:#d1dae3}.light-theme .xe-label{background:#fff;color:#566678}.light-theme .xe-amount{color:#17212b!important}.light-theme .xe-select{color:#17212b!important}
.light-theme .swap-btn{background:#fff;color:#314766;border-color:#d3dce5;box-shadow:0 4px 16px #20304018}
.light-theme .converter-info{background:#f6f8fa;border-color:#d7e0e9}.light-theme .xe-rate-note{background:#fff8dd;border-color:#ecd980}.light-theme .xe-rate-note span{color:#536170}
@media(max-width:1050px){.xe-converter{grid-template-columns:1fr;gap:22px}.swap-btn{top:50%;transform:translate(-50%,-50%) rotate(90deg)}.xe-currency{min-width:150px}}
@media(max-width:600px){.xe-main-row{flex-direction:column;align-items:stretch}.xe-currency{min-width:0;justify-content:flex-start}.xe-currency-name{text-align:left}.xe-amount{font-size:26px!important}.rate-fee-row{grid-template-columns:1fr}}


/* V4.2 — Correction contraste des menus de devises */
body:not(.light-theme) select,
body:not(.light-theme) .xe-select {
  background-color: #0b1520 !important;
  color: #ffffff !important;
  border-color: #3a4b5d !important;
}

body:not(.light-theme) select option,
body:not(.light-theme) .xe-select option {
  background-color: #101b28 !important;
  color: #ffffff !important;
}

body:not(.light-theme) select:focus,
body:not(.light-theme) .xe-select:focus {
  border-color: #ffbf00 !important;
  outline: none !important;
}

body.light-theme select,
body.light-theme .xe-select {
  background-color: #ffffff !important;
  color: #17212b !important;
}

body.light-theme select option,
body.light-theme .xe-select option {
  background-color: #ffffff !important;
  color: #17212b !important;
}

/* Améliore aussi la lisibilité du code devise dans le convertisseur */
body:not(.light-theme) .xe-currency,
body:not(.light-theme) .xe-currency-name {
  color: #ffffff;
}

body:not(.light-theme) .xe-currency-name {
  color: #aab7c6;
}

/* V4.3 — Gestion employés par administrateur */
.user-actions{display:flex;gap:6px;align-items:center}
.delete-user-btn{background:#4a1e24;color:#ff9a9a;border:1px solid #6a2a33;border-radius:5px;padding:6px 9px;font-size:11px;cursor:pointer}
.delete-user-btn:hover{background:#632630}
.delete-user-btn:disabled{opacity:.35;cursor:not-allowed}
.user-active{display:inline-block;padding:4px 8px;border-radius:12px;background:#153b2a;color:#62d986;font-size:11px;font-weight:700}
.user-inactive{display:inline-block;padding:4px 8px;border-radius:12px;background:#45252a;color:#ef9292;font-size:11px;font-weight:700}
.current-user-tag{display:inline-block;margin-left:5px;padding:2px 6px;border-radius:10px;background:rgba(255,191,0,.15);color:var(--gold);font-size:10px}
.light-theme .delete-user-btn{background:#fdebec;color:#b12d36;border-color:#f0c7ca}
.light-theme .user-active{background:#e6f6ec;color:#187943}
.light-theme .user-inactive{background:#fbeaec;color:#a6313a}

/* ==========================================
   V4.4 — Sélecteur de devises style XE
   ========================================== */
.native-hidden-select{
  position:absolute!important;
  opacity:0!important;
  width:1px!important;
  height:1px!important;
  pointer-events:none!important;
}
.currency-picker-wrap{
  position:relative;
  min-width:230px;
}
.currency-picker-btn{
  width:100%;
  min-width:230px;
  border:0;
  background:transparent;
  color:#fff;
  display:flex;
  align-items:center;
  gap:9px;
  cursor:pointer;
  padding:8px 4px;
  text-align:left;
}
.picker-text{
  display:flex;
  align-items:baseline;
  gap:6px;
  min-width:0;
  flex:1;
}
.picker-text b{
  font-size:17px;
  white-space:nowrap;
}
.picker-text span{
  color:#9aa8b8;
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:150px;
}
.picker-caret{
  margin-left:auto;
  color:#aeb9c5;
  font-size:18px;
  transition:transform .15s ease;
}
.currency-picker-btn.open .picker-caret{transform:rotate(180deg)}
.currency-picker-menu{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  width:380px;
  max-height:470px;
  background:#0e1925;
  border:1px solid #34465a;
  border-radius:11px;
  box-shadow:0 18px 45px rgba(0,0,0,.45);
  overflow:hidden;
  z-index:100;
}
.picker-search-row{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-bottom:1px solid #2f4052;
  background:#101c29;
}
.picker-search-row span{
  font-size:22px;
  color:#a7b3c1;
}
.picker-search-row input{
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  outline:0!important;
  font-size:15px!important;
  padding:8px 2px!important;
}
.currency-picker-list{
  max-height:400px;
  overflow:auto;
  padding:7px 0;
}
.picker-section-title{
  padding:9px 14px 6px;
  font-size:11px;
  font-weight:800;
  color:#8794a5;
  text-transform:uppercase;
  letter-spacing:.4px;
}
.currency-option{
  width:100%;
  border:0;
  background:transparent;
  color:#eef3f8;
  display:grid;
  grid-template-columns:34px 58px 1fr 24px;
  align-items:center;
  gap:4px;
  padding:9px 13px;
  cursor:pointer;
  text-align:left;
}
.currency-option:hover{
  background:#182738;
}
.currency-option.selected{
  background:#1b3150;
}
.currency-option .opt-flag{
  font-size:22px;
}
.currency-option .opt-code{
  font-weight:800;
  font-size:14px;
}
.currency-option .opt-name{
  font-size:14px;
  color:#c5cfda;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.currency-option .opt-check{
  color:#49a2ff;
  font-size:17px;
  text-align:right;
}
.currency-option.empty{
  display:block;
  color:#8997a6;
  padding:22px 14px;
  text-align:center;
}
.currency-picker-list::-webkit-scrollbar{width:9px}
.currency-picker-list::-webkit-scrollbar-thumb{background:#65717d;border-radius:8px}
.currency-picker-list::-webkit-scrollbar-track{background:#17222d}

body.light-theme .currency-picker-btn{
  color:#1c2835;
}
body.light-theme .picker-text span{
  color:#647386;
}
body.light-theme .currency-picker-menu{
  background:#fff;
  border-color:#d4dde7;
  box-shadow:0 18px 40px rgba(23,37,51,.18);
}
body.light-theme .picker-search-row{
  background:#fff;
  border-color:#dce3ea;
}
body.light-theme .picker-search-row input{
  color:#1b2836!important;
}
body.light-theme .picker-section-title{
  color:#9aa6b6;
}
body.light-theme .currency-option{
  color:#1f2b39;
}
body.light-theme .currency-option:hover{
  background:#f2f6fa;
}
body.light-theme .currency-option.selected{
  background:#eaf2ff;
}
body.light-theme .currency-option .opt-name{
  color:#344456;
}
body.light-theme .currency-picker-list::-webkit-scrollbar-track{background:#eef2f5}
@media(max-width:700px){
  .currency-picker-wrap{min-width:180px}
  .currency-picker-btn{min-width:180px}
  .currency-picker-menu{width:min(360px,90vw);right:auto;left:0}
}

/* V4.5 — drapeaux locaux : fonctionne même si Windows affiche US/GB/EU à la place des emojis */
.flag-img{width:24px;height:17px;object-fit:cover;border-radius:2px;vertical-align:middle;margin-right:8px;box-shadow:0 0 0 1px rgba(255,255,255,.14)}
.picker-flag-img{width:29px;height:21px;object-fit:cover;border-radius:3px;display:block;box-shadow:0 0 0 1px rgba(255,255,255,.14)}
.converter-flag-img{width:32px;height:23px;object-fit:cover;border-radius:3px;display:block;box-shadow:0 0 0 1px rgba(255,255,255,.16)}
.light-theme .flag-img,.light-theme .picker-flag-img,.light-theme .converter-flag-img{box-shadow:0 0 0 1px rgba(0,0,0,.15)}

/* V5 — conformité transaction */
.compliance-subbox{margin:10px 0;padding:10px;border:1px solid #314153;border-radius:8px;background:#0b1520}
.compliance-gate{display:flex;flex-direction:column;gap:4px;margin:12px 0;padding:12px;border-radius:8px;border:1px solid #34465a;background:#0b1520}
.compliance-gate span{font-size:12px;color:var(--muted)}
.good-gate{border-color:#24653d;background:#10291c}.warn-gate{border-color:#8b6b16;background:#2b2410}.danger-gate{border-color:#9c3434;background:#351719}
.suspicious-check{border-color:#7c3035!important}
.light-theme .compliance-subbox,.light-theme .compliance-gate{background:#f7f9fb;border-color:#d7e0e9}
.light-theme .good-gate{background:#eaf7ef;border-color:#9bcbae}.light-theme .warn-gate{background:#fff7db;border-color:#e2c86d}.light-theme .danger-gate{background:#fdebec;border-color:#e7a1a5}


/* V5.1 — Footer corrigé : toujours après le contenu, jamais au milieu */
footer,
.app-footer {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  width: auto !important;
  flex-shrink: 0;
  z-index: auto !important;
  margin-top: 22px !important;
}

.main,
.main-content {
  min-height: 100vh;
}

.content,
.content-area,
.views {
  overflow: visible;
}

/* Si le footer est un enfant direct de .main, pousse-le après les vues. */
.main {
  display: flex;
  flex-direction: column;
}
.main > footer,
.main > .app-footer {
  margin-top: auto !important;
}

/* Évite qu'un ancien padding réservé à un footer fixe crée un grand espace. */
body,
.main,
.content,
.content-area {
  padding-bottom: 0;
}

/* =========================================================
   V5.4 — Nouvelle transaction responsive au zoom navigateur
   ========================================================= */

/* Les deux blocs doivent pouvoir rétrécir sans pousser le contenu dehors */
.xe-converter{
  min-width:0 !important;
}
.xe-box{
  min-width:0 !important;
  overflow:hidden !important;
}
.xe-main-row{
  min-width:0 !important;
  width:100% !important;
}

/* Le montant garde toujours la priorité d'affichage */
.xe-amount{
  min-width:70px !important;
  width:100% !important;
  flex:1 1 110px !important;
  font-size:clamp(18px,2.1vw,30px) !important;
  line-height:1.15 !important;
}

/* Le sélecteur de devise peut rétrécir */
.currency-picker-wrap{
  min-width:0 !important;
  width:min(245px,48%) !important;
  flex:0 1 245px !important;
}
.currency-picker-btn{
  min-width:0 !important;
  width:100% !important;
  padding:7px 2px !important;
}
.picker-text{
  min-width:0 !important;
  overflow:hidden !important;
}
.picker-text b{
  font-size:clamp(13px,1.35vw,17px) !important;
  flex:0 0 auto;
}
.picker-text span{
  font-size:clamp(11px,1.15vw,14px) !important;
  max-width:100% !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}
.xe-flag,
.converter-flag-img{
  flex:0 0 auto !important;
}
.converter-flag-img{
  width:clamp(22px,2.3vw,32px) !important;
  height:auto !important;
}

/* Texte sous les cases */
.xe-currency-name{
  font-size:clamp(10px,1vw,12px) !important;
  overflow:hidden !important;
  white-space:nowrap !important;
  text-overflow:ellipsis !important;
}

/* Le bouton switch ne doit pas manger l'espace des champs */
.swap-btn{
  width:clamp(40px,4vw,48px) !important;
  height:clamp(40px,4vw,48px) !important;
  font-size:clamp(18px,2vw,23px) !important;
}

/* À partir d'une largeur effective plus petite (souvent quand on zoome),
   les deux monnaies passent verticalement pour rester utilisables. */
@media (max-width:1250px){
  .exchange-layout{
    grid-template-columns:minmax(0,1.15fr) minmax(330px,.85fr) !important;
  }
  .xe-converter{
    grid-template-columns:1fr !important;
    gap:22px !important;
  }
  .swap-btn{
    top:50% !important;
    transform:translate(-50%,-50%) rotate(90deg) !important;
  }
  .currency-picker-wrap{
    width:min(260px,45%) !important;
  }
}

/* Zoom élevé / fenêtre moyenne : réduire davantage */
@media (max-width:1000px){
  .exchange-layout{
    grid-template-columns:1fr !important;
  }
  .converter-panel{
    min-width:0 !important;
  }
  .xe-amount{
    font-size:clamp(17px,3vw,25px) !important;
  }
  .picker-text span{
    max-width:125px !important;
  }
}

/* Très petit espace : mettre montant puis devise sur 2 lignes */
@media (max-width:650px){
  .xe-main-row{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:6px !important;
  }
  .currency-picker-wrap{
    width:100% !important;
    max-width:none !important;
  }
  .currency-picker-btn{
    justify-content:flex-start !important;
  }
  .picker-text span{
    max-width:none !important;
  }
  .xe-currency-name{
    text-align:left !important;
  }
}

/* Évite que les gros libellés ACHAT/VENTE débordent au zoom */
.converter-mode button,
.segmented button{
  font-size:clamp(13px,1.5vw,18px) !important;
  white-space:nowrap !important;
}

/* V5.5 — titres "Le client donne / reçoit" toujours visibles */
.xe-box{
  overflow:visible !important;
  padding-top:18px !important;
}

.xe-label{
  position:static !important;
  display:block !important;
  width:max-content;
  max-width:100%;
  margin:0 0 8px 0 !important;
  padding:0 !important;
  background:transparent !important;
  color:#c8d3df !important;
  font-size:clamp(12px,1.25vw,15px) !important;
  line-height:1.2 !important;
  font-weight:800 !important;
  white-space:nowrap !important;
  overflow:visible !important;
}

.light-theme .xe-label{
  color:#405064 !important;
}

@media(max-width:650px){
  .xe-box{
    padding-top:14px !important;
  }
  .xe-label{
    font-size:13px !important;
    margin-bottom:6px !important;
  }
}

/* V5.6 — titres intégrés dans la bordure comme la référence */
.xe-box{
  position:relative !important;
  overflow:visible !important;
  padding-top:22px !important;
  margin-top:10px !important;
}

.xe-label{
  position:absolute !important;
  top:-11px !important;
  left:28px !important;
  z-index:4 !important;
  display:block !important;
  width:auto !important;
  max-width:calc(100% - 56px) !important;
  margin:0 !important;
  padding:0 10px !important;
  background:#111d2b !important;
  color:#d7e0eb !important;
  font-size:clamp(12px,1.15vw,15px) !important;
  line-height:22px !important;
  font-weight:800 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

body.light-theme .xe-label{
  background:#ffffff !important;
  color:#405064 !important;
}

@media(max-width:1250px){
  .xe-box{margin-top:12px !important}
  .xe-label{
    top:-10px !important;
    left:22px !important;
    padding:0 8px !important;
    font-size:13px !important;
    line-height:20px !important;
  }
}

@media(max-width:650px){
  .xe-label{
    left:18px !important;
    max-width:calc(100% - 36px) !important;
    font-size:12px !important;
  }
}

/* V5.7 — Mode de paiement visible sur Nouvelle transaction */
.payment-method-block{grid-column:1/-1;margin-top:4px}
.payment-methods{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:6px}
.payment-method{
  min-width:0;min-height:54px;padding:8px 7px;border:1px solid #34485d;border-radius:9px;
  background:#0b1622;color:#cbd6e2;cursor:pointer;font-weight:750;font-size:13px;
  display:flex;align-items:center;justify-content:center;gap:6px;transition:.15s ease
}
.payment-method:hover{border-color:#71839a}
.payment-method.selected{background:#314d72;border-color:#6686ae;color:#fff;box-shadow:0 0 0 1px rgba(255,191,0,.12)}
.payment-method span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.light-theme .payment-method{background:#fff;color:#334255;border-color:#d3dce6}
.light-theme .payment-method.selected{background:#344f74;color:#fff;border-color:#344f74}
@media(max-width:1100px){.payment-methods{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:550px){.payment-methods{grid-template-columns:1fr 1fr}.payment-method{font-size:12px}}

/* V5.8 — rappel logique achat/vente */
.rate-logic-note{
  margin:0 16px 10px;
  padding:8px 11px;
  border:1px solid #34465a;
  border-radius:8px;
  background:#0b1520;
  color:#aeb9c6;
  font-size:11px;
  line-height:1.5;
}
.rate-logic-note b{color:#fff}
.rate-logic-note span{margin:0 6px;color:var(--gold)}
.light-theme .rate-logic-note{background:#f7f9fb;border-color:#d8e0e8;color:#667587}
.light-theme .rate-logic-note b{color:#1b2734}

/* V6 — Crypto */
.crypto-trade-panel{padding-bottom:18px}
.crypto-mode{margin:16px}
.crypto-direction-note{margin:0 16px 12px;padding:9px 11px;border:1px solid #34465a;border-radius:8px;background:#0b1520;color:#aeb9c6;font-size:12px}
.crypto-input-grid{margin:0 16px}
.crypto-converter{display:grid;grid-template-columns:1fr 46px 1fr;align-items:center;gap:8px;margin:14px 16px}
.crypto-box{background:#0b1520;border:1px solid #34465a;border-radius:10px;padding:12px;min-width:0}
.crypto-box label{margin:0 0 7px}
.crypto-box input{font-size:22px;font-weight:800;background:transparent;border:0;padding:8px 0}
.crypto-box span{display:block;color:var(--muted);font-size:12px}
.crypto-arrow{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;border:1px solid #405166;background:#142231}
.crypto-rate-info{margin:12px 16px;padding:12px 14px;border-radius:9px;background:#0a1520;border:1px solid #304153;display:flex;justify-content:space-between;gap:12px}
.crypto-rate-info span{color:var(--muted);font-size:12px}.crypto-rate-info b{color:var(--gold)}
.light-theme .crypto-direction-note,.light-theme .crypto-box,.light-theme .crypto-rate-info{background:#f7f9fb;border-color:#d5dee8;color:#526173}
.light-theme .crypto-box input{color:#17212b}
.light-theme .crypto-arrow{background:#fff;color:#314766;border-color:#d3dce5}
.payment-methods{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:1150px){.payment-methods{grid-template-columns:repeat(3,minmax(0,1fr))}.crypto-converter{grid-template-columns:1fr}.crypto-arrow{margin:auto;transform:rotate(90deg)}}
@media(max-width:650px){.payment-methods{grid-template-columns:1fr 1fr}}

/* V6.2 — clients enregistrés / auto-remplissage */
.saved-client-box{position:relative;margin-bottom:10px}
.saved-client-row{display:flex;gap:8px}
.saved-client-row input{flex:1}
.saved-client-row .btn{flex:0 0 auto}
.saved-client-results{position:absolute;left:0;right:0;top:calc(100% + 5px);z-index:120;background:#0e1925;border:1px solid #34465a;border-radius:9px;box-shadow:0 15px 35px rgba(0,0,0,.42);max-height:280px;overflow:auto}
.saved-client-item{width:100%;border:0;border-bottom:1px solid #283849;background:transparent;color:#eef3f8;padding:10px 12px;text-align:left;cursor:pointer}
.saved-client-item:hover{background:#172637}
.saved-client-item b{display:block;font-size:13px}
.saved-client-item span{display:block;color:#9eabba;font-size:11px;margin-top:3px}
.saved-client-empty{padding:14px;color:#8997a6;text-align:center;font-size:12px}
.selected-client-badge{margin-top:8px;padding:9px 10px;border-radius:8px;background:#153424;border:1px solid #286844;color:#74dc94;font-size:12px}
.selected-client-badge button{float:right;border:0;background:transparent;color:#74dc94;font-size:17px;cursor:pointer}
.light-theme .saved-client-results{background:#fff;border-color:#d6dee7}
.light-theme .saved-client-item{color:#1d2936;border-color:#e4e9ee}
.light-theme .saved-client-item:hover{background:#f1f5f9}
.light-theme .saved-client-item span{color:#677587}
.light-theme .selected-client-badge{background:#e9f7ee;border-color:#a7d4b6;color:#237b45}

/* V7 Cloud */
.cloud-status{font-size:11px;padding:7px 9px;border-radius:14px;border:1px solid #34465a;color:#b9c5d2;background:#0b1520;white-space:nowrap}
.cloud-status.ok{color:#67d98b;border-color:#286844;background:#10271b}
.cloud-status.warn{color:#f1c85b;border-color:#81671d;background:#2a2411}
.cloud-status.bad{color:#f08e95;border-color:#84343b;background:#31171a}
.light-theme .cloud-status{background:#f7f9fb;border-color:#d6dee7;color:#526274}
.light-theme .cloud-status.ok{background:#eaf7ef;color:#267a47}.light-theme .cloud-status.warn{background:#fff6d8;color:#806516}.light-theme .cloud-status.bad{background:#fdebed;color:#a33a43}
@media(max-width:1100px){.cloud-status{display:none}}

.security-panel{padding:16px;margin-bottom:14px}.security-divider{height:1px;background:#2d3c4c;margin:18px 0}.security-actions{display:flex;gap:8px;justify-content:flex-end}.twofa-setup{margin-top:14px;padding:13px;border:1px solid #3c5167;border-radius:9px;background:#0b1520}.twofa-setup code{user-select:all;color:var(--gold)}.light-theme .twofa-setup{background:#f7f9fb;border-color:#d5dee8}

/* V7.4 — messages de connexion */
.login-status{margin-top:12px;padding:10px 12px;border-radius:8px;font-size:12px;line-height:1.45;text-align:left}
.login-status.info{background:#10271b;border:1px solid #286844;color:#78d79a}
.login-status.warn{background:#2a2411;border:1px solid #81671d;color:#f1c85b}
.login-status.bad{background:#31171a;border:1px solid #84343b;color:#f08e95}
.light-theme .login-status.info{background:#eaf7ef;color:#267a47}
.light-theme .login-status.warn{background:#fff6d8;color:#806516}
.light-theme .login-status.bad{background:#fdebed;color:#a33a43}


/* ================= V8.0 MAJOR ================= */
.notification-btn{position:relative}
.notification-count{position:absolute;right:-5px;top:-6px;min-width:17px;height:17px;padding:0 4px;border-radius:10px;background:#d83e48;color:#fff;font-size:10px;display:grid;place-items:center;font-weight:800}
.notification-panel{position:fixed;right:22px;top:68px;width:min(390px,92vw);z-index:500;background:#101b28;border:1px solid #34465a;border-radius:12px;box-shadow:0 20px 50px rgba(0,0,0,.45);padding:12px}
.notification-list{display:flex;flex-direction:column;gap:7px;max-height:420px;overflow:auto}
.notification-item{border:1px solid #34465a;background:#142231;color:#d9e1ea;border-radius:8px;padding:11px;text-align:left;cursor:pointer}
.notification-item.warn{border-color:#80671f}.notification-item.danger{border-color:#873941}.notification-item.good{border-color:#2b6b48}
.light-theme .notification-panel{background:#fff;border-color:#d5dee8}.light-theme .notification-item{background:#f7f9fb;color:#283645}
.follow-btn.selected{border-color:#d6a51d;color:#f3c849;background:rgba(222,171,27,.12)}
.row-actions{display:flex;gap:6px;flex-wrap:wrap}
.rate-chart{width:100%;height:240px;background:#0b1520;border:1px solid #34465a;border-radius:8px}.chart-buy,.chart-sell{fill:none;stroke-width:3}.chart-buy{stroke:#53c884}.chart-sell{stroke:#e05e67}.chart-legend{display:flex;gap:22px;margin:8px 0 14px}
.currency-preview{margin-top:6px;color:var(--muted);font-size:12px}
.crypto-v8-grid{align-items:start}.crypto-basket-panel{margin-top:14px}
.atm-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}
.atm-card{border:1px solid #34465a;border-radius:10px;padding:12px;display:grid;grid-template-columns:1fr auto;gap:5px 10px;align-items:center;background:#0b1520}
.atm-card div{display:flex;flex-direction:column}.atm-card span{font-size:11px;color:var(--muted)}.atm-card strong{font-size:18px;color:var(--gold)}.atm-card button{grid-column:1/-1}
.light-theme .atm-card{background:#f7f9fb;border-color:#d6dee8}
.report-filters{display:grid;grid-template-columns:repeat(5,minmax(140px,1fr));gap:10px;align-items:end}.report-apply{padding-bottom:1px}.report-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
.report-summary{display:flex;flex-direction:column;gap:9px}.summary-row{display:flex;justify-content:space-between;border-bottom:1px solid #2d3c4c;padding:9px 0}.summary-row.total{font-size:17px;border-top:2px solid #46596d;border-bottom:0;margin-top:8px;padding-top:15px}
@media(max-width:1100px){.report-filters{grid-template-columns:repeat(2,1fr)}.report-kpis{grid-template-columns:repeat(2,1fr)}}
@media(max-width:650px){.report-filters,.report-kpis{grid-template-columns:1fr}}
@media print{
 body.print-active-view .sidebar,body.print-active-view .topbar,body.print-active-view .notification-panel{display:none!important}
 body.print-active-view .main{margin:0!important;width:100%!important}
 body.print-active-view .view{display:none!important}
 body.print-active-view .view.active{display:block!important}
 body.print-active-view .panel{box-shadow:none!important;border:1px solid #aaa!important}
}


/* ================= V8.1 FIXES ================= */
.action-btn,.follow-btn,.graph-btn,.delete-user-btn{
  cursor:pointer!important;
  transition:background-color .16s ease,border-color .16s ease,color .16s ease,transform .08s ease,box-shadow .16s ease!important;
}
.action-btn:hover,.follow-btn:hover,.graph-btn:hover,.delete-user-btn:hover{
  transform:translateY(-1px);
}
.graph-btn:hover,.edit-action:hover{
  background:#3a4655!important;
  border-color:#607087!important;
  color:#fff!important;
  box-shadow:0 2px 8px rgba(0,0,0,.18);
}
.graph-action:hover{background:#253e62!important;border-color:#4b73a8!important}
.follow-btn:hover{filter:brightness(1.08);box-shadow:0 2px 8px rgba(0,0,0,.16)}
.follow-btn.selected{cursor:pointer!important}
.delete-user-btn:hover,.delete-action:hover{filter:brightness(1.12)}
.chart-dot.buy{fill:#53c884}.chart-dot.sell{fill:#e05e67}
#shiftToggle{cursor:pointer!important}
#shiftToggle:hover{filter:brightness(1.08);transform:translateY(-1px)}

/* Full light theme adaptation for V8 surfaces */
body.light-theme,
body.light-theme .main,
body.light-theme .view{color:#1d2732}
body.light-theme .panel,
body.light-theme .kpi,
body.light-theme .crypto-trade-panel,
body.light-theme .crypto-basket-panel,
body.light-theme .report-filter-panel{
  background:#fff!important;color:#1d2732!important;border-color:#d7e0e9!important;
}
body.light-theme .panel-head,
body.light-theme .panel-head h2,
body.light-theme .panel h2,
body.light-theme .panel h3,
body.light-theme label,
body.light-theme td,
body.light-theme th,
body.light-theme strong,
body.light-theme b{color:#1d2732}
body.light-theme .muted,
body.light-theme small,
body.light-theme .table-footer,
body.light-theme .crypto-direction-note,
body.light-theme .currency-preview{color:#647282!important}
body.light-theme table thead,
body.light-theme th{background:#f3f6f9!important}
body.light-theme tr:hover td{background:#f8fafc}
body.light-theme input,
body.light-theme select,
body.light-theme textarea{
  background:#fff!important;color:#182431!important;border-color:#cdd7e2!important;
}
body.light-theme input::placeholder,
body.light-theme textarea::placeholder{color:#8995a3!important}
body.light-theme .currency-picker-btn,
body.light-theme .currency-picker-menu,
body.light-theme .saved-client-results,
body.light-theme .crypto-box,
body.light-theme .crypto-rate-info,
body.light-theme .twofa-setup{
  background:#fff!important;color:#1c2936!important;border-color:#d1dbe5!important;
}
body.light-theme .currency-option{color:#273442!important}
body.light-theme .currency-option:hover,
body.light-theme .currency-option.selected{background:#edf3f8!important;color:#17212b!important}
body.light-theme .picker-section-title{color:#637180!important;background:#f5f8fa!important}
body.light-theme .converter-mode button{
  background:#fff!important;color:#314052!important;border-color:#cfd9e3!important;
}
body.light-theme .converter-mode button.selected{
  background:#344f74!important;color:#fff!important;border-color:#344f74!important;
}
body.light-theme .xe-box{background:#fff!important;border-color:#ccd7e2!important}
body.light-theme .xe-amount{color:#111d2a!important}
body.light-theme .xe-currency-name,
body.light-theme .picker-text span{color:#687687!important}
body.light-theme .basket-summary,
body.light-theme .compliance-gate,
body.light-theme .rate-logic-note{
  background:#f7f9fb!important;color:#273442!important;border-color:#d5dee7!important;
}
body.light-theme .atm-card{background:#fff!important;color:#1d2732!important;border-color:#d5dee7!important}
body.light-theme .notification-panel{background:#fff!important;color:#1d2732!important;border-color:#d5dee7!important}
body.light-theme .notification-item{background:#f7f9fb!important;color:#273442!important}
body.light-theme .rate-chart{background:#f8fafc!important;border-color:#d7e0e9!important}
body.light-theme .summary-row{border-color:#e1e7ed!important}
body.light-theme .graph-btn,
body.light-theme .edit-action,
body.light-theme .graph-action{
  background:#eef2f6!important;color:#253140!important;border-color:#ccd6e0!important;
}
body.light-theme .graph-btn:hover,
body.light-theme .edit-action:hover{
  background:#dde7f0!important;color:#162230!important;border-color:#aebdca!important;
}
body.light-theme .graph-action:hover{
  background:#dbe9f8!important;color:#183e69!important;border-color:#a9c4e0!important;
}
body.light-theme .follow-btn{
  color:#392c00!important;
}
body.light-theme .follow-btn.selected{
  background:#fff6d8!important;color:#8a6500!important;border:1px solid #e1be55!important;
}
body.light-theme .delete-user-btn,
body.light-theme .delete-action{cursor:pointer!important}
body.light-theme .icon-btn{background:#fff!important;color:#253140!important;border-color:#cfd8e2!important}
body.light-theme .icon-btn:hover{background:#edf2f7!important;color:#111b26!important}
body.light-theme .notification-count{color:#fff!important}
body.light-theme .logout{color:#b22f38!important}
body.light-theme .modal-card{background:#fff!important;color:#1d2732!important}
body.light-theme .modal-card h2,
body.light-theme .modal-card td,
body.light-theme .modal-card th{color:#1d2732!important}
body.light-theme .green-text{color:#177f42!important}
body.light-theme .red-text{color:#c6323b!important}
body.light-theme .gold-text{color:#9b7200!important}

/* V8.3 Comptabilité */
.accounting-warning{padding:14px 16px;border:1px solid #9b7b2d;border-radius:12px;margin-bottom:16px;background:rgba(180,140,40,.12)}
.accounting-summary{padding:16px;border-radius:12px;margin-top:14px;background:rgba(120,140,160,.10);line-height:1.8}
body.light-theme .accounting-warning{background:#fff8df;color:#4b3a00;border-color:#e3c76c}
body.light-theme .accounting-summary{background:#f3f6f9;color:#1d2732}

/* V8.5 import + receipt barcode */
.import-history-panel{margin-bottom:14px}
.receipt-barcode{margin:12px auto 8px;text-align:center;color:#000;max-width:270px}
.receipt-barcode svg{display:block;width:100%;height:58px;margin:0 auto;background:#fff}
.receipt-barcode div{font-family:monospace;font-size:11px;letter-spacing:1.2px;margin-top:3px;color:#111}
body.light-theme .receipt-barcode{color:#000}
@media print{
 .receipt-barcode{break-inside:avoid}
 .receipt-barcode svg{height:52px}
}

/* ================= V8.6 TRANSACTIONS + KYC PRO ================= */
.pro-filter-panel{margin-bottom:14px}.pro-filters{display:grid;gap:10px;grid-template-columns:repeat(4,minmax(150px,1fr));align-items:end}
.pro-filters label{display:flex;flex-direction:column;gap:5px;font-size:11px;color:var(--muted)}
.tx-pro-filters{grid-template-columns:repeat(4,minmax(145px,1fr))}
.filter-summary{display:flex;gap:22px;margin-top:12px;padding-top:10px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}
.pro-table td{vertical-align:middle}.pro-table small,.transaction-history-table small{display:block;font-size:10px;color:var(--muted);margin-top:3px}
.history-ref{color:#a99350!important}.operation-cell{min-width:205px;font-size:11px;line-height:1.5}
.tx-type-chip{display:inline-flex;padding:4px 8px;border-radius:12px;font-size:10px;font-weight:800}.tx-type-chip.buy{background:rgba(45,164,94,.13);color:#58ce85}.tx-type-chip.sell{background:rgba(221,74,85,.13);color:#ef7880}.tx-type-chip.multi{background:rgba(71,112,190,.15);color:#86aef8}
.status-warn{display:inline-flex;padding:4px 7px;border-radius:6px;background:rgba(218,164,36,.16);color:#e6bd4b;font-size:10px;font-weight:800}.status-ok{font-size:10px;color:var(--green);font-weight:700}
.id-code{font-size:11px;padding:4px 6px;border-radius:5px;background:rgba(110,130,150,.13)}.empty-pro-row{text-align:center;padding:28px!important}
.tx-detail-pro,.client-file-pro{min-width:min(900px,85vw)}.tx-detail-header{display:flex;justify-content:space-between;gap:16px;align-items:start;margin-bottom:14px}.tx-detail-header h2{margin:0}.tx-detail-header p{margin:4px 0 0;color:var(--muted)}
.history-banner{border:1px solid #80671f;background:rgba(159,121,25,.12);padding:10px 12px;border-radius:8px;margin-bottom:12px}
.detail-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.detail-card{border:1px solid var(--line);border-radius:10px;padding:12px;background:var(--panel2)}.detail-card h3{margin:0 0 10px}.detail-card>div{display:flex;justify-content:space-between;gap:14px;border-bottom:1px solid var(--line);padding:7px 0}.detail-card>div:last-child{border-bottom:0}.detail-card span{color:var(--muted);font-size:11px}.detail-card b{text-align:right;font-size:11px;overflow-wrap:anywhere}.id-number{font-family:monospace;font-size:13px!important}
.panel-like-detail{margin-top:14px;border:1px solid var(--line);border-radius:10px;padding:12px}.panel-like-detail h3{margin-top:0}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
body.light-theme .history-banner{background:#fff7d8;color:#4a3900;border-color:#dfc363}body.light-theme .id-code{background:#eef3f7;color:#243140}body.light-theme .tx-type-chip.buy{color:#167841}body.light-theme .tx-type-chip.sell{color:#bd3039}body.light-theme .tx-type-chip.multi{color:#315c9c}body.light-theme .status-warn{color:#846000;background:#fff2c8}
@media(max-width:1100px){.pro-filters,.tx-pro-filters{grid-template-columns:repeat(2,1fr)}.detail-grid{grid-template-columns:1fr 1fr}}
@media(max-width:700px){.pro-filters,.tx-pro-filters,.detail-grid{grid-template-columns:1fr}.tx-detail-pro,.client-file-pro{min-width:0}.filter-summary{flex-direction:column;gap:5px}}


/* ================= V8.6.1 MODAL RESPONSIVE FIX ================= */
#modal{
  padding:24px!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:auto!important;
}
#modal.modal-wide-86 .modal-card{
  width:min(1120px, calc(100vw - 48px))!important;
  max-width:min(1120px, calc(100vw - 48px))!important;
  min-width:0!important;
  max-height:calc(100vh - 48px)!important;
  overflow:auto!important;
  box-sizing:border-box!important;
  margin:auto!important;
}
#modal.modal-wide-86 #modalContent{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
  overflow:visible!important;
}
#modal.modal-wide-86 .tx-detail-pro,
#modal.modal-wide-86 .client-file-pro{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
#modal.modal-wide-86 .detail-grid{
  width:100%;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
#modal.modal-wide-86 .detail-card{
  min-width:0!important;
  overflow:hidden;
}
#modal.modal-wide-86 .detail-card > div{
  min-width:0;
}
#modal.modal-wide-86 .detail-card b{
  min-width:0;
  max-width:65%;
  overflow-wrap:anywhere;
  word-break:break-word;
}
#modal.modal-wide-86 .panel-like-detail{
  width:100%;
  min-width:0;
  box-sizing:border-box;
}
#modal.modal-wide-86 .table-wrap{
  width:100%;
  max-width:100%;
  overflow-x:auto!important;
}
#modal.modal-wide-86 table{
  width:100%;
  min-width:760px;
}
#modal.modal-wide-86 .receipt-barcode{
  width:min(330px,90%);
  max-width:100%;
  margin:14px auto;
}
#modal.modal-wide-86 .modal-actions{
  width:100%;
  flex-wrap:wrap;
}
#modal.modal-wide-86 .modal-actions .btn{
  min-width:150px;
}
#modal.modal-wide-86 .tx-detail-header{
  width:100%;
  flex-wrap:wrap;
}
body.light-theme #modal.modal-wide-86 .modal-card{
  background:#fff!important;
  color:#1d2732!important;
}

@media(max-width:900px){
  #modal{padding:12px!important}
  #modal.modal-wide-86 .modal-card{
    width:calc(100vw - 24px)!important;
    max-width:calc(100vw - 24px)!important;
    max-height:calc(100vh - 24px)!important;
  }
  #modal.modal-wide-86 .detail-grid{
    grid-template-columns:1fr!important;
  }
  #modal.modal-wide-86 table{
    min-width:700px;
  }
}
@media(max-width:600px){
  #modal.modal-wide-86 .modal-actions{
    flex-direction:column;
  }
  #modal.modal-wide-86 .modal-actions .btn{
    width:100%;
  }
}

/* ================= V8.7 INITIAL CASH ================= */
.initial-cash-panel{margin-bottom:14px}
.initial-cash-status{display:flex;align-items:center;gap:8px;margin:10px 0 14px;flex-wrap:wrap}
#cashAdjustHistory87 td{font-size:11px}
body.light-theme .initial-cash-panel{background:#fff!important;color:#1d2732!important}

/* ================= V8.8 HISTORY REPLAY + RECEIPTS ================= */
.historical-replay-88{margin-bottom:14px}
.history-replay-note{margin-top:12px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--panel2);color:var(--muted);font-size:11px}
.customer-receipts-88{margin-top:14px}
.customer-receipts-88 .panel-head{padding:0 0 10px 0}
.current-receipt-row td{background:rgba(70,120,190,.09)}
body.light-theme .history-replay-note{background:#f5f8fb;color:#5f6d7b}
body.light-theme .current-receipt-row td{background:#eef5fc}

/* V8.9 danger zone */
.danger-zone-89{border:1px solid rgba(210,60,70,.45)!important}
.danger-box-89{padding:14px;border-radius:9px;background:rgba(210,60,70,.08);border:1px solid rgba(210,60,70,.25)}
.danger-box-89 b{color:#ef7880}.danger-box-89 p{color:var(--muted);font-size:12px}
.dangerbtn{background:#b93642!important;color:#fff!important;border-color:#d14a55!important}
body.light-theme .danger-box-89{background:#fff0f1}
body.light-theme .danger-box-89 b{color:#a51f2b}

/* V9.0 transaction logic */
.logic-help-90{
 display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:10px 0 16px;
}
.logic-help-90>div{
 border:1px solid var(--line);background:var(--panel2);border-radius:9px;padding:10px 12px;
 display:flex;flex-direction:column;gap:4px;font-size:11px;color:var(--muted);
}
.logic-help-90 b{font-size:12px;color:var(--text)}
.logic-help-90 strong{color:var(--gold)}
body.light-theme .logic-help-90>div{background:#f5f8fb}
@media(max-width:800px){.logic-help-90{grid-template-columns:1fr}}

/* V9.0.1 exact transaction rules */
#exchange .rate-logic-note{display:none!important}

/* V9.3.1 OCR */
.rate-ocr-panel{margin:14px 0;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--panel2)}
.rate-ocr-head,.rate-ocr-actions,.rate-ocr-toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center}
.rate-ocr-head{align-items:start;margin-bottom:12px}.rate-ocr-head h3{margin:0}
.rate-ocr-layout{display:grid;grid-template-columns:minmax(260px,.7fr) minmax(520px,1.5fr);gap:14px}
.rate-ocr-image-wrap{padding:10px;border:1px solid var(--line);border-radius:10px}.rate-ocr-image-wrap img{width:100%;max-height:420px;object-fit:contain;background:#fff}
.rate-ocr-status{font-size:11px;color:var(--muted);margin-top:8px}.rate-ocr-toolbar{margin-bottom:10px}.rate-ocr-toolbar label{display:flex;flex-direction:column;gap:4px;flex:1}
.rate-ocr-actions{margin-top:12px}.ocr931{min-width:105px}
body.light-theme .rate-ocr-panel{background:#f6f8fb!important}
@media(max-width:1000px){.rate-ocr-layout{grid-template-columns:1fr}}

.rate-ocr-debug934{margin-top:5px;font-size:10px;opacity:.65}

/* V9.3.5 OCR preview */
.ocr-preview935{
  outline:2px solid #ffbf00!important;
  box-shadow:0 0 0 3px rgba(255,191,0,.18)!important;
  background:rgba(255,191,0,.10)!important;
}
body.light-theme .ocr-preview935{background:#fff6d8!important}

/* V9.3.6 safe OCR preview */
.ocr-select936{display:flex;align-items:center;gap:7px}
.ocr-select936 input{width:auto!important;min-width:0!important}
.ocr-row-warn936 td{background:rgba(255,175,0,.055)}
.ocr-row-warn936 .ocr931{border-color:#b58a19!important}

/* ================= V9.3.7 OCR MODAL ================= */
.rate-ocr-modal937{
 position:fixed;
 inset:0;
 z-index:10050;
 background:rgba(0,0,0,.72);
 display:flex;
 align-items:center;
 justify-content:center;
 padding:20px;
}
.rate-ocr-modal937.hidden{display:none!important}
.rate-ocr-modal-card937{
 width:min(1280px,calc(100vw - 40px));
 max-height:calc(100vh - 40px);
 overflow:auto;
 background:var(--panel);
 color:var(--text);
 border:1px solid var(--line);
 border-radius:14px;
 box-shadow:0 24px 80px rgba(0,0,0,.5);
}
.rate-ocr-modal-head937{
 display:flex;
 justify-content:space-between;
 align-items:start;
 gap:16px;
 padding:18px;
 border-bottom:1px solid var(--line);
 position:sticky;
 top:0;
 z-index:2;
 background:var(--panel);
}
.rate-ocr-modal-head937 h2{margin:0 0 4px}
.rate-ocr-modal-body937{
 display:grid;
 grid-template-columns:minmax(280px,.7fr) minmax(650px,1.6fr);
 gap:16px;
 padding:16px;
}
.rate-ocr-modal-preview937{
 border:1px solid var(--line);
 border-radius:10px;
 padding:10px;
 background:var(--panel2);
}
.rate-ocr-modal-preview937 img{
 display:block;
 width:100%;
 max-height:650px;
 object-fit:contain;
 background:#fff;
 border-radius:6px;
}
.rate-ocr-toolbar937{
 display:flex;
 justify-content:space-between;
 align-items:end;
 gap:12px;
 margin-bottom:10px;
}
.rate-ocr-toolbar937 label{
 display:flex;
 flex-direction:column;
 gap:5px;
 font-size:11px;
 color:var(--muted);
}
.rate-ocr-modal-table937 small{display:block;color:var(--muted);font-size:10px}
.rate-ocr-modal-table937 input[type="number"]{min-width:120px}
.rate-ocr-modal-actions937{
 display:flex;
 justify-content:flex-end;
 gap:10px;
 padding:16px 18px;
 border-top:1px solid var(--line);
 position:sticky;
 bottom:0;
 background:var(--panel);
}
.ocr-modal-warn937 td{background:rgba(255,175,0,.06)}
body.light-theme .rate-ocr-modal-card937,
body.light-theme .rate-ocr-modal-head937,
body.light-theme .rate-ocr-modal-actions937{background:#fff!important;color:#17222e!important}
body.light-theme .rate-ocr-modal-preview937{background:#f4f7fa!important}
@media(max-width:980px){
 .rate-ocr-modal-body937{grid-template-columns:1fr}
 .rate-ocr-modal-preview937 img{max-height:300px}
}

/* V9.3.8 modal button interaction */
#rateOcrModal937 button{
  pointer-events:auto!important;
  position:relative;
  z-index:10;
  cursor:pointer!important;
}
.rate-ocr-modal-actions937{
  z-index:20!important;
}
.rate-ocr-modal-head937{
  z-index:20!important;
}

/* ================= V9.4 PROFIT ================= */
.profit-kpis94{display:grid;grid-template-columns:repeat(5,minmax(140px,1fr));gap:10px;margin:14px 0}
.profit-net94{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:12px 0 16px}
.profit-net94>div{border:1px solid var(--line);border-radius:10px;padding:12px;background:var(--panel2);display:flex;justify-content:space-between;gap:12px}
.profit-net94 span{color:var(--muted);font-size:11px}.profit-net94 b{font-size:16px}
.profit-net-main94{border-color:rgba(255,190,0,.5)!important}
.profit-net-main94 b{color:var(--gold)}
.profit-filters94{grid-template-columns:repeat(6,minmax(130px,1fr))}
.profit-positive94{color:var(--green)}.profit-negative94{color:#ef7880}
body.light-theme .profit-net94>div{background:#f6f8fb}
@media(max-width:1200px){.profit-kpis94{grid-template-columns:repeat(3,1fr)}.profit-filters94{grid-template-columns:repeat(3,1fr)}}
@media(max-width:750px){.profit-kpis94,.profit-net94,.profit-filters94{grid-template-columns:1fr}}

/* ================= V9.5 PROFIT ENGINE ================= */
.profit-engine-status95{
  display:flex;
  flex-wrap:wrap;
  gap:8px 18px;
  padding:10px 12px;
  margin-bottom:12px;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--panel2);
  font-size:11px;
  color:var(--muted);
}
.profit-engine-status95 b{color:var(--text)}
.profit-engine-ok95{color:var(--green)}
.profit-estimated95{color:#e0ad31}
.estimated-chip95{
  display:block;
  margin-top:3px;
  font-size:9px;
  color:#e0ad31;
  font-weight:700;
}
body.light-theme .profit-engine-status95{background:#f6f8fb}

/* ================= V10 PRO ================= */
.profit-click10{cursor:pointer;text-decoration:underline;text-decoration-style:dotted}
.profit-click10:hover{filter:brightness(1.25)}
.profit-detail-card10{max-width:760px}
.profit-detail-total10{display:flex;justify-content:space-between;align-items:center;padding:14px;border:1px solid var(--line);border-radius:10px;margin:12px 0}
.profit-detail-total10 b{font-size:24px;color:var(--green)}
.profit-line10{padding:14px;margin:10px 0;border:1px solid var(--line);border-radius:10px;background:var(--panel2)}
.profit-line10 h3{margin:0 0 8px}
.profit-formula10{font-size:18px;margin:8px 0}
body.light-theme .profit-line10{background:#f6f8fb}
