:root{--afc-bg:#f5f7fb;--afc-card:#fff;--afc-soft:#f8fafc;--afc-border:#e2e8f0;--afc-border2:#cbd5e1;--afc-text:#0f172a;--afc-muted:#64748b;--afc-primary:#2563eb;--afc-primary2:#1d4ed8;--afc-green:#15803d;--afc-red:#be123c;--afc-shadow:0 8px 22px rgba(15,23,42,.045);--afc-radius:16px;--afc-font:'Vazirmatn','B Yekan','BYekan',Tahoma,IRANSans,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;--afc-fw-normal:400;--afc-fw-button:600;--afc-fw-heading:700}
body.font-vazirmatn{--afc-font:'Vazirmatn','B Yekan','BYekan',Tahoma,IRANSans,system-ui,sans-serif;--afc-fw-normal:400;--afc-fw-button:600;--afc-fw-heading:700}body.font-byekan{--afc-font:'B Yekan','BYekan','Vazirmatn',Tahoma,system-ui,sans-serif;--afc-fw-normal:400;--afc-fw-button:600;--afc-fw-heading:700}body.font-yekanbakh{--afc-font:'Yekan Bakh','YekanBakh','Vazirmatn',Tahoma,system-ui,sans-serif}body.font-iransans{--afc-font:'IRANSans','IranSans','Vazirmatn',Tahoma,system-ui,sans-serif}body.font-tahoma{--afc-font:Tahoma,Arial,sans-serif}
*{box-sizing:border-box}html,body{min-height:100%;direction:rtl;text-align:right}body{margin:0;background:var(--afc-bg);color:var(--afc-text);font-family:var(--afc-font)!important;font-weight:var(--afc-fw-normal);font-size:13px;line-height:1.7;-webkit-font-smoothing:antialiased}.app{display:flex;min-height:100vh}.sidebar{width:270px;background:#fff;border-left:1px solid var(--afc-border);padding:12px 10px;position:fixed;right:0;top:0;bottom:0;overflow:auto;box-shadow:-8px 0 26px rgba(15,23,42,.03);z-index:40;transition:.22s ease}.brand{display:flex;gap:9px;align-items:center;padding:7px 7px 12px;border-bottom:1px solid var(--afc-border);margin-bottom:8px}.brand-logo{width:38px;height:38px;border-radius:13px;display:grid;place-items:center;background:linear-gradient(135deg,#2563eb,#0f172a);color:#fff;font-weight:800;font-size:15px}.brand b{font-size:14px;display:block;line-height:1.45;font-weight:var(--afc-fw-heading)}.brand span{color:var(--afc-muted);font-size:11px}nav a{display:flex;align-items:center;gap:7px;color:#334155;text-decoration:none;padding:8px 9px;border-radius:11px;margin:2px 0;font-weight:var(--afc-fw-button);transition:.18s ease}nav a:hover,nav a.active{background:#eff6ff;color:#1d4ed8}nav a.danger-link{color:#be123c}.content{margin-right:270px;width:calc(100% - 270px);padding:14px 16px 30px;transition:.22s ease}.content.full{margin:0;width:100%;max-width:760px;margin:auto}.content>*,.topbar{max-width:1180px;margin-left:auto!important;margin-right:auto!important}.topbar{background:#fff;border:1px solid var(--afc-border);border-radius:16px;padding:10px 12px;display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;box-shadow:var(--afc-shadow)}.top-title{display:flex;gap:9px;align-items:center}.menu-toggle{width:36px;height:36px;border-radius:11px;background:#fff;color:#0f172a;border:1px solid var(--afc-border2);font-size:19px;display:grid;place-items:center;cursor:pointer}.topbar h1{margin:0;font-size:20px;font-weight:var(--afc-fw-heading);line-height:1.35}.topbar p{margin:0;color:var(--afc-muted);font-size:12px}.clock{text-align:center;line-height:1.55;color:#475569;background:#f8fafc;border:1px solid #e2e8f0;border-radius:13px;padding:5px 10px;min-width:170px}.clock b{display:block;font-size:12px;color:#111827;font-weight:var(--afc-fw-button);letter-spacing:.2px}.sidebar-collapsed .sidebar{transform:translateX(284px)}.sidebar-collapsed .content{margin-right:0;width:100%}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px}.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.card,.box{background:var(--afc-card);border:1px solid var(--afc-border);border-radius:var(--afc-radius);padding:13px 15px;margin-bottom:16px;box-shadow:var(--afc-shadow)}.card h1,.card h2,.card h3{margin-top:0;font-weight:var(--afc-fw-heading);line-height:1.4}.card h2{font-size:17px;margin-bottom:10px}.card h3{font-size:15px}.stat{padding:14px 15px;border-radius:18px;background:linear-gradient(180deg,#fff,#fbfdff);border:1px solid var(--afc-border);box-shadow:var(--afc-shadow);position:relative;overflow:hidden}.stat:before{content:"";position:absolute;inset:auto auto -18px -18px;width:64px;height:64px;border-radius:50%;background:#eff6ff}.stat small{color:var(--afc-muted);font-weight:var(--afc-fw-button)}.stat b{display:block;font-size:24px;margin-top:4px;font-weight:var(--afc-fw-heading)}.quick{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.quick a{padding:12px 11px;text-align:center;background:#fff;border:1px solid var(--afc-border);color:#0f172a;text-decoration:none;border-radius:14px;font-weight:var(--afc-fw-button);box-shadow:0 5px 14px rgba(15,23,42,.035);transition:.18s ease}.quick a:hover{transform:translateY(-1px);border-color:#93c5fd;color:#1d4ed8}.btn,button{background:var(--afc-primary);color:#fff;border:1px solid var(--afc-primary2);border-radius:10px;padding:8px 12px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;cursor:pointer;font-family:inherit!important;font-weight:var(--afc-fw-button);font-size:12.5px;line-height:1.3;min-height:36px}.btn:hover,button:hover{background:var(--afc-primary2)}.secondary{background:#fff!important;color:#0f172a!important;border-color:var(--afc-border2)!important}.danger{background:var(--afc-red)!important;border-color:var(--afc-red)!important}.success{background:var(--afc-green)!important;border-color:var(--afc-green)!important}.pill{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:4px 9px;font-size:11.5px;font-weight:var(--afc-fw-button);background:#eef2ff;color:#3730a3}label{display:block;margin:7px 0 5px;color:#334155;font-size:12.5px;font-weight:var(--afc-fw-button)}input,select,textarea{width:100%;border:1px solid var(--afc-border2);border-radius:10px;padding:8px 10px;background:#fff;font-family:inherit!important;min-height:38px;font-size:13px;direction:rtl;text-align:right}input[dir=ltr],.ltr{direction:ltr!important;text-align:left!important}textarea{min-height:72px}.row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.row4{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap}form .actions,form button{margin-top:10px}table{width:100%;border-collapse:separate;border-spacing:0;background:#fff;border:1px solid var(--afc-border);border-radius:14px;overflow:hidden}th,td{padding:8px 9px;border-bottom:1px solid #eef2f7;text-align:right;font-size:12.5px;vertical-align:middle}tr:last-child td{border-bottom:0}th{color:#334155;background:#f8fafc;font-weight:var(--afc-fw-heading)}.table-wrap{overflow:auto}.flash{background:#ecfdf5;border:1px solid #a7f3d0;color:#166534;padding:10px 12px;border-radius:12px;margin-bottom:12px;font-weight:var(--afc-fw-button)}.error{background:#fff1f2;border:1px solid #fecdd3;color:#be123c;padding:10px 12px;border-radius:12px;margin-bottom:12px;font-weight:var(--afc-fw-button)}.muted{color:var(--afc-muted)}.collapse{display:none;background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:12px;margin:7px 0}.collapse.open{display:block}.print-doc{background:#fff;padding:22px;color:#111}.doc-head{display:flex;justify-content:space-between;border-bottom:2px solid #111;padding-bottom:10px;margin-bottom:16px}.mini-note{font-size:11.5px;color:#64748b;margin-top:5px}.tabs{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:12px}.tabs a{padding:8px 12px;background:#fff;border:1px solid var(--afc-border);border-radius:11px;text-decoration:none;color:#334155;font-weight:var(--afc-fw-button)}.tabs a.active{background:#1d4ed8;color:#fff}.oc-like-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.oc-like-title h2{margin:0;font-size:18px;font-weight:var(--afc-fw-heading)}.site-card{border:1px solid #e2e8f0;border-radius:14px;padding:12px;background:#fff;margin-bottom:10px}.conn-grid{display:grid;grid-template-columns:1fr .9fr 1fr .85fr;gap:10px;align-items:start}.preview-row{display:grid;grid-template-columns:34px 1fr 130px 110px 110px 110px;gap:8px;align-items:center;border-bottom:1px solid #eef2f7;padding:8px 0}.preview-row.header{font-weight:var(--afc-fw-heading);color:#334155;background:#f8fafc;border-radius:10px;padding:8px}.price-type-item{display:grid;grid-template-columns:1fr 1fr 90px;gap:8px;align-items:end;margin-bottom:8px}
@media(max-width:1000px){.grid,.quick,.grid3,.row4,.conn-grid{grid-template-columns:1fr 1fr}.row{grid-template-columns:1fr}.sidebar{transform:translateX(250px)}.content{margin-right:0;width:100%}.sidebar-open .sidebar{transform:translateX(0)}.clock{display:none}.content>*{max-width:100%}}
@media(max-width:620px){.grid,.quick,.grid3,.row4,.conn-grid,.preview-row{grid-template-columns:1fr}.content{padding:10px}.topbar h1{font-size:17px}.card{padding:13px}.quick a{padding:11px}.topbar{border-radius:14px}}
@media print{.sidebar,.topbar,.no-print,.tabs{display:none!important}.content{margin:0;width:100%;padding:0}.card{box-shadow:none;border:0}.print-doc{padding:0}body{background:#fff}}

.oc-card-list{display:grid;gap:10px}.oc-connection-card{background:#fff;border:1px solid var(--afc-border);border-radius:14px;padding:12px;box-shadow:var(--afc-shadow)}.oc-connection-grid{display:grid;grid-template-columns:1.1fr 1.1fr .8fr .8fr 1fr;gap:10px;align-items:center}.status-ok{color:#15803d;font-weight:700}.status-bad{color:#be123c;font-weight:700}.variant-toolbar{display:flex;gap:8px;align-items:end;flex-wrap:wrap;margin:8px 0 12px}.variant-toolbar>*{min-width:160px;flex:1}.compact-table input,.compact-table select{min-height:34px;padding:6px 8px}.settings-row{display:grid;grid-template-columns:1fr 1fr 72px;gap:10px;align-items:end;border:1px solid #eef2f7;border-radius:12px;padding:10px;margin-bottom:8px;background:#fff}.preview-meta{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:8px 0 12px}.count-badge{background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe;border-radius:999px;padding:4px 10px;font-weight:700;font-size:12px}
@media(max-width:900px){.oc-connection-grid,.settings-row{grid-template-columns:1fr}}

/* AFC v0.7 - connection cards aligned with Order Center */
.connections-card-wrap{padding:16px 16px 14px}.afc-connections-list{display:grid;gap:12px}.afc-connection-card{background:#fff;border:1px solid var(--afc-border);border-radius:14px;padding:14px;box-shadow:none}.afc-connection-grid{display:grid;grid-template-columns:1.2fr 1.15fr 1.2fr .75fr .85fr 1.15fr;gap:12px;align-items:start}.afc-connection-card label{margin:0 0 6px;color:#334155;font-size:12px;font-weight:700}.conn-value{min-height:38px;display:flex;align-items:center;border:1px solid var(--afc-border);background:#fff;border-radius:10px;padding:8px 10px;color:#0f172a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conn-value.strong{font-weight:700}.api-key-box{font-size:12px}.conn-status{min-height:38px;display:flex;align-items:center;font-weight:800}.conn-status.ok{color:#166534}.conn-status.bad{color:#b91c1c}.conn-actions{display:flex;gap:8px;flex-wrap:wrap;margin:0}.conn-actions .btn,.conn-actions button{margin:0;min-height:38px;white-space:nowrap}.connections-card-wrap h2{margin-bottom:14px}
@media(max-width:1180px){.afc-connection-grid{grid-template-columns:1fr 1fr 1fr}.conn-actions{grid-column:1/-1}}@media(max-width:740px){.afc-connection-grid{grid-template-columns:1fr}.conn-actions{grid-column:auto}.conn-actions .btn,.conn-actions button{width:100%}}


.oc-connection-stack{display:flex;flex-direction:column;gap:14px;margin-top:14px}.oc-connection-card{background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:16px;box-shadow:var(--shadow-sm)}.oc-conn-grid{display:grid;grid-template-columns:1fr 1.25fr 1.15fr .75fr .85fr 1.05fr;gap:12px;align-items:start}.oc-conn-actions{display:flex;gap:8px;flex-wrap:wrap;padding-top:2px}.oc-conn-status{font-size:13px}.ok{color:#15803d}.bad{color:#b91c1c}.connection-add-row{justify-content:flex-start;margin-top:14px}@media(max-width:1100px){.oc-conn-grid{grid-template-columns:1fr 1fr}}@media(max-width:720px){.oc-conn-grid{grid-template-columns:1fr}}

/* AFC v0.9 - Order Center exact-style connection cards */
.afc-oc-connections{display:flex;flex-direction:column;gap:12px;margin-top:12px}.afc-oc-connection-card{background:#fff;border:1px solid #dbe3ee;border-radius:18px;padding:14px 16px;box-shadow:0 8px 22px rgba(15,23,42,.035)}.afc-oc-connection-form{margin:0}.afc-oc-conn-row{display:grid;grid-template-columns:1.1fr 1.35fr 1.1fr .75fr .9fr 1.3fr;gap:11px;align-items:start}.afc-oc-field label,.afc-oc-status-box label,.afc-oc-actions label{font-size:12px;font-weight:800;color:#334155;margin:0 0 6px}.afc-oc-connection-card input,.afc-oc-connection-card select{min-height:38px;border-radius:12px;background:#fff}.afc-oc-status-box .status-line{min-height:38px;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc;padding:7px 10px;display:flex;flex-direction:column;justify-content:center;gap:2px}.afc-oc-status-box b{font-size:13px}.afc-oc-status-box small{font-size:11px;color:#64748b;line-height:1.35}.afc-oc-status-box small.status-bad{color:#be123c}.afc-oc-actions .actions-inline{display:flex;gap:7px;flex-wrap:wrap}.afc-oc-actions button,.afc-oc-actions .btn{min-height:38px;margin:0;padding:8px 10px;border-radius:11px;font-size:12px}.connection-add-row{margin-top:14px}.connection-add-row .btn{min-width:140px}.oc-like-title{margin-bottom:10px}.preview-row{grid-template-columns:54px 1fr 120px 120px 120px 90px}.preview-row input[type=checkbox]{width:auto;min-height:0}.count-badge{display:inline-flex;align-items:center}
@media(max-width:1180px){.afc-oc-conn-row{grid-template-columns:1fr 1fr}.afc-oc-actions{grid-column:1/-1}.afc-oc-actions .actions-inline{justify-content:flex-start}}@media(max-width:720px){.afc-oc-conn-row,.preview-row{grid-template-columns:1fr}.afc-oc-actions .actions-inline>*{width:100%}}

/* AFC v0.10 - connection actions exactly like Order Center flow */
.afc-connections-master-form{margin:0}
.afc-oc-connections{gap:10px;margin-top:12px;margin-bottom:12px}
.afc-oc-connection-card{background:#fff;border:1px solid #d7e0ec;border-radius:18px;padding:13px 14px;box-shadow:0 6px 16px rgba(15,23,42,.03)}
.afc-oc-exact-row{grid-template-columns:1.08fr 1.25fr 1.05fr .72fr .82fr 1.05fr;gap:10px;align-items:start}
.afc-oc-actions .actions-inline{display:flex;gap:7px;flex-wrap:wrap;align-items:center}
.afc-oc-actions .actions-inline button{white-space:nowrap;min-width:auto}
.afc-oc-actions .danger-soft{color:#b91c1c!important;border-color:#fecaca!important;background:#fff!important}
.afc-oc-status-box .status-line{background:#fff;min-height:38px}
.oc-bottom-actions{display:flex;gap:8px;align-items:center;justify-content:flex-start;margin-top:12px;padding-top:0}
.oc-bottom-actions .btn,.oc-bottom-actions button{margin-top:0}
.add-connection-panel{margin-top:12px}
.empty-connection-card{margin-bottom:0}
@media(max-width:1200px){.afc-oc-exact-row{grid-template-columns:1fr 1fr 1fr}.afc-oc-actions{grid-column:1/-1}.afc-oc-actions .actions-inline{justify-content:flex-start}}
@media(max-width:760px){.afc-oc-exact-row{grid-template-columns:1fr}.afc-oc-actions{grid-column:auto}.afc-oc-actions .actions-inline button{width:100%}.oc-bottom-actions{flex-direction:column;align-items:stretch}.oc-bottom-actions .btn,.oc-bottom-actions button{width:100%}}

/* OC-style footer credit */
.credit{margin-top:20px;text-align:center;font-size:10px;color:#bbb;letter-spacing:1px;opacity:.8;font-family:var(--afc-font)!important;font-weight:var(--afc-fw-normal)!important;line-height:1.6}.credit:hover{opacity:1}
.content>.credit{margin-bottom:6px}


/* AFC v0.12 fixes */
.afc-oc-actions .actions-inline{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;gap:8px!important;align-items:center!important;white-space:nowrap!important;}
.afc-oc-actions .actions-inline button{width:auto!important;min-width:78px!important;margin:0!important;}
.afc-oc-actions{min-width:300px!important;}
.afc-oc-status-box small{display:block;margin-top:4px;font-size:11px;color:#64748b;white-space:nowrap;direction:rtl;}
.preview-row{grid-template-columns:80px 1.8fr 150px 150px 110px 110px!important;align-items:center;}
.import-preview-row .ltr{direction:ltr;text-align:left;}
.credit{margin-top:20px!important;text-align:center!important;font-size:10px!important;color:#bbb!important;letter-spacing:1px!important;opacity:.8!important;transition:opacity .2s ease!important;}
.credit:hover{opacity:1!important;}


/* AFC v0.14 mobile/sidebar and compact module fixes */
.sidebar-backdrop{display:none}
.sidebar-open .sidebar-backdrop{display:block;position:fixed;inset:0;background:rgba(15,23,42,.38);z-index:35}
.sidebar-open .sidebar{z-index:45}
.stock-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:nowrap}
.stock-head h2{margin:0;white-space:nowrap}
.stock-head .actions{flex-wrap:nowrap}
.stock-head .btn{white-space:nowrap}
.sale-manual-price{display:none}
.sale-manual-price.open{display:block}
.inline-help{font-size:11.5px;color:var(--afc-muted);margin-top:4px}
@media(max-width:740px){
  body.sidebar-open{overflow:hidden}
  .sidebar{width:78vw;max-width:310px;transform:translateX(100%)}
  .sidebar-open .sidebar{transform:translateX(0)}
  .sidebar-collapsed .sidebar{transform:translateX(100%)}
  .stock-head{align-items:flex-start}
  .stock-head .actions{flex-direction:column;align-items:stretch}
  .stock-head .actions .btn{min-width:128px}
}


.table-wrap{width:100%;overflow:auto;-webkit-overflow-scrolling:touch}
table{min-width:720px}
@media(max-width:740px){
 table{font-size:13px}
 .card{overflow:hidden}
}

#pos-live-box.success{border-color:#16a34a;background:#dcfce7;color:#166534}#pos-live-box.error{border-color:#ef4444;background:#fee2e2;color:#991b1b}

.dashboard-hero{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px}.dashboard-hero h1{margin:0 0 6px}.dashboard-hero p{margin:0;color:var(--afc-muted)}
.stats-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:16px}.stat-card{background:#fff;border:1px solid #e2e8f0;border-radius:18px;padding:16px;box-shadow:0 10px 28px rgba(15,23,42,.05)}.stat-card span,.stat-card small{display:block;color:var(--afc-muted)}.stat-card b{display:block;font-size:22px;margin:8px 0}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px}.badge{display:inline-block;padding:3px 9px;border-radius:999px;background:#e2e8f0}.badge.ok{background:#dcfce7;color:#166534}.badge.bad{background:#fee2e2;color:#991b1b}.badge.warn{background:#fef3c7;color:#92400e}
.quick-actions{display:flex;gap:8px;flex-wrap:wrap}.quick-actions a{background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;padding:10px 14px;text-decoration:none}.pos-shell{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(320px,.8fr);gap:16px}.product-list{display:grid;grid-template-columns:1fr;gap:8px;max-height:70vh;overflow:auto}.product-tile{text-align:right;background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:10px;cursor:pointer}.product-tile span,.product-tile small{display:block}.cart-row{display:grid;grid-template-columns:1fr 70px 120px 44px;gap:8px;align-items:center;border-bottom:1px solid #e2e8f0;padding:8px 0}.cart-title{font-weight:700}.pos-total{font-size:20px;margin:16px 0;text-align:left}
@media(max-width:900px){.stats-grid{grid-template-columns:1fr 1fr}.grid2,.pos-shell{grid-template-columns:1fr}.dashboard-hero{display:block}.cart-row{grid-template-columns:1fr 64px 100px 40px}}

.code-box{background:#0f172a;color:#fff;padding:14px;border-radius:12px;direction:ltr;overflow:auto}

/* v0.29 dashboard/layout fixes */
.table-wrap{width:100%;overflow-x:auto}
.dashboard-hero.compact{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.dashboard-hero.compact h1{margin:0 0 6px;font-size:28px}
.dashboard-hero.compact p{margin:0;color:#64748b}
.stats-grid.compact{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:12px;margin:12px 0 16px}
.stat-card{min-width:0}
.grid2.dashboard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:16px}
.dashboard-grid .card{min-width:0}
.badge{white-space:nowrap}
@media(max-width:1100px){.stats-grid.compact{grid-template-columns:repeat(2,minmax(0,1fr))}.grid2.dashboard-grid{grid-template-columns:1fr}.dashboard-hero.compact{display:block}.dashboard-hero.compact .actions{margin-top:12px}}
@media(max-width:620px){.stats-grid.compact{grid-template-columns:1fr}.dashboard-hero.compact h1{font-size:22px}}


/* AFC v0.32 fixes */
.product-tile{color:#0f172a!important;background:#fff!important;border-color:#dbe3ee!important;display:block;width:100%;min-height:54px;margin:0;text-align:right!important}
.product-tile b,.product-tile span,.product-tile small{color:#0f172a!important}
.product-tile small{color:#64748b!important}
.pos-main .actions{align-items:center!important}
.pos-main .actions .btn,.pos-main .actions button{margin-top:0!important}
.sale-row-actions{display:flex!important;flex-wrap:nowrap!important;gap:6px!important;align-items:center!important}
.sale-row-actions form{margin:0!important;display:inline-flex!important}
.sale-row-actions .btn,.sale-row-actions button{margin:0!important;white-space:nowrap;padding:7px 10px}
.sidebar-backdrop{cursor:pointer}
@media(max-width:740px){.menu-toggle{background:#2563eb;color:#fff;border-color:#1d4ed8}.sale-row-actions{min-width:190px}.sale-row-actions .btn,.sale-row-actions button{padding:6px 8px;font-size:11.5px}.product-list{max-height:48vh}.pos-main .actions{display:grid;grid-template-columns:1fr 1fr}.pos-main .actions>*{width:100%}}

/* AFC v0.33 Persian payment/POS statuses */
.badge.neutral{background:#e5e7eb;color:#374151}
.badge.ok{background:#dcfce7!important;color:#166534!important}
.badge.warn{background:#fef3c7!important;color:#92400e!important}
.badge.bad{background:#fee2e2!important;color:#991b1b!important}
.badge.info{background:#dbeafe!important;color:#1d4ed8!important}.badge.done{background:#dcfce7!important;color:#047857!important}.badge.complete{background:#ccfbf1!important;color:#0f766e!important}
.sale-payment-status .badge,.sale-pos-status .badge{font-weight:800}
button[disabled]{opacity:.65;cursor:not-allowed}
/* AFC v0.34 inventory workflow */
.ajax-result-list{display:grid;gap:6px;margin-top:6px;position:relative;z-index:5}.ajax-result-list a,.ajax-result-list button{display:flex!important;flex-direction:column;align-items:flex-start!important;gap:2px;text-align:right;width:100%;background:#fff!important;color:#0f172a!important;border:1px solid #dbe3ee!important;border-radius:12px;padding:9px 10px;text-decoration:none;min-height:auto}.ajax-result-list a:hover,.ajax-result-list button:hover{border-color:#93c5fd!important;background:#eff6ff!important}.ajax-result-list small{color:#64748b}.transfer-picker{margin:12px 0}.status-in_transit{background:#fef3c7;color:#92400e}.status-received{background:#dcfce7;color:#166534}.status-canceled{background:#f1f5f9;color:#475569}.status-draft{background:#eef2ff;color:#3730a3}
@media(max-width:740px){.stock-head{flex-direction:column;align-items:stretch}.stock-head .actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.stock-head .actions .btn{width:100%}.row4{grid-template-columns:1fr}.row{grid-template-columns:1fr}}

/* v0.35 موجودی: ردیف بازشونده و خوانایی بهتر */
.stock-master-row{cursor:pointer}
.stock-master-row:hover{background:#f8fbff}
.stock-expand-btn{min-width:34px;width:34px;padding:6px!important}
.stock-expand-btn.open{background:#eff6ff!important;color:#1d4ed8!important;border-color:#93c5fd!important}
.stock-detail-box{margin:0 8px 10px;background:#fbfdff}
.stock-detail-row td{background:#fff}
.stock-products-table th,.stock-products-table td{white-space:nowrap}
.permission-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.permission-card{border:1px solid #e2e8f0;border-radius:14px;padding:12px;background:#fff}
.permission-card h3{margin:0 0 8px}
.check-line{display:flex;align-items:center;gap:8px;margin:6px 0}.check-line input{width:auto;min-height:unset}
.health-ok{background:#ecfdf5;color:#166534}.health-warn{background:#fffbeb;color:#92400e}.health-bad{background:#fff1f2;color:#be123c}
@media(max-width:760px){.permission-grid{grid-template-columns:1fr}.stock-products-table th,.stock-products-table td{font-size:12px}}
.check-chip{display:inline-flex;gap:6px;align-items:center;border:1px solid #e2e8f0;border-radius:999px;padding:7px 12px;background:#fff;color:#0f172a;font-size:13px}
.check-chip input{width:auto;min-height:auto;margin:0}
.transfer-alert{border-color:#f59e0b;background:linear-gradient(180deg,#fff7ed,#fff)}
.transfer-alert h2{color:#92400e}

/* AFC v0.37 inventory modal, desktop menu, online signal */
.modal{display:none;position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:100;align-items:center;justify-content:center;padding:18px}
.modal.open{display:flex}.modal-open{overflow:hidden}.modal-card{background:#fff;border:1px solid #e2e8f0;border-radius:20px;box-shadow:0 28px 70px rgba(15,23,42,.25);padding:16px;max-height:92vh;overflow:auto;width:min(720px,96vw)}.modal-card.wide{width:min(1100px,96vw)}.modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.modal-head h2{margin:0;font-size:18px}.modal-card input[type=number]{min-width:80px}
.topbar-left{display:flex;align-items:center;gap:10px}.online-status{display:inline-flex;align-items:center;gap:8px;border:1px solid #e2e8f0;border-radius:999px;background:#f8fafc;padding:6px 10px;font-size:12px;font-weight:800;white-space:nowrap}.online-status b{font-size:12px}.signal-bars{display:inline-flex;gap:2px;align-items:flex-end;height:15px;direction:ltr}.signal-bars i{display:block;width:4px;border-radius:4px;background:#94a3b8}.signal-bars i:nth-child(1){height:5px}.signal-bars i:nth-child(2){height:9px}.signal-bars i:nth-child(3){height:13px}.status-online{background:#ecfdf5;border-color:#a7f3d0;color:#166534}.status-online .signal-bars i{background:#16a34a}.status-mid{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}.status-mid .signal-bars i:nth-child(1),.status-mid .signal-bars i:nth-child(2){background:#2563eb}.status-mid .signal-bars i:nth-child(3){background:#cbd5e1}.status-weak{background:#fffbeb;border-color:#fde68a;color:#92400e}.status-weak .signal-bars i:nth-child(1){background:#f59e0b}.status-weak .signal-bars i:nth-child(2),.status-weak .signal-bars i:nth-child(3){background:#e2e8f0}.status-offline{background:#fff1f2;border-color:#fecdd3;color:#be123c}.status-offline .signal-bars i{background:#ef4444}.status-checking{color:#64748b}
@media(min-width:1001px){.sidebar-collapsed .sidebar{transform:translateX(284px)!important}.sidebar-collapsed .content{margin-right:0!important;width:100%!important}.sidebar-collapsed .sidebar-backdrop{display:none!important}}
@media(max-width:1000px){.topbar-left{gap:6px}.online-status b{display:none}.online-status{padding:7px}.clock{display:none!important}}
@media(max-width:760px){.modal{padding:8px}.modal-card{width:98vw;padding:12px}.modal-head h2{font-size:15px}.topbar-left{margin-right:auto}}

/* AFC v0.38 - inventory modal fix + connection status fallback */
.stock-products-table tr.stock-master-row td{vertical-align:middle}.inventory-detail-modal{max-width:1180px}.inventory-summary-row{display:grid;grid-template-columns:repeat(3,minmax(120px,1fr));gap:10px;margin:10px 0 14px}.inventory-summary-row>div{border:1px solid #e2e8f0;border-radius:14px;background:#f8fafc;padding:10px 12px}.inventory-summary-row span{display:block;color:#64748b;font-size:12px;margin-bottom:4px}.inventory-summary-row b{font-size:22px;color:#0f172a}.inventory-detail-table{max-height:58vh;overflow:auto}.inventory-detail-table input{min-width:80px}.modal.open{display:flex}.status-checking{background:#f8fafc;border-color:#e2e8f0;color:#475569}.status-checking .signal-bars i{animation:afcSignalPulse 1s infinite ease-in-out;background:#94a3b8}.status-checking .signal-bars i:nth-child(2){animation-delay:.12s}.status-checking .signal-bars i:nth-child(3){animation-delay:.24s}@keyframes afcSignalPulse{0%,100%{opacity:.35}50%{opacity:1}}@media(max-width:700px){.inventory-summary-row{grid-template-columns:1fr}.inventory-detail-modal{width:96vw}.inventory-detail-table{max-height:60vh}}
/* AFC v0.39 stock expand + network fixes */
.stock-expand-row{display:none;background:#f8fafc}.stock-expand-row.open{display:table-row}.stock-expand-row>td{padding:0!important;border-top:0!important}.stock-expand-box{margin:0 10px 12px;border:1px solid #e2e8f0;border-radius:14px;background:#fff;padding:12px}.stock-expand-box h3{margin:0 0 10px;font-size:15px}.stock-expand-table th,.stock-expand-table td{white-space:nowrap}.stock-expand-btn{min-width:38px;padding:6px 8px}.stock-expand-btn.open{background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe}.topbar-left .online-status{min-width:116px;justify-content:center}.status-checking b:after{content:'…';animation:afcDots 1.2s infinite}@keyframes afcDots{0%{opacity:.25}50%{opacity:1}100%{opacity:.25}}
@media(max-width:700px){.stock-expand-box{margin:0 0 10px;padding:10px}.stock-expand-table{font-size:12px}.stock-expand-btn{min-width:34px}}


/* AFC v0.40 - unified professional modal system */
html.afc-modal-lock, body.afc-modal-lock, body.modal-open{overflow:hidden!important; height:100%;}
.modal,
.afc-modal{
  display:none!important;
  position:fixed!important;
  inset:0!important;
  z-index:9999!important;
  padding:24px!important;
  background:rgba(15,23,42,.42)!important;
  backdrop-filter:blur(4px)!important;
  -webkit-backdrop-filter:blur(4px)!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
}
.modal.open,
.afc-modal.open{display:flex!important;}
.afc-modal-backdrop{position:absolute!important;inset:0!important;background:transparent!important;}
.modal-card,
.afc-modal-panel{
  position:relative!important;
  width:min(980px,calc(100vw - 48px))!important;
  max-height:calc(100vh - 48px)!important;
  margin:0!important;
  background:#fff!important;
  border:1px solid rgba(226,232,240,.95)!important;
  border-radius:24px!important;
  box-shadow:0 30px 90px rgba(15,23,42,.32)!important;
  overflow:hidden!important;
  padding:0!important;
  display:flex!important;
  flex-direction:column!important;
}
.modal-card.wide,
.afc-modal-panel.wide{width:min(1180px,calc(100vw - 48px))!important;}
.afc-modal-panel.small{width:min(720px,calc(100vw - 48px))!important;}
.modal-head,
.afc-modal-head{
  flex:0 0 auto!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  padding:16px 18px!important;
  margin:0!important;
  border-bottom:1px solid #e2e8f0!important;
  background:#fff!important;
  position:sticky!important;
  top:0!important;
  z-index:2!important;
}
.modal-head h2,
.afc-modal-head h2{margin:0!important;font-size:18px!important;color:#0f172a!important;}
.modal-card > :not(.modal-head),
.afc-modal-panel > :not(.afc-modal-head){padding:16px 18px;}
.modal-card form{overflow:auto!important;}
.modal-card .table-wrap,
.modal-card .inventory-detail-table{max-height:52vh!important;overflow:auto!important;border-radius:14px;}
.inventory-detail-modal{width:min(1180px,calc(100vw - 48px))!important;}
.inventory-summary-row{padding:0!important;margin:0 0 14px!important;}
.modal-card .actions,
.afc-modal-panel .actions{position:sticky;bottom:0;background:#fff;border-top:1px solid #e2e8f0;margin:12px -18px -16px!important;padding:12px 18px!important;z-index:2;}
@media(max-width:760px){
  .modal,.afc-modal{padding:0!important;align-items:stretch!important;justify-content:stretch!important;}
  .modal-card,.modal-card.wide,.inventory-detail-modal,.afc-modal-panel,.afc-modal-panel.small,.afc-modal-panel.wide{
    width:100vw!important;max-width:100vw!important;height:100vh!important;max-height:100vh!important;border-radius:0!important;
  }
  .modal-head,.afc-modal-head{padding:14px!important;}
  .modal-card > :not(.modal-head),.afc-modal-panel > :not(.afc-modal-head){padding:14px!important;}
  .modal-card .table-wrap,.modal-card .inventory-detail-table{max-height:60vh!important;}
}


/* AFC v0.41 - clean modal system without dark/blur backdrop, independent from sidebar */
html.afc-modal-lock, body.afc-modal-lock, body.modal-open{overflow:hidden!important; height:auto!important;}
.modal,.afc-modal{
  display:none!important;
  position:fixed!important;
  top:0!important;right:0!important;bottom:0!important;left:0!important;
  width:100vw!important;max-width:none!important;height:100vh!important;max-height:none!important;
  margin:0!important;padding:22px!important;
  z-index:99999!important;
  background:transparent!important;
  backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
  align-items:center!important;justify-content:center!important;
  overflow:hidden!important;
}
.modal.open,.afc-modal.open{display:flex!important;}
.afc-modal-backdrop{position:absolute!important;inset:0!important;background:transparent!important;backdrop-filter:none!important;}
.modal-card,.afc-modal-panel{
  position:relative!important;
  margin:0 auto!important;
  width:min(1000px,calc(100vw - 44px))!important;
  max-width:calc(100vw - 44px)!important;
  max-height:calc(100vh - 44px)!important;
  background:#fff!important;
  border:1px solid #dbe3ee!important;
  border-radius:22px!important;
  box-shadow:0 18px 55px rgba(15,23,42,.20)!important;
  overflow:hidden!important;
  padding:0!important;
  display:flex!important;flex-direction:column!important;
}
.modal-card.wide,.inventory-detail-modal,.afc-modal-panel.wide{width:min(1180px,calc(100vw - 44px))!important;}
.afc-modal-panel.small{width:min(720px,calc(100vw - 44px))!important;}
.modal-head,.afc-modal-head{flex:0 0 auto!important;background:#fff!important;border-bottom:1px solid #e2e8f0!important;padding:14px 16px!important;margin:0!important;position:sticky!important;top:0!important;z-index:2!important;}
.modal-card > :not(.modal-head),.afc-modal-panel > :not(.afc-modal-head){padding:14px 16px!important;overflow:auto!important;}
.modal-card form,.afc-modal-panel form{overflow:auto!important;}
.modal-card .table-wrap,.modal-card .inventory-detail-table{max-height:54vh!important;overflow:auto!important;border-radius:14px;}
.modal-card .actions,.afc-modal-panel .actions{position:sticky;bottom:0;background:#fff;border-top:1px solid #e2e8f0;margin:12px -16px -14px!important;padding:12px 16px!important;z-index:3;}
@media(max-width:760px){
  .modal,.afc-modal{padding:0!important;align-items:stretch!important;justify-content:stretch!important;}
  .modal-card,.modal-card.wide,.inventory-detail-modal,.afc-modal-panel,.afc-modal-panel.small,.afc-modal-panel.wide{width:100vw!important;max-width:100vw!important;height:100vh!important;max-height:100vh!important;border-radius:0!important;}
  .modal-card > :not(.modal-head),.afc-modal-panel > :not(.afc-modal-head){padding:14px!important;}
}

/* AFC v0.42 - modal scroll cleanup: one clean vertical scroll inside modal body */
html.afc-modal-lock, body.afc-modal-lock, body.modal-open{
  overflow:hidden!important;
  height:100%!important;
}
.modal,.afc-modal{
  overflow:hidden!important;
  padding:24px!important;
  background:rgba(15,23,42,.08)!important;
}
.modal-card,.afc-modal-panel{
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  max-height:calc(100dvh - 48px)!important;
  min-height:0!important;
}
.modal-head,.afc-modal-head{
  flex:0 0 auto!important;
  position:relative!important;
  top:auto!important;
}
.modal-card > :not(.modal-head),
.afc-modal-panel > :not(.afc-modal-head){
  overflow:visible!important;
}
.modal-card > form,
.afc-modal-panel > form,
.modal-card > .modal-body,
.afc-modal-panel > .modal-body{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:16px 18px!important;
  scrollbar-gutter:stable!important;
}
.modal-card .table-wrap,
.modal-card .inventory-detail-table,
.afc-modal-panel .table-wrap{
  max-height:none!important;
  overflow-y:visible!important;
  overflow-x:auto!important;
  border-radius:14px!important;
}
.inventory-detail-table table,
.modal-card .table-wrap table{
  width:100%!important;
  min-width:760px!important;
}
.inventory-detail-modal .inventory-summary-row{
  flex:0 0 auto!important;
}
.modal-card .actions,
.afc-modal-panel .actions{
  position:sticky!important;
  bottom:0!important;
  background:#fff!important;
  border-top:1px solid #e2e8f0!important;
  z-index:5!important;
}
@media(max-width:760px){
  .modal,.afc-modal{padding:0!important;background:#fff!important;}
  .modal-card,.modal-card.wide,.inventory-detail-modal,.afc-modal-panel,.afc-modal-panel.small,.afc-modal-panel.wide{
    width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important;
  }
  .modal-card > form,.afc-modal-panel > form,.modal-card > .modal-body,.afc-modal-panel > .modal-body{padding:14px!important;}
  .inventory-detail-table table,.modal-card .table-wrap table{min-width:720px!important;}
}

/* AFC v0.43 - modal usable scroll + mobile clock restore */
.modal.open,.afc-modal.open{
  display:flex!important;
  overflow:hidden!important;
}
.modal-card,.afc-modal-panel{
  max-height:calc(100dvh - 48px)!important;
  min-height:0!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
}
.modal-head,.afc-modal-head{
  flex:0 0 auto!important;
}
/* Default modal content: one vertical scroll area */
.modal-card > form,
.afc-modal-panel > form,
.modal-card > .modal-body,
.afc-modal-panel > .modal-body{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:16px 18px!important;
  scrollbar-gutter:stable!important;
}
/* Inventory detail modal has summary above the form; keep summary fixed and scroll the form cleanly */
.inventory-detail-modal .inventory-summary-row,
.inventory-detail-modal > p.muted{
  flex:0 0 auto!important;
  margin-left:18px!important;
  margin-right:18px!important;
}
.inventory-detail-modal > p.muted{margin-top:0!important;margin-bottom:12px!important;}
.inventory-detail-modal > form{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:0 18px 16px!important;
}
.inventory-detail-modal .inventory-detail-table,
.inventory-detail-modal .table-wrap{
  max-height:none!important;
  overflow-x:auto!important;
  overflow-y:visible!important;
  border-radius:14px!important;
}
.inventory-detail-modal table{min-width:760px!important;}
.inventory-detail-modal .actions,
.modal-card .actions,
.afc-modal-panel .actions{
  position:sticky!important;
  bottom:0!important;
  background:#fff!important;
  border-top:1px solid #e2e8f0!important;
  padding-top:12px!important;
  padding-bottom:12px!important;
  z-index:6!important;
}
/* Mobile header should keep date/time visible in compact mode */
@media(max-width:1000px){
  .topbar{flex-wrap:wrap!important;gap:8px!important;}
  .topbar-left{display:flex!important;align-items:center!important;gap:6px!important;flex-wrap:wrap!important;margin-right:auto!important;}
  .clock{display:block!important;min-width:auto!important;padding:4px 8px!important;border-radius:11px!important;line-height:1.35!important;font-size:10px!important;}
  .clock b{font-size:10.5px!important;}
  .online-status{padding:6px 8px!important;min-width:auto!important;}
}
@media(max-width:760px){
  .modal,.afc-modal{padding:0!important;}
  .modal-card,.modal-card.wide,.inventory-detail-modal,.afc-modal-panel,.afc-modal-panel.small,.afc-modal-panel.wide{
    width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important;
  }
  .modal-card > form,.afc-modal-panel > form,.modal-card > .modal-body,.afc-modal-panel > .modal-body{padding:14px!important;}
  .inventory-detail-modal .inventory-summary-row,
  .inventory-detail-modal > p.muted{margin-left:14px!important;margin-right:14px!important;}
  .inventory-detail-modal > form{padding:0 14px 14px!important;}
  .inventory-detail-modal table{min-width:720px!important;}
}


/* AFC v0.44 - final clean modal scrolling + mobile header clock */
html.afc-modal-lock,
body.afc-modal-lock,
body.modal-open{
  overflow:hidden!important;
}
.modal,
.afc-modal{
  display:none!important;
  position:fixed!important;
  inset:0!important;
  z-index:99999!important;
  padding:24px!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  background:rgba(15,23,42,.10)!important;
  direction:rtl!important;
}
.modal.open,
.afc-modal.open{
  display:flex!important;
}
.modal-card,
.afc-modal-panel{
  position:relative!important;
  width:min(1080px,calc(100vw - 48px))!important;
  max-width:calc(100vw - 48px)!important;
  height:auto!important;
  max-height:calc(100vh - 48px)!important;
  max-height:calc(100dvh - 48px)!important;
  margin:0 auto!important;
  padding:0!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  background:#fff!important;
  border:1px solid #dbe3ee!important;
  border-radius:22px!important;
  box-shadow:0 20px 60px rgba(15,23,42,.22)!important;
}
.modal-card.wide,
.inventory-detail-modal,
.afc-modal-panel.wide{
  width:min(1180px,calc(100vw - 48px))!important;
}
.afc-modal-panel.small{
  width:min(720px,calc(100vw - 48px))!important;
}
.modal-head,
.afc-modal-head{
  flex:0 0 auto!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  padding:14px 18px!important;
  margin:0!important;
  background:#fff!important;
  border-bottom:1px solid #e2e8f0!important;
  position:relative!important;
  top:auto!important;
  z-index:10!important;
}
/* one scroll only: the direct form/body/list inside modal */
.modal-card > form,
.afc-modal-panel > form,
.modal-card > .modal-body,
.afc-modal-panel > .modal-body,
.afc-modal-panel > #variant-list,
.modal-card > #variant-list{
  flex:1 1 auto!important;
  min-height:0!important;
  max-height:calc(100vh - 125px)!important;
  max-height:calc(100dvh - 125px)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:16px 18px 96px!important;
  scrollbar-gutter:stable!important;
  -webkit-overflow-scrolling:touch!important;
}
/* Inventory detail has summary before form; only form scrolls below the summary */
.inventory-detail-modal .inventory-summary-row,
.inventory-detail-modal > p.muted{
  flex:0 0 auto!important;
  margin-left:18px!important;
  margin-right:18px!important;
}
.inventory-detail-modal > form{
  flex:1 1 auto!important;
  min-height:240px!important;
  max-height:calc(100vh - 300px)!important;
  max-height:calc(100dvh - 300px)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:0 18px 96px!important;
  -webkit-overflow-scrolling:touch!important;
}
.modal-card .table-wrap,
.modal-card .inventory-detail-table,
.afc-modal-panel .table-wrap{
  max-height:none!important;
  overflow-x:auto!important;
  overflow-y:visible!important;
  border-radius:14px!important;
}
.modal-card .table-wrap table,
.inventory-detail-modal table,
.afc-modal-panel .table-wrap table{
  min-width:720px!important;
}
.modal-card .actions,
.afc-modal-panel .actions{
  position:sticky!important;
  bottom:0!important;
  background:#fff!important;
  border-top:1px solid #e2e8f0!important;
  margin:16px -18px -96px!important;
  padding:12px 18px!important;
  z-index:20!important;
}
/* prevent fields from sliding under sticky action area */
.modal-card textarea,
.afc-modal-panel textarea,
.modal-card input,
.afc-modal-panel input,
.modal-card select,
.afc-modal-panel select{
  position:relative!important;
  z-index:1!important;
}
@media(max-width:760px){
  .modal,.afc-modal{
    padding:0!important;
    background:#fff!important;
    align-items:stretch!important;
    justify-content:stretch!important;
  }
  .modal-card,
  .modal-card.wide,
  .inventory-detail-modal,
  .afc-modal-panel,
  .afc-modal-panel.small,
  .afc-modal-panel.wide{
    width:100vw!important;
    max-width:100vw!important;
    height:100vh!important;
    height:100dvh!important;
    max-height:100vh!important;
    max-height:100dvh!important;
    border-radius:0!important;
    border:0!important;
  }
  .modal-card > form,
  .afc-modal-panel > form,
  .modal-card > .modal-body,
  .afc-modal-panel > .modal-body,
  .afc-modal-panel > #variant-list,
  .modal-card > #variant-list{
    max-height:none!important;
    padding:14px 14px 100px!important;
  }
  .inventory-detail-modal > form{
    max-height:none!important;
    padding:0 14px 100px!important;
  }
  .inventory-detail-modal .inventory-summary-row,
  .inventory-detail-modal > p.muted{
    margin-left:14px!important;
    margin-right:14px!important;
  }
}
@media(max-width:1000px){
  .topbar{flex-wrap:wrap!important;align-items:flex-start!important;gap:8px!important;}
  .topbar-left{display:flex!important;order:2!important;width:100%!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;margin:0!important;}
  .clock{display:block!important;visibility:visible!important;opacity:1!important;min-width:122px!important;padding:6px 10px!important;border-radius:12px!important;line-height:1.35!important;font-size:10.5px!important;text-align:center!important;}
  .clock span,.clock b{display:block!important;font-size:10.5px!important;white-space:nowrap!important;}
  .online-status{display:inline-flex!important;visibility:visible!important;opacity:1!important;min-width:auto!important;padding:7px 10px!important;}
  .online-status b{display:inline!important;font-size:11px!important;}
}

/* AFC v0.45 - definitive modal scroll fix: one usable internal scroll */
html.afc-modal-lock,
body.afc-modal-lock,
body.modal-open{
  overflow:hidden!important;
  position:relative!important;
}
.modal,
.afc-modal{
  overflow:hidden!important;
  overscroll-behavior:contain!important;
}
.modal.open,
.afc-modal.open{
  display:flex!important;
}
.modal-card,
.afc-modal-panel{
  height:calc(100vh - 48px)!important;
  height:calc(100dvh - 48px)!important;
  max-height:calc(100vh - 48px)!important;
  max-height:calc(100dvh - 48px)!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
}
.modal-head,
.afc-modal-head{
  flex:0 0 auto!important;
}
.modal-card > form,
.afc-modal-panel > form,
.modal-card > .modal-body,
.afc-modal-panel > .modal-body,
.afc-modal-panel > #variant-list,
.modal-card > #variant-list{
  flex:1 1 auto!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:16px 18px 110px!important;
  -webkit-overflow-scrolling:touch!important;
  scrollbar-gutter:stable!important;
  overscroll-behavior:contain!important;
}
.inventory-detail-modal > form{
  flex:1 1 auto!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:0 18px 110px!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior:contain!important;
}
.inventory-detail-modal .inventory-summary-row,
.inventory-detail-modal > p.muted{
  flex:0 0 auto!important;
}
.modal-card .table-wrap,
.modal-card .inventory-detail-table,
.afc-modal-panel .table-wrap{
  max-height:none!important;
  overflow-x:auto!important;
  overflow-y:visible!important;
}
.modal-card .actions,
.afc-modal-panel .actions{
  position:sticky!important;
  bottom:0!important;
  margin:18px -18px -110px!important;
  padding:12px 18px!important;
  background:#fff!important;
  border-top:1px solid #e2e8f0!important;
  z-index:40!important;
}
.modal-card .row,
.afc-modal-panel .row,
.modal-card .row4,
.afc-modal-panel .row4{
  overflow:visible!important;
}
@media(max-width:760px){
  .modal-card,
  .modal-card.wide,
  .inventory-detail-modal,
  .afc-modal-panel,
  .afc-modal-panel.small,
  .afc-modal-panel.wide{
    height:100vh!important;
    height:100dvh!important;
    max-height:100vh!important;
    max-height:100dvh!important;
  }
  .modal-card > form,
  .afc-modal-panel > form,
  .modal-card > .modal-body,
  .afc-modal-panel > .modal-body,
  .afc-modal-panel > #variant-list,
  .modal-card > #variant-list{
    padding:14px 14px 120px!important;
  }
  .inventory-detail-modal > form{
    padding:0 14px 120px!important;
  }
  .modal-card .actions,
  .afc-modal-panel .actions{
    margin:18px -14px -120px!important;
    padding:12px 14px calc(12px + env(safe-area-inset-bottom))!important;
  }
}


/* AFC v0.46 - definitive modal scroll fix: overlay scrolls, no nested vertical scroll */
html.afc-modal-lock, body.afc-modal-lock, body.modal-open{overflow:hidden!important;}
.modal,.afc-modal{
  position:fixed!important;inset:0!important;z-index:99999!important;
  display:none!important;overflow-y:auto!important;overflow-x:hidden!important;
  padding:24px!important;align-items:flex-start!important;justify-content:center!important;
  background:rgba(15,23,42,.16)!important;-webkit-overflow-scrolling:touch!important;
  backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
}
.modal.open,.afc-modal.open{display:flex!important;}
.afc-modal-backdrop{position:fixed!important;inset:0!important;background:transparent!important;pointer-events:auto!important;}
.modal-card,.afc-modal-panel{
  position:relative!important;z-index:1!important;display:block!important;flex:none!important;
  width:min(1180px,calc(100vw - 48px))!important;max-width:none!important;
  height:auto!important;min-height:0!important;max-height:none!important;
  margin:24px auto!important;padding:0!important;overflow:visible!important;
  background:#fff!important;border:1px solid #dbe3ee!important;border-radius:22px!important;
  box-shadow:0 28px 80px rgba(15,23,42,.22)!important;
}
.modal-card.wide,.inventory-detail-modal,.afc-modal-panel.wide{width:min(1180px,calc(100vw - 48px))!important;}
.afc-modal-panel.small{width:min(720px,calc(100vw - 48px))!important;}
.modal-head,.afc-modal-head{
  position:sticky!important;top:0!important;z-index:4!important;display:flex!important;align-items:center!important;justify-content:space-between!important;
  padding:14px 18px!important;margin:0!important;background:#fff!important;border-bottom:1px solid #e2e8f0!important;border-radius:22px 22px 0 0!important;
}
.modal-card > :not(.modal-head),.afc-modal-panel > :not(.afc-modal-head){overflow:visible!important;max-height:none!important;}
.modal-card > form,.afc-modal-panel > form,.modal-card > .modal-body,.afc-modal-panel > .modal-body,.afc-modal-panel > #variant-list{
  display:block!important;flex:none!important;min-height:0!important;max-height:none!important;height:auto!important;
  overflow:visible!important;padding:16px 18px 24px!important;
}
.modal-card .table-wrap,.modal-card .inventory-detail-table,.afc-modal-panel .table-wrap{
  max-height:none!important;overflow-x:auto!important;overflow-y:visible!important;border-radius:14px!important;-webkit-overflow-scrolling:touch!important;
}
.inventory-detail-table table,.modal-card .table-wrap table{min-width:760px!important;width:100%!important;}
.modal-card .actions,.afc-modal-panel .actions{
  position:sticky!important;bottom:0!important;z-index:5!important;background:#fff!important;border-top:1px solid #e2e8f0!important;
  margin:16px -18px -24px!important;padding:12px 18px!important;border-radius:0 0 22px 22px!important;
}
@media(max-width:760px){
  .modal,.afc-modal{padding:0!important;background:#fff!important;}
  .modal-card,.modal-card.wide,.inventory-detail-modal,.afc-modal-panel,.afc-modal-panel.small,.afc-modal-panel.wide{
    width:100vw!important;max-width:100vw!important;margin:0!important;border-radius:0!important;border-left:0!important;border-right:0!important;box-shadow:none!important;
  }
  .modal-head,.afc-modal-head{border-radius:0!important;padding:14px!important;}
  .modal-card > form,.afc-modal-panel > form,.modal-card > .modal-body,.afc-modal-panel > .modal-body,.afc-modal-panel > #variant-list{padding:14px 14px 24px!important;}
  .modal-card .actions,.afc-modal-panel .actions{margin:16px -14px -24px!important;padding:12px 14px!important;border-radius:0!important;}
  .inventory-detail-table table,.modal-card .table-wrap table{min-width:720px!important;}
}

/* AFC v0.47 - real modal internal scrolling fix */
html.afc-modal-lock, body.afc-modal-lock, body.modal-open{
  overflow:hidden!important;
}
.modal,.afc-modal{
  position:fixed!important;
  inset:0!important;
  z-index:99999!important;
  display:none!important;
  padding:24px!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  background:rgba(15,23,42,.18)!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
.modal.open,.afc-modal.open{display:flex!important;}
.afc-modal-backdrop{position:fixed!important;inset:0!important;background:transparent!important;}
.modal-card,.afc-modal-panel{
  position:relative!important;
  z-index:1!important;
  width:min(1180px,calc(100vw - 48px))!important;
  max-width:calc(100vw - 48px)!important;
  height:min(820px,calc(100vh - 48px))!important;
  max-height:calc(100vh - 48px)!important;
  margin:0 auto!important;
  padding:0!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  min-height:0!important;
  background:#fff!important;
  border:1px solid #dbe3ee!important;
  border-radius:22px!important;
  box-shadow:0 28px 80px rgba(15,23,42,.22)!important;
}
.afc-modal-panel.small{width:min(720px,calc(100vw - 48px))!important;}
.modal-head,.afc-modal-head{
  flex:0 0 auto!important;
  position:relative!important;
  top:auto!important;
  z-index:3!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  padding:14px 18px!important;
  margin:0!important;
  background:#fff!important;
  border-bottom:1px solid #e2e8f0!important;
  border-radius:22px 22px 0 0!important;
}
.modal-card > :not(.modal-head),.afc-modal-panel > :not(.afc-modal-head){
  max-height:none!important;
}
.modal-card > form,.afc-modal-panel > form,.modal-card > .modal-body,.afc-modal-panel > .modal-body,.afc-modal-panel > #variant-list{
  flex:1 1 auto!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch!important;
  padding:16px 18px 24px!important;
  background:#fff!important;
}
/* stock detail has summary blocks before the form; keep them fixed and let the form scroll */
.inventory-detail-modal > .inventory-summary-row,
.inventory-detail-modal > p.muted{
  flex:0 0 auto!important;
  margin-left:18px!important;
  margin-right:18px!important;
}
.inventory-detail-modal > form{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:0 18px 24px!important;
  background:#fff!important;
}
.modal-card .table-wrap,.modal-card .inventory-detail-table,.afc-modal-panel .table-wrap{
  max-height:none!important;
  overflow-x:auto!important;
  overflow-y:visible!important;
  border-radius:14px!important;
  -webkit-overflow-scrolling:touch!important;
}
.inventory-detail-table table,.modal-card .table-wrap table{min-width:760px!important;width:100%!important;}
/* Do not make every .actions sticky; only the final submit row should stick */
.modal-card .actions,.afc-modal-panel .actions{
  position:static!important;
  bottom:auto!important;
  margin:12px 0 0!important;
  padding:0!important;
  border-top:0!important;
  background:transparent!important;
  z-index:auto!important;
}
.modal-card > form > .actions:last-child,
.afc-modal-panel > form > .actions:last-child{
  position:sticky!important;
  bottom:0!important;
  z-index:4!important;
  display:flex!important;
  gap:8px!important;
  justify-content:flex-start!important;
  background:#fff!important;
  border-top:1px solid #e2e8f0!important;
  margin:16px -18px -24px!important;
  padding:12px 18px!important;
  border-radius:0 0 22px 22px!important;
}
@media(max-width:760px){
  .modal,.afc-modal{padding:0!important;align-items:stretch!important;justify-content:stretch!important;background:#fff!important;}
  .modal-card,.modal-card.wide,.inventory-detail-modal,.afc-modal-panel,.afc-modal-panel.small,.afc-modal-panel.wide{
    width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;border-radius:0!important;border-left:0!important;border-right:0!important;box-shadow:none!important;
  }
  .modal-head,.afc-modal-head{border-radius:0!important;padding:14px!important;}
  .modal-card > form,.afc-modal-panel > form,.modal-card > .modal-body,.afc-modal-panel > .modal-body,.afc-modal-panel > #variant-list{padding:14px 14px 28px!important;}
  .inventory-detail-modal > .inventory-summary-row,.inventory-detail-modal > p.muted{margin-left:14px!important;margin-right:14px!important;}
  .inventory-detail-modal > form{padding:0 14px 28px!important;}
  .modal-card > form > .actions:last-child,.afc-modal-panel > form > .actions:last-child{margin:16px -14px -28px!important;padding:12px 14px!important;border-radius:0!important;}
  .inventory-detail-table table,.modal-card .table-wrap table{min-width:720px!important;}
}

/* AFC v0.48 - modal overflow root fix: one real scroll on the modal overlay */
html.afc-modal-lock,
body.afc-modal-lock,
body.modal-open{
  overflow:hidden!important;
  height:100%!important;
}
.modal,
.afc-modal{
  position:fixed!important;
  inset:0!important;
  z-index:99999!important;
  display:none!important;
  direction:rtl!important;
  padding:22px!important;
  background:rgba(15,23,42,.18)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  align-items:flex-start!important;
  justify-content:center!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior:contain!important;
}
.modal.open,
.afc-modal.open{
  display:flex!important;
}
.modal-card,
.afc-modal-panel,
.modal-card.wide,
.inventory-detail-modal,
.afc-modal-panel.wide,
.afc-modal-panel.small{
  position:relative!important;
  z-index:1!important;
  flex:0 0 auto!important;
  display:block!important;
  width:min(1180px,calc(100vw - 44px))!important;
  max-width:calc(100vw - 44px)!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  margin:22px auto 70px!important;
  padding:0!important;
  background:#fff!important;
  border:1px solid #dbe3ee!important;
  border-radius:22px!important;
  box-shadow:0 28px 80px rgba(15,23,42,.22)!important;
}
.afc-modal-panel.small{width:min(720px,calc(100vw - 44px))!important;}
.modal-head,
.afc-modal-head{
  position:sticky!important;
  top:0!important;
  z-index:20!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  padding:14px 18px!important;
  margin:0!important;
  background:#fff!important;
  border-bottom:1px solid #e2e8f0!important;
  border-radius:22px 22px 0 0!important;
}
.modal-card > :not(.modal-head),
.afc-modal-panel > :not(.afc-modal-head),
.modal-card > form,
.afc-modal-panel > form,
.modal-card > .modal-body,
.afc-modal-panel > .modal-body,
.afc-modal-panel > #variant-list,
.modal-card > #variant-list,
.inventory-detail-modal > form{
  display:block!important;
  flex:none!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
}
.modal-card > form,
.afc-modal-panel > form,
.modal-card > .modal-body,
.afc-modal-panel > .modal-body,
.afc-modal-panel > #variant-list,
.modal-card > #variant-list{
  padding:16px 18px 24px!important;
  background:#fff!important;
}
.inventory-detail-modal > .inventory-summary-row,
.inventory-detail-modal > p.muted{
  margin-left:18px!important;
  margin-right:18px!important;
}
.inventory-detail-modal > form{
  padding:0 18px 24px!important;
}
.modal-card .table-wrap,
.modal-card .inventory-detail-table,
.afc-modal-panel .table-wrap{
  max-height:none!important;
  overflow-y:visible!important;
  overflow-x:auto!important;
  -webkit-overflow-scrolling:touch!important;
  border-radius:14px!important;
}
.inventory-detail-table table,
.modal-card .table-wrap table{
  width:100%!important;
  min-width:760px!important;
}
.modal-card .actions,
.afc-modal-panel .actions,
.modal-card > form > .actions:last-child,
.afc-modal-panel > form > .actions:last-child{
  position:static!important;
  bottom:auto!important;
  z-index:auto!important;
  display:flex!important;
  gap:8px!important;
  justify-content:flex-start!important;
  margin:16px 0 0!important;
  padding:12px 0 0!important;
  border-top:1px solid #e2e8f0!important;
  background:#fff!important;
  border-radius:0!important;
}
@media(max-width:760px){
  .modal,.afc-modal{
    padding:0!important;
    background:#fff!important;
  }
  .modal-card,
  .modal-card.wide,
  .inventory-detail-modal,
  .afc-modal-panel,
  .afc-modal-panel.small,
  .afc-modal-panel.wide{
    width:100vw!important;
    max-width:100vw!important;
    margin:0 0 60px!important;
    border-radius:0!important;
    border-left:0!important;
    border-right:0!important;
    box-shadow:none!important;
  }
  .modal-head,.afc-modal-head{border-radius:0!important;padding:14px!important;}
  .modal-card > form,
  .afc-modal-panel > form,
  .modal-card > .modal-body,
  .afc-modal-panel > .modal-body,
  .afc-modal-panel > #variant-list,
  .modal-card > #variant-list{
    padding:14px 14px 28px!important;
  }
  .inventory-detail-modal > .inventory-summary-row,
  .inventory-detail-modal > p.muted{margin-left:14px!important;margin-right:14px!important;}
  .inventory-detail-modal > form{padding:0 14px 28px!important;}
  .inventory-detail-table table,.modal-card .table-wrap table{min-width:720px!important;}
}

/* AFC v0.49 - final modal overflow correction: page-like modal scroll */
html.afc-modal-lock,
body.afc-modal-lock,
body.modal-open{
  overflow:hidden!important;
  height:100%!important;
}
.modal,
.afc-modal{
  position:fixed!important;
  inset:0!important;
  z-index:999999!important;
  display:none!important;
  direction:rtl!important;
  padding:24px!important;
  background:rgba(15,23,42,.18)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  align-items:initial!important;
  justify-content:initial!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior:contain!important;
}
.modal.open,
.afc-modal.open{
  display:block!important;
}
.afc-modal-backdrop{
  position:fixed!important;
  inset:0!important;
  background:transparent!important;
  pointer-events:auto!important;
}
.modal-card,
.afc-modal-panel,
.modal-card.wide,
.inventory-detail-modal,
.afc-modal-panel.wide,
.afc-modal-panel.small{
  position:relative!important;
  z-index:1!important;
  display:block!important;
  width:min(1180px,calc(100vw - 48px))!important;
  max-width:calc(100vw - 48px)!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  margin:24px auto 96px!important;
  padding:0!important;
  background:#fff!important;
  border:1px solid #dbe3ee!important;
  border-radius:22px!important;
  box-shadow:0 28px 80px rgba(15,23,42,.22)!important;
}
.afc-modal-panel.small{width:min(720px,calc(100vw - 48px))!important;}
.modal-head,
.afc-modal-head{
  position:sticky!important;
  top:0!important;
  z-index:30!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  padding:14px 18px!important;
  margin:0!important;
  background:#fff!important;
  border-bottom:1px solid #e2e8f0!important;
  border-radius:22px 22px 0 0!important;
}
.modal-card > :not(.modal-head),
.afc-modal-panel > :not(.afc-modal-head),
.modal-card > form,
.afc-modal-panel > form,
.modal-card > .modal-body,
.afc-modal-panel > .modal-body,
.afc-modal-panel > #variant-list,
.modal-card > #variant-list,
.inventory-detail-modal > form{
  display:block!important;
  position:relative!important;
  flex:none!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
}
.modal-card > form,
.afc-modal-panel > form,
.modal-card > .modal-body,
.afc-modal-panel > .modal-body,
.afc-modal-panel > #variant-list,
.modal-card > #variant-list{
  padding:16px 18px 24px!important;
  background:#fff!important;
}
.inventory-detail-modal > .inventory-summary-row,
.inventory-detail-modal > p.muted{
  margin-left:18px!important;
  margin-right:18px!important;
}
.inventory-detail-modal > form{
  padding:0 18px 24px!important;
}
.modal-card .table-wrap,
.modal-card .inventory-detail-table,
.afc-modal-panel .table-wrap{
  max-height:none!important;
  overflow-y:visible!important;
  overflow-x:auto!important;
  -webkit-overflow-scrolling:touch!important;
  border-radius:14px!important;
}
.inventory-detail-table table,
.modal-card .table-wrap table{
  width:100%!important;
  min-width:760px!important;
}
.modal-card .actions,
.afc-modal-panel .actions,
.modal-card > form > .actions:last-child,
.afc-modal-panel > form > .actions:last-child{
  position:static!important;
  bottom:auto!important;
  z-index:auto!important;
  display:flex!important;
  gap:8px!important;
  justify-content:flex-start!important;
  margin:16px 0 0!important;
  padding:12px 0 0!important;
  border-top:1px solid #e2e8f0!important;
  background:#fff!important;
  border-radius:0!important;
}
body.modal-open .app,
body.afc-modal-lock .app{
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
}
@media(max-width:760px){
  .modal,
  .afc-modal{
    padding:0!important;
    background:#fff!important;
  }
  .modal-card,
  .modal-card.wide,
  .inventory-detail-modal,
  .afc-modal-panel,
  .afc-modal-panel.small,
  .afc-modal-panel.wide{
    width:100vw!important;
    max-width:100vw!important;
    margin:0 0 90px!important;
    border-radius:0!important;
    border-left:0!important;
    border-right:0!important;
    box-shadow:none!important;
  }
  .modal-head,
  .afc-modal-head{
    border-radius:0!important;
    padding:14px!important;
  }
  .modal-card > form,
  .afc-modal-panel > form,
  .modal-card > .modal-body,
  .afc-modal-panel > .modal-body,
  .afc-modal-panel > #variant-list,
  .modal-card > #variant-list{
    padding:14px 14px 28px!important;
  }
  .inventory-detail-modal > .inventory-summary-row,
  .inventory-detail-modal > p.muted{margin-left:14px!important;margin-right:14px!important;}
  .inventory-detail-modal > form{padding:0 14px 28px!important;}
  .inventory-detail-table table,
  .modal-card .table-wrap table{min-width:720px!important;}
}

/* AFC v0.50 - real fixed-height modal scroll: card scrolls, not page and not table */
html.afc-modal-lock,
body.afc-modal-lock,
body.modal-open{
  overflow:hidden!important;
  height:100%!important;
}
.modal,
.afc-modal{
  display:none!important;
  position:fixed!important;
  inset:0!important;
  width:100vw!important;
  height:100vh!important;
  z-index:999999!important;
  padding:24px!important;
  direction:rtl!important;
  background:rgba(15,23,42,.20)!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  overscroll-behavior:contain!important;
}
.modal.open,
.afc-modal.open{
  display:flex!important;
}
.afc-modal-backdrop{
  position:fixed!important;
  inset:0!important;
  background:transparent!important;
  pointer-events:auto!important;
}
.modal-card,
.afc-modal-panel,
.modal-card.wide,
.inventory-detail-modal,
.afc-modal-panel.wide,
.afc-modal-panel.small{
  position:relative!important;
  z-index:1!important;
  display:block!important;
  flex:none!important;
  width:min(1180px,calc(100vw - 48px))!important;
  max-width:calc(100vw - 48px)!important;
  height:auto!important;
  min-height:0!important;
  max-height:calc(100vh - 48px)!important;
  max-height:calc(100dvh - 48px)!important;
  margin:0 auto!important;
  padding:0!important;
  background:#fff!important;
  border:1px solid #dbe3ee!important;
  border-radius:22px!important;
  box-shadow:0 28px 80px rgba(15,23,42,.22)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior:contain!important;
}
.afc-modal-panel.small{width:min(720px,calc(100vw - 48px))!important;}
.modal-head,
.afc-modal-head{
  position:sticky!important;
  top:0!important;
  z-index:30!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  margin:0!important;
  padding:14px 18px!important;
  background:#fff!important;
  border-bottom:1px solid #e2e8f0!important;
  border-radius:22px 22px 0 0!important;
}
.modal-card > :not(.modal-head),
.afc-modal-panel > :not(.afc-modal-head),
.modal-card > form,
.afc-modal-panel > form,
.modal-card > .modal-body,
.afc-modal-panel > .modal-body,
.afc-modal-panel > #variant-list,
.modal-card > #variant-list,
.inventory-detail-modal > form{
  display:block!important;
  position:relative!important;
  flex:none!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  background:#fff!important;
}
.modal-card > form,
.afc-modal-panel > form,
.modal-card > .modal-body,
.afc-modal-panel > .modal-body,
.afc-modal-panel > #variant-list,
.modal-card > #variant-list{
  padding:16px 18px 28px!important;
}
.inventory-detail-modal > .inventory-summary-row,
.inventory-detail-modal > p.muted{
  margin-left:18px!important;
  margin-right:18px!important;
}
.inventory-detail-modal > form{
  padding:0 18px 28px!important;
}
.modal-card .table-wrap,
.modal-card .inventory-detail-table,
.afc-modal-panel .table-wrap{
  max-height:none!important;
  overflow-y:visible!important;
  overflow-x:auto!important;
  -webkit-overflow-scrolling:touch!important;
  border-radius:14px!important;
}
.inventory-detail-table table,
.modal-card .table-wrap table{
  width:100%!important;
  min-width:760px!important;
}
.modal-card .actions,
.afc-modal-panel .actions,
.modal-card > form > .actions:last-child,
.afc-modal-panel > form > .actions:last-child{
  position:static!important;
  bottom:auto!important;
  z-index:auto!important;
  display:flex!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  justify-content:flex-start!important;
  margin:16px 0 0!important;
  padding:12px 0 0!important;
  border-top:1px solid #e2e8f0!important;
  background:#fff!important;
  border-radius:0!important;
}
@media(max-width:760px){
  .modal,
  .afc-modal{
    padding:0!important;
    background:#fff!important;
    align-items:stretch!important;
    justify-content:stretch!important;
  }
  .modal-card,
  .modal-card.wide,
  .inventory-detail-modal,
  .afc-modal-panel,
  .afc-modal-panel.small,
  .afc-modal-panel.wide{
    width:100vw!important;
    max-width:100vw!important;
    height:100vh!important;
    height:100dvh!important;
    max-height:100vh!important;
    max-height:100dvh!important;
    margin:0!important;
    border-radius:0!important;
    border-left:0!important;
    border-right:0!important;
    box-shadow:none!important;
  }
  .modal-head,
  .afc-modal-head{
    border-radius:0!important;
    padding:14px!important;
  }
  .modal-card > form,
  .afc-modal-panel > form,
  .modal-card > .modal-body,
  .afc-modal-panel > .modal-body,
  .afc-modal-panel > #variant-list,
  .modal-card > #variant-list{
    padding:14px 14px 30px!important;
  }
  .inventory-detail-modal > .inventory-summary-row,
  .inventory-detail-modal > p.muted{margin-left:14px!important;margin-right:14px!important;}
  .inventory-detail-modal > form{padding:0 14px 30px!important;}
}


/* AFC v0.51 - inventory modal compact header cards and removed explanatory clutter */
.inventory-detail-modal > .inventory-summary-row{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:8px!important;
  margin:10px 18px 8px!important;
  padding:0!important;
}
.inventory-detail-modal > .inventory-summary-row > div{
  min-height:0!important;
  padding:8px 10px!important;
  border-radius:12px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
}
.inventory-detail-modal > .inventory-summary-row span{
  display:inline!important;
  margin:0!important;
  font-size:12px!important;
  line-height:1.2!important;
}
.inventory-detail-modal > .inventory-summary-row b{
  font-size:18px!important;
  line-height:1!important;
}
.inventory-detail-modal .modal-head{padding-top:12px!important;padding-bottom:12px!important;}
.inventory-detail-modal > form{padding-top:8px!important;}
@media(max-width:760px){
  .inventory-detail-modal > .inventory-summary-row{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:6px!important;
    margin:8px 12px 6px!important;
  }
  .inventory-detail-modal > .inventory-summary-row > div{padding:7px 8px!important;border-radius:10px!important;}
  .inventory-detail-modal > .inventory-summary-row span{font-size:11px!important;}
  .inventory-detail-modal > .inventory-summary-row b{font-size:16px!important;}
}

/* AFC v0.52 - product management polish */
.product-thumb{width:52px;height:52px;border-radius:14px;object-fit:cover;display:inline-flex;align-items:center;justify-content:center;background:#f1f5f9;border:1px solid rgba(15,23,42,.10);font-size:11px;color:#64748b;text-align:center;overflow:hidden}
.product-preview{width:80px;height:80px;border-radius:16px;object-fit:cover;border:1px solid rgba(15,23,42,.12);background:#f8fafc;display:block}
.inline-actions{display:flex;gap:8px;align-items:center;justify-content:flex-start;flex-wrap:nowrap}
.inline-actions form{display:inline-flex;margin:0}
.inline-actions .btn,.inline-actions button{white-space:nowrap}
@media(max-width:700px){.product-thumb{width:44px;height:44px;border-radius:12px}.inline-actions{gap:6px}.inline-actions .btn,.inline-actions button{padding:9px 10px;font-size:12px}}

/* AFC v0.53 - product management cleanup */
.product-actions-cell{width:150px;white-space:nowrap;vertical-align:middle!important}
.product-row-actions{display:inline-flex!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:center!important;gap:8px!important;margin:0!important}
.product-row-actions form{display:inline-flex!important;margin:0!important;padding:0!important}
.product-row-actions .btn,.product-row-actions button{margin:0!important;min-height:36px!important;height:36px!important;padding:7px 12px!important;line-height:1!important;white-space:nowrap!important}
.product-image-picker{display:grid;grid-template-columns:96px 1fr;gap:14px;align-items:center;margin:14px 0}
.product-image-preview-box{width:96px;height:96px;border-radius:18px;background:#f8fafc;border:1px solid rgba(15,23,42,.12);display:flex;align-items:center;justify-content:center;overflow:hidden;color:#64748b;font-size:12px;text-align:center}
.product-image-preview-box img,#product-image-preview:not(.product-image-empty){width:96px;height:96px;object-fit:cover;display:block;border-radius:18px}
.product-image-empty{width:96px;height:96px;display:flex;align-items:center;justify-content:center}
.image-control-row{display:grid;grid-template-columns:130px 1fr;gap:8px;align-items:center}
.image-file-btn{margin:0!important;height:38px;cursor:pointer}
.compact-table th,.compact-table td{vertical-align:middle!important}
.compact-table td:last-child,.compact-table th:last-child{width:70px;text-align:center}
@media(max-width:700px){
  .product-image-picker{grid-template-columns:1fr;align-items:start}
  .product-image-preview-box,#product-image-preview:not(.product-image-empty),.product-image-empty{width:84px;height:84px;border-radius:16px}
  .image-control-row{grid-template-columns:1fr}
  .product-actions-cell{width:auto}.product-row-actions{gap:6px!important}.product-row-actions .btn,.product-row-actions button{padding:7px 9px!important;font-size:12px!important}
}

/* AFC v0.54 - small UI cleanup */
.filter-action{align-self:end;display:flex;align-items:flex-end}
.filter-action button{width:100%;margin-top:0}
.stock-products-table th,.stock-products-table td{vertical-align:middle}


/* AFC v0.55 - mobile friendly update ZIP file picker */
.update-card .update-upload-form{display:block}
.afc-file-picker{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:8px 0 14px 0;direction:rtl}
.afc-file-input{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important;border:0!important;padding:0!important;margin:-1px!important}
.afc-file-button{display:inline-flex!important;align-items:center;justify-content:center;min-height:42px;cursor:pointer;user-select:none;white-space:nowrap}
.afc-file-name{display:inline-flex;align-items:center;min-height:42px;flex:1;min-width:180px;padding:0 14px;border:1px solid var(--border);border-radius:14px;background:#fff;color:var(--text);direction:ltr;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.update-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:8px}
@media (max-width:700px){
  .afc-file-picker{display:grid;grid-template-columns:1fr;gap:10px}
  .afc-file-button,.afc-file-name{width:100%;box-sizing:border-box}
  .afc-file-name{direction:rtl;text-align:right;min-width:0}
  .update-actions{display:grid;grid-template-columns:1fr;gap:10px}
  .update-actions .btn,.update-actions button{width:100%;box-sizing:border-box;text-align:center;justify-content:center}
}


/* AFC v0.56 - align small action buttons beside fields */
.filter-action{
  align-self:end!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  height:auto!important;
}
.filter-action button,
.filter-action .btn{
  width:auto!important;
  min-width:118px!important;
  height:38px!important;
  min-height:38px!important;
  margin:0!important;
  padding:8px 16px!important;
  align-self:center!important;
  white-space:nowrap!important;
}
.bulk-apply-cell{
  align-self:end!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
}
.bulk-apply-cell label{display:none!important}
.bulk-apply-cell button{
  width:auto!important;
  min-width:126px!important;
  height:38px!important;
  min-height:38px!important;
  margin:0!important;
  padding:8px 16px!important;
  white-space:nowrap!important;
}
@media(max-width:700px){
  .filter-action button,.filter-action .btn,.bulk-apply-cell button{width:100%!important;min-width:0!important}
}

/* AFC v0.57 action alignment */
.row-actions{display:inline-flex!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;flex-wrap:nowrap!important;white-space:nowrap!important}
.row-actions form{display:inline-flex!important;margin:0!important;padding:0!important;align-items:center!important}
.row-actions .btn,.row-actions button{margin:0!important;min-height:36px!important;height:36px!important;line-height:1!important;white-space:nowrap!important}
.filter-actions,.table-actions-inline{display:flex!important;align-items:end!important;gap:8px!important;flex-wrap:wrap!important}
.filter-actions button,.table-actions-inline button{width:auto!important;min-width:120px!important;margin:0!important}
@media(max-width:740px){.row-actions{gap:6px!important}.row-actions .btn,.row-actions button{padding:7px 10px!important}.filter-actions button,.table-actions-inline button{width:100%!important}}


/* AFC v0.59 - grouped menu and purchase mode cleanup */
.nav-group-title{margin:10px 8px 4px;color:#64748b;font-size:11.5px;font-weight:800;letter-spacing:0;display:flex;align-items:center;gap:6px}
.nav-group-title:before{content:"";width:5px;height:5px;border-radius:999px;background:#93c5fd;display:inline-block}
.sidebar nav a{margin-right:2px}
#raw-product-name-wrap[style*="display: none"],#raw-purchase-box[style*="display: none"]{display:none!important}
#purchase-product-search-wrap[style*="display: none"],#registered-purchase-box[style*="display: none"]{display:none!important}

/* AFC v0.60 - optimized grouped menu + purchase type toggle + POS requests */
.sidebar nav{padding-bottom:16px}
.nav-group{margin:7px 0;border:1px solid #eef2f7;border-radius:14px;background:#fbfdff;overflow:hidden}
.nav-group-trigger{width:100%!important;min-height:38px!important;margin:0!important;padding:8px 10px!important;border:0!important;background:transparent!important;color:#0f172a!important;display:flex!important;align-items:center!important;justify-content:space-between!important;box-shadow:none!important;font-size:12.5px!important}
.nav-group-trigger:hover{background:#f1f5f9!important}
.nav-group-trigger b{font-weight:800}
.nav-dot{width:7px;height:7px;border-radius:50%;background:#93c5fd;display:inline-block;margin-left:7px}
.nav-chev{margin-right:auto;color:#64748b;transition:.18s ease;font-size:15px}
.nav-group.open .nav-chev{transform:rotate(180deg)}
.nav-sub{display:none;padding:2px 6px 7px}
.nav-group.open .nav-sub{display:block}
.nav-sub a{font-size:12.3px;padding:7px 8px;margin:2px 0;background:transparent}
.nav-sub a.active{background:#eff6ff;color:#1d4ed8}
.sidebar nav > a{border:1px solid #eef2f7;background:#fff}
.nav-group-title{display:none!important}
#purchase-product-search-wrap[hidden],#raw-product-name-wrap[hidden],#registered-purchase-box[hidden],#raw-purchase-box[hidden]{display:none!important}
.filter-row{align-items:end}.pos-request-stats{margin-bottom:12px}.compact-cards .stat{padding:12px 14px}.pay-status{display:inline-flex;align-items:center;justify-content:center;min-height:28px;padding:4px 10px;border-radius:999px;font-weight:800;font-size:12px;background:#eef2ff;color:#3730a3;white-space:nowrap}.pay-paid,.pay-success{background:#dcfce7;color:#166534}.pay-pending,.pay-processing,.pay-sent_to_pos,.pay-waiting_response{background:#fef3c7;color:#92400e}.pay-failed,.pay-timeout{background:#fee2e2;color:#991b1b}.pay-canceled{background:#f1f5f9;color:#475569}.pay-reversed{background:#ede9fe;color:#5b21b6}
@media(max-width:1000px){.nav-group{border-radius:13px}.nav-group-trigger{min-height:42px!important}.nav-sub a{padding:9px 10px}}

/* AFC v0.61 - POS request spacing and expense form alignment */
.pos-requests-card .filter-row{align-items:end;margin-bottom:14px!important;gap:10px!important}
.pos-requests-card .table-wrap{margin-top:12px!important}
.pos-requests-card .filter-action{align-self:end!important;display:flex!important;align-items:flex-end!important}
.pos-requests-card .filter-action button{width:auto!important;min-width:120px!important;margin:0!important;height:38px!important}
@media(max-width:740px){.pos-requests-card .filter-action button{width:100%!important}}

/* AFC v0.62+ feature styles preserved, typography/layout baseline restored to v0.61 */
.bulk-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 14px 0;padding:12px;border:1px solid var(--border);border-radius:16px;background:rgba(255,255,255,.55)}
.bulk-toolbar .check-line{margin:0;display:inline-flex;align-items:center;gap:8px;white-space:nowrap}
.bulk-toolbar button{width:auto;min-width:110px}
.product-check{width:18px;height:18px;accent-color:var(--primary)}
.product-row-actions{display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:nowrap!important}
.product-row-actions .btn,.product-row-actions button{height:40px;display:inline-flex;align-items:center;justify-content:center;margin:0!important;white-space:nowrap}
@media(max-width:640px){.bulk-toolbar{align-items:stretch}.bulk-toolbar button{width:100%}.product-row-actions{gap:6px!important}.product-row-actions .btn,.product-row-actions button{height:38px;padding:8px 12px}}

.sidebar-credit{margin:14px 8px 4px;padding:10px 6px 6px;color:#94a3b8;font-size:11px;text-align:center;line-height:1.8}
.channel-price-pill{display:inline-flex;align-items:center;border-radius:999px;padding:4px 10px;background:#eef6ff;color:#2563eb;font-size:12px;font-weight:800}
.woo-sync-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:12px 0}.webhook-input{font-size:12px}.price-sync-note{background:#fff7ed;border:1px solid #fed7aa;border-radius:14px;padding:12px;margin:12px 0;color:#9a3412}.mini-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.row-actions,.actions-inline{align-items:center}.row-actions form{margin:0}
@media(max-width:760px){.woo-sync-grid{grid-template-columns:1fr}.sidebar-credit{padding-bottom:18px}}

.gateway-map-box{margin-top:14px;padding:14px;border:1px solid var(--border,#dbe4f0);border-radius:16px;background:rgba(248,250,252,.8)}
.gateway-map-box h3{margin:0 0 10px;font-size:15px;color:var(--text,#0f172a)}
.gateway-map-grid{display:grid;grid-template-columns:minmax(220px,1.4fr) 130px 130px 110px 90px;gap:10px;align-items:end;margin-top:8px}
.gateway-map-head{font-weight:800;color:var(--muted,#64748b);font-size:12px;align-items:center;margin-top:0}
.gateway-map-grid input,.gateway-map-grid select{width:100%;min-height:42px}
.gateway-map-grid small{display:block;margin-top:4px;font-size:11px}
.check-line.compact{min-height:42px;align-items:center;justify-content:center;padding:0 8px;margin:0}
@media(max-width:900px){.gateway-map-grid{grid-template-columns:1fr 1fr}.gateway-map-head{display:none}.check-line.compact{justify-content:flex-start}}

.compact-filter .fit-button{align-self:end;width:auto;min-width:110px;height:46px;padding:0 22px}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px;margin:16px 0}
.stats-grid .stat{background:#fff;border:1px solid var(--border,#dbe3ef);border-radius:18px;padding:16px;box-shadow:0 10px 25px rgba(15,23,42,.04)}
.stats-grid .stat span{display:block;color:#64748b;font-size:13px;margin-bottom:8px}
.stats-grid .stat b{font-size:22px;color:#0f172a}
@media(max-width:640px){.compact-filter .fit-button{width:100%}.stats-grid{grid-template-columns:1fr 1fr}.stats-grid .stat b{font-size:18px}}

.offline-queue-pill{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid #fde68a;background:#fffbeb;color:#92400e;border-radius:999px;padding:6px 10px;font-weight:800;font-size:12px;margin-inline-start:8px;white-space:nowrap}.offline-queue-pill:empty{display:none}

/* AFC v0.73 - complete UI refactor: stable mobile typography, menu, cards and tables */
:root{
  --afc-ui-text:#0f172a;
  --afc-ui-muted:#64748b;
  --afc-ui-border:#e2e8f0;
  --afc-ui-soft:#f8fafc;
}
html{font-size:13px!important;}
body{font-size:13px!important;line-height:1.7!important;color:var(--afc-ui-text)!important;}
body,button,input,select,textarea,table,th,td,a,span,small,b,strong,label,h1,h2,h3,h4,p{font-family:var(--afc-font)!important;}

/* sidebar / menu */
.sidebar{display:flex!important;flex-direction:column!important;gap:0!important;}
.sidebar nav{display:flex!important;flex-direction:column!important;gap:6px!important;padding:0 0 14px!important;}
.brand{flex:0 0 auto!important;}
.sidebar-credit{position:static!important;margin:14px 4px 0!important;padding:8px 0 4px!important;flex:0 0 auto!important;color:#94a3b8!important;font-size:11px!important;line-height:1.8!important;text-align:center!important;}
.sidebar nav > a,
.nav-group,
.nav-group-trigger{font-size:13px!important;line-height:1.55!important;border-radius:13px!important;}
.sidebar nav > a{min-height:42px!important;margin:0!important;padding:9px 12px!important;border:1px solid #eef2f7!important;background:#fff!important;color:#334155!important;display:flex!important;align-items:center!important;gap:8px!important;font-weight:700!important;}
.sidebar nav > a.active{background:#eff6ff!important;color:#1d4ed8!important;border-color:#dbeafe!important;}
.sidebar nav > a.danger-link{color:#be123c!important;}
.nav-group{margin:0!important;border:1px solid #eef2f7!important;border-radius:13px!important;background:#fff!important;overflow:hidden!important;box-shadow:none!important;}
.nav-group-trigger{height:42px!important;min-height:42px!important;padding:9px 12px!important;background:#fff!important;color:#0f172a!important;border:0!important;width:100%!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;text-align:right!important;font-weight:700!important;}
.nav-group-trigger b{font-size:13px!important;line-height:1.45!important;font-weight:700!important;}
.nav-dot{width:6px!important;height:6px!important;margin:0 0 0 7px!important;flex:0 0 6px!important;background:#93c5fd!important;}
.nav-chev{margin-right:auto!important;margin-left:0!important;font-size:14px!important;color:#64748b!important;line-height:1!important;}
.nav-sub{padding:0 10px 9px!important;background:#fff!important;}
.nav-sub a{min-height:34px!important;margin:2px 0!important;padding:7px 10px!important;font-size:12.5px!important;line-height:1.55!important;border-radius:11px!important;background:transparent!important;color:#334155!important;font-weight:600!important;display:flex!important;align-items:center!important;gap:7px!important;}
.nav-sub a.active{background:#eff6ff!important;color:#1d4ed8!important;}
.nav-sub a span,.sidebar nav > a span{font-size:12px!important;line-height:1!important;}

/* page headings and cards */
.topbar h1{font-size:20px!important;line-height:1.35!important;font-weight:700!important;}
.topbar p{font-size:12px!important;line-height:1.6!important;}
.card,.box{padding:14px 16px!important;border-radius:16px!important;overflow:hidden!important;}
.card h1{font-size:21px!important;line-height:1.4!important;margin:0 0 12px!important;}
.card h2{font-size:18px!important;line-height:1.4!important;margin:0 0 12px!important;}
.card h3{font-size:15px!important;line-height:1.45!important;margin:0 0 10px!important;}
.card p,.box p,.muted{font-size:13px!important;line-height:1.9!important;}
.stat{padding:14px 15px!important;min-height:112px!important;}
.stat small{font-size:12.5px!important;line-height:1.5!important;}
.stat b{font-size:23px!important;line-height:1.35!important;word-break:break-word!important;}
.stats-grid .stat span{font-size:12.5px!important;line-height:1.5!important;}
.stats-grid .stat b{font-size:21px!important;line-height:1.35!important;}

/* tables: prevent huge text and clipping */
.table-wrap{width:100%!important;overflow-x:auto!important;overflow-y:visible!important;-webkit-overflow-scrolling:touch!important;border-radius:14px!important;}
table{font-size:12.5px!important;table-layout:auto!important;}
th,td{font-size:12.5px!important;line-height:1.65!important;white-space:nowrap!important;}
td .muted,td small,th small{font-size:11.5px!important;line-height:1.5!important;}
.table-wrap table{min-width:640px;}
.card .table-wrap + .table-wrap{margin-top:12px!important;}
.empty-state,.table-empty,.no-results{font-size:13px!important;color:#64748b!important;line-height:1.8!important;}

/* form controls */
label{font-size:12.5px!important;line-height:1.5!important;margin:7px 0 5px!important;}
input,select,textarea{font-size:13px!important;line-height:1.5!important;min-height:38px!important;}
button,.btn{font-size:12.5px!important;line-height:1.35!important;min-height:36px!important;}
.actions,.row-actions,.actions-inline{gap:8px!important;align-items:center!important;}

/* responsive mobile polish */
@media(max-width:1000px){
  .sidebar{width:min(78vw,340px)!important;max-width:340px!important;padding:12px 10px!important;}
  .sidebar-open .sidebar{transform:translateX(0)!important;}
  .brand{padding:8px 6px 13px!important;margin-bottom:8px!important;gap:10px!important;}
  .brand-logo{width:42px!important;height:42px!important;border-radius:14px!important;font-size:15px!important;flex:0 0 42px!important;}
  .brand b{font-size:14.5px!important;line-height:1.45!important;}
  .brand span{font-size:11.5px!important;line-height:1.55!important;}
  .sidebar nav{gap:7px!important;}
  .sidebar nav > a,.nav-group-trigger{height:44px!important;min-height:44px!important;padding:9px 12px!important;}
  .nav-group-trigger b,.sidebar nav > a{font-size:13.5px!important;}
  .nav-sub{padding:1px 10px 10px!important;}
  .nav-sub a{font-size:12.7px!important;min-height:36px!important;padding:8px 10px!important;}
  .sidebar-credit{font-size:11px!important;margin-top:12px!important;padding-bottom:16px!important;}
  .content{padding:10px!important;}
  .topbar{padding:10px 12px!important;border-radius:15px!important;}
  .topbar h1{font-size:19px!important;}
}
@media(max-width:620px){
  html{font-size:13px!important;}
  body{font-size:13px!important;}
  .grid,.grid3,.quick{grid-template-columns:1fr 1fr!important;gap:10px!important;}
  .card,.box{padding:14px!important;margin-bottom:14px!important;border-radius:17px!important;}
  .card h1{font-size:20px!important;}
  .card h2{font-size:18px!important;}
  .card h3{font-size:15px!important;}
  .card p,.box p,.muted{font-size:13px!important;}
  .stat{min-height:118px!important;padding:14px!important;}
  .stat b{font-size:21px!important;}
  .stats-grid{grid-template-columns:1fr 1fr!important;gap:10px!important;}
  .stats-grid .stat{padding:14px!important;min-height:114px!important;}
  .stats-grid .stat b{font-size:18px!important;}
  th,td{font-size:12px!important;padding:8px!important;}
  .table-wrap table{min-width:620px!important;}
  .online-status{font-size:12px!important;}
  .online-status b{font-size:11.5px!important;}
}
@media(max-width:380px){
  .grid,.grid3,.quick,.stats-grid{grid-template-columns:1fr!important;}
  .sidebar{width:82vw!important;}
}


/* AFC v0.74 - requested UI polish and permission layout */
.menu-toggle:hover{background:var(--afc-primary)!important;border-color:var(--afc-primary2)!important;color:#fff!important;}
.sidebar nav > a .nav-dot{width:6px!important;height:6px!important;border-radius:999px!important;background:#93c5fd!important;display:inline-block!important;flex:0 0 6px!important;margin:0 0 0 7px!important;}
.sidebar nav > a.danger-link .nav-dot,.nav-dot.nav-dot-danger{background:#be123c!important;}
.sidebar nav > a.danger-link:hover,.sidebar nav > a.danger-link.active{background:#fff1f2!important;color:#be123c!important;border-color:#fecdd3!important;}
.pos-terminal-actions{display:inline-flex!important;align-items:center!important;gap:8px!important;flex-wrap:nowrap!important;white-space:nowrap!important;}
.pos-terminal-actions form{display:inline-flex!important;margin:0!important;padding:0!important;}
.pos-terminal-actions .btn,.pos-terminal-actions button{height:36px!important;min-height:36px!important;margin:0!important;white-space:nowrap!important;}
.permission-section{border:1px solid #edf2f7;border-radius:16px;background:#fbfdff;padding:12px;margin:14px 0;}
.permission-section h3{margin:0 0 10px!important;font-size:15px!important;color:#0f172a!important;}
.permission-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;}
.permission-card{background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:11px;}
.permission-card h4{margin:0 0 8px!important;font-size:13px!important;line-height:1.55!important;}
.permission-card .check-line{margin:5px 0!important;display:flex;align-items:center;gap:7px;}
.permission-card small{display:block;margin-top:6px;direction:ltr;text-align:left;font-size:11px!important;}
@media(max-width:760px){.pos-terminal-actions{gap:6px!important}.pos-terminal-actions .btn,.pos-terminal-actions button{padding:7px 9px!important;font-size:12px!important}.permission-grid{grid-template-columns:1fr}.permission-section{padding:10px}}


/* AFC v0.76 - pagination and report polish */
.afc-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0 4px;padding:10px 12px;border:1px solid #e2e8f0;background:#f8fafc;border-radius:14px;flex-wrap:wrap}
.afc-page-total{font-size:12.5px;color:#475569;line-height:1.8}
.afc-page-links{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.afc-page-links b{min-width:34px;height:34px;border-radius:10px;background:var(--afc-primary,#2563eb);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:12px}.afc-page-links .btn{min-height:34px;height:34px;padding:7px 10px}.report-period-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.report-period-tabs a{padding:9px 14px;border-radius:12px;background:#f1f5f9;color:#334155;text-decoration:none;border:1px solid #e2e8f0;font-size:13px}.report-period-tabs a.active{background:#dbeafe;border-color:#93c5fd;color:#1d4ed8;font-weight:700}.report-section-title{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.report-mini-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px}.report-mini-card{border:1px solid #e2e8f0;background:#fff;border-radius:14px;padding:12px}.report-mini-card span{font-size:12px;color:#64748b}.report-mini-card b{display:block;margin-top:5px;font-size:17px;color:#0f172a}.gateway-map-box h3{margin-top:0!important}.gateway-map-box .muted:empty{display:none!important}
@media(max-width:620px){.afc-pagination{align-items:stretch}.afc-page-links{justify-content:flex-start}.afc-page-total{width:100%}.report-period-tabs a{flex:1;text-align:center;padding:9px 8px}.report-mini-grid{grid-template-columns:1fr 1fr}}
.sync-progress-box{margin-top:12px;border:1px solid var(--line,#dbe3ef);border-radius:16px;background:#fff;padding:12px;box-shadow:0 8px 24px rgba(15,23,42,.04)}
.sync-progress-title{font-weight:800;margin-bottom:8px;color:#0f172a}
.sync-progress-bar{height:10px;background:#eef4ff;border-radius:999px;overflow:hidden;margin-bottom:8px}
.sync-progress-bar span{display:block;height:100%;width:0;background:#2563eb;border-radius:999px;transition:width .25s ease}
.sync-progress-text{font-size:13px;color:#334155;font-weight:700}
.sync-progress-log{margin-top:8px;max-height:110px;overflow:auto;font-size:12px;color:#64748b;line-height:1.9;border-top:1px dashed #e2e8f0;padding-top:6px}
.sync-progress-box.sync-error{border-color:#fecaca;background:#fff7f7}.sync-progress-box.sync-error .sync-progress-bar span{background:#dc2626}
/* AFC v0.88 - sales today summary */
.sales-today-summary{margin-top:12px;padding:10px 14px;border:1px solid #dbe4f0;border-radius:14px;background:#f8fafc;display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:#475569;font-size:14px}.sales-today-summary b{color:#0f172a;font-size:18px}.sales-today-summary small{color:#64748b;margin-inline-start:auto}@media(max-width:640px){.sales-today-summary{font-size:13px}.sales-today-summary b{font-size:16px}.sales-today-summary small{width:100%;margin-inline-start:0}}

.sales-today-summary.inline{margin-top:6px;font-size:14px;color:#475569}.sales-today-summary.inline b{font-size:16px;color:#0f172a;margin-inline-start:6px}

/* AFC v0.90 sales subtitle + negative reservation support UI */
.sales-subtitle{margin:-8px 0 14px;color:#475569;font-size:13.5px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}.sales-subtitle b{font-size:16px;color:#0f172a;font-weight:800}.sales-today-summary.inline{padding:0!important;background:transparent!important;border:0!important;border-radius:0!important;margin:0 0 12px!important}.badge.shortage{background:#fee2e2;color:#991b1b;border-color:#fecaca}


/* AFC v0.92 - sales header restored and today summary inline */
.sales-page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap;margin:2px 0 12px}
.sales-page-head h2{margin:0!important;font-size:22px!important;line-height:1.5!important;color:#0f172a!important}
.sales-page-head button{height:42px!important;min-height:42px!important;padding:9px 16px!important;white-space:nowrap!important}
.sales-subtitle{margin:2px 0 0!important;color:#64748b!important;font-size:13.5px!important;display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:wrap!important}
.sales-subtitle b{font-size:16px!important;color:#0f172a!important;font-weight:800!important}
.sales-list-card{margin-top:12px!important}
.sale-row-actions{display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:nowrap!important;white-space:nowrap!important}.sale-row-actions form{margin:0!important;display:inline-flex!important}.sale-row-actions .btn,.sale-row-actions button{height:36px!important;min-height:36px!important;padding:7px 11px!important;margin:0!important}
@media(max-width:760px){.sales-page-head{align-items:stretch}.sales-page-head button{width:100%}.sales-page-head h2{font-size:19px!important}.sales-subtitle{font-size:13px!important}.sales-subtitle b{font-size:15px!important}.sale-row-actions{gap:6px!important}.sale-row-actions .btn,.sale-row-actions button{font-size:12px!important;padding:7px 9px!important}}

/* AFC v0.93 pagination/per-page and print polish */
.afc-pagination{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:10px 0}.afc-per-page{display:inline-flex;align-items:center;gap:6px;margin:0}.afc-per-page label{margin:0;color:#64748b;font-size:12px}.afc-per-page select{width:auto;min-width:74px;min-height:34px;padding:5px 8px}.afc-page-links{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.afc-page-total{color:#64748b;font-weight:600}.afc-page-links b{background:#eff6ff;color:#1d4ed8;border-radius:10px;padding:7px 10px;display:inline-flex;min-width:34px;justify-content:center}
@media(max-width:700px){.afc-pagination{align-items:flex-start}.afc-per-page{width:100%;justify-content:flex-start}.afc-page-links .btn{min-height:32px;padding:6px 9px}}

/* AFC v0.97 fixes */
.print-btn{font-family:var(--font-family, Vazirmatn, Tahoma, sans-serif)!important;}

/* AFC v0.99 */
.print-btn{font-family:Vazirmatn,IRANSans,Tahoma,sans-serif!important;}
.afc-per-page select{min-width:72px}
.online-status.status-online{opacity:1}
/* AFC v1.16 new sale UX */
.pos-products-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px}.sort-pills{display:flex;gap:8px;flex-wrap:wrap}.sort-pills .active{background:#1d4ed8!important;color:#fff!important;border-color:#1d4ed8!important}.warn-soft{background:#fff7ed!important;border-color:#fed7aa!important;color:#9a3412!important}.new-sale-shell textarea{width:100%;border:1px solid var(--border,#dbe3ee);border-radius:12px;padding:10px;resize:vertical}.check-line{display:flex;align-items:center;gap:8px}.check-line input{width:auto;min-height:auto}

/* AFC v1.40 - Dynamic Permission UI */
.perm-page{display:flex;flex-direction:column;gap:14px}.perm-hero{display:flex;align-items:center;justify-content:space-between;gap:14px}.perm-hero h2{margin:0 0 6px;font-size:22px}.perm-mode-tabs{display:flex;gap:8px;flex-wrap:wrap}.perm-mode-tabs a{display:inline-flex;align-items:center;justify-content:center;border:1px solid #dbeafe;background:#fff;color:#1d4ed8;border-radius:12px;padding:10px 14px;font-weight:900;text-decoration:none}.perm-mode-tabs a.active{background:#2563eb;color:#fff;border-color:#2563eb}.perm-toolbar{display:grid;grid-template-columns:minmax(220px,320px) 1fr minmax(220px,320px);gap:12px;align-items:end}.perm-select-form label{display:block;color:#64748b;font-size:12px;margin-bottom:5px}.perm-select-form select,.perm-search{width:100%;min-height:44px;border-radius:12px;border:1px solid #cbd5e1;background:#fff;padding:8px 12px}.perm-summary{border:1px dashed #bfdbfe;background:#eff6ff;border-radius:14px;padding:10px 12px}.perm-summary b{display:block;color:#0f172a;margin-bottom:3px}.perm-summary span{font-size:12px;color:#475569}.perm-section{padding:0!important;overflow:hidden}.perm-section details{display:block}.perm-section summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid #e2e8f0;background:#fff}.perm-section summary::-webkit-details-marker{display:none}.perm-section summary h3{margin:0;font-size:17px}.perm-section summary p{margin:5px 0 0;color:#64748b;font-size:12px}.perm-section-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}.pill{display:inline-flex;border-radius:999px;padding:5px 9px;background:#ecfdf5;color:#047857;font-size:12px;font-weight:900}.btn-small{border:1px solid #bfdbfe;background:#eff6ff;color:#1d4ed8;border-radius:10px;padding:7px 10px;font-size:12px;font-weight:900;cursor:pointer}.muted-btn{background:#f8fafc;border-color:#e2e8f0;color:#475569}.perm-grid2{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px;padding:14px 16px;background:#f8fafc}.perm-item{border:1px solid #e2e8f0;border-radius:14px;background:#fff;padding:10px;display:flex;flex-direction:column;gap:8px;min-height:118px}.perm-main-check{display:flex!important;align-items:flex-start!important;gap:10px;margin:0!important}.perm-main-check input{width:18px!important;height:18px!important;min-height:auto!important;margin-top:3px!important}.perm-main-check span{display:block;line-height:1.7}.perm-main-check b{display:block;color:#0f172a}.perm-main-check em{display:inline-flex;margin-top:4px;border-radius:999px;background:#eef2ff;color:#3730a3;font-style:normal;font-size:11px;font-weight:900;padding:3px 7px}.perm-override{display:flex!important;gap:7px;align-items:center!important;margin:0!important;color:#64748b;font-size:12px}.perm-override input{width:15px!important;height:15px!important;min-height:auto!important;margin:0!important}.perm-override small{color:#94a3b8}.perm-item code{display:block;direction:ltr;text-align:left;color:#64748b;background:#f8fafc;border:1px solid #e2e8f0;border-radius:9px;padding:5px 7px;font-size:11px;white-space:normal;word-break:break-word}.perm-savebar{position:sticky;bottom:10px;z-index:3;display:flex;justify-content:center;gap:10px;margin:16px auto 0;padding:12px;border:1px solid #e2e8f0;background:rgba(255,255,255,.92);backdrop-filter:blur(8px);border-radius:18px;box-shadow:0 16px 40px rgba(15,23,42,.10);width:max-content;max-width:100%}.perm-savebar .primary{min-width:190px}.perm-savebar .secondary{display:inline-flex;align-items:center;justify-content:center;min-width:150px;text-decoration:none;border-radius:12px;padding:10px 14px;border:1px solid #e2e8f0;background:#f8fafc;color:#475569;font-weight:900}.permission-section,.permission-grid,.permission-card{display:revert}
@media(max-width:900px){.perm-hero,.perm-toolbar{grid-template-columns:1fr;display:grid}.perm-grid2{grid-template-columns:1fr}.perm-section summary{align-items:flex-start;flex-direction:column}.perm-savebar{width:100%;flex-direction:column}.perm-savebar .primary,.perm-savebar .secondary{width:100%}}


/* AFC v1.41 - Compact permission management UI */
.perm-page{gap:10px!important;}
.perm-hero{padding:12px 14px!important;align-items:center!important;}
.perm-hero h2{font-size:18px!important;margin:0 0 3px!important;}
.perm-hero p{font-size:12px!important;margin:0!important;line-height:1.6!important;}
.perm-mode-tabs a{border-radius:10px!important;padding:7px 11px!important;font-size:12px!important;min-height:32px!important;}
.perm-toolbar{grid-template-columns:minmax(190px,260px) 1fr minmax(190px,260px)!important;gap:9px!important;padding:10px 12px!important;align-items:end!important;}
.perm-select-form label{font-size:11.5px!important;margin-bottom:3px!important;}
.perm-select-form select,.perm-search{min-height:36px!important;border-radius:10px!important;padding:6px 10px!important;font-size:12px!important;}
.perm-summary{padding:7px 10px!important;border-radius:12px!important;}
.perm-summary b{font-size:12.5px!important;margin-bottom:0!important;}
.perm-summary span{font-size:11px!important;}
.perm-section{margin-bottom:10px!important;border-radius:14px!important;}
.perm-section summary{padding:9px 12px!important;gap:8px!important;min-height:54px!important;}
.perm-section summary h3{font-size:14.5px!important;margin:0!important;}
.perm-section summary p{font-size:11px!important;margin:2px 0 0!important;line-height:1.45!important;}
.perm-section-actions{gap:6px!important;}
.perm-section-actions .pill{font-size:10.5px!important;padding:3px 7px!important;}
.btn-small{border-radius:9px!important;padding:5px 8px!important;font-size:11px!important;min-height:28px!important;}
.perm-grid2{grid-template-columns:repeat(auto-fill,minmax(190px,1fr))!important;gap:8px!important;padding:10px 12px!important;background:#f8fafc!important;}
.perm-item{min-height:0!important;padding:8px 9px!important;border-radius:12px!important;gap:6px!important;text-align:right!important;direction:rtl!important;box-shadow:0 4px 12px rgba(15,23,42,.025)!important;}
.perm-main-check{display:flex!important;flex-direction:row!important;align-items:flex-start!important;justify-content:flex-start!important;gap:8px!important;margin:0!important;width:100%!important;direction:rtl!important;text-align:right!important;}
.perm-main-check input[type=checkbox]{appearance:auto!important;-webkit-appearance:auto!important;width:16px!important;height:16px!important;min-width:16px!important;max-width:16px!important;min-height:16px!important;max-height:16px!important;margin:4px 0 0 0!important;padding:0!important;flex:0 0 16px!important;border-radius:4px!important;}
.perm-main-check span{flex:1 1 auto!important;min-width:0!important;line-height:1.55!important;}
.perm-main-check b{font-size:12.2px!important;white-space:normal!important;}
.perm-main-check em{font-size:10px!important;padding:2px 6px!important;margin-top:3px!important;}
.perm-override{font-size:10.8px!important;gap:5px!important;line-height:1.4!important;}
.perm-override input[type=checkbox]{width:13px!important;height:13px!important;min-height:13px!important;min-width:13px!important;}
.perm-override small{font-size:10px!important;}
.perm-item code{font-size:10px!important;padding:4px 6px!important;border-radius:8px!important;line-height:1.35!important;max-height:36px!important;overflow:hidden!important;text-overflow:ellipsis!important;}
.perm-savebar{padding:9px 10px!important;border-radius:14px!important;margin-top:10px!important;gap:8px!important;}
.perm-savebar .primary{min-width:160px!important;min-height:36px!important;}
.perm-savebar .secondary{min-width:130px!important;min-height:36px!important;padding:8px 12px!important;border-radius:10px!important;}
@media(min-width:1200px){.perm-grid2{grid-template-columns:repeat(4,minmax(0,1fr))!important;}}
@media(max-width:900px){.perm-toolbar{grid-template-columns:1fr!important}.perm-grid2{grid-template-columns:1fr!important}.perm-section summary{flex-direction:column!important;align-items:stretch!important}.perm-section-actions{justify-content:flex-start!important}}

/* AFC v1.50 - UI consistency fixes */
.button{background:var(--afc-primary);color:#fff;border:1px solid var(--afc-primary2);border-radius:10px;padding:8px 12px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;cursor:pointer;font-family:inherit!important;font-weight:var(--afc-fw-button);font-size:12.5px;line-height:1.3;min-height:36px;margin:0}.button.secondary{background:#fff!important;color:#0f172a!important;border-color:var(--afc-border2)!important}.actions form,.row-actions form,.role-actions form{display:inline-flex!important;align-items:center!important;margin:0!important}.actions button,.actions .btn,.actions .button,.row-actions button,.row-actions .btn,.row-actions .button,.role-actions button,.role-actions .btn,.role-actions .button{margin:0!important;vertical-align:middle!important;align-self:center!important}.status-fa-active::before{content:"فعال"}.status-fa-inactive::before{content:"غیرفعال"}


/* AFC v1.53 - transfer workflow and site stock polish */
.perm-toolbar{display:grid;grid-template-columns:minmax(220px,1fr) minmax(220px,1fr);gap:12px;align-items:end!important}
.perm-toolbar .perm-search{grid-column:1/-1}
.perm-select-form{display:grid!important;grid-template-columns:auto minmax(220px,1fr)!important;align-items:center!important;gap:8px!important;margin:0!important}
.perm-select-form label{margin:0!important;color:#64748b;font-size:12px;font-weight:800;white-space:nowrap}
.perm-select-form select{width:100%;min-height:40px!important;margin:0!important}
.stock-expand-box>.actions,.inventory-detail-actions{margin-top:10px!important;display:flex;gap:8px;align-items:center;justify-content:flex-end}
@media(max-width:760px){.perm-toolbar{grid-template-columns:1fr}.perm-select-form{grid-template-columns:1fr!important}.perm-select-form label{margin-bottom:4px!important}}

/* AFC v1.53 - site stock badges */
.site-stock-list{display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:flex-start;min-width:160px}
.site-stock-badge{display:inline-flex;gap:4px;align-items:center;border:1px solid #e2e8f0;border-radius:999px;padding:4px 8px;font-size:12px;background:#f8fafc;color:#334155;white-space:nowrap}
.site-stock-badge.ok{background:#ecfdf5;border-color:#bbf7d0;color:#047857}
.site-stock-badge.bad{background:#fff1f2;border-color:#fecdd3;color:#be123c}
.transfer-status-pending_accept{background:#fff7ed;color:#c2410c}
.transfer-status-in_transit{background:#eff6ff;color:#1d4ed8}
.transfer-status-received{background:#ecfdf5;color:#047857}
.transfer-status-canceled{background:#f1f5f9;color:#64748b}
/* AFC v1.54 - connected site stock columns in inventory detail */
.site-stock-cell{display:inline-flex;align-items:center;justify-content:center;min-width:74px;border-radius:999px;padding:3px 9px;font-size:12px;font-weight:700;border:1px solid #e2e8f0;background:#f8fafc;color:#475569;white-space:nowrap}
.site-stock-cell.ok{background:#ecfdf5;border-color:#bbf7d0;color:#047857}
.site-stock-cell.bad{background:#fff1f2;border-color:#fecdd3;color:#be123c}
.site-stock-cell.empty{background:#f8fafc;border-color:#e2e8f0;color:#94a3b8}
.stock-expand-table th,.stock-expand-table td{white-space:nowrap}
/* AFC v1.55 - product attributes and variant picker polish */
.toggle-inline{display:inline-flex;align-items:center;gap:6px;padding:9px 12px;border:1px solid var(--line);border-radius:12px;background:#fff;font-weight:800;color:#334155;white-space:nowrap}
.toggle-inline input{width:auto;margin:0}
.variant-picker-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;margin-top:10px}
.variant-choice{display:flex!important;flex-direction:column;align-items:flex-start;gap:6px;text-align:right;min-height:70px;justify-content:center}
.variant-choice small{color:#64748b;font-size:12px}
.product-attr-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:999px;background:#eef2ff;color:#3730a3;font-size:12px;font-weight:800}

/* AFC v1.56 - compact variant toggle and product attributes polish */
.pos-products-head .sort-pills{align-items:center!important;gap:8px!important;}
.toggle-inline{min-height:40px!important;padding:7px 10px!important;border-radius:12px!important;font-size:12.5px!important;line-height:1.4!important;background:#fff!important;box-shadow:none!important;}
.toggle-inline input[type="checkbox"]{width:16px!important;height:16px!important;min-height:0!important;padding:0!important;appearance:auto!important;accent-color:#2563eb!important;flex:0 0 auto!important;}
.product-attributes-hero{margin-bottom:14px!important;}
.product-attributes-grid{grid-template-columns:360px minmax(0,1fr)!important;align-items:start!important;gap:14px!important;}
.product-attribute-form .row{grid-template-columns:1fr!important;}
.product-attribute-list table{min-width:520px!important;}
.variant-picker-grid .variant-choice{align-items:stretch!important;text-align:right!important;}
@media(max-width:900px){.product-attributes-grid{grid-template-columns:1fr!important;}}


/* AFC v1.57 - new sale variant ajax stability */
.pos-products.afc-products-loading{position:relative;pointer-events:none;opacity:.75}
.pos-products.afc-products-loading:after{content:'در حال بروزرسانی محصولات...';position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.72);backdrop-filter:blur(2px);border-radius:18px;font-weight:800;color:#1e40af;z-index:30}
#quick-show-variants:disabled{opacity:.55;cursor:wait}
.variant-picker-grid .error{grid-column:1/-1}

/* AFC v1.58 - new sale product toolbar polish */
.pos-products-head{align-items:flex-start!important;gap:8px!important}
.pos-products-head h2{margin:0!important;line-height:1.8!important}
.pos-products-head .sort-pills{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;align-items:stretch!important;width:100%!important;max-width:340px!important}
.pos-products-head .toggle-inline{grid-column:1 / -1!important;justify-content:flex-start!important;min-height:34px!important;height:34px!important;padding:5px 8px!important;font-size:12px!important;border-radius:10px!important}
.pos-products-head .sort-pills .btn{height:38px!important;min-height:38px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;padding:0 10px!important;font-size:12px!important;border-radius:10px!important;white-space:nowrap!important}
.pos-products-head .sort-pills [data-new-sale-sort="recent"]{grid-column:1 / -1!important;width:100%!important}
.variant-picker-grid .error{padding:12px 14px;border-radius:12px;background:#fff1f2;border:1px solid #fecdd3;color:#be123c;font-weight:800}


/* AFC v1.59 - compact variant picker + product filter alignment */
.pos-products-head{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:10px!important;
}
.pos-products-head h2{
  width:100%!important;
  text-align:right!important;
  margin:0!important;
}
.pos-products-head .sort-pills{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:8px!important;
  width:100%!important;
  max-width:none!important;
  align-items:stretch!important;
}
.pos-products-head .toggle-inline{
  grid-column:1 / -1!important;
  justify-self:start!important;
  width:auto!important;
  height:32px!important;
  min-height:32px!important;
  padding:4px 8px!important;
  border-radius:10px!important;
  margin:0!important;
}
.pos-products-head .sort-pills .btn,
.pos-products-head .sort-pills [data-new-sale-sort="recent"]{
  grid-column:auto!important;
  width:100%!important;
  min-width:0!important;
  height:38px!important;
  min-height:38px!important;
  padding:0 8px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  white-space:nowrap!important;
}
#variantPickerModal{
  align-items:center!important;
  justify-content:center!important;
}
#variantPickerModal .modal-card{
  width:min(520px,calc(100vw - 44px))!important;
  max-width:520px!important;
  max-height:min(420px,calc(100vh - 44px))!important;
  border-radius:20px!important;
  overflow:hidden!important;
  padding:0!important;
  display:flex!important;
  flex-direction:column!important;
}
#variantPickerModal .modal-head{
  flex:0 0 auto!important;
  padding:12px 14px!important;
  margin:0!important;
}
#variantPickerModal #variantPickerBody{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow:auto!important;
  padding:12px 14px 14px!important;
}
#variantPickerModal .variant-picker-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:8px!important;
  margin:0!important;
}
#variantPickerModal .variant-choice{
  min-height:70px!important;
  padding:9px 8px!important;
  border-radius:12px!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
}
#variantPickerModal .variant-choice b{font-size:15px!important;line-height:1.3!important;}
#variantPickerModal .variant-choice small{font-size:11px!important;line-height:1.8!important;}
#variantPickerModal .error,
#variantPickerModal .muted{
  grid-column:1 / -1!important;
}
@media(max-width:560px){
  #variantPickerModal .variant-picker-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .pos-products-head .sort-pills{grid-template-columns:1fr!important;}
}

/* AFC v1.60 - Inventory Transfer UX */
.transfer-modal-card{width:min(1360px,calc(100vw - 24px))!important;max-height:calc(100vh - 32px)!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}.transfer-new-form{display:flex!important;flex-direction:column!important;min-height:0!important;overflow:hidden!important}.transfer-ux-grid{display:grid;grid-template-columns:420px minmax(0,1fr);gap:18px;padding:16px 18px 90px;overflow:auto;min-height:0}.transfer-product-panel,.transfer-form-panel{border:1px solid #dbe3ee;border-radius:18px;background:#fff;padding:14px}.transfer-panel-head,.transfer-cart-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.transfer-panel-head h3,.transfer-cart-head h3{margin:0}.compact-check{display:inline-flex!important;align-items:center!important;gap:6px!important;font-size:13px!important;white-space:nowrap}.compact-check input{width:15px!important;height:15px!important;min-height:auto!important}.transfer-search-input{height:42px!important;margin-bottom:10px!important}.transfer-filter-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:10px}.transfer-filter-row .secondary{height:38px!important;padding:0 8px!important;font-size:13px!important}.transfer-filter.active{background:#2563eb!important;color:#fff!important;border-color:#2563eb!important}.transfer-product-list{max-height:500px;overflow:auto;display:grid;gap:8px;padding-left:3px}.transfer-product-card{display:block;width:100%;text-align:right;background:#f8fafc;border:1px solid #dbe3ee;border-radius:14px;padding:10px 12px;cursor:pointer;color:#0f172a}.transfer-product-card:hover{background:#eff6ff;border-color:#93c5fd}.transfer-product-card b{display:block;font-size:14px}.transfer-product-card small,.transfer-product-card span{display:block;margin-top:3px;color:#64748b}.transfer-empty{padding:14px;text-align:center;border:1px dashed #cbd5e1;border-radius:14px;background:#f8fafc}.transfer-meta-row{margin-bottom:12px}.transfer-cart-wrap{max-height:260px;overflow:auto}.transfer-items-table input[type=number]{max-width:92px}.modal-actions{position:sticky!important;bottom:0!important;z-index:10!important;background:#fff!important;border-top:1px solid #e2e8f0!important;margin:0!important;padding:12px 18px!important;display:flex!important;justify-content:flex-end!important;gap:10px!important}.modal-actions button{min-width:160px;height:42px}.transfer-variant-panel{width:min(560px,calc(100vw - 48px))!important;max-height:calc(100vh - 90px)!important}.compact-variant-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(130px,1fr))!important;gap:8px!important;padding:14px!important;overflow:auto!important}.variant-item.compact{grid-template-columns:1fr!important;text-align:center!important;min-height:76px!important}.mini-danger{min-width:42px!important;padding:7px 10px!important}@media(max-width:980px){.transfer-ux-grid{grid-template-columns:1fr}.transfer-product-list{max-height:280px}.transfer-filter-row{grid-template-columns:1fr}}


/* AFC v1.63 - Transfer variant modal must float above transfer modal */
#transfer-variant-modal{z-index:100200!important;}
#transfer-variant-modal.open{display:flex!important;align-items:center!important;justify-content:center!important;}
#transfer-variant-modal .afc-modal-backdrop{background:rgba(15,23,42,.18)!important;backdrop-filter:none!important;}
#transfer-variant-modal .transfer-variant-panel{width:min(540px,calc(100vw - 44px))!important;max-height:calc(100vh - 84px)!important;z-index:100201!important;box-shadow:0 24px 70px rgba(15,23,42,.28)!important;}
#transfer-variant-modal .compact-variant-grid{grid-template-columns:repeat(auto-fit,minmax(96px,1fr))!important;gap:8px!important;max-height:320px!important;overflow:auto!important;}
#transfer-variant-modal .variant-item.compact{min-height:68px!important;border-radius:12px!important;cursor:pointer!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:4px!important;}
#transfer-variant-modal .variant-item.compact b{font-size:16px!important;}
#transfer-variant-modal .variant-item.compact small{font-size:12px!important;color:#64748b!important;}
#transfer-variant-modal .variant-item.compact:not(.disabled):hover{background:#eff6ff!important;border-color:#93c5fd!important;}
#transfer-variant-modal .variant-item.compact.disabled{opacity:.55!important;cursor:not-allowed!important;background:#f8fafc!important;}

/* AFC v1.64 - Transfer variant modal final layout fix */
#transfer-variant-modal{
  position:fixed!important;
  inset:0!important;
  z-index:999999!important;
  display:none!important;
  align-items:center!important;
  justify-content:center!important;
  padding:18px!important;
  background:rgba(15,23,42,.34)!important;
  box-sizing:border-box!important;
}
#transfer-variant-modal.open{
  display:flex!important;
}
#transfer-variant-modal .afc-modal-backdrop{
  position:absolute!important;
  inset:0!important;
  background:transparent!important;
  backdrop-filter:none!important;
}
#transfer-variant-modal .transfer-variant-panel{
  position:relative!important;
  z-index:1000000!important;
  width:min(560px,calc(100vw - 40px))!important;
  max-width:560px!important;
  height:auto!important;
  max-height:min(520px,calc(100vh - 72px))!important;
  margin:0!important;
  background:#fff!important;
  border:1px solid #dbe3ee!important;
  border-radius:22px!important;
  box-shadow:0 28px 80px rgba(15,23,42,.30)!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
  transform:none!important;
}
#transfer-variant-modal .afc-modal-head{
  flex:0 0 auto!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  padding:14px 18px!important;
  border-bottom:1px solid #e2e8f0!important;
  background:#fff!important;
  position:relative!important;
  top:auto!important;
  margin:0!important;
}
#transfer-variant-modal .afc-modal-head h2{
  font-size:17px!important;
  line-height:1.8!important;
  margin:0!important;
  white-space:normal!important;
}
#transfer-variant-modal #transfer-variant-list.compact-variant-grid{
  width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
  flex:1 1 auto!important;
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(96px,1fr))!important;
  align-items:stretch!important;
  justify-items:stretch!important;
  gap:10px!important;
  padding:16px!important;
  overflow:auto!important;
  max-height:360px!important;
  direction:rtl!important;
}
#transfer-variant-modal #transfer-variant-list.compact-variant-grid:empty{
  display:block!important;
}
#transfer-variant-modal .variant-item.compact{
  width:100%!important;
  min-width:0!important;
  min-height:76px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:5px!important;
  padding:10px 8px!important;
  border:1px solid #bfdbfe!important;
  border-radius:14px!important;
  background:#2563eb!important;
  color:#fff!important;
  text-align:center!important;
  cursor:pointer!important;
  box-sizing:border-box!important;
}
#transfer-variant-modal .variant-item.compact b{
  color:#fff!important;
  font-size:17px!important;
  line-height:1.2!important;
}
#transfer-variant-modal .variant-item.compact small{
  color:#dbeafe!important;
  font-size:12px!important;
  line-height:1.5!important;
}
#transfer-variant-modal .variant-item.compact:not(.disabled):hover{
  background:#1d4ed8!important;
  border-color:#1d4ed8!important;
}
#transfer-variant-modal .variant-item.compact.disabled{
  background:#f1f5f9!important;
  border-color:#e2e8f0!important;
  color:#94a3b8!important;
  cursor:not-allowed!important;
  opacity:1!important;
}
#transfer-variant-modal .variant-item.compact.disabled b,
#transfer-variant-modal .variant-item.compact.disabled small{
  color:#94a3b8!important;
}
#transfer-variant-modal .error,
#transfer-variant-modal .muted{
  grid-column:1/-1!important;
  width:100%!important;
  box-sizing:border-box!important;
  padding:12px 14px!important;
  border-radius:14px!important;
}
@media(max-width:560px){
  #transfer-variant-modal #transfer-variant-list.compact-variant-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}

/* AFC v1.66 transfer workflow final polish */
.transfer-status-rejected{background:#fee2e2;color:#991b1b}
.transfer-alert-rejected{border-color:#fecaca;background:#fff7f7}
.transfer-alert .sale-row-actions{gap:8px;justify-content:flex-start}
.transfer-alert form{display:inline-flex;margin:0}

/* AFC v1.67 - sales detail, Jalali range filter, receipt print polish */
.sales-filter-card{margin-bottom:12px!important}
.sale-view-meta>div{background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:11px 12px}
.sale-view-meta small{display:block;color:#64748b;margin-bottom:4px;font-weight:700}
.sale-view-meta b{font-size:14px;color:#0f172a}
.sticky-note-card textarea{min-height:86px;background:#fffef0;border-color:#fde68a}
.sale-notes{display:grid;gap:9px;margin-top:10px}
.sale-note{background:#fff8c5;border:1px solid #facc15;border-radius:14px;padding:10px 12px;box-shadow:0 8px 18px rgba(234,179,8,.10)}
.sale-note p{margin:0 0 7px;white-space:pre-wrap;color:#422006}
.sale-note small{color:#854d0e;font-weight:700}
.receipt-doc{width:80mm;max-width:80mm;margin:0 auto;background:#fff;color:#111;padding:4mm;font-size:11px;line-height:1.55;box-shadow:0 10px 28px rgba(15,23,42,.08);border:1px solid #e5e7eb;border-radius:10px}
.receipt-doc .receipt-head{text-align:center;border-bottom:1px dashed #111;padding-bottom:6px;margin-bottom:7px}
.receipt-doc .receipt-head h2{font-size:16px;margin:0 0 3px}
.receipt-doc .receipt-meta{display:grid;gap:2px;border-bottom:1px dashed #aaa;padding-bottom:6px;margin-bottom:7px}
.receipt-doc table{border:0;border-radius:0;font-size:10.5px}
.receipt-doc th,.receipt-doc td{padding:4px 2px;border-bottom:1px dashed #ddd;font-size:10.5px;background:#fff}
.receipt-doc .receipt-total{text-align:left;font-size:14px;margin-top:8px;font-weight:900;border-top:1px dashed #111;padding-top:7px}
.receipt-doc .receipt-foot{text-align:center;border-top:1px dashed #aaa;margin-top:8px;padding-top:6px;color:#475569}
@media print{
  @page{size:80mm auto;margin:0}
  html,body{width:80mm!important;min-width:80mm!important;background:#fff!important;margin:0!important;padding:0!important}
  .sidebar,.topbar,.no-print,.tabs,.credit{display:none!important}
  .app,.content{display:block!important;margin:0!important;width:80mm!important;max-width:80mm!important;padding:0!important}
  .content>*{max-width:80mm!important;margin:0!important}
  .card{box-shadow:none!important;border:0!important;border-radius:0!important;margin:0!important}
  .print-doc,.receipt-doc{width:80mm!important;max-width:80mm!important;margin:0!important;padding:4mm!important;border:0!important;box-shadow:none!important;border-radius:0!important}
  .print-doc:not(.receipt-doc){font-size:11px!important}
  .print-doc table{font-size:10.5px!important}
  .print-doc th,.print-doc td{padding:4px 2px!important;font-size:10.5px!important}
}


/* AFC v1.68 - Jalali picker, customer history, receipt print */
.afc-jdp{position:absolute;z-index:10000;width:270px;background:#fff;border:1px solid #dbe3ee;border-radius:16px;box-shadow:0 18px 45px rgba(15,23,42,.18);padding:10px;direction:rtl}
.afc-jdp-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.afc-jdp-head button,.afc-jdp-actions button{border:1px solid #e2e8f0;background:#f8fafc;border-radius:10px;padding:6px 10px;cursor:pointer}.afc-jdp-week,.afc-jdp-days{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;text-align:center}.afc-jdp-week span{font-size:12px;color:#64748b}.afc-jdp-days button{border:0;background:#fff;border-radius:10px;padding:7px 0;cursor:pointer}.afc-jdp-days button:hover{background:#eff6ff}.afc-jdp-actions{display:flex;gap:6px;margin-top:8px}.customer-history-inline{align-items:center;gap:8px;margin-top:6px}.customer-history-inline small{color:#64748b}
@media print{body{background:#fff!important}.app,.content,.page,.main{display:block!important;margin:0!important;padding:0!important;box-shadow:none!important}.sidebar,.topbar,.no-print,.actions.no-print{display:none!important}.receipt-doc{font-family:'Vazirmatn','B Yekan',Tahoma,Arial,sans-serif!important;width:80mm!important;max-width:80mm!important;min-width:80mm!important;margin:0!important;padding:4mm!important;color:#000!important;background:#fff!important;border:0!important;box-shadow:none!important;border-radius:0!important}.receipt-doc table{width:100%!important;border-collapse:collapse!important}.receipt-doc th,.receipt-doc td{border:0!important;border-bottom:1px dashed #999!important}.receipt-doc .receipt-head{border-bottom:1px dashed #000!important}}


/* AFC v1.69 - visual corrections */
.afc-jdp{background:#fff!important;border-color:#cbd5e1!important;box-shadow:0 22px 55px rgba(15,23,42,.22)!important;color:#0f172a!important}
.afc-jdp-head b{color:#0f172a!important;font-size:14px!important}
.afc-jdp-head button,.afc-jdp-actions button{background:#f8fafc!important;color:#334155!important;border:1px solid #dbe3ee!important;min-width:34px!important;opacity:1!important}
.afc-jdp-head button:hover,.afc-jdp-actions button:hover{background:#e0ecff!important;color:#1d4ed8!important;border-color:#bfdbfe!important}
.afc-jdp-week span{color:#475569!important;font-weight:800!important}
.afc-jdp-days button{background:#fff!important;color:#0f172a!important;border:1px solid transparent!important;opacity:1!important;font-weight:700!important}
.afc-jdp-days button:hover{background:#eff6ff!important;border-color:#bfdbfe!important;color:#1d4ed8!important}
.afc-jdp-actions{justify-content:flex-end!important}.afc-jdp-actions button{font-weight:800!important}
.site-view-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.site-view-actions form{display:inline-flex;margin:0}
@media print{
  @page{size:80mm auto;margin:0!important}
  html,body{width:80mm!important;max-width:80mm!important;min-width:80mm!important;height:auto!important;margin:0!important;padding:0!important;background:#fff!important;overflow:visible!important}
  .receipt-page,.receipt-page body{width:80mm!important;margin:0!important;padding:0!important;background:#fff!important}
  .receipt-doc{width:80mm!important;max-width:80mm!important;min-width:80mm!important;margin:0!important;padding:4mm!important;box-sizing:border-box!important;border:0!important;border-radius:0!important;box-shadow:none!important;page-break-after:auto!important;break-after:auto!important}
}
/* AFC v1.70 - receipt and sale note polish */
.sticky-note-card-top{border:1px solid #fde68a!important;background:linear-gradient(180deg,#fffbea,#fff)!important;box-shadow:0 10px 24px rgba(245,158,11,.12)!important}
.sticky-note-card-top h2{display:flex;align-items:center;gap:8px}.sticky-note-card-top h2:before{content:'📝';font-size:18px}.sale-note{position:relative}.sale-note-delete{margin-top:8px}.sale-note-delete button{font-size:12px;padding:6px 10px;border-radius:10px}

/* AFC v1.71 - sale receipt and view layout polish */
.sale-view-top-layout{display:grid;grid-template-columns:340px minmax(0,1fr);gap:16px;align-items:start;direction:rtl}
.sale-view-top-layout>*{direction:rtl}
.sale-view-side-notes{position:sticky;top:0;border:1px solid #fde68a;background:linear-gradient(180deg,#fffbeb,#fff);box-shadow:0 12px 30px rgba(245,158,11,.12)}
.sale-view-side-notes h2{display:flex;align-items:center;gap:8px;margin-bottom:12px}
.sale-view-side-notes h2:before{content:'📝';font-size:18px}
.sale-view-side-notes textarea{min-height:110px;background:#fffdf5;border-color:#fbbf24}
.sale-view-side-notes .sale-note{border:1px solid #fcd34d;background:#fff7d6;border-radius:14px;padding:12px;margin-top:10px;box-shadow:0 8px 20px rgba(245,158,11,.10)}
.sale-view-side-notes .sale-note p{font-size:14px;line-height:1.8;margin:0 0 8px;color:#1f2937;font-weight:700}
.sale-view-side-notes .sale-note small{display:block;color:#92400e;font-weight:700}
.sale-view-side-notes .sale-note-delete{margin-top:8px}
@media(max-width:980px){.sale-view-top-layout{grid-template-columns:1fr}.sale-view-side-notes{position:static;order:2}.sale-view-main-info{order:1}}


/* AFC v1.73 - unified sale/site order detail layout */
.sale-view-detail-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(280px,.85fr);gap:16px;align-items:start;margin-top:16px}
.sale-view-detail-grid .card{margin-top:0!important}
.sale-view-detail-grid table{min-width:0}
@media(max-width:980px){.sale-view-detail-grid{grid-template-columns:1fr}}

/* AFC v1.74 unified sale/site detail layout */
.sale-view-detail-grid{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(320px,.85fr)!important;gap:14px!important;align-items:start!important}
.sale-view-detail-grid .card{min-width:0!important}
.sale-view-detail-grid .table-wrap{max-width:100%!important;overflow:auto!important}
.receipt-head h2{font-weight:900}
.customer-history-inline{display:flex;gap:8px;align-items:center;margin-top:8px}
@media(max-width:900px){.sale-view-detail-grid{grid-template-columns:1fr!important}}

/* AFC v1.75 - customer history modal, clean order numbers, equal detail cards */
.customer-history-inline{display:flex!important;gap:8px;align-items:center;justify-content:flex-start;margin-top:8px;flex-wrap:wrap}
.customer-history-inline[style*="display:none"]{display:none!important}
.customer-history-inline button{border-radius:14px!important;background:#eef6ff!important;border-color:#bfdbfe!important;color:#1d4ed8!important;font-weight:900!important;padding:9px 14px!important}
.customer-history-inline small{font-weight:800;color:#64748b}
.afc-modal-lite{position:fixed;inset:0;z-index:99999;background:rgba(15,23,42,.45);display:none;align-items:center;justify-content:center;padding:18px;direction:rtl}
.afc-modal-lite.open{display:flex}
.afc-modal-lite-card{width:min(920px,96vw);max-height:88vh;overflow:auto;background:#fff;border:1px solid #dbe4f0;border-radius:22px;box-shadow:0 30px 80px rgba(15,23,42,.25);padding:18px}
.afc-modal-lite-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;border-bottom:1px solid #eef2f7;padding-bottom:12px}
.afc-modal-lite-head h2{margin:0;font-size:20px;font-weight:900}.afc-modal-lite-head button{width:38px;height:38px;border-radius:12px;border:1px solid #cbd5e1;background:#fff;font-size:22px;cursor:pointer}
.history-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px}.history-summary>div{background:#f8fafc;border:1px solid #e2e8f0;border-radius:16px;padding:12px}.history-summary small{display:block;color:#64748b;margin-bottom:6px}.history-summary b{font-weight:900;color:#0f172a}
.afc-modal-lite table{width:100%;border-collapse:collapse}.afc-modal-lite th,.afc-modal-lite td{padding:10px;border-bottom:1px solid #eef2f7;text-align:right;vertical-align:top}.afc-modal-lite th{background:#f8fafc;font-weight:900}.afc-modal-lite .btn{white-space:nowrap}
.sale-view-detail-grid{align-items:stretch!important}.sale-view-detail-grid>.card{height:100%;min-height:260px!important}.sale-view-detail-grid .table-wrap{max-height:none!important}
@media(max-width:760px){.history-summary{grid-template-columns:1fr 1fr}.afc-modal-lite-card{padding:12px}.afc-modal-lite th,.afc-modal-lite td{font-size:12px;padding:8px}}

/* AFC v1.76 - sales filters, mixed payment UI, notes wording */
.sales-filter-form{display:grid;grid-template-columns:minmax(280px,1.5fr) minmax(180px,1fr) minmax(180px,1fr) auto;gap:14px;align-items:end}
.sales-filter-search input{min-width:280px}
.sales-filter-actions{display:flex;gap:10px;align-items:center;justify-content:flex-start;align-self:end;white-space:nowrap}
.mixed-payment-cards{border:1px solid #dbeafe;background:linear-gradient(180deg,#f8fbff,#fff);border-radius:18px;padding:14px;margin:14px 0}
.mixed-payment-cards h3{margin:0 0 12px;font-size:16px;color:#0f172a}
.mixed-cards-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.mixed-payment-card{display:flex;flex-direction:column;gap:8px;border:1px solid #e2e8f0;background:#fff;border-radius:16px;padding:12px;min-height:150px;box-shadow:0 8px 22px rgba(15,23,42,.04)}
.mixed-payment-card .mixed-card-title{display:flex;align-items:center;gap:8px;font-weight:900;margin:0 0 4px;color:#1e293b}
.mixed-payment-card .mixed-card-title input{width:18px;height:18px;accent-color:#2563eb}
.mixed-payment-card input,.mixed-payment-card select{width:100%;min-height:40px}
.mixed-total-strip{margin-top:12px;border-radius:14px;background:#eff6ff;padding:10px 12px;color:#1e3a8a}
.customer-history-inline{display:flex!important;gap:8px;align-items:center;justify-content:flex-start;margin-top:8px;flex-wrap:wrap}
.customer-history-inline[style*="display:none"]{display:none!important}
.customer-history-inline button{border-radius:14px!important;background:#eef6ff!important;border-color:#bfdbfe!important;color:#1d4ed8!important;font-weight:900!important;padding:9px 14px!important}
.customer-history-inline small{font-weight:800;color:#64748b}
@media(max-width:900px){.sales-filter-form{grid-template-columns:1fr}.sales-filter-actions{justify-content:flex-start}.mixed-cards-grid{grid-template-columns:1fr}}


/* AFC v1.78 - quick POS alignment, history modal, granular note permission UI polish */
.quick-customer-row{align-items:end}.quick-customer-row>div{display:flex;flex-direction:column;justify-content:flex-end}.quick-history-cell{display:flex!important;flex-direction:column;align-items:stretch;justify-content:flex-end;gap:5px;min-height:76px}.quick-history-cell[style*="display:none"]{display:none!important}.quick-history-cell label{margin:0 0 5px}.quick-history-cell .secondary{min-height:38px;height:38px;width:100%;white-space:nowrap}.quick-history-cell small{display:block;text-align:center;min-height:18px;color:var(--afc-muted);font-weight:var(--afc-fw-button)}
.afc-modal-lite-card{position:relative}.afc-modal-lite-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.afc-modal-lite-head h2{margin:0}.afc-modal-close,.afc-modal-lite-head button{width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;border-radius:12px!important;padding:0!important;font-size:22px!important;line-height:1!important;background:#fff!important;color:#0f172a!important;border:1px solid var(--afc-border2)!important;box-shadow:0 4px 12px rgba(15,23,42,.05)}
.actions .btn,.actions button,.sales-filter-actions .btn,.sales-filter-actions button{height:38px;min-height:38px;align-self:end}form .row4>div{align-self:end}

/* AFC v1.79 - quick POS history alignment fix */
.quick-customer-row{align-items:start!important;}
.quick-customer-row>div{align-self:start!important;}
.quick-customer-row input{height:38px!important;min-height:38px!important;}
.quick-history-cell{position:relative!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;padding-top:25px!important;min-height:74px!important;margin-top:0!important;gap:0!important;}
.quick-history-cell[style*="display:none"]{display:none!important;}
.quick-history-cell label{display:none!important;}
.quick-history-cell .secondary{height:38px!important;min-height:38px!important;width:100%!important;margin:0!important;}
.quick-history-cell small{display:block!important;text-align:center!important;min-height:18px!important;line-height:18px!important;margin-top:4px!important;color:var(--afc-muted)!important;font-weight:var(--afc-fw-button)!important;}
.customer-history-inline[style*="display: none"],.customer-history-inline[style*="display:none"]{display:none!important;}

/* AFC v1.80 - final quick POS customer row alignment */
.quick-customer-row{align-items:end!important;}
.quick-customer-row>div{display:flex!important;flex-direction:column!important;justify-content:flex-end!important;align-self:end!important;}
.quick-customer-row label{min-height:22px!important;margin-bottom:6px!important;line-height:22px!important;}
.quick-customer-row input{height:38px!important;min-height:38px!important;line-height:38px!important;}
.quick-history-cell{padding-top:0!important;margin-top:0!important;min-height:auto!important;gap:4px!important;justify-content:flex-end!important;align-items:stretch!important;}
.quick-history-cell label{display:block!important;visibility:hidden!important;height:22px!important;min-height:22px!important;margin-bottom:6px!important;}
.quick-history-cell .secondary{height:38px!important;min-height:38px!important;line-height:18px!important;width:100%!important;margin:0!important;}
.quick-history-cell small{display:block!important;text-align:center!important;min-height:18px!important;line-height:18px!important;margin-top:4px!important;color:var(--afc-muted)!important;font-weight:var(--afc-fw-button)!important;}


/* AFC v1.88 - unified single Jalali date field and compact search */
.afc-search-combo{display:flex;align-items:stretch;direction:rtl;width:100%}
.afc-search-combo input{border-radius:0 12px 12px 0!important;min-width:0!important;width:100%}
.afc-search-combo button{border-radius:12px 0 0 12px!important;border:1px solid #cbd5e1;border-right:0;background:#2563eb;color:#fff;font-weight:800;padding:0 14px;min-width:72px;height:auto;white-space:nowrap;cursor:pointer}
.sales-filter-form-v187{grid-template-columns:minmax(260px,1.2fr) minmax(240px,.9fr) auto!important}
.afc-unified-date{position:relative;min-width:220px}
.afc-unified-date>label{display:block;font-weight:800;color:#334155;margin-bottom:8px}
.afc-date-display{width:100%;height:40px;border:1px solid #cbd5e1;background:#fff;border-radius:12px;padding:0 14px;text-align:center;font-weight:900;color:#0f172a;cursor:pointer;box-shadow:0 1px 4px rgba(15,23,42,.03);transition:.18s ease}
.afc-date-display:hover,.afc-unified-date.open .afc-date-display{border-color:#2563eb;box-shadow:0 0 0 4px rgba(37,99,235,.10)}
.afc-unified-date.is-range .afc-date-display{min-width:250px}
.afc-date-popover{display:none;position:absolute;z-index:60;top:calc(100% + 8px);right:0;min-width:280px;background:#fff;border:1px solid #dbe7f3;border-radius:18px;padding:12px;box-shadow:0 18px 45px rgba(15,23,42,.16)}
.afc-unified-date.open .afc-date-popover{display:block;animation:afcDatePop .16s ease-out}
@keyframes afcDatePop{from{opacity:0;transform:translateY(-6px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
.afc-date-mode-toggle{display:flex;gap:6px;background:#eef5ff;border-radius:12px;padding:4px;margin-bottom:10px}
.afc-date-mode-toggle button{flex:1;border:0;background:transparent;border-radius:10px;padding:8px 10px;font-weight:800;color:#64748b;cursor:pointer;transition:.18s ease}
.afc-date-mode-toggle button.active{background:#2563eb;color:#fff;box-shadow:0 6px 16px rgba(37,99,235,.22)}
.afc-date-fields{display:grid;grid-template-columns:1fr auto 1fr;gap:8px;align-items:center}
.afc-date-fields input{width:100%;text-align:center;font-weight:800;background:#fff!important}
.afc-date-separator{font-weight:900;color:#64748b;background:#eef2f7;border-radius:999px;padding:5px 9px}
.afc-unified-date.is-single .afc-date-separator,.afc-unified-date.is-single .afc-date-end{display:none!important}
.afc-unified-date.is-single .afc-date-fields{grid-template-columns:1fr}
@media(max-width:900px){.sales-filter-form-v187{grid-template-columns:1fr!important}.afc-date-popover{position:static;min-width:0;margin-top:8px}.afc-unified-date:not(.open) .afc-date-popover{display:none!important}.afc-date-fields{grid-template-columns:1fr!important}.afc-date-separator{display:none}.afc-unified-date.is-range .afc-date-end{display:block!important}.afc-search-combo button{min-width:64px;padding:0 10px}.sales-subtitle{display:flex;gap:6px;align-items:baseline;flex-wrap:wrap}.sales-subtitle small{font-size:12px;color:#64748b}}


/* AFC v1.89 - fixed unified date field layout + fast reports */
.sales-subtitle{display:flex;gap:6px;align-items:baseline;flex-wrap:wrap}.sales-subtitle span{font-weight:800;color:#64748b}.sales-subtitle b{font-size:18px}.sales-subtitle small{color:#64748b;font-weight:800}
.sales-filter-form-v187{display:grid!important;grid-template-columns:minmax(300px,1.35fr) minmax(260px,.95fr) auto!important;gap:14px!important;align-items:end!important}
.sales-filter-form-v187 label,.reports-filter label,.afc-unified-date>label{height:22px;line-height:22px;margin:0 0 7px!important;font-weight:900;color:#334155}
.afc-search-combo{height:40px!important;display:flex!important;align-items:stretch!important;direction:rtl!important;width:100%!important}
.afc-search-combo input{height:40px!important;min-height:40px!important;border-radius:0 12px 12px 0!important;border-left:0!important;line-height:40px!important;padding-top:0!important;padding-bottom:0!important}
.afc-search-combo button{height:40px!important;min-height:40px!important;border-radius:12px 0 0 12px!important;display:flex!important;align-items:center!important;justify-content:center!important}
.afc-unified-date{position:relative!important;min-width:0!important}
.afc-date-display-input{width:100%!important;height:40px!important;min-height:40px!important;border:1px solid #cbd5e1!important;background:#fff!important;border-radius:12px!important;padding:0 14px!important;text-align:center!important;font-weight:900!important;color:#0f172a!important;cursor:pointer!important;box-shadow:0 1px 4px rgba(15,23,42,.03)!important;transition:.18s ease!important;line-height:40px!important}
.afc-date-display-input::placeholder{color:#64748b!important;font-weight:800!important}
.afc-date-display-input:hover,.afc-date-display-input:focus,.afc-unified-date.open .afc-date-display-input{border-color:#2563eb!important;box-shadow:0 0 0 4px rgba(37,99,235,.10)!important;outline:0!important;background:#fff!important;color:#0f172a!important}
.afc-unified-date.is-range .afc-date-display-input{min-width:300px!important}
.afc-date-display{background:#fff!important;color:#0f172a!important}
.afc-date-popover{min-width:300px!important;max-width:min(360px,calc(100vw - 32px))!important}
.afc-date-popover .afc-date-fields{margin-top:8px!important}
.afc-date-fields input{height:38px!important;min-height:38px!important}
.sales-filter-actions{height:40px!important;display:flex!important;align-items:flex-end!important;gap:10px!important;align-self:end!important}
.sales-filter-actions button,.sales-filter-actions .btn{height:40px!important;min-height:40px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;margin:0!important}
@media(max-width:900px){
  .sales-filter-form-v187{grid-template-columns:1fr!important;gap:12px!important}
  .afc-date-popover{position:absolute!important;right:0!important;top:calc(100% + 8px)!important;min-width:100%!important;margin-top:0!important}
  .afc-date-fields{grid-template-columns:1fr!important}
  .afc-date-separator{display:none!important}
  .afc-unified-date.is-range .afc-date-end{display:block!important}
}


/* AFC v1.90 - reports/sales date UI polish and mobile table cleanup */
.sales-filter-card{overflow:visible!important;position:relative!important;z-index:20!important}
.sales-filter-form-v187{align-items:end!important}
.sales-filter-search,.afc-unified-date,.sales-filter-actions{align-self:end!important}
.afc-unified-date>label,.sales-filter-search>label{display:block!important;text-align:right!important;height:auto!important;margin-bottom:8px!important}
.afc-date-display-input{background:#fff!important;color:#0f172a!important;border:1px solid #cbd5e1!important;border-radius:12px!important;height:42px!important;line-height:42px!important;box-shadow:none!important}
.afc-date-display-input:focus,.afc-unified-date.open .afc-date-display-input{border-color:#2563eb!important;box-shadow:0 0 0 3px rgba(37,99,235,.12)!important}
.afc-date-popover{position:absolute!important;top:calc(100% + 10px)!important;right:0!important;z-index:9999!important;background:#fff!important;border-radius:18px!important;box-shadow:0 18px 50px rgba(15,23,42,.20)!important}
.sales-list-card,.reports-table,.card{position:relative}.sales-list-card{z-index:1!important}.reports-filter-card{overflow:visible!important;z-index:30!important;position:relative!important}.reports-filter{overflow:visible!important}.reports-filter .afc-unified-date{z-index:40!important}
@media(max-width:900px){
  .sales-filter-form-v187{grid-template-columns:1fr!important;gap:14px!important}
  .sales-filter-actions{order:3;width:100%!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important;height:auto!important}
  .sales-filter-actions button,.sales-filter-actions .btn{width:100%!important;height:42px!important}
  .afc-date-popover{position:absolute!important;left:0!important;right:0!important;width:100%!important;min-width:0!important;max-width:100%!important}
  .reports-mobile-grid{display:none!important}
  .reports-mobile-nav{margin-bottom:10px!important}
  .reports-table,.reports-table.card{border:0!important;box-shadow:none!important;background:transparent!important;padding:0!important;overflow:visible!important}
  .reports-table table,.reports-table tbody{display:block!important;background:transparent!important;border:0!important}
  .reports-table tr{display:block!important;background:#fff!important;border:1px solid #e5eaf2!important;border-radius:16px!important;margin:10px 0!important;padding:10px 14px!important;box-shadow:0 4px 14px rgba(15,23,42,.04)!important}
  .reports-table td{display:flex!important;justify-content:space-between!important;gap:14px!important;border-bottom:1px solid #eef2f7!important;padding:9px 0!important;text-align:left!important;white-space:normal!important;word-break:break-word!important}
  .reports-table td:last-child{border-bottom:0!important}
  .reports-table td:before{content:attr(data-label)!important;color:#64748b!important;font-weight:900!important;text-align:right!important;flex:0 0 auto!important;max-width:42%!important}
}


/* AFC v1.91 - reports/sales filter polish */
.sales-filter-card,.reports-top,.reports-page .card{overflow:visible!important}
.sales-filter-form-v187{display:grid!important;grid-template-columns:minmax(360px,1.2fr) minmax(300px,.9fr) auto!important;gap:12px!important;align-items:end!important;direction:rtl!important}
.sales-filter-search{min-width:0!important}.afc-search-combo{display:flex!important;align-items:center!important;width:100%!important;height:42px!important;direction:ltr!important}.afc-search-combo input{height:42px!important;min-height:42px!important;line-height:42px!important;border:1px solid #cbd5e1!important;border-left:0!important;border-radius:0 12px 12px 0!important;padding:0 14px!important;direction:rtl!important;box-sizing:border-box!important}.afc-search-combo button{height:42px!important;min-height:42px!important;line-height:42px!important;border-radius:12px 0 0 12px!important;border:1px solid #2563eb!important;background:#2563eb!important;color:#fff!important;padding:0 16px!important;min-width:78px!important;display:flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;white-space:nowrap!important}
.afc-unified-date{position:relative!important;min-width:0!important}.afc-date-display-input{height:42px!important;min-height:42px!important;line-height:42px!important;background:#fff!important;color:#0f172a!important;border:1px solid #cbd5e1!important;border-radius:12px!important;box-shadow:none!important;text-align:center!important;box-sizing:border-box!important}.afc-date-display-input:focus,.afc-unified-date.open .afc-date-display-input{border-color:#2563eb!important;box-shadow:0 0 0 3px rgba(37,99,235,.12)!important;outline:none!important}.afc-date-popover{position:absolute!important;top:calc(100% + 8px)!important;right:0!important;left:auto!important;z-index:10000!important;width:320px!important;min-width:320px!important;max-width:calc(100vw - 32px)!important;background:#fff!important;border:1px solid #dbe7f3!important;border-radius:18px!important;padding:12px!important;box-shadow:0 18px 45px rgba(15,23,42,.18)!important;margin:0!important}.afc-unified-date:not(.open) .afc-date-popover{display:none!important}.afc-date-mode-toggle{display:flex!important;gap:6px!important;background:#eef5ff!important;border-radius:12px!important;padding:4px!important;margin-bottom:10px!important}.afc-date-mode-toggle button{height:36px!important;border:0!important;border-radius:10px!important;background:transparent!important;color:#64748b!important;font-weight:900!important}.afc-date-mode-toggle button.active{background:#2563eb!important;color:#fff!important}.afc-date-fields{display:grid!important;grid-template-columns:1fr auto 1fr!important;gap:8px!important;align-items:center!important}.afc-date-fields input{height:38px!important;min-height:38px!important;text-align:center!important;border:1px solid #cbd5e1!important;border-radius:12px!important;background:#fff!important;box-shadow:none!important}.afc-unified-date.is-single .afc-date-fields{grid-template-columns:1fr!important}.afc-unified-date.is-single .afc-date-separator,.afc-unified-date.is-single .afc-date-end{display:none!important}
.reports-filter{display:grid!important;grid-template-columns:repeat(4,minmax(140px,1fr)) minmax(260px,1.15fr) 130px!important;gap:12px!important;align-items:end!important;direction:rtl!important;overflow:visible!important}.reports-filter label{margin:0!important;min-width:0!important}.reports-filter select,.reports-filter input{height:42px!important;box-sizing:border-box!important}.reports-filter .afc-unified-date>label{display:block!important}.reports-filter-submit{height:42px!important;align-self:end!important;width:130px!important;border-radius:12px!important}.reports-filter .afc-date-popover{right:0!important;left:auto!important}.report-range-note{margin-top:10px!important;text-align:left!important;color:#64748b!important;font-size:12px!important}
.reports-dashboard-highlights .reports-table{margin-top:8px!important}.reports-dashboard-highlights .reports-table table{width:100%!important;table-layout:auto!important}.reports-dashboard-highlights .reports-table th,.reports-dashboard-highlights .reports-table td{white-space:normal!important}
@media(max-width:900px){
  .sales-filter-form-v187,.reports-filter{grid-template-columns:1fr!important;gap:10px!important}.sales-filter-actions{display:flex!important;gap:8px!important}.sales-filter-actions button,.sales-filter-actions a{flex:1!important}.afc-date-popover{position:absolute!important;width:100%!important;min-width:100%!important;max-width:100%!important;right:0!important;left:0!important}.afc-date-fields{grid-template-columns:1fr!important}.afc-date-separator{display:none!important}.afc-unified-date.is-range .afc-date-end{display:block!important}.reports-filter-submit{width:100%!important}.report-range-note{text-align:right!important}.reports-mobile-nav{position:sticky!important;top:8px!important;z-index:50!important;background:rgba(248,250,252,.94)!important;backdrop-filter:blur(10px)!important;border:1px solid #e5eaf2!important;border-radius:16px!important;padding:8px!important;margin:8px 0 12px!important}.reports-mobile-select{width:100%!important;height:44px!important;border-radius:12px!important;border:1px solid #cbd5e1!important;background:#fff!important;font-weight:900!important;color:#0f172a!important;text-align:center!important}.reports-nav{display:none!important}
}

/* AFC v1.92 - stable reports/sales filters and dashboard table cleanup */
:root{--afc-control-h:42px}
.sales-filter-card,.reports-filter-card{overflow:visible!important;position:relative!important;z-index:80!important}
.sales-filter-form-v187{display:grid!important;grid-template-columns:minmax(360px,1.2fr) minmax(300px,.85fr) auto!important;gap:12px!important;align-items:end!important;direction:rtl!important}
.sales-filter-form-v187 label,.reports-filter label{display:flex!important;flex-direction:column!important;gap:7px!important;margin:0!important;justify-content:flex-end!important;min-width:0!important}
.sales-filter-search,.afc-unified-date,.sales-filter-actions{align-self:end!important;min-width:0!important}
.afc-search-combo{display:grid!important;grid-template-columns:80px minmax(0,1fr)!important;width:100%!important;height:var(--afc-control-h)!important;direction:ltr!important;align-items:stretch!important}
.afc-search-combo button{height:var(--afc-control-h)!important;min-height:var(--afc-control-h)!important;border-radius:12px 0 0 12px!important;border:1px solid #2563eb!important;background:#2563eb!important;color:#fff!important;margin:0!important;padding:0 12px!important;box-sizing:border-box!important;display:flex!important;align-items:center!important;justify-content:center!important;white-space:nowrap!important}
.afc-search-combo input{height:var(--afc-control-h)!important;min-height:var(--afc-control-h)!important;border-radius:0 12px 12px 0!important;border:1px solid #cbd5e1!important;border-left:0!important;margin:0!important;padding:0 14px!important;box-sizing:border-box!important;direction:rtl!important;width:100%!important;min-width:0!important;box-shadow:none!important;background:#fff!important}
.afc-date-display-input{height:var(--afc-control-h)!important;min-height:var(--afc-control-h)!important;line-height:var(--afc-control-h)!important;border-radius:12px!important;border:1px solid #cbd5e1!important;background:#fff!important;box-shadow:none!important;box-sizing:border-box!important;width:100%!important;display:block!important;color:#0f172a!important;text-align:center!important;font-weight:900!important}
.afc-date-display-input:focus,.afc-unified-date.open .afc-date-display-input{border-color:#2563eb!important;box-shadow:0 0 0 3px rgba(37,99,235,.12)!important;outline:0!important}
.sales-filter-actions{height:var(--afc-control-h)!important;display:flex!important;gap:10px!important;align-items:stretch!important}
.sales-filter-actions button,.sales-filter-actions .btn{height:var(--afc-control-h)!important;min-height:var(--afc-control-h)!important;margin:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;white-space:nowrap!important}
.afc-unified-date{position:relative!important}
.afc-date-popover{position:absolute!important;top:calc(100% + 8px)!important;right:0!important;left:auto!important;width:320px!important;min-width:320px!important;max-width:calc(100vw - 32px)!important;background:#fff!important;border:1px solid #dbe7f3!important;border-radius:18px!important;padding:12px!important;box-shadow:0 18px 45px rgba(15,23,42,.18)!important;margin:0!important;z-index:99999!important}
.afc-unified-date:not(.open) .afc-date-popover{display:none!important}
.reports-filter{display:grid!important;grid-template-columns:minmax(130px,.8fr) repeat(4,minmax(140px,1fr)) minmax(260px,1.15fr)!important;gap:12px!important;align-items:end!important;direction:ltr!important;overflow:visible!important}
.reports-filter>*{direction:rtl!important;min-width:0!important}
.reports-filter select,.reports-filter input,.reports-filter-submit{height:var(--afc-control-h)!important;min-height:var(--afc-control-h)!important;box-sizing:border-box!important;margin:0!important}
.reports-filter-submit{width:100%!important;border-radius:12px!important;align-self:end!important;display:flex!important;align-items:center!important;justify-content:center!important}
.report-range-note{grid-column:1/-1!important;margin-top:2px!important;text-align:right!important;color:#64748b!important;font-size:12px!important}
.reports-dashboard-highlights{align-items:stretch!important}
.reports-dashboard-highlights .card{overflow:hidden!important}
.reports-dashboard-highlights .reports-table{overflow:hidden!important;margin-top:8px!important;border-radius:14px!important;max-width:100%!important}
.reports-dashboard-highlights table{width:100%!important;min-width:0!important;table-layout:fixed!important;border-collapse:collapse!important}
.reports-dashboard-highlights th,.reports-dashboard-highlights td{white-space:normal!important;word-break:break-word!important;overflow-wrap:anywhere!important;text-align:right!important;padding:12px 14px!important}
.reports-dashboard-highlights th:nth-child(2),.reports-dashboard-highlights td:nth-child(2){width:92px!important;text-align:center!important}
.reports-dashboard-highlights th:nth-child(3),.reports-dashboard-highlights td:nth-child(3){width:140px!important;text-align:left!important}
@media(max-width:900px){
  .sales-filter-form-v187,.reports-filter{grid-template-columns:1fr!important;display:grid!important;gap:10px!important;direction:rtl!important}
  .reports-filter>*{direction:rtl!important}
  .afc-search-combo{grid-template-columns:76px minmax(0,1fr)!important}
  .sales-filter-actions{height:auto!important;display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important}
  .sales-filter-actions button,.sales-filter-actions .btn{width:100%!important;height:42px!important}
  .afc-date-popover{right:0!important;left:0!important;width:100%!important;min-width:0!important;max-width:100%!important;position:absolute!important}
  .afc-date-fields{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
  .afc-date-separator{display:none!important}
  .afc-unified-date.is-range .afc-date-end{display:block!important}
  .reports-mobile-nav{position:sticky!important;top:8px!important;z-index:60!important;background:rgba(248,250,252,.96)!important;backdrop-filter:blur(10px)!important;border:1px solid #e5eaf2!important;border-radius:16px!important;padding:8px!important;margin:8px 0 12px!important}
  .reports-mobile-select{width:100%!important;height:44px!important;border-radius:12px!important;border:1px solid #cbd5e1!important;background:#fff!important;font-weight:900!important;color:#0f172a!important;text-align:center!important}
  .reports-mobile-grid{display:none!important}
  .reports-nav{display:none!important}
  .reports-dashboard-highlights{display:grid!important;grid-template-columns:1fr!important;gap:12px!important}
  .reports-dashboard-highlights .card{padding:16px!important;overflow:visible!important}
  .reports-dashboard-highlights .reports-table,.reports-dashboard-highlights table,.reports-dashboard-highlights tbody{display:block!important;background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important}
  .reports-dashboard-highlights thead{display:none!important}
  .reports-dashboard-highlights tr{display:block!important;background:#fff!important;border:1px solid #e5eaf2!important;border-radius:16px!important;margin:10px 0!important;padding:10px 14px!important;box-shadow:0 4px 14px rgba(15,23,42,.04)!important}
  .reports-dashboard-highlights td{display:flex!important;justify-content:space-between!important;gap:14px!important;border-bottom:1px solid #eef2f7!important;padding:9px 0!important;text-align:left!important;white-space:normal!important;word-break:break-word!important}
  .reports-dashboard-highlights td:last-child{border-bottom:0!important}
  .reports-dashboard-highlights td:before{content:attr(data-label)!important;color:#64748b!important;font-weight:900!important;text-align:right!important;max-width:46%!important;flex:0 0 auto!important}
}


/* AFC v1.93 - reports stable dashboard cards + clean filters */
.reports-dashboard-highlights .card{overflow:hidden!important}
.reports-top-cards{display:grid;gap:10px;margin-top:8px}
.reports-top-card{display:grid;gap:8px;padding:12px 14px;border:1px solid #e5eaf2;border-radius:16px;background:#fff;box-shadow:0 4px 14px rgba(15,23,42,.035)}
.reports-top-card strong{display:flex;gap:8px;align-items:flex-start;line-height:1.9;color:#0f172a;font-size:14px;word-break:break-word}
.reports-top-card .rank{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:999px;background:#eef4ff;color:#2563eb;font-weight:900;font-size:12px;margin-top:2px}
.reports-top-card div{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#64748b;font-size:12px}
.reports-top-card b{color:#0f172a;font-size:13px;white-space:nowrap}
.reports-filter{grid-template-columns:130px minmax(240px,1.1fr) repeat(4,minmax(140px,1fr))!important;align-items:end!important;direction:rtl!important}
.reports-filter-submit{height:42px!important;align-self:end!important}
.reports-filter .afc-unified-date,.reports-filter label{align-self:end!important}
.reports-filter select,.reports-filter input,.reports-filter .afc-date-display-input{height:42px!important;min-height:42px!important}
.sales-filter-form-v187{align-items:end!important}
.sales-filter-search,.sales-filter-form-v187 .afc-unified-date,.sales-filter-actions{align-self:end!important}
.afc-search-combo{height:42px!important;align-items:stretch!important}
@media(max-width:900px){
  .reports-filter{grid-template-columns:1fr!important;direction:rtl!important}
  .reports-dashboard-highlights .reports-table{display:none!important}
  .reports-top-card{padding:12px!important;border-radius:15px!important}
  .reports-top-card div{display:grid;grid-template-columns:1fr;gap:4px;text-align:right}
  .reports-top-card b{white-space:normal!important}
  .sales-filter-form-v187{grid-template-columns:1fr!important;gap:10px!important}
}


/* AFC v1.96 - clean reports channel mega filter + sales filter alignment */
.sales-filter-card,.reports-page .card{overflow:visible!important}
.sales-filter-form-v187{
  display:grid!important;
  grid-template-columns:minmax(320px,1.15fr) minmax(280px,.95fr) max-content!important;
  gap:12px!important;
  align-items:end!important;
  direction:rtl!important;
}
.sales-filter-form-v187 .sales-filter-search{order:1!important;justify-self:stretch!important}
.sales-filter-form-v187 .afc-unified-date{order:2!important;justify-self:stretch!important}
.sales-filter-form-v187 .sales-filter-actions{order:3!important;justify-self:end!important;margin-right:auto!important}
.afc-search-combo{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 48px!important;
  direction:rtl!important;
  height:42px!important;
  width:100%!important;
  align-items:stretch!important;
}
.afc-search-combo input{
  grid-column:1!important;
  border:1px solid #cbd5e1!important;
  border-left:0!important;
  border-radius:0 12px 12px 0!important;
  height:42px!important;
  min-height:42px!important;
  padding:0 14px!important;
  background:#fff!important;
  width:100%!important;
  min-width:0!important;
  direction:rtl!important;
  box-sizing:border-box!important;
}
.afc-search-combo button{
  grid-column:2!important;
  width:48px!important;
  min-width:48px!important;
  height:42px!important;
  min-height:42px!important;
  border-radius:12px 0 0 12px!important;
  border:1px solid #2563eb!important;
  margin:0!important;
  padding:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
}
.afc-search-combo button:before{content:'🔍';font-size:16px;line-height:1}

.reports-filter{
  display:grid!important;
  grid-template-columns:minmax(240px,1.15fr) minmax(180px,.85fr) minmax(260px,1fr) 130px!important;
  gap:12px!important;
  align-items:end!important;
  direction:rtl!important;
  overflow:visible!important;
}
.reports-filter>*{min-width:0!important;direction:rtl!important}
.reports-filter .afc-channel-mega{order:1!important;min-width:0!important;width:100%!important;position:relative!important}
.reports-filter label{order:2!important}
.reports-filter .afc-unified-date{order:3!important}
.reports-filter-submit{order:4!important;width:130px!important;height:42px!important;justify-self:start!important}
.afc-channel-trigger{
  height:42px!important;
  width:100%!important;
  border:1px solid #cbd5e1!important;
  border-radius:12px!important;
  background:#fff!important;
  padding:0 14px!important;
  box-shadow:none!important;
  font-size:13px!important;
  text-align:right!important;
}
.afc-channel-menu{
  top:calc(100% + 8px)!important;
  right:0!important;
  left:auto!important;
  width:360px!important;
  max-width:min(360px,calc(100vw - 32px))!important;
  max-height:330px!important;
  padding:10px!important;
  border-radius:16px!important;
  border:1px solid #dbe7f3!important;
  box-shadow:0 18px 45px rgba(15,23,42,.16)!important;
  background:#fff!important;
  z-index:99999!important;
}
.afc-channel-check{
  min-height:36px!important;
  padding:8px 10px!important;
  border-radius:10px!important;
  display:flex!important;
  flex-direction:row!important;
  justify-content:flex-start!important;
  align-items:center!important;
  gap:8px!important;
  font-size:13px!important;
  line-height:1.8!important;
}
.afc-channel-check input{margin:0!important;flex:0 0 auto!important;width:16px!important;height:16px!important}
.afc-channel-check span{display:block!important;white-space:normal!important;text-align:right!important;flex:1!important}
.afc-channel-check.all{background:#eff6ff!important;margin-bottom:6px!important;color:#1d4ed8!important}
.afc-channel-check.parent{background:#f8fafc!important;margin-top:6px!important;color:#0f172a!important}
.afc-channel-children{padding:4px 16px 4px 0!important;margin:4px 8px 4px 0!important;border-right:2px solid #e2e8f0!important}
@media(max-width:900px){
  .sales-filter-form-v187,.reports-filter{grid-template-columns:1fr!important;gap:10px!important;direction:rtl!important}
  .sales-filter-form-v187 .sales-filter-search,.sales-filter-form-v187 .afc-unified-date,.sales-filter-form-v187 .sales-filter-actions{order:initial!important;width:100%!important;justify-self:stretch!important;margin:0!important}
  .sales-filter-actions{display:grid!important;grid-template-columns:1fr 1fr!important;height:auto!important;gap:8px!important}
  .sales-filter-actions button,.sales-filter-actions .btn{width:100%!important;height:42px!important}
  .reports-filter .afc-channel-mega,.reports-filter label,.reports-filter .afc-unified-date,.reports-filter-submit{order:initial!important;width:100%!important;justify-self:stretch!important}
  .reports-filter-submit{width:100%!important}
  .afc-channel-menu{position:absolute!important;width:100%!important;max-width:100%!important;right:0!important;left:0!important;max-height:300px!important}
}


/* AFC v1.97 - final clean channel mega menu + reports filter layout */
.reports-filter > label{order:2!important;display:flex!important;flex-direction:column!important;gap:7px!important;margin:0!important;justify-content:flex-end!important;min-width:0!important;}
.reports-filter > .afc-channel-mega{order:1!important;}
.reports-filter > .afc-unified-date{order:3!important;}
.reports-filter > .reports-filter-submit{order:4!important;}
.reports-filter .afc-channel-menu label,
.reports-filter .afc-channel-check{
  order:initial!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:9px!important;
  width:100%!important;
  height:auto!important;
  min-height:36px!important;
  margin:0!important;
  padding:8px 10px!important;
  color:#0f172a!important;
  font-size:13px!important;
  font-weight:850!important;
  line-height:1.6!important;
  text-align:right!important;
  box-sizing:border-box!important;
}
.reports-filter .afc-channel-check input[type=checkbox],
.afc-channel-check input[type=checkbox]{
  appearance:none!important;
  -webkit-appearance:none!important;
  display:inline-grid!important;
  place-content:center!important;
  width:17px!important;
  min-width:17px!important;
  max-width:17px!important;
  height:17px!important;
  min-height:17px!important;
  max-height:17px!important;
  flex:0 0 17px!important;
  padding:0!important;
  margin:0!important;
  border:1.5px solid #cbd5e1!important;
  border-radius:5px!important;
  background:#fff!important;
  box-shadow:none!important;
  vertical-align:middle!important;
}
.reports-filter .afc-channel-check input[type=checkbox]:checked,
.afc-channel-check input[type=checkbox]:checked{
  background:#2563eb!important;
  border-color:#2563eb!important;
}
.reports-filter .afc-channel-check input[type=checkbox]:checked:after,
.afc-channel-check input[type=checkbox]:checked:after{
  content:'✓'!important;
  color:#fff!important;
  font-size:12px!important;
  font-weight:900!important;
  line-height:1!important;
}
.reports-filter .afc-channel-check span,
.afc-channel-check span{
  flex:1 1 auto!important;
  display:block!important;
  min-width:0!important;
  text-align:right!important;
  white-space:normal!important;
}
.reports-filter .afc-channel-check.all{background:#eff6ff!important;color:#1d4ed8!important;margin-bottom:6px!important;}
.reports-filter .afc-channel-check.parent{background:#f8fafc!important;color:#334155!important;margin-top:7px!important;}
.reports-filter .afc-channel-children{display:grid!important;gap:2px!important;padding:4px 16px 4px 0!important;margin:4px 8px 4px 0!important;border-right:2px solid #e2e8f0!important;}
.reports-filter .afc-channel-menu{
  top:calc(100% + 8px)!important;
  right:0!important;
  left:auto!important;
  width:min(360px,calc(100vw - 32px))!important;
  max-height:340px!important;
  overflow:auto!important;
  background:#fff!important;
  border:1px solid #dbe7f3!important;
  border-radius:16px!important;
  padding:10px!important;
  box-shadow:0 18px 45px rgba(15,23,42,.16)!important;
  z-index:999999!important;
}
@media(max-width:900px){
  .reports-filter{grid-template-columns:1fr!important;}
  .reports-filter > label,.reports-filter > .afc-channel-mega,.reports-filter > .afc-unified-date,.reports-filter > .reports-filter-submit{order:initial!important;width:100%!important;justify-self:stretch!important;}
  .reports-filter .afc-channel-menu{position:absolute!important;width:100%!important;max-width:100%!important;right:0!important;left:0!important;max-height:310px!important;}
}


/* AFC v1.98 - mobile sidebar/report filter final polish */
@media(max-width:1000px){
  body.sidebar-open .sidebar-backdrop{z-index:999990!important;display:block!important;background:rgba(15,23,42,.42)!important;}
  body.sidebar-open .sidebar{z-index:1000000!important;}
  body.sidebar-open .content,body.sidebar-open .topbar,body.sidebar-open .sales-filter-card,body.sidebar-open .reports-filter-card{z-index:auto!important;}
}

/* Sales filter should never float above the opened mobile sidebar */
.sales-filter-card,.reports-filter-card{z-index:10!important;}
body:not(.sidebar-open) .sales-filter-card,body:not(.sidebar-open) .reports-filter-card{position:relative!important;overflow:visible!important;}

/* Reports filter clean grid */
.reports-filter-card{overflow:visible!important;}
.reports-filter{display:grid!important;grid-template-columns:minmax(260px,1.2fr) minmax(190px,.85fr) minmax(220px,1fr) 150px!important;gap:12px!important;align-items:end!important;direction:rtl!important;overflow:visible!important;}
.reports-filter > *{min-width:0!important;}
.reports-filter > label{display:flex!important;flex-direction:column!important;gap:7px!important;margin:0!important;font-size:12px!important;font-weight:800!important;color:#475569!important;position:relative!important;z-index:1!important;}
.reports-filter select,.reports-filter input,.reports-filter .afc-channel-trigger{height:42px!important;border-radius:12px!important;border:1px solid #cbd5e1!important;background:#fff!important;box-shadow:none!important;}
.reports-filter-submit{height:42px!important;margin:0!important;width:150px!important;justify-self:start!important;}

/* Channel mega menu: remove native checkbox visual completely and draw our own box */
.afc-channel-check{position:relative!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;min-height:38px!important;padding:8px 10px!important;border-radius:11px!important;line-height:1.6!important;overflow:hidden!important;}
.afc-channel-check input[type=checkbox]{position:absolute!important;opacity:0!important;appearance:none!important;-webkit-appearance:none!important;width:1px!important;height:1px!important;min-width:1px!important;min-height:1px!important;max-width:1px!important;max-height:1px!important;margin:0!important;padding:0!important;pointer-events:none!important;clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;}
.afc-channel-check span{display:flex!important;align-items:center!important;gap:8px!important;min-width:0!important;flex:1 1 auto!important;text-align:right!important;white-space:normal!important;}
.afc-channel-check span:before{content:''!important;display:inline-grid!important;place-content:center!important;width:18px!important;height:18px!important;min-width:18px!important;border:1.5px solid #cbd5e1!important;border-radius:6px!important;background:#fff!important;color:#fff!important;font-size:12px!important;font-weight:900!important;line-height:1!important;}
.afc-channel-check input[type=checkbox]:checked + span:before{content:'✓'!important;background:#2563eb!important;border-color:#2563eb!important;}
.afc-channel-check.all{background:#eff6ff!important;color:#1d4ed8!important;margin-bottom:6px!important;}
.afc-channel-check.parent{background:#f8fafc!important;color:#334155!important;margin-top:6px!important;}
.afc-channel-children{display:grid!important;gap:3px!important;padding:4px 18px 4px 0!important;margin:4px 8px 4px 0!important;border-right:2px solid #e2e8f0!important;}
.afc-channel-menu{overflow:auto!important;}

/* Mobile reports: stacked, readable, no overlap */
@media(max-width:700px){
  .reports-page{padding:0!important;gap:12px!important;}
  .reports-filter-card{padding:18px 14px!important;border-radius:18px!important;overflow:visible!important;}
  .reports-filter{grid-template-columns:1fr!important;gap:13px!important;align-items:stretch!important;}
  .reports-filter > .afc-channel-mega,.reports-filter > label,.reports-filter > .afc-unified-date,.reports-filter > .reports-filter-submit{width:100%!important;justify-self:stretch!important;order:initial!important;}
  .reports-filter label,.afc-channel-mega > label,.reports-filter .afc-unified-date > label{font-size:13px!important;color:#475569!important;margin:0 0 6px!important;font-weight:900!important;line-height:1.5!important;display:block!important;}
  .reports-filter select,.reports-filter input,.reports-filter .afc-channel-trigger,.reports-filter .afc-date-display-input{height:48px!important;min-height:48px!important;border-radius:15px!important;font-size:14px!important;padding:0 14px!important;}
  .reports-filter-submit{height:48px!important;min-height:48px!important;width:100%!important;font-size:14px!important;border-radius:15px!important;margin-top:2px!important;}
  .reports-filter .afc-channel-menu{position:absolute!important;top:calc(100% + 8px)!important;right:0!important;left:0!important;width:100%!important;max-width:100%!important;max-height:320px!important;border-radius:16px!important;padding:10px!important;box-shadow:0 18px 45px rgba(15,23,42,.18)!important;z-index:9999!important;}
  .afc-channel-check{font-size:14px!important;min-height:42px!important;padding:9px 10px!important;}
  .afc-channel-check span:before{width:20px!important;height:20px!important;min-width:20px!important;}
  .reports-mobile-nav{display:block!important;position:sticky!important;top:8px!important;z-index:70!important;background:rgba(248,251,255,.96)!important;backdrop-filter:blur(10px)!important;-webkit-backdrop-filter:blur(10px)!important;border:1px solid #e5eaf2!important;border-radius:16px!important;padding:8px!important;margin:8px 0 12px!important;}
  .reports-mobile-select{width:100%!important;height:46px!important;border-radius:13px!important;border:1px solid #cbd5e1!important;background:#fff!important;text-align:right!important;font-weight:900!important;color:#0f172a!important;padding:0 12px!important;}
  .reports-mobile-grid{display:none!important;}
}

@media(max-width:640px){
  .sales-filter-form-v187{grid-template-columns:1fr!important;gap:12px!important;}
  .sales-filter-card{position:relative!important;z-index:10!important;}
  .sales-filter-form-v187 .sales-filter-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important;}
  .sales-filter-form-v187 .afc-search-combo{height:48px!important;border-radius:15px!important;}
  .sales-filter-form-v187 .afc-search-combo input,.sales-filter-form-v187 .afc-search-icon-btn{height:48px!important;}
  .sales-filter-form-v187 .afc-search-icon-btn{width:52px!important;min-width:52px!important;}
  .sales-filter-form-v187 .afc-date-display-input{height:48px!important;border-radius:15px!important;}
  .sales-filter-actions button,.sales-filter-actions .btn{height:48px!important;border-radius:15px!important;font-size:14px!important;}
}

/* AFC v1.99 - reports filter final alignment + stable mega checkbox */
.reports-filter-card{overflow:visible!important;position:relative!important;z-index:20!important;}
.reports-filter{display:grid!important;grid-template-columns:minmax(280px,1.15fr) minmax(190px,.8fr) minmax(260px,1fr) 150px!important;gap:12px!important;align-items:end!important;direction:rtl!important;overflow:visible!important;}
.reports-filter > .afc-channel-mega,.reports-filter > label,.reports-filter > .afc-unified-date{display:grid!important;grid-template-rows:22px 42px!important;gap:7px!important;align-items:end!important;align-self:end!important;min-width:0!important;width:100%!important;margin:0!important;position:relative!important;}
.reports-filter > .afc-channel-mega > label,.reports-filter > label,.reports-filter > .afc-unified-date > label{grid-row:1!important;display:block!important;height:22px!important;line-height:22px!important;margin:0!important;padding:0!important;font-size:12px!important;font-weight:900!important;color:#475569!important;text-align:right!important;}
.reports-filter select,.reports-filter input,.reports-filter .afc-date-display-input,.reports-filter .afc-channel-trigger{grid-row:2!important;height:42px!important;min-height:42px!important;max-height:42px!important;width:100%!important;margin:0!important;box-sizing:border-box!important;border-radius:12px!important;border:1px solid #cbd5e1!important;background:#fff!important;box-shadow:none!important;}
.reports-filter-submit{height:42px!important;min-height:42px!important;max-height:42px!important;width:150px!important;justify-self:start!important;align-self:end!important;margin:0!important;border-radius:12px!important;}
.reports-filter .afc-channel-menu{top:calc(100% + 8px)!important;right:0!important;left:auto!important;width:min(360px,100%)!important;max-width:100%!important;z-index:9999!important;}
.reports-filter .afc-channel-check,.reports-filter .afc-channel-menu label{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:10px!important;height:auto!important;min-height:38px!important;max-height:none!important;padding:8px 10px!important;margin:0!important;line-height:1.7!important;overflow:visible!important;}
.reports-filter .afc-channel-check input[type=checkbox]{appearance:none!important;-webkit-appearance:none!important;position:relative!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;width:18px!important;min-width:18px!important;max-width:18px!important;height:18px!important;min-height:18px!important;max-height:18px!important;flex:0 0 18px!important;padding:0!important;margin:0!important;border:1.5px solid #cbd5e1!important;border-radius:5px!important;background:#fff!important;box-shadow:none!important;transform:none!important;cursor:pointer!important;}
.reports-filter .afc-channel-check input[type=checkbox]:checked{background:#2563eb!important;border-color:#2563eb!important;}
.reports-filter .afc-channel-check input[type=checkbox]:checked:after{content:'✓'!important;color:#fff!important;font-size:13px!important;font-weight:900!important;line-height:1!important;}
.reports-filter .afc-channel-check span{display:block!important;flex:1 1 auto!important;text-align:right!important;white-space:normal!important;min-width:0!important;}
@media(max-width:700px){.reports-filter-card{padding:18px 14px!important;border-radius:18px!important;}.reports-filter{grid-template-columns:1fr!important;gap:13px!important;align-items:stretch!important;}.reports-filter > .afc-channel-mega,.reports-filter > label,.reports-filter > .afc-unified-date{grid-template-rows:auto 48px!important;gap:6px!important;width:100%!important;justify-self:stretch!important;}.reports-filter > .afc-channel-mega > label,.reports-filter > label,.reports-filter > .afc-unified-date > label{height:auto!important;line-height:1.5!important;font-size:13px!important;}.reports-filter select,.reports-filter input,.reports-filter .afc-date-display-input,.reports-filter .afc-channel-trigger{height:48px!important;min-height:48px!important;max-height:48px!important;border-radius:15px!important;font-size:14px!important;}.reports-filter-submit{width:100%!important;height:48px!important;min-height:48px!important;max-height:48px!important;border-radius:15px!important;justify-self:stretch!important;}.reports-filter .afc-channel-menu{position:absolute!important;top:calc(100% + 8px)!important;right:0!important;left:0!important;width:100%!important;max-height:330px!important;overflow:auto!important;}}

/* AFC v2.00 - reports mobile section menu behavior */
@media(max-width:700px){
  .reports-nav{display:none!important}
  .reports-mobile-nav{display:block!important;margin:0 0 10px 0!important;position:relative!important;top:auto!important;background:transparent!important;padding:0!important;border:0!important;z-index:15!important}
  .reports-mobile-select-wrap{position:sticky!important;top:0!important;z-index:35!important;background:#f8fbff!important;padding:8px 0!important}
  .reports-mobile-select{width:100%!important;height:46px!important;border-radius:14px!important;border:1px solid #cbd5e1!important;background:#fff!important;padding:0 12px!important;font-weight:800!important;color:#0f172a!important;text-align:right!important}
  .reports-mobile-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;margin-top:8px!important}
  .reports-mobile-grid a{display:flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;min-height:48px!important;padding:10px 8px!important;border-radius:15px!important;border:1px solid #e5e7eb!important;background:#fff!important;text-decoration:none!important;color:#0f172a!important;font-size:14px!important;font-weight:900!important;box-shadow:0 1px 2px rgba(15,23,42,.04)!important}
  .reports-mobile-grid a.active{background:var(--primary,#2563eb)!important;border-color:var(--primary,#2563eb)!important;color:#fff!important}
}


/* AFC v2.01 - final reports filter alignment + closed channel dropdown */
.reports-filter{
  display:grid!important;
  grid-template-columns:minmax(260px,1.25fr) minmax(190px,.85fr) minmax(240px,1fr) 150px!important;
  grid-template-areas:"channel payment date submit"!important;
  gap:12px!important;
  align-items:end!important;
  direction:rtl!important;
  overflow:visible!important;
}
.reports-filter > .afc-channel-mega{grid-area:channel!important;}
.reports-filter > label:has(select[name="payment_type"]){grid-area:payment!important;}
.reports-filter > .afc-unified-date{grid-area:date!important;}
.reports-filter > .reports-filter-submit{grid-area:submit!important;}
.reports-filter > .afc-channel-mega,
.reports-filter > label,
.reports-filter > .afc-unified-date{
  display:grid!important;
  grid-template-rows:22px 44px!important;
  gap:7px!important;
  align-items:end!important;
  align-self:end!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  position:relative!important;
}
.reports-filter > .afc-channel-mega > label,
.reports-filter > label,
.reports-filter > .afc-unified-date > label{
  grid-row:1!important;
  height:22px!important;
  line-height:22px!important;
  margin:0!important;
  padding:0!important;
  font-size:12px!important;
  font-weight:900!important;
  color:#475569!important;
  text-align:right!important;
}
.reports-filter select,
.reports-filter input,
.reports-filter .afc-date-display-input,
.reports-filter .afc-channel-trigger{
  grid-row:2!important;
  height:44px!important;
  min-height:44px!important;
  max-height:44px!important;
  width:100%!important;
  margin:0!important;
  box-sizing:border-box!important;
  border-radius:13px!important;
  border:1px solid #cbd5e1!important;
  background:#fff!important;
  box-shadow:none!important;
  font-weight:800!important;
}
.reports-filter-submit{
  height:44px!important;
  min-height:44px!important;
  max-height:44px!important;
  width:150px!important;
  justify-self:start!important;
  align-self:end!important;
  margin:0!important;
  border-radius:13px!important;
}
.afc-channel-mega .afc-channel-menu,
.reports-filter .afc-channel-menu{
  display:none!important;
  position:absolute!important;
  top:calc(100% + 8px)!important;
  right:0!important;
  left:auto!important;
  width:min(380px,100%)!important;
  max-width:100%!important;
  max-height:360px!important;
  overflow:auto!important;
  padding:10px!important;
  border:1px solid #dbe3ef!important;
  border-radius:16px!important;
  background:#fff!important;
  box-shadow:0 18px 45px rgba(15,23,42,.18)!important;
  z-index:9999!important;
}
.afc-channel-mega.open .afc-channel-menu,
.reports-filter .afc-channel-mega.open .afc-channel-menu{display:block!important;}
.reports-filter .afc-channel-check,
.reports-filter .afc-channel-menu label,
.afc-channel-check{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  min-height:40px!important;
  height:auto!important;
  max-height:none!important;
  padding:8px 10px!important;
  margin:0!important;
  line-height:1.7!important;
  overflow:visible!important;
  border-radius:12px!important;
}
.afc-channel-check input[type=checkbox],
.reports-filter .afc-channel-check input[type=checkbox]{
  appearance:none!important;
  -webkit-appearance:none!important;
  position:relative!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:20px!important;
  min-width:20px!important;
  max-width:20px!important;
  height:20px!important;
  min-height:20px!important;
  max-height:20px!important;
  flex:0 0 20px!important;
  padding:0!important;
  margin:0!important;
  border:1.5px solid #cbd5e1!important;
  border-radius:6px!important;
  background:#fff!important;
  box-shadow:none!important;
  transform:none!important;
  cursor:pointer!important;
}
.afc-channel-check input[type=checkbox]:checked,
.reports-filter .afc-channel-check input[type=checkbox]:checked{background:#2563eb!important;border-color:#2563eb!important;}
.afc-channel-check input[type=checkbox]:checked:after,
.reports-filter .afc-channel-check input[type=checkbox]:checked:after{content:'✓'!important;color:#fff!important;font-size:13px!important;font-weight:900!important;line-height:1!important;}
.afc-channel-check span,
.reports-filter .afc-channel-check span{display:block!important;flex:1 1 auto!important;text-align:right!important;white-space:normal!important;min-width:0!important;}
@media(max-width:1200px){
  .reports-filter{grid-template-columns:repeat(2,minmax(220px,1fr))!important;grid-template-areas:"channel payment" "date submit"!important;}
  .reports-filter-submit{width:100%!important;}
}
@media(max-width:700px){
  .reports-filter-card{padding:18px 14px!important;border-radius:18px!important;overflow:visible!important;}
  .reports-filter{grid-template-columns:1fr!important;grid-template-areas:"channel" "payment" "date" "submit"!important;gap:13px!important;align-items:stretch!important;}
  .reports-filter > .afc-channel-mega,
  .reports-filter > label,
  .reports-filter > .afc-unified-date{grid-template-rows:auto 48px!important;gap:6px!important;width:100%!important;justify-self:stretch!important;}
  .reports-filter > .afc-channel-mega > label,
  .reports-filter > label,
  .reports-filter > .afc-unified-date > label{height:auto!important;line-height:1.5!important;font-size:13px!important;margin:0!important;}
  .reports-filter select,
  .reports-filter input,
  .reports-filter .afc-date-display-input,
  .reports-filter .afc-channel-trigger{height:48px!important;min-height:48px!important;max-height:48px!important;border-radius:15px!important;font-size:14px!important;padding:0 14px!important;}
  .reports-filter-submit{width:100%!important;height:48px!important;min-height:48px!important;max-height:48px!important;border-radius:15px!important;justify-self:stretch!important;}
  .reports-filter .afc-channel-menu{display:none!important;position:absolute!important;top:calc(100% + 8px)!important;right:0!important;left:0!important;width:100%!important;max-width:100%!important;max-height:320px!important;overflow:auto!important;border-radius:16px!important;padding:10px!important;z-index:9999!important;}
  .reports-filter .afc-channel-mega.open .afc-channel-menu{display:block!important;}
  .reports-mobile-nav{display:block!important;margin:0 0 10px 0!important;position:relative!important;top:auto!important;background:transparent!important;padding:0!important;border:0!important;z-index:15!important;}
  .reports-mobile-select-wrap{position:sticky!important;top:0!important;z-index:35!important;background:#f8fbff!important;padding:8px 0!important;}
  .reports-mobile-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;margin-top:8px!important;}
}


/* AFC v2.02 - reports mobile nav + channel trigger title final fix */
.reports-filter{
  grid-template-columns:minmax(260px,1.25fr) minmax(190px,.85fr) minmax(240px,1fr) 150px!important;
  grid-template-areas:"channel payment date submit"!important;
}
.reports-filter > .afc-channel-mega{grid-area:channel!important;}
.reports-filter > label:has(select[name="payment_type"]){grid-area:payment!important;}
.reports-filter > .afc-unified-date{grid-area:date!important;}
.reports-filter > .reports-filter-submit{grid-area:submit!important;}
.reports-filter .afc-channel-trigger{
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  text-align:right!important;color:#0f172a!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  padding:0 14px!important;line-height:1!important;appearance:none!important;-webkit-appearance:none!important;
}
.reports-filter .afc-channel-trigger:before{content:'⌄';font-size:15px;color:#64748b;order:2;margin-right:auto;margin-left:0;line-height:1;}
.reports-filter .afc-channel-menu{display:none!important;}
.reports-filter .afc-channel-mega.open .afc-channel-menu{display:block!important;}
@media(max-width:700px){
  .reports-filter{grid-template-columns:1fr!important;grid-template-areas:"channel" "payment" "date" "submit"!important;}
  .reports-filter .afc-channel-trigger{height:48px!important;min-height:48px!important;max-height:48px!important;font-size:14px!important;}
  .reports-filter .afc-channel-menu{display:none!important;max-height:min(320px,55vh)!important;}
  .reports-filter .afc-channel-mega.open .afc-channel-menu{display:block!important;}
  .reports-mobile-nav{display:block!important;position:relative!important;overflow:visible!important;height:auto!important;min-height:0!important;max-height:none!important;margin:0 0 12px 0!important;padding:0!important;background:transparent!important;z-index:10!important;}
  .reports-mobile-select-wrap{position:sticky!important;top:0!important;z-index:35!important;background:#f8fbff!important;padding:8px 0!important;margin:0!important;}
  .reports-mobile-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;margin-top:8px!important;overflow:visible!important;height:auto!important;min-height:0!important;max-height:none!important;clear:both!important;}
  .reports-mobile-grid a{display:flex!important;position:relative!important;visibility:visible!important;opacity:1!important;min-height:48px!important;height:auto!important;}
  .reports-layout{clear:both!important;}
}


/* AFC v2.03 - mobile sticky report dropdown + charts visible + channel trigger text */
.reports-filter .afc-channel-trigger{
  direction:rtl!important;
  unicode-bidi:plaintext!important;
  color:#0f172a!important;
  font-weight:800!important;
}
.reports-filter .afc-channel-trigger:empty::after{
  content:'همه کانال‌ها'!important;
  color:#0f172a!important;
}
@media(max-width:700px){
  .reports-mobile-nav{
    display:block!important;
    position:static!important;
    overflow:visible!important;
    height:auto!important;
    max-height:none!important;
    margin:0 0 12px 0!important;
    padding:0!important;
  }
  .reports-mobile-select-wrap{
    position:fixed!important;
    top:0!important;
    left:0!important;
    right:0!important;
    width:100%!important;
    z-index:2147483000!important;
    padding:8px 20px!important;
    background:rgba(248,251,255,.96)!important;
    backdrop-filter:saturate(140%) blur(10px);
    -webkit-backdrop-filter:saturate(140%) blur(10px);
    box-shadow:0 8px 24px rgba(15,23,42,.08)!important;
    box-sizing:border-box!important;
  }
  .reports-mobile-select{
    width:100%!important;
    height:46px!important;
    border-radius:14px!important;
    border:1px solid #cbd5e1!important;
    background:#fff!important;
    color:#0f172a!important;
    font-weight:900!important;
    text-align:right!important;
    padding:0 12px!important;
  }
  body:has(.reports-mobile-nav){padding-top:62px!important;}
  .reports-mobile-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    margin-top:8px!important;
    overflow:visible!important;
    height:auto!important;
    max-height:none!important;
  }
  .bar-row{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:7px!important;
    align-items:stretch!important;
    margin:12px 0!important;
    padding:10px 0!important;
    border-bottom:1px solid #eef2f7!important;
  }
  .bar-row:last-child{border-bottom:0!important;}
  .bar-row span,.bar-row b{
    display:block!important;
    text-align:right!important;
    white-space:normal!important;
  }
  .bar-row i{
    display:block!important;
    width:100%!important;
    height:12px!important;
    min-height:12px!important;
    border-radius:999px!important;
    background:#e0ecff!important;
    overflow:hidden!important;
    direction:ltr!important;
  }
  .bar-row i em{
    display:block!important;
    height:12px!important;
    border-radius:999px!important;
    background:#2563eb!important;
  }
}

/* AFC v2.37 - transfer alerts, transfer list filters, compact actions and timeline polish */
.transfer-dashboard-alert{border-width:1px!important;overflow:hidden!important}
.transfer-alert-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:12px}
.transfer-alert-head h2{margin:0 0 6px!important;font-size:20px!important;line-height:1.5!important}
.transfer-alert-head p{margin:0!important;color:#334155!important;font-weight:700!important;line-height:1.9!important}
.transfer-alert-view-all{min-height:34px!important;padding:7px 12px!important;border-radius:12px!important;font-size:12px!important;white-space:nowrap!important}
.transfer-alert-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px}
.transfer-alert-item{border:1px solid #e2e8f0;border-radius:16px;background:#fff;padding:11px 12px;display:grid;gap:10px;box-shadow:0 8px 22px rgba(15,23,42,.04)}
.transfer-alert-item.rejected{background:#fffafa;border-color:#fecaca}
.transfer-alert-main{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.transfer-alert-main small,.transfer-alert-route small{display:block;color:#64748b;font-size:11px;font-weight:800;margin-bottom:3px}
.transfer-alert-main b{display:block;color:#0f172a;font-size:14px;line-height:1.5;word-break:break-word}
.transfer-alert-route{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:8px;background:#f8fafc;border:1px solid #eef2f7;border-radius:14px;padding:8px 10px}
.transfer-alert-route>span{color:#94a3b8;font-weight:900;direction:ltr}
.transfer-alert-route b{font-size:13px;color:#0f172a;line-height:1.7;overflow:hidden;text-overflow:ellipsis;display:block}
.transfer-alert-meta{display:flex;flex-wrap:wrap;gap:6px 12px;color:#64748b;font-size:12px;line-height:1.8}
.transfer-alert-meta b{color:#334155}
.transfer-alert-note{margin:0;color:#7f1d1d;background:#fff1f2;border:1px dashed #fecdd3;border-radius:12px;padding:8px 10px;font-size:12.5px;line-height:1.8}
.transfer-alert-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px!important;justify-content:flex-start!important}
.transfer-row-actions{display:flex!important;align-items:center!important;gap:6px!important;flex-wrap:wrap!important;justify-content:flex-start!important}
.transfer-row-actions form,.transfer-alert-actions form{display:inline-flex!important;margin:0!important}
.transfer-mini-btn,.transfer-row-actions button,.transfer-row-actions .btn,.transfer-alert-actions button,.transfer-alert-actions .btn{min-height:31px!important;height:31px!important;padding:5px 10px!important;border-radius:10px!important;font-size:11.5px!important;font-weight:800!important;line-height:1!important;white-space:nowrap!important;min-width:auto!important}
.transfer-list-filter{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr)) auto;gap:10px;align-items:end}
.transfer-list-filter label{display:block;margin:0 0 6px;color:#64748b;font-size:12px;font-weight:800}
.transfer-list-filter select{width:100%;height:42px!important;min-height:42px!important;border-radius:12px!important}
.transfer-filter-actions{display:flex;align-items:center;gap:8px;white-space:nowrap}
.transfer-filter-actions button,.transfer-filter-actions .btn{height:42px!important;min-height:42px!important;padding:8px 14px!important;border-radius:12px!important;margin:0!important}
.transfer-list-head{margin-bottom:8px!important}.transfer-list-head h2{margin:0!important}.transfer-list-head p{margin:4px 0 0!important}
.transfer-table-wrap table.transfer-list-table th{font-size:12px!important;color:#475569!important;background:#f8fafc!important;white-space:nowrap}
.transfer-table-wrap table.transfer-list-table td{font-size:12.5px!important;vertical-align:middle!important;white-space:nowrap}
.transfer-doc-link{color:#1d4ed8!important;font-weight:900;text-decoration:none}.transfer-doc-link:hover{text-decoration:underline}
.pill[class*="transfer-status-"]{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:26px!important;padding:4px 10px!important;border-radius:999px!important;font-size:11.5px!important;font-weight:900!important;border:1px solid transparent!important;white-space:nowrap!important}
.transfer-status-pending_accept{background:#fff7ed!important;color:#9a3412!important;border-color:#fed7aa!important}
.transfer-status-in_transit{background:#eff6ff!important;color:#1d4ed8!important;border-color:#bfdbfe!important}
.transfer-status-received{background:#ecfdf5!important;color:#047857!important;border-color:#bbf7d0!important}
.transfer-status-canceled{background:#f8fafc!important;color:#475569!important;border-color:#e2e8f0!important}
.transfer-status-draft{background:#eef2ff!important;color:#3730a3!important;border-color:#c7d2fe!important}
.transfer-status-rejected{background:#fee2e2!important;color:#991b1b!important;border-color:#fecaca!important}
.transfer-timeline{position:relative;display:grid;gap:10px;margin:12px 0 4px;padding-right:18px}
.transfer-timeline:before{content:"";position:absolute;right:6px;top:8px;bottom:8px;width:2px;background:#e2e8f0;border-radius:99px}
.transfer-timeline-item{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:flex-start;background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:10px 12px}
.transfer-timeline-dot{width:12px;height:12px;border-radius:50%;background:#2563eb;border:3px solid #dbeafe;margin-top:5px;box-shadow:0 0 0 4px #fff;z-index:2}
.transfer-timeline-item b{display:block;color:#0f172a;font-size:14px;margin-bottom:3px}.transfer-timeline-item small{display:block;color:#64748b;font-weight:700;font-size:12px}.transfer-timeline-item p{margin:6px 0 0;color:#334155;font-size:12.5px;line-height:1.8}.transfer-timeline-received .transfer-timeline-dot{background:#10b981;border-color:#bbf7d0}.transfer-timeline-rejected .transfer-timeline-dot,.transfer-timeline-canceled .transfer-timeline-dot,.transfer-timeline-cancelled .transfer-timeline-dot{background:#ef4444;border-color:#fecaca}.transfer-timeline-accepted .transfer-timeline-dot{background:#f59e0b;border-color:#fde68a}
@media(max-width:760px){
  .transfer-dashboard-alert{padding:14px!important;border-radius:18px!important;margin-bottom:14px!important}
  .transfer-alert-head{display:grid;grid-template-columns:1fr;gap:8px;margin-bottom:10px}.transfer-alert-head h2{font-size:18px!important}.transfer-alert-head p{font-size:13px!important}.transfer-alert-view-all{width:100%;justify-content:center!important}
  .transfer-alert-list{grid-template-columns:1fr!important;gap:9px}.transfer-alert-item{padding:10px!important;border-radius:15px!important}.transfer-alert-main{align-items:center}.transfer-alert-main b{font-size:13px}.transfer-alert-route{padding:8px;gap:6px}.transfer-alert-route b{font-size:12px}.transfer-alert-meta{display:grid;grid-template-columns:1fr;font-size:11.5px;gap:3px}.transfer-alert-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}.transfer-alert-actions form{display:block!important}.transfer-alert-actions .btn,.transfer-alert-actions button{width:100%!important}
  .transfer-list-filter{grid-template-columns:1fr!important}.transfer-filter-actions{display:grid;grid-template-columns:1fr 1fr}.transfer-filter-actions button,.transfer-filter-actions .btn{width:100%!important;justify-content:center!important}
  .transfer-table-wrap{overflow:visible!important}.transfer-list-table,.transfer-list-table tbody,.transfer-list-table tr,.transfer-list-table td{display:block!important;width:100%!important}.transfer-list-table tr:first-child{display:none!important}.transfer-list-row{border:1px solid #e2e8f0!important;border-radius:16px!important;background:#fff!important;margin:0 0 10px!important;padding:8px 10px!important;box-shadow:0 8px 20px rgba(15,23,42,.04)}.transfer-list-table td{border:0!important;border-bottom:1px solid #eef2f7!important;padding:8px 2px!important;display:grid!important;grid-template-columns:110px minmax(0,1fr)!important;align-items:center!important;white-space:normal!important}.transfer-list-table td:before{content:attr(data-label);color:#64748b;font-weight:900;font-size:12px}.transfer-list-table td:last-child{border-bottom:0!important}.transfer-row-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important}.transfer-row-actions form{display:block!important}.transfer-row-actions .btn,.transfer-row-actions button{width:100%!important;justify-content:center!important}.transfer-timeline{padding-right:14px}.transfer-timeline-item{padding:9px 10px}
}

/* AFC v2.38 - transfer desktop table restore + mobile-only card optimization */
.transfer-dashboard-alert .transfer-alert-titlebar{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:14px!important;margin-bottom:10px!important}
.transfer-dashboard-alert .transfer-alert-titlebar h2{margin:0 0 4px!important;font-size:20px!important;line-height:1.6!important;color:#92400e!important}
.transfer-dashboard-alert .transfer-alert-titlebar p{margin:0!important;font-size:13px!important;line-height:1.8!important;color:#334155!important}
.transfer-dashboard-alert .transfer-alert-view-all{min-height:34px!important;height:34px!important;padding:7px 12px!important;border-radius:12px!important;font-size:12px!important;white-space:nowrap!important}
.transfer-alert-table-wrap{overflow-x:auto!important;overflow-y:visible!important;border-radius:14px!important}
.transfer-alert-table{width:100%!important;min-width:760px!important;border-collapse:separate!important;border-spacing:0!important}
.transfer-alert-table th{font-size:12px!important;color:#475569!important;background:#f8fafc!important;white-space:nowrap!important;padding:11px 10px!important}
.transfer-alert-table td{font-size:12.5px!important;vertical-align:middle!important;white-space:nowrap!important;padding:11px 10px!important}
.transfer-doc-inline{font-size:13px!important;color:#0f172a!important;font-weight:900!important}

@media(min-width:761px){
  .transfer-table-wrap{overflow-x:auto!important;overflow-y:visible!important;border-radius:14px!important}
  .transfer-list-table{width:100%!important;min-width:860px!important;border-collapse:separate!important;border-spacing:0!important;table-layout:auto!important}
  .transfer-list-table,.transfer-list-table tbody,.transfer-list-table tr,.transfer-list-table th,.transfer-list-table td{display:revert!important;width:auto!important}
  .transfer-list-table tr:first-child{display:table-row!important}
  .transfer-list-row{display:table-row!important;border:0!important;border-radius:0!important;background:transparent!important;margin:0!important;padding:0!important;box-shadow:none!important}
  .transfer-list-table th{font-size:12px!important;color:#475569!important;background:#f8fafc!important;white-space:nowrap!important;padding:11px 10px!important;text-align:right!important}
  .transfer-list-table td{font-size:12.5px!important;vertical-align:middle!important;white-space:nowrap!important;padding:12px 10px!important;border-bottom:1px solid #eef2f7!important;text-align:right!important;display:table-cell!important}
  .transfer-list-table td:before{display:none!important;content:none!important}
  .transfer-doc-cell{min-width:138px!important;max-width:180px!important;direction:ltr!important;text-align:left!important}
  .transfer-doc-link{display:inline-block!important;max-width:160px!important;overflow:hidden!important;text-overflow:ellipsis!important;vertical-align:middle!important;color:#1d4ed8!important;font-weight:900!important;text-decoration:none!important}
  .transfer-route-cell{display:flex!important;align-items:center!important;gap:8px!important;min-width:220px!important;max-width:300px!important;white-space:nowrap!important}
  .transfer-route-cell b{display:inline-block!important;max-width:125px!important;overflow:hidden!important;text-overflow:ellipsis!important;color:#0f172a!important;font-weight:800!important}
  .transfer-route-cell i{font-style:normal!important;color:#94a3b8!important;font-weight:900!important;direction:ltr!important;flex:0 0 auto!important}
  .transfer-status-cell{min-width:120px!important}.transfer-status-cell .pill{white-space:nowrap!important}
  .transfer-registered-cell{min-width:160px!important}.transfer-registered-cell b{display:block!important;font-weight:800!important;color:#0f172a!important;margin-bottom:3px!important}.transfer-registered-cell small{display:block!important;color:#64748b!important;font-size:11px!important;font-weight:700!important;line-height:1.6!important}
  .transfer-people-cell{min-width:145px!important}.transfer-people-cell span{display:block!important;color:#64748b!important;font-size:11.5px!important;line-height:1.8!important}.transfer-people-cell b{color:#0f172a!important;font-weight:800!important}
  .transfer-action-cell{width:1%!important;min-width:170px!important;white-space:nowrap!important}
  .transfer-row-actions{display:inline-flex!important;flex-wrap:nowrap!important;align-items:center!important;justify-content:flex-start!important;gap:6px!important;width:auto!important}
  .transfer-row-actions form{display:inline-flex!important;margin:0!important;width:auto!important}
  .transfer-row-actions .btn,.transfer-row-actions button,.transfer-mini-btn{width:auto!important;min-width:0!important;min-height:30px!important;height:30px!important;padding:5px 9px!important;border-radius:10px!important;font-size:11.5px!important;line-height:1!important;white-space:nowrap!important;justify-content:center!important}
}

@media(max-width:760px){
  .transfer-dashboard-alert{padding:13px!important;border-radius:18px!important;margin-bottom:14px!important;overflow:hidden!important}
  .transfer-dashboard-alert .transfer-alert-titlebar{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;margin-bottom:10px!important}
  .transfer-dashboard-alert .transfer-alert-titlebar h2{font-size:18px!important;margin-bottom:2px!important}
  .transfer-dashboard-alert .transfer-alert-titlebar p{font-size:13px!important;line-height:1.9!important}
  .transfer-dashboard-alert .transfer-alert-view-all{width:100%!important;justify-content:center!important;height:38px!important}
  .transfer-alert-table-wrap{overflow:visible!important;border:0!important}
  .transfer-alert-table,.transfer-alert-table tbody,.transfer-alert-table tr,.transfer-alert-table td{display:block!important;width:100%!important;min-width:0!important}
  .transfer-alert-table tr:first-child{display:none!important}
  .transfer-alert-row{border:1px solid #e2e8f0!important;border-radius:16px!important;background:#fff!important;margin:0 0 10px!important;padding:9px 11px!important;box-shadow:0 8px 18px rgba(15,23,42,.04)!important}
  .transfer-alert-table td{border:0!important;border-bottom:1px solid #eef2f7!important;padding:8px 0!important;display:grid!important;grid-template-columns:100px minmax(0,1fr)!important;align-items:center!important;white-space:normal!important;font-size:12.5px!important;text-align:right!important}
  .transfer-alert-table td:before{content:attr(data-label)!important;color:#64748b!important;font-weight:900!important;font-size:12px!important}
  .transfer-alert-table td:last-child{border-bottom:0!important}
  .transfer-doc-inline{font-size:12.5px!important;word-break:break-word!important;direction:ltr!important;text-align:left!important;display:block!important}
  .transfer-alert-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;width:100%!important}
  .transfer-alert-actions form{display:block!important;width:100%!important}
  .transfer-alert-actions .btn,.transfer-alert-actions button{width:100%!important;justify-content:center!important;height:34px!important}

  .transfer-list-card{padding:12px!important;border-radius:18px!important;overflow:hidden!important}
  .transfer-list-head{margin-bottom:10px!important}.transfer-list-head h2{font-size:18px!important}.transfer-list-head p{font-size:12.5px!important}
  .transfer-table-wrap{overflow:visible!important;border:0!important}
  .transfer-list-table,.transfer-list-table tbody,.transfer-list-table tr,.transfer-list-table td{display:block!important;width:100%!important;min-width:0!important}
  .transfer-list-table tr:first-child{display:none!important}
  .transfer-list-row{border:1px solid #e2e8f0!important;border-radius:16px!important;background:#fff!important;margin:0 0 10px!important;padding:9px 11px!important;box-shadow:0 8px 18px rgba(15,23,42,.04)!important}
  .transfer-list-table td{border:0!important;border-bottom:1px solid #eef2f7!important;padding:8px 0!important;display:grid!important;grid-template-columns:98px minmax(0,1fr)!important;align-items:center!important;white-space:normal!important;font-size:12.5px!important;text-align:right!important}
  .transfer-list-table td:before{content:attr(data-label)!important;color:#64748b!important;font-weight:900!important;font-size:12px!important}
  .transfer-list-table td:last-child{border-bottom:0!important}
  .transfer-doc-cell{text-align:left!important;direction:ltr!important}.transfer-doc-link{display:block!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;word-break:break-word!important;color:#1d4ed8!important;font-weight:900!important}
  .transfer-route-cell{display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;gap:6px!important;align-items:center!important;background:#f8fafc!important;border:1px solid #eef2f7!important;border-radius:12px!important;padding:7px 8px!important}
  .transfer-route-cell b{font-size:12px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.transfer-route-cell i{font-style:normal!important;color:#94a3b8!important;font-weight:900!important;direction:ltr!important}
  .transfer-registered-cell b{display:block!important;color:#0f172a!important;margin-bottom:3px!important}.transfer-registered-cell small{display:block!important;color:#64748b!important;font-size:11.5px!important;line-height:1.7!important}
  .transfer-people-cell span{display:block!important;color:#64748b!important;font-size:11.5px!important;line-height:1.8!important}.transfer-people-cell b{color:#0f172a!important}
  .transfer-row-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;width:100%!important;justify-content:stretch!important}
  .transfer-row-actions form{display:block!important;width:100%!important;margin:0!important}
  .transfer-row-actions .btn,.transfer-row-actions button,.transfer-mini-btn{width:100%!important;height:34px!important;min-height:34px!important;justify-content:center!important;font-size:11.5px!important;border-radius:10px!important}
}

/* AFC v2.39 - transfer list action alignment + date filters + mobile compact cards */
.transfer-list-filter{grid-template-columns:repeat(5,minmax(128px,1fr)) auto!important;gap:10px!important;align-items:end!important}
.transfer-list-filter input.transfer-date-input{width:100%!important;height:42px!important;min-height:42px!important;border-radius:12px!important;text-align:center!important;font-weight:750!important;background:#fff!important;border:1px solid #cbd5e1!important;box-sizing:border-box!important}
.transfer-filter-card{overflow:visible!important}.transfer-list-card{overflow:hidden!important}.transfer-table-wrap{overflow-x:auto!important;overflow-y:visible!important}
.transfer-list-table{min-width:1100px!important;table-layout:auto!important}
.transfer-action-cell{min-width:255px!important;width:255px!important;max-width:255px!important;white-space:nowrap!important}
.transfer-action-cell .transfer-row-actions{display:inline-flex!important;flex-flow:row nowrap!important;align-items:center!important;justify-content:flex-start!important;gap:5px!important;width:auto!important;min-width:max-content!important;white-space:nowrap!important}
.transfer-action-cell .transfer-row-actions form{display:inline-flex!important;width:auto!important;margin:0!important;flex:0 0 auto!important}
.transfer-action-cell .transfer-row-actions .btn,
.transfer-action-cell .transfer-row-actions button,
.transfer-action-cell .transfer-mini-btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:auto!important;min-width:44px!important;height:30px!important;min-height:30px!important;padding:5px 9px!important;border-radius:10px!important;font-size:11px!important;line-height:1!important;white-space:nowrap!important;flex:0 0 auto!important;margin:0!important}
.transfer-action-cell .transfer-row-actions a.transfer-mini-btn{min-width:58px!important}
.transfer-list-table td{height:auto!important}.transfer-list-row{height:auto!important}.transfer-list-table th,.transfer-list-table td{padding-top:10px!important;padding-bottom:10px!important}
@media(max-width:1180px) and (min-width:761px){.transfer-list-filter{grid-template-columns:repeat(3,minmax(160px,1fr))!important}.transfer-filter-actions{grid-column:1/-1!important;justify-content:flex-start!important}.transfer-list-table{min-width:1080px!important}}
@media(max-width:760px){
  .transfer-filter-card{padding:12px!important;border-radius:18px!important;overflow:visible!important}
  .transfer-list-filter{grid-template-columns:1fr 1fr!important;gap:8px!important}
  .transfer-list-filter>div{min-width:0!important}.transfer-list-filter label{font-size:11.5px!important;margin-bottom:5px!important}
  .transfer-list-filter select,.transfer-list-filter input.transfer-date-input{height:40px!important;min-height:40px!important;border-radius:12px!important;font-size:12.5px!important}
  .transfer-filter-actions{grid-column:1/-1!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}.transfer-filter-actions button,.transfer-filter-actions .btn{height:40px!important;min-height:40px!important;font-size:12px!important}
  .transfer-list-card{padding:10px!important;border-radius:18px!important;overflow:hidden!important}.transfer-table-wrap{overflow:visible!important}
  .transfer-list-table,.transfer-list-table tbody,.transfer-list-table tr,.transfer-list-table td{display:block!important;width:100%!important;min-width:0!important;box-sizing:border-box!important}
  .transfer-list-table tr:first-child{display:none!important}
  .transfer-list-row{border:1px solid #e2e8f0!important;border-radius:15px!important;background:#fff!important;margin:0 0 8px!important;padding:8px 9px!important;box-shadow:0 7px 18px rgba(15,23,42,.04)!important}
  .transfer-list-table td{border:0!important;border-bottom:1px solid #eef2f7!important;padding:6px 0!important;display:grid!important;grid-template-columns:78px minmax(0,1fr)!important;align-items:center!important;white-space:normal!important;font-size:12px!important;text-align:right!important;min-height:0!important}
  .transfer-list-table td:before{content:attr(data-label)!important;color:#64748b!important;font-weight:900!important;font-size:11.5px!important;line-height:1.5!important}
  .transfer-list-table td:last-child{border-bottom:0!important}.transfer-list-table td.transfer-empty-mobile{display:none!important}
  .transfer-doc-cell{direction:ltr!important;text-align:left!important}.transfer-doc-link{display:block!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:12px!important;color:#1d4ed8!important;font-weight:900!important}
  .transfer-route-cell{display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;gap:5px!important;align-items:center!important;background:#f8fafc!important;border:1px solid #eef2f7!important;border-radius:11px!important;padding:6px 7px!important}
  .transfer-route-cell:before{display:none!important}.transfer-route-cell b{font-size:11.5px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;color:#0f172a!important}.transfer-route-cell i{font-style:normal!important;color:#94a3b8!important;font-weight:900!important;direction:ltr!important}
  .transfer-status-cell .pill{min-height:24px!important;padding:3px 8px!important;font-size:10.8px!important}
  .transfer-registered-cell b{display:inline!important;margin:0!important;font-size:12px!important}.transfer-registered-cell small{display:block!important;color:#64748b!important;font-size:10.8px!important;line-height:1.6!important;margin-top:2px!important}
  .transfer-people-cell span{display:block!important;font-size:11px!important;line-height:1.7!important;color:#64748b!important}.transfer-people-cell b{color:#0f172a!important}
  .transfer-action-cell{width:100%!important;min-width:0!important;max-width:none!important;padding-top:8px!important}.transfer-action-cell:before{display:none!important}
  .transfer-action-cell .transfer-row-actions{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important;width:100%!important;min-width:0!important;white-space:normal!important}.transfer-action-cell .transfer-row-actions form{display:block!important;width:100%!important}.transfer-action-cell .transfer-row-actions .btn,.transfer-action-cell .transfer-row-actions button,.transfer-action-cell .transfer-mini-btn{width:100%!important;min-width:0!important;height:32px!important;min-height:32px!important;padding:4px 5px!important;font-size:10.8px!important;border-radius:9px!important}
}
@media(max-width:420px){.transfer-action-cell .transfer-row-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}.transfer-list-table td{grid-template-columns:72px minmax(0,1fr)!important}.transfer-list-filter{grid-template-columns:1fr!important}}

/* AFC v2.40 - transfer mobile cards final + dashboard alert action alignment */
.transfer-mobile-list{display:none}
@media(min-width:761px){
  .transfer-dashboard-alert .transfer-alert-actions,
  .transfer-dashboard-alert .transfer-alert-actions.transfer-row-actions{
    display:inline-flex!important;
    flex-flow:row nowrap!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:6px!important;
    width:auto!important;
    min-width:max-content!important;
    white-space:nowrap!important;
  }
  .transfer-dashboard-alert .transfer-alert-actions form{
    display:inline-flex!important;
    align-items:center!important;
    width:auto!important;
    margin:0!important;
    padding:0!important;
    flex:0 0 auto!important;
  }
  .transfer-dashboard-alert .transfer-alert-actions .btn,
  .transfer-dashboard-alert .transfer-alert-actions button,
  .transfer-dashboard-alert .transfer-alert-actions .transfer-mini-btn{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    height:30px!important;
    min-height:30px!important;
    padding:5px 10px!important;
    margin:0!important;
    line-height:1!important;
    vertical-align:middle!important;
    border-radius:10px!important;
    font-size:11px!important;
    white-space:nowrap!important;
  }
}
@media(max-width:760px){
  .transfer-list-card{padding:10px!important;border-radius:18px!important;overflow:hidden!important}
  .transfer-list-head{margin-bottom:8px!important}
  .transfer-list-head h2{font-size:18px!important;line-height:1.6!important;margin:0!important}
  .transfer-list-head p{font-size:12px!important;line-height:1.7!important;margin:0!important}
  .transfer-list-card .table-wrap.transfer-table-wrap{display:none!important}
  .transfer-mobile-list{display:grid!important;grid-template-columns:1fr!important;gap:9px!important;margin:8px 0 10px!important;width:100%!important;max-width:100%!important;overflow:visible!important;box-sizing:border-box!important}
  .transfer-mobile-card{background:#fff!important;border:1px solid #dfe7f1!important;border-radius:16px!important;box-shadow:0 8px 20px rgba(15,23,42,.045)!important;padding:10px!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;overflow:hidden!important;color:#0f172a!important}
  .tm-top{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;margin-bottom:8px!important;width:100%!important;min-width:0!important}
  .tm-doc{direction:ltr!important;text-align:left!important;display:block!important;min-width:0!important;max-width:calc(100% - 118px)!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:13px!important;font-weight:900!important;color:#1d4ed8!important;text-decoration:none!important;line-height:1.5!important}
  .tm-top .pill{flex:0 0 auto!important;max-width:112px!important;min-height:24px!important;padding:3px 8px!important;font-size:10.5px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  .tm-route{display:grid!important;grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr)!important;align-items:center!important;gap:5px!important;background:#f8fafc!important;border:1px solid #edf2f7!important;border-radius:12px!important;padding:8px!important;margin-bottom:8px!important;min-width:0!important;box-sizing:border-box!important}
  .tm-route span{display:block!important;min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;text-align:center!important;font-size:12px!important;font-weight:850!important;color:#0f172a!important;line-height:1.6!important}
  .tm-route i{font-style:normal!important;color:#94a3b8!important;font-weight:900!important;text-align:center!important;direction:ltr!important;line-height:1!important}
  .tm-meta-grid{display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important;margin:0!important;width:100%!important;min-width:0!important}
  .tm-meta-grid>div{min-width:0!important;background:#fbfdff!important;border:1px solid #edf2f7!important;border-radius:12px!important;padding:7px 8px!important;box-sizing:border-box!important;overflow:hidden!important}
  .tm-meta-grid>div.tm-wide{grid-column:1/-1!important}
  .tm-meta-grid small{display:block!important;color:#64748b!important;font-size:10.5px!important;font-weight:850!important;margin-bottom:3px!important;line-height:1.5!important}
  .tm-meta-grid b{display:block!important;color:#0f172a!important;font-size:12px!important;font-weight:850!important;line-height:1.7!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  .tm-actions.transfer-row-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;width:100%!important;min-width:0!important;margin-top:9px!important;align-items:stretch!important;white-space:normal!important;box-sizing:border-box!important}
  .tm-actions.transfer-row-actions form{display:block!important;width:100%!important;min-width:0!important;margin:0!important;padding:0!important}
  .tm-actions.transfer-row-actions .btn,
  .tm-actions.transfer-row-actions button,
  .tm-actions.transfer-row-actions .transfer-mini-btn{display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;min-width:0!important;height:36px!important;min-height:36px!important;padding:6px 8px!important;margin:0!important;border-radius:11px!important;font-size:12px!important;font-weight:850!important;line-height:1!important;box-sizing:border-box!important;white-space:nowrap!important}
  .transfer-mobile-empty{padding:12px!important;border:1px dashed #cbd5e1!important;border-radius:14px!important;background:#f8fafc!important}
  .transfer-list-card .pagination{margin:8px 0!important;border-radius:15px!important;overflow:hidden!important}
}
@media(max-width:420px){
  .tm-doc{max-width:calc(100% - 106px)!important;font-size:12.5px!important}
  .tm-top .pill{max-width:100px!important;font-size:10px!important;padding-left:6px!important;padding-right:6px!important}
  .tm-meta-grid{grid-template-columns:1fr!important}
  .tm-meta-grid>div.tm-wide{grid-column:auto!important}
}

/* AFC v2.41 transfer workflow accepted state */
.transfer-status-accepted{background:#eef2ff!important;color:#3730a3!important;border-color:#c7d2fe!important}
.transfer-action-cell .transfer-row-actions{align-items:center!important}
.transfer-dashboard-alert .transfer-alert-actions{align-items:center!important}

/* AFC v2.42 - transfer ship modal polish */
.transfer-ship-panel{max-width:460px!important;width:min(460px,calc(100vw - 28px))!important}
.transfer-ship-form{display:grid!important;gap:10px!important}
.transfer-ship-form label{font-size:12px!important;font-weight:850!important;color:#64748b!important;margin-top:2px!important}
.transfer-ship-form input,.transfer-ship-form textarea{width:100%!important;border:1px solid #cbd8ea!important;border-radius:12px!important;background:#fff!important;padding:10px 12px!important;font-weight:700!important;box-sizing:border-box!important}
.transfer-ship-form input{height:44px!important}
.transfer-ship-form textarea{min-height:86px!important;resize:vertical!important}
.transfer-ship-form .modal-actions{display:flex!important;gap:8px!important;justify-content:flex-start!important;margin-top:4px!important}

/* AFC v2.53 offline mode */
.afc-offline-mode-banner{margin:10px 0 14px;padding:12px 14px;border:1px solid #fed7aa;background:#fff7ed;color:#9a3412;border-radius:16px;display:flex;gap:8px;align-items:center;justify-content:space-between;flex-wrap:wrap;line-height:1.8}
.afc-offline-mode-banner b{font-weight:900}.afc-offline-mode-banner span{color:#7c2d12;font-size:13px}.offline-queue-pill{display:inline-flex;align-items:center;justify-content:center;border-radius:14px;background:#fff7ed;color:#9a3412;border:1px solid #fed7aa;padding:8px 12px;font-weight:800;font-size:12px;min-height:34px}.offline-queue-pill:empty{display:none}.afc-is-offline #quick-submit-btn{background:#ea580c!important;border-color:#ea580c!important}.status-offline{background:#fff7ed!important;color:#9a3412!important;border-color:#fed7aa!important}
@media(max-width:700px){.afc-offline-mode-banner{font-size:12px;padding:10px}.offline-queue-pill{width:100%;font-size:11.5px}}

/* AFC v2.67 */
.sidebar-credit small{display:block;margin-top:4px;font-size:10px;color:#94a3b8;font-weight:600}

/* AFC v2.73 - quick POS cart row polish + offline sync visibility */
.quick-cart-row{
  grid-template-columns:minmax(0,1fr) 96px 150px 42px!important;
  gap:10px!important;
  align-items:end!important;
  border:1px solid #dbeafe!important;
  background:linear-gradient(180deg,#ffffff,#f8fbff)!important;
  border-radius:16px!important;
  padding:12px!important;
  margin:10px 0!important;
  box-shadow:0 8px 22px rgba(15,23,42,.045)!important;
}
.quick-cart-row .cart-product{min-width:0;display:flex;flex-direction:column;gap:5px;align-self:center}
.quick-cart-row .cart-product b{font-size:14px;font-weight:900;color:#0f172a;line-height:1.8;white-space:normal;overflow-wrap:anywhere}
.quick-cart-row .cart-product small{font-size:11.5px;color:#64748b;font-weight:700}
.quick-cart-row .cart-field{display:flex;flex-direction:column;gap:5px}
.quick-cart-row .cart-field label{font-size:11px;color:#64748b;font-weight:800;margin:0}
.quick-cart-row input.qty,.quick-cart-row input.unit{height:40px!important;border-radius:12px!important;text-align:center!important;font-weight:800!important;background:#fff!important}
.quick-cart-row .remove{height:40px!important;width:40px!important;min-width:40px!important;border-radius:12px!important;padding:0!important;align-self:end!important}
.offline-queue-pill[title]:not(:empty){cursor:help}
#afc-offline-sync-message{margin-bottom:12px;border-radius:14px;padding:12px 14px;font-weight:800;border:1px solid #bbf7d0;background:#ecfdf5;color:#166534}
#afc-offline-sync-message.error{border-color:#fecdd3;background:#fff1f2;color:#be123c}
@media(max-width:700px){
  .quick-cart-row{grid-template-columns:1fr 72px 104px 38px!important;gap:7px!important;padding:10px!important}
  .quick-cart-row .cart-product{grid-column:1 / -1}
  .quick-cart-row .cart-product b{font-size:13px}
  .quick-cart-row input.qty,.quick-cart-row input.unit,.quick-cart-row .remove{height:38px!important}
}


/* AFC v2.89 polish */
.sale-customer-history-card{margin-top:14px!important}
.sale-view-detail-grid + .sale-customer-history-card{margin-top:14px!important}
.modal-head .modal-x-btn{width:38px!important;height:38px!important;padding:0!important;border-radius:12px!important;font-size:18px!important;line-height:1!important;display:inline-flex!important;align-items:center!important;justify-content:center!important}
#variantPickerTitle.has-offline-cache:after{content:'کش آفلاین';display:inline-flex;align-items:center;margin-right:8px;padding:3px 8px;border-radius:999px;background:#fff7ed;color:#9a3412;border:1px solid #fed7aa;font-size:11px;font-weight:900;vertical-align:middle}
.variant-choice small{color:#64748b!important;font-weight:700!important}

/* AFC v3.16 - installment site stats gateway sync fix */
.settlement-tx-hint{display:block;margin-top:5px;color:#64748b;font-size:11px;font-weight:600;line-height:1.7}

/* AFC v3.21 - subtle today highlight in all unified Jalali datepickers */
.afc-jdp-days button.is-today{
  background:#f8fbff!important;
  border-color:#bfdbfe!important;
  color:#1d4ed8!important;
  box-shadow:inset 0 0 0 1px rgba(29,78,216,.10)!important;
}
.afc-jdp-days button.is-today::after{
  content:'';
  display:block;
  width:4px;
  height:4px;
  border-radius:999px;
  background:#60a5fa;
  margin:3px auto 0;
  opacity:.85;
}
.afc-jdp-days button.is-selected{
  background:#1d4ed8!important;
  border-color:#1d4ed8!important;
  color:#fff!important;
}
.afc-jdp-days button.is-selected::after{background:#fff!important;opacity:.85!important}

/* AFC v3.27 mobile sale button/search polish */
@media(max-width:760px){.sales-page-head button.sales-new-btn{width:auto!important;min-width:0!important;display:inline-flex!important}.sales-new-plus{display:inline-grid!important;place-items:center!important;width:18px!important;height:18px!important;border-radius:999px!important;background:rgba(255,255,255,.22)!important;font-size:18px!important;line-height:1!important}.sales-filter-form-v187 .afc-search-combo{display:flex!important;align-items:stretch!important;min-height:48px!important}.sales-filter-form-v187 .afc-search-icon-btn{height:auto!important;align-self:stretch!important;margin:0!important}}

/* AFC v3.30 - product thumbnails in sale/purchase lists */
.product-tile{display:grid!important;grid-template-columns:54px minmax(0,1fr)!important;align-items:center!important;text-align:right!important;gap:8px 10px!important;min-height:68px!important;white-space:normal!important}
.product-tile b,.product-tile span,.product-tile small{grid-column:2!important;min-width:0!important;overflow-wrap:anywhere!important}
.product-tile-thumb{grid-row:1 / span 3!important;width:48px!important;height:48px!important;object-fit:cover!important;border-radius:12px!important;border:1px solid #e2e8f0!important;background:#f8fafc!important;align-self:center!important;justify-self:center!important}
.product-tile-thumb.empty{display:flex!important;align-items:center!important;justify-content:center!important;font-size:10px!important;color:#94a3b8!important;font-weight:800!important;line-height:1.3!important;text-align:center!important;padding:3px!important}
.product-search-result,.ajax-result-item.has-thumb{display:grid!important;grid-template-columns:46px minmax(0,1fr)!important;gap:8px!important;align-items:center!important;text-align:right!important}
.product-search-result .search-result-text,.ajax-result-item.has-thumb .search-result-text{min-width:0!important}
.product-search-thumb,.purchase-result-thumb{width:42px!important;height:42px!important;object-fit:cover!important;border-radius:10px!important;border:1px solid #e2e8f0!important;background:#f8fafc!important}
.product-search-thumb.empty,.purchase-result-thumb.empty{display:flex!important;align-items:center!important;justify-content:center!important;font-size:9.5px!important;color:#94a3b8!important;font-weight:800!important;text-align:center!important;line-height:1.25!important;padding:2px!important}
.selected-product.with-thumb{display:grid!important;grid-template-columns:44px minmax(0,1fr)!important;gap:8px!important;align-items:center!important}
.selected-product.with-thumb img,.selected-product.with-thumb .product-search-thumb{grid-row:1 / span 2!important}
.stock-product-thumb{width:44px;height:44px;object-fit:cover;border-radius:10px;border:1px solid #e2e8f0;background:#f8fafc;vertical-align:middle;margin-left:8px}.stock-product-cell{display:flex;align-items:center;gap:8px}.stock-product-cell b{line-height:1.6}
.product-tile[style*="display: none"]{display:none!important}

/* AFC v3.31 - cleaner product placeholders */
.product-tile-thumb.empty,.product-search-thumb.empty,.purchase-result-thumb.empty{color:transparent!important;position:relative!important;background:linear-gradient(180deg,#f8fafc,#eef2f7)!important;border-style:dashed!important;overflow:hidden!important;flex:none!important}
.product-tile-thumb.empty::before,.product-search-thumb.empty::before,.purchase-result-thumb.empty::before{content:"📷";position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#cbd5e1;font-size:18px;line-height:1}
.product-tile{padding:10px 12px!important}
.product-list .product-tile{min-height:70px!important}
.product-tile b{font-size:13px!important}.product-tile span{font-size:12.5px!important}.product-tile small{font-size:11.5px!important;color:#64748b!important}
.stock-product-thumb.empty{display:inline-flex;align-items:center;justify-content:center;color:#cbd5e1;font-size:18px}
.tiny-link{font-size:11px;font-weight:800;color:#2563eb;text-decoration:none;white-space:nowrap}
.tiny-link:hover{text-decoration:underline}


/* AFC v3.32 - stable product tile placeholders */
/* AFC v3.33 - delivery exchange table price polish */
.product-tile{grid-template-columns:54px minmax(0,1fr)!important;align-items:center!important;min-height:70px!important}
.product-tile > b,.product-tile > span:not(.product-tile-thumb),.product-tile > small{grid-column:2!important;min-width:0!important;overflow-wrap:anywhere!important}
.product-tile > .product-tile-thumb{grid-column:1!important;grid-row:1 / span 3!important;align-self:center!important;justify-self:center!important;width:48px!important;height:48px!important;box-sizing:border-box!important}
.product-tile-thumb.empty,.product-search-thumb.empty,.purchase-result-thumb.empty{color:#94a3b8!important;position:static!important;background:#f8fafc!important;border-style:dashed!important;overflow:hidden!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;line-height:1.25!important}
.product-tile-thumb.empty::before,.product-search-thumb.empty::before,.purchase-result-thumb.empty::before{content:none!important}
.product-tile-thumb.empty{font-size:10px!important;padding:3px!important}
.product-search-thumb.empty,.purchase-result-thumb.empty{font-size:9.5px!important;padding:2px!important}


/* AFC v3.34 - searchable replacement picker in delivery exchange */

/* AFC v3.37 - delivery exchange item checkbox id fix */


/* AFC v3.48 - money input Persian formatting */
.afc-money-input{
  direction:ltr;
  unicode-bidi:plaintext;
  text-align:left;
  font-variant-numeric:tabular-nums;
}

/* AFC v3.61 - login otp redesign */
.login-shell{min-height:calc(100vh - 120px);display:flex;align-items:center;justify-content:center;padding:24px}
.login-card{width:min(520px,100%);padding:28px;border-radius:26px;box-shadow:0 18px 45px rgba(15,23,42,.08)}
.login-brandline{display:flex;gap:14px;align-items:center;margin-bottom:18px}
.login-logo{width:54px;height:54px;border-radius:18px;background:#1d4ed8;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:900;font-size:18px;box-shadow:0 10px 25px rgba(37,99,235,.22)}
.login-brandline h1{font-size:22px;margin:0 0 4px}.login-brandline p{margin:0;color:#64748b}
.login-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;background:#f1f5f9;padding:6px;border-radius:18px;margin:18px 0}
.login-tab{border:0;background:transparent;border-radius:14px;padding:12px 10px;font-weight:800;color:#475569;cursor:pointer}
.login-tab.active{background:#fff;color:#1d4ed8;box-shadow:0 8px 20px rgba(15,23,42,.08)}
.login-panel{display:none}.login-panel.active{display:block}
.login-form label{display:block;margin-top:12px;font-weight:800;color:#0f172a}.login-form input{margin-top:8px}
.login-submit{width:100%;margin-top:18px;padding:13px 16px;border-radius:16px;font-weight:900}
.login-resend{margin-top:10px;text-align:center}.login-resend button{width:100%;border-radius:16px}
@media(max-width:640px){.login-shell{padding:14px;align-items:flex-start}.login-card{padding:20px;border-radius:22px}.login-brandline{align-items:flex-start}.login-brandline h1{font-size:19px}}

/* AFC v3.61 - login tabs hover/autofill polish */
.login-tabs .login-tab,
.login-tabs .login-tab:hover,
.login-tabs .login-tab:focus{
  color:#334155!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  outline:none;
}
.login-tabs .login-tab:hover,
.login-tabs .login-tab:focus-visible{
  background:#e0ecff!important;
  color:#1d4ed8!important;
}
.login-tabs .login-tab.active,
.login-tabs .login-tab.active:hover,
.login-tabs .login-tab.active:focus{
  background:#fff!important;
  color:#1d4ed8!important;
  box-shadow:0 8px 20px rgba(15,23,42,.08)!important;
}
#afc-otp-code{
  letter-spacing:.22em;
  text-align:center!important;
  font-weight:900;
  font-size:18px;
}

/* AFC v3.62 - modern role-aware dashboard rebuild */
.afc-dashboard-modern{max-width:1280px!important;margin:0 auto 32px;display:block}.afc-dashboard-modern *{min-width:0}.dash-hero-modern{position:relative;overflow:hidden;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:18px;margin:0 0 18px;padding:22px;border:1px solid rgba(191,219,254,.75);border-radius:28px;background:linear-gradient(135deg,#eff6ff 0%,#fff 48%,#f8fafc 100%);box-shadow:0 18px 55px rgba(15,23,42,.08)}.dash-hero-glow{position:absolute;inset:auto -80px -110px auto;width:260px;height:260px;border-radius:999px;background:radial-gradient(circle,#bfdbfe 0%,rgba(191,219,254,0) 70%);pointer-events:none}.dash-user-badge{position:relative;width:70px;height:70px;border-radius:24px;display:grid;place-items:center;background:linear-gradient(135deg,#2563eb,#0f172a);color:#fff;font-size:20px;font-weight:1000;box-shadow:0 16px 36px rgba(37,99,235,.22)}.dash-hero-copy{position:relative}.dash-kicker{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-size:12px;font-weight:900;margin-bottom:8px}.dash-hero-modern h1{margin:0;font-size:28px;line-height:1.35;color:#0f172a;font-weight:1000}.dash-hero-modern p{margin:4px 0 0;color:#475569;font-size:13px;font-weight:800}.dash-scope-line{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.dash-scope-line span{display:inline-flex;align-items:center;border:1px solid #e2e8f0;background:rgba(255,255,255,.86);color:#334155;border-radius:999px;padding:5px 10px;font-size:12px;font-weight:800}.dash-hero-actions{position:relative;display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.dash-primary-action,.dash-secondary-action,.dash-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;font-weight:950;border-radius:14px;min-height:40px;padding:9px 14px;white-space:nowrap}.dash-primary-action{background:#2563eb;color:#fff!important;border:1px solid #1d4ed8;box-shadow:0 12px 28px rgba(37,99,235,.18)}.dash-primary-action:hover{background:#1d4ed8}.dash-secondary-action,.dash-link{background:#fff;color:#0f172a!important;border:1px solid #dbe3ef}.dash-secondary-action:hover,.dash-link:hover{border-color:#93c5fd;color:#1d4ed8!important}.dash-section{margin:0 0 18px}.dash-panel{background:#fff;border:1px solid #e2e8f0;border-radius:24px;padding:16px;box-shadow:0 14px 40px rgba(15,23,42,.055)}.dash-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0 0 14px}.dash-section-head.compact{margin-bottom:12px}.dash-section-head h2{margin:0 0 4px;font-size:18px;line-height:1.45;color:#0f172a;font-weight:1000}.dash-section-head p{margin:0;color:#64748b;font-size:12.5px;font-weight:750}.dash-quick-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(138px,1fr));gap:12px}.dash-shortcut{position:relative;overflow:hidden;min-height:132px;border-radius:22px;padding:14px;text-decoration:none;color:#0f172a!important;background:#fff;border:1px solid #e2e8f0;box-shadow:0 12px 32px rgba(15,23,42,.05);transition:.18s ease;display:flex;flex-direction:column;justify-content:space-between}.dash-shortcut:before{content:"";position:absolute;inset:auto auto -36px -36px;width:108px;height:108px;border-radius:999px;background:var(--dash-soft,#eff6ff);transition:.18s ease}.dash-shortcut:hover{transform:translateY(-2px);border-color:var(--dash-border,#93c5fd);box-shadow:0 18px 44px rgba(15,23,42,.09)}.dash-shortcut:hover:before{transform:scale(1.16)}.dash-shortcut-icon{position:relative;width:42px;height:42px;border-radius:16px;display:grid;place-items:center;background:var(--dash-bg,#2563eb);color:#fff;font-size:20px;box-shadow:0 12px 26px rgba(15,23,42,.13)}.dash-shortcut b{position:relative;font-size:14px;font-weight:1000;line-height:1.5}.dash-shortcut small{position:relative;color:#64748b;font-size:11.5px;font-weight:750;line-height:1.7}.tone-blue{--dash-bg:#2563eb;--dash-soft:#dbeafe;--dash-border:#93c5fd}.tone-green,.tone-emerald{--dash-bg:#10b981;--dash-soft:#dcfce7;--dash-border:#86efac}.tone-orange{--dash-bg:#f97316;--dash-soft:#ffedd5;--dash-border:#fdba74}.tone-cyan{--dash-bg:#0891b2;--dash-soft:#cffafe;--dash-border:#67e8f9}.tone-purple{--dash-bg:#7c3aed;--dash-soft:#ede9fe;--dash-border:#c4b5fd}.tone-amber{--dash-bg:#d97706;--dash-soft:#fef3c7;--dash-border:#fcd34d}.tone-indigo{--dash-bg:#4f46e5;--dash-soft:#e0e7ff;--dash-border:#a5b4fc}.tone-rose{--dash-bg:#e11d48;--dash-soft:#ffe4e6;--dash-border:#fda4af}.tone-red{--dash-bg:#dc2626;--dash-soft:#fee2e2;--dash-border:#fca5a5}.tone-slate{--dash-bg:#334155;--dash-soft:#e2e8f0;--dash-border:#94a3b8}.dash-stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.dash-stat-card{position:relative;overflow:hidden;text-decoration:none;color:#0f172a!important;background:linear-gradient(180deg,#fff,#fbfdff);border:1px solid #e2e8f0;border-radius:22px;padding:16px;min-height:128px;box-shadow:0 12px 32px rgba(15,23,42,.05);transition:.18s ease}.dash-stat-card:after{content:"";position:absolute;inset:auto auto -44px -44px;width:126px;height:126px;border-radius:999px;background:var(--dash-soft,#eff6ff)}.dash-stat-card:hover{transform:translateY(-2px);border-color:var(--dash-border,#93c5fd)}.dash-stat-card span,.dash-stat-card small{position:relative;z-index:1;display:block;color:#64748b;font-weight:850}.dash-stat-card span{font-size:12.5px}.dash-stat-card b{position:relative;z-index:1;display:block;margin:9px 0 6px;font-size:23px;line-height:1.35;color:#0f172a;font-weight:1000}.dash-layout-main{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(300px,.75fr);gap:18px;align-items:start}.dash-col-wide,.dash-col-side{display:grid;gap:0}.sticky-lite{position:sticky;top:12px}.dash-attention-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}.dash-attention-card{display:flex;flex-direction:column;gap:7px;text-decoration:none;color:#0f172a!important;border:1px solid #e2e8f0;background:linear-gradient(180deg,#fff,#fbfdff);border-radius:18px;padding:13px 14px;border-right:5px solid var(--dash-bg,#2563eb);transition:.16s ease}.dash-attention-card:hover{transform:translateY(-1px);border-color:var(--dash-border,#93c5fd)}.dash-attention-card b{font-size:14px;font-weight:1000}.dash-attention-card span{color:#475569;font-size:12.5px;font-weight:750;line-height:1.7}.dash-attention-card small{color:var(--dash-bg,#2563eb);font-size:12px;font-weight:950}.dash-inventory-decision,.dash-two-list{display:grid;grid-template-columns:1fr 1fr;gap:12px}.dash-inventory-box{border:1px solid #e2e8f0;border-radius:20px;background:#f8fafc;padding:12px}.dash-inventory-box.low{background:linear-gradient(180deg,#fffbeb,#fff)}.dash-inventory-box.high{background:linear-gradient(180deg,#f5f3ff,#fff)}.dash-mini-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.dash-mini-title b{font-size:14px;font-weight:1000;color:#0f172a}.dash-mini-title span,.dash-mini-title a{font-size:12px;color:#64748b;font-weight:850;text-decoration:none}.dash-mini-title a:hover{color:#1d4ed8}.dash-table-list{display:grid;gap:8px}.dash-product-row,.dash-sale-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;text-decoration:none;color:#0f172a!important;background:#fff;border:1px solid #e2e8f0;border-radius:15px;padding:10px 11px;transition:.15s ease}.dash-product-row:hover,.dash-sale-row:hover{border-color:#93c5fd;box-shadow:0 10px 24px rgba(15,23,42,.055)}.dash-product-main b,.dash-sale-row b{display:block;font-size:12.8px;font-weight:950;line-height:1.65;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dash-product-main small,.dash-sale-row small{display:block;color:#64748b;font-size:11.5px;font-weight:750;line-height:1.7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dash-sale-row span{font-weight:1000;color:#0f172a;white-space:nowrap}.dash-num{display:inline-flex;align-items:center;justify-content:center;min-width:42px;height:34px;border-radius:13px;font-weight:1000}.dash-num.ok{background:#dcfce7;color:#166534}.dash-num.warn{background:#fef3c7;color:#92400e}.dash-health-list{display:grid;gap:8px}.dash-health-row{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid #e2e8f0;background:#fff;border-radius:15px;padding:10px 11px}.dash-health-row span{color:#475569;font-size:12.5px;font-weight:850}.dash-health-row b{font-size:12.5px;font-weight:1000;border-radius:999px;padding:4px 10px;background:#e2e8f0;color:#334155}.dash-health-row b.ok{background:#dcfce7;color:#166534}.dash-health-row b.warn{background:#fef3c7;color:#92400e}.dash-health-row b.bad{background:#fee2e2;color:#991b1b}.dash-health-row b.neutral{background:#e2e8f0;color:#334155}.dash-timeline-modern{position:relative;display:grid;gap:10px;padding-right:8px}.dash-time-item{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;text-decoration:none;color:#0f172a!important}.dash-time-item i{width:11px;height:11px;border-radius:999px;background:#2563eb;margin-top:8px;box-shadow:0 0 0 5px #dbeafe}.dash-time-item div{border:1px solid #e2e8f0;border-radius:15px;background:#fff;padding:9px 10px}.dash-time-item b,.dash-time-item span,.dash-time-item small{display:block}.dash-time-item b{font-size:12.5px;font-weight:1000}.dash-time-item span{font-size:12px;color:#475569;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dash-time-item small{font-size:11px;color:#64748b;font-weight:800}.dash-empty{border:1px dashed #cbd5e1;border-radius:16px;background:#f8fafc;color:#64748b;padding:16px;text-align:center;font-weight:850;font-size:12.5px}.afc-dashboard-modern .badge{font-weight:900}.afc-dashboard-modern .dash-section a:focus{outline:3px solid rgba(37,99,235,.18);outline-offset:2px}.content:has(.afc-dashboard-modern){padding-left:18px;padding-right:18px}.content:has(.afc-dashboard-modern)>*:not(.topbar):not(.afc-dashboard-modern){max-width:1280px!important}
@media(max-width:1120px){.dash-layout-main{grid-template-columns:1fr}.sticky-lite{position:static}.dash-hero-modern{grid-template-columns:auto minmax(0,1fr)}.dash-hero-actions{grid-column:1 / -1;justify-content:flex-start}.dash-inventory-decision,.dash-two-list{grid-template-columns:1fr}}
@media(max-width:760px){.afc-dashboard-modern{margin-bottom:18px}.dash-hero-modern{grid-template-columns:1fr;padding:17px;border-radius:22px}.dash-user-badge{width:58px;height:58px;border-radius:20px}.dash-hero-modern h1{font-size:22px}.dash-scope-line{display:grid}.dash-hero-actions a{width:100%}.dash-section-head{align-items:stretch;flex-direction:column}.dash-link{width:100%}.dash-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.dash-shortcut{min-height:118px;border-radius:18px;padding:12px}.dash-shortcut-icon{width:38px;height:38px}.dash-stat-grid{grid-template-columns:1fr 1fr;gap:9px}.dash-stat-card{min-height:116px;padding:13px;border-radius:18px}.dash-stat-card b{font-size:17px}.dash-attention-grid{grid-template-columns:1fr}.dash-product-row,.dash-sale-row{grid-template-columns:1fr}.dash-sale-row span{margin-top:2px}.content:has(.afc-dashboard-modern){padding-left:10px;padding-right:10px}}
@media(max-width:480px){.dash-quick-grid,.dash-stat-grid{grid-template-columns:1fr}.dash-shortcut{min-height:104px}.dash-scope-line span{white-space:normal}.dash-hero-modern p{font-size:12px}}

/* AFC v4.09 - login field alignment and dashboard header width */
.content:has(.afc-dashboard-modern)>.topbar{width:100%!important;max-width:1280px!important}

/* AFC v3.63 - dashboard cleanup after modern rebuild */
.dash-hero-modern.dash-hero-compact{padding:18px 20px;grid-template-columns:auto minmax(0,1fr) auto;min-height:auto;margin-bottom:16px}
.dash-hero-modern.dash-hero-compact .dash-user-badge{width:56px;height:56px;border-radius:20px;font-size:18px}
.dash-hero-modern.dash-hero-compact h1{font-size:25px}
.dash-hero-modern.dash-hero-compact p{font-size:13px;color:#64748b;margin-top:3px}
.dash-layout-main.single{grid-template-columns:minmax(0,1fr)}
.dash-two-list.single{grid-template-columns:minmax(0,1fr)}
@media (max-width:760px){.dash-hero-modern.dash-hero-compact{grid-template-columns:auto minmax(0,1fr);gap:12px}.dash-hero-modern.dash-hero-compact .dash-hero-actions{grid-column:1/-1;justify-content:stretch}.dash-hero-modern.dash-hero-compact .dash-hero-actions a{flex:1}}


/* AFC v3.64 - dashboard text cleanup and admin side spacing */
.afc-dashboard-modern .dash-hero-modern.dash-hero-compact .dash-hero-copy h1{margin-bottom:0}
.afc-dashboard-modern .dash-section-head{align-items:center}
.afc-dashboard-modern .dash-section-head h2{margin-bottom:0}
.afc-dashboard-modern .dash-section-head p{display:none!important}
.afc-dashboard-modern .dash-col-wide,
.afc-dashboard-modern .dash-col-side{gap:18px}
.afc-dashboard-modern .sticky-lite{position:static!important;top:auto!important}
.afc-dashboard-modern .dash-layout-main{overflow:visible}
@media(max-width:1120px){.afc-dashboard-modern .dash-col-side{grid-template-columns:1fr}}

/* AFC v3.65 - dashboard wording, typography and mobile polish */
.afc-dashboard-modern .dash-section-head h2{font-size:16px!important;font-weight:750!important;line-height:1.45!important;letter-spacing:0!important}
.afc-dashboard-modern .dash-hero-modern.dash-hero-compact{padding:16px 18px!important;border-radius:24px!important;margin-bottom:14px!important}
.afc-dashboard-modern .dash-hero-modern.dash-hero-compact h1{font-size:22px!important;font-weight:800!important;line-height:1.55!important}
.afc-dashboard-modern .dash-user-badge{width:52px!important;height:52px!important;border-radius:18px!important;font-size:17px!important;font-weight:800!important}
.afc-dashboard-modern .dash-primary-action,.afc-dashboard-modern .dash-secondary-action{font-size:12px!important;font-weight:650!important;min-height:38px!important;padding:8px 13px!important;border-radius:13px!important}
.afc-dashboard-modern .dash-section{margin-bottom:16px!important}
.afc-dashboard-modern .dash-panel{padding:15px!important;border-radius:22px!important}
.afc-dashboard-modern .dash-quick-grid{gap:10px!important}
.afc-dashboard-modern .dash-shortcut{min-height:116px!important;padding:13px!important;border-radius:18px!important}
.afc-dashboard-modern .dash-shortcut-icon{width:38px!important;height:38px!important;border-radius:14px!important;font-size:18px!important}
.afc-dashboard-modern .dash-shortcut b{font-size:13px!important;font-weight:750!important;line-height:1.55!important}
.afc-dashboard-modern .dash-shortcut small{font-size:11px!important;font-weight:500!important;line-height:1.65!important;color:#64748b!important}
.afc-dashboard-modern .dash-stat-card{min-height:112px!important;padding:14px!important;border-radius:18px!important}
.afc-dashboard-modern .dash-stat-card span,.afc-dashboard-modern .dash-stat-card small{font-weight:500!important}
.afc-dashboard-modern .dash-stat-card span{font-size:12px!important}
.afc-dashboard-modern .dash-stat-card b{font-size:19px!important;font-weight:780!important;margin:7px 0 5px!important}
.afc-dashboard-modern .dash-attention-card{padding:12px 13px!important;border-radius:16px!important;gap:5px!important}
.afc-dashboard-modern .dash-attention-card b{font-size:13px!important;font-weight:750!important}
.afc-dashboard-modern .dash-attention-card span{font-size:12px!important;font-weight:500!important;line-height:1.65!important}
.afc-dashboard-modern .dash-attention-card small{font-size:11.5px!important;font-weight:650!important}
.afc-dashboard-modern .dash-mini-title b{font-size:13px!important;font-weight:750!important}
.afc-dashboard-modern .dash-mini-title span,.afc-dashboard-modern .dash-mini-title a{font-size:11.5px!important;font-weight:550!important}
.afc-dashboard-modern .dash-product-row,.afc-dashboard-modern .dash-sale-row{padding:9px 10px!important;border-radius:14px!important}
.afc-dashboard-modern .dash-product-main b,.afc-dashboard-modern .dash-sale-row b{font-size:12.3px!important;font-weight:700!important;line-height:1.6!important}
.afc-dashboard-modern .dash-product-main small,.afc-dashboard-modern .dash-sale-row small{font-size:11px!important;font-weight:450!important;line-height:1.6!important}
.afc-dashboard-modern .dash-sale-row span{font-size:12px!important;font-weight:700!important}
.afc-dashboard-modern .dash-num{min-width:38px!important;height:31px!important;border-radius:12px!important;font-size:12.5px!important;font-weight:750!important}
.afc-dashboard-modern .dash-health-row{padding:9px 10px!important;border-radius:14px!important}
.afc-dashboard-modern .dash-health-row span{font-size:12px!important;font-weight:550!important}
.afc-dashboard-modern .dash-health-row b{font-size:12px!important;font-weight:700!important}
.afc-dashboard-modern .dash-time-item b{font-size:12px!important;font-weight:700!important}
.afc-dashboard-modern .dash-time-item span{font-size:11.5px!important;font-weight:500!important}
.afc-dashboard-modern .dash-time-item small{font-size:10.8px!important;font-weight:500!important}
.afc-dashboard-modern .dash-empty{font-size:12px!important;font-weight:500!important;padding:13px!important}
.login-form input:not([type="hidden"]){direction:ltr!important;text-align:left!important;unicode-bidi:plaintext!important}
.login-panel[data-login-panel="password"] input,
.login-panel[data-login-panel="password"] .afc-login-identity,
.login-panel[data-login-panel="password"] .afc-login-password{direction:ltr!important;text-align:left!important;unicode-bidi:plaintext!important}
@media(max-width:760px){
  .content:has(.afc-dashboard-modern){padding-left:8px!important;padding-right:8px!important}
  .afc-dashboard-modern{margin-bottom:14px!important}
  .afc-dashboard-modern .dash-hero-modern.dash-hero-compact{padding:13px 14px!important;border-radius:20px!important;grid-template-columns:auto minmax(0,1fr)!important;gap:10px!important}
  .afc-dashboard-modern .dash-user-badge{width:44px!important;height:44px!important;border-radius:15px!important;font-size:15px!important}
  .afc-dashboard-modern .dash-hero-modern.dash-hero-compact h1{font-size:18px!important;font-weight:750!important}
  .afc-dashboard-modern .dash-hero-actions{grid-column:1/-1!important;gap:7px!important}
  .afc-dashboard-modern .dash-hero-actions a{flex:1 1 0!important;width:auto!important;font-size:11.5px!important;min-height:36px!important;padding:8px 9px!important}
  .afc-dashboard-modern .dash-section-head{margin-bottom:9px!important}
  .afc-dashboard-modern .dash-section-head h2{font-size:14.5px!important;font-weight:700!important}
  .afc-dashboard-modern .dash-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .afc-dashboard-modern .dash-shortcut{min-height:96px!important;padding:10px!important;border-radius:16px!important}
  .afc-dashboard-modern .dash-shortcut-icon{width:34px!important;height:34px!important;border-radius:12px!important;font-size:16px!important}
  .afc-dashboard-modern .dash-shortcut b{font-size:12px!important;font-weight:700!important;line-height:1.45!important}
  .afc-dashboard-modern .dash-shortcut small{font-size:10.2px!important;font-weight:450!important;line-height:1.45!important}
  .afc-dashboard-modern .dash-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .afc-dashboard-modern .dash-stat-card{min-height:94px!important;padding:11px!important;border-radius:16px!important}
  .afc-dashboard-modern .dash-stat-card span{font-size:11px!important}
  .afc-dashboard-modern .dash-stat-card b{font-size:15px!important;font-weight:740!important;margin:5px 0 3px!important}
  .afc-dashboard-modern .dash-stat-card small{font-size:10.4px!important;line-height:1.45!important}
  .afc-dashboard-modern .dash-panel{padding:12px!important;border-radius:18px!important}
  .afc-dashboard-modern .dash-inventory-box{padding:10px!important;border-radius:16px!important}
  .afc-dashboard-modern .dash-product-row,.afc-dashboard-modern .dash-sale-row{grid-template-columns:minmax(0,1fr) auto!important;gap:7px!important;padding:8px 9px!important}
  .afc-dashboard-modern .dash-product-main b,.afc-dashboard-modern .dash-sale-row b{font-size:11.5px!important;font-weight:650!important;white-space:normal!important;line-height:1.5!important}
  .afc-dashboard-modern .dash-product-main small,.afc-dashboard-modern .dash-sale-row small{font-size:10.3px!important;font-weight:420!important;white-space:normal!important;line-height:1.45!important}
  .afc-dashboard-modern .dash-sale-row span{font-size:11.2px!important;font-weight:650!important}
  .afc-dashboard-modern .dash-num{min-width:33px!important;height:28px!important;font-size:11.5px!important;font-weight:700!important}
}
@media(max-width:480px){
  .afc-dashboard-modern .dash-quick-grid,.afc-dashboard-modern .dash-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .afc-dashboard-modern .dash-shortcut{min-height:92px!important}
  .afc-dashboard-modern .dash-stat-card{min-height:90px!important}
}


/* AFC v3.66 - dashboard hero action buttons alignment */
.afc-dashboard-modern .dash-hero-actions{
  align-items:center!important;
}
.afc-dashboard-modern .dash-primary-action,
.afc-dashboard-modern .dash-secondary-action{
  box-sizing:border-box!important;
  flex:0 0 136px!important;
  width:136px!important;
  min-width:136px!important;
  height:40px!important;
  min-height:40px!important;
  padding:0 14px!important;
  line-height:1.4!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
}
@media(max-width:760px){
  .afc-dashboard-modern .dash-hero-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:7px!important;
    width:100%!important;
  }
  .afc-dashboard-modern .dash-primary-action,
  .afc-dashboard-modern .dash-secondary-action{
    flex:none!important;
    width:100%!important;
    min-width:0!important;
    height:38px!important;
    min-height:38px!important;
    padding:0 8px!important;
    font-size:11.5px!important;
  }
}
@media(max-width:380px){
  .afc-dashboard-modern .dash-hero-actions{
    grid-template-columns:1fr!important;
  }
}
/* AFC v3.68 - commission auto settings */
.quick-commission-row{margin-top:12px;padding:12px;border:1px dashed #cbd5e1;border-radius:16px;background:#f8fafc}
@media(max-width:760px){.quick-commission-row{padding:10px}}

/* AFC v3.68 - commission settings */
.commission-settings-row{margin:10px 0 6px}
.quick-commission-row{grid-template-columns:minmax(220px,360px)!important}
@media(max-width:760px){.quick-commission-row{grid-template-columns:1fr!important}}

/* AFC v3.88 - align sale/order notes card with main detail card */
.sale-view-top-layout>.sale-view-side-notes{top:0!important;margin-top:0!important}
/* AFC v3.94 - native OTP autofill helper */
.afc-otp-username-proxy{position:absolute!important;left:-9999px!important;top:auto!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}


/* AFC v4.06 - system health */
.health-page{display:grid;gap:18px}.health-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}.health-head>div:first-child{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.health-head h1{margin:0}.health-head-status{display:flex}.health-actions,.health-section-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.health-actions form,.health-section-head form{margin:0}.health-summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:12px}.health-summary-card{display:flex;flex-direction:column;gap:7px;min-height:112px;justify-content:center}.health-summary-card>span{font-size:13px;color:var(--muted,#64748b)}.health-summary-card>b{font-size:22px}.health-summary-card small{color:var(--muted,#64748b)}.health-badge{display:inline-flex;align-items:center;justify-content:center;width:max-content;max-width:100%;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:700;line-height:1.4;white-space:nowrap}.health-ok{background:#dcfce7;color:#166534}.health-warn{background:#fef3c7;color:#92400e}.health-bad{background:#fee2e2;color:#991b1b}.health-neutral{background:#eef2f7;color:#475569}.health-section{padding:18px}.health-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px}.health-section-head h2{margin:0;font-size:18px}.health-table-wrap{width:100%;overflow:auto;border-radius:12px}.health-table{min-width:860px;margin:0}.health-table th,.health-table td{vertical-align:middle}.health-table td b,.health-table td small{display:block}.health-table td small{margin-top:5px;color:var(--muted,#64748b)}.health-error-message{min-width:280px;max-width:540px;white-space:normal;line-height:1.8}.health-two-col{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.health-kv{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 0;border-bottom:1px solid rgba(148,163,184,.2)}.health-kv:last-child{border-bottom:0}.health-kv span{color:var(--muted,#64748b)}.health-kv b{text-align:left}.health-mini-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.health-mini-grid>div{padding:14px;border:1px solid rgba(148,163,184,.25);border-radius:12px;display:flex;flex-direction:column;gap:8px}.health-mini-grid span{font-size:13px;color:var(--muted,#64748b)}.health-mini-grid b{font-size:22px}.health-perf-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid rgba(148,163,184,.2)}.health-perf-row:last-child{border-bottom:0}.health-perf-row div{min-width:0}.health-perf-row b,.health-perf-row small{display:block}.health-perf-row small{max-width:440px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted,#64748b);margin-top:4px}.health-perf-row strong{white-space:nowrap;direction:ltr}.btn.compact{padding:6px 10px;min-height:auto;font-size:12px}
@media(max-width:1180px){.health-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.health-page{gap:14px}.health-head{align-items:stretch}.health-head>div:first-child{justify-content:space-between;width:100%}.health-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.health-actions form,.health-actions button{width:100%}.health-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.health-summary-card{min-height:100px;padding:14px}.health-summary-card>b{font-size:18px}.health-two-col{grid-template-columns:1fr}.health-section{padding:14px}.health-mini-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.health-table{min-width:780px}.health-section-head{align-items:flex-start}.health-section-actions{width:100%}.health-section-actions .btn{flex:1}.health-kv{align-items:flex-start}.health-kv b{max-width:62%;white-space:normal}}
@media(max-width:420px){.health-summary-grid{grid-template-columns:1fr 1fr}.health-mini-grid{grid-template-columns:1fr 1fr}.health-badge{white-space:normal;text-align:center}}


/* Karin v4.33 - visual identity, sidebar brand and rebuilt login */
.karin-sidebar-brand{align-items:center!important;gap:10px!important;padding:8px 5px 13px!important}
.karin-sidebar-brand .brand-logo{width:44px!important;height:44px!important;flex:0 0 44px!important;padding:0!important;border-radius:14px!important;background:#071a35!important;overflow:hidden;box-shadow:0 8px 20px rgba(3,18,42,.18)}
.karin-sidebar-brand .brand-logo img{display:block;width:100%;height:100%;object-fit:cover}
.karin-sidebar-brand .brand-copy{min-width:0}
.karin-sidebar-brand .brand-copy b{font-size:18px!important;line-height:1.25!important;color:#073b8c!important;font-weight:1000!important}
.karin-sidebar-brand .brand-copy span{display:block;margin-top:3px;font-size:10.5px!important;line-height:1.55!important;color:#64748b!important;font-weight:700}
.karin-login-shell{min-height:100vh!important;padding:28px 16px!important;background:radial-gradient(circle at 50% 0,rgba(0,195,255,.14),transparent 34%),linear-gradient(145deg,#f6fbff 0%,#eef5ff 45%,#f8fafc 100%)}
.karin-login-card{width:min(540px,100%)!important;padding:30px!important;border:1px solid rgba(148,163,184,.22)!important;border-radius:28px!important;box-shadow:0 28px 80px rgba(2,20,49,.13)!important;overflow:hidden;position:relative}
.karin-login-card:before{content:"";position:absolute;inset:0 0 auto 0;height:4px;background:linear-gradient(90deg,#0b49b6,#00d9f7,#0b49b6)}
.karin-login-brand{display:flex;justify-content:center;align-items:center;min-height:126px;margin:-2px -2px 8px;padding:6px 10px 0}
.karin-login-brand img{display:block;width:min(430px,100%);height:auto;max-height:150px;object-fit:contain}
.karin-login-heading{text-align:center;margin:0 0 18px}
.karin-login-heading h1{margin:0;color:#071a35;font-size:24px;line-height:1.5;font-weight:1000}
.karin-login-heading p{margin:3px 0 0;color:#64748b;font-size:13px;font-weight:750}
.karin-login-card .login-tabs{margin-top:15px;background:#edf3fb;border:1px solid #dbe6f4}
.karin-login-card .login-submit{background:linear-gradient(135deg,#0d54ca,#08398e)!important;border-color:#08398e!important;box-shadow:0 12px 28px rgba(11,73,182,.20)}
.karin-login-card .login-submit:hover{background:linear-gradient(135deg,#0a47ad,#062e74)!important}
@media(max-width:640px){.karin-sidebar-brand .brand-logo{width:42px!important;height:42px!important;flex-basis:42px!important}.karin-login-shell{padding:14px!important;align-items:center!important}.karin-login-card{padding:22px 18px!important;border-radius:24px!important}.karin-login-brand{min-height:104px;margin-bottom:4px}.karin-login-heading h1{font-size:21px}.karin-login-heading p{font-size:12px}}


/* Karin v4.34 - mobile login viewport fit and footer spacing */
.content.full:has(.karin-login-shell){
  max-width:none!important;
  min-height:100vh;
  min-height:100svh;
  padding:0!important;
  display:flex;
  flex-direction:column;
}
.content.full:has(.karin-login-shell)>.karin-login-shell{
  width:100%;
  max-width:none!important;
  min-height:0!important;
  flex:1 0 auto;
}
.content.full:has(.karin-login-shell)>.credit{
  flex:0 0 auto;
  margin:0!important;
  padding:8px 12px calc(8px + env(safe-area-inset-bottom));
}
@media(max-width:640px){
  .content.full:has(.karin-login-shell)>.karin-login-shell{
    align-items:flex-start!important;
    justify-content:center!important;
    padding:10px 12px 6px!important;
  }
  .karin-login-card{
    margin:0 auto!important;
    padding:16px 16px 17px!important;
    border-radius:22px!important;
  }
  .karin-login-brand{
    min-height:82px!important;
    margin:-2px -2px 2px!important;
    padding:2px 8px 0!important;
  }
  .karin-login-brand img{max-height:105px!important}
  .karin-login-heading{margin-bottom:12px!important}
  .karin-login-heading h1{font-size:20px!important;line-height:1.4!important}
  .karin-login-heading p{margin-top:2px!important;font-size:11.5px!important}
  .karin-login-card .login-tabs{margin-top:10px!important}
  .karin-login-card .login-form{gap:7px!important}
  .karin-login-card label{margin-top:5px!important;margin-bottom:4px!important}
  .karin-login-card input:not([type="hidden"]){min-height:44px!important;padding-top:9px!important;padding-bottom:9px!important}
  .karin-login-card .login-submit{min-height:46px!important;margin-top:8px!important}
}


/* Karin v4.36 - compact sidebar identity and mobile login flow */
.karin-sidebar-brand .brand-copy b{
  font-size:17px!important;
  line-height:1.25!important;
}
.karin-sidebar-brand .brand-copy span{
  margin-top:1px!important;
  font-size:9px!important;
  line-height:1.5!important;
  white-space:nowrap!important;
}
.karin-login-card{margin-bottom:0!important}
@media(max-width:640px){
  .content.full:has(.karin-login-shell){
    min-height:100vh!important;
    min-height:100svh!important;
    background:radial-gradient(circle at 50% 0,rgba(0,195,255,.14),transparent 34%),linear-gradient(145deg,#f6fbff 0%,#eef5ff 45%,#f8fafc 100%)!important;
  }
  .content.full:has(.karin-login-shell)>.karin-login-shell{
    flex:0 0 auto!important;
    min-height:0!important;
    align-items:flex-start!important;
    justify-content:flex-start!important;
    padding:4px 10px 0!important;
    background:transparent!important;
  }
  .content.full:has(.karin-login-shell)>.credit{
    flex:0 0 auto!important;
    align-self:center!important;
    width:100%!important;
    margin:0 auto!important;
    padding:6px 12px calc(8px + env(safe-area-inset-bottom))!important;
    font-size:9px!important;
    line-height:1.5!important;
  }
  .karin-login-card{
    width:100%!important;
    margin:0 auto!important;
    padding:13px 14px 14px!important;
    border-radius:20px!important;
    box-shadow:0 16px 42px rgba(2,20,49,.11)!important;
  }
  .karin-login-brand{
    min-height:70px!important;
    margin:-2px -2px 0!important;
    padding:0 6px!important;
  }
  .karin-login-brand img{
    width:min(360px,100%)!important;
    max-height:90px!important;
  }
  .karin-login-heading{margin:0 0 8px!important}
  .karin-login-heading h1{font-size:18px!important;line-height:1.35!important}
  .karin-login-heading p{margin-top:1px!important;font-size:11px!important;line-height:1.6!important}
  .karin-login-card .login-tabs{
    margin:8px 0 9px!important;
    padding:5px!important;
    border-radius:16px!important;
  }
  .karin-login-card .login-tab{
    min-height:38px!important;
    padding:8px 7px!important;
    font-size:12px!important;
    border-radius:12px!important;
  }
  .karin-login-card label{
    margin-top:4px!important;
    margin-bottom:3px!important;
    font-size:12px!important;
  }
  .karin-login-card input:not([type="hidden"]){
    min-height:42px!important;
    padding:7px 10px!important;
    font-size:16px!important;
    line-height:1.25!important;
    border-radius:10px!important;
  }
  .karin-login-card .login-submit{
    min-height:43px!important;
    margin-top:7px!important;
    padding:9px 12px!important;
    font-size:12.5px!important;
    border-radius:14px!important;
  }
}

/* Karin v4.37 - login content-fit layout, centered credit and no redundant heading */
.content.full.karin-login-page{
  margin:0!important;
  width:100%!important;
  max-width:none!important;
  min-height:100vh!important;
  min-height:100svh!important;
  padding:18px 14px 12px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  background:radial-gradient(circle at 50% 0,rgba(0,195,255,.14),transparent 34%),linear-gradient(145deg,#f6fbff 0%,#eef5ff 45%,#f8fafc 100%)!important;
}
.karin-login-page>.karin-login-shell{
  display:block!important;
  flex:0 0 auto!important;
  width:min(540px,100%)!important;
  max-width:540px!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  background:transparent!important;
}
.karin-login-page .karin-login-card{
  width:100%!important;
  margin:0!important;
}
.karin-login-page .karin-login-heading{display:none!important}
.content.full.karin-login-page>.credit{
  display:block!important;
  flex:0 0 auto!important;
  align-self:center!important;
  width:100%!important;
  max-width:540px!important;
  margin:0!important;
  padding:0 10px!important;
  text-align:center!important;
  direction:ltr!important;
  line-height:1.5!important;
}
@media(max-width:640px){
  .content.full.karin-login-page{
    min-height:100vh!important;
    min-height:100svh!important;
    padding:4px 10px calc(5px + env(safe-area-inset-bottom))!important;
    justify-content:flex-start!important;
    gap:3px!important;
  }
  .karin-login-page>.karin-login-shell{
    width:100%!important;
    max-width:100%!important;
  }
  .karin-login-page .karin-login-card{
    padding:10px 12px 12px!important;
    border-radius:18px!important;
    box-shadow:0 14px 38px rgba(2,20,49,.10)!important;
  }
  .karin-login-page .karin-login-brand{
    min-height:0!important;
    height:auto!important;
    margin:0 0 2px!important;
    padding:0 4px!important;
  }
  .karin-login-page .karin-login-brand img{
    display:block!important;
    width:min(280px,82vw)!important;
    height:auto!important;
    max-height:101px!important;
    margin:0 auto!important;
  }
  .karin-login-page .login-tabs{
    margin:2px 0 7px!important;
    padding:4px!important;
    border-radius:14px!important;
  }
  .karin-login-page .login-tab{
    min-height:36px!important;
    padding:7px 6px!important;
    font-size:11.5px!important;
    border-radius:11px!important;
  }
  .karin-login-page .login-form label{
    margin:3px 0 2px!important;
    font-size:11.5px!important;
    line-height:1.5!important;
  }
  .karin-login-page .login-form input:not([type="hidden"]){
    min-height:41px!important;
    margin-top:3px!important;
    padding:7px 9px!important;
    font-size:16px!important;
    line-height:1.2!important;
    border-radius:10px!important;
  }
  .karin-login-page .login-submit{
    min-height:42px!important;
    margin-top:7px!important;
    padding:8px 11px!important;
    font-size:12px!important;
    border-radius:13px!important;
  }
  .content.full.karin-login-page>.credit{
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding:1px 8px 0!important;
    font-size:8.5px!important;
    line-height:1.35!important;
    text-align:center!important;
  }
}
@media(max-width:640px) and (max-height:620px){
  .content.full.karin-login-page{padding-top:2px!important;gap:2px!important}
  .karin-login-page .karin-login-card{padding:8px 10px 9px!important}
  .karin-login-page .karin-login-brand img{width:min(245px,74vw)!important;max-height:88px!important}
  .karin-login-page .login-tabs{margin:1px 0 5px!important;padding:3px!important}
  .karin-login-page .login-tab{min-height:34px!important;padding:6px 5px!important}
  .karin-login-page .login-form label{margin-top:2px!important}
  .karin-login-page .login-form input:not([type="hidden"]){min-height:39px!important;padding-top:6px!important;padding-bottom:6px!important}
  .karin-login-page .login-submit{min-height:40px!important;margin-top:5px!important}
  .content.full.karin-login-page>.credit{font-size:8px!important;padding-top:0!important}
}


/* Karin v4.48: product editor attributes, pricing and price history discoverability */
.product-editor-section{box-shadow:none!important;margin:16px 0 0!important;padding:16px!important;background:#fbfdff!important;border:1px solid #dbe5f2!important}
.section-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.section-title-row h2{margin:0}
.attribute-editor-list{display:grid;gap:10px}
.attribute-editor-row{display:grid;grid-template-columns:minmax(180px,.7fr) minmax(280px,1.3fr) auto;align-items:end;gap:10px;padding:12px;border:1px solid #dbe5f2;border-radius:12px;background:#fff}
.attribute-editor-row>div{min-width:0}
.attribute-remove-btn{width:42px!important;min-width:42px!important;height:42px!important;padding:0!important;font-size:20px!important;line-height:1!important}
.variant-pricing-box{background:#fff!important}
.variant-pricing-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}
.variant-price-field{padding:12px;border:1px solid #dbe5f2;border-radius:12px;background:#f8fbff}
.variant-price-field label{display:block;margin-bottom:7px;font-weight:800}
.variant-special-pricing-grid{display:grid;grid-template-columns:repeat(2,minmax(240px,1fr));gap:12px;margin-top:14px}
.variant-special-price-card{padding:14px;border:1px solid #dbe5f2;border-radius:12px;background:#fff}
.variant-special-price-card>.toggle-inline{display:flex!important;align-items:center!important;gap:8px!important;margin:0!important;font-weight:800!important}
.variant-special-price-card>.toggle-inline input[type="checkbox"]{width:18px!important;height:18px!important;min-width:18px!important;margin:0!important}
.variant-special-input{margin-top:12px}
.variant-special-input label{display:block;margin-bottom:7px;font-weight:700}
.variant-pricing-actions{display:flex;justify-content:flex-start;margin-top:14px}
.variant-pricing-actions button{min-width:190px}
.product-variants-table th,.product-variants-table td{vertical-align:middle}
.product-variants-table input{min-width:130px}
.product-variants-table td:first-child input:last-child{min-width:210px}
@media(max-width:820px){
 .attribute-editor-row{grid-template-columns:1fr}
 .attribute-remove-btn{width:100%!important;min-width:0!important}
 .variant-special-pricing-grid{grid-template-columns:1fr}
 .variant-pricing-actions button{width:100%}
}


/* Karin v4.53: compact price-history access and restored quick-POS product cards */
/* Karin v4.54: purchase, supplier and account-management layouts live in their page modules. */
.variant-pricing-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.variant-pricing-heading h2{margin:0}
.variant-price-history-link{display:inline-flex;align-items:center;gap:5px;color:#64748b!important;font-size:12px;font-weight:800;text-decoration:none;padding:5px 8px;border-radius:8px;white-space:nowrap}
.variant-price-history-link::before{content:"↶";font-size:14px;line-height:1}
.variant-price-history-link:hover{color:#2563eb!important;background:#eff6ff}

.product-list{gap:8px!important;padding-left:3px}
.product-list .product-tile{
 display:grid!important;
 grid-template-columns:50px minmax(0,1fr)!important;
 align-items:center!important;
 direction:rtl!important;
 width:100%!important;
 min-width:0!important;
 min-height:72px!important;
 padding:8px 10px!important;
 column-gap:10px!important;
 border:1px solid #dbe5f0!important;
 border-radius:14px!important;
 background:#fff!important;
 color:#0f172a!important;
 text-align:right!important;
 overflow:hidden!important;
 box-shadow:0 1px 2px rgba(15,23,42,.025)!important;
 transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease!important;
}
.product-list .product-tile:hover{border-color:#93b4e8!important;box-shadow:0 6px 16px rgba(37,99,235,.08)!important;transform:translateY(-1px)}
.product-list .product-tile:focus-visible{outline:3px solid rgba(37,99,235,.18)!important;outline-offset:1px!important}
.product-list .product-tile>.tile-media{
 grid-column:1!important;
 display:grid!important;
 grid-template-rows:44px 14px!important;
 justify-items:center!important;
 align-content:center!important;
 gap:3px!important;
 width:50px!important;
 min-width:50px!important;
 margin:0!important;
 padding:0!important;
 overflow:visible!important;
}
.product-list .product-tile .tile-media>.product-tile-thumb{
 position:static!important;
 grid-column:1!important;
 grid-row:1!important;
 display:flex!important;
 width:44px!important;
 height:44px!important;
 min-width:44px!important;
 max-width:44px!important;
 margin:0!important;
 padding:0!important;
 object-fit:cover!important;
 border:1px solid #e2e8f0!important;
 border-radius:11px!important;
 background:#f8fafc!important;
 box-sizing:border-box!important;
}
.product-list .product-tile .tile-media>.product-tile-thumb.empty{
 align-items:center!important;
 justify-content:center!important;
 padding:3px!important;
 color:#94a3b8!important;
 font-size:9px!important;
 font-weight:700!important;
 line-height:1.2!important;
 text-align:center!important;
}
.product-list .product-tile .tile-sku-code{
 grid-column:1!important;
 grid-row:2!important;
 justify-self:center!important;
 display:block!important;
 max-width:48px!important;
 min-width:0!important;
 margin:0!important;
 padding:1px 5px!important;
 overflow:hidden!important;
 border:1px solid #e2e8f0!important;
 border-radius:999px!important;
 background:#f8fafc!important;
 color:#64748b!important;
 font-size:9.5px!important;
 font-weight:500!important;
 line-height:14px!important;
 text-align:center!important;
 white-space:nowrap!important;
 text-overflow:ellipsis!important;
 direction:ltr!important;
 unicode-bidi:isolate!important;
 box-sizing:border-box!important;
}
.product-list .product-tile>.tile-body{
 grid-column:2!important;
 display:flex!important;
 flex-direction:column!important;
 justify-content:center!important;
 gap:5px!important;
 min-width:0!important;
 width:100%!important;
 overflow:hidden!important;
}
.product-list .product-tile .tile-title{
 display:block!important;
 min-width:0!important;
 width:100%!important;
 margin:0!important;
 padding:0!important;
 overflow:hidden!important;
 color:#0f172a!important;
 font-size:13px!important;
 font-weight:800!important;
 line-height:1.55!important;
 text-align:right!important;
 white-space:nowrap!important;
 text-overflow:ellipsis!important;
}
.product-list .product-tile .tile-details{
 display:flex!important;
 align-items:center!important;
 justify-content:flex-start!important;
 direction:rtl!important;
 min-width:0!important;
 width:100%!important;
 margin:0!important;
 padding:0!important;
 overflow:hidden!important;
 color:#64748b!important;
 font-size:11px!important;
 font-weight:400!important;
 line-height:18px!important;
 white-space:nowrap!important;
}
.product-list .product-tile .tile-meta-text{
 display:block!important;
 flex:0 1 auto!important;
 min-width:0!important;
 max-width:55%!important;
 overflow:hidden!important;
 color:#64748b!important;
 font-weight:400!important;
 text-overflow:ellipsis!important;
 white-space:nowrap!important;
}
.product-list .product-tile .tile-price{
 display:inline-flex!important;
 flex:0 0 auto!important;
 align-items:center!important;
 color:#0f5bd8!important;
 font-size:11.5px!important;
 font-weight:800!important;
 direction:rtl!important;
 unicode-bidi:isolate!important;
 white-space:nowrap!important;
}
.product-list .product-tile .tile-price::before{
 content:"|"!important;
 margin:0 7px!important;
 color:#cbd5e1!important;
 font-size:10px!important;
 font-weight:400!important;
}
.product-list .product-tile>b,
.product-list .product-tile>small:not(.tile-details),
.product-list .product-tile>span:not(.tile-media):not(.tile-body):not(.product-tile-thumb){display:none!important}
.product-list .product-tile[style*="display: none"]{display:none!important}
@media(max-width:640px){
 .variant-pricing-heading{align-items:flex-start}
 .product-list .product-tile{grid-template-columns:46px minmax(0,1fr)!important;min-height:68px!important;padding:7px 9px!important;column-gap:8px!important}
 .product-list .product-tile>.tile-media{grid-template-rows:41px 13px!important;width:46px!important;min-width:46px!important}
 .product-list .product-tile .tile-media>.product-tile-thumb{width:41px!important;height:41px!important;min-width:41px!important;max-width:41px!important}
 .product-list .product-tile .tile-sku-code{max-width:44px!important;padding:0 4px!important;font-size:9px!important;line-height:13px!important}
 .product-list .product-tile .tile-title{font-size:12.5px!important}
 .product-list .product-tile .tile-meta-text{max-width:50%!important}
 .product-list .product-tile .tile-price{font-size:11px!important}
 .product-list .product-tile .tile-price::before{margin:0 5px!important}
}

/* Karin v4.55: cheque documents and status history layouts are scoped to cheque pages. */


/* Karin v4.57 - sidebar icon quality and neutral dashboard avatar */
.karin-sidebar-brand{gap:11px!important;padding:8px 5px 13px!important}
.karin-sidebar-brand .brand-logo{width:52px!important;height:52px!important;flex:0 0 52px!important;padding:0!important;border-radius:16px!important;background:transparent!important;box-shadow:none!important;overflow:visible!important}
.karin-sidebar-brand .brand-logo img{display:block;width:52px!important;height:52px!important;object-fit:contain!important;image-rendering:auto!important;border-radius:16px!important}
.dash-user-avatar{background:linear-gradient(145deg,#eff6ff,#dbeafe)!important;color:#1d4ed8!important;border:1px solid #bfdbfe!important;box-shadow:0 10px 24px rgba(37,99,235,.12)!important}
.dash-user-avatar svg{width:26px;height:26px;display:block}
@media(max-width:640px){.karin-sidebar-brand .brand-logo,.karin-sidebar-brand .brand-logo img{width:48px!important;height:48px!important}.karin-sidebar-brand .brand-logo{flex-basis:48px!important}}


/* Karin 4.69 - order delivery modal: one horizontal summary row */
body .delivery-modal-card-v322 .delivery-summary-strip{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:10px!important;
  width:100%!important;
  align-items:stretch!important;
}
body .delivery-modal-card-v322 .delivery-summary-strip>div{
  grid-column:auto!important;
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  margin:0!important;
}
@media(max-width:900px){body .delivery-modal-card-v322 .delivery-summary-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:520px){body .delivery-modal-card-v322 .delivery-summary-strip{grid-template-columns:1fr!important}}


/* Karin v4.70 - desktop width consistency and complete sidebar branding */
@media(min-width:1001px){
  .sidebar{width:270px!important;}
  .content{margin-right:270px!important;width:calc(100% - 270px)!important;}
  .sidebar-collapsed .sidebar{transform:translateX(284px)!important;}
  .sidebar-collapsed .content{margin-right:0!important;width:100%!important;}
}
.content>*,.topbar{max-width:1180px;}
.karin-sidebar-brand .brand-copy{min-width:0!important;flex:1 1 auto!important;overflow:visible!important;}
.karin-sidebar-brand .brand-copy span{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;font-size:9.5px!important;line-height:1.65!important;max-width:100%!important;}


/* Karin v4.71 - single desktop scrollbar for expandable sidebar */
@media(min-width:1001px){
  html{overflow-y:scroll!important;}
  body{overflow-y:visible!important;}
  .app{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 270px!important;
    align-items:start!important;
    min-height:100vh!important;
  }
  .sidebar{
    grid-column:2!important;
    grid-row:1!important;
    position:sticky!important;
    top:0!important;
    right:auto!important;
    bottom:auto!important;
    width:270px!important;
    height:auto!important;
    min-height:100vh!important;
    max-height:none!important;
    overflow:visible!important;
    align-self:start!important;
    flex:none!important;
  }
  .sidebar nav{
    overflow:visible!important;
    max-height:none!important;
  }
  .content{
    grid-column:1!important;
    grid-row:1!important;
    margin-right:0!important;
    width:100%!important;
    min-width:0!important;
  }
  .sidebar-backdrop{display:none!important;}
  body.sidebar-collapsed .app{grid-template-columns:minmax(0,1fr) 0!important;}
  body.sidebar-collapsed .sidebar{
    width:0!important;
    min-width:0!important;
    padding-left:0!important;
    padding-right:0!important;
    border:0!important;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
    transform:none!important;
    overflow:hidden!important;
  }
  body.sidebar-collapsed .content{margin-right:0!important;width:100%!important;}
}

/* Karin v4.73 - restore RTL desktop sidebar with one page scrollbar */
@media(min-width:1001px){
  html{overflow-y:scroll!important;}
  body{overflow-y:visible!important;}
  .app{
    display:flex!important;
    flex-direction:row!important;
    direction:rtl!important;
    align-items:flex-start!important;
    min-height:100vh!important;
  }
  .sidebar{
    order:0!important;
    position:sticky!important;
    top:0!important;
    right:auto!important;
    left:auto!important;
    bottom:auto!important;
    flex:0 0 270px!important;
    width:270px!important;
    min-width:270px!important;
    height:auto!important;
    min-height:100vh!important;
    max-height:none!important;
    overflow:visible!important;
    align-self:flex-start!important;
    direction:rtl!important;
    transform:none!important;
  }
  .sidebar nav{overflow:visible!important;max-height:none!important;}
  .content{
    order:1!important;
    flex:1 1 auto!important;
    width:auto!important;
    min-width:0!important;
    margin-right:0!important;
    direction:rtl!important;
  }
  .sidebar-backdrop{display:none!important;}
  body.sidebar-collapsed .sidebar{
    display:none!important;
    width:0!important;
    min-width:0!important;
    flex-basis:0!important;
  }
  body.sidebar-collapsed .content{width:auto!important;max-width:none!important;margin-right:0!important;}
}
