
:root{--bg:#07101b;--panel:#0b1725;--panel2:#0f1f31;--line:#233a52;--text:#edf5ff;--muted:#8ea5bd;--green:#22c55e;--green2:#16a34a;--amber:#facc15;--red:#ef4444;--blue:#38bdf8;--purple:#a78bfa;--shadow:0 18px 45px rgba(0,0,0,.38)}
*{box-sizing:border-box}html,body{height:100%;margin:0;font-family:"Noto Sans Bengali","Segoe UI",Arial,sans-serif;background:#050b12;color:var(--text)}body{overflow:hidden}button,input,select,textarea{font:inherit}button{cursor:pointer}.hidden{display:none!important}
.app-shell{width:100%;max-width:1360px;height:calc(100vh - 24px);margin:12px auto;background:var(--bg);border:1px solid rgba(126,164,199,.28);border-radius:14px;overflow:hidden;box-shadow:var(--shadow);display:flex;flex-direction:column}.windowbar{height:28px;display:flex;align-items:center;justify-content:space-between;padding:0 12px;background:#0a1119;border-bottom:1px solid #1d2a38;font-size:11px}.dots{display:flex;gap:6px}.dot{width:10px;height:10px;border-radius:50%}.red{background:#ff5f57}.yellow{background:#ffbd2e}.green{background:#28c940}.topbar{height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 14px;background:linear-gradient(#12243a,#0a1420);border-bottom:1px solid var(--line)}.brand{display:flex;gap:10px;align-items:center}.brand img{width:36px;height:36px}.brand h1{font-size:16px;margin:0}.brand small{display:block;color:var(--muted);font-size:9px;letter-spacing:.08em}.top-actions{display:flex;gap:8px;align-items:center}.langbtn,.ghost,.primary,.danger,.success{border:1px solid var(--line);border-radius:9px;padding:7px 11px;background:#122235;color:var(--text);font-size:11px}.langbtn.active,.primary{background:linear-gradient(135deg,#16a34a,#059669);border-color:#34d399}.danger{background:#4b1720;border-color:#7f1d1d}.success{background:#123c29;border-color:#166534}.workspace{flex:1;display:flex;min-height:0}.sidebar{width:218px;background:#0b1725;border-right:1px solid var(--line);padding:10px;overflow:auto}.nav-title{font-size:9px;color:#67819a;letter-spacing:.16em;margin:5px 8px 7px}.navbtn{width:100%;display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:10px;border:0;border-left:2px solid transparent;background:transparent;color:#b7c8d8;text-align:left;font-size:12px;margin:2px 0}.navbtn:hover{background:#102236}.navbtn.active{background:rgba(34,197,94,.12);border-left-color:#4ade80;color:#86efac}.navbtn .ico{width:22px;text-align:center}.badge{margin-left:auto;background:#1d3348;border-radius:8px;padding:2px 6px;font-size:9px}.main{flex:1;min-width:0;overflow:auto;padding:14px;background:radial-gradient(circle at 20% 0%,rgba(22,163,74,.08),transparent 35%),#08121d}.pagehead{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:12px}.pagehead h2{margin:0;font-size:19px}.pagehead p{margin:3px 0 0;color:var(--muted);font-size:11px}.cards{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin-bottom:12px}.stat{background:linear-gradient(135deg,#102034,#0b1725);border:1px solid var(--line);border-radius:13px;padding:12px}.stat .label{color:#91a8bf;font-size:10px}.stat .value{font-size:19px;font-weight:800;margin-top:4px}.stat .sub{font-size:9px;color:#6f8aa3;margin-top:3px}.grid2{display:grid;grid-template-columns:1.15fr .85fr;gap:12px}.panel{background:#0c1928;border:1px solid var(--line);border-radius:13px;padding:12px;min-width:0}.panel h3{font-size:13px;margin:0 0 10px}.tablewrap{overflow:auto;border:1px solid #1d3347;border-radius:10px}table{width:100%;border-collapse:collapse;font-size:11px;min-width:720px}th,td{padding:9px 10px;border-bottom:1px solid #1b2c3d;text-align:left;vertical-align:middle}th{color:#8ca6c0;background:#0d1c2c;position:sticky;top:0}tr:hover td{background:#0e1e2e}.status{display:inline-flex;padding:3px 7px;border-radius:999px;font-size:9px;border:1px solid}.ok{color:#86efac;border-color:#166534;background:#123522}.low{color:#fde68a;border-color:#854d0e;background:#3b2b0b}.bad{color:#fda4af;border-color:#7f1d1d;background:#3d151c}.product-thumb{width:46px;height:46px;border-radius:9px;object-fit:cover;background:#132235;border:1px solid #274057}.toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}.search{flex:1;min-width:190px;background:#0a1522;border:1px solid var(--line);border-radius:9px;padding:8px 10px;color:var(--text)}.formgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.field label{display:block;font-size:10px;color:#91a8bf;margin-bottom:5px}.field input,.field select,.field textarea{width:100%;padding:8px 9px;border-radius:9px;border:1px solid var(--line);background:#081522;color:#eef7ff;outline:none}.field textarea{min-height:76px;resize:vertical}.modalback{position:fixed;inset:0;background:rgba(0,0,0,.72);display:flex;align-items:center;justify-content:center;padding:18px;z-index:80}.modal{width:min(880px,96vw);max-height:90vh;overflow:auto;background:#0c1928;border:1px solid #2b4864;border-radius:16px;padding:16px;box-shadow:var(--shadow)}.modalhead{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.modalhead h3{margin:0}.close{background:transparent;color:#fff;border:0;font-size:20px}.loginpage{position:fixed;inset:0;z-index:100;background:radial-gradient(circle at 15% 20%,rgba(34,197,94,.25),transparent 34%),radial-gradient(circle at 85% 15%,rgba(56,189,248,.16),transparent 32%),#061019;display:flex;align-items:center;justify-content:center;padding:18px}.loginbox{width:min(1080px,95vw);min-height:610px;background:#0a1724;border:1px solid #28435c;border-radius:22px;overflow:hidden;display:grid;grid-template-columns:1.2fr .8fr;box-shadow:0 35px 90px rgba(0,0,0,.5)}.loginart{position:relative;padding:38px;background:linear-gradient(145deg,rgba(3,105,161,.1),rgba(22,163,74,.12));display:flex;flex-direction:column;justify-content:space-between}.hero-products{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:24px}.hero-products img{width:100%;border-radius:18px;border:1px solid #2b4d62;box-shadow:0 16px 30px rgba(0,0,0,.28)}.loginart h2{font-size:34px;line-height:1.2;margin:0}.loginart p{color:#9fb5c9;max-width:600px}.loginform{padding:36px;background:#0b1521;display:flex;flex-direction:column;justify-content:center}.loginform h3{font-size:22px;margin:0 0 6px}.loginform p{font-size:11px;color:var(--muted);margin:0 0 22px}.loginform .field{margin-bottom:10px}.loginform .wide{width:100%;margin-top:6px}.togglelinks{display:flex;gap:8px;margin-bottom:16px}.notice{font-size:10px;color:#8fa7bd;background:#0a1d2a;border:1px solid #1d3b50;border-radius:9px;padding:9px;margin-top:10px}.mini-chart{height:170px;display:flex;align-items:flex-end;gap:9px;padding:12px 2px}.bar{flex:1;background:linear-gradient(#4ade80,#15803d);border-radius:6px 6px 2px 2px;min-width:18px;position:relative}.bar span{position:absolute;bottom:-22px;left:50%;transform:translateX(-50%);font-size:9px;color:#7890a8}.alerts{display:grid;gap:8px}.alert{display:flex;gap:10px;align-items:center;padding:9px;border:1px solid #233b52;border-radius:10px;background:#0b1a28}.alert img{width:40px;height:40px;border-radius:8px}.alert b{font-size:11px}.alert small{display:block;color:#90a6bb;margin-top:2px}.footerline{padding:6px 12px;border-top:1px solid #1d2d3d;background:#0a121c;color:#66829c;font-size:9px;display:flex;justify-content:space-between}.mobile-menu{display:none}.previewimg{max-width:150px;max-height:120px;border-radius:10px;border:1px solid var(--line);margin-top:8px}
.language-switcher{flex-wrap:wrap;justify-content:flex-end}.language-switcher .langbtn{min-width:62px}.market-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;white-space:nowrap;background:linear-gradient(135deg,#7c3aed,#9333ea);border-color:#c084fc!important;color:#fff!important;font-weight:800}.market-link:hover{background:linear-gradient(135deg,#6d28d9,#7e22ce)}.loginform .language-switcher{gap:5px}.loginform .language-switcher .langbtn{padding:6px 8px;font-size:10px}html[dir="rtl"] .sidebar{border-right:0;border-left:1px solid var(--line)}html[dir="rtl"] th,html[dir="rtl"] td,html[dir="rtl"] .navbtn{text-align:right}
@media(max-width:1000px){.cards{grid-template-columns:repeat(2,1fr)}.grid2{grid-template-columns:1fr}.formgrid{grid-template-columns:repeat(2,1fr)}.loginbox{grid-template-columns:1fr}.loginart{display:none}.sidebar{position:fixed;z-index:70;left:0;top:0;bottom:0;transform:translateX(-105%);transition:.2s;width:240px}.sidebar.show{transform:translateX(0)}.mobile-menu{display:inline-block}.app-shell{height:100vh;margin:0;border-radius:0}}
@media(max-width:600px){.cards{grid-template-columns:1fr 1fr}.formgrid{grid-template-columns:1fr}.topbar{height:auto;min-height:62px;padding:8px;align-items:flex-start;gap:6px}.topbar>.language-switcher{flex:1;gap:5px}.topbar>.language-switcher .langbtn,.topbar>.language-switcher .danger{padding:6px 7px;font-size:10px;min-width:58px}.brand h1{font-size:13px}.brand small{display:none}.main{padding:9px}.loginform{padding:24px}.pagehead{flex-direction:column}.top-actions .clock{display:none}}

/* Bahar Agro Voice-only App Assistant */
#appAssistantFab{border:1px solid #2dd4bf;background:#07101b;color:#fff;box-shadow:0 10px 30px rgba(0,0,0,.38),0 0 0 1px rgba(45,212,191,.16);display:flex;align-items:center;justify-content:center;cursor:pointer;outline:none;overflow:hidden}
#appAssistantFab img{display:block;width:100%;height:100%;object-fit:cover;pointer-events:none}
#appAssistantFab.assistant-login{position:relative;z-index:2;width:58px;height:58px;border-radius:16px;margin:0 0 14px auto;padding:0;flex:0 0 auto}
#appAssistantFab.assistant-floating{position:fixed;right:18px;bottom:18px;z-index:130;width:60px;height:60px;border-radius:18px;padding:0}
#appAssistantFab:hover{filter:brightness(1.08);box-shadow:0 12px 34px rgba(0,0,0,.42),0 0 16px rgba(45,212,191,.28)}
#appAssistantFab:active{transform:scale(.96)}
@media(max-width:600px){#appAssistantFab.assistant-login{width:54px;height:54px;margin-bottom:12px}#appAssistantFab.assistant-floating{right:10px;bottom:10px;width:56px;height:56px}}

/* V10: page-click voice guide + persistent microphone on/off */
#assistantControlWrap{display:flex;align-items:center;gap:8px;width:max-content}
#assistantControlWrap.assistant-login{position:relative;z-index:2;margin:0 0 14px auto}
#assistantControlWrap.assistant-floating{position:fixed;right:18px;bottom:18px;z-index:130}
#assistantControlWrap #appAssistantFab{position:relative!important;right:auto!important;bottom:auto!important;margin:0!important;width:60px;height:60px;border-radius:18px;padding:0;flex:0 0 auto}
#assistantMuteBtn{width:34px;height:34px;border-radius:50%;border:1px solid rgba(45,212,191,.65);background:#0b1623;color:#dffcf7;display:flex;align-items:center;justify-content:center;padding:7px;cursor:pointer;box-shadow:0 6px 18px rgba(0,0,0,.3)}
#assistantMuteBtn svg{display:block;width:100%;height:100%;fill:currentColor}
#assistantMuteBtn:hover{filter:brightness(1.12)}
#assistantControlWrap.voice-muted #appAssistantFab{filter:grayscale(.8) brightness(.65)}
#assistantControlWrap.voice-muted #assistantMuteBtn{color:#ff6b6b;border-color:rgba(255,107,107,.75)}
@media(max-width:600px){#assistantControlWrap.assistant-login{margin-bottom:12px}#assistantControlWrap.assistant-floating{right:10px;bottom:10px}#assistantControlWrap #appAssistantFab{width:56px;height:56px}#assistantMuteBtn{width:32px;height:32px;padding:6px}}


/* POS LAYOUT */
.pos-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; height: 100%; min-height: 500px; }
.pos-main { display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.pos-header { display: flex; justify-content: space-between; align-items: center; }
.pos-header h2 { margin: 0; font-size: 20px; color: #e2e8f0; }
.pos-toolbar { display: flex; gap: 10px; }
.pos-toolbar .search { flex: 1; background: #111827; border: 1px solid #374151; padding: 10px 14px; font-size: 14px; border-radius: 8px; color: #fff; outline:none; }
.pos-categories { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.cat-btn { background: #1f2937; border: 1px solid #374151; color: #9ca3af; padding: 8px 16px; border-radius: 20px; cursor: pointer; white-space: nowrap; transition: 0.2s; font-size: 13px; }
.cat-btn:hover { background: #374151; }
.cat-btn.active { background: #8b5cf6; border-color: #7c3aed; color: #fff; }

.pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); grid-auto-rows: min-content; align-items: stretch; gap: 12px; overflow-y: auto; padding-right: 4px; padding-bottom: 20px; }
.pos-products::-webkit-scrollbar { width: 6px; }
.pos-products::-webkit-scrollbar-thumb { background: #374151; border-radius: 10px; }
.pos-product-card { background: #1f2937; border: 1px solid #374151; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-height: 250px; justify-content: space-between; height: 100%; }
.pos-card-img-wrap { position: relative; height: 120px; background: #374151; }
.pos-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.pos-stock-badge { position: absolute; top: 8px; right: 8px; background: rgba(16, 185, 129, 0.9); color: white; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: bold; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
.pos-card-info { padding: 10px; display: flex; flex-direction: column; flex: 1; }
.pos-card-info h4 { margin: 0 0 4px 0; font-size: 14px; color: #f3f4f6; }
.pos-card-info small { color: #9ca3af; font-size: 11px; margin-bottom: 8px; }
.pos-card-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.pos-price { font-weight: bold; font-size: 16px; color: #f3f4f6; }
.cart-add-btn { background: #8b5cf6; color: white; border: none; padding: 8px; border-radius: 6px; cursor: pointer; font-size: 13px; transition: 0.2s; font-weight: bold; }
.cart-add-btn:hover { background: #7c3aed; }

.pos-cart-sidebar { background: #111827; border: 1px solid #374151; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.cart-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: #1f2937; border-bottom: 1px solid #374151; }
.cart-header h3 { margin: 0; font-size: 16px; color: #f3f4f6; }
.clear-cart-btn { color: #ef4444; font-size: 12px; padding: 4px; background: transparent; border: none; cursor: pointer; }
.cart-items { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cart-items::-webkit-scrollbar { width: 6px; }
.cart-items::-webkit-scrollbar-thumb { background: #374151; border-radius: 10px; }
.cart-item { display: flex; gap: 10px; background: #1f2937; padding: 10px; border-radius: 8px; border: 1px solid #374151; align-items: center; }
.cart-item img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-info h4 { margin: 0 0 4px 0; font-size: 13px; color: #f3f4f6; }
.cart-qty-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 6px;}
.cart-item-price { font-size: 12px; color: #9ca3af; }
.qty-btn-group { display: flex; align-items: center; background: #374151; border-radius: 6px; overflow: hidden; }
.qty-btn { background: transparent; border: none; color: white; width: 24px; height: 24px; cursor: pointer; font-size: 14px; line-height: 1; }
.qty-btn:hover { background: #4b5563; }
.qty-btn-group span { width: 24px; text-align: center; font-size: 12px; }
.cart-item-total { font-weight: bold; font-size: 13px; }
.cart-del-btn { background: transparent; border: none; color: #ef4444; cursor: pointer; padding: 4px; font-size: 16px; }
.cart-del-btn:hover { color: #f87171; }

.cart-summary { background: #1f2937; padding: 16px; border-top: 1px solid #374151; display: flex; flex-direction: column; gap: 8px; }
.summary-row { display: flex; justify-content: space-between; font-size: 13px; color: #9ca3af; align-items: center; }
.summary-row.highlight { color: #a78bfa; font-weight: bold; font-size: 16px; border-top: 1px dashed #374151; padding-top: 8px; margin-top: 4px; }
.discount-input { width: 60px; background: #111827; border: 1px solid #374151; color: white; padding: 4px 6px; border-radius: 4px; text-align: right; font-size:13px; outline:none; }
.discount-input:focus { border-color: #8b5cf6; }
.payment-box { background: #111827; padding: 12px; border-radius: 8px; border: 1px solid #374151; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.cash-input { width: 90px; background: #1f2937; border: 1px solid #374151; color: white; padding: 6px 8px; border-radius: 4px; text-align: right; font-weight: bold; font-size: 14px; outline:none; }
.cash-input:focus { border-color: #8b5cf6; }
.text-green { color: #10b981; }
.text-red { color: #ef4444; }
.checkout-btn { background: #8b5cf6; color: white; border: none; padding: 14px; border-radius: 8px; font-weight: bold; font-size: 15px; cursor: pointer; margin-top: 6px; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.checkout-btn:hover { background: #7c3aed; }
.checkout-btn:disabled { background: #374151; color:#9ca3af; cursor: not-allowed; box-shadow:none; }

@media(max-width: 900px) {
   .pos-layout { grid-template-columns: 1fr; height: auto; }
   .pos-cart-sidebar { min-height: 500px; }
   .pos-products { max-height: 400px; }
}
