/* Approved purple, gold and ivory visual theme. No business logic. */
:root{--teal:#661389;--teal-dark:#45075f;--teal-soft:#f5e5fa;--ink:#3e1155;--muted:#745c7d;--line:#ead7c7;--bg:#fff4e8;--card:#fffaf3;--radius:20px;--gold:#efbc51;--royal-shadow:0 4px 12px #75321d19}
body{background:radial-gradient(ellipse at 0% 70%,#f6d8ed66,transparent 50%),linear-gradient(160deg,#fff9f1,#fff0e0);color:var(--ink)}
.topbar{background:radial-gradient(ellipse at 20% 0%,#8f23a7,transparent 65%),linear-gradient(120deg,#4c0769,#650d7c 55%,#350547);padding:15px 18px 20px;border-bottom:3px solid #edc46d;border-radius:0 0 42% 8% / 0 0 15px 12px;box-shadow:0 4px 10px #783b5822;min-height:78px}
.topbar .brand-name{font-size:32px;color:#fffaf0;text-shadow:0 2px 1px #250433,0 0 8px #ffe0a033;position:relative;display:inline-block}.topbar .brand-name:after{content:'';display:block;height:6px;border-bottom:3px solid #f1c664;border-radius:0 0 70% 80%;transform:rotate(-4deg);margin-top:-4px}.topbar .brand-sub{font-size:9px;letter-spacing:1.5px;color:#ffdf94}.topbar .icon-btn{color:#ffe096;background:#fff1c510;border:1px solid #dcb66a66;border-radius:12px;width:42px;height:42px}
.account-chip{position:static;width:fit-content;max-width:calc(100% - 28px);margin:8px auto 0;padding:5px 12px;font-size:11px;color:#5b236f;background:#fff9ef;border-color:#e8ce96;overflow-wrap:anywhere}.account-chip .linklike{color:#61137d}.mode-banner{margin:0;border:0;background:linear-gradient(100deg,#fff4dd,#fff8ed);color:#57226a;font-size:13px;font-weight:700;line-height:1.7;padding:12px 18px;box-shadow:inset 0 -1px #ecd9be}
main{padding:14px 12px 190px}.period-pills{gap:7px;margin-bottom:12px}.pill{background:linear-gradient(#fffcf7,#fff0da);color:#56216c;border:1px solid #fffdf2;border-bottom-color:#e5cbad;font-size:15px;font-weight:700;padding:10px 5px;box-shadow:var(--royal-shadow)}.pill.active{background:linear-gradient(#9619ab,#620980 55%,#47065e);color:#fff4c9;border-color:#c79852;box-shadow:0 2px 7px #6d176855,inset 0 1px 1px #e9a8f266}
.period-sel{justify-content:flex-start;margin-bottom:7px}.period-sel input{color:#58146f;font-weight:700;background:linear-gradient(#fffcf8,#fff0df);border:1px solid #eedcc5;border-radius:20px;padding:10px 14px;box-shadow:var(--royal-shadow);max-width:100%;font-size:15px;font-family:inherit}.range-label{color:#66227a;font-weight:700;margin-bottom:9px}.cards{gap:10px}.stat-card{position:relative;display:grid;grid-template-columns:1fr 44px;align-items:center;column-gap:9px;min-height:112px;padding:12px 10px;border:1px solid #fffaf2;border-bottom:1px solid #e8c9aa;border-radius:20px;background:linear-gradient(145deg,#fffdf8,#fff0d5);box-shadow:0 4px 8px #9d5f3224,inset 0 1px 0 #fff}.stat-card:nth-child(4n+1),.stat-card:nth-child(4n+4){background:linear-gradient(145deg,#fff2fc,#f0daf7)}.metric-body{min-width:0}.stat-card .label{font-size:13px;font-weight:800;color:#501463;line-height:1.35;margin-bottom:4px;overflow-wrap:break-word}.stat-card .value{font-size:26px;line-height:1.15;color:#4e096c;overflow-wrap:anywhere}.stat-card .value small{font-size:12px;color:inherit;font-weight:700}.stat-card.good .value,.stat-card.warn .value{color:#4e096c}.stat-card.bad .value{color:#b91c1c}.metric-icon{display:flex;align-items:center;justify-content:center;width:44px;height:48px;border-radius:50%;background:radial-gradient(circle at 30% 10%,#bd39c3,#710b8e 52%,#3f0756);border:1px solid #d1a544;box-shadow:0 2px 3px #4c085b44,inset 0 1px 2px #efb5ee55}.metric-icon svg{width:28px;height:28px;filter:drop-shadow(0 2px 1px #3d0b3f)}
.alltime-strip{background:linear-gradient(#fffcf6,#ffefdc);border:1px solid #e8ccb0;border-radius:18px;box-shadow:var(--royal-shadow);color:#662079;gap:7px 12px;line-height:1.7}.alltime-strip:empty{display:none}.alltime-strip .at-title{color:#5b1373}.add-toggle,.primary{background:linear-gradient(#8e21a1,#640b80 65%,#4c0866);border:1px solid #cba057;color:#fff4cf;box-shadow:0 3px 8px #68236b2b,inset 0 1px 1px #eca8e755;border-radius:16px}.add-toggle{padding:14px}.primary:active{background:#49065f}.entry-form,.record,.report-table,.modal,.auth-card{background:linear-gradient(135deg,#fffdf8,#fff5e9);border:1px solid #ebd3b6;box-shadow:var(--royal-shadow)}.entry-form input,.entry-form select,.search,.auth-card input,.chat-input-row input{background:#fffdfa;color:#3e164d;border-color:#e5cdb8;min-height:44px}.field{color:#6f4b7c}.record .rec-head{gap:8px;align-items:flex-start}.record .rec-title{font-size:16px;overflow-wrap:anywhere}.record .rec-amount{white-space:nowrap}.record .rec-dist{background:#f3e3fa;color:#64167b;padding:6px 8px;border-radius:9px;margin:6px 0}.record .rec-meta{color:#745c7d}.small-btn,.ghost{background:linear-gradient(#fffdf7,#fff0dc);border-color:#e5cba9;color:#64147a;min-height:38px}.small-btn.danger{color:#a51c35}.report-row{gap:12px;line-height:1.6}.report-row .k{color:#705278}.report-row .v{white-space:nowrap}.report-row.highlight{background:linear-gradient(110deg,#f4dffa,#fff0cc)}.report-row.highlight .v{color:#561075}.item-row{background:#fffaf6;border-color:#ecd5bf}.form-hint{color:#705278;background:#fbefdf}.alert-card{background:#fff0cf;border-color:#e6be60;color:#7c4b02}.bottom-nav{background:radial-gradient(ellipse at 15% 0%,#8c1f9d,transparent 65%),linear-gradient(110deg,#5a0b74,#38054c);border-top:3px solid #e6ba5d;border-radius:40% 8% 0 0 / 14px 10px 0 0;box-shadow:0 -4px 12px #763b6820;padding:8px 3px calc(4px + env(safe-area-inset-bottom))}.nav-item{color:#f6e9f8;font-size:11px;padding:9px 1px;gap:5px;min-height:66px;border:1px solid transparent;border-radius:14px}.nav-item svg{width:25px;height:25px;stroke:#fff0b6;stroke-width:1.8;filter:drop-shadow(0 1px 1px #250331)}.nav-item.active{color:#ffdd81;background:linear-gradient(#92229f44,#31043f88);border-color:#d0a456;font-weight:800;box-shadow:inset 0 1px 5px #f3bff233}.nav-item.active svg{stroke:#ffda75;stroke-width:2.5}#assistantFab{background:radial-gradient(circle at 30% 10%,#b735bc,#6e0a86 55%,#3f0559);border:2px solid #e4b94b;box-shadow:0 3px 12px #57116e55;bottom:96px;width:54px;height:54px}#assistantFab svg{stroke:#ffe29b}#assistantPanel{background:#fff8ef;border:1px solid #d9af67}.chat-head{background:linear-gradient(#7a148e,#51076b);color:#fff2c7}.chat-head .icon-btn{color:#ffe19b}.chat-mode{background:#f7e9d9;color:#705278}.msg.bot{background:#f4e8f8;color:#421052}.msg.user{background:linear-gradient(#85209a,#5b0b75);color:#fff8e8}.auth-gate{background:radial-gradient(ellipse at top,#e8c5ef,#fff1dc 70%)}.auth-card .brand-name{color:#64137a}.linklike{color:#6d2185}.modal-backdrop{background:#24033588}
@media(max-width:350px){.stat-card{grid-template-columns:1fr 34px;padding:11px 8px;column-gap:5px}.metric-icon{width:34px;height:40px}.metric-icon svg{width:24px;height:24px}.stat-card .label{font-size:12px}.stat-card .value{font-size:23px}.nav-item{font-size:10px}.nav-item svg{width:22px;height:22px}}
@font-face{font-family:RoyalArabic;src:url('fonts/Tajawal-Regular.ttf') format('truetype');font-weight:400 500;font-display:swap}@font-face{font-family:RoyalArabic;src:url('fonts/Tajawal-Bold.ttf') format('truetype');font-weight:600 900;font-display:swap}body{font-family:RoyalArabic,Tajawal,sans-serif}.stat-card{grid-template-columns:minmax(0,1fr) 40px;column-gap:7px}.metric-icon{width:40px;height:44px}.stat-card .label{font-size:13px}.alltime-strip{padding-inline-end:14px}.report-row{scroll-margin-bottom:180px}button,input,select{font-family:inherit}.stat-card .value{font-size:28px}.auth-card .brand{gap:6px}
@media(max-width:350px){.stat-card{grid-template-columns:minmax(0,1fr) 30px;column-gap:5px}.metric-icon{width:30px;height:36px}.metric-icon svg{width:22px;height:22px}.stat-card .label{font-size:12px}.stat-card .value{font-size:23px}}
/* Assistant is kept in the header so it never hides a balance or report row. */
#assistantFab{position:static;flex:0 0 42px;width:42px;height:42px;margin-inline-start:8px;border-width:1px;display:flex;align-items:center;justify-content:center}.topbar .brand{margin-inline-end:auto}.topbar{gap:6px}.topbar .brand-sub{display:none}#backupBtn{order:2}#assistantFab{order:1}.topbar .brand{order:0}

/* Account controls: drawer, no overlay on balances. */
#menuBtn{order:-1;flex:0 0 40px;min-height:44px;color:#ffe29b;padding:6px;border:1px solid #d6aa66;border-radius:12px;background:#ffffff0c}.menu-backdrop{position:fixed;inset:0;z-index:70;background:#24033588;display:flex}.app-menu{width:min(340px,90vw);height:100%;padding:22px 20px;overflow-y:auto;background:linear-gradient(140deg,#fffcf6,#f5e5f7);box-shadow:-8px 0 28px #25033155;display:flex;flex-direction:column;gap:14px}.menu-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.menu-heading h2,#settingsTitle{font-size:21px;color:#5b1373;margin:0}.menu-heading button{font-size:23px;color:#6f147c;min-width:44px;min-height:44px}.app-menu .account-chip{position:static;background:#fffaf2;color:#5b1373;border:1px solid #dfbf90;border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:10px;overflow-wrap:anywhere}.app-menu p{line-height:1.7;margin:0}#accountEmail{font-size:15px;text-align:right;word-break:break-word}.app-menu button,#settingsModal button{min-height:46px;padding:10px 12px;font-size:16px}.menu-foot{font-size:13px;color:#795780;line-height:1.8;margin-top:auto}#settingsModal .modal{max-height:85dvh;overflow:auto}#menuLocalState{color:#785780}.topbar .brand-name{white-space:nowrap}@media(max-width:350px){.topbar .brand-name{font-size:30px}#assistantFab{margin-inline-start:0;width:38px;flex-basis:38px}.topbar{padding-inline:12px;gap:5px}}

.stock-out-shortcuts{display:flex;gap:10px;margin:12px 0;flex-wrap:wrap}.stock-out-shortcuts button{flex:1;min-width:120px;padding:10px;font-size:14px}.stock-out-shortcuts svg{width:22px;height:22px;vertical-align:middle;margin-inline-end:6px}#page-stockouts h2{font-size:24px;color:#64137a;margin:12px 0}.stockout-line{display:grid;grid-template-columns:minmax(0,1fr) 75px 40px;gap:8px;background:#fbefdf;padding:10px;border-radius:12px;margin:8px 0}.stockout-line select,.stockout-line input{min-width:0;width:100%}.stockout-line .line-info{grid-column:1/-1;font-size:13px;color:#705278;line-height:1.7}.out-value-row{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;line-height:1.8}.out-cancelled{opacity:.7;border-style:dashed}#stockOutHistory .record{overflow-wrap:anywhere}#stockOutForm{margin-block:14px}#stockOutTotals{margin:14px 0}#stockOutHistory .rec-meta{line-height:1.8}#partnerFilterLabel{margin-top:14px}#partnerFilter{width:100%;padding:10px;border:1px solid #dfc6af;border-radius:12px;background:#fffaf6}#stockOutLines .remove-out-line{min-height:44px;color:#9d2343}#stockOutHistory .small-btn{margin-top:8px}

.out-entry{display:flex;align-items:center;justify-content:center;font-weight:700}.out-chip{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:12px;margin-inline-end:8px;flex:0 0 36px}.out-chip svg{width:22px;height:22px;margin:0}
.out-entry-w{background:linear-gradient(#fffcf8,#f5e5fa);border:1px solid #d9b5e6;color:#45075f}.out-entry-w .out-chip{background:#661389;color:#fff}
.out-entry-g{background:linear-gradient(#fffcf8,#ffe6ec);border:1px solid #eab0c0;color:#7a1630}.out-entry-g .out-chip{background:#a3203f;color:#fff}
.partner-total-row{border-top:1px solid #ecd9c4;padding:8px 0}.partner-total-row:first-of-type{border-top:0}.pt-head{display:flex;justify-content:space-between;gap:12px;font-weight:700}#partnerTotals{margin:14px 0}
