:root{
  --bg:#eef3f1; --panel:#ffffff; --ink:#16241f; --muted:#5f726b;
  --line:#dde7e3; --brand:#0e6b4e; --brand-2:#16a06f; --brand-ink:#fff;
  --green:#1f9d57; --green-bg:#e6f6ee; --amber:#b97d00; --amber-bg:#fdf3e0;
  --red:#d6453f; --red-bg:#fbe9e9; --grey-bg:#eef1f0; --blue-bg:#e7f0fa;
  --radius:14px;
  --shadow:0 1px 2px rgba(14,60,46,.05),0 6px 22px rgba(14,60,46,.07);
  --shadow-lg:0 10px 34px rgba(14,60,46,.13);
  /* signature gradients */
  --grad-brand:linear-gradient(135deg,#0e6b4e 0%,#16a06f 100%);
  --grad-sidebar:linear-gradient(176deg,#0a3a2b 0%,#0c5238 52%,#0e6b4e 100%);
  --gold:#d9a441;
  /* KPI accent hues (label / value / chip-bg start / chip-bg end) */
  --k1:#0e9f6e; --k1b:#d8f4e8;  --k2:#0ea5b7; --k2b:#d6f1f4;
  --k3:#6366f1; --k3b:#e5e7fb;  --k4:#d9822b; --k4b:#fbeed9;
  --k5:#e0457b; --k5b:#fbe1ec;  --k6:#7c3aed; --k6b:#efe7fc;
  --k7:#2563eb; --k7b:#e2ecfd;  --k8:#0f766e; --k8b:#d7efec;
}
*{box-sizing:border-box}
html,body{margin:0}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans Bengali","Hind Siliguri",sans-serif;
  background:var(--bg);color:var(--ink);font-size:14.5px;line-height:1.5}
body.bn{font-family:"Hind Siliguri","Kalpurush","Noto Sans Bengali",-apple-system,"Segoe UI",Roboto,sans-serif}
a{color:var(--brand-2);text-decoration:none}
h1,h2,h3{margin:0 0 .4rem}
code{background:var(--grey-bg);padding:.1rem .35rem;border-radius:5px;font-size:.85em}
.m0{margin:0}.mt{margin-top:.5rem}.small{font-size:.82rem}.muted{color:var(--muted)}.center{text-align:center}

/* layout */
.layout{display:flex;min-height:100vh}
.sidebar{width:248px;background:var(--brand);color:#dbe6f3;flex-shrink:0;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.brand{display:flex;align-items:center;gap:.6rem;padding:1.1rem 1.1rem;border-bottom:1px solid rgba(255,255,255,.12)}
.brand-mark{display:inline-grid;place-items:center;width:34px;height:34px;background:var(--brand-2);color:#fff;border-radius:8px;font-weight:700;letter-spacing:.5px}
.brand-mark.lg{width:54px;height:54px;font-size:1.3rem;margin:0 auto}
.brand-name{font-weight:600;color:#fff;font-size:.98rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav{padding:.6rem .5rem;overflow:auto}
.nav-section{font-size:.68rem;text-transform:uppercase;letter-spacing:.08em;color:#9fb6d2;padding:.9rem .7rem .3rem}
.navlink{display:flex;align-items:center;gap:.6rem;padding:.55rem .7rem;border-radius:8px;color:#cfdded;margin-bottom:2px}
.navlink .i{width:18px;text-align:center;opacity:.85}
.navlink:hover{background:rgba(255,255,255,.08);color:#fff}
.navlink.active{background:var(--brand-2);color:#fff}
.navlink.danger.active{background:var(--red)}
.main{flex:1;display:flex;flex-direction:column;min-width:0}
.topbar{display:flex;align-items:center;justify-content:space-between;background:var(--panel);border-bottom:1px solid var(--line);padding:.8rem 1.4rem;position:sticky;top:0;z-index:5}
.topbar-title{font-weight:600;font-size:1.05rem}
.topbar-right{display:flex;align-items:center;gap:.9rem}
.user-chip{font-weight:600}.user-chip small{color:var(--muted);font-weight:400;margin-left:.25rem}
.lang-toggle{border:1px solid var(--line);padding:.2rem .55rem;border-radius:6px;color:var(--muted)}
.content{padding:1.4rem;flex:1}
.appfoot{padding:1rem 1.4rem;color:var(--muted);font-size:.8rem;border-top:1px solid var(--line)}
.inline{display:inline}

/* cards + grid */
.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:1.2rem;margin-bottom:1.2rem}
.card.narrow{max-width:680px}
.card-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem}
.card-head h2{font-size:1.1rem}
.sub{font-size:.92rem;color:var(--muted);margin:1.2rem 0 .6rem;text-transform:uppercase;letter-spacing:.04em}
.grid{display:grid;gap:1rem}
.grid-2{grid-template-columns:1fr 1fr}
.grid-4{grid-template-columns:repeat(4,1fr)}
.stat{padding:1rem 1.1rem}
.stat-label{color:var(--muted);font-size:.8rem;text-transform:uppercase;letter-spacing:.04em}
.stat-value{font-size:1.7rem;font-weight:700;margin-top:.2rem}

/* tables */
.table{width:100%;border-collapse:collapse}
.table th,.table td{text-align:left;padding:.6rem .7rem;border-bottom:1px solid var(--line);vertical-align:middle}
.table thead th{font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.table tbody tr:hover{background:#fafbfe}
.row-actions{display:flex;gap:.35rem;justify-content:flex-end}

/* forms */
.field{display:block;margin-bottom:.9rem}
.field>span{display:block;font-size:.82rem;color:var(--muted);margin-bottom:.3rem}
input[type=text],input[type=email],input[type=password],input[type=number],select{
  width:100%;padding:.55rem .7rem;border:1px solid var(--line);border-radius:8px;background:#fff;font:inherit;color:var(--ink)}
input:focus,select:focus{outline:none;border-color:var(--brand-2);box-shadow:0 0 0 3px rgba(46,117,182,.15)}
.check{display:flex;align-items:center;gap:.5rem;margin:.4rem 0}
.form-actions{display:flex;gap:.6rem;justify-content:flex-end;margin-top:1rem}
.err{color:var(--red);font-size:.8rem}

/* buttons */
.btn{display:inline-flex;align-items:center;gap:.4rem;border:1px solid transparent;border-radius:8px;padding:.55rem .9rem;font:inherit;font-weight:600;cursor:pointer}
.btn-sm{padding:.35rem .65rem;font-size:.82rem}
.btn-block{width:100%;justify-content:center}
.btn-primary{background:var(--brand);color:#fff}
.btn-primary:hover{background:#16395a}
.btn-ghost{background:#fff;border-color:var(--line);color:var(--ink)}
.btn-ghost:hover{background:var(--grey-bg)}
.btn-danger{background:var(--red);color:#fff}
.btn-danger:hover{background:#9f2c2c}

/* badges + alerts */
.badge{display:inline-block;padding:.15rem .5rem;border-radius:20px;font-size:.72rem;font-weight:600}
.badge-green{background:var(--green-bg);color:var(--green)}
.badge-amber{background:var(--amber-bg);color:var(--amber)}
.badge-red{background:var(--red-bg);color:var(--red)}
.badge-grey{background:var(--grey-bg);color:var(--muted)}
.badge-blue{background:var(--blue-bg);color:var(--brand-2)}
.alert{padding:.7rem .9rem;border-radius:8px;margin-bottom:1rem;font-size:.9rem;border:1px solid transparent}
.alert ul{padding-left:1.1rem}
.alert-success{background:var(--green-bg);color:#13683a;border-color:#bfe6cf}
.alert-error,.alert-danger{background:var(--red-bg);color:#922;border-color:#f1c9c9}
.alert-warning{background:var(--amber-bg);color:#7a5400;border-color:#f0dcae}

/* dashboard phase map */
.phase-map{display:grid;grid-template-columns:repeat(4,1fr);gap:.6rem;margin-top:1rem}
.phase{padding:.7rem .8rem;border:1px dashed var(--line);border-radius:8px;font-size:.85rem;color:var(--muted)}
.phase.done{border-style:solid;border-color:var(--green);background:var(--green-bg);color:#13683a;font-weight:600}

/* login */
.login-wrap{min-height:100vh;display:grid;place-items:center;padding:1rem;background:var(--grad-sidebar);position:relative;overflow:hidden}
.login-card{background:#fff;border-radius:14px;box-shadow:0 12px 40px rgba(10,30,60,.25);padding:2rem;width:100%;max-width:380px}
.login-head{text-align:center;margin-bottom:1.2rem}
.login-head h1{font-size:1.15rem;margin-top:.6rem}
.login-lang{text-align:center;margin-top:1rem;color:var(--muted);font-size:.82rem}

/* preview / errors */
.preview-box{border-top:1px solid var(--line);margin-top:1rem;padding-top:1rem}
.scope-list{display:grid;grid-template-columns:1fr 1fr;gap:.2rem}
.errcode{font-size:3rem;color:var(--brand);margin-bottom:0}

@media(max-width:820px){
  .sidebar{position:fixed;left:-260px;transition:left .2s;z-index:30}
  .grid-4,.phase-map{grid-template-columns:1fr 1fr}
  .grid-2{grid-template-columns:1fr}
  .scope-list{grid-template-columns:1fr}
}

/* ---- Phase 2: catalog & inventory ---- */
.grid-3{grid-template-columns:1fr 1fr 1fr}
.table th.num,.table td.num{text-align:right;font-variant-numeric:tabular-nums}
td.low{color:var(--red);font-weight:600}
td.pos{color:var(--green)}
.filterbar{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1rem}
.filterbar input[type=text]{flex:1;min-width:180px}
.filterbar select{width:auto}
textarea{width:100%;padding:.55rem .7rem;border:1px solid var(--line);border-radius:8px;font:inherit;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.85rem;resize:vertical}
textarea:focus{outline:none;border-color:var(--brand-2);box-shadow:0 0 0 3px rgba(46,117,182,.15)}
.or-divider{display:flex;align-items:center;text-align:center;color:var(--muted);font-size:.8rem;margin:.6rem 0}
.or-divider::before,.or-divider::after{content:"";flex:1;border-top:1px solid var(--line)}
.or-divider span{padding:0 .8rem}
.varform{border-top:1px solid var(--line);margin-top:.6rem;padding-top:.8rem}
input[type=file]{font:inherit;font-size:.85rem}
@media(max-width:820px){.grid-3{grid-template-columns:1fr}}

/* ---- Phase 3: POS & sales ---- */
.pos-wrap{display:grid;grid-template-columns:1fr 1fr;gap:1rem;align-items:start}
.pos-search input[type=text]{width:100%}
.pos-results{margin-top:.6rem;max-height:60vh;overflow:auto;display:flex;flex-direction:column;gap:.35rem}
.pos-result{padding:.5rem .6rem;border:1px solid var(--line);border-radius:8px;cursor:pointer;background:#fff}
.pos-result:hover{border-color:var(--brand-2);background:#f7faff}
.pos-cart-table .qty{display:inline-flex;align-items:center;gap:.25rem;justify-content:flex-end}
.pos-cart-table .qty button{width:24px;height:24px;border:1px solid var(--line);background:#fff;border-radius:6px;cursor:pointer;font-weight:700;line-height:1}
.pos-cart-table .qinput{width:64px;text-align:right;padding:.2rem .3rem}
.pos-foot{border-top:1px solid var(--line);margin-top:.6rem;padding-top:.8rem;display:flex;flex-direction:column;gap:.6rem}
.pos-totals{background:#f7faff;border:1px solid var(--line);border-radius:10px;padding:.7rem .9rem;display:flex;flex-direction:column;gap:.3rem}
.pos-totals .r-row{display:flex;justify-content:space-between}
.pos-totals .total{font-size:1.15rem;font-weight:800;border-top:1px dashed #b9c6da;padding-top:.3rem;margin-top:.2rem}
.btn-block{width:100%;justify-content:center;padding:.7rem;font-size:1rem}
.btn-danger{background:var(--red,#c23b3b);color:#fff}
.r-row{display:flex;justify-content:space-between;gap:.5rem}
@media(max-width:900px){.pos-wrap{grid-template-columns:1fr}}

/* ---- Phase 4: orders / fulfilment ---- */
.order-status-row{display:flex;gap:.5rem;margin:.4rem 0 1rem}
.badge.big{font-size:.8rem;padding:.25rem .7rem}
.pipeline{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1rem}
.timeline{list-style:none;margin:0;padding:0}
.timeline li{padding:.5rem 0 .5rem 1rem;border-left:2px solid var(--line);margin-left:.4rem;position:relative}
.timeline li::before{content:"";position:absolute;left:-5px;top:.8rem;width:8px;height:8px;border-radius:50%;background:var(--brand-2,#2e75b6)}
.badge.status-pending{background:#fdf3df;color:#9a6b00}
.badge.status-confirmed{background:#e5eefb;color:#22518c}
.badge.status-packed{background:#e8e5fb;color:#4a35a5}
.badge.status-dispatched{background:#e0f0f6;color:#1d6a86}
.badge.status-delivered{background:#e4f6e7;color:#2e7d3a}
.badge.status-cancelled{background:#fbe9e9;color:#c23b3b}
.badge.status-returned{background:#f1e3e3;color:#8c4a4a}
.badge.pay-unpaid{background:#fbe9e9;color:#c23b3b}
.badge.pay-partial{background:#fdf3df;color:#9a6b00}
.badge.pay-paid{background:#e4f6e7;color:#2e7d3a}

/* ---- Phase 6: analytics & meta ---- */
.chart{width:100%;height:auto;display:block}
.chart-axis{display:flex;justify-content:space-between;color:var(--muted,#8a93a3);font-size:.75rem;margin-top:.3rem}
.hbar-row{display:flex;align-items:center;gap:.6rem;margin:.35rem 0}
.hbar-label{flex:0 0 38%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.85rem}
.hbar-track{flex:1;background:var(--track,#eef1f6);border-radius:6px;height:14px;overflow:hidden}
.hbar-fill{display:block;height:100%;background:var(--brand-2,#2e75b6);border-radius:6px}
.hbar-fill.alt{background:var(--brand,#1f4e79)}
.hbar-val{flex:0 0 auto;font-variant-numeric:tabular-nums;font-size:.82rem;color:var(--muted,#5a6473)}
.funnel{display:flex;flex-wrap:wrap;gap:.75rem}
.funnel-step{flex:1 1 90px;text-align:center;padding:.6rem .4rem;border:1px solid var(--line,#dde3ec);border-radius:8px;background:var(--surface,#fff)}
.funnel-count{font-size:1.5rem;font-weight:700;line-height:1}
.funnel-label{display:inline-block;margin-top:.4rem}

/* ---- Phase 1 completion: responsive foundation, media, RBAC, labels ---- */
.table-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.brand-logo{width:36px;height:36px;object-fit:contain;border-radius:7px;background:#fff;padding:2px;flex:0 0 auto}
.menu-toggle{display:none;border:0;background:transparent;font-size:1.35rem;cursor:pointer;color:var(--ink);padding:.2rem .45rem}
.nav-scrim{display:none}
.user-chip{color:var(--ink)}
.permission-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem}
.permission-group{border:1px solid var(--line);border-radius:9px;padding:.8rem;background:#fafbfe}
.permission-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}
.permission-group .check{align-items:flex-start}.permission-group .check span{display:flex;flex-direction:column}.permission-group small{color:var(--muted);font-size:.7rem}
.linkbtn{border:0;background:none;color:var(--brand-2);cursor:pointer;font-size:.75rem}
.thumb{width:42px;height:42px;object-fit:cover;border-radius:7px;border:1px solid var(--line);display:inline-grid;place-items:center}.thumb.placeholder{background:var(--grey-bg);color:var(--muted)}
.image-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.7rem}.image-card{border:1px solid var(--line);border-radius:9px;overflow:hidden;background:#fff}.image-card img{display:block;width:100%;height:130px;object-fit:cover}.image-actions{display:flex;gap:.35rem;align-items:center;flex-wrap:wrap;padding:.45rem}.image-actions form{display:inline}
.upload-row{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:.8rem;margin-top:.8rem}
.settings-tabs{display:grid;grid-template-columns:1fr 1fr;gap:1.2rem}.settings-tabs>section{border:1px solid var(--line);border-radius:10px;padding:1rem;background:#fafbfe}.settings-tabs .sub{margin-top:0}.settings-logo-row{display:flex;align-items:center;gap:1rem}.logo-preview{width:90px;height:70px;object-fit:contain;border:1px solid var(--line);border-radius:8px;background:#fff}.grow{flex:1}
.label-sheet{display:flex;justify-content:center;padding:8mm}.product-label{width:58mm;min-height:36mm;border:1px dashed #777;padding:3mm;text-align:center;font-family:Arial,sans-serif}.label-business{font-size:9pt;font-weight:700}.label-name{font-size:10pt;margin:1mm 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.barcode-svg{width:100%;height:16mm;fill:#000}.label-code{font-family:monospace;font-size:8pt;letter-spacing:.8px}.label-price{font-size:15pt;font-weight:800;margin-top:1mm}
@media print{.label-sheet{padding:0}.product-label{border:0}.appfoot,.topbar,.sidebar{display:none!important}}
@media(max-width:1100px){.permission-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-tabs{grid-template-columns:1fr}.image-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:820px){
 .menu-toggle{display:inline-block}.topbar{padding:.7rem .8rem;gap:.4rem}.topbar-title{flex:1}.topbar-right{gap:.35rem}.user-chip small{display:none}.content{padding:.8rem}.card{padding:.85rem}.card-head{align-items:flex-start;gap:.5rem;flex-wrap:wrap}.row-actions{flex-wrap:wrap}
 .sidebar{left:-260px;position:fixed}.nav-open .sidebar{left:0}.nav-open .nav-scrim{display:block;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:20}.sidebar{z-index:30}
 .permission-grid{grid-template-columns:1fr}.image-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-4{grid-template-columns:1fr 1fr}
 .table th,.table td{white-space:nowrap}.table td .muted{white-space:normal}.topbar-right form{display:none}
}
@media(max-width:480px){.image-grid,.grid-4{grid-template-columns:1fr}.lang-toggle{display:none}.user-chip{max-width:120px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}

/* ---- Phase 2 completion: selling core, expenses, returns and live dashboard ---- */
.pos-toolbar{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap;margin-bottom:.8rem}
.pos-toolbar .field{margin:0;min-width:170px}.pos-toolbar .grow{flex:1;min-width:240px}
.pos-v2{align-items:start}.compact-grid{gap:.65rem}.compact-grid .field{margin-bottom:0}
.product-grid-results{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.65rem;margin-top:.75rem;max-height:520px;overflow:auto;padding-right:.2rem}
.product-tile{border:1px solid var(--line);border-radius:10px;background:#fff;overflow:hidden;text-align:left;cursor:pointer;padding:0;transition:.15s ease;display:flex;flex-direction:column;min-height:160px}
.product-tile:hover{border-color:var(--brand-2);transform:translateY(-1px);box-shadow:0 4px 14px rgba(31,78,121,.1)}
.product-tile img,.tile-placeholder{width:100%;height:94px;object-fit:cover;background:var(--grey-bg);display:grid;place-items:center;color:var(--muted);font-size:1.4rem}
.tile-copy{display:flex;flex-direction:column;gap:.15rem;padding:.55rem}.tile-copy strong{font-size:.84rem;line-height:1.25}.tile-copy small{color:var(--muted)}
.customer-picker{border:1px solid var(--line);border-radius:9px;padding:.7rem;background:#fafbfe;margin-bottom:.7rem}
.quick-customer-box{border-top:1px dashed var(--line);margin-top:.65rem;padding-top:.65rem}
.payment-panel{border:1px solid var(--line);border-radius:9px;padding:.7rem;background:#fafbfe}.card-head.compact{margin-bottom:.4rem}.card-head.compact h3{font-size:.92rem}
.payment-row{display:grid;grid-template-columns:minmax(105px,.8fr) minmax(90px,1fr) minmax(110px,1.2fr) auto;gap:.45rem;align-items:center;margin:.4rem 0}
.price-input{width:88px;text-align:right}.pos-actions{display:grid;grid-template-columns:1fr 1fr;gap:.5rem}.tiny{font-size:.7rem}
.order-builder-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(300px,.75fr);gap:1rem;align-items:start}
.customer-trust{margin-top:.55rem;border-radius:8px;padding:.55rem .65rem;background:#eef5ff;color:#244c73;font-size:.82rem}
.cost-box{border:1px dashed #d5a32c;border-radius:9px;background:#fffaf0;padding:.75rem}.cost-box .sub{margin-top:0}
.dashboard-filter{display:flex;align-items:end;gap:.6rem;flex-wrap:wrap;margin-bottom:1rem}.dashboard-filter .field{margin:0;min-width:140px}.custom-range{display:flex;gap:.55rem;align-items:end;flex-wrap:wrap}
.dashboard-stats{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:1rem}.stat-danger .stat-value{color:var(--red)}.stat-success .stat-value{color:var(--green)}.small-value{font-size:1.2rem!important}
.return-record{border:1px solid var(--line);border-radius:8px;padding:.65rem;margin:.55rem 0;background:#fafbfe}
.invoice-brand{display:flex;align-items:flex-start;gap:.75rem}.invoice-logo{width:68px;height:58px;object-fit:contain}.invoice-meta{display:flex;justify-content:space-between;gap:1rem;margin:.8rem 0}.invoice-meta-right{text-align:right}
.invoice-bottom{display:flex;justify-content:space-between;align-items:flex-end;gap:1rem;margin-top:.8rem}.invoice-qr{min-width:115px;text-align:center}.invoice-qr img{display:block;width:90px;height:90px;object-fit:contain;margin:auto}.invoice-qr small{display:block;font-size:.7rem;color:var(--muted)}
.invoice-terms,.invoice-note{margin-top:1rem;padding:.65rem;border:1px solid var(--line);border-radius:7px;background:#fafbfe;font-size:.8rem}
@media(max-width:1100px){.dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.order-builder-layout{grid-template-columns:1fr}.product-grid-results{grid-template-columns:repeat(auto-fill,minmax(135px,1fr))}}
@media(max-width:720px){.payment-row{grid-template-columns:1fr 1fr}.payment-row .payment-reference{grid-column:1/-1}.pos-actions{grid-template-columns:1fr}.invoice-meta,.invoice-bottom{flex-direction:column;align-items:stretch}.invoice-meta-right{text-align:left}.invoice-qr{align-self:center}.dashboard-stats{grid-template-columns:1fr 1fr}.product-grid-results{max-height:none}}
@media(max-width:480px){.dashboard-stats{grid-template-columns:1fr}.payment-row{grid-template-columns:1fr}.payment-row .payment-reference{grid-column:auto}.pos-toolbar .grow{min-width:100%}}

/* ---- Phase 3: courier, messaging, bookings and follow-up automation ---- */
.notification-chip{position:relative;text-decoration:none;font-size:1.05rem;padding:.35rem .45rem;border-radius:8px}.notification-chip:hover{background:var(--grey-bg)}.notification-chip span{position:absolute;top:-4px;right:-5px;background:#c23b3b;color:#fff;border-radius:999px;font-size:.62rem;min-width:17px;height:17px;display:grid;place-items:center;padding:0 3px}
.integration-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem}.integration-card{border:1px solid var(--line);border-radius:10px;padding:.8rem;background:#fff}.integration-card h4{margin:.1rem 0 .45rem}.integration-card .meta{font-size:.78rem;color:var(--muted);line-height:1.45}.integration-card .actions{display:flex;gap:.4rem;flex-wrap:wrap;margin-top:.65rem}
.status-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:.35rem;background:#999}.status-dot.ok{background:#2a9d63}.status-dot.error{background:#c23b3b}.status-dot.untested{background:#d4a72c}
.kpi-row{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.65rem;margin:.8rem 0}.kpi-mini{border:1px solid var(--line);border-radius:9px;padding:.7rem;background:#fafbfe}.kpi-mini strong{display:block;font-size:1.25rem}.kpi-mini small{color:var(--muted)}
.timeline{border-left:2px solid var(--line);padding-left:1rem;margin-left:.4rem}.timeline-item{position:relative;margin:0 0 .8rem}.timeline-item:before{content:"";position:absolute;left:-1.36rem;top:.28rem;width:9px;height:9px;border-radius:50%;background:var(--brand-2)}.timeline-item small{color:var(--muted)}
.message-body{max-width:420px;white-space:normal;line-height:1.35}.json-help{font-family:monospace;font-size:.72rem;background:#f4f6fb;border:1px solid var(--line);border-radius:8px;padding:.65rem;white-space:pre-wrap}.due-overdue{color:#c23b3b;font-weight:700}.due-today{color:#b47a00;font-weight:700}.booking-actions,.followup-actions{display:flex;gap:.35rem;flex-wrap:wrap}.provider-badge{font-family:monospace;font-size:.72rem;background:#eef5ff;color:#244c73;padding:.18rem .4rem;border-radius:6px}
.order-automation-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.order-automation-grid .card{margin:0}.return-qty{width:100px}.template-vars{font-size:.76rem;color:var(--muted);line-height:1.5}
@media(max-width:1100px){.integration-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.kpi-row{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.integration-grid,.order-automation-grid{grid-template-columns:1fr}.kpi-row{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.kpi-row{grid-template-columns:1fr}}

/* ---- Phase 4: purchases, accounts, quotations, reporting and marketing ---- */
.account-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.7rem;margin-bottom:1rem}
.account-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.55rem;align-items:center;margin:0}.account-card small{display:block;color:var(--muted);margin-top:.15rem}.account-card .btn{grid-column:1/-1;justify-self:start}.account-balance{font-size:1.3rem;font-weight:800;font-variant-numeric:tabular-nums}
.report-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.7rem;margin:.8rem 0 1rem}.report-summary .card{margin:0}
.report-summary .stat-value{font-size:1.15rem}.num{font-variant-numeric:tabular-nums;text-align:right}.mt{margin-top:.75rem}
@media(max-width:680px){.account-cards,.report-summary{grid-template-columns:1fr}.account-card{grid-template-columns:1fr}.account-balance{font-size:1.15rem}}

/* =====================================================================
   VISUAL ENHANCEMENT LAYER — v5.1 "Sylhet Tea" theme
   Adds depth, gradients, colour and micro-interactions. All existing
   class names are preserved; this layer only enriches their appearance.
   ===================================================================== */

/* ambient page tint */
body{background:
  radial-gradient(1100px 480px at 100% -10%,rgba(22,160,111,.07),transparent 60%),
  radial-gradient(900px 420px at -10% 110%,rgba(99,102,241,.06),transparent 55%),
  var(--bg);background-attachment:fixed}

/* ---- sidebar ---- */
.sidebar{background:var(--grad-sidebar);box-shadow:2px 0 18px rgba(8,40,30,.18)}
.brand{border-bottom:1px solid rgba(255,255,255,.10)}
.brand-mark{background:linear-gradient(135deg,var(--gold),#f0c66b);color:#3a2a05;
  box-shadow:0 4px 14px rgba(217,164,65,.4)}
.navlink{transition:background .16s ease,color .16s ease,transform .16s ease}
.navlink:hover{transform:translateX(2px)}
.navlink.active{background:linear-gradient(135deg,rgba(22,160,111,.95),rgba(14,107,78,.95));
  box-shadow:0 6px 16px rgba(0,0,0,.22);position:relative}
.navlink.active::before{content:"";position:absolute;left:-.5rem;top:50%;transform:translateY(-50%);
  width:3px;height:60%;background:var(--gold);border-radius:0 3px 3px 0}
.nav-section{color:#8fc7b0}

/* ---- topbar ---- */
.topbar{backdrop-filter:saturate(1.2) blur(6px);background:rgba(255,255,255,.88);
  box-shadow:0 1px 0 var(--line),0 6px 18px rgba(14,60,46,.04)}
.topbar-title{background:var(--grad-brand);-webkit-background-clip:text;background-clip:text;
  -webkit-text-fill-color:transparent}
.user-chip{display:inline-flex;flex-direction:column;line-height:1.15;padding:.3rem .6rem;
  border-radius:10px;background:var(--grey-bg)}
.lang-toggle{transition:.15s}.lang-toggle:hover{border-color:var(--brand-2);color:var(--brand)}

/* ---- cards ---- */
.card{transition:box-shadow .2s ease,transform .2s ease;position:relative}
.card:hover{box-shadow:var(--shadow-lg)}
.card-head h2{background:var(--grad-brand);-webkit-background-clip:text;background-clip:text;
  -webkit-text-fill-color:transparent;font-weight:700}

/* ---- generic stat cards (used outside the dashboard too) ---- */
.stat{display:flex;flex-direction:column;justify-content:center;overflow:hidden}
.stat::after{content:"";position:absolute;inset:0 auto 0 0;width:4px;background:var(--grad-brand);
  border-radius:var(--radius) 0 0 var(--radius)}
.stat-value{background:var(--grad-brand);-webkit-background-clip:text;background-clip:text;
  -webkit-text-fill-color:transparent;letter-spacing:-.5px}

/* ---- dashboard hero ---- */
.dash-hero{background:var(--grad-sidebar);color:#eafaf3;border-radius:18px;padding:1.3rem 1.5rem;
  margin-bottom:1.2rem;display:flex;align-items:center;justify-content:space-between;gap:1rem;
  box-shadow:var(--shadow-lg);position:relative;overflow:hidden}
.dash-hero::after{content:"";position:absolute;right:-40px;top:-40px;width:220px;height:220px;
  background:radial-gradient(circle,rgba(217,164,65,.35),transparent 65%)}
.dash-hero h1{font-size:1.4rem;margin:0;color:#fff}
.dash-hero p{margin:.25rem 0 0;color:#bfe6d6;font-size:.9rem}
.dash-hero .hero-badge{background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.22);
  padding:.45rem .8rem;border-radius:12px;font-weight:600;font-size:.85rem;backdrop-filter:blur(4px);z-index:1}

/* ---- colourful KPI cards ---- */
.dashboard-stats .stat{padding:1.05rem 1.15rem;flex-direction:row;align-items:center;gap:.9rem}
.dashboard-stats .stat::after{display:none}
.dashboard-stats .stat .stat-body{min-width:0}
.stat-ic{flex:0 0 auto;width:46px;height:46px;border-radius:13px;display:grid;place-items:center;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.03)}
.stat-ic svg{width:23px;height:23px;stroke-width:2}
.dashboard-stats .stat .stat-value{font-size:1.55rem}
.dashboard-stats .stat:nth-child(1){border-top:3px solid var(--k1)}
.dashboard-stats .stat:nth-child(1) .stat-ic{background:var(--k1b);color:var(--k1)}
.dashboard-stats .stat:nth-child(1) .stat-value{background:none;-webkit-text-fill-color:initial;color:var(--k1)}
.dashboard-stats .stat:nth-child(2){border-top:3px solid var(--k2)}
.dashboard-stats .stat:nth-child(2) .stat-ic{background:var(--k2b);color:var(--k2)}
.dashboard-stats .stat:nth-child(2) .stat-value{background:none;-webkit-text-fill-color:initial;color:var(--k2)}
.dashboard-stats .stat:nth-child(3){border-top:3px solid var(--k3)}
.dashboard-stats .stat:nth-child(3) .stat-ic{background:var(--k3b);color:var(--k3)}
.dashboard-stats .stat:nth-child(3) .stat-value{background:none;-webkit-text-fill-color:initial;color:var(--k3)}
.dashboard-stats .stat:nth-child(4){border-top:3px solid var(--k4)}
.dashboard-stats .stat:nth-child(4) .stat-ic{background:var(--k4b);color:var(--k4)}
.dashboard-stats .stat:nth-child(4) .stat-value{background:none;-webkit-text-fill-color:initial;color:var(--k4)}
.dashboard-stats .stat:nth-child(5){border-top:3px solid var(--k5)}
.dashboard-stats .stat:nth-child(5) .stat-ic{background:var(--k5b);color:var(--k5)}
.dashboard-stats .stat:nth-child(5) .stat-value{background:none;-webkit-text-fill-color:initial;color:var(--k5)}
.dashboard-stats .stat:nth-child(6){border-top:3px solid var(--k6)}
.dashboard-stats .stat:nth-child(6) .stat-ic{background:var(--k6b);color:var(--k6)}
.dashboard-stats .stat:nth-child(6) .stat-value{background:none;-webkit-text-fill-color:initial;color:var(--k6)}
.dashboard-stats .stat:nth-child(7){border-top:3px solid var(--k7)}
.dashboard-stats .stat:nth-child(7) .stat-ic{background:var(--k7b);color:var(--k7)}
.dashboard-stats .stat:nth-child(7) .stat-value{background:none;-webkit-text-fill-color:initial;color:var(--k7)}
.dashboard-stats .stat:nth-child(8){border-top:3px solid var(--k8)}
.dashboard-stats .stat:nth-child(8) .stat-ic{background:var(--k8b);color:var(--k8)}
.dashboard-stats .stat:nth-child(8) .stat-value{background:none;-webkit-text-fill-color:initial;color:var(--k8)}
.stat-danger .stat-value,.dashboard-stats .stat.stat-danger .stat-value{color:var(--red)!important}

/* ---- buttons ---- */
.btn{transition:transform .12s ease,box-shadow .15s ease,background .15s ease}
.btn:active{transform:translateY(1px)}
.btn-primary{background:var(--grad-brand);box-shadow:0 4px 14px rgba(14,107,78,.28)}
.btn-primary:hover{background:linear-gradient(135deg,#0c5d44,#13905f);box-shadow:0 6px 18px rgba(14,107,78,.36)}
.btn-ghost:hover{border-color:var(--brand-2);color:var(--brand)}
.btn-danger{background:linear-gradient(135deg,#c5332d,#e0554e)}

/* ---- badges ---- */
.badge{box-shadow:inset 0 0 0 1px rgba(0,0,0,.03)}

/* ---- tables ---- */
.table thead th{background:#f3f8f6;position:sticky;top:0}
.table tbody tr{transition:background .12s}
.table tbody tr:nth-child(even){background:#fafcfb}
.table tbody tr:hover{background:#eef7f3}
.card>.table-wrap{border:1px solid var(--line);border-radius:12px;overflow:auto}
.card>.table-wrap .table thead th{border-bottom:1px solid var(--line)}

/* ---- horizontal bars / charts get the brand gradient ---- */
.hbar-fill{background:var(--grad-brand);transition:width .6s cubic-bezier(.22,1,.36,1)}
.hbar-fill.alt{background:linear-gradient(135deg,var(--k3),#8b8ef6)}
.funnel-count{background:var(--grad-brand);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}

/* ---- login polish ---- */
.login-wrap::before{content:"";position:absolute;width:520px;height:520px;border-radius:50%;
  background:radial-gradient(circle,rgba(217,164,65,.22),transparent 60%);top:-160px;right:-120px}
.login-card{box-shadow:0 24px 60px rgba(5,30,20,.4);border-radius:18px}
.brand-mark.lg{background:linear-gradient(135deg,var(--gold),#f0c66b);color:#3a2a05}

/* ---- phase map (kept, themed) ---- */
.phase.done{border-color:var(--brand-2);background:var(--green-bg);color:#0e5a40}

/* ---- accessibility ---- */
@media (prefers-reduced-motion: reduce){
  *{animation:none!important;transition:none!important}
  .card:hover,.navlink:hover,.btn:active{transform:none}
}

/* ---- SRS final: Customer Follow Up dashboard ---- */
.followup-page{display:flex;flex-direction:column;gap:1rem}.followup-stats{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:.8rem}.fu-stat{display:flex;align-items:center;gap:.8rem;background:#fff;border:1px solid var(--line);border-radius:14px;padding:.9rem 1rem;box-shadow:var(--shadow)}.fu-stat-icon{width:40px;height:40px;display:grid;place-items:center;border-radius:50%;font-size:1.15rem}.fu-stat strong{display:block;font-size:1.3rem;line-height:1.1}.fu-stat small{display:block;color:var(--muted);margin-top:.2rem}.fu-blue .fu-stat-icon{background:#e9f3ff;color:#2674d9}.fu-green .fu-stat-icon{background:#e8f8ee;color:#159957}.fu-orange .fu-stat-icon{background:#fff3d9;color:#d58a00}.fu-purple .fu-stat-icon{background:#f0eaff;color:#7d52d8}.fu-red .fu-stat-icon{background:#ffe9ec;color:#dc3c51}.followup-toolbar{margin:0;display:flex;justify-content:space-between;align-items:center;gap:.8rem;padding:.7rem .9rem}.fu-search-form{display:flex;gap:.55rem;align-items:center;flex:1}.fu-search{display:flex;align-items:center;gap:.45rem;flex:1;max-width:560px;border:1px solid var(--line);border-radius:9px;background:#fff;padding:0 .65rem}.fu-search input{border:0;box-shadow:none;width:100%;padding:.65rem 0}.fu-search input:focus{outline:0}.fu-new-panel{margin:0}.fu-workspace{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:1rem;align-items:start}.fu-list-card,.fu-profile{margin:0}.fu-tabs{display:flex;gap:.35rem;padding:.55rem .6rem;border-bottom:1px solid var(--line);overflow:auto}.fu-tabs a{white-space:nowrap;padding:.45rem .7rem;border-radius:8px;color:var(--muted);font-size:.83rem;font-weight:700}.fu-tabs a.active{background:#eaf8f1;color:var(--brand);box-shadow:inset 0 0 0 1px #bfe8d3}.fu-table td{vertical-align:middle}.fu-table td small{display:block;color:var(--muted);margin-top:.2rem}.fu-customer{display:flex;align-items:center;gap:.55rem;min-width:170px}.fu-avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#d7f3e7,#cfe1ff);color:#154f3b;font-weight:800;flex:0 0 auto}.fu-avatar.large{width:54px;height:54px;font-size:1.05rem}.fu-customer strong{display:block}.fu-status{display:inline-block;padding:.28rem .55rem;border-radius:7px;font-size:.72rem;font-weight:800;white-space:nowrap}.fu-status-overdue{background:#ffe8eb;color:#c92f44}.fu-status-today{background:#fff2d5;color:#a96d00}.fu-status-upcoming{background:#e7f7ed;color:#178a4e}.fu-status-completed{background:#e7f6ee;color:#178a4e}.fu-status-none{background:#eef1f5;color:#6b7280}.fu-actions{display:flex;gap:.25rem}.fu-actions a{width:27px;height:27px;border:1px solid var(--line);border-radius:6px;display:grid;place-items:center;background:#fff;font-size:.76rem}.selected-row{background:#edf9f3!important;box-shadow:inset 3px 0 var(--brand-2)}.fu-profile{position:sticky;top:78px;padding:0;overflow:hidden}.fu-profile-head{background:linear-gradient(135deg,#087d4d,#0aa866);color:#fff;padding:1rem;display:flex;align-items:center;gap:.7rem}.fu-profile-head h3{margin:0;color:#fff}.fu-profile-head a{display:block;color:#fff;font-size:.83rem;margin-top:.15rem}.fu-profile-head small{display:block;color:#d8f7e8;margin-top:.15rem}.fu-mini-stats{display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid var(--line)}.fu-mini-stats div{padding:.75rem .35rem;text-align:center;border-right:1px solid var(--line)}.fu-mini-stats div:last-child{border-right:0}.fu-mini-stats strong{display:block;font-size:.95rem}.fu-mini-stats span{display:block;color:var(--muted);font-size:.65rem;margin-top:.2rem}.fu-profile-info{padding:.75rem 1rem;margin:0;border-bottom:1px solid var(--line)}.fu-profile-info>div{display:flex;justify-content:space-between;gap:.6rem;padding:.35rem 0}.fu-profile-info dt{color:var(--muted);font-size:.75rem}.fu-profile-info dd{margin:0;text-align:right;font-size:.75rem;font-weight:700}.fu-note{margin:.75rem 1rem;padding:.65rem;border:1px solid var(--line);border-radius:8px;background:#fafcfb}.fu-note p{margin:.3rem 0 0;font-size:.78rem}.fu-courier-history,.fu-history{padding:.2rem 1rem .8rem}.fu-courier-history h4,.fu-history h4{margin:.6rem 0;font-size:.85rem}.fu-courier-history>div{display:flex;justify-content:space-between;padding:.3rem 0;border-bottom:1px dashed var(--line);font-size:.75rem}.fu-history{max-height:340px;overflow:auto}.fu-history-item{display:grid;grid-template-columns:10px 1fr;gap:.55rem;position:relative;padding:.45rem 0}.fu-history-item:before{content:"";position:absolute;left:4px;top:18px;bottom:-8px;width:1px;background:var(--line)}.fu-history-item:last-child:before{display:none}.fu-dot{width:9px;height:9px;border-radius:50%;margin-top:.25rem;z-index:1;background:#9ca3af}.fu-dot-completed{background:#19a65f}.fu-dot-pending{background:#e3a10d}.fu-dot-cancelled{background:#dc4052}.fu-history-item strong{font-size:.75rem}.fu-history-item p{font-size:.72rem;color:var(--muted);margin:.18rem 0}.fu-history-actions{display:flex;gap:.25rem}.fu-history-actions form{display:flex;gap:.25rem}.fu-history-actions input{width:110px;padding:.35rem;font-size:.7rem}.fu-profile-actions{display:grid;grid-template-columns:1.2fr 1fr .65fr;gap:.35rem;padding:.75rem 1rem;border-top:1px solid var(--line)}.fu-profile-actions .btn{justify-content:center;font-size:.72rem}.fu-wa{background:#17a45b;color:#fff}.fu-sms{background:#4776e6;color:#fff}.empty-state{padding:3rem 1rem;text-align:center;color:var(--muted)}
@media(max-width:1250px){.followup-stats{grid-template-columns:repeat(3,1fr)}.fu-workspace{grid-template-columns:1fr}.fu-profile{position:static}}
@media(max-width:760px){.followup-stats{grid-template-columns:1fr 1fr}.followup-toolbar,.fu-search-form{align-items:stretch;flex-direction:column}.fu-search{max-width:none}.fu-profile-actions{grid-template-columns:1fr}.fu-mini-stats{grid-template-columns:1fr 1fr 1fr}}
@media(max-width:460px){.followup-stats{grid-template-columns:1fr}}

/* SRS final completion: dashboard marketing and return analytics */
.marketing-kpis,.return-summary-box{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.8rem;margin:.7rem 0 1rem}.marketing-kpis>div,.return-summary-box>div{padding:.9rem;border:1px solid var(--line);border-radius:12px;background:var(--surface-2,#f8fafc)}.marketing-kpis span,.return-summary-box span{display:block;color:var(--muted);font-size:.78rem}.marketing-kpis strong,.return-summary-box strong{display:block;margin-top:.25rem;font-size:1.25rem}.return-summary-box{grid-template-columns:repeat(2,minmax(0,1fr))}.marketing-bars>div{display:grid;grid-template-columns:130px 1fr;gap:.7rem;align-items:center;margin:.7rem 0}.marketing-bars label{font-size:.82rem;color:var(--muted)}.marketing-bars span{display:block;height:12px;border-radius:99px;background:#e8edf4;overflow:hidden}.marketing-bars i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#166534,#22c55e)}.marketing-bars>div:first-child i{background:linear-gradient(90deg,#b45309,#f59e0b)}
@media(max-width:850px){.marketing-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.marketing-bars>div{grid-template-columns:1fr}.return-summary-box{grid-template-columns:1fr 1fr}}

/* Print-ready bilingual reports */
.report-print{font-family:inherit;color:#111}.report-print-head{display:flex;justify-content:space-between;gap:2rem;border-bottom:2px solid #0f5132;padding-bottom:1rem;margin-bottom:1rem}.report-print-head h1,.report-print-head h2{margin:0}.report-print-head p{margin:.15rem 0}.report-print-title{text-align:right}.report-print-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.5rem;margin:1rem 0}.report-print-summary>div{border:1px solid #ccc;padding:.7rem}.report-print-summary span{display:block;font-size:.75rem;color:#555}.report-print-summary strong{font-size:1rem}.report-print-table{width:100%;border-collapse:collapse;font-size:.78rem}.report-print-table th,.report-print-table td{border:1px solid #bbb;padding:.4rem;vertical-align:top}.report-print-table th{background:#0f5132;color:white}.report-print-foot{text-align:right;margin-top:1rem;font-size:.75rem;color:#555}@media print{.report-print-table{font-size:9pt}.report-print-table thead{display:table-header-group}.report-print-table tr{break-inside:avoid}.report-print-summary{grid-template-columns:repeat(4,1fr)}}
.return-items-cell{min-width:190px;white-space:normal;line-height:1.45}
.table-pager{display:flex;justify-content:flex-end;align-items:center;gap:.8rem;padding:.8rem 0}
.pos-customer-history{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.5rem;padding:.7rem;margin:.4rem 0;border:1px solid #dbe5dd;border-radius:10px;background:#f6fbf7}.pos-customer-history>div{padding:.35rem}.pos-customer-history span{display:block;color:var(--muted);font-size:.72rem}.pos-customer-history strong{font-size:1rem}.pos-customer-history .wide{grid-column:1/-1}@media(max-width:700px){.pos-customer-history{grid-template-columns:repeat(2,1fr)}}

/* Final SRS completion: bulk order tools, shipping labels and safe action links */
.bulk-toolbar{display:flex;gap:.55rem;align-items:center;flex-wrap:wrap;padding:.75rem;border:1px solid var(--line);border-radius:12px;background:#f8fafc;margin:.75rem 0}
.bulk-toolbar select{min-width:170px}
.shipping-label-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12mm}
.shipping-label{border:2px solid #172033;border-radius:10px;min-height:115mm;display:flex;flex-direction:column;break-inside:avoid;background:#fff}
.shipping-label header,.shipping-label footer{display:flex;justify-content:space-between;gap:1rem;padding:10px 14px;background:#f3f6fa}
.shipping-label header{font-size:18px;border-bottom:1px solid #ccd5e1}.shipping-label footer{font-size:12px;border-top:1px solid #ccd5e1;margin-top:auto}
.ship-label-body{padding:16px}.ship-label-body h2{font-size:24px;margin:0 0 8px}.ship-phone{font-size:18px;font-weight:700}.ship-label-body p{font-size:16px;line-height:1.55}
.bulk-invoice-page{break-after:page}.bulk-invoice-page:last-child{break-after:auto}
.link-button{appearance:none;border:0;background:none;padding:0;color:var(--primary);cursor:pointer;font:inherit;text-align:left}.notification-open-form{display:inline}
.exchange-banner{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap}
.export-print .card-head{margin-bottom:1rem}.export-table{font-size:12px}
@media(max-width:760px){.shipping-label-grid{grid-template-columns:1fr}.bulk-toolbar>*{width:100%}.bulk-toolbar .btn{width:auto}}
@media print{
  .shipping-label-grid{grid-template-columns:repeat(2,1fr);gap:8mm}.shipping-label{min-height:120mm}
  .bulk-invoice-page{padding:0}.export-table{font-size:9px}
}

/* ================================================================
   Phase 1 — workflow navigation, purchase receiving and stock buckets
   ================================================================ */
.sidebar{background:var(--grad-sidebar);transition:width .2s ease,left .2s ease;overflow-y:auto;overflow-x:hidden;z-index:30}
.brand{position:sticky;top:0;z-index:3;background:rgba(7,48,34,.96);backdrop-filter:blur(8px)}
.nav{overflow:visible;padding-bottom:2rem}.nav-dashboard{margin-bottom:.5rem}.nav-label{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav-group{margin:3px 0;border-radius:10px}.nav-group-toggle{width:100%;display:flex;align-items:center;gap:.65rem;padding:.62rem .7rem;border:0;border-radius:9px;background:transparent;color:#d7e9e1;font:inherit;cursor:pointer;text-align:left}.nav-group-toggle:hover,.nav-group.active>.nav-group-toggle{background:rgba(255,255,255,.09);color:#fff}.nav-group-toggle .i,.navlink .i{width:20px;min-width:20px;text-align:center}.nav-caret{margin-left:auto;transition:transform .18s ease}.nav-group.open .nav-caret{transform:rotate(180deg)}.nav-submenu{display:none;padding:.15rem 0 .35rem .75rem}.nav-group.open .nav-submenu{display:block}.nav-submenu .navlink{font-size:.88rem;padding:.48rem .62rem}.nav-submenu .navlink.active{background:linear-gradient(135deg,#16a06f,#12835c);box-shadow:0 5px 14px rgba(0,0,0,.14)}
.sidebar-compact .sidebar{width:76px}.sidebar-compact .brand{justify-content:center;padding:1rem .5rem}.sidebar-compact .brand-name,.sidebar-compact .nav-label,.sidebar-compact .nav-caret{display:none}.sidebar-compact .nav-group-toggle,.sidebar-compact .navlink{justify-content:center;padding:.62rem .45rem}.sidebar-compact .nav-submenu{padding-left:0}.sidebar-compact .nav-group-toggle .i,.sidebar-compact .navlink .i{font-size:1.05rem}.sidebar-compact .main{min-width:0}

.topbar{gap:1rem;min-height:64px}.topbar-left,.topbar-right{display:flex;align-items:center;gap:.65rem}.topbar-left{min-width:220px}.topbar-center{flex:1;display:flex;justify-content:center}.desktop-sidebar-toggle{display:inline-flex}.mobile-menu-toggle{display:none}.topbar-search{width:min(520px,100%);display:flex;align-items:center;gap:.5rem;border:1px solid var(--line);background:#f7faf9;border-radius:10px;padding:.05rem .65rem}.topbar-search input{border:0;background:transparent;box-shadow:none;padding:.55rem 0}.topbar-search input:focus{box-shadow:none}.topbar-search kbd{font-size:.7rem;border:1px solid var(--line);background:#fff;border-radius:4px;padding:.05rem .3rem;color:var(--muted)}
.quick-create-wrap{position:relative}.quick-create-menu{display:none;position:absolute;right:0;top:calc(100% + 8px);width:220px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-lg);padding:.45rem;z-index:25}.quick-create-wrap.open .quick-create-menu{display:block}.quick-create-menu a{display:block;padding:.55rem .7rem;border-radius:8px;color:var(--ink)}.quick-create-menu a:hover{background:#edf7f2;color:var(--brand)}.notification-chip{position:relative;display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--line);border-radius:10px;background:#fff}.notification-chip span{position:absolute;right:-5px;top:-6px;min-width:18px;height:18px;padding:0 4px;border-radius:99px;background:var(--red);color:#fff;font-size:.65rem;display:grid;place-items:center}.user-chip{display:flex;flex-direction:column;line-height:1.1}.user-chip small{margin:.2rem 0 0}

.workflow-strip{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin:.75rem 0 1rem;padding:.65rem .8rem;border:1px dashed #b9d8ca;border-radius:10px;background:#f4fbf7}.workflow-strip span{padding:.28rem .55rem;border-radius:7px;background:#fff;border:1px solid var(--line);font-size:.8rem;font-weight:700}.workflow-strip span.current{background:var(--brand);border-color:var(--brand);color:#fff}.workflow-strip span.done{background:var(--green-bg);border-color:#a8dec3;color:var(--green)}.workflow-strip b{color:var(--muted)}
.purchase-subtitle{margin:.15rem 0 0}.purchase-entry-table select,.purchase-entry-table input{min-width:110px}.purchase-entry-table td:first-child select{min-width:240px}.purchase-entry-table tfoot th{background:#f3f8f6}.stock-target{display:inline-flex;align-items:center;padding:.24rem .5rem;border-radius:7px;background:#e8f4ff;color:#185b91;font-size:.76rem;font-weight:700;white-space:nowrap}.form-output{display:flex;align-items:center;min-height:40px;padding:.55rem .7rem;border:1px solid var(--line);border-radius:8px;background:#f8faf9;font-weight:700}.field small{display:block;color:var(--muted);font-size:.72rem;margin-top:.25rem}.split-actions{justify-content:space-between;align-items:center}.narrow-wide{max-width:820px}.alert-soft{background:#f7faf9;border:1px solid var(--line);color:var(--muted)}
.progress-mini{width:150px;max-width:100%;height:7px;border-radius:99px;background:#e3ece8;overflow:hidden;margin-bottom:.25rem}.progress-mini span{display:block;height:100%;background:var(--grad-brand);border-radius:inherit}.receipt-panel{border:1px solid var(--line);border-radius:12px;margin:.75rem 0;overflow:hidden}.receipt-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.7rem .85rem;background:#f4f9f6;border-bottom:1px solid var(--line)}.receipt-panel .table-wrap{border:0}.table-compact th,.table-compact td{padding:.42rem .6rem}.activity-timeline{position:relative}.activity-timeline article{display:grid;grid-template-columns:18px 1fr;gap:.65rem;padding:.45rem 0}.timeline-dot{width:10px;height:10px;border-radius:50%;background:var(--brand-2);margin-top:.35rem;box-shadow:0 0 0 4px #e4f4ed}.activity-timeline article:not(:last-child) .timeline-dot:after{content:"";display:block;width:1px;height:46px;background:var(--line);margin:10px auto 0}.activity-timeline p{margin:.15rem 0;color:var(--muted)}
.inventory-tabs{display:flex;gap:.45rem;overflow:auto;margin-bottom:1rem}.inventory-tab{padding:.55rem .85rem;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--muted);font-weight:700;white-space:nowrap}.inventory-tab.active{background:var(--grad-brand);border-color:transparent;color:#fff;box-shadow:0 5px 14px rgba(14,107,78,.22)}
.repeat-row{display:grid;grid-template-columns:130px 1fr auto auto;gap:.55rem;align-items:end;margin-bottom:.55rem}.repeat-address-row{grid-template-columns:130px 1fr auto auto}.repeat-row .field{margin:0}.contact-block{padding:.85rem;border:1px solid var(--line);border-radius:12px;margin-bottom:1rem;background:#fbfdfc}.contact-block-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:.65rem}.product-type-badge{display:inline-flex;padding:.25rem .5rem;border-radius:7px;background:#eef1f0;color:#3d5048;font-size:.75rem;font-weight:700}
.global-search-page{display:flex;gap:.6rem}.global-search-page input{flex:1}.search-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.search-group{margin:0}.search-result{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.65rem .55rem;border-top:1px solid var(--line);color:var(--ink)}.search-result:hover{background:#f2f9f5}.search-result strong,.search-result small{display:block}.search-result small{color:var(--muted);margin-top:.15rem}

@media(max-width:1180px){.topbar-center{max-width:360px}.topbar-title{display:none}.topbar-left{min-width:auto}.search-groups{grid-template-columns:1fr}}
@media(max-width:980px){.desktop-sidebar-toggle{display:none}.mobile-menu-toggle{display:inline-flex}.sidebar-compact .sidebar{width:248px}.sidebar-compact .brand-name,.sidebar-compact .nav-label,.sidebar-compact .nav-caret{display:initial}.sidebar-compact .nav-group-toggle,.sidebar-compact .navlink{justify-content:flex-start;padding:.55rem .7rem}.sidebar{position:fixed;left:-270px;top:0;width:248px}.nav-open .sidebar{left:0}.nav-open .nav-scrim{display:block;position:fixed;inset:0;background:rgba(0,0,0,.42);z-index:20}.topbar-center{display:none}.topbar{padding:.65rem .8rem}.topbar-right{margin-left:auto}.user-chip,.logout-form{display:none}.content{padding:.85rem}}
@media(max-width:700px){.quick-create-toggle{font-size:0}.quick-create-toggle:after{content:"+";font-size:1rem}.lang-toggle{display:none}.grid-4,.grid-2{grid-template-columns:1fr}.split-actions{align-items:stretch;flex-direction:column-reverse}.split-actions>.row-actions,.split-actions>.btn{width:100%}.split-actions>.row-actions{display:grid;grid-template-columns:1fr}.repeat-row,.repeat-address-row{grid-template-columns:1fr}.purchase-entry-table{min-width:1050px}.search-groups{grid-template-columns:1fr}.global-search-page{flex-direction:column}.receipt-head{align-items:flex-start}.workflow-strip{font-size:.8rem}.topbar-right{gap:.35rem}}
.check.is-disabled{opacity:.55;cursor:not-allowed}.check.is-disabled input{cursor:not-allowed}

/* ===== Phase 2: Packaging & bucketed inventory ===== */
.page-tabs{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap;margin:0 0 1rem;padding:.35rem;background:var(--surface,#fff);border:1px solid var(--border,#e5e7eb);border-radius:.75rem;position:sticky;top:4.15rem;z-index:12}
.page-tabs a{display:inline-flex;align-items:center;min-height:2.35rem;padding:.5rem .8rem;border-radius:.55rem;color:var(--muted,#64748b);font-weight:700;text-decoration:none}
.page-tabs a:hover,.page-tabs a.active{background:var(--primary-soft,#eef2ff);color:var(--primary,#3346a8)}
.metric-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;margin-bottom:1rem}.metric-grid-5{grid-template-columns:repeat(5,minmax(0,1fr))}
.metric{background:var(--surface,#fff);border:1px solid var(--border,#e5e7eb);border-radius:.8rem;padding:1rem;min-width:0}.metric span,.metric small{display:block;color:var(--muted,#64748b)}.metric strong{display:block;font-size:1.45rem;line-height:1.25;margin:.25rem 0;overflow-wrap:anywhere}
.align-start{align-items:start}.block{display:block}.center{text-align:center}.pos{color:var(--success,#15803d)!important}.low{color:var(--danger,#b91c1c)!important}.row-warning{background:var(--warning-soft,#fff7ed)}
.input-action{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.4rem}.stock-output{display:flex;align-items:center;min-height:2.6rem;padding:.55rem .7rem;background:var(--surface-alt,#f8fafc);border:1px solid var(--border,#e5e7eb);border-radius:.5rem;font-weight:700}
.packaging-lines select,.packaging-lines input{min-width:110px}.packaging-lines td:first-child select{min-width:240px}.packaging-lines output{white-space:nowrap}
.packaging-reconcile .summary-list{margin-top:.5rem}.summary-list{display:grid;gap:.55rem;margin:0}.summary-list>div{display:flex;justify-content:space-between;gap:1rem;padding:.5rem 0;border-bottom:1px dashed var(--border,#e5e7eb)}.summary-list dt{color:var(--muted,#64748b)}.summary-list dd{margin:0;font-weight:700;text-align:right}.summary-list .total{font-size:1.08rem;border-bottom:0;border-top:2px solid var(--border,#e5e7eb);padding-top:.75rem}
.note-box{padding:.8rem 1rem;border-radius:.65rem;background:var(--surface-alt,#f8fafc);border:1px solid var(--border,#e5e7eb);margin-top:1rem}.danger-zone{border-color:var(--danger-soft,#fecaca);display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,.8fr);gap:1.25rem;align-items:start}.danger-zone form{margin:0}
.timeline.compact{display:grid;gap:.75rem}.timeline.compact .timeline-item{position:relative;padding-left:1.1rem;border-left:2px solid var(--border,#e5e7eb)}.timeline.compact small{display:block;color:var(--muted,#64748b);margin:.15rem 0}.timeline.compact p{margin:.25rem 0 0}
.stack-actions{display:grid;gap:.4rem;min-width:170px}.stack-actions form{display:flex;gap:.35rem;margin:0}.stack-actions input{min-width:110px;width:100%}
.transfer-progress{display:grid;grid-template-columns:repeat(5,1fr);gap:.4rem;margin:1rem 0}.transfer-progress div{padding:.55rem;text-align:center;border-radius:.55rem;background:var(--surface-alt,#f8fafc);color:var(--muted,#64748b);font-size:.82rem;font-weight:700;border:1px solid var(--border,#e5e7eb)}.transfer-progress div.done{background:var(--primary-soft,#eef2ff);color:var(--primary,#3346a8);border-color:var(--primary-soft,#c7d2fe)}
.badge-green{background:var(--success-soft,#dcfce7);color:var(--success,#166534)}.badge-yellow{background:var(--warning-soft,#fef3c7);color:var(--warning,#92400e)}.badge-red{background:var(--danger-soft,#fee2e2);color:var(--danger,#991b1b)}
.btn-lg{padding:.78rem 1.2rem;font-size:1rem}.btn:disabled{opacity:.5;cursor:not-allowed}.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}.split-actions{justify-content:space-between}
@media (max-width:1100px){.metric-grid-5{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}.danger-zone{grid-template-columns:1fr}}
@media (max-width:720px){.page-tabs{position:static;overflow-x:auto;flex-wrap:nowrap}.page-tabs a{white-space:nowrap}.metric-grid,.metric-grid-5{grid-template-columns:1fr 1fr}.packaging-lines td:first-child select{min-width:190px}.transfer-progress{grid-template-columns:1fr}.grid-4{grid-template-columns:1fr}.danger-zone{grid-template-columns:1fr}}
@media (max-width:460px){.metric-grid,.metric-grid-5{grid-template-columns:1fr}.input-action{grid-template-columns:1fr}.stack-actions form{flex-direction:column}}

/* ================= Phase 3: Sales, Delivery, Courier and Returns ================= */
.grid-5{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}.grid-6{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:14px}.span-2{grid-column:span 2}.page-tabs{display:flex;gap:6px;overflow:auto;padding:4px 0 12px;scrollbar-width:thin}.page-tabs a{white-space:nowrap;padding:9px 13px;border:1px solid var(--border);border-radius:10px;background:var(--card);color:var(--text);text-decoration:none;font-weight:700}.page-tabs a:hover,.page-tabs a.active{background:var(--primary);border-color:var(--primary);color:#fff}.order-builder-layout{display:grid;grid-template-columns:minmax(320px,.9fr) minmax(520px,1.4fr);gap:16px;align-items:start}.order-catalog{position:sticky;top:82px;max-height:calc(100vh - 100px);overflow:auto}.scan-search-row,.input-action{display:flex;gap:8px;align-items:end}.scan-search-row .field,.input-action input{min-width:0}.form-section{border-top:1px solid var(--border);padding-top:15px;margin-top:15px}.form-section h3{margin:0 0 12px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.target-total-box{display:grid;grid-template-columns:minmax(180px,1fr) auto;gap:10px;align-items:end;padding:12px;border:1px dashed var(--border);border-radius:12px;background:var(--surface-soft);margin-bottom:12px}.target-total-box small{grid-column:1/-1}.customer-trust{display:flex;flex-wrap:wrap;gap:8px;padding:10px 12px;margin:10px 0;border-radius:10px;background:var(--surface-soft)}.customer-trust span{padding-left:8px;border-left:1px solid var(--border)}.courier-risk-panel{margin:12px 0;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--card)}.courier-summary-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:8px 0 12px}.courier-summary-cards span{display:flex;justify-content:space-between;gap:6px;padding:8px;border-radius:8px;background:var(--surface-soft);font-size:.84rem}.table-compact th,.table-compact td{padding:7px 8px}.product-tile em{font-size:.68rem;font-style:normal;text-transform:uppercase;opacity:.75}.barcode-modal{position:fixed;z-index:9999;inset:0;background:rgba(0,0,0,.72);display:grid;place-items:center;padding:18px}.barcode-modal[hidden]{display:none}.barcode-dialog{width:min(520px,100%);background:var(--card);border-radius:16px;padding:14px;box-shadow:0 30px 80px rgba(0,0,0,.35)}.barcode-dialog video{width:100%;max-height:60vh;background:#000;border-radius:12px;object-fit:cover}.action-dock{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:15px}.pipeline{display:flex;align-items:center;flex-wrap:wrap;gap:7px}.order-overview{grid-template-columns:minmax(0,2fr) minmax(290px,1fr)}.order-address{padding:14px;border-radius:12px;background:var(--surface-soft)}.order-totals{max-width:420px;margin-left:auto}.order-totals>div{display:flex;justify-content:space-between;gap:16px;padding:7px 0;border-bottom:1px dashed var(--border)}.order-totals .grand,.order-totals .due{font-size:1.08rem;font-weight:800}.detail-list{display:grid;grid-template-columns:minmax(100px,.8fr) minmax(0,1.3fr);gap:8px 12px;margin:0}.detail-list dt{color:var(--muted)}.detail-list dd{margin:0;font-weight:650;overflow-wrap:anywhere}.inline-form{display:flex;gap:8px;flex-wrap:wrap;align-items:end}.timeline.horizontal{display:flex;overflow:auto;gap:12px}.timeline.horizontal .timeline-item{min-width:210px}.timeline.compact .timeline-item{padding:8px 0}.exchange-layout,.delivery-layout{align-items:start}.exchange-credit,.return-estimate{display:flex;justify-content:space-between;align-items:center;padding:12px;border-radius:10px;background:var(--surface-soft);margin:12px 0}.exchange-credit strong,.return-estimate strong{font-size:1.25rem}.exchange-summary{display:grid;grid-template-columns:repeat(3,1fr) auto;gap:16px;align-items:center}.exchange-summary>div{display:flex;flex-direction:column}.exchange-summary strong{font-size:1.2rem}.product-grid-results.mini{max-height:220px}.return-stats .stat-value,.order-stats .stat-value{font-size:1.35rem}.order-list-table td{vertical-align:top}.config-grid{align-items:start}.document-template-form{padding-bottom:18px;border-bottom:1px solid var(--border)}.pos-customer-primary{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}.pos-customer-primary>div{display:flex;flex-direction:column;padding:8px;border-radius:8px;background:var(--surface-soft)}.status-processing,.status-ready_for_courier,.status-courier_sent,.status-in_transit{background:#dbeafe;color:#1e40af}.status-partial_delivery,.status-partial_return,.status-exchanged{background:#fef3c7;color:#92400e}.status-completed,.status-delivered{background:#dcfce7;color:#166534}.status-returned,.status-cancelled{background:#fee2e2;color:#991b1b}.callout.warning{border-left-color:#f59e0b;background:#fffbeb}.callout.info{border-left-color:#3b82f6;background:#eff6ff}
@media(max-width:1180px){.order-builder-layout{grid-template-columns:1fr}.order-catalog{position:static;max-height:none}.grid-5,.grid-6{grid-template-columns:repeat(3,1fr)}.order-overview{grid-template-columns:1fr}.order-overview>.span-2{grid-column:auto}}
@media(max-width:760px){.grid-5,.grid-6,.courier-summary-cards,.pos-customer-primary{grid-template-columns:repeat(2,1fr)}.exchange-summary{grid-template-columns:1fr 1fr}.exchange-summary .btn{grid-column:1/-1}.target-total-box{grid-template-columns:1fr}.span-2{grid-column:auto}.action-dock{align-items:flex-start;flex-direction:column}.scan-search-row{align-items:stretch}.scan-search-row .btn{align-self:flex-end}.detail-list{grid-template-columns:1fr}.detail-list dt{font-size:.75rem}.order-checkout{overflow:hidden}}
@media(max-width:480px){.grid-5,.grid-6,.courier-summary-cards,.pos-customer-primary,.exchange-summary{grid-template-columns:1fr}.page-tabs a{padding:8px 10px}.scan-search-row{flex-direction:column}.scan-camera-btn{width:100%}}

/* ================= Phase 4: CRM, Finance, Quotations and Integrations ================= */
.crm-layout{display:grid;grid-template-columns:minmax(280px,.8fr) minmax(0,1.6fr);gap:16px;align-items:start}.crm-sidebar{position:sticky;top:82px}.crm-profile{display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:center}.crm-avatar{width:54px;height:54px;border-radius:50%;display:grid;place-items:center;background:var(--primary-soft,#eef2ff);font-weight:800;font-size:1.2rem}.crm-contact-list{display:grid;gap:7px}.crm-contact-list a,.crm-contact-list span{overflow-wrap:anywhere}.followup-toolbar{display:flex;align-items:end;justify-content:space-between;gap:12px;flex-wrap:wrap}.followup-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.followup-entry{border-left:4px solid var(--border);padding-left:12px}.followup-entry.overdue{border-left-color:var(--danger,#dc2626)}.followup-entry.today{border-left-color:var(--warning,#f59e0b)}.timeline{display:grid;gap:12px}.timeline-item{display:grid;grid-template-columns:12px minmax(0,1fr);gap:10px;align-items:start}.timeline-dot{width:10px;height:10px;margin-top:6px;border-radius:50%;background:var(--primary,#3346a8);box-shadow:0 0 0 4px var(--primary-soft,#eef2ff)}.stack-sm{display:grid;gap:9px}.mb{margin-bottom:1rem}.cost-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--surface-soft,#f8fafc)}.cost-summary span{display:flex;flex-direction:column;gap:4px;color:var(--muted)}.cost-summary strong{font-size:1.15rem;color:var(--text)}.ledger-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.ledger-balance{font-size:1.4rem;font-weight:800}.row-void{opacity:.58;text-decoration:line-through}.message-preview{max-width:420px;white-space:pre-wrap;overflow-wrap:anywhere}.phase-stats{margin:12px 0}.mini-stat{padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--surface-soft,#f8fafc);text-align:center}.mini-stat strong{display:block;font-size:1.35rem}.mini-stat span{font-size:.78rem;color:var(--muted)}.template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.phase4-template-card{margin:0}.phase4-template-form{padding-bottom:8px}.input-action{display:flex;gap:8px}.input-action input{flex:1}.alert-info{background:#eff6ff;border-color:#bfdbfe;color:#1e3a8a}.alert-danger{background:#fef2f2;border-color:#fecaca;color:#991b1b}.grid-5.phase-stats{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:1000px){.crm-layout{grid-template-columns:1fr}.crm-sidebar{position:static}.template-grid{grid-template-columns:1fr}.grid-5.phase-stats{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:720px){.followup-stats,.cost-summary,.ledger-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-5.phase-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:460px){.followup-stats,.cost-summary,.ledger-summary,.grid-5.phase-stats{grid-template-columns:1fr}.input-action{flex-direction:column}}

/* ================= Phase 5: reports, administration and launch ================= */
.report-center{display:grid;gap:16px}.report-toolbar{overflow:visible}.report-filter-form{display:grid;grid-template-columns:minmax(220px,1.2fr) 4fr auto;gap:14px;align-items:end}.report-dynamic-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px}.report-filter-actions{display:flex;gap:8px;align-items:end;padding-bottom:1px}.saved-report-views{display:flex;justify-content:space-between;align-items:end;gap:12px;flex-wrap:wrap;border-top:1px solid var(--border);padding-top:12px;margin-top:12px}.inline-flex{display:flex;align-items:end;gap:8px;flex-wrap:wrap}.field.compact{margin:0;min-width:190px}.save-report-view input{min-width:180px}.chip-list{display:flex;gap:7px;flex-wrap:wrap}.chip-delete{display:inline-flex;align-items:center;gap:5px;background:var(--surface-soft);border:1px solid var(--border);border-radius:999px;padding:5px 9px}.chip-delete button{border:0;background:transparent;color:var(--danger);cursor:pointer;padding:0}.report-summary-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}.report-summary-grid .stat{min-height:90px}.report-table-wrap{max-height:68vh;overflow:auto}.report-table-wrap thead th{position:sticky;top:0;z-index:2;background:var(--surface)}.report-table-wrap td{max-width:360px;white-space:normal;overflow-wrap:anywhere}.report-title-block{text-align:center;margin-bottom:18px}.report-meta{display:flex;justify-content:center;gap:18px;flex-wrap:wrap}.phase5-kpis a{text-decoration:none;color:inherit}.phase5-kpis .stat{transition:transform .16s ease,box-shadow .16s ease}.phase5-kpis .stat:hover{transform:translateY(-2px);box-shadow:var(--shadow-lg)}.trend-chart{min-height:300px;overflow:hidden}.trend-chart svg{display:block;width:100%;height:auto}.chart-grid{stroke:var(--border);stroke-width:1}.chart-axis{fill:var(--text-muted);font-size:11px}.chart-line{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.chart-revenue{stroke:#2563eb;fill:#2563eb}.chart-profit{stroke:#16a34a;fill:#16a34a}.chart-expense{stroke:#dc2626;fill:#dc2626}.trend-legend{display:flex;justify-content:flex-end;gap:16px;font-size:12px;margin-bottom:4px}.trend-legend span:before{content:"";display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px}.legend-revenue:before{background:#2563eb}.legend-profit:before{background:#16a34a}.legend-expense:before{background:#dc2626}.inventory-overview-grid,.marketing-kpis,.return-summary-box{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.inventory-overview-grid>div,.marketing-kpis>div,.return-summary-box>div{display:flex;flex-direction:column;gap:4px;background:var(--surface-soft);border:1px solid var(--border);border-radius:12px;padding:14px}.inventory-overview-grid span,.marketing-kpis span,.return-summary-box span{color:var(--text-muted);font-size:12px}.inventory-overview-grid strong,.marketing-kpis strong,.return-summary-box strong{font-size:18px}.hbar-row{text-decoration:none;color:inherit;display:grid;grid-template-columns:minmax(100px,1fr) 3fr minmax(130px,auto);align-items:center;gap:10px;padding:8px 0}.hbar-track{height:9px;border-radius:999px;background:var(--surface-soft);overflow:hidden}.hbar-fill{display:block;height:100%;background:var(--primary);border-radius:inherit}.hbar-val{text-align:right;font-size:12px;color:var(--text-muted)}
.user-profile-head{display:flex;align-items:center;gap:16px}.user-avatar-lg{width:78px;height:78px;border-radius:20px;object-fit:cover;background:var(--surface-soft);border:1px solid var(--border)}.user-avatar-placeholder{display:grid;place-items:center;font-size:30px;font-weight:700}.performance-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:10px}.task-board{display:grid;gap:10px}.task-item{border:1px solid var(--border);border-radius:12px;padding:12px;background:var(--surface)}.task-item-head{display:flex;justify-content:space-between;gap:10px}.priority-urgent{border-left:4px solid var(--danger)}.priority-high{border-left:4px solid #f59e0b}.priority-low{border-left:4px solid #0ea5e9}.audit-json{background:#0f172a;color:#e2e8f0;border-radius:10px;padding:14px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;max-height:420px}.audit-filter-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;align-items:end}.reconciliation-status{display:flex;align-items:center;gap:10px}.reconciliation-checks{display:grid;gap:10px}.reconciliation-check{border:1px solid var(--border);border-radius:12px;padding:13px}.reconciliation-check.passed{border-left:4px solid #16a34a}.reconciliation-check.warning{border-left:4px solid #f59e0b}.reconciliation-check.failed{border-left:4px solid var(--danger)}.backup-integrity{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px}.integrity-ok{color:#15803d}.integrity-bad{color:var(--danger)}
@media(max-width:1000px){.report-filter-form{grid-template-columns:1fr}.report-filter-actions{padding:0}.report-selector{max-width:none}}
@media(max-width:640px){.inventory-overview-grid,.marketing-kpis,.return-summary-box{grid-template-columns:1fr}.hbar-row{grid-template-columns:1fr}.hbar-val{text-align:left}.saved-report-views,.inline-flex{align-items:stretch}.inline-flex>*{width:100%}.report-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.user-profile-head{align-items:flex-start}.trend-legend{justify-content:flex-start;flex-wrap:wrap}}
@media print{.report-table-wrap{max-height:none;overflow:visible}.report-table-wrap thead th{position:static}.report-center{display:block}.report-center .card{box-shadow:none;border:0}.trend-chart{page-break-inside:avoid}}

.user-name-cell{display:inline-flex;align-items:center;gap:9px}.user-avatar-sm{width:34px;height:34px;border-radius:10px;object-fit:cover;background:var(--surface-soft);border:1px solid var(--border);flex:0 0 34px}.user-avatar-placeholder-sm{display:inline-grid;place-items:center;font-weight:700;text-decoration:none}

/* ========================================================================== 
   Tea Business UI Refresh · settings, purchases, onboarding and navigation
   ========================================================================== */
:root{
  --tea-deep:#0a4938;--tea:#0d684e;--tea-bright:#15966c;--tea-soft:#e9f7f1;
  --leaf:#6d8f3e;--leaf-soft:#f0f6e8;--tea-gold:#c99335;--tea-gold-soft:#fff5dd;
  --cream:#fbfaf5;--surface:#fff;--surface-soft:#f7faf8;--border:#dce7e2;
  --text:#172720;--text-muted:#64776e;--primary:var(--tea);--primary-soft:var(--tea-soft);
}
body.tea-business-ui{background:
  radial-gradient(circle at 95% 3%,rgba(109,143,62,.08),transparent 24rem),
  radial-gradient(circle at 20% 90%,rgba(13,104,78,.05),transparent 30rem),var(--bg);color:var(--text)}
body.tea-business-ui::before{content:"";position:fixed;inset:0;pointer-events:none;opacity:.18;z-index:-1;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cpath d='M76 14c-15 2-24 10-26 24 14-2 23-10 26-24ZM15 73c12-1 20-8 22-20-12 2-19 8-22 20Z' fill='none' stroke='%236d8f3e' stroke-opacity='.15' stroke-width='1'/%3E%3C/svg%3E")}

/* One and only one navigation toggle. Legacy buttons remain hidden even with stale HTML cache. */
.mobile-menu-toggle,.desktop-sidebar-toggle{display:none!important}
.menu-toggle.sidebar-toggle{width:42px;height:42px;display:inline-grid!important;place-items:center;border:1px solid #d6e5df;border-radius:12px;background:#fff;color:var(--tea);box-shadow:0 5px 18px rgba(10,73,56,.1);padding:0;cursor:pointer;transition:.18s ease}
.menu-toggle.sidebar-toggle:hover{transform:translateY(-1px);border-color:#a9c9bc;background:var(--tea-soft)}
.menu-toggle-lines{width:18px;display:grid;gap:4px}.menu-toggle-lines i{height:2px;border-radius:99px;background:currentColor;display:block;transition:.2s ease}.menu-toggle.sidebar-toggle.is-active .menu-toggle-lines i:nth-child(1){transform:translateY(6px) rotate(45deg)}.menu-toggle.sidebar-toggle.is-active .menu-toggle-lines i:nth-child(2){opacity:0;transform:scaleX(.2)}.menu-toggle.sidebar-toggle.is-active .menu-toggle-lines i:nth-child(3){transform:translateY(-6px) rotate(-45deg)}
.topbar{min-height:70px;padding:.7rem 1.25rem;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);box-shadow:0 4px 20px rgba(20,59,47,.04);z-index:20}
.topbar-left,.topbar-heading{display:flex;align-items:center}.topbar-left{gap:.8rem}.topbar-heading{display:block;min-width:0}.topbar-title{font-size:1.05rem;color:var(--tea-deep);line-height:1.2}.topbar-context{display:block;color:var(--text-muted);font-size:.7rem;margin-top:2px}.topbar-right{gap:.6rem}.topbar-search{height:42px;border-radius:12px;background:#f5f8f6;border:1px solid #e0e9e5}.topbar-search input{background:transparent}.lang-toggle,.notification-chip,.user-chip{border-radius:11px}.notification-chip{width:39px;height:39px;display:grid;place-items:center;background:#fff;border:1px solid var(--border);position:relative}.notification-chip>span{position:absolute;right:-5px;top:-5px}.user-chip{padding:.35rem .65rem;background:#f7faf8;border:1px solid var(--border)}
.content{padding:1.25rem clamp(.8rem,2vw,1.6rem) 2rem;max-width:1800px;width:100%;margin:0 auto}
.appfoot{background:rgba(255,255,255,.55);text-align:center}
.card{border-color:#dfe9e4;box-shadow:0 8px 28px rgba(24,65,51,.06);transition:border-color .16s ease,box-shadow .16s ease}.card:hover{border-color:#cfe0d9}.card-head h2,.card-head h3{color:var(--tea-deep)}
.btn{border-radius:10px;min-height:38px;justify-content:center}.btn-primary{background:linear-gradient(135deg,var(--tea),var(--tea-bright));box-shadow:0 6px 16px rgba(13,104,78,.17)}.btn-primary:hover{background:linear-gradient(135deg,#084f3c,#10815e);transform:translateY(-1px)}.btn-ghost:hover{border-color:#b7cfc5;background:var(--tea-soft);color:var(--tea-deep)}.btn-danger{background:linear-gradient(135deg,#c93e3e,#e15a4f)}.btn.full{width:100%}
input[type=text],input[type=email],input[type=password],input[type=number],input[type=date],input[type=datetime-local],input[type=url],input[type=tel],select,textarea{border-color:#d9e5df;border-radius:10px;background:#fff;min-height:42px;color:var(--text)}
textarea{font-family:inherit;min-height:auto}.field>span{font-weight:700;color:#43584f;font-size:.78rem}.field small{display:block;color:var(--text-muted);font-size:.75rem;margin-top:.3rem}input:focus,select:focus,textarea:focus{border-color:var(--tea-bright);box-shadow:0 0 0 3px rgba(21,150,108,.13)}
.table th,.table td{padding:.72rem .75rem}.table thead th{background:#f4f8f6;color:#52675e;border-top:1px solid var(--border);border-bottom:1px solid var(--border)}.table thead th:first-child{border-radius:10px 0 0 0}.table thead th:last-child{border-radius:0 10px 0 0}.table tbody tr:hover{background:#f8fbf9}.table-wrap{border-radius:12px;scrollbar-color:#b9cec4 transparent}.badge{padding:.25rem .58rem}.eyebrow{display:block;text-transform:uppercase;letter-spacing:.12em;font-size:.68rem;font-weight:800;color:var(--tea-bright);margin-bottom:.35rem}
.empty-state{padding:2.5rem 1rem;text-align:center}.empty-state span{width:54px;height:54px;margin:0 auto .8rem;display:grid;place-items:center;border-radius:18px;background:var(--tea-soft);color:var(--tea);font-size:1.5rem}.empty-state h3{color:var(--tea-deep)}.empty-state p{color:var(--text-muted);margin:.3rem auto 1rem;max-width:500px}.empty-state.mini{padding:1rem}

/* Contextual tea guides on every page. */
.tea-page-guide{margin:0 0 1rem;border:1px solid #cfe3d9;border-radius:14px;background:linear-gradient(115deg,#f4fbf7,#fffaf0);box-shadow:0 6px 18px rgba(32,92,67,.05);overflow:hidden}.tea-page-guide summary{list-style:none;display:flex;align-items:center;gap:.8rem;padding:.8rem 1rem;cursor:pointer}.tea-page-guide summary::-webkit-details-marker{display:none}.tea-guide-icon{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:linear-gradient(135deg,var(--tea),var(--leaf));color:#fff;font-size:1.1rem;box-shadow:0 6px 14px rgba(13,104,78,.18)}.tea-guide-copy{min-width:0;display:flex;flex-direction:column;flex:1}.tea-guide-copy strong{color:var(--tea-deep)}.tea-guide-copy small{color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tea-guide-action{font-size:.75rem;color:var(--tea);font-weight:800;border:1px solid #c9ddd4;padding:.32rem .6rem;border-radius:999px;background:#fff}.tea-page-guide[open] .tea-guide-action{background:var(--tea);color:#fff}.tea-guide-body{padding:.2rem 1rem 1rem;border-top:1px solid rgba(207,227,217,.7)}.tea-guide-examples{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap;margin:.8rem 0}.tea-guide-label{font-weight:800;font-size:.75rem;color:var(--tea-deep)}.tea-chip{background:#fff;border:1px solid #d6e5df;border-radius:999px;padding:.25rem .55rem;font-size:.76rem}.tea-guide-steps{margin:.3rem 0 0;padding-left:1.25rem;color:#4f625a}.tea-guide-steps li{margin:.25rem 0}

/* Settings control center. */
.settings-page{display:grid;gap:1rem}.settings-hero{position:relative;overflow:hidden;display:flex;justify-content:space-between;gap:1.5rem;align-items:center;padding:1.6rem 1.8rem;border-radius:20px;background:linear-gradient(125deg,#073f31,#0e6c50 58%,#718f3d);color:#fff;box-shadow:0 16px 42px rgba(10,73,56,.2)}.settings-hero::after{content:"";position:absolute;width:300px;height:300px;border:1px solid rgba(255,255,255,.13);border-radius:50%;right:-90px;top:-140px;box-shadow:0 0 0 45px rgba(255,255,255,.04),0 0 0 90px rgba(255,255,255,.025)}.settings-hero-copy{position:relative;z-index:1;max-width:850px}.settings-hero .eyebrow{color:#bfe9d5}.settings-hero h1{font-size:clamp(1.45rem,3vw,2.2rem);margin:0}.settings-hero p{margin:.4rem 0 0;color:#d7eee4;max-width:760px}.settings-health-row{display:flex;gap:.6rem;flex-wrap:wrap;margin-top:1rem}.settings-health-row>span{display:flex;align-items:center;gap:.4rem;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.14);padding:.35rem .6rem;border-radius:999px;font-size:.72rem}.status-dot{width:8px;height:8px;border-radius:50%;background:#b7c4be}.status-dot.ok{background:#67e8a8;box-shadow:0 0 0 3px rgba(103,232,168,.14)}.status-dot.warn{background:#ffd166}.status-dot.bad{background:#ff8b84}.status-dot.neutral{background:#c5d1cc}.settings-hero-mark{position:relative;z-index:1;min-width:145px;height:120px;border-radius:26px;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.18);display:grid;place-items:center;align-content:center;transform:rotate(2deg)}.settings-hero-mark span{font-size:3.1rem;line-height:1}.settings-hero-mark small{text-transform:uppercase;letter-spacing:.12em;font-weight:800;color:#e7f5ee}
.settings-tabbar{position:sticky;top:72px;z-index:12;display:flex;gap:.35rem;padding:.45rem;border:1px solid var(--border);border-radius:15px;background:rgba(255,255,255,.94);backdrop-filter:blur(12px);box-shadow:0 8px 24px rgba(25,65,52,.07);overflow-x:auto}.settings-tab{display:flex;align-items:center;gap:.42rem;white-space:nowrap;color:#52665e;font-weight:700;padding:.55rem .75rem;border-radius:10px}.settings-tab>span{width:24px;height:24px;display:grid;place-items:center;border-radius:8px;background:#eef4f1}.settings-tab:hover{background:#f2f7f4;color:var(--tea)}.settings-tab.active{background:linear-gradient(135deg,var(--tea),var(--tea-bright));color:#fff;box-shadow:0 5px 14px rgba(13,104,78,.16)}.settings-tab.active>span{background:rgba(255,255,255,.15)}
.settings-form{display:contents}.settings-panel{background:#fff;border:1px solid var(--border);border-radius:18px;padding:1.35rem;box-shadow:0 9px 30px rgba(24,65,51,.06)}.settings-panel[hidden]{display:none}.settings-panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;padding-bottom:1rem;margin-bottom:1.1rem;border-bottom:1px solid #edf2ef}.settings-panel-head>div:first-child{display:grid;grid-template-columns:auto 1fr;column-gap:.75rem}.settings-panel-head .section-icon{grid-row:1/3;width:42px;height:42px;display:grid;place-items:center;border-radius:13px;background:linear-gradient(135deg,var(--tea-soft),var(--leaf-soft));color:var(--tea);font-size:1.05rem;font-weight:800}.settings-panel-head h2{margin:0;color:var(--tea-deep);font-size:1.15rem}.settings-panel-head p{grid-column:2;margin:.12rem 0 0;color:var(--text-muted);font-size:.83rem}.settings-panel-tag{background:var(--tea-gold-soft);color:#966b1f;border:1px solid #f0daa9;padding:.3rem .6rem;border-radius:999px;font-size:.72rem;font-weight:800}.settings-logo-card{display:flex;align-items:center;gap:1rem;padding:1rem;border:1px dashed #c9ddd4;border-radius:14px;background:#f9fcfa;margin-bottom:1rem}.settings-logo-preview{width:76px;height:76px;border-radius:18px;display:grid;place-items:center;background:linear-gradient(135deg,var(--tea),var(--leaf));color:#fff;overflow:hidden;flex:0 0 76px;font-size:2rem}.settings-logo-preview img{width:100%;height:100%;object-fit:cover}.grow{flex:1}.settings-tip{display:flex;gap:.65rem;align-items:flex-start;padding:.8rem;border-radius:12px;background:var(--tea-soft);color:#345348}.settings-tip>span{width:22px;height:22px;display:grid;place-items:center;border-radius:50%;background:var(--tea);color:#fff;font-weight:800;flex:0 0 22px}.settings-tip p{margin:0}.settings-check-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}.settings-check-grid.single{grid-template-columns:1fr}.check-card{display:flex;gap:.7rem;align-items:flex-start;border:1px solid var(--border);border-radius:13px;padding:.85rem;background:#fbfdfc;cursor:pointer}.check-card:hover{border-color:#b9d2c7;background:#f5faf7}.check-card input{margin-top:.25rem;accent-color:var(--tea);width:18px;height:18px}.check-card span{display:flex;flex-direction:column}.check-card strong{color:var(--tea-deep)}.check-card small{color:var(--text-muted);font-size:.76rem;margin-top:.14rem}.settings-savebar{position:sticky;bottom:1rem;z-index:10;display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:.8rem 1rem;border:1px solid #c7ddd3;border-radius:14px;background:rgba(255,255,255,.94);backdrop-filter:blur(12px);box-shadow:0 12px 35px rgba(24,65,51,.14)}.settings-savebar>div{display:flex;flex-direction:column}.settings-savebar small{color:var(--text-muted)}
.tea-demo-layout{display:grid;grid-template-columns:minmax(280px,.9fr) minmax(0,1.3fr);gap:1rem}.tea-demo-showcase{position:relative;overflow:hidden;padding:1.35rem;border-radius:16px;background:linear-gradient(145deg,#0b4b39,#116f52);color:#fff}.tea-demo-showcase::after{content:"☘";position:absolute;right:-18px;bottom:-55px;font-size:12rem;line-height:1;color:rgba(255,255,255,.05)}.tea-demo-showcase .eyebrow{color:#b9ead4}.tea-demo-showcase h3{font-size:1.35rem}.tea-demo-showcase p{color:#d9eee5;position:relative;z-index:1}.tea-demo-flow{display:flex;align-items:center;gap:.35rem;flex-wrap:wrap;margin:1rem 0;position:relative;z-index:1}.tea-demo-flow span{padding:.3rem .52rem;border-radius:8px;background:rgba(255,255,255,.12);font-size:.72rem;font-weight:700}.tea-demo-flow b{color:#b9ead4}.tea-demo-product-list{list-style:none;padding:0;margin:1rem 0 0;display:grid;gap:.45rem;position:relative;z-index:1}.tea-demo-product-list li{display:flex;justify-content:space-between;gap:.5rem;padding:.52rem .6rem;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.06);border-radius:10px}.tea-demo-product-list small{color:#b9dfd0}.tea-demo-control{display:grid;gap:1rem}.tea-demo-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.65rem}.tea-demo-metrics>div{padding:.8rem;border:1px solid var(--border);border-radius:12px;background:#fbfdfc;text-align:center}.tea-demo-metrics span{display:block;font-size:1.35rem;font-weight:800;color:var(--tea)}.tea-demo-metrics small{color:var(--text-muted)}.tea-demo-actions{display:flex;gap:.6rem;flex-wrap:wrap}.tea-demo-actions form{margin:0}.tea-guide-toggle-form{margin:0}

/* Purchase management. */
.purchase-page{display:grid;gap:1rem}.purchase-hero{position:relative;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:1.2rem;padding:1.35rem 1.5rem;border-radius:18px;background:linear-gradient(128deg,#fff,#f4fbf7 60%,#fff8e8);border:1px solid #d8e8e1;box-shadow:0 10px 30px rgba(24,65,51,.07)}.purchase-hero::after{content:"☘";position:absolute;right:16%;top:-38px;font-size:8rem;color:rgba(13,104,78,.045);transform:rotate(-14deg)}.purchase-hero>div:first-child{position:relative;z-index:1}.purchase-hero h1{font-size:clamp(1.35rem,2.5vw,1.95rem);color:var(--tea-deep);margin:0}.purchase-hero p{color:var(--text-muted);margin:.35rem 0 0;max-width:760px}.purchase-hero-actions{display:flex;gap:.55rem;align-items:center;flex-wrap:wrap;position:relative;z-index:1}.btn-count{display:inline-grid;place-items:center;min-width:21px;height:21px;padding:0 .35rem;border-radius:999px;background:var(--tea-gold-soft);color:#8f6419;font-size:.7rem}.purchase-workflow{display:flex;align-items:stretch;gap:.4rem;padding:.65rem;border:1px solid var(--border);border-radius:15px;background:#fff;box-shadow:0 7px 24px rgba(24,65,51,.05);overflow-x:auto}.purchase-workflow>span{min-width:135px;display:grid;grid-template-columns:34px 1fr;grid-template-rows:auto auto;column-gap:.55rem;align-items:center;padding:.55rem .7rem;border-radius:11px;color:#6a7a73}.purchase-workflow>span i{grid-row:1/3;width:32px;height:32px;display:grid;place-items:center;border-radius:10px;background:#edf3f0;font-style:normal;font-weight:800}.purchase-workflow>span strong{font-size:.8rem}.purchase-workflow>span small{font-size:.68rem;color:#89978f}.purchase-workflow>span.active{background:var(--tea-soft);color:var(--tea-deep)}.purchase-workflow>span.active i{background:linear-gradient(135deg,var(--tea),var(--tea-bright));color:#fff}.purchase-workflow>span.done{background:#edf8f2;color:#236848}.purchase-workflow>span.done i{background:#32a66d;color:#fff}.purchase-workflow>b{align-self:center;color:#9fb0a8}.purchase-workflow.compact{margin-top:.85rem;padding:0;border:0;box-shadow:none;background:transparent}.purchase-workflow.compact>span{min-width:auto;padding:.32rem .45rem;display:flex;gap:.35rem;background:rgba(255,255,255,.72);border:1px solid #dce9e3}.purchase-workflow.compact>span i{width:22px;height:22px;border-radius:7px}.purchase-workflow.compact>span small{display:none}
.purchase-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.85rem}.purchase-kpis article{display:flex;align-items:center;gap:.8rem;padding:1rem;border:1px solid var(--border);border-radius:15px;background:#fff;box-shadow:0 7px 22px rgba(24,65,51,.05);min-width:0}.kpi-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:14px;flex:0 0 44px;font-size:1.05rem;font-weight:800}.kpi-icon.tea{background:var(--tea-soft);color:var(--tea)}.kpi-icon.due{background:#fff0ec;color:#d15742}.kpi-icon.receipt{background:#e8f4ff;color:#3477a8}.kpi-icon.pending{background:var(--tea-gold-soft);color:#9a6d20}.kpi-icon.payment{background:#edf8f2;color:#249160}.purchase-kpis article>div{min-width:0;display:flex;flex-direction:column}.purchase-kpis small{color:var(--text-muted);font-size:.72rem}.purchase-kpis strong{font-size:1.28rem;color:var(--tea-deep);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.purchase-kpis em{font-style:normal;color:#8a9992;font-size:.7rem}.purchase-status-pills{display:flex;gap:.45rem;overflow-x:auto;padding:.15rem}.purchase-status-pills a{display:flex;align-items:center;gap:.35rem;white-space:nowrap;padding:.42rem .62rem;border:1px solid var(--border);background:#fff;border-radius:999px;color:#566a61;font-weight:700;font-size:.74rem}.purchase-status-pills a span{min-width:21px;height:21px;display:grid;place-items:center;border-radius:50%;background:#eef4f1;font-size:.68rem}.purchase-status-pills a:hover,.purchase-status-pills a.active{border-color:var(--tea);background:var(--tea);color:#fff}.purchase-status-pills a.active span{background:rgba(255,255,255,.18)}
.purchase-filter-card{padding:.8rem;margin:0}.purchase-filterbar{margin:0;align-items:center}.purchase-filterbar>*{min-height:40px}.filter-search{position:relative;flex:1;min-width:210px}.filter-search span{position:absolute;left:.7rem;top:50%;transform:translateY(-50%);color:#83938b}.filter-search input{padding-left:2rem!important}.purchase-filterbar select{max-width:180px}.purchase-list-card{padding:1rem;margin:0}.table-legend{display:flex;gap:.7rem;font-size:.72rem;color:var(--text-muted)}.table-legend span{display:flex;align-items:center;gap:.35rem}.legend-dot{width:9px;height:9px;border-radius:50%;display:inline-block}.legend-dot.raw{background:#3e9b73}.legend-dot.packaging{background:#c18b35}.legend-dot.finished{background:#397bb0}.purchase-table{min-width:1050px}.purchase-no-cell,.purchase-product-cell{display:flex;align-items:center;gap:.65rem;min-width:0}.purchase-doc-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:var(--tea-soft);color:var(--tea);flex:0 0 34px}.purchase-doc-icon.large{width:46px;height:46px;border-radius:14px;font-size:1.2rem}.purchase-no-cell>div,.purchase-product-cell>div{display:flex;flex-direction:column;min-width:0}.purchase-no-cell a{color:var(--tea-deep)}.purchase-no-cell small,.purchase-product-cell small,.table-subtext{display:block;color:var(--text-muted);font-size:.7rem;margin-top:.1rem}.warehouse-chip{display:inline-flex;align-items:center;gap:.3rem;padding:.28rem .5rem;border-radius:8px;background:#f1f5f3;color:#52675e;font-size:.73rem}.receipt-progress{min-width:150px}.receipt-progress>div{height:7px;background:#e8efec;border-radius:999px;overflow:hidden}.receipt-progress>div span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--tea),var(--tea-bright))}.receipt-progress small{display:flex;justify-content:space-between;color:var(--text-muted);margin-top:.25rem}.payment-chip{display:inline-flex;padding:.24rem .5rem;border-radius:999px;font-size:.7rem;font-weight:800;background:#eff3f1;color:#63736c}.payment-chip.paid{background:#e7f7ef;color:#238152}.payment-chip.partial{background:#fff4dc;color:#94681c}.payment-chip.unpaid{background:#fff0ed;color:#bd4d3d}.due-number{color:#c34f3f;font-weight:700}
.purchase-entry-shell{display:grid;grid-template-columns:minmax(0,1fr) 315px;gap:1rem;align-items:start}.purchase-entry-main{display:grid;gap:1rem}.purchase-section-card{padding:1rem;margin:0}.purchase-section-head{display:flex;align-items:center;gap:.7rem;padding-bottom:.85rem;margin-bottom:.9rem;border-bottom:1px solid #edf2ef}.purchase-section-head>span{width:34px;height:34px;display:grid;place-items:center;border-radius:11px;background:var(--tea-soft);color:var(--tea);font-weight:800;flex:0 0 34px}.purchase-section-head>div{flex:1}.purchase-section-head h2{margin:0;color:var(--tea-deep);font-size:1rem}.purchase-section-head p{margin:.1rem 0 0;color:var(--text-muted);font-size:.77rem}.purchase-notice{display:flex;gap:.65rem;align-items:flex-start;padding:.75rem;border:1px solid #cde2d8;border-radius:12px;background:#f3faf6}.purchase-notice>span{width:23px;height:23px;display:grid;place-items:center;border-radius:50%;background:var(--tea);color:#fff;font-weight:800;flex:0 0 23px}.purchase-notice strong{color:var(--tea-deep)}.purchase-notice p{margin:.12rem 0 0;color:#52675e;font-size:.78rem}.tea-example-strip{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap;margin-bottom:.7rem;color:var(--text-muted);font-size:.72rem}.tea-example-strip span{padding:.25rem .5rem;border-radius:999px;background:var(--tea-soft);color:#376350}.purchase-items-wrap{border:1px solid var(--border)}.purchase-entry-table{min-width:900px}.purchase-entry-table td{vertical-align:top}.purchase-entry-table select,.purchase-entry-table input{min-height:38px}.purchase-entry-table .purchase-product{min-width:240px}.stock-destination{display:flex;flex-direction:column;align-items:flex-start;gap:.25rem}.stock-destination small{color:var(--text-muted)}.purchase-product-meta{display:block;color:var(--text-muted);font-size:.68rem;margin-top:.2rem}.qty-with-unit{position:relative;display:flex;align-items:center;min-width:110px}.qty-with-unit input{padding-right:2.6rem}.qty-with-unit>small{position:absolute;right:.55rem;color:#83938b;font-size:.67rem;pointer-events:none}.form-output{min-height:42px;display:flex;align-items:center;padding:.55rem .7rem;border-radius:10px;background:#f4f8f6;border:1px solid var(--border);font-weight:800}.file-drop{padding:.8rem;border:1px dashed #bdd4ca;border-radius:12px;background:#fafcfb}.purchase-side-summary{position:sticky;top:145px;display:grid;gap:1rem}.purchase-summary-card{padding:1rem;margin:0;border-color:#cfe1d9}.purchase-summary-head{display:flex;gap:.65rem;align-items:center;padding-bottom:.8rem;margin-bottom:.6rem;border-bottom:1px solid #edf2ef}.purchase-summary-head>span{width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:linear-gradient(135deg,var(--tea),var(--tea-bright));color:#fff}.purchase-summary-head>div{display:flex;flex-direction:column}.purchase-summary-head strong{color:var(--tea-deep)}.purchase-summary-head small{color:var(--text-muted);font-size:.7rem}.summary-line,.summary-input,.summary-total{display:flex;justify-content:space-between;align-items:center;gap:.8rem;padding:.6rem 0}.summary-line{border-bottom:1px dashed #e0e9e5}.summary-line span,.summary-input span{color:var(--text-muted);font-size:.76rem}.summary-input input{width:120px;min-height:36px;text-align:right}.summary-input.paid{margin-top:.4rem;padding:.65rem;background:#f6faf8;border-radius:10px}.summary-total{margin:.35rem 0;padding:.8rem;border-radius:11px;background:linear-gradient(135deg,var(--tea-deep),var(--tea));color:#fff}.summary-total output{font-size:1.35rem;font-weight:800}.purchase-summary-tip{display:flex;gap:.45rem;align-items:flex-start;margin-top:.6rem;padding:.65rem;border-radius:10px;background:var(--tea-gold-soft);color:#77571e}.purchase-summary-tip>span{font-weight:800}.purchase-summary-tip p{margin:0;font-size:.72rem}.purchase-summary-tip.warning{background:#fff0ed;color:#8e4338}.tea-stock-legend-card{padding:1rem;margin:0}.tea-stock-legend-card h3{font-size:.9rem;color:var(--tea-deep)}.tea-stock-legend-card>div{display:flex;gap:.55rem;align-items:flex-start;padding:.55rem 0;border-bottom:1px solid #edf2ef}.tea-stock-legend-card>div:last-child{border:0}.tea-stock-legend-card>div span:last-child{display:flex;flex-direction:column}.tea-stock-legend-card small{color:var(--text-muted);font-size:.69rem}.purchase-submitbar{position:sticky;bottom:.8rem;z-index:9;display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:.75rem;border:1px solid #c9ddd4;border-radius:14px;background:rgba(255,255,255,.95);backdrop-filter:blur(12px);box-shadow:0 12px 32px rgba(24,65,51,.13)}.purchase-submitbar>div{display:flex;gap:.55rem}
.purchase-state-banner{display:flex;gap:.7rem;align-items:flex-start;padding:.85rem 1rem;border-radius:13px;border:1px solid}.purchase-state-banner>span{width:30px;height:30px;display:grid;place-items:center;border-radius:10px;font-weight:800;flex:0 0 30px}.purchase-state-banner strong{display:block}.purchase-state-banner p{margin:.1rem 0 0}.purchase-state-banner.warning{background:#fff9e9;border-color:#f1dca9;color:#72551d}.purchase-state-banner.warning>span{background:#f4c85b;color:#5d430f}.purchase-state-banner.info{background:#edf7ff;border-color:#c8e2f3;color:#315c76}.purchase-state-banner.info>span{background:#65a9d4;color:#fff}.purchase-state-banner.success{background:#edf9f3;border-color:#c6e8d5;color:#276647}.purchase-state-banner.success>span{background:#39a66f;color:#fff}.purchase-title-row{display:flex;align-items:center;gap:.7rem}.purchase-title-row h1{line-height:1}.purchase-detail-grid{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:1rem;align-items:start}.purchase-detail-main{display:grid;gap:1rem}.purchase-detail-side{display:grid;gap:1rem;position:sticky;top:145px}.purchase-detail-table{min-width:900px}.tea-product-dot{width:11px;height:11px;border-radius:50%;background:linear-gradient(135deg,var(--tea-bright),var(--leaf));box-shadow:0 0 0 4px var(--tea-soft);flex:0 0 11px}.stock-destination-chip{display:inline-flex;padding:.3rem .55rem;border-radius:8px;font-size:.71rem;font-weight:800}.stock-destination-chip.raw{background:#e7f6ef;color:#287251}.stock-destination-chip.packaging{background:#fff4df;color:#8d671d}.stock-destination-chip.finished{background:#e9f3fc;color:#366e99}.stock-destination-chip.damaged{background:#fff0ed;color:#af4d3d}.purchase-detail-notes{display:flex;justify-content:space-between;gap:1rem;padding:.85rem;margin-top:.8rem;border-radius:12px;background:#f7faf8}.purchase-detail-notes p{margin:.2rem 0 0;color:var(--text-muted)}.receipt-timeline{display:grid;gap:.75rem}.receipt-card{display:grid;grid-template-columns:38px 1fr;gap:.65rem}.receipt-card-marker{width:36px;height:36px;display:grid;place-items:center;border-radius:12px;background:var(--tea-soft);color:var(--tea);font-weight:800}.receipt-card-content{padding:.85rem;border:1px solid var(--border);border-radius:13px}.receipt-head{display:flex;justify-content:space-between;align-items:start;gap:1rem;margin-bottom:.6rem}.receipt-head>div{display:flex;flex-direction:column}.receipt-head small{color:var(--text-muted)}.purchase-info-card,.purchase-payment-card{padding:1rem;margin:0}.purchase-info-card h3,.purchase-payment-card h3{color:var(--tea-deep)}.purchase-info-card dl{margin:0}.purchase-info-card dl>div{display:flex;justify-content:space-between;gap:1rem;padding:.55rem 0;border-bottom:1px solid #edf2ef}.purchase-info-card dt{color:var(--text-muted);font-size:.74rem}.purchase-info-card dd{margin:0;text-align:right;font-weight:700}.purchase-payment-card>p{color:var(--text-muted);font-size:.75rem}.purchase-finance-grid{margin-top:0}.purchase-activity-card{margin:0}.activity-timeline.professional article{padding:.7rem 0}.activity-timeline.professional small{color:var(--text-muted)}
.receive-all-btn{position:absolute;right:2.6rem;border:0;background:var(--tea-soft);color:var(--tea);border-radius:6px;padding:.18rem .35rem;font-size:.64rem;font-weight:800;cursor:pointer}.receive-input input,.return-input input{padding-right:5.3rem}.receipt-ring{--progress:0;width:130px;height:130px;margin:.6rem auto 1rem;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--tea) calc(var(--progress)*1%),#e9efec 0);position:relative}.receipt-ring::after{content:"";position:absolute;inset:12px;border-radius:50%;background:#fff}.receipt-ring>div{position:relative;z-index:1;display:flex;flex-direction:column;text-align:center}.receipt-ring strong{font-size:1.35rem;color:var(--tea-deep)}.receipt-ring small{font-size:.66rem;color:var(--text-muted)}.return-hero{background:linear-gradient(128deg,#fff,#fff7f3 70%,#fff)}.return-summary-card{border-color:#efd2cb}.purchase-return-table{min-width:950px}

@media(max-width:1180px){.purchase-entry-shell,.purchase-detail-grid{grid-template-columns:1fr}.purchase-side-summary,.purchase-detail-side{position:static;grid-template-columns:repeat(2,minmax(0,1fr))}.purchase-summary-card{grid-column:auto}.tea-demo-layout{grid-template-columns:1fr}.purchase-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-tabbar{top:70px}}
@media(max-width:980px){.topbar-context{display:none}.topbar-center{display:none}.content{padding:1rem}.sidebar{z-index:50}.nav-scrim{z-index:45}.settings-tabbar{position:static}.purchase-side-summary,.purchase-detail-side{grid-template-columns:1fr}.purchase-workflow>span{min-width:125px}.logout-form{display:none}.user-chip small{display:none}}
@media(max-width:760px){.topbar{padding:.55rem .7rem}.topbar-right{gap:.35rem}.quick-create-wrap,.user-chip{display:none}.settings-hero,.purchase-hero{padding:1.1rem;align-items:flex-start;flex-direction:column}.settings-hero-mark{display:none}.settings-health-row{display:grid}.settings-tabbar{border-radius:12px}.settings-panel{padding:1rem}.settings-panel-head{flex-direction:column}.settings-panel-head>div:first-child{width:100%}.settings-check-grid,.tea-demo-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-savebar,.purchase-submitbar{bottom:.4rem}.settings-savebar>div{display:none}.purchase-kpis{grid-template-columns:1fr}.purchase-workflow{padding:.4rem}.purchase-workflow>span{min-width:112px;grid-template-columns:28px 1fr}.purchase-workflow>span i{width:27px;height:27px}.purchase-workflow.compact{display:none}.purchase-filterbar>*{width:100%!important;max-width:none!important}.purchase-filterbar .filter-search{width:100%}.purchase-submitbar{align-items:stretch}.purchase-submitbar>div{display:grid;grid-template-columns:1fr 1fr;flex:1}.purchase-submitbar>.btn{flex:0 0 auto}.purchase-title-row{flex-wrap:wrap}.receipt-head{flex-direction:column}.grid.grid-4,.grid.grid-3,.grid.grid-2{grid-template-columns:1fr}.settings-logo-card{align-items:flex-start}.tea-page-guide summary{align-items:flex-start}.tea-guide-copy small{white-space:normal}.tea-guide-action{display:none}}
@media(max-width:480px){.settings-check-grid,.tea-demo-metrics{grid-template-columns:1fr}.purchase-submitbar{flex-direction:column}.purchase-submitbar>div{width:100%}.purchase-submitbar>.btn{width:100%}.tea-demo-actions,.tea-demo-actions form,.tea-demo-actions button{width:100%}.menu-toggle.sidebar-toggle{width:39px;height:39px}.notification-chip{width:36px;height:36px}.lang-toggle{padding:.28rem .42rem}.topbar-title{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}

/* Tea-branded authentication screen */
.tea-login-page{min-height:100vh;background:
 radial-gradient(circle at 12% 12%,rgba(21,150,108,.18),transparent 24rem),
 radial-gradient(circle at 90% 88%,rgba(201,147,53,.13),transparent 26rem),
 linear-gradient(145deg,#f4fbf7,#fffdf6)}
.tea-login-page::before,.tea-login-page::after{content:"";position:fixed;pointer-events:none;opacity:.28;background-repeat:no-repeat;background-size:contain;z-index:0}
.tea-login-page::before{width:310px;height:310px;left:-90px;bottom:-70px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%230d684e' stroke-width='5'%3E%3Cpath d='M100 184C97 122 82 73 35 24'/%3E%3Cpath d='M82 116C43 112 18 90 13 56 51 54 79 72 82 116ZM106 94c6-38 31-64 68-69 2 39-21 66-68 69ZM95 148c35-5 62 7 80 39-37 11-66-2-80-39Z'/%3E%3C/g%3E%3C/svg%3E")}
.tea-login-page::after{width:250px;height:250px;right:-55px;top:-35px;transform:rotate(180deg);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%236d8f3e' stroke-width='5'%3E%3Cpath d='M100 184C97 122 82 73 35 24'/%3E%3Cpath d='M82 116C43 112 18 90 13 56 51 54 79 72 82 116ZM106 94c6-38 31-64 68-69 2 39-21 66-68 69Z'/%3E%3C/g%3E%3C/svg%3E")}
.tea-login-page .login-wrap{position:relative;z-index:1;min-height:100vh;padding:1.25rem}
.tea-login-page .login-card{width:min(440px,100%);padding:2rem;border:1px solid rgba(13,104,78,.16);border-radius:24px;background:rgba(255,255,255,.93);backdrop-filter:blur(18px);box-shadow:0 28px 75px rgba(10,73,56,.16)}
.tea-login-page .login-head{margin-bottom:1.4rem}.tea-login-page .login-head h1{color:var(--tea-deep);letter-spacing:-.02em}
.tea-login-mark{width:64px!important;height:64px!important;margin:0 auto .8rem;background:linear-gradient(145deg,var(--tea),var(--tea-bright))!important;color:#fff!important;border-radius:20px!important;font-size:2rem!important;box-shadow:0 14px 32px rgba(13,104,78,.25)}
.tea-login-page .login-lang{margin-top:1.1rem;padding-top:1rem;border-top:1px solid var(--border)}

/* Shared polish so legacy module pages visually match the tea workspace. */
.tea-business-ui .page-head{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;margin:0 0 1rem;padding:1rem 1.15rem;border:1px solid var(--border);border-radius:16px;background:linear-gradient(120deg,#fff,#f6fbf8);box-shadow:0 8px 25px rgba(24,65,51,.055)}
.tea-business-ui .page-head h1{margin:0;color:var(--tea-deep);font-size:clamp(1.2rem,2vw,1.65rem);letter-spacing:-.018em}.tea-business-ui .page-head p{margin:.25rem 0 0;color:var(--text-muted)}
.tea-business-ui .filterbar{padding:.75rem;border:1px solid var(--border);border-radius:13px;background:#fafcfb;gap:.55rem}.tea-business-ui .filterbar input,.tea-business-ui .filterbar select{background:#fff}
.tea-business-ui .tabs{padding:.3rem;border:1px solid var(--border);border-radius:12px;background:#f7faf8;gap:.25rem}.tea-business-ui .tabs a{border-radius:9px}.tea-business-ui .tabs a.active{background:var(--tea);color:#fff;box-shadow:0 5px 13px rgba(13,104,78,.15)}
.tea-business-ui .thumb{width:48px;height:48px;object-fit:cover;border-radius:13px;border:1px solid #d7e4de;background:#f3f8f5;box-shadow:0 4px 12px rgba(22,64,50,.07)}.tea-business-ui .thumb.placeholder{display:inline-grid;place-items:center;color:var(--tea);font-size:1.15rem}
.tea-business-ui .stat{border-color:var(--border);background:linear-gradient(145deg,#fff,#f8fbf9)}.tea-business-ui .stat strong{color:var(--tea-deep)}
.tea-business-ui .form-actions{padding-top:.85rem;border-top:1px solid #edf2ef}.tea-business-ui code{color:var(--tea-deep);background:var(--tea-soft);border-radius:6px;padding:.12rem .35rem}
@media(max-width:640px){.tea-business-ui .page-head{align-items:flex-start;padding:.85rem}.tea-business-ui .page-head .row-actions{width:100%}.tea-business-ui .page-head .row-actions .btn{flex:1}.tea-business-ui .filterbar>*{min-width:0!important;max-width:none!important}}
@media print{.tea-business-ui .page-head{box-shadow:none;border:0;padding:0;background:none}}

/* =====================================================================
   UI & FORM STABILITY PATCH — 2026-07-19
   Uniform controls, safer responsive layouts, order and purchase polish.
   ===================================================================== */
html{overflow-x:hidden;scroll-behavior:smooth}
body{min-width:320px}
.main{min-width:0;max-width:100%;overflow-x:clip}
.topbar{order:0;width:100%;flex:0 0 auto}
.content{order:1;min-width:0;max-width:100%;overflow-x:clip}
.appfoot{order:2}
.content>*{min-width:0}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.grid-5{grid-template-columns:repeat(5,minmax(0,1fr))}
.grid-6{grid-template-columns:repeat(6,minmax(0,1fr))}
.field{min-width:0;margin-bottom:.95rem}
.field>span{color:#50655c;font-size:.76rem;font-weight:750;letter-spacing:.015em;margin-bottom:.38rem}
.field:focus-within>span{color:var(--tea,#0d684e)}

/* Every application control, including search/date/tel/url and no-type inputs. */
:where(
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]),
  select,
  textarea
){
  display:block;width:100%;max-width:100%;min-width:0;min-height:44px;
  margin:0;padding:.64rem .78rem;border:1px solid #cedbd5;border-radius:11px;
  background-color:#fff;color:var(--ink,#16241f);font:inherit;font-family:inherit;
  line-height:1.35;box-shadow:0 1px 1px rgba(18,67,50,.025);
  transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease;
}
:where(input,select,textarea)::placeholder{color:#94a29c;opacity:1}
:where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),select,textarea):hover:not(:disabled){border-color:#adc7bc}
:where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),select,textarea):focus{
  outline:0;border-color:var(--tea-bright,#15966c);background:#fff;
  box-shadow:0 0 0 3px rgba(21,150,108,.13),0 2px 8px rgba(18,67,50,.055)
}
:where(input,select,textarea):disabled{cursor:not-allowed;color:#829089;background:#f2f5f3;border-color:#dfe7e3;opacity:1}
:where(input,textarea)[readonly]{background:#f6f9f7;color:#53665d}
:where(input,select,textarea)[aria-invalid="true"]{border-color:#d6453f;box-shadow:0 0 0 3px rgba(214,69,63,.11)}
input[type="search"]{-webkit-appearance:none;appearance:none}
input[type="search"]::-webkit-search-cancel-button{cursor:pointer}
input[type="date"],input[type="datetime-local"],input[type="time"],input[type="month"],input[type="week"]{font-variant-numeric:tabular-nums;color-scheme:light}
input[type="number"]{font-variant-numeric:tabular-nums}
textarea{min-height:96px;height:auto;line-height:1.55;resize:vertical;font-family:inherit;font-size:inherit}
select{
  -webkit-appearance:none;appearance:none;padding-right:2.35rem;cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m5 7.5 5 5 5-5' stroke='%23546b61' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right .72rem center;background-size:16px
}
html[lang="bn"] select{background-position:left .72rem center;padding-right:.78rem;padding-left:2.35rem}
input[type="file"]{padding:.42rem .55rem;background:#fbfdfc;cursor:pointer}
input[type="file"]::file-selector-button{border:0;border-radius:8px;padding:.46rem .7rem;margin-right:.65rem;background:var(--tea-soft,#e9f7f1);color:var(--tea,#0d684e);font:inherit;font-weight:750;cursor:pointer}
input[type="checkbox"],input[type="radio"]{width:18px;height:18px;min-width:18px;margin:0;accent-color:var(--tea,#0d684e);cursor:pointer}
input[type="checkbox"]:focus-visible,input[type="radio"]:focus-visible{outline:3px solid rgba(21,150,108,.18);outline-offset:2px}
.check{min-height:30px}.check span{line-height:1.35}
.form-output{min-width:0;overflow-wrap:anywhere}

/* Compact controls remain compact without falling back to browser-default UI. */
.table :where(input:not([type="checkbox"]):not([type="radio"]),select){min-height:38px;padding:.48rem .62rem;border-radius:9px}
.btn{min-height:40px;justify-content:center;white-space:nowrap;border-radius:10px;transition:transform .15s ease,box-shadow .15s ease,background-color .15s ease,border-color .15s ease}
.btn:hover{transform:translateY(-1px)}
.btn:active{transform:translateY(0)}
.btn-sm{min-height:36px}
.btn-primary{background:linear-gradient(135deg,var(--tea,#0d684e),var(--tea-bright,#15966c));box-shadow:0 6px 14px rgba(13,104,78,.16)}
.btn-primary:hover{background:linear-gradient(135deg,#09543f,#117f5c);box-shadow:0 8px 18px rgba(13,104,78,.22)}
.btn-ghost{border-color:#d4dfda;background:#fff}
.btn-ghost:hover{border-color:#b7ccc2;background:#f7faf8}

/* Shared filter bars no longer overflow or show mismatched input styles. */
.filterbar{align-items:end;padding:.8rem;gap:.65rem}
.filterbar>:where(input:not([type="hidden"]),select){flex:1 1 170px;width:auto;min-width:145px}
.filterbar>.btn{flex:0 0 auto}
.inline-form>:where(input:not([type="hidden"]),select){width:auto;min-width:150px;flex:1 1 170px}
.table-wrap{max-width:100%;border-radius:12px}
.table{min-width:0}
.table th{white-space:nowrap}
.wrap-cell{white-space:normal;min-width:150px}

/* Order register: clearly grouped filters and stable responsive structure. */
.order-management-page{display:grid;gap:1rem}
.order-management-page>.page-head,.order-management-page>.page-tabs,.order-management-page>.order-stats,.order-management-page>.card{margin-bottom:0}
.order-page-head{position:relative;overflow:hidden}
.order-page-head:after{content:"";position:absolute;right:-35px;bottom:-60px;width:180px;height:180px;border-radius:50%;background:radial-gradient(circle,rgba(21,150,108,.09),transparent 68%);pointer-events:none}
.order-stats .stat{margin:0;min-height:100px;border-left:4px solid var(--tea-bright,#15966c);display:flex;flex-direction:column;justify-content:center}
.order-register-card{padding:1rem;margin:0;overflow:hidden}
.order-filter-panel{display:grid;grid-template-columns:minmax(260px,1.7fr) repeat(4,minmax(145px,1fr));gap:.7rem;align-items:end;padding:.85rem;border:1px solid var(--border,#dce7e2);border-radius:14px;background:#f8fbf9}
.order-filter-panel .field{margin:0}
.order-filter-search{grid-column:span 2}
.order-filter-actions{display:flex;gap:.5rem;align-items:center;min-height:44px}
.order-register-tools{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.8rem 0 .55rem}
.order-table-wrap{border:1px solid var(--border,#dce7e2)}
.order-list-table th,.order-list-table td{padding:.68rem .72rem}
.bulk-toolbar{background:#f6faf8;border-color:#d8e6df}
.bulk-toolbar>:where(select,input){width:auto;min-width:170px;flex:1 1 180px}
.bulk-toolbar .btn,.bulk-toolbar small{flex:0 0 auto}

/* New order: cleaner workspace and no accidental horizontal overflow. */
.order-create-page{display:grid;gap:1rem;max-width:1680px;margin:0 auto}
.order-create-page>.page-head{margin:0}
.order-builder-layout{grid-template-columns:minmax(330px,.78fr) minmax(0,1.5fr);gap:1rem;max-width:100%}
.order-catalog,.order-checkout{min-width:0;margin:0}
.order-catalog{top:86px;border-color:#d8e6df}
.order-checkout{overflow:visible;padding:1.15rem}
.order-checkout>.card-head{padding-bottom:.75rem;border-bottom:1px solid #edf2ef}
.order-checkout .form-section{padding:1rem;margin:1rem 0 0;border:1px solid #e1eae6;border-radius:14px;background:#fbfdfc}
.order-checkout .form-section h3{color:var(--tea-deep,#0a4938);font-size:1rem}
.order-checkout .form-section .field:last-child{margin-bottom:0}
.order-checkout .grid{gap:.75rem}
.order-checkout .pos-totals{margin-top:1rem;border-color:#cfe1d9;background:linear-gradient(145deg,#f5fbf8,#fff)}
.order-checkout #createOrderBtn{margin-top:.8rem;min-height:48px}
.scan-search-row{align-items:end}.scan-search-row .field{margin:0}
.product-grid-results:empty:after{content:"Search or scan a finished tea product to begin";display:block;padding:1.5rem;text-align:center;color:var(--muted);border:1px dashed #cddbd5;border-radius:12px;background:#fbfdfc;grid-column:1/-1}
html[lang="bn"] .product-grid-results:empty:after{content:"শুরু করতে একটি বিক্রয়যোগ্য চা পণ্য খুঁজুন বা স্ক্যান করুন"}
.target-total-box .field{margin:0}
.section-heading{margin-bottom:.7rem}

/* Purchase entry: balanced desktop composition and card-style mobile rows. */
.purchase-entry-shell{grid-template-columns:minmax(0,1fr) 300px;gap:1rem}
.purchase-section-card{overflow:hidden}
.purchase-items-wrap{max-width:100%;background:#fff}
.purchase-entry-table{min-width:820px}
.purchase-entry-table td:first-child select{min-width:210px}
.purchase-entry-table .purchase-product{min-width:210px}
.purchase-entry-table output{display:inline-flex;align-items:center;justify-content:flex-end;min-height:38px;font-weight:800;color:var(--tea-deep,#0a4938)}
.purchase-side-summary{top:88px}
.purchase-submitbar{margin-top:1rem;bottom:.65rem}
.purchase-row-action{text-align:right}

/* Prevent tutorial help from competing with primary actions. */
.tea-page-guide{margin-bottom:1rem}
.tea-page-guide summary{min-height:58px}

@media(max-width:1450px){
  .order-filter-panel{grid-template-columns:minmax(240px,1.5fr) repeat(3,minmax(145px,1fr))}
  .order-filter-search{grid-column:span 2}
  .order-builder-layout{grid-template-columns:1fr}
  .order-catalog{position:static;max-height:none}
  .purchase-entry-shell{grid-template-columns:1fr}
  .purchase-side-summary{position:static;display:grid;grid-template-columns:minmax(0,1.25fr) minmax(260px,.75fr)}
}
@media(max-width:1100px){
  .order-filter-panel{grid-template-columns:repeat(3,minmax(0,1fr))}
  .order-filter-search{grid-column:span 2}
  .order-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
  .purchase-side-summary{grid-template-columns:1fr 1fr}
}
@media(max-width:820px){
  .grid-3,.grid-4,.grid-5,.grid-6{grid-template-columns:repeat(2,minmax(0,1fr))}
  .order-filter-panel{grid-template-columns:repeat(2,minmax(0,1fr))}
  .order-filter-search{grid-column:1/-1}
  .order-filter-actions{grid-column:1/-1}
  .order-filter-actions .btn{flex:1}
  .order-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .order-register-tools{align-items:flex-start;flex-direction:column}
  .purchase-side-summary{grid-template-columns:1fr}
  .purchase-section-head{align-items:flex-start;flex-wrap:wrap}
  .purchase-section-head .btn{margin-left:41px}
  .purchase-entry-table{min-width:0;border-collapse:separate;border-spacing:0}
  .purchase-entry-table thead{display:none}
  .purchase-entry-table,.purchase-entry-table tbody,.purchase-entry-table tr,.purchase-entry-table td{display:block;width:100%}
  .purchase-entry-table tbody{padding:.7rem;display:grid;gap:.75rem}
  .purchase-entry-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.68rem;padding:.8rem;border:1px solid #dce7e2;border-radius:13px;background:#fbfdfc;box-shadow:0 4px 12px rgba(20,59,47,.04)}
  .purchase-entry-table td{padding:0!important;border:0!important;text-align:left!important;min-width:0}
  .purchase-entry-table td:before{content:attr(data-label);display:block;margin-bottom:.3rem;color:#5b6f66;font-size:.68rem;font-weight:800;text-transform:uppercase;letter-spacing:.035em}
  .purchase-entry-table td:first-child{grid-column:1/-1}
  .purchase-entry-table td:first-child select,.purchase-entry-table .purchase-product{min-width:0;width:100%}
  .purchase-entry-table .stock-destination{min-height:44px;justify-content:center}
  .purchase-entry-table .qty-with-unit{min-width:0}
  .purchase-entry-table .purchase-row-action{grid-column:1/-1;display:flex;justify-content:flex-end}
  .purchase-entry-table .purchase-row-action:before{display:none}
  .purchase-entry-table .purchase-remove{min-width:42px}
}
@media(max-width:620px){
  :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),select,textarea){font-size:16px}
  .grid-2,.grid-3,.grid-4,.grid-5,.grid-6{grid-template-columns:1fr}
  .span-2{grid-column:auto}
  .filterbar>:where(input:not([type="hidden"]),select),.inline-form>:where(input:not([type="hidden"]),select){width:100%;min-width:0;flex-basis:100%}
  .order-filter-panel{grid-template-columns:1fr;padding:.7rem}
  .order-filter-search,.order-filter-actions{grid-column:auto}
  .order-stats{grid-template-columns:1fr}
  .order-tabs{position:static}
  .order-register-card{padding:.75rem}
  .order-checkout{padding:.8rem}
  .order-checkout .form-section{padding:.8rem}
  .target-total-box{grid-template-columns:1fr}
  .target-total-box .btn{width:100%}
  .scan-search-row{flex-direction:column;align-items:stretch}
  .scan-search-row .btn{width:100%}
  .purchase-entry-table tr{grid-template-columns:1fr}
  .purchase-entry-table td:first-child,.purchase-entry-table .purchase-row-action{grid-column:auto}
  .purchase-submitbar{position:static;flex-direction:column;align-items:stretch}
  .purchase-submitbar>div{display:grid;grid-template-columns:1fr}
  .purchase-submitbar .btn{width:100%}
  .summary-input input{width:110px}
}

/* ========================================================================== 
   POS client-requested fixes — 2026-07
   ========================================================================== */
.pos-wrap.pos-v2{
  grid-template-columns:minmax(0,1.04fr) minmax(430px,.96fr);
  gap:16px;
}
.pos-search,.pos-cart{min-width:0;overflow:hidden}
.pos-search>.card-head,.pos-cart>.card-head{margin-bottom:.75rem}
.pos-results.product-grid-results{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(145px,1fr));
  align-content:start;
  gap:10px;
  max-height:calc(100vh - 330px);
  min-height:180px;
  overflow:auto;
  padding:2px 5px 6px 2px;
  scrollbar-gutter:stable;
}
.pos-results.is-loading{opacity:.58;pointer-events:none}
.product-tile{min-width:0;height:100%;min-height:190px}
.product-tile img,.product-tile .tile-placeholder{height:96px;flex:0 0 96px}
.product-tile .tile-copy{min-width:0;flex:1;padding:9px;gap:3px}
.product-tile .tile-copy strong{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  min-height:2.15em;
  line-height:1.1;
  overflow-wrap:anywhere;
}
.product-tile .tile-copy small{
  display:block;
  min-height:2.25em;
  line-height:1.15;
  overflow-wrap:anywhere;
}
.tile-stock-price{display:flex;align-items:flex-end;justify-content:space-between;gap:6px;flex-wrap:wrap}
.tile-stock-price b{font-size:.84rem;color:var(--text,#17231e)}
.tile-stock-price span{font-size:.75rem;color:var(--muted)}
.product-tile em{margin-top:auto}

/* The old rule made this outer container a four-column grid and squeezed the
   nested six-card grid into only one column. Keep one outer column instead. */
.pos-customer-history{
  display:block;
  width:100%;
  min-width:0;
  margin:10px 0 4px;
  padding:12px;
  border:1px solid #d8e7df;
  border-radius:12px;
  background:linear-gradient(145deg,#f5faf7,#fbfdfc);
  overflow:hidden;
}
.pos-customer-history[hidden]{display:none!important}
.pos-customer-history.is-loading{opacity:.55}
.pos-customer-history>div{padding:0}
.pos-customer-history .pos-customer-primary{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(105px,1fr));
  gap:8px;
  width:100%;
}
.pos-customer-history .pos-history-stat{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  min-width:0;
  min-height:72px;
  padding:9px 10px;
  border:1px solid #e0ebe5;
  border-radius:9px;
  background:#fff;
}
.pos-customer-history .pos-history-stat span{
  display:block;
  color:var(--muted);
  font-size:.72rem;
  line-height:1.25;
  white-space:normal;
  word-break:normal;
  overflow-wrap:break-word;
  hyphens:none;
}
.pos-customer-history .pos-history-stat strong{
  display:block;
  margin-top:6px;
  color:var(--tea-deep,#0a4938);
  font-size:1rem;
  line-height:1.1;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.pos-customer-history .pos-history-note{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  width:100%;
  margin-top:9px;
  padding:9px 10px;
  border-radius:9px;
  background:#eaf4ef;
  color:#365a4c;
  font-size:.78rem;
  line-height:1.35;
}
.pos-customer-history .pos-history-note span,
.pos-customer-history .pos-history-note strong{
  display:block;
  min-width:0;
  font-size:inherit;
  word-break:normal;
  overflow-wrap:break-word;
}
.pos-customer-history .pos-history-note strong{text-align:right;color:var(--tea-deep,#0a4938)}

.pos-cart .table-wrap{max-width:100%}
.pos-cart-table{min-width:610px}
.pos-cart-table th,.pos-cart-table td{vertical-align:middle}
.pos-cart-table .wrap-cell{min-width:150px;white-space:normal}
.pos-cart-table .pos-line-price{width:92px;text-align:right}
.pos-cart-table .qinput{width:58px}
.customer-picker{display:flex;align-items:end;gap:10px;flex-wrap:wrap}
.customer-picker .field{flex:1 1 260px;margin:0}
.customer-picker .btn{flex:0 0 auto}
.payment-row>*{min-width:0;width:100%}
.payment-row button{width:auto}

@media(max-width:1100px){
  .pos-wrap.pos-v2{grid-template-columns:minmax(0,1fr) minmax(390px,.9fr)}
  .pos-results.product-grid-results{grid-template-columns:repeat(auto-fill,minmax(132px,1fr))}
}
@media(max-width:940px){
  .pos-wrap.pos-v2{grid-template-columns:1fr}
  .pos-results.product-grid-results{max-height:520px;grid-template-columns:repeat(auto-fill,minmax(145px,1fr))}
  .pos-cart{overflow:visible}
}
@media(max-width:620px){
  .pos-toolbar{align-items:stretch}
  .pos-toolbar>div,.pos-toolbar .row-actions{width:100%}
  .pos-toolbar .row-actions .btn{flex:1}
  .compact-grid.grid-2{grid-template-columns:1fr}
  .scan-search-row{flex-direction:column;align-items:stretch}
  .scan-camera-btn{width:100%}
  .pos-results.product-grid-results{
    grid-template-columns:repeat(2,minmax(0,1fr));
    max-height:none;
    min-height:0;
  }
  .pos-customer-history .pos-customer-primary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .pos-customer-history .pos-history-note{align-items:flex-start;flex-direction:column}
  .pos-customer-history .pos-history-note strong{text-align:left}
  .customer-picker{align-items:stretch}
  .customer-picker .field,.customer-picker .btn{width:100%;flex-basis:100%}
}
@media(max-width:390px){
  .pos-results.product-grid-results{grid-template-columns:1fr}
  .product-tile{min-height:174px}
  .pos-customer-history .pos-customer-primary{grid-template-columns:1fr}
}


/* ========================================================================== 
   POS cart alignment, editable prices and expanded courier history — 2026-07-21
   ========================================================================== */
.pos-cart .table-wrap{
  width:100%;
  overflow-x:auto;
  scrollbar-gutter:stable;
}
.pos-cart-table{
  width:100%;
  min-width:640px;
  table-layout:fixed;
}
.pos-cart-table col.pos-col-qty{width:150px}
.pos-cart-table col.pos-col-price{width:105px}
.pos-cart-table col.pos-col-total{width:110px}
.pos-cart-table col.pos-col-action{width:44px}
.pos-cart-table th,.pos-cart-table td{box-sizing:border-box}
.pos-cart-table .pos-product-head,.pos-cart-table .pos-product-cell{text-align:left}
.pos-cart-table .pos-qty-head,.pos-cart-table .pos-qty-cell{text-align:center!important}
.pos-cart-table .pos-price-head,.pos-cart-table .pos-price-cell,
.pos-cart-table .pos-total-head,.pos-cart-table .pos-line-total{text-align:right!important}
.pos-cart-table .pos-action-head,.pos-cart-table .pos-action-cell{text-align:center!important}
.pos-cart-table .pos-qty-cell .qty{
  display:flex;
  width:100%;
  justify-content:center;
}
.pos-cart-table .pos-line-price{
  display:block;
  width:100%;
  max-width:96px;
  min-width:0;
  margin-left:auto;
  text-align:right;
  font-variant-numeric:tabular-nums;
}
.pos-cart-table .pos-line-price:not(:focus){background:#fff}
.pos-cart-table .pos-line-total{font-variant-numeric:tabular-nums;white-space:nowrap}
.pos-cart-table .pos-action-cell .btn{margin-inline:auto}

.pos-customer-history{
  padding:16px;
  overflow:visible;
}
.pos-courier-history-block{
  width:100%;
  min-width:0;
  margin-top:12px;
  padding:13px;
  border:1px solid #d4e5dc;
  border-radius:12px;
  background:#fff;
  box-shadow:0 5px 16px rgba(18,72,53,.045);
}
.pos-courier-history-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.pos-courier-history-heading>div:first-child span,
.pos-courier-rate span{
  display:block;
  color:var(--muted);
  font-size:.72rem;
  line-height:1.25;
}
.pos-courier-history-heading>div:first-child strong{
  display:block;
  margin-top:3px;
  color:var(--tea-deep,#0a4938);
  font-size:1rem;
}
.pos-courier-rate{
  flex:0 0 auto;
  min-width:105px;
  padding:8px 10px;
  border-radius:9px;
  background:#eaf5ef;
  text-align:right;
}
.pos-courier-rate strong{
  display:block;
  margin-top:2px;
  color:var(--tea-deep,#0a4938);
  font-size:1.15rem;
}
.pos-courier-summary-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-bottom:10px;
}
.pos-courier-summary-grid>div{
  min-width:0;
  padding:8px 9px;
  border:1px solid #e2ebe6;
  border-radius:9px;
  background:#f8fbf9;
}
.pos-courier-summary-grid span{
  display:block;
  color:var(--muted);
  font-size:.69rem;
  line-height:1.2;
  overflow-wrap:anywhere;
}
.pos-courier-summary-grid strong{
  display:block;
  margin-top:5px;
  color:var(--tea-deep,#0a4938);
  font-size:1rem;
  font-variant-numeric:tabular-nums;
}
.pos-courier-history-table-wrap{
  width:100%;
  max-height:310px;
  overflow:auto;
  border:1px solid #e0e9e4;
  border-radius:10px;
  scrollbar-gutter:stable;
}
.pos-courier-history-table{
  width:100%;
  min-width:620px;
  margin:0;
  table-layout:auto;
}
.pos-courier-history-table thead th{
  position:sticky;
  top:0;
  z-index:1;
  background:#f0f6f3;
  box-shadow:0 1px #dce7e1;
  white-space:nowrap;
}
.pos-courier-history-table th,
.pos-courier-history-table td{
  padding:8px 9px;
  vertical-align:middle;
}
.pos-courier-history-table tbody tr:nth-child(even){background:#fbfdfc}
.pos-history-empty{
  margin:0;
  padding:18px 10px;
  text-align:center;
  border:1px dashed #d8e5de;
  border-radius:9px;
  background:#fafcfb;
}

@media(max-width:620px){
  .pos-cart-table{min-width:610px}
  .pos-cart-table col.pos-col-qty{width:145px}
  .pos-customer-history{padding:11px}
  .pos-courier-history-block{padding:10px}
  .pos-courier-history-heading{align-items:stretch;flex-direction:column}
  .pos-courier-rate{text-align:left;width:100%}
  .pos-courier-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:390px){
  .pos-courier-summary-grid{grid-template-columns:1fr 1fr}
}

/* ========================================================================== 
   BDCourier phone verification in Settings, POS and Orders — 2026-07-21
   ========================================================================== */
.courier-enable-card{margin-bottom:14px}
.courier-settings-grid{margin:12px 0}
.courier-secret-row{
  display:flex;
  align-items:stretch;
  gap:12px;
  margin-top:12px;
}
.courier-secret-row>.field{margin:0}
.check-card.compact{padding:10px 12px;min-width:235px}
.check-card.danger-soft{background:#fff7f7;border-color:#f1cccc}
.check-card.danger-soft:hover{background:#fff1f1;border-color:#eab4b4}
.check-card.danger-soft strong{color:#9f2828}
.courier-api-test-box{
  display:grid;
  grid-template-columns:minmax(220px,1fr) minmax(280px,auto);
  gap:12px 18px;
  align-items:end;
  margin:16px 0;
  padding:14px;
  border:1px solid #d4e3dc;
  border-radius:13px;
  background:#f8fbf9;
}
.courier-api-test-box>div:first-child{display:flex;flex-direction:column;gap:3px}
.courier-api-test-box>div:first-child strong{color:var(--tea-deep,#0a4938)}
.courier-api-test-box>div:first-child small{color:var(--muted)}
.courier-api-test-controls{display:flex;gap:8px;align-items:center}
.courier-api-test-controls input{min-width:180px;flex:1}
.courier-api-test-result{
  grid-column:1/-1;
  padding:10px 12px;
  border-radius:9px;
  border:1px solid var(--border);
  font-size:.86rem;
  overflow-wrap:anywhere;
}
.courier-api-test-result.is-loading{background:#f3f7f5;color:var(--muted)}
.courier-api-test-result.is-success{background:#eaf8ef;border-color:#bfe2cc;color:#17653a}
.courier-api-test-result.is-error{background:#fff0f0;border-color:#ecc2c2;color:#9b2727}

.pos-courier-check-bar{
  display:flex;
  gap:9px;
  align-items:end;
  margin:10px 0 2px;
  padding:10px;
  border:1px solid #d8e7df;
  border-radius:11px;
  background:#f8fbf9;
}
.pos-courier-check-bar .field{margin:0;min-width:210px}
.pos-courier-check-message{min-width:110px;padding-bottom:9px;color:var(--muted)}
.pos-courier-check-message.is-loading{color:#6b7280}
.pos-courier-check-message.is-success{color:#177245;font-weight:700}
.pos-courier-check-message.is-error{color:#a12b2b;font-weight:700}

.pos-courier-heading-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
.pos-courier-history-heading>div:first-child small,
.courier-risk-heading small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:.76rem;
}
.courier-result-meta{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px 12px;
  margin:0 0 10px;
  padding:8px 10px;
  border-radius:9px;
  background:#f5f8f6;
  color:var(--muted);
  font-size:.75rem;
}
.courier-result-meta b{color:var(--text)}
.courier-result-meta .badge{margin-left:auto;white-space:nowrap}
.courier-api-warning{
  display:flex;
  flex-direction:column;
  gap:3px;
  margin:9px 0 11px;
  padding:10px 12px;
  border:1px solid #efd39b;
  border-radius:9px;
  background:#fff9ea;
  color:#745315;
  font-size:.8rem;
}
.courier-api-warning span{overflow-wrap:anywhere}
.courier-provider-cell{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:145px;
}
.courier-provider-logo,
.courier-provider-placeholder{
  width:30px;
  height:30px;
  flex:0 0 30px;
  border-radius:7px;
}
.courier-provider-logo{
  display:block;
  padding:2px;
  border:1px solid #e1e8e4;
  background:#fff;
  object-fit:contain;
}
.courier-provider-placeholder{
  display:grid;
  place-items:center;
  background:#e8f2ed;
  color:var(--tea-deep,#0a4938);
  font-size:.78rem;
  font-weight:800;
}
.courier-provider-cell strong{min-width:0;overflow-wrap:anywhere}
.courier-report-alert{
  margin-top:12px;
  padding:12px;
  border:1px solid #e8b8b8;
  border-radius:11px;
  background:#fff7f7;
  color:#7f2424;
}
.courier-report-alert-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.courier-report-alert>p{margin:5px 0 10px;font-size:.8rem}
.courier-report-list{display:grid;gap:7px}
.courier-report-item{
  display:flex;
  gap:9px;
  align-items:flex-start;
  padding:9px;
  border-radius:8px;
  background:#fff;
  border:1px solid #f0d3d3;
}
.courier-report-item>img{width:30px;height:30px;flex:0 0 30px;object-fit:contain;border-radius:6px}
.courier-report-item>div{display:flex;min-width:0;flex-direction:column;gap:2px}
.courier-report-item span,.courier-report-item small{font-size:.73rem;color:#8b5a5a}
.courier-report-item p{margin:2px 0;font-size:.79rem;overflow-wrap:anywhere}

.order-courier-check-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin:10px 0 0;
}
.order-courier-check-actions small{color:var(--muted)}
.courier-risk-panel{
  min-height:0;
  margin:12px 0 0;
  padding:14px;
  overflow:hidden;
  border-color:#d5e5dd;
  box-shadow:0 5px 16px rgba(18,72,53,.035);
}
.courier-risk-heading>div{min-width:0}
.courier-loading{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  min-height:64px;
  color:var(--muted);
}
.courier-loading .spinner{
  width:18px;
  height:18px;
  border:2px solid #cbd8d2;
  border-top-color:var(--primary);
  border-radius:50%;
  animation:courier-spin .75s linear infinite;
}
@keyframes courier-spin{to{transform:rotate(360deg)}}
.courier-summary-cards-expanded{
  grid-template-columns:repeat(5,minmax(100px,1fr));
  margin:10px 0 12px;
}
.courier-summary-cards-expanded span{
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  gap:5px;
  min-height:62px;
}
.courier-summary-cards-expanded b{
  color:var(--tea-deep,#0a4938);
  font-size:1.05rem;
  font-variant-numeric:tabular-nums;
}
.courier-history-table-wrap{
  width:100%;
  max-height:330px;
  overflow:auto;
  border:1px solid #e0e9e4;
  border-radius:10px;
  scrollbar-gutter:stable;
}
.courier-history-table{
  width:100%;
  min-width:650px;
  margin:0;
}
.courier-history-table thead th{
  position:sticky;
  top:0;
  z-index:1;
  background:#f0f6f3;
  white-space:nowrap;
}
.courier-history-table tbody tr:nth-child(even){background:#fbfdfc}
.courier-history-empty{margin:0;padding:18px;text-align:center;border:1px dashed var(--border);border-radius:9px}
.courier-history-card{min-width:0;overflow:hidden}
.courier-history-card .card-head{align-items:center}
.courier-history-card .courier-summary-cards-expanded{grid-template-columns:repeat(2,minmax(0,1fr))}
.courier-history-card .courier-summary-cards-expanded span:last-child{grid-column:1/-1}
.courier-history-card .courier-history-table-wrap{max-height:360px}


/* --- Professional courier history styling: POS + Orders --- */
.pos-courier-history-block,
.courier-risk-panel,
.courier-history-card{
  border:1px solid #d6e5dd;
  border-radius:16px;
  background:linear-gradient(180deg,#ffffff 0%,#fbfdfc 100%);
  box-shadow:0 12px 28px rgba(12,78,52,.06);
}
.pos-courier-history-block{padding:14px}
.courier-risk-panel{padding:14px}
.courier-history-card .card-head,
.pos-courier-history-heading{
  position:relative;
}
.courier-result-meta{
  margin-top:2px;
  padding:10px 12px;
  border:1px solid #e2ece7;
  border-radius:12px;
  background:#f7faf8;
}
.courier-result-meta .badge{
  border:1px solid #d9e5de;
  background:#eef6f1;
  color:#275946;
  font-weight:700;
}
.courier-summary-cards-expanded span,
.pos-courier-summary-grid>div{
  position:relative;
  overflow:hidden;
  padding:12px 13px;
  border:1px solid #dfeae4;
  border-radius:14px;
  background:linear-gradient(180deg,#ffffff 0%,#f6faf8 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
}
.courier-summary-cards-expanded span::after,
.pos-courier-summary-grid>div::after{
  content:"";
  position:absolute;
  inset:auto -18px -18px auto;
  width:56px;
  height:56px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(17,114,76,.12),rgba(17,114,76,0));
}
.courier-summary-cards-expanded b,
.pos-courier-summary-grid strong{
  font-size:1.15rem;
  font-weight:800;
}
.pos-courier-history-table-wrap,
.courier-history-table-wrap{
  width:100%;
  max-height:360px;
  overflow:auto;
  border:1px solid #dce8e1;
  border-radius:14px;
  background:#fff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
  scrollbar-gutter:stable;
}
.pos-courier-history-table,
.courier-history-table{
  width:100%;
  min-width:680px;
  margin:0;
  border-collapse:separate;
  border-spacing:0;
}
.pos-courier-history-table thead th,
.courier-history-table thead th{
  position:sticky;
  top:0;
  z-index:2;
  padding:12px 14px;
  background:linear-gradient(180deg,#f5faf7 0%,#edf5f0 100%);
  color:#5f7569;
  font-size:.73rem;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
  border-bottom:1px solid #dce8e1;
  white-space:nowrap;
}
.pos-courier-history-table td,
.courier-history-table td{
  padding:12px 14px;
  vertical-align:middle;
  border-bottom:1px solid #edf3ef;
}
.pos-courier-history-table tbody tr:nth-child(even),
.courier-history-table tbody tr:nth-child(even){background:#fbfdfc}
.pos-courier-history-table tbody tr:hover,
.courier-history-table tbody tr:hover{background:#f6fbf8}
.pos-courier-history-table tbody tr:last-child td,
.courier-history-table tbody tr:last-child td{border-bottom:none}
.courier-provider-cell{
  display:flex;
  align-items:center;
  gap:11px;
  min-width:180px;
}
.courier-logo-shell{
  position:relative;
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  flex:0 0 42px;
  border-radius:12px;
  border:1px solid #dce8e1;
  background:linear-gradient(180deg,#ffffff 0%,#f3f8f5 100%);
  box-shadow:0 6px 14px rgba(18,72,53,.06);
  overflow:hidden;
}
.courier-provider-logo,
.courier-provider-placeholder{
  width:28px;
  height:28px;
  flex:0 0 28px;
  border-radius:8px;
}
.courier-provider-logo{
  display:block;
  padding:0;
  border:0;
  background:transparent;
  object-fit:contain;
}
.courier-provider-placeholder{
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#dff3e9,#d7ece3);
  color:var(--tea-deep,#0a4938);
  font-size:.82rem;
  font-weight:800;
}
.courier-provider-copy{
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:3px;
}
.courier-provider-cell strong{
  min-width:0;
  overflow-wrap:anywhere;
  color:#173f33;
  font-size:.93rem;
  font-weight:800;
}
.courier-provider-copy small{
  color:#7b8f84;
  font-size:.72rem;
  line-height:1.2;
}
.courier-rate-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:84px;
  padding:6px 11px;
  border-radius:999px;
  font-size:.8rem;
  font-weight:800;
  letter-spacing:.01em;
}
.courier-rate-pill.is-good{background:#e8f8ee;color:#137a47;border:1px solid #c7e9d5}
.courier-rate-pill.is-mid{background:#fff6dc;color:#a46d00;border:1px solid #f0df9d}
.courier-rate-pill.is-low{background:#fff0f0;color:#bf3f3f;border:1px solid #efc4c4}
.courier-report-alert{
  margin-top:14px;
  padding:14px;
  border-radius:14px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.6);
}
.courier-report-item{
  align-items:center;
  padding:10px 11px;
  border-radius:12px;
  background:#fff;
}
.courier-report-item>.courier-logo-shell{width:38px;height:38px;flex-basis:38px}
.courier-report-item>.courier-logo-shell .courier-provider-logo,
.courier-report-item>.courier-logo-shell .courier-provider-placeholder{width:24px;height:24px}

@media(max-width:900px){
  .courier-settings-grid.grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .courier-api-test-box{grid-template-columns:1fr}
  .courier-api-test-result{grid-column:auto}
  .courier-summary-cards-expanded{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:620px){
  .courier-secret-row{flex-direction:column}
  .check-card.compact{min-width:0}
  .courier-api-test-controls{align-items:stretch;flex-direction:column}
  .courier-api-test-controls .btn{width:100%}
  .pos-courier-check-bar{align-items:stretch;flex-direction:column}
  .pos-courier-check-bar .field,.pos-courier-check-bar .btn{width:100%}
  .pos-courier-check-message{min-width:0;padding:0}
  .pos-courier-heading-actions{align-items:stretch;flex-direction:column;width:100%}
  .pos-courier-heading-actions .btn{width:100%}
  .courier-result-meta{align-items:flex-start;flex-direction:column}
  .courier-result-meta .badge{margin-left:0}
  .courier-summary-cards-expanded{grid-template-columns:repeat(2,minmax(0,1fr))}
  .courier-history-card .courier-summary-cards-expanded{grid-template-columns:repeat(2,minmax(0,1fr))}
  .courier-history-card .courier-summary-cards-expanded span:last-child{grid-column:auto}
  .pos-courier-history-table,.courier-history-table{min-width:620px}
}
@media(max-width:480px){
  .courier-provider-cell{min-width:150px;gap:9px}
  .courier-logo-shell{width:38px;height:38px;flex-basis:38px}
  .courier-provider-logo,.courier-provider-placeholder{width:24px;height:24px}
  .courier-rate-pill{min-width:74px;padding:5px 9px;font-size:.76rem}
}
@media(max-width:390px){
  .courier-settings-grid.grid-4,.courier-summary-cards-expanded{grid-template-columns:1fr}
  .courier-history-card .courier-summary-cards-expanded{grid-template-columns:1fr}
}

/* ========================================================================== 
   Professional Courier Delivery History UI — POS + Orders — 2026-07-21
   ========================================================================== */
.courier-risk-panel,
.pos-courier-history-block,
.courier-history-card.courier-insight-panel{
  min-width:0;
  border:1px solid #d7e6de;
  border-radius:18px;
  background:
    radial-gradient(circle at 100% 0,rgba(20,143,91,.075),transparent 34%),
    linear-gradient(180deg,#fff 0%,#fbfdfc 100%);
  box-shadow:0 14px 34px rgba(16,77,55,.08);
}
.courier-risk-panel{
  margin-top:14px;
  padding:16px;
  overflow:hidden;
}
.pos-courier-history-block{
  margin-top:12px;
  padding:15px;
}
.courier-history-card.courier-insight-panel{
  overflow:hidden;
}

.courier-panel-hero{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:1px 1px 14px;
  border-bottom:1px solid #e7efeb;
}
.courier-panel-title{
  display:flex;
  align-items:center;
  min-width:0;
  gap:12px;
}
.courier-panel-title>div{min-width:0}
.courier-panel-title h3{
  margin:0;
  color:#123f32;
  font-size:1.02rem;
  line-height:1.25;
  letter-spacing:-.01em;
}
.courier-panel-icon{
  display:grid;
  place-items:center;
  width:48px;
  height:48px;
  flex:0 0 48px;
  border-radius:15px;
  background:linear-gradient(145deg,#0c8a5b,#076b48);
  color:#fff;
  box-shadow:0 10px 22px rgba(7,107,72,.24);
}
.courier-panel-icon svg{
  width:25px;
  height:25px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.courier-phone-chip{
  display:inline-flex;
  align-items:center;
  gap:5px;
  max-width:100%;
  margin-top:6px;
  padding:4px 9px;
  border:1px solid #dbe9e2;
  border-radius:999px;
  background:#f5faf7;
  color:#587064;
  font-size:.72rem;
  font-weight:700;
  line-height:1;
  font-variant-numeric:tabular-nums;
}
.courier-phone-chip svg{
  width:13px;
  height:13px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.courier-panel-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  flex:0 0 auto;
}
.courier-refresh-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:38px;
  border-color:#d6e4dd;
  background:#fff;
  color:#234f41;
  box-shadow:0 5px 14px rgba(25,76,57,.055);
  white-space:nowrap;
}
.courier-refresh-btn:hover{
  border-color:#a9d2bf;
  background:#f3faf6;
}
.courier-refresh-btn svg{
  width:16px;
  height:16px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.courier-score-ring{
  --score:0;
  --score-color:#178a58;
  position:relative;
  display:grid;
  place-items:center;
  width:88px;
  height:88px;
  flex:0 0 88px;
  border-radius:50%;
  background:conic-gradient(var(--score-color) calc(var(--score) * 1%),#e8efeb 0);
  box-shadow:0 8px 20px rgba(18,75,55,.08);
}
.courier-score-ring::before{
  content:"";
  position:absolute;
  inset:7px;
  border-radius:50%;
  background:#fff;
  box-shadow:inset 0 0 0 1px #edf2ef;
}
.courier-score-ring>div{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  text-align:center;
}
.courier-score-ring strong{
  color:#123f32;
  font-size:1rem;
  line-height:1;
  font-variant-numeric:tabular-nums;
}
.courier-score-ring span{
  max-width:60px;
  margin-top:4px;
  color:#71867b;
  font-size:.58rem;
  line-height:1.12;
}
.courier-score-ring.is-good{--score-color:#17935b}
.courier-score-ring.is-mid{--score-color:#d69a1e}
.courier-score-ring.is-low{--score-color:#d55353}
.courier-score-ring.is-neutral{--score-color:#9aa9a1}

.courier-meta-strip{
  display:grid;
  grid-template-columns:minmax(150px,.8fr) minmax(220px,1.25fr) auto;
  align-items:center;
  gap:10px;
  margin:13px 0;
  padding:10px 11px;
  border:1px solid #e4ede8;
  border-radius:13px;
  background:rgba(247,250,248,.92);
}
.courier-meta-item{
  display:flex;
  align-items:center;
  min-width:0;
  gap:8px;
}
.courier-meta-item>i{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  flex:0 0 30px;
  border-radius:9px;
  background:#e9f4ee;
  color:#1d7754;
  font-style:normal;
}
.courier-meta-item svg{
  width:15px;
  height:15px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.courier-meta-item>span{
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:2px;
}
.courier-meta-item small{
  color:#7d9187;
  font-size:.65rem;
  line-height:1;
}
.courier-meta-item strong{
  overflow:hidden;
  color:#294f43;
  font-size:.74rem;
  font-weight:750;
  line-height:1.2;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.courier-result-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:30px;
  padding:5px 10px;
  border:1px solid #dce8e2;
  border-radius:999px;
  background:#fff;
  color:#5b7066;
  font-size:.69rem;
  font-weight:750;
  white-space:nowrap;
}
.courier-result-chip>i{
  width:7px;
  height:7px;
  border-radius:50%;
  background:#91a39a;
  box-shadow:0 0 0 3px rgba(145,163,154,.12);
}
.courier-result-chip.is-live{
  border-color:#cce9d9;
  background:#f3fbf6;
  color:#167347;
}
.courier-result-chip.is-live>i{
  background:#20a765;
  box-shadow:0 0 0 3px rgba(32,167,101,.12);
}
.courier-result-chip.is-cached{
  border-color:#e6e0c8;
  background:#fffdf4;
  color:#806b24;
}
.courier-result-chip.is-cached>i{
  background:#c5a23b;
  box-shadow:0 0 0 3px rgba(197,162,59,.13);
}

.courier-stat-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin:0 0 13px;
}
.courier-stat-card{
  display:flex;
  align-items:center;
  min-width:0;
  gap:10px;
  min-height:76px;
  padding:11px 12px;
  border:1px solid #e2ebe6;
  border-radius:14px;
  background:#fff;
  box-shadow:0 6px 16px rgba(17,66,49,.045);
}
.courier-stat-icon{
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  flex:0 0 38px;
  border-radius:12px;
}
.courier-stat-icon svg{
  width:19px;
  height:19px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.courier-stat-card>div{
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:4px;
}
.courier-stat-card small{
  color:#70847a;
  font-size:.68rem;
  line-height:1.16;
  overflow-wrap:anywhere;
}
.courier-stat-card strong{
  color:#153f33;
  font-size:1.12rem;
  line-height:1;
  font-variant-numeric:tabular-nums;
}
.courier-stat-card.is-total .courier-stat-icon{background:#eaf2ff;color:#3972c6}
.courier-stat-card.is-success .courier-stat-icon{background:#e7f8ee;color:#148653}
.courier-stat-card.is-failed .courier-stat-icon{background:#fff0f0;color:#cf4c4c}
.courier-stat-card.is-processing .courier-stat-icon{background:#fff6df;color:#b98212}

.courier-provider-scroll{
  width:100%;
  max-height:520px;
  overflow-x:hidden;
  overflow-y:auto;
  padding:2px 4px 2px 2px;
  scrollbar-gutter:stable;
  overscroll-behavior:contain;
}
.courier-provider-scroll::-webkit-scrollbar{width:8px}
.courier-provider-scroll::-webkit-scrollbar-track{background:#eef4f1;border-radius:999px}
.courier-provider-scroll::-webkit-scrollbar-thumb{background:#b8cec3;border:2px solid #eef4f1;border-radius:999px}
.courier-provider-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.courier-provider-card{
  min-width:0;
  padding:12px;
  border:1px solid #dde9e3;
  border-radius:15px;
  background:#fff;
  box-shadow:0 7px 18px rgba(19,70,52,.05);
  transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease;
}
.courier-provider-card:hover{
  transform:translateY(-1px);
  border-color:#bad7c9;
  box-shadow:0 10px 24px rgba(19,70,52,.085);
}
.courier-provider-card.is-neutral{
  background:#fbfcfb;
  opacity:.84;
}
.courier-provider-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-width:0;
  gap:10px;
}
.courier-provider-cell{
  display:flex;
  align-items:center;
  min-width:0;
  gap:10px;
}
.courier-logo-shell{
  position:relative;
  display:grid;
  place-items:center;
  width:62px;
  height:44px;
  flex:0 0 62px;
  overflow:hidden;
  border:1px solid #dce8e1;
  border-radius:12px;
  background:linear-gradient(180deg,#fff,#f5f8f6);
  box-shadow:0 5px 13px rgba(18,72,53,.055);
}
.courier-provider-logo{
  display:block;
  width:52px;
  height:30px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  object-fit:contain;
}
.courier-provider-placeholder{
  display:grid;
  place-items:center;
  width:32px;
  height:32px;
  border-radius:10px;
  background:linear-gradient(135deg,#dff3e9,#d5e9df);
  color:#155d42;
  font-size:.86rem;
  font-weight:850;
}
.courier-provider-copy{
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:3px;
}
.courier-provider-copy strong{
  overflow:hidden;
  color:#173f33;
  font-size:.9rem;
  font-weight:800;
  line-height:1.18;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.courier-provider-copy small{
  color:#7b8f84;
  font-size:.67rem;
  line-height:1.2;
}
.courier-rate-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:70px;
  padding:6px 9px;
  border:1px solid transparent;
  border-radius:999px;
  font-size:.75rem;
  font-weight:850;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.courier-rate-pill.is-good{border-color:#c7e9d5;background:#e8f8ee;color:#137a47}
.courier-rate-pill.is-mid{border-color:#f0df9d;background:#fff6dc;color:#9a6800}
.courier-rate-pill.is-low{border-color:#efc4c4;background:#fff0f0;color:#b93a3a}
.courier-rate-pill.is-neutral{border-color:#dfe6e2;background:#f1f4f2;color:#77867e}
.courier-progress-track{
  height:6px;
  margin:11px 0;
  overflow:hidden;
  border-radius:999px;
  background:#edf2ef;
}
.courier-progress-track>span{
  display:block;
  height:100%;
  border-radius:inherit;
  background:#1b955d;
  transition:width .25s ease;
}
.courier-provider-card.is-mid .courier-progress-track>span{background:#d49a24}
.courier-provider-card.is-low .courier-progress-track>span{background:#d35454}
.courier-provider-card.is-neutral .courier-progress-track>span{background:#aab6b0}
.courier-provider-metrics{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
}
.courier-provider-metrics>span{
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:4px;
  padding:7px 8px;
  border-radius:10px;
  background:#f7faf8;
}
.courier-provider-metrics small{
  min-height:2.25em;
  color:#788b81;
  font-size:.61rem;
  line-height:1.12;
  overflow-wrap:anywhere;
}
.courier-provider-metrics strong{
  color:#1d493b;
  font-size:.88rem;
  line-height:1;
  font-variant-numeric:tabular-nums;
}

.courier-report-alert{
  margin-top:13px;
  padding:13px;
  border:1px solid #edc0c0;
  border-radius:14px;
  background:linear-gradient(180deg,#fff9f9,#fff4f4);
  box-shadow:none;
}
.courier-report-item{
  align-items:center;
  padding:10px;
  border-radius:12px;
}
.courier-report-item>.courier-logo-shell{
  width:54px;
  height:40px;
  flex-basis:54px;
}
.courier-report-item>.courier-logo-shell .courier-provider-logo{width:46px;height:26px}

.pos-courier-history-block .courier-panel-hero,
.courier-history-card .courier-panel-hero{
  align-items:stretch;
  flex-direction:column;
}
.pos-courier-history-block .courier-panel-actions,
.courier-history-card .courier-panel-actions{
  justify-content:space-between;
}
.pos-courier-history-block .courier-stat-grid,
.courier-history-card .courier-stat-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.pos-courier-history-block .courier-provider-grid,
.courier-history-card .courier-provider-grid{
  grid-template-columns:1fr;
}
.pos-courier-history-block .courier-provider-scroll,
.courier-history-card .courier-provider-scroll{
  max-height:430px;
}
.courier-history-card .courier-meta-strip{
  grid-template-columns:1fr;
}
.courier-history-card .courier-result-chip{
  justify-self:start;
}

@media(max-width:760px){
  .courier-panel-hero{
    align-items:stretch;
    flex-direction:column;
  }
  .courier-panel-actions{justify-content:space-between}
  .courier-meta-strip{grid-template-columns:1fr 1fr}
  .courier-result-chip{justify-self:start}
  .courier-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .courier-provider-grid{grid-template-columns:1fr}
  .order-create-page .courier-risk-panel .courier-provider-metrics{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:5px;
  }
}
@media(max-width:480px){
  .courier-risk-panel,.pos-courier-history-block{padding:12px;border-radius:15px}
  .courier-panel-icon{width:43px;height:43px;flex-basis:43px;border-radius:13px}
  .courier-panel-icon svg{width:22px;height:22px}
  .courier-panel-actions{align-items:center}
  .courier-score-ring{width:80px;height:80px;flex-basis:80px}
  .courier-score-ring strong{font-size:.92rem}
  .courier-meta-strip{grid-template-columns:1fr}
  .courier-stat-grid{gap:8px}
  .courier-stat-card{min-height:70px;padding:9px}
  .courier-stat-icon{width:34px;height:34px;flex-basis:34px}
  .courier-provider-card{padding:10px}
  .courier-logo-shell{width:55px;height:40px;flex-basis:55px}
  .courier-provider-logo{width:46px;height:27px}
  .courier-rate-pill{min-width:64px;padding:5px 8px;font-size:.7rem}
  .courier-provider-metrics>span{padding:6px}
}

/* Courier account, automatic booking and webhook configuration */
.courier-account-editor{max-width:1120px;margin-inline:auto;overflow:visible}
.courier-account-head{align-items:flex-start;padding-bottom:18px}
.courier-account-head h2{margin:4px 0 5px}
.courier-account-head p{margin:0;color:var(--muted);max-width:720px}
.courier-account-editor form{display:grid;gap:16px}
.courier-form-section{border:1px solid var(--border);border-radius:16px;padding:18px;background:linear-gradient(180deg,#fff,#fbfdfc)}
.courier-form-section-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:15px}
.courier-form-section-head>div{display:flex;align-items:center;gap:10px}
.courier-form-section-head h3{margin:0;font-size:1rem}
.step-pill{display:grid;place-items:center;width:30px;height:30px;border-radius:10px;background:#e9f6f0;color:#087552;font-weight:800}
.courier-provider-note{margin-top:12px;padding:11px 13px;border-radius:12px;background:#f2f7f5;border:1px dashed #bfd8cf;color:#46625a;font-size:.85rem}
.courier-credential-grid [hidden]{display:none!important}
.courier-webhook-preview p{margin:0 0 12px;color:var(--muted)}
.copy-field{display:flex;align-items:center;gap:8px;padding:8px;border:1px solid var(--border);background:#f6faf8;border-radius:12px}
.copy-field code{min-width:0;flex:1;overflow:auto;white-space:nowrap;padding:4px 7px;color:#075f45;font-size:.82rem}
.courier-account-footer{position:sticky;bottom:10px;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 15px;border:1px solid #c9ded6;border-radius:15px;background:rgba(255,255,255,.96);box-shadow:0 12px 32px rgba(25,66,53,.12);backdrop-filter:blur(10px)}
.courier-account-footer .settings-check-grid{margin:0;flex:1;grid-template-columns:repeat(2,minmax(0,1fr))}
.courier-account-footer>.btn{min-width:190px}
.json-help summary{cursor:pointer;font-weight:700;color:#285449}
.json-help pre{overflow:auto;margin:12px 0 0;padding:13px;border-radius:12px;background:#10241e;color:#d8f4e8;font-size:.78rem}
.settings-section-divider{display:flex;align-items:center;gap:13px;margin:26px 0 16px;padding:15px 16px;border-radius:15px;background:linear-gradient(135deg,#edf8f3,#f9fcfa);border:1px solid #cfe4dc}
.settings-section-divider>span{display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px;border-radius:13px;background:#087552;color:#fff;font-size:1.05rem}
.settings-section-divider>div{min-width:0;flex:1}
.settings-section-divider h3{margin:0 0 3px;font-size:1.02rem}
.settings-section-divider p{margin:0;color:var(--muted);font-size:.84rem}
.courier-automation-toggles{grid-template-columns:repeat(2,minmax(0,1fr))}
.courier-webhook-settings{margin-top:16px;padding:15px;border:1px solid var(--border);border-radius:15px;background:#fbfdfc}
.courier-webhook-settings-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}
.courier-webhook-settings-head>div{display:grid;gap:3px}
.courier-webhook-settings-head small{color:var(--muted)}
.webhook-url-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:12px}
.webhook-url-card{min-width:0;padding:12px;border:1px solid #d8e7e1;border-radius:12px;background:#fff}
.webhook-url-card span{display:block;margin-bottom:7px;font-size:.75rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:#537168}
.webhook-url-card code{display:block;overflow:auto;white-space:nowrap;color:#075f45;font-size:.75rem}
.courier-webhook-settings .alert{margin:0}
@media(max-width:900px){
  .courier-auto-config-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .webhook-url-grid{grid-template-columns:1fr}
  .courier-account-footer{position:static;align-items:stretch;flex-direction:column}
  .courier-account-footer>.btn{width:100%}
}
@media(max-width:640px){
  .courier-form-section{padding:14px}
  .courier-form-section-head{align-items:flex-start;flex-direction:column}
  .courier-automation-toggles,.courier-auto-config-grid,.courier-account-footer .settings-check-grid{grid-template-columns:1fr}
  .settings-section-divider{align-items:flex-start;flex-wrap:wrap}
  .settings-section-divider .btn{width:100%}
  .copy-field{align-items:stretch;flex-direction:column}
  .copy-field .btn{width:100%}
}

/* =========================================================
   Client mobile UX fix — Order Configuration + New Order
   ========================================================= */
.order-config-head{align-items:flex-start}
.order-config-tabs{gap:8px;padding:6px;background:#f5f9f7;border:1px solid #dce8e2;border-radius:14px}
.order-config-tabs a{gap:7px;scroll-snap-align:start}
.order-config-tabs a>span{display:grid;place-items:center;width:24px;height:24px;border-radius:8px;background:rgba(8,117,82,.08);font-size:.82rem}
.order-config-tabs a.active>span{background:rgba(255,255,255,.18)}
.order-config-grid{gap:18px}
.order-config-editor,.order-config-list-card{overflow:visible;border-color:#dbe7e1;box-shadow:0 8px 24px rgba(24,72,56,.055)}
.order-config-form-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:4px}
.order-config-form-footer .btn{min-width:120px}
.order-config-list-card .card-head{border-bottom:1px solid #e5eeea;padding-bottom:13px;margin-bottom:12px}
.responsive-config-table-wrap{border:0!important;border-radius:0!important}
.responsive-config-table td,.responsive-config-table th{vertical-align:middle}
.responsive-config-table code{display:inline-flex;padding:5px 8px;border-radius:8px;background:#edf7f2;color:#087552;font-weight:750}
.config-actions-cell .row-actions{justify-content:flex-end;flex-wrap:nowrap}
.config-actions-cell form{margin:0}
.order-config-options{padding:12px;border:1px solid #dfe9e4;border-radius:12px;background:#f7faf8}

.order-mobile-jump{display:none}
.order-cart-section{scroll-margin-top:90px}
.order-form-section{scroll-margin-top:90px;border:1px solid #dfe9e4;border-radius:14px;padding:0!important;margin-top:14px!important;overflow:hidden;background:#fff}
.order-form-section>summary{display:flex;align-items:center;gap:10px;min-height:52px;padding:12px 14px;cursor:pointer;list-style:none;background:linear-gradient(180deg,#fbfdfc,#f5f9f7);user-select:none}
.order-form-section>summary::-webkit-details-marker{display:none}
.order-form-section>summary h3{flex:1;margin:0!important;font-size:1rem}
.order-section-index{display:grid;place-items:center;width:29px;height:29px;flex:0 0 29px;border-radius:9px;background:#e5f4ed;color:#087552;font-size:.72rem;font-weight:850}
.order-section-chevron{color:#527066;font-size:1rem;transition:transform .2s ease}
.order-form-section[open] .order-section-chevron{transform:rotate(180deg)}
.order-section-body{padding:14px;border-top:1px solid #e4ece8}
.order-section-actions{display:flex;justify-content:flex-end;margin-bottom:10px}
.order-review-section{display:grid;gap:12px;margin-top:15px}
.order-mobile-dock{display:none}

@media(max-width:760px){
  .order-config-head{gap:10px}
  .order-config-head .btn{width:100%}
  .order-config-tabs{position:sticky;top:68px;z-index:15;display:flex;flex-wrap:nowrap;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:none;box-shadow:0 8px 18px rgba(20,62,49,.08)}
  .order-config-tabs::-webkit-scrollbar{display:none}
  .order-config-tabs a{flex:0 0 auto;min-height:42px;padding:8px 11px}
  .order-config-grid{grid-template-columns:1fr}
  .order-config-editor .grid-2,.order-config-editor .grid-3,.order-config-editor .grid-4{grid-template-columns:1fr}
  .order-config-form-footer{position:sticky;bottom:8px;z-index:4;padding:10px;border:1px solid #cfe1d9;border-radius:13px;background:rgba(255,255,255,.96);box-shadow:0 10px 28px rgba(22,66,52,.13);backdrop-filter:blur(8px)}
  .order-config-form-footer .btn{min-width:132px}
  .responsive-config-table-wrap{overflow:visible!important}
  .responsive-config-table,.responsive-config-table tbody{display:block;width:100%}
  .responsive-config-table thead{display:none}
  .responsive-config-table tr{display:grid;grid-template-columns:1fr 1fr;gap:0 12px;margin-bottom:11px;padding:12px;border:1px solid #dce8e2;border-radius:14px;background:linear-gradient(180deg,#fff,#fbfdfc);box-shadow:0 5px 16px rgba(25,70,55,.045)}
  .responsive-config-table td{display:flex;min-width:0;align-items:flex-start;justify-content:space-between;gap:10px;padding:8px 0!important;border:0!important;text-align:right;overflow-wrap:anywhere}
  .responsive-config-table td::before{content:attr(data-label);flex:0 0 auto;color:#72867d;font-size:.69rem;font-weight:800;text-align:left;text-transform:uppercase;letter-spacing:.035em}
  .responsive-config-table td:nth-child(1),.responsive-config-table td:nth-child(2),.responsive-config-table .config-actions-cell{grid-column:1/-1}
  .responsive-config-table td:nth-child(2){display:block;text-align:left}
  .responsive-config-table td:nth-child(2)::before{display:block;margin-bottom:5px}
  .responsive-config-table .config-actions-cell{display:block;padding-top:10px!important;border-top:1px solid #e7eeea!important}
  .responsive-config-table .config-actions-cell::before{display:none}
  .config-actions-cell .row-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .config-actions-cell .row-actions .btn,.config-actions-cell .row-actions form,.config-actions-cell .row-actions form .btn{width:100%}

  .order-create-page{padding-bottom:96px}
  .order-create-head{margin-bottom:8px}
  .order-create-head p{display:none}
  .order-mobile-jump{position:sticky;top:66px;z-index:14;display:flex;gap:7px;margin:0 -2px 10px;padding:7px;overflow-x:auto;border:1px solid #dce8e2;border-radius:13px;background:rgba(248,251,249,.96);box-shadow:0 7px 18px rgba(20,62,49,.08);backdrop-filter:blur(9px);scrollbar-width:none}
  .order-mobile-jump::-webkit-scrollbar{display:none}
  .order-mobile-jump button{display:flex;flex:0 0 auto;align-items:center;gap:7px;min-height:38px;padding:7px 10px;border:1px solid #dbe7e1;border-radius:10px;background:#fff;color:#294d41;font:inherit;font-size:.75rem;font-weight:750;white-space:nowrap}
  .order-mobile-jump button span{display:grid;place-items:center;width:22px;height:22px;border-radius:7px;background:#e8f5ee;color:#087552;font-size:.66rem}
  .order-builder-layout{gap:10px}
  .order-catalog,.order-checkout{border-radius:14px;padding:12px}
  .order-catalog{scroll-margin-top:125px}
  .order-catalog .grid-2{grid-template-columns:1fr 1fr}
  .order-catalog .field span{font-size:.72rem}
  .product-grid-results{max-height:330px;overflow:auto}
  .order-cart-section{scroll-margin-top:125px}
  .order-cart-table-wrap{overflow:visible!important;border:0!important}
  .pos-cart-table,.pos-cart-table tbody{display:block;width:100%}
  .pos-cart-table thead{display:none}
  .pos-cart-table tr{position:relative;display:grid;grid-template-columns:1fr 1fr;gap:8px 12px;margin-bottom:10px;padding:12px;border:1px solid #dbe7e1;border-radius:14px;background:#fbfdfc}
  .pos-cart-table td{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:8px;padding:0!important;border:0!important;text-align:right}
  .pos-cart-table td::before{content:attr(data-label);color:#75877f;font-size:.67rem;font-weight:800;text-transform:uppercase;letter-spacing:.03em}
  .pos-cart-table .cart-product-cell{grid-column:1/-1;display:block;padding-right:34px!important;text-align:left}
  .pos-cart-table .cart-product-cell::before{display:none}
  .pos-cart-table .cart-qty-cell,.pos-cart-table .cart-price-cell{grid-column:span 1}
  .pos-cart-table .cart-total-cell{grid-column:1/-1;padding-top:9px!important;border-top:1px dashed #d8e4de!important;font-weight:850;color:#075f45}
  .pos-cart-table .cart-remove-cell{position:absolute;top:8px;right:8px}
  .pos-cart-table .cart-remove-cell::before{display:none}
  .pos-cart-table .cart-remove-cell .btn{width:30px;height:30px;padding:0;border-radius:9px;color:#b33d3d}
  .pos-cart-table .qty{min-width:122px}
  .pos-cart-table .qinput{width:48px}
  .pos-cart-table .price-input{width:105px;max-width:100%;font-weight:750}
  .order-form-section{scroll-margin-top:125px}
  .order-form-section>summary{min-height:50px;padding:10px 12px}
  .order-section-body{padding:12px}
  .order-section-body>.grid-3,.order-section-body>.grid-2,.quick-customer-box .grid-3{grid-template-columns:1fr}
  .order-section-body .field{margin-bottom:9px}
  .order-section-body .field span{margin-bottom:5px;font-size:.75rem}
  .target-total-box{padding:10px}
  .courier-risk-panel{margin-left:-2px;margin-right:-2px}
  .order-review-section{padding-bottom:8px}
  .order-review-section>#createOrderBtn{display:none}
  .order-mobile-dock{position:fixed;right:10px;bottom:calc(10px + var(--order-keyboard-offset,0px));left:10px;z-index:70;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 11px;border:1px solid #bcd8cd;border-radius:16px;background:rgba(255,255,255,.97);box-shadow:0 16px 40px rgba(13,54,42,.22);backdrop-filter:blur(12px);transition:bottom .16s ease,padding .16s ease}
  .order-mobile-dock-summary{display:flex;min-width:0;flex:1;flex-direction:column;gap:1px}
  .order-mobile-dock-summary small{overflow:hidden;color:#6f837a;font-size:.66rem;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}
  .order-mobile-dock-summary strong{color:#075f45;font-size:1.05rem;line-height:1.15}
  .order-mobile-dock-summary>span{color:#536f64;font-size:.68rem}
  .order-mobile-dock .btn{min-width:132px;min-height:46px;border-radius:12px;font-weight:850}
  body.order-keyboard-open .order-mobile-dock{padding:7px 9px}
  body.order-keyboard-open .order-mobile-dock-summary small,body.order-keyboard-open .order-mobile-dock-summary>span{display:none}
  body.order-keyboard-open .order-mobile-dock .btn{min-height:40px}
}

@media(max-width:420px){
  .order-catalog .grid-2{grid-template-columns:1fr}
  .order-config-form-footer{align-items:stretch;flex-direction:column}
  .order-config-form-footer .btn{width:100%}
  .responsive-config-table tr{grid-template-columns:1fr}
  .responsive-config-table td{grid-column:1!important}
  .responsive-config-table td:nth-child(2),.responsive-config-table .config-actions-cell{grid-column:1!important}
  .order-mobile-dock .btn{min-width:116px;padding-inline:12px}
  .order-mobile-dock-summary strong{font-size:.96rem}
}

/* =========================================================
   Client requirements fix: New Order pricing, weight charge,
   courier accuracy comparison and configuration mobile fit
   ========================================================= */
.order-cart-table{width:100%;min-width:620px;table-layout:fixed}
.order-cart-table col.order-col-product{width:auto}
.order-cart-table col.order-col-qty{width:146px}
.order-cart-table col.order-col-price{width:118px}
.order-cart-table col.order-col-total{width:116px}
.order-cart-table col.order-col-action{width:42px}
.order-cart-table .order-product-head,.order-cart-table .cart-product-cell{text-align:left}
.order-cart-table .order-qty-head,.order-cart-table .cart-qty-cell{text-align:center!important}
.order-cart-table .order-price-head,.order-cart-table .cart-price-cell{text-align:left!important}
.order-cart-table .order-total-head,.order-cart-table .cart-total-cell{text-align:right!important}
.order-cart-table .cart-qty-cell .qty{display:flex;width:100%;justify-content:center;margin-inline:auto}
.order-cart-table .cart-price-cell .price-input{display:block;width:100%;max-width:104px;min-width:0;margin:0;text-align:left;font-weight:750;font-variant-numeric:tabular-nums;background:#fff;border-color:#b9d7cb}
.order-cart-table .cart-price-cell .price-input:focus{border-color:#087552;box-shadow:0 0 0 3px rgba(8,117,82,.12)}
.order-cart-table .cart-total-cell{font-variant-numeric:tabular-nums;white-space:nowrap}

.delivery-charge-field{min-width:0}
.delivery-charge-control{display:flex;align-items:stretch;gap:7px;min-width:0}
.delivery-charge-control input{min-width:0;flex:1}
.delivery-charge-control .btn{flex:0 0 auto;white-space:nowrap}
.delivery-charge-hint{display:block;margin-top:6px;padding:7px 9px;border-radius:9px;background:#edf8f3;color:#286253;font-size:.72rem;font-weight:650;line-height:1.35}
.delivery-charge-hint.is-manual{background:#fff7df;color:#825c08}

.courier-accuracy-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0 12px}
.courier-accuracy-grid>div{min-width:0;padding:10px 11px;border:1px solid #dce8e2;border-radius:12px;background:linear-gradient(180deg,#fff,#f7fbf9)}
.courier-accuracy-grid small{display:block;margin-bottom:3px;color:#6d837a;font-size:.68rem;font-weight:750;text-transform:uppercase;letter-spacing:.025em}
.courier-accuracy-grid strong{display:block;color:#143f34;font-size:1.04rem;overflow-wrap:anywhere;text-transform:capitalize}
.courier-accuracy-grid .risk-safe,.courier-accuracy-grid .risk-low{color:#087552}
.courier-accuracy-grid .risk-medium{color:#a36700}
.courier-accuracy-grid .risk-high,.courier-accuracy-grid .risk-danger{color:#b52e2e}
.courier-risk-chip{display:inline-flex;gap:6px;margin:8px 0 12px;padding:7px 10px;border-radius:999px;background:#f1f7f4;color:#49685e;font-size:.76rem;text-transform:capitalize}

.order-configuration-page{width:100%;max-width:100%;min-width:0;overflow-x:clip}
.order-configuration-page *{box-sizing:border-box}
.order-configuration-page .order-config-grid,
.order-configuration-page .order-config-editor,
.order-configuration-page .order-config-list-card,
.order-configuration-page .order-config-form,
.order-configuration-page .order-config-form>.grid,
.order-configuration-page .order-config-form .field{width:100%;max-width:100%;min-width:0}
.order-configuration-page .order-config-editor input,
.order-configuration-page .order-config-editor select,
.order-configuration-page .order-config-editor textarea{width:100%;max-width:100%;min-width:0}
.order-configuration-page .order-config-tabs{max-width:100%}
.order-delivery-config-grid{align-items:end}

@media(max-width:760px){
  .order-cart-table{min-width:0}
  .order-cart-table .cart-price-cell .price-input{width:104px;max-width:100%;margin-left:auto;text-align:right}
  .delivery-charge-control{flex-wrap:wrap}
  .delivery-charge-control .btn{width:100%}
  .courier-accuracy-grid{grid-template-columns:1fr 1fr}
  .courier-accuracy-grid>div:last-child:nth-child(odd){grid-column:1/-1}
  .order-configuration-page{margin-inline:0;padding-inline:0}
  .order-configuration-page .order-config-grid{display:block!important}
  .order-configuration-page .order-config-editor,
  .order-configuration-page .order-config-list-card{margin:0 0 12px;overflow:hidden}
  .order-configuration-page .order-config-form{overflow:hidden}
  .order-configuration-page .order-config-form-footer{max-width:100%}
}
@media(max-width:420px){
  .courier-accuracy-grid{grid-template-columns:1fr}
  .courier-accuracy-grid>div:last-child:nth-child(odd){grid-column:auto}
}

/* =========================================================
   Order return receipt, inspection and repackaging workflow
   ========================================================= */
.btn-success{border-color:#16845d;background:linear-gradient(135deg,#0d7653,#19a16f);color:#fff;box-shadow:0 6px 14px rgba(13,118,83,.18)}
.btn-success:hover{background:linear-gradient(135deg,#095f43,#12865d);color:#fff}
.btn-warning{border-color:#e5a92f;background:linear-gradient(135deg,#f3b63b,#d88a12);color:#3e2900;box-shadow:0 6px 14px rgba(216,138,18,.18)}
.btn-warning:hover{background:linear-gradient(135deg,#eaaa2e,#c87a08);color:#2e1d00}

.return-page-head{align-items:flex-end}
.return-page-head .eyebrow{display:inline-flex;margin-bottom:5px;color:#0d7653;font-size:.72rem;font-weight:850;letter-spacing:.08em;text-transform:uppercase}
.return-workflow-grid{align-items:start}
.return-action-card{position:relative;overflow:hidden;padding:20px}
.return-action-card::before{content:"";position:absolute;inset:0 0 auto;height:4px;background:linear-gradient(90deg,#0d7653,#f0b643)}
.return-type-banner{display:flex;align-items:center;gap:13px;padding:14px;border:1px solid #dbe8e2;border-radius:15px;background:linear-gradient(135deg,#f8fcfa,#fff)}
.return-type-banner.full{border-color:#f1cecc;background:linear-gradient(135deg,#fff5f4,#fff)}
.return-type-banner.partial{border-color:#eadcb5;background:linear-gradient(135deg,#fff9e9,#fff)}
.return-type-icon{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;border-radius:13px;background:#e9f6f0;color:#087552;font-size:1.25rem;font-weight:900}
.return-type-banner.full .return-type-icon{background:#fee8e6;color:#b92e28}
.return-type-banner.partial .return-type-icon{background:#fff0c9;color:#8a5900}
.return-type-banner strong,.return-type-banner small{display:block}
.return-type-banner strong{font-size:1.02rem;color:#183e33}
.return-type-banner small{margin-top:3px;color:#6b7f77;line-height:1.4}
.return-money-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.return-money-summary>div{min-width:0;padding:12px;border:1px solid #dfeae5;border-radius:12px;background:#f8fbfa}
.return-money-summary span,.return-receive-summary span{display:block;color:#75867f;font-size:.69rem;font-weight:800;text-transform:uppercase;letter-spacing:.035em}
.return-money-summary strong{display:block;margin-top:4px;color:#173f34;font-size:1.08rem;font-variant-numeric:tabular-nums}
.return-items-preview{overflow:hidden}
.return-preview-list{display:grid;gap:8px}
.return-preview-list article{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 12px;border:1px solid #e1ebe6;border-radius:12px;background:#fbfdfc}
.return-preview-list article>div{min-width:0}
.return-preview-list strong,.return-preview-list small{display:block}
.return-preview-list strong{overflow-wrap:anywhere;color:#1d4539}
.return-preview-list small{margin-top:2px;color:#819088;font-size:.72rem}
.return-preview-list article>span{flex:0 0 auto;color:#355e52;font-size:.82rem;font-weight:800;white-space:nowrap}
.return-process-steps{display:flex;align-items:center;justify-content:space-between;gap:5px;margin-top:18px;padding-top:16px;border-top:1px dashed #d5e3dc;overflow-x:auto}
.return-process-steps span{display:flex;align-items:center;gap:6px;min-width:max-content;color:#71827a;font-size:.72rem;font-weight:750}
.return-process-steps span i{display:grid;place-items:center;width:25px;height:25px;border-radius:999px;background:#edf3f0;color:#61736b;font-style:normal;font-weight:900}
.return-process-steps span.active{color:#087552}.return-process-steps span.active i{background:#087552;color:#fff}
.return-process-steps>b{color:#a9b8b1;font-weight:600}

.return-receive-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.return-receive-summary>div{min-width:0;padding:12px;border:1px solid #dfeae5;border-radius:12px;background:#f8fbfa}
.return-receive-summary strong,.return-receive-summary small{display:block;overflow-wrap:anywhere}
.return-receive-summary strong{margin-top:4px;color:#173f34}.return-receive-summary small{margin-top:2px;color:#71827a;font-size:.72rem}
.return-condition-picker{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0;padding:0;border:0}
.return-condition-picker legend{grid-column:1/-1;margin-bottom:2px;color:#294e43;font-size:.82rem;font-weight:800}
.return-condition-picker label{position:relative;display:block;cursor:pointer}
.return-condition-picker input{position:absolute;opacity:0;pointer-events:none}
.return-condition-picker label>span{display:grid;grid-template-columns:38px 1fr;grid-template-rows:auto auto;gap:2px 9px;min-height:92px;padding:12px;border:1.5px solid #d9e5df;border-radius:14px;background:#fff;transition:.18s ease}
.return-condition-picker label>span>b{grid-row:1/3;display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:#eaf7f1;color:#087552;font-size:1rem}
.return-condition-picker label:last-child>span>b{background:#fff0ee;color:#b7332e}
.return-condition-picker label>span>strong{color:#244a3f}.return-condition-picker label>span>small{color:#71827a;line-height:1.35}
.return-condition-picker input:checked+span{border-color:#16845d;background:#f3fbf7;box-shadow:0 0 0 3px rgba(22,132,93,.10)}
.return-condition-picker label:last-child input:checked+span{border-color:#d65d57;background:#fff7f6;box-shadow:0 0 0 3px rgba(214,93,87,.10)}
.return-receipt-status-card{display:flex;align-items:center;gap:11px;margin-top:16px;padding:13px;border-radius:13px;border:1px solid #ead9aa;background:#fff9e7}
.return-receipt-status-card.received{border-color:#bfe2d2;background:#effaf5}
.return-receipt-status-card>span{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;border-radius:12px;background:#f3b63b;color:#fff;font-weight:900}
.return-receipt-status-card.received>span{background:#16845d}
.return-receipt-status-card strong,.return-receipt-status-card small{display:block}.return-receipt-status-card strong{color:#324e45}.return-receipt-status-card small{margin-top:2px;color:#71827a;font-size:.74rem}

.return-action-dock{flex-wrap:wrap;border-color:#dbe8e2;background:linear-gradient(135deg,#fff,#f6fbf8)}
.return-primary-actions{margin-left:auto}
.return-pending-banner{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border:1px solid #ead59c;border-radius:12px;background:#fff9e8}
.return-pending-banner>span{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;border-radius:10px;background:#f3b63b;color:#fff;font-weight:900}
.return-pending-banner>div{min-width:0;flex:1}.return-pending-banner strong,.return-pending-banner small{display:block}.return-pending-banner strong{color:#674800}.return-pending-banner small{margin-top:2px;color:#806a2f}
.return-pending-banner>a{font-size:.78rem;font-weight:850;white-space:nowrap}
.return-history-timeline{display:grid;gap:10px}
.return-history-timeline .return-history-item{padding:12px!important;border:1px solid #e0e9e5;border-radius:13px;background:#fbfdfc}
.return-history-head,.return-history-state,.return-history-money{display:flex;align-items:center;flex-wrap:wrap;gap:7px}
.return-history-head{justify-content:space-between}.return-history-money{margin:9px 0}.return-history-money span{padding:5px 8px;border-radius:8px;background:#f0f6f3;color:#61736b;font-size:.72rem}.return-history-money b{color:#244a3f}
.return-history-state{margin-bottom:8px}.return-history-state small{color:#75867f}.return-history-created{display:block;margin-top:8px;color:#8a9891}

.return-receipt-tabs{display:flex;gap:7px;margin:0 0 14px;padding:4px;overflow-x:auto;border:1px solid #dce7e2;border-radius:14px;background:#f5f9f7;scrollbar-width:thin}
.return-receipt-tabs a{display:flex;align-items:center;gap:7px;min-width:max-content;padding:9px 11px;border-radius:10px;color:#526b62;font-size:.78rem;font-weight:800;text-decoration:none}
.return-receipt-tabs a span{display:grid;place-items:center;min-width:23px;height:23px;padding:0 6px;border-radius:999px;background:#e6efeb;color:#345a4e;font-size:.68rem}
.return-receipt-tabs a:hover,.return-receipt-tabs a.active{background:#087552;color:#fff}.return-receipt-tabs a.active span{background:rgba(255,255,255,.2);color:#fff}
.return-filterbar{grid-template-columns:minmax(180px,1.35fr) repeat(5,minmax(120px,.8fr)) auto auto}
.return-register-table,.return-received-table{min-width:1080px}
.return-register-table td,.return-received-table td{vertical-align:top}
.return-register-table .row-actions,.return-received-table .row-actions{flex-wrap:nowrap}
.table-block{display:block;margin-top:4px}
.return-workflow-pills{overflow-x:auto}
.return-received-card{border-color:#d8e7e0}

@media(max-width:1180px){
  .return-filterbar{grid-template-columns:repeat(3,minmax(0,1fr))}
  .return-filterbar .btn{width:100%}
}
@media(max-width:760px){
  .return-page-head{align-items:flex-start}
  .return-workflow-grid{grid-template-columns:1fr}
  .return-action-card{padding:15px}
  .return-money-summary,.return-receive-summary{grid-template-columns:1fr 1fr}
  .return-condition-picker{grid-template-columns:1fr}
  .return-process-steps{justify-content:flex-start;padding-bottom:3px}
  .return-action-dock{align-items:stretch}
  .return-primary-actions{width:100%;margin-left:0}.return-primary-actions .btn{flex:1 1 140px}
  .return-pending-banner{align-items:flex-start;flex-wrap:wrap}.return-pending-banner>a{margin-left:44px}
  .return-filterbar{grid-template-columns:1fr 1fr}
  .return-receipt-tabs{margin-inline:-2px}
}
@media(max-width:480px){
  .return-money-summary,.return-receive-summary,.return-filterbar{grid-template-columns:1fr}
  .return-type-banner{align-items:flex-start}
  .return-preview-list article{align-items:flex-start;flex-direction:column}
  .return-pending-banner>a{width:100%;margin-left:0;padding-top:3px}
  .return-action-dock .return-primary-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .return-action-dock .return-primary-actions .btn{width:100%}
}

/* =========================================================
   Purchase / Return Packaging mobile viewport fix
   Added for the client-recorded mobile issue (2026-07-21)
   ========================================================= */
.purchase-page,
.purchase-page > *,
.purchase-hero,
.purchase-hero > div,
.purchase-list-card,
.purchase-filter-card,
.return-received-card {
  min-width: 0;
  max-width: 100%;
}

.purchase-page {
  width: 100%;
  overflow-x: clip;
}

.purchase-hero > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.purchase-hero h1,
.purchase-hero p {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.purchase-hero-actions {
  min-width: 0;
  max-width: 100%;
}

.purchase-filter-card,
.purchase-list-card {
  overflow: hidden;
}

.purchase-filterbar {
  min-width: 0;
  max-width: 100%;
}

.purchase-filterbar > * {
  min-width: 0;
}

.purchase-status-pills,
.return-workflow-pills {
  width: 100%;
  max-width: 100%;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.purchase-list-card > .table-wrap,
.return-received-card > .table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.purchase-table,
.return-received-table {
  margin: 0;
}

@media (max-width: 760px) {
  .purchase-page {
    gap: .75rem;
  }

  .purchase-hero {
    width: 100%;
    padding: .9rem;
    gap: .85rem;
    overflow: hidden;
  }

  .purchase-hero::after {
    display: none;
  }

  .purchase-hero > div:first-child,
  .purchase-hero-actions {
    width: 100%;
  }

  .purchase-hero h1 {
    font-size: 1.35rem;
    line-height: 1.25;
  }

  .purchase-hero p {
    font-size: .82rem;
    line-height: 1.45;
  }

  .purchase-hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .5rem;
  }

  .purchase-hero-actions .btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }

  .purchase-hero-actions .btn:nth-child(3) {
    grid-column: 1 / -1;
  }

  .purchase-kpis {
    gap: .6rem;
  }

  .purchase-kpis article {
    width: 100%;
    padding: .82rem;
  }

  .purchase-status-pills {
    margin: 0;
    padding: .15rem 0 .3rem;
  }

  .purchase-status-pills a {
    flex: 0 0 auto;
  }

  .purchase-filter-card,
  .purchase-list-card {
    width: 100%;
    padding: .75rem;
  }

  .purchase-filterbar {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: .55rem;
  }

  .purchase-filterbar > *,
  .purchase-filterbar .filter-search,
  .purchase-filterbar input,
  .purchase-filterbar select,
  .purchase-filterbar button,
  .purchase-filterbar a.btn {
    width: 100% !important;
    max-width: 100% !important;
  }

  .purchase-list-card .card-head {
    align-items: stretch;
    gap: .7rem;
  }

  .purchase-list-card .card-head > * {
    min-width: 0;
    max-width: 100%;
  }

  .purchase-list-card .card-head > .btn {
    width: 100%;
    justify-content: center;
  }

  .purchase-list-card > .table-wrap,
  .return-received-card > .table-wrap {
    margin: 0;
    border-radius: 10px;
  }

  .purchase-table {
    min-width: 980px;
  }

  .return-received-table {
    min-width: 920px;
  }

  .purchase-table th,
  .purchase-table td,
  .return-received-table th,
  .return-received-table td {
    padding: .62rem .65rem;
    font-size: .76rem;
  }

  .purchase-table .row-actions,
  .return-received-table .row-actions {
    flex-wrap: wrap;
    min-width: 125px;
  }

  .purchase-table .row-actions .btn,
  .return-received-table .row-actions .btn,
  .return-received-table .row-actions form,
  .return-received-table .row-actions form .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .purchase-hero-actions {
    grid-template-columns: 1fr;
  }

  .purchase-hero-actions .btn:nth-child(3) {
    grid-column: auto;
  }

  .purchase-kpis article {
    gap: .65rem;
  }

  .purchase-kpis strong {
    font-size: 1.12rem;
  }
}

/* User guide shortcut: translated, compact-safe and always clickable. */
.sidebar-help-block{
  min-width:0;
  margin-top:.65rem;
  padding:.55rem .45rem .35rem;
  border-top:1px solid rgba(255,255,255,.12);
}
.sidebar .nav-title-help{
  margin:0 .4rem .38rem;
  color:rgba(225,247,238,.68);
  font-size:.66rem;
  font-weight:800;
  line-height:1.35;
  letter-spacing:.08em;
  text-transform:uppercase;
  overflow-wrap:anywhere;
}
.sidebar .nav-documentation{
  display:flex;
  align-items:center;
  width:100%;
  min-width:0;
  margin:0;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.075);
}
.sidebar .nav-documentation:hover,
.sidebar .nav-documentation:focus-visible{
  border-color:rgba(255,255,255,.26);
  background:rgba(255,255,255,.15);
  color:#fff;
  text-decoration:none;
}
.sidebar .nav-documentation .nav-label{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.sidebar .nav-doc-open{
  flex:0 0 auto;
  margin-left:auto;
  opacity:.7;
  font-size:.78rem;
}
.sidebar-compact .sidebar-help-block{
  padding:.45rem .25rem .35rem;
}
.sidebar-compact .nav-title-help,
.sidebar-compact .nav-doc-open{
  display:none;
}
.sidebar-compact .nav-documentation{
  justify-content:center;
  padding:.62rem .45rem;
}
@media(max-width:980px){
  .sidebar-compact .sidebar-help-block{
    padding:.55rem .45rem .35rem;
  }
  .sidebar-compact .nav-title-help{
    display:block;
  }
  .sidebar-compact .nav-doc-open{
    display:inline;
  }
  .sidebar-compact .nav-documentation{
    justify-content:flex-start;
    padding:.55rem .7rem;
  }
}

/* Order vs courier status flow clarity */
.order-flow-status{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 10px;padding:10px 12px}
.order-flow-status strong{white-space:nowrap}.order-flow-status span{color:var(--muted,#64748b);font-size:.84rem}
.courier-status-form{display:flex;align-items:center;gap:8px;flex:1;flex-wrap:wrap}
.courier-status-form select{min-width:190px}.courier-status-form input{min-width:180px;flex:1}
@media (max-width:680px){
  .order-flow-status{align-items:flex-start;flex-direction:column}
  .order-flow-status strong{white-space:normal}
  .courier-status-form{width:100%;display:grid;grid-template-columns:1fr}
  .courier-status-form select,.courier-status-form input,.courier-status-form button{width:100%;min-width:0}
}

/* ---- Order details: responsive status history ---- */
.order-status-history-card{
  overflow:hidden;
}
.order-status-history{
  list-style:none;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:1rem;
  width:100%;
  min-width:0;
  margin:0;
  padding:.45rem 0 .1rem;
  border:0;
}
.order-status-history-step{
  position:relative;
  display:flex;
  min-width:0;
  margin:0;
  padding:.95rem .35rem .55rem 0;
  border-top:2px solid var(--line,var(--border,#dce6e1));
}
.order-status-history-marker{
  position:absolute;
  top:-6px;
  left:0;
  z-index:1;
  width:10px;
  height:10px;
  border:2px solid var(--card,#fff);
  border-radius:50%;
  background:var(--brand-2,var(--primary,#169b72));
  box-shadow:0 0 0 2px rgba(22,155,114,.14);
}
.order-status-history-content{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  width:min(100%,240px);
  min-width:0;
}
.order-status-history-badge{
  display:inline-flex;
  align-items:center;
  max-width:100%;
  min-height:28px;
  padding:.32rem .62rem;
  line-height:1.25;
  white-space:normal;
  overflow-wrap:anywhere;
  text-align:left;
}
.order-status-history-note{
  width:100%;
  margin:.5rem 0 0;
  color:var(--text,var(--ink,#1f2937));
  line-height:1.45;
  overflow-wrap:anywhere;
}
.order-status-history-meta{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.1rem .42rem;
  width:100%;
  margin-top:.58rem;
  color:var(--muted,#64748b);
  font-size:.76rem;
  line-height:1.5;
  overflow-wrap:anywhere;
}
.order-status-history-meta span{
  min-width:0;
}
.order-status-history-separator{
  opacity:.65;
}
.order-status-history-empty{
  margin:.25rem 0 0;
}
@media (max-width:640px){
  .order-status-history{
    grid-template-columns:1fr;
    gap:0;
    padding:.25rem 0 0;
  }
  .order-status-history-step{
    display:grid;
    grid-template-columns:18px minmax(0,1fr);
    column-gap:.65rem;
    padding:0 0 1.25rem;
    border-top:0;
    border-left:2px solid var(--line,var(--border,#dce6e1));
  }
  .order-status-history-step:last-child{
    padding-bottom:.2rem;
    border-left-color:transparent;
  }
  .order-status-history-marker{
    top:.32rem;
    left:-6px;
  }
  .order-status-history-content{
    grid-column:2;
    width:100%;
  }
}
@media (max-width:380px){
  .order-status-history-meta{
    display:grid;
    gap:.08rem;
  }
  .order-status-history-separator{
    display:none;
  }
}


/* ---- Order details: responsive Courier & Tracking ---- */
.order-courier-tracking-card{
  min-width:0;
  overflow:hidden;
}
.order-courier-tracking-card .card-head>div{
  min-width:0;
}
.order-courier-tracking-card .card-head p{
  max-width:100%;
  overflow-wrap:anywhere;
}
.courier-tracking-details{
  align-items:center;
}
.courier-tracking-details dt,
.courier-tracking-details dd{
  min-width:0;
}
.courier-tracking-details dd>.badge,
.courier-tracking-details dd>code{
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.courier-tracking-actions{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:flex-start;
  gap:.65rem;
  width:100%;
  margin-top:1rem;
}
.courier-tracking-actions>form{
  margin:0;
}
.courier-sync-form{
  align-self:flex-start;
}
.courier-status-form.courier-status-update-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:.55rem;
  width:100%;
  min-width:0;
  align-items:stretch;
}
.courier-status-update-form select{
  grid-column:1/-1;
}
.courier-status-update-form select,
.courier-status-update-form input,
.courier-status-update-form button{
  min-width:0;
  max-width:100%;
  min-height:42px;
  margin:0;
}
.courier-status-update-form select,
.courier-status-update-form input{
  width:100%;
}
.courier-status-update-form button{
  white-space:nowrap;
}
.courier-closed-help{
  display:block;
  width:100%;
  overflow-wrap:anywhere;
}
.courier-event-history{
  position:relative;
  display:grid;
  gap:0;
  min-width:0;
  margin-top:1.05rem;
  padding-left:1.15rem;
  border-left:2px solid var(--line,var(--border,#dce6e1));
}
.courier-event-item{
  position:relative;
  display:block;
  min-width:0;
  margin:0;
  padding:0 0 1.05rem .2rem;
}
.courier-event-item:last-child{
  padding-bottom:.15rem;
}
.courier-event-marker{
  position:absolute;
  top:.38rem;
  left:-1.52rem;
  z-index:1;
  width:10px;
  height:10px;
  border:2px solid var(--card,#fff);
  border-radius:50%;
  background:var(--brand-2,var(--primary,#169b72));
  box-shadow:0 0 0 2px rgba(22,155,114,.14);
}
.courier-event-content{
  min-width:0;
}
.courier-event-head{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.4rem .55rem;
  min-width:0;
}
.courier-event-head strong{
  min-width:0;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.courier-event-badge{
  display:inline-flex;
  align-items:center;
  max-width:100%;
  min-height:27px;
  padding:.28rem .58rem;
  line-height:1.25;
  white-space:normal;
  overflow-wrap:anywhere;
  text-align:left;
}
.courier-event-content p{
  margin:.38rem 0 0;
  color:var(--text,var(--ink,#1f2937));
  line-height:1.45;
  overflow-wrap:anywhere;
}
.courier-event-content small{
  display:block;
  margin-top:.38rem;
  color:var(--muted,#64748b);
  line-height:1.45;
  overflow-wrap:anywhere;
}
@media (max-width:760px){
  .courier-tracking-details{
    grid-template-columns:minmax(105px,.72fr) minmax(0,1.28fr);
    gap:.55rem .7rem;
  }
  .courier-tracking-details dt{
    font-size:.82rem;
  }
}
@media (max-width:430px){
  .courier-tracking-details{
    grid-template-columns:1fr;
    gap:.15rem;
  }
  .courier-tracking-details dt:not(:first-child){
    margin-top:.52rem;
  }
  .courier-status-form.courier-status-update-form{
    grid-template-columns:1fr;
  }
  .courier-status-update-form select,
  .courier-status-update-form input,
  .courier-status-update-form button{
    grid-column:1;
    width:100%;
  }
  .courier-sync-form,
  .courier-sync-form .btn{
    width:100%;
  }
  .courier-event-head{
    align-items:flex-start;
    flex-direction:column;
  }
}

/* ---- Order document POS/A4 split actions ---- */
.order-document-toolbar{
  display:flex;
  flex-wrap:wrap;
  align-items:stretch;
  justify-content:flex-end;
  gap:.45rem;
  min-width:0;
}
.order-document-pair{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  min-width:0;
}
.order-document-pair .btn{
  min-height:38px;
  justify-content:center;
  white-space:nowrap;
}
.order-document-main{
  border-radius:8px 0 0 8px!important;
  border-right:0!important;
  gap:.35rem!important;
}
.order-document-main small{
  display:inline-flex;
  align-items:center;
  min-height:18px;
  padding:0 .36rem;
  border-radius:999px;
  background:#e3f4ed;
  color:#0b7654;
  font-size:.62rem;
  font-weight:900;
  letter-spacing:.035em;
}
.order-document-a4{
  min-width:42px;
  padding-left:.5rem!important;
  padding-right:.5rem!important;
  border-radius:0 8px 8px 0!important;
  background:#f6faf8!important;
  color:#547068!important;
  font-size:.72rem!important;
  font-weight:900!important;
}
.order-document-a4:hover{
  background:#e9f3ef!important;
  color:var(--brand,#0e6b4e)!important;
}
@media(max-width:980px){
  .order-document-toolbar{
    width:100%;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .order-document-toolbar .order-back-button{
    grid-column:1/-1;
    justify-content:center;
  }
  .order-document-pair{
    width:100%;
  }
  .order-document-main{
    width:100%;
  }
}
@media(max-width:520px){
  .order-document-toolbar{
    grid-template-columns:1fr;
  }
  .order-document-toolbar .order-back-button{
    grid-column:1;
  }
}

/* =========================================================
   Order Management client feedback update (2026-07-21)
   Courier outcomes, update alignment, compact delivery details,
   reliable item-table overflow and responsive action controls.
   ========================================================= */

/* Stop the left order card stretching to the height of the courier history. */
.order-overview{
  align-items:start;
}
.order-overview > *,
.order-overview > .span-2,
.order-overview > aside,
.order-overview .card{
  min-width:0;
}
.order-items-card{
  align-self:start;
  min-width:0;
  max-width:100%;
  overflow:hidden;
}

/* Keep all item columns readable and make horizontal scrolling intentional. */
.order-items-table-wrap{
  position:relative;
  display:block;
  width:100%;
  max-width:100%;
  overflow-x:auto!important;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-inline:contain;
  scrollbar-width:thin;
  border:1px solid var(--border,#dce7e2)!important;
}
.order-items-table{
  width:100%;
  min-width:760px;
  table-layout:auto;
  margin:0;
}
.order-items-table th,
.order-items-table td{
  white-space:nowrap;
}
.order-items-table th:first-child,
.order-items-table td:first-child{
  min-width:220px;
  white-space:normal;
  overflow-wrap:anywhere;
}
.order-items-table-wrap:focus-visible{
  outline:3px solid rgba(13,128,91,.18);
  outline-offset:2px;
}

/* Compact delivery details and totals; no empty stretched area. */
.order-summary-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(285px,.82fr);
  align-items:start;
  gap:16px;
  margin-top:16px;
}
.order-delivery-details{
  min-height:0;
  padding:16px;
}
.order-delivery-details h3{
  margin:0 0 9px;
}
.order-delivery-details strong,
.order-delivery-details .order-delivery-phones{
  display:block;
  overflow-wrap:anywhere;
}
.order-delivery-details .order-delivery-phones{
  margin-top:4px;
  color:var(--muted,#66776f);
}
.order-delivery-details p{
  margin:.55rem 0 0;
  line-height:1.55;
  overflow-wrap:anywhere;
}
.order-summary-grid .order-totals{
  width:100%;
  max-width:none;
  margin:0;
  padding:4px 14px 8px;
  border:1px solid var(--border,#dce7e2);
  border-radius:12px;
  background:var(--surface-soft,#f5f9f7);
}

/* Courier outcome controls stay visible from Booked/Pending until final outcome. */
.return-action-dock{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:12px 16px;
}
.return-action-dock .order-flow-status{
  min-width:0;
  margin:0;
}
.order-office-pipeline{
  justify-content:flex-end;
}
.courier-outcome-actions{
  grid-column:1/-1;
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:9px;
  width:100%;
  margin:0;
  padding-top:11px;
  border-top:1px dashed var(--border,#dce7e2);
}
.courier-outcome-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:42px;
  padding:.58rem .85rem!important;
  border-radius:11px!important;
  font-weight:850;
  box-shadow:0 7px 18px rgba(23,63,52,.08);
  transition:transform .16s ease,box-shadow .16s ease,filter .16s ease;
}
.courier-outcome-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(23,63,52,.13);
}
.courier-outcome-icon{
  display:grid;
  place-items:center;
  flex:0 0 27px;
  width:27px;
  height:27px;
  border-radius:8px;
  background:rgba(255,255,255,.22);
  font-size:.9rem;
  font-weight:950;
  line-height:1;
}
.courier-outcome-btn.is-partial-delivery{
  border-color:#b9d9cc!important;
  background:#eff9f4!important;
  color:#087552!important;
}
.courier-outcome-btn.is-partial-delivery .courier-outcome-icon{
  background:#d6efe4;
}
.courier-outcome-btn.is-charge-return{
  border-color:#e3aa25!important;
  background:linear-gradient(135deg,#f8ba38,#e9a514)!important;
  color:#3f2a00!important;
}
.courier-outcome-btn.is-full-return{
  background:linear-gradient(135deg,#e85d57,#cf3e39)!important;
}
.contact-action-btn{
  min-height:42px;
}

/* Clean Courier Update panel and field alignment. */
.courier-update-panel{
  width:100%;
  min-width:0;
  margin-top:16px;
  padding:14px;
  border:1px solid var(--border,#dce7e2);
  border-radius:14px;
  background:linear-gradient(145deg,#f8fbfa,#f2f8f5);
}
.courier-update-panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.courier-update-panel-head > div{
  min-width:0;
}
.courier-update-panel-head strong,
.courier-update-panel-head small{
  display:block;
}
.courier-update-panel-head strong{
  color:#17483a;
  font-size:.92rem;
}
.courier-update-panel-head small{
  margin-top:3px;
  color:var(--muted,#66776f);
  line-height:1.4;
  overflow-wrap:anywhere;
}
.courier-update-panel .courier-sync-form{
  flex:0 0 auto;
  align-self:flex-start;
}
.courier-status-form.courier-status-update-form{
  display:grid!important;
  grid-template-columns:minmax(180px,.8fr) minmax(220px,1.2fr) auto;
  align-items:end;
  gap:10px;
  width:100%;
  min-width:0;
}
.courier-status-update-form .field{
  min-width:0;
  margin:0;
}
.courier-status-update-form .field > span{
  display:block;
  margin-bottom:5px;
  color:#52675e;
  font-size:.74rem;
  font-weight:800;
}
.courier-status-update-form select,
.courier-status-update-form input,
.courier-status-update-form .courier-update-submit{
  grid-column:auto!important;
  width:100%;
  min-width:0;
  min-height:44px;
  margin:0;
}
.courier-status-update-form .courier-update-submit{
  width:auto;
  min-width:100px;
  padding-inline:18px;
}

/* Tracking cards and event content must never force horizontal overflow. */
.order-courier-tracking-card,
.order-courier-tracking-card > *,
.courier-tracking-details,
.courier-update-panel,
.courier-event-history{
  min-width:0;
  max-width:100%;
}

@media(max-width:900px){
  .return-action-dock{
    grid-template-columns:1fr;
    align-items:stretch;
  }
  .order-office-pipeline{
    justify-content:flex-start;
  }
  .courier-outcome-actions{
    justify-content:flex-start;
  }
  .courier-status-form.courier-status-update-form{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  }
  .courier-status-update-form .courier-update-submit{
    grid-column:1/-1!important;
    width:100%;
  }
}

@media(max-width:760px){
  .order-summary-grid{
    grid-template-columns:1fr;
  }
  .order-items-table{
    min-width:700px;
  }
  .courier-outcome-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .courier-outcome-actions .btn{
    width:100%!important;
    min-width:0;
  }
  .courier-update-panel-head{
    align-items:stretch;
  }
}

@media(max-width:560px){
  .order-items-card{
    padding-left:13px;
    padding-right:13px;
  }
  .order-items-table-wrap{
    margin-inline:0;
  }
  .order-items-table{
    min-width:660px;
  }
  .courier-outcome-actions{
    grid-template-columns:1fr;
  }
  .courier-status-form.courier-status-update-form{
    grid-template-columns:1fr;
  }
  .courier-status-update-form .courier-update-submit{
    grid-column:1!important;
  }
  .courier-update-panel-head{
    flex-direction:column;
  }
  .courier-update-panel .courier-sync-form,
  .courier-update-panel .courier-sync-form .btn{
    width:100%;
  }
  .courier-update-panel{
    padding:12px;
  }
}

/* Order item table: fit common desktop widths and become readable cards on phones. */
.order-items-table{min-width:680px}
.order-items-table th:first-child,
.order-items-table td:first-child{min-width:180px}
@media(max-width:640px){
  .order-items-table-wrap{
    overflow:visible!important;
    border:0!important;
    background:transparent;
  }
  .order-items-table{
    display:block;
    width:100%;
    min-width:0!important;
  }
  .order-items-table thead{display:none}
  .order-items-table tbody{
    display:grid;
    gap:10px;
  }
  .order-items-table tbody tr{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:0 12px;
    padding:12px;
    border:1px solid var(--border,#dce7e2);
    border-radius:12px;
    background:#fbfdfc;
  }
  .order-items-table tbody td,
  .order-items-table tbody td:first-child{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    min-width:0;
    padding:7px 0;
    border:0;
    border-bottom:1px dashed var(--border,#dce7e2);
    white-space:normal;
    text-align:right;
  }
  .order-items-table tbody td::before{
    content:attr(data-label);
    flex:0 0 auto;
    color:var(--muted,#66776f);
    font-size:.72rem;
    font-weight:800;
    text-align:left;
  }
  .order-items-table tbody .order-item-product{
    grid-column:1/-1;
    display:block;
    padding:0 0 10px;
    text-align:left;
  }
  .order-items-table tbody .order-item-product::before{
    display:block;
    margin-bottom:5px;
  }
  .order-items-table tbody .order-item-product strong,
  .order-items-table tbody .order-item-product .small{
    display:block;
    overflow-wrap:anywhere;
  }
  .order-items-table tbody .order-item-total{
    font-weight:850;
  }
  .order-items-table tbody td:nth-last-child(-n+2){border-bottom:0}
}
@media(max-width:420px){
  .order-items-table tbody tr{grid-template-columns:1fr}
  .order-items-table tbody td,
  .order-items-table tbody .order-item-product{grid-column:1}
  .order-items-table tbody td:nth-last-child(2){border-bottom:1px dashed var(--border,#dce7e2)}
  .order-items-table tbody td:last-child{border-bottom:0}
}

/* Keep all courier outcome actions readable on narrow phones. */
@media(max-width:560px){
  .return-action-dock .courier-outcome-actions{
    grid-template-columns:1fr!important;
  }
}

/* =========================================================
   Courier parcel ID and tracking links
   ========================================================= */
.courier-tracking-links{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  min-width:0;
}
.courier-tracking-links small{
  display:block;
  flex:1 0 100%;
  max-width:640px;
  line-height:1.35;
}
.courier-tracking-links.compact{
  flex-wrap:nowrap;
  gap:6px;
}
.courier-tracking-links.compact .btn{
  min-width:max-content;
}
.courier-shipment-table-wrap{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.courier-shipment-table{
  min-width:1080px;
}
.courier-shipment-table code{
  white-space:nowrap;
}
@media(max-width:640px){
  .courier-tracking-details{
    grid-template-columns:1fr;
  }
  .courier-tracking-details dt{
    margin-top:7px;
    font-size:.72rem;
    font-weight:800;
    text-transform:uppercase;
  }
  .courier-tracking-details dd{
    margin:0;
  }
  .courier-tracking-links,
  .courier-tracking-links.compact{
    align-items:stretch;
    flex-direction:column;
  }
  .courier-tracking-links .btn{
    width:100%;
    justify-content:center;
  }
}


/* Order detail page: independent columns prevent tall courier history from leaving a blank left column. */
.order-detail-layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(340px,.9fr);gap:1rem;align-items:start;min-width:0}
.order-detail-primary,.order-detail-secondary{min-width:0}.order-detail-layout .card{margin:0;min-width:0}.order-detail-primary>.order-courier-tracking-card{width:100%}
.order-payments-card .inline-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;gap:.55rem;align-items:end}.order-payments-card .inline-form>*{min-width:0;width:100%}.order-payments-card .inline-form .btn{white-space:nowrap}

.order-document-label-pair{position:relative}.order-document-size-menu{position:relative;display:flex}.order-document-size-menu>summary{list-style:none;cursor:pointer;height:100%;border-top-left-radius:0!important;border-bottom-left-radius:0!important}.order-document-size-menu>summary::-webkit-details-marker{display:none}.order-document-size-menu[open]>summary{background:var(--brand-soft,#e5f5ef);color:var(--brand,#0e6b4e)}
.order-document-size-list{position:absolute;right:0;top:calc(100% + .45rem);z-index:80;display:grid;grid-template-columns:repeat(2,minmax(112px,1fr));gap:.25rem;min-width:270px;padding:.55rem;border:1px solid var(--line,#dce6e2);border-radius:12px;background:#fff;box-shadow:0 14px 34px rgba(15,55,43,.18)}.order-document-size-list a{display:flex;align-items:center;min-height:36px;padding:.48rem .65rem;border-radius:8px;color:var(--text,#173c32);font-size:.78rem;font-weight:750;text-decoration:none;white-space:nowrap}.order-document-size-list a:hover{background:var(--brand-soft,#e5f5ef);color:var(--brand,#0e6b4e)}

@media(max-width:1180px){.order-detail-layout{grid-template-columns:1fr}.order-detail-primary,.order-detail-secondary{width:100%}}
@media(max-width:760px){.order-payments-card .inline-form{grid-template-columns:repeat(2,minmax(0,1fr))}.order-payments-card .inline-form .btn{width:100%}.order-document-size-list{position:fixed;left:12px;right:12px;top:auto;bottom:12px;min-width:0;max-height:60vh;overflow:auto;grid-template-columns:repeat(2,minmax(0,1fr))}.order-courier-tracking-card .courier-tracking-links{display:grid;grid-template-columns:1fr}.order-courier-tracking-card .courier-tracking-links .btn{width:100%}}
@media(max-width:520px){.order-payments-card .inline-form{grid-template-columns:1fr}.order-document-toolbar{width:100%}.order-document-pair{flex:1 1 calc(50% - .4rem);min-width:0}.order-document-main{min-width:0}.order-document-main span{overflow:hidden;text-overflow:ellipsis}.order-document-size-list{grid-template-columns:1fr}.courier-tracking-details{grid-template-columns:1fr!important}.courier-tracking-details dt{padding-bottom:0!important}.courier-tracking-details dd{padding-top:.1rem!important;overflow-wrap:anywhere}.courier-tracking-details code{white-space:normal;word-break:break-all}}

/* =========================================================
   Courier label/status follow-up (2026-07-21)
   Direct size buttons, exact provider status and horizontal histories.
   ========================================================= */
.order-provider-status-badge{
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
}
.courier-live-status{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px 9px;
}
.courier-live-status small{
  display:block;
  flex:1 1 100%;
  font-size:.72rem;
}
.courier-provider-status-pill{
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
}

/* Every courier label size is visible directly in the red-marked toolbar area. */
.order-document-toolbar{
  display:flex!important;
  flex-wrap:nowrap!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  width:100%;
  max-width:100%;
  min-width:0;
  gap:.4rem;
  overflow-x:auto;
  overflow-y:hidden;
  padding:.12rem 0 .28rem;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}
.order-document-toolbar>*{
  flex:0 0 auto;
}
.order-document-toolbar .order-back-button{
  grid-column:auto!important;
  min-height:38px;
}
.order-document-label-group{
  display:flex;
  flex:0 0 auto;
  align-items:stretch;
  min-width:max-content;
  border:1px solid var(--border,#dce7e2);
  border-radius:9px;
  overflow:hidden;
  background:#f7faf9;
}
.order-document-label-title{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:.45rem .66rem;
  border-right:1px solid var(--border,#dce7e2);
  background:#fff;
  color:#233d35;
  font-size:.76rem;
  font-weight:850;
  white-space:nowrap;
}
.order-document-label-sizes{
  display:flex;
  align-items:stretch;
  gap:0;
}
.order-label-size-button{
  min-height:38px!important;
  padding:.4rem .55rem!important;
  border:0!important;
  border-right:1px solid var(--border,#dce7e2)!important;
  border-radius:0!important;
  background:#f7faf9!important;
  color:#4e675e!important;
  font-size:.69rem!important;
  font-weight:850!important;
  white-space:nowrap;
  box-shadow:none!important;
}
.order-label-size-button:last-child{
  border-right:0!important;
}
.order-label-size-button:hover,
.order-label-size-button:focus-visible{
  background:#e9f4ef!important;
  color:var(--brand,#0e6b4e)!important;
}
.order-label-size-button.is-primary-size{
  background:#e1f2ea!important;
  color:#087552!important;
}
@media(max-width:980px){
  .order-document-toolbar{
    display:flex!important;
    grid-template-columns:none!important;
  }
  .order-document-pair,
  .order-document-main{
    width:auto!important;
  }
}

/* Courier history runs left-to-right; swipe/scroll for additional states. */
.courier-event-history{
  position:relative;
  display:grid!important;
  grid-template-columns:none!important;
  grid-auto-flow:column;
  grid-auto-columns:minmax(175px,1fr);
  gap:12px!important;
  width:100%;
  min-width:0;
  max-width:100%;
  margin-top:1rem;
  padding:.42rem 0 .35rem!important;
  overflow-x:auto;
  overflow-y:hidden;
  border-left:0!important;
  scroll-snap-type:x proximity;
  scrollbar-width:thin;
  -webkit-overflow-scrolling:touch;
}
.courier-event-item{
  position:relative;
  display:block!important;
  min-width:0;
  min-height:112px;
  margin:0!important;
  padding:1rem .75rem .72rem 0!important;
  border-top:2px solid var(--line,var(--border,#dce6e1));
  scroll-snap-align:start;
}
.courier-event-item:last-child{
  padding-bottom:.72rem!important;
}
.courier-event-marker{
  top:-6px!important;
  left:0!important;
}
.courier-event-head{
  align-items:flex-start!important;
  flex-direction:column!important;
  gap:.38rem!important;
}
.courier-event-content p{
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* Internal order workflow is horizontal too, on desktop and mobile. */
.order-status-history{
  display:grid!important;
  grid-template-columns:none!important;
  grid-auto-flow:column;
  grid-auto-columns:minmax(180px,1fr);
  gap:12px!important;
  width:100%;
  min-width:0;
  max-width:100%;
  padding:.45rem 0 .3rem!important;
  overflow-x:auto;
  overflow-y:hidden;
  scroll-snap-type:x proximity;
  scrollbar-width:thin;
  -webkit-overflow-scrolling:touch;
}
.order-status-history-step{
  display:block!important;
  min-width:0;
  min-height:118px;
  padding:1rem .75rem .65rem 0!important;
  border-top:2px solid var(--line,var(--border,#dce6e1))!important;
  border-left:0!important;
  scroll-snap-align:start;
}
.order-status-history-step:last-child{
  padding-bottom:.65rem!important;
  border-left:0!important;
}
.order-status-history-marker{
  top:-6px!important;
  left:0!important;
}
.order-status-history-content{
  display:flex!important;
  width:100%!important;
}
@media(max-width:520px){
  .courier-event-history{grid-auto-columns:minmax(78vw,1fr)}
  .order-status-history{grid-auto-columns:minmax(76vw,1fr)}
  .order-document-label-title{padding-inline:.55rem}
  .order-label-size-button{padding-inline:.48rem!important}
}


/* ---- Courier history v3: one-row horizontal status rail ---- */
.order-courier-tracking-card .courier-event-history{
  display:flex!important;
  flex-flow:row nowrap!important;
  align-items:stretch!important;
  gap:12px!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin-top:1rem!important;
  padding:.45rem 2px .55rem!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  border-left:0!important;
  scroll-snap-type:x proximity;
  scrollbar-width:thin;
  -webkit-overflow-scrolling:touch;
}
.order-courier-tracking-card .courier-event-item{
  position:relative!important;
  display:block!important;
  flex:0 0 clamp(185px,24vw,270px)!important;
  width:auto!important;
  min-width:185px!important;
  min-height:118px!important;
  margin:0!important;
  padding:1rem .8rem .75rem 0!important;
  border-top:2px solid var(--line,var(--border,#dce6e1))!important;
  border-left:0!important;
  scroll-snap-align:start;
}
.order-courier-tracking-card .courier-event-marker{
  top:-6px!important;
  left:0!important;
}
.order-courier-tracking-card .courier-event-head{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  gap:.4rem!important;
}
.order-courier-tracking-card .courier-event-content{
  width:100%!important;
  min-width:0!important;
}
@media(max-width:640px){
  .order-courier-tracking-card .courier-event-item{
    flex-basis:82vw!important;
    min-width:82vw!important;
  }
}

/* ========================================================================== 
   Product create/edit — responsive customer-type pricing
   ========================================================================== */
.product-form-card{width:100%;max-width:1180px;margin-left:auto;margin-right:auto;overflow:hidden}
.product-form-card + .product-form-card{margin-top:1rem}.product-form-head{align-items:flex-start;gap:1rem}.product-form{display:grid;gap:1rem}.product-form-section{margin:0;padding:1rem;border:1px solid var(--line,#dce7e2);border-radius:14px;background:#fbfdfc}.product-form-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;margin-bottom:.75rem}.product-form-section-head h3{margin:0;color:var(--tea-deep,#0a4938);font-size:.98rem}.product-form-section-head p{margin:.2rem 0 0;color:var(--muted);font-size:.78rem;line-height:1.45}.product-form-section .field{margin:0;min-width:0}.product-grid-identity,.product-pack-grid,.product-stock-grid{gap:.75rem}.product-price-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem}.product-price-grid .field{padding:.72rem;border:1px solid #dce7e2;border-radius:12px;background:#fff}.product-price-grid .price-customer{border-left:4px solid var(--tea-bright,#15966c)}.product-price-grid .price-regular{border-left-color:#2f8f65}.product-price-grid .price-retail{border-left-color:#2f6fb2}.product-price-grid .price-wholesale{border-left-color:#9a6a19}.product-option-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.65rem;margin-bottom:.85rem}.product-option-grid .check{display:flex;align-items:center;gap:.55rem;min-width:0;padding:.7rem .75rem;border:1px solid #dce7e2;border-radius:11px;background:#fff}.product-option-grid .check span{min-width:0;overflow-wrap:anywhere}.product-form-actions{justify-content:flex-end;gap:.65rem;margin-top:0}.product-form-actions .btn{min-width:110px}.product-upload-row{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap}.product-upload-row>input[type="file"]{flex:1 1 280px;min-width:0}.product-variation-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem}.product-variation-grid .field{margin:0;min-width:0}.product-variation-table{min-width:920px}
@media(max-width:980px){.product-form-card{max-width:none}.product-price-grid,.product-variation-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.product-form-card{padding:.8rem}.product-form-head{flex-direction:column;align-items:stretch}.product-form-head .row-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}.product-form-head .row-actions .btn{width:100%}.product-form-section{padding:.8rem}.product-price-grid,.product-variation-grid{grid-template-columns:1fr 1fr}.product-option-grid{grid-template-columns:1fr}.product-form-actions{display:grid;grid-template-columns:1fr 1fr}.product-form-actions .btn{width:100%;min-width:0}.product-upload-row{align-items:stretch;flex-direction:column}.product-upload-row>*{width:100%}.product-variation-table{min-width:0;border-collapse:separate;border-spacing:0}.product-variation-table thead{display:none}.product-variation-table,.product-variation-table tbody,.product-variation-table tr,.product-variation-table td{display:block;width:100%}.product-variation-table tbody{display:grid;gap:.75rem;padding:.05rem}.product-variation-table tr{padding:.8rem;border:1px solid #dce7e2;border-radius:12px;background:#fbfdfc}.product-variation-table td{display:grid;grid-template-columns:minmax(105px,.8fr) minmax(0,1.2fr);gap:.55rem;padding:.42rem 0!important;border:0!important;text-align:right!important;white-space:normal}.product-variation-table td:before{content:attr(data-label);text-align:left;color:var(--muted);font-size:.72rem;font-weight:800}.product-variation-table td.row-actions{display:flex;justify-content:flex-end;padding-top:.7rem!important;border-top:1px solid #e3ebe7!important}.product-variation-table td.row-actions:before{display:none}.product-variation-table tr:only-child td[colspan]{display:block;text-align:center!important}.product-variation-table tr:only-child td[colspan]:before{display:none}}
@media(max-width:520px){.product-form-card{padding:.65rem;border-radius:12px}.product-form-section{padding:.7rem;border-radius:12px}.product-price-grid,.product-variation-grid{grid-template-columns:1fr}.product-form-head .row-actions{grid-template-columns:1fr}.product-form-actions{grid-template-columns:1fr}.product-price-grid .field{padding:.65rem}}

/* ========================================================================== 
   Product list — compact desktop headers and card-style mobile rows
   ========================================================================== */
.product-list-card{width:100%;overflow:hidden}
.product-list-head{gap:.9rem;align-items:flex-start}
.product-list-head-actions{flex-wrap:wrap}
.product-filterbar{display:grid;grid-template-columns:minmax(230px,1.35fr) repeat(3,minmax(145px,.8fr)) auto;align-items:end}
.product-filterbar>*{width:100%!important;min-width:0!important}
.product-filterbar>.btn{width:auto!important;min-width:72px!important}
.product-list-table-wrap{max-width:100%;overflow-x:auto}
.product-list-table{width:100%;min-width:860px;table-layout:fixed}
.product-list-table th,.product-list-table td{white-space:normal;overflow-wrap:anywhere}
.product-list-table th{line-height:1.2;vertical-align:middle}
.product-list-table th:nth-child(1){width:21%}.product-list-table th:nth-child(2){width:11%}.product-list-table th:nth-child(3){width:9%}.product-list-table th:nth-child(4),.product-list-table th:nth-child(5),.product-list-table th:nth-child(6){width:10%}.product-list-table th:nth-child(7){width:9%}.product-list-table th:nth-child(8){width:8%}.product-list-table th:nth-child(9){width:12%}
.product-price-heading span,.product-price-heading small{display:block;font:inherit;color:inherit;letter-spacing:inherit;text-transform:inherit}
.product-summary{display:flex;align-items:flex-start;gap:.65rem;min-width:0}.product-summary .thumb{flex:0 0 42px;width:42px;height:42px}.product-summary-copy{min-width:0}.product-name-line{display:flex;align-items:center;gap:.35rem;flex-wrap:wrap}.product-name-line strong{overflow-wrap:anywhere}.product-identifiers{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap;margin-top:.25rem;color:var(--muted);font-size:.68rem}.product-identifiers code{font-size:.68rem}.product-list-table td.num{white-space:nowrap;overflow-wrap:normal}.product-actions-cell .row-actions{justify-content:flex-start;align-items:center;flex-wrap:wrap}.product-actions-cell form{display:inline-flex;margin:0}.product-actions-cell .btn{padding:.42rem .52rem;font-size:.7rem}.product-form-errors{scroll-margin-top:90px}.product-form-errors>strong{display:block;margin-bottom:.25rem}.product-back-link{display:inline-flex;align-items:center;gap:.38rem}.product-back-icon{font-size:1.05rem;line-height:1}
@media(max-width:1080px){.product-filterbar{grid-template-columns:minmax(220px,1.3fr) repeat(2,minmax(145px,.8fr))}.product-filterbar>.btn{width:100%!important}}
@media(max-width:820px){.product-list-head{flex-direction:column;align-items:stretch}.product-list-head-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}.product-list-head-actions .btn{width:100%}.product-filterbar{grid-template-columns:1fr 1fr}.product-filterbar>.btn{width:100%!important}.product-list-table-wrap{overflow:visible!important;border:0!important;background:transparent!important}.product-list-table{min-width:0;table-layout:auto;border-collapse:separate;border-spacing:0}.product-list-table thead{display:none}.product-list-table,.product-list-table tbody{display:block;width:100%}.product-list-table tbody{display:grid;gap:.8rem}.product-list-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 .8rem;padding:.8rem;border:1px solid var(--line,#dce7e2);border-radius:13px;background:#fff;box-shadow:0 5px 16px rgba(18,70,54,.05)}.product-list-table td{display:flex;align-items:flex-start;justify-content:space-between;gap:.7rem;width:100%;padding:.48rem 0!important;border:0!important;text-align:right!important;white-space:normal!important}.product-list-table td:before{content:attr(data-label);flex:0 0 44%;text-align:left;color:var(--muted);font-size:.7rem;font-weight:800;line-height:1.35}.product-list-table .product-main-cell{grid-column:1/-1;display:block!important;padding:0 0 .75rem!important;margin-bottom:.2rem;border-bottom:1px solid var(--line,#dce7e2)!important;text-align:left!important}.product-list-table .product-main-cell:before{display:none}.product-summary .thumb{width:48px;height:48px;flex-basis:48px}.product-list-table .product-actions-cell{grid-column:1/-1;display:block!important;padding-top:.75rem!important;margin-top:.2rem;border-top:1px solid var(--line,#dce7e2)!important}.product-list-table .product-actions-cell:before{display:none}.product-actions-cell .row-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.45rem;width:100%}.product-actions-cell .btn,.product-actions-cell form,.product-actions-cell form .btn{width:100%}.product-empty-row{display:block!important;text-align:center}.product-empty-row td{display:block!important;text-align:center!important}.product-empty-row td:before{display:none}}
@media(max-width:560px){.product-list-head-actions,.product-filterbar{grid-template-columns:1fr}.product-list-table tr{grid-template-columns:1fr}.product-list-table td{grid-column:1/-1}.product-actions-cell .row-actions{grid-template-columns:1fr 1fr}}
@media(max-width:380px){.product-actions-cell .row-actions{grid-template-columns:1fr}}

/* ========================================================================== 
   Product price reports, imports and quotations — responsive related views
   ========================================================================== */
.report-table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.report-table-wrap .report-table{width:100%}
.report-table-wrap .report-table th{min-width:88px;white-space:normal;overflow-wrap:anywhere;line-height:1.2;vertical-align:middle}
.report-table-wrap .report-table td{max-width:260px;white-space:normal;overflow-wrap:anywhere}
.report-table-wrap .report-table th.num,.report-table-wrap .report-table td.num{white-space:nowrap}
.catalog-import-card{width:100%;max-width:980px;margin-left:auto;margin-right:auto;overflow:hidden}
.catalog-import-columns{overflow-wrap:anywhere;line-height:1.55}
.catalog-import-columns code{white-space:normal;overflow-wrap:anywhere}
.quotation-form-card{width:100%;max-width:1280px;margin-left:auto;margin-right:auto;overflow:hidden}
.quotation-price-tier{display:block;margin-top:.35rem;line-height:1.35}
.quotation-items-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.quotation-items-table{min-width:1040px}
.quotation-items-table th{white-space:normal;line-height:1.2;vertical-align:middle}
.quotation-items-table select,.quotation-items-table input{width:100%;min-width:0}
.quotation-items-table th:nth-child(1),.quotation-items-table th:nth-child(2){min-width:155px}
.quotation-items-table th:nth-child(3){min-width:190px}
.quotation-items-table th:nth-child(4){min-width:90px}
.quotation-items-table th:nth-child(5),.quotation-items-table th:nth-child(6){min-width:125px}
.quotation-items-table th:nth-child(7){min-width:95px}
.quotation-item-action{width:52px;text-align:center}
@media(max-width:760px){
  .report-toolbar .report-filter-form,.report-toolbar .report-dynamic-filters{min-width:0}
  .report-table-wrap{border:1px solid var(--line,#dce7e2);border-radius:12px}
  .catalog-import-card{padding:.8rem}
  .quotation-form-card{padding:.8rem}
  .quotation-items-wrap{overflow:visible!important;border:0!important;background:transparent!important}
  .quotation-items-table{display:block;width:100%;min-width:0;border-collapse:separate;border-spacing:0}
  .quotation-items-table thead{display:none}
  .quotation-items-table tbody{display:grid;gap:.8rem;width:100%}
  .quotation-items-table tr{display:block;padding:.8rem;border:1px solid var(--line,#dce7e2);border-radius:13px;background:#fbfdfc}
  .quotation-items-table td{display:grid;grid-template-columns:minmax(115px,.8fr) minmax(0,1.2fr);align-items:center;gap:.6rem;width:100%;padding:.42rem 0!important;border:0!important;text-align:right!important;white-space:normal}
  .quotation-items-table td:before{content:attr(data-label);text-align:left;color:var(--muted);font-size:.72rem;font-weight:800;line-height:1.35}
  .quotation-items-table td.quotation-item-action{display:flex;justify-content:flex-end;width:100%;margin-top:.25rem;padding-top:.7rem!important;border-top:1px solid var(--line,#dce7e2)!important}
  .quotation-items-table td.quotation-item-action:before{display:none}
  .quotation-items-table .quote-remove{min-width:46px}
}
@media(max-width:420px){
  .quotation-items-table td{grid-template-columns:1fr;text-align:left!important}
  .quotation-items-table td:before{margin-bottom:-.25rem}
}

/* ========================================================================== 
   Report center — responsive filters, export controls and mobile report cards
   ========================================================================== */
.report-center{width:100%;min-width:0}
.report-toolbar,.report-result-card{width:100%;min-width:0;overflow:hidden}
.report-toolbar-head,.report-result-head{align-items:flex-start;gap:1rem}
.report-toolbar-title,.report-result-title{min-width:0}
.report-toolbar-title h2,.report-result-title h2{margin-bottom:.2rem;overflow-wrap:anywhere}
.report-filter-form{
  display:grid;
  grid-template-columns:minmax(220px,.9fr) minmax(0,3.1fr);
  gap:12px 14px;
  align-items:end;
  width:100%;
  min-width:0;
}
.report-filter-form .field{min-width:0;margin:0}
.report-filter-form input,.report-filter-form select{width:100%;min-width:0;max-width:100%}
.report-selector{grid-column:1;align-self:end}
.report-dynamic-filters{
  grid-column:2;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(155px,1fr));
  gap:10px;
  min-width:0;
}
.report-action-row{
  grid-column:1/-1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-width:0;
  margin-top:2px;
  padding-top:12px;
  border-top:1px solid var(--line,var(--border,#dce7e2));
}
.report-view-actions,.report-download-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}
.report-download-actions{justify-content:flex-end;margin-left:auto}
.report-action-button{min-width:82px;justify-content:center;text-align:center;white-space:normal;line-height:1.2}
.saved-report-views{min-width:0}
.report-saved-view-select,.save-report-view{min-width:0}
.saved-report-chips{display:flex;align-items:center;gap:7px;flex-wrap:wrap;min-width:0}
.saved-report-chips form{min-width:0}
.saved-report-chips .chip-delete{max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:left}
.report-row-count{flex:0 0 auto;white-space:nowrap}
.report-summary-grid{margin:0 0 14px}
.report-summary-item{
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width:0;
  min-height:82px;
  padding:12px 14px;
  border:1px solid var(--line,var(--border,#dce7e2));
  border-radius:12px;
  background:var(--surface-soft,#f7faf9);
}
.report-summary-item span{color:var(--muted,var(--text-muted,#64748b));font-size:.72rem;font-weight:700;line-height:1.35;overflow-wrap:anywhere}
.report-summary-item strong{margin-top:.3rem;font-size:1.05rem;line-height:1.25;overflow-wrap:anywhere}
.report-table-wrap{
  width:100%;
  max-width:100%;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  border:1px solid var(--line,var(--border,#dce7e2));
  border-radius:12px;
}
.report-table-wrap .report-table{
  width:max-content;
  min-width:100%;
  table-layout:auto;
  margin:0;
}
.report-table-wrap .report-table th{
  min-width:104px;
  max-width:190px;
  padding:.72rem .7rem;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:normal;
  line-height:1.18;
  vertical-align:middle;
}
.report-table-wrap .report-table th>span{display:block}
.report-table-wrap .report-table td{
  min-width:104px;
  max-width:300px;
  padding:.7rem;
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.35;
  vertical-align:top;
}
.report-table-wrap .report-table th.num,.report-table-wrap .report-table td.num{min-width:118px;white-space:nowrap}
.report-cell-value{display:block;min-width:0;overflow-wrap:anywhere}
.report-table-wrap::-webkit-scrollbar{height:9px;width:9px}
.report-table-wrap::-webkit-scrollbar-thumb{border-radius:999px;background:rgba(66,96,84,.32)}
.report-table-wrap::-webkit-scrollbar-track{background:rgba(220,231,226,.55)}
.report-result-card>.table-pager{padding:.8rem 0 0}

@media(max-width:1080px){
  .report-filter-form{grid-template-columns:1fr}
  .report-selector,.report-dynamic-filters,.report-action-row{grid-column:1}
  .report-dynamic-filters{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media(max-width:760px){
  .report-toolbar,.report-result-card{padding:.8rem}
  .report-toolbar-head,.report-result-head{flex-direction:column;align-items:stretch}
  .report-result-head{gap:.65rem}
  .report-row-count{align-self:flex-start}
  .report-dynamic-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
  .report-action-row{display:grid;grid-template-columns:1fr;align-items:stretch}
  .report-view-actions,.report-download-actions{display:grid;width:100%;margin:0;gap:.55rem}
  .report-view-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  .report-download-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
  .report-action-button{width:100%;min-width:0;min-height:40px;padding:.55rem .45rem}
  .saved-report-views{display:grid;grid-template-columns:1fr;align-items:stretch}
  .saved-report-views .inline-flex{display:grid;grid-template-columns:1fr;width:100%;align-items:stretch}
  .saved-report-views .inline-flex>*,.saved-report-views .field.compact,.save-report-view input{width:100%;min-width:0;max-width:100%}
  .save-report-view .check{justify-content:flex-start}
  .saved-report-chips{width:100%}
  .report-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem}
  .report-summary-item{min-height:76px;padding:10px 11px}
}

@media(max-width:680px){
  .report-table-wrap{overflow:visible;border:0;border-radius:0;background:transparent}
  .report-table-wrap .report-table{display:block;width:100%;min-width:0;border-collapse:separate;border-spacing:0;background:transparent}
  .report-table-wrap .report-table thead{display:none}
  .report-table-wrap .report-table tbody{display:grid;width:100%;gap:.75rem}
  .report-table-wrap .report-table tr{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0 .85rem;
    width:100%;
    padding:.72rem .8rem;
    border:1px solid var(--line,var(--border,#dce7e2));
    border-radius:12px;
    background:var(--surface,#fff);
    box-shadow:0 5px 16px rgba(18,70,54,.045);
  }
  .report-table-wrap .report-table td,
  .report-table-wrap .report-table td.num{
    display:grid;
    grid-template-columns:minmax(90px,.85fr) minmax(0,1.15fr);
    align-items:start;
    gap:.55rem;
    width:100%;
    min-width:0;
    max-width:none;
    padding:.48rem 0!important;
    border:0!important;
    border-bottom:1px dashed rgba(186,204,196,.65)!important;
    white-space:normal;
    text-align:right!important;
  }
  .report-table-wrap .report-table td:nth-last-child(-n+2){border-bottom-color:transparent!important}
  .report-table-wrap .report-table td:before{
    content:attr(data-label);
    min-width:0;
    color:var(--muted,var(--text-muted,#64748b));
    font-size:.69rem;
    font-weight:800;
    line-height:1.35;
    text-align:left;
    overflow-wrap:anywhere;
  }
  .report-table-wrap .report-table td .report-cell-value{min-width:0;text-align:right;overflow-wrap:anywhere}
  .report-table-wrap .report-table .report-empty-row{display:block!important;padding:.9rem}
  .report-table-wrap .report-table .report-empty-row td{display:block!important;padding:.7rem!important;border:0!important;text-align:center!important}
  .report-table-wrap .report-table .report-empty-row td:before{display:none}
  .report-result-card>.table-pager{justify-content:space-between;gap:.45rem}
  .report-result-card>.table-pager .btn{flex:1;justify-content:center}
}

@media(max-width:500px){
  .report-toolbar,.report-result-card{padding:.68rem;border-radius:12px}
  .report-dynamic-filters{grid-template-columns:1fr}
  .report-summary-grid{grid-template-columns:1fr}
  .report-download-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
  .report-table-wrap .report-table tr{grid-template-columns:1fr;padding:.7rem}
  .report-table-wrap .report-table td,.report-table-wrap .report-table td.num{grid-column:1/-1;border-bottom:1px dashed rgba(186,204,196,.65)!important}
  .report-table-wrap .report-table td:last-child{border-bottom-color:transparent!important}
}

@media(max-width:360px){
  .report-view-actions,.report-download-actions{grid-template-columns:1fr}
  .report-table-wrap .report-table td,.report-table-wrap .report-table td.num{grid-template-columns:1fr;text-align:left!important}
  .report-table-wrap .report-table td .report-cell-value{text-align:left}
}

@media print{
  .report-toolbar{display:none!important}
  .report-result-card{padding:0!important;border:0!important;box-shadow:none!important}
  .report-table-wrap{max-height:none!important;overflow:visible!important;border:0!important}
  .report-table-wrap .report-table{width:100%!important;min-width:0!important}
}
/* Product create: inline variation setup */
.product-variation-toggle{
  border-color:#9fd6c4;
  background:#f1fbf7;
}
.product-new-variation-panel{
  border:1px solid #b9ded1;
  border-radius:16px;
  background:linear-gradient(180deg,#f7fcfa 0%,#f2faf7 100%);
  padding:1rem;
}
.variation-builder-head{
  align-items:flex-start;
  gap:1rem;
}
.variation-builder-head p{
  margin:.3rem 0 0;
  color:var(--muted);
  line-height:1.5;
}
.variation-builder-list{
  display:grid;
  gap:.9rem;
}
.variation-entry-card{
  min-width:0;
  border:1px solid #d5e7e0;
  border-radius:14px;
  background:#fff;
  padding:.9rem;
  box-shadow:0 5px 16px rgba(18,70,54,.045);
}
.variation-entry-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  padding-bottom:.65rem;
  margin-bottom:.8rem;
  border-bottom:1px solid #e6efeb;
}
.variation-entry-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.75rem;
  align-items:end;
}
.variation-entry-grid .field,
.variation-entry-grid .check{
  min-width:0;
  margin:0;
}
.variation-entry-grid .variation-attributes-field{
  grid-column:span 2;
}
.variation-active-check{
  min-height:44px;
  align-self:end;
}
.variation-builder-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.8rem;
  margin-top:.9rem;
  padding-top:.85rem;
  border-top:1px dashed #c9ddd5;
}
.product-form-actions [hidden],
.product-parent-opening-field[hidden],
.product-new-variation-panel[hidden]{
  display:none!important;
}

@media(max-width:1100px){
  .variation-entry-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media(max-width:820px){
  .variation-entry-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .variation-entry-grid .variation-attributes-field{grid-column:1/-1}
  .variation-builder-toolbar{align-items:flex-start;flex-direction:column}
}

@media(max-width:560px){
  .product-new-variation-panel{padding:.72rem;border-radius:12px}
  .variation-builder-head{display:flex;flex-direction:column;align-items:flex-start}
  .variation-entry-card{padding:.72rem;border-radius:12px}
  .variation-entry-head{align-items:flex-start}
  .variation-entry-grid{grid-template-columns:1fr}
  .variation-entry-grid .variation-attributes-field{grid-column:auto}
  .variation-remove-btn{white-space:nowrap}
  .variation-builder-toolbar .btn{width:100%;justify-content:center}
  .product-form-actions{display:grid;grid-template-columns:1fr;width:100%}
  .product-form-actions .btn{width:100%;justify-content:center}
}

/* =====================================================================
   Mobile POS cart + responsive in-flow sale/order actions — 2026-07-22
   - Keeps every POS cart control inside the phone width.
   - Keeps Hold sale and Complete sale inside the POS summary action area.
   - Keeps New Sales actions responsive in normal page flow.
   ===================================================================== */
.pos-mobile-dock,
.pos-mobile-dock-spacer{display:none}

@media(max-width:760px){
  .pos-cart.card{overflow:visible}
  .pos-cart .pos-cart-table-wrap{
    width:100%;
    max-width:100%;
    overflow:visible!important;
    border:0!important;
  }
  .pos-cart .pos-cart-table,
  .pos-cart .pos-cart-table tbody{
    display:block;
    width:100%;
    min-width:0!important;
  }
  .pos-cart .pos-cart-table colgroup,
  .pos-cart .pos-cart-table thead{display:none}
  .pos-cart .pos-cart-table tr{
    position:relative;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px 12px;
    width:100%;
    min-width:0;
    margin:0 0 10px;
    padding:12px;
    border:1px solid #dbe7e1;
    border-radius:14px;
    background:#fbfdfc;
    box-sizing:border-box;
  }
  .pos-cart .pos-cart-table td,
  .pos-cart .pos-cart-table td.num{
    display:flex;
    min-width:0;
    width:100%;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    padding:0!important;
    border:0!important;
    text-align:right!important;
    box-sizing:border-box;
  }
  .pos-cart .pos-cart-table td::before{
    content:attr(data-label);
    flex:0 0 auto;
    color:#75877f;
    font-size:.67rem;
    font-weight:800;
    line-height:1.25;
    text-align:left;
    text-transform:uppercase;
    letter-spacing:.03em;
  }
  .pos-cart .pos-cart-table .pos-product-cell{
    grid-column:1/-1;
    display:flex!important;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
    min-width:0!important;
    padding-right:36px!important;
    text-align:left!important;
  }
  .pos-cart .pos-cart-table .pos-product-cell::before{display:none}
  .pos-cart .pos-cart-table .pos-product-cell strong{
    min-width:0;
    flex:1 1 auto;
    font-size:.82rem;
    line-height:1.35;
    overflow-wrap:anywhere;
  }
  .pos-cart .pos-cart-table .pos-product-cell .tiny{
    flex:0 0 auto;
    margin:1px 0 0;
    font-size:.64rem;
    line-height:1.25;
    text-align:right;
    white-space:nowrap;
  }
  .pos-cart .pos-cart-table .pos-qty-cell,
  .pos-cart .pos-cart-table .pos-price-cell{grid-column:span 1}
  .pos-cart .pos-cart-table .pos-qty-cell .qty{
    width:auto;
    min-width:0;
    margin-left:auto;
    justify-content:flex-end;
  }
  .pos-cart .pos-cart-table .pos-qty-cell .qinput{width:48px;min-width:0}
  .pos-cart .pos-cart-table .pos-price-cell .pos-line-price{
    width:94px;
    max-width:100%;
    min-width:0;
    margin-left:auto;
    text-align:right;
    font-weight:750;
  }
  .pos-cart .pos-cart-table .pos-line-total{
    grid-column:1/-1;
    padding-top:9px!important;
    border-top:1px dashed #d8e4de!important;
    color:#075f45;
    font-weight:850;
    font-variant-numeric:tabular-nums;
    white-space:nowrap;
  }
  .pos-cart .pos-cart-table .pos-action-cell{
    position:absolute;
    top:8px;
    right:8px;
    width:auto;
  }
  .pos-cart .pos-cart-table .pos-action-cell::before{display:none}
  .pos-cart .pos-cart-table .pos-action-cell .btn{
    width:30px;
    height:30px;
    min-height:0;
    margin:0;
    padding:0;
    border-radius:9px;
    color:#b33d3d;
  }
  .pos-cart .pos-cart-table tr.empty{
    display:block;
    padding:15px 12px;
  }
  .pos-cart .pos-cart-table tr.empty td{
    display:block;
    text-align:center!important;
  }
  .pos-cart .pos-cart-table tr.empty td::before{display:none}

  .pos-actions{
    grid-template-columns:1fr!important;
    width:100%;
    gap:8px;
  }
  .pos-actions .btn{
    width:100%;
    min-width:0;
    min-height:44px;
  }
  .pos-mobile-dock,
  .pos-mobile-dock-spacer{display:none!important}

  .order-create-page,
  .order-builder-layout,
  .order-catalog,
  .order-checkout,
  .order-review-section{
    width:100%;
    max-width:100%;
    min-width:0;
    box-sizing:border-box;
  }
  .order-create-page{padding-bottom:0!important;overflow-x:hidden}
  .order-checkout :where(.grid,.field,input,select,textarea,.delivery-charge-control,.target-total-box){min-width:0;max-width:100%}
  .order-checkout :where(input,select,textarea){width:100%;box-sizing:border-box}

  body .order-mobile-dock{
    position:static!important;
    inset:auto!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    z-index:auto!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(170px,220px)!important;
    align-items:center!important;
    gap:10px!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0 0 1.2rem!important;
    padding:10px 11px!important;
    border:1px solid #bcd8cd!important;
    border-radius:14px!important;
    background:#fff!important;
    box-shadow:0 7px 20px rgba(13,54,42,.10)!important;
    backdrop-filter:none!important;
    transition:none!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  body .order-mobile-dock-summary{
    width:100%!important;
    min-width:0!important;
    overflow:hidden!important;
  }
  body .order-mobile-dock-summary small,
  body .order-mobile-dock-summary>span{
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  body.order-keyboard-open .order-mobile-dock{padding:10px 11px!important}
  body.order-keyboard-open .order-mobile-dock-summary small,
  body.order-keyboard-open .order-mobile-dock-summary>span{display:block!important}
  body.order-keyboard-open .order-mobile-dock .btn{min-height:44px!important}
  body .order-mobile-dock-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    width:100%!important;
    min-width:0!important;
    max-width:220px!important;
    gap:7px!important;
  }
  body .order-mobile-dock-actions .btn{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:44px!important;
    padding-inline:8px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    box-sizing:border-box!important;
  }
}

@media(max-width:420px){
  .pos-cart .pos-cart-table tr{grid-template-columns:1fr}
  .pos-cart .pos-cart-table .pos-qty-cell,
  .pos-cart .pos-cart-table .pos-price-cell,
  .pos-cart .pos-cart-table .pos-line-total{grid-column:1}
  .pos-cart .pos-cart-table .pos-product-cell{
    flex-direction:column;
    padding-right:36px!important;
  }
  .pos-cart .pos-cart-table .pos-product-cell .tiny{
    margin-top:2px;
    text-align:left;
  }
  body .order-mobile-dock{
    grid-template-columns:1fr!important;
    align-items:stretch!important;
    gap:8px!important;
    padding:10px!important;
  }
  body .order-mobile-dock-summary{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    column-gap:10px!important;
    row-gap:1px!important;
    align-items:end!important;
  }
  body .order-mobile-dock-summary small{
    grid-column:1/-1!important;
    white-space:normal!important;
  }
  body .order-mobile-dock-summary strong{grid-column:1!important}
  body .order-mobile-dock-summary>span{
    grid-column:2!important;
    text-align:right!important;
    white-space:normal!important;
  }
  body .order-mobile-dock-actions{
    width:100%!important;
    max-width:none!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body .order-mobile-dock-actions .btn{
    min-height:42px!important;
    padding-inline:10px!important;
  }
}


/* New Sales mobile: keep courier status metrics in one row and let the page scroll normally. */
@media(max-width:760px){
  .order-create-page .courier-risk-panel .courier-provider-metrics,
  .order-create-page .pos-courier-history-block .courier-provider-metrics{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:5px!important;
  }

  .order-create-page .courier-provider-scroll,
  .pos-courier-history-block .courier-provider-scroll,
  .courier-history-card .courier-provider-scroll{
    max-height:none!important;
    overflow:visible!important;
    overscroll-behavior:auto!important;
    scrollbar-gutter:auto!important;
    touch-action:pan-y!important;
  }
}

/* POS mobile: match New Sales courier layout and show customer data in 2 rows × 3 columns. */
@media(max-width:760px){
  .pos-courier-history-block .courier-provider-metrics{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:5px!important;
  }
  .pos-courier-history-block .courier-provider-metrics>span{
    min-width:0!important;
    padding:6px 4px!important;
  }
  .pos-courier-history-block .courier-provider-metrics small{
    min-height:2.2em!important;
    font-size:.56rem!important;
    line-height:1.05!important;
  }

  .pos-customer-history .pos-customer-primary{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:6px!important;
  }
  .pos-customer-history .pos-history-stat{
    min-height:76px!important;
    padding:8px 7px!important;
  }
  .pos-customer-history .pos-history-stat span{
    font-size:.62rem!important;
    line-height:1.15!important;
  }
  .pos-customer-history .pos-history-stat strong{
    font-size:.9rem!important;
  }
}

/* ========================================================================== 
   Order register — desktop fit only
   Mobile keeps the original table layout and horizontal scrolling.
   ========================================================================== */
@media (min-width:821px){
  .order-table-wrap{
    position:relative;
    display:block;
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-inline:contain;
    scrollbar-width:thin;
  }

  .order-list-table{
    width:100%;
    min-width:0;
    table-layout:fixed;
    margin:0;
  }

  .order-list-table.has-bulk-select col.order-col-select{width:3.5%}
  .order-list-table.has-bulk-select col.order-col-id{width:10.5%}
  .order-list-table.has-bulk-select col.order-col-customer{width:16%}
  .order-list-table.has-bulk-select col.order-col-commercial{width:12%}
  .order-list-table.has-bulk-select col.order-col-delivery{width:17.5%}
  .order-list-table.has-bulk-select col.order-col-status{width:14%}
  .order-list-table.has-bulk-select col.order-col-total{width:8%}
  .order-list-table.has-bulk-select col.order-col-due{width:8%}
  .order-list-table.has-bulk-select col.order-col-actions{width:10.5%}

  .order-list-table.no-bulk-select col.order-col-id{width:11%}
  .order-list-table.no-bulk-select col.order-col-customer{width:16.5%}
  .order-list-table.no-bulk-select col.order-col-commercial{width:12.5%}
  .order-list-table.no-bulk-select col.order-col-delivery{width:18.5%}
  .order-list-table.no-bulk-select col.order-col-status{width:14.5%}
  .order-list-table.no-bulk-select col.order-col-total{width:8%}
  .order-list-table.no-bulk-select col.order-col-due{width:8%}
  .order-list-table.no-bulk-select col.order-col-actions{width:11%}

  .order-list-table th,
  .order-list-table td{
    min-width:0;
    padding:.62rem .46rem;
    vertical-align:top;
  }

  .order-list-table th{
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .order-list-table .order-select-col{
    text-align:center;
    padding-left:.25rem;
    padding-right:.25rem;
  }

  .order-list-table .order-cell-stack{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:.27rem;
    width:100%;
    min-width:0;
    max-width:100%;
  }

  .order-list-table .copy-line{
    display:flex;
    flex-wrap:nowrap;
    align-items:center;
    gap:.28rem;
    width:100%;
    min-width:0;
    max-width:100%;
  }

  .order-list-table .copy-line>a,
  .order-list-table .copy-line>span,
  .order-list-table .copy-line>code{
    min-width:0;
    max-width:100%;
  }

  .order-list-table .order-id-line,
  .order-list-table .order-id-line>a,
  .order-list-table .order-id-line code{
    width:auto;
    white-space:nowrap!important;
  }

  .order-list-table .copy-value,
  .order-list-table .delivery-number-line .copy-value,
  .order-list-table .parcel-copy-row code{
    display:block;
    min-width:0;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap!important;
  }

  .order-list-table .inline-copy-btn{
    display:inline-grid;
    place-items:center;
    flex:0 0 24px;
    width:24px;
    height:24px;
    min-width:24px;
    padding:0;
    border:1px solid var(--border,#dce7e2);
    border-radius:6px;
    background:#fff;
    color:#415b52;
    font:inherit;
    font-size:.72rem;
    line-height:1;
    cursor:pointer;
  }

  .order-list-table .inline-copy-btn:hover,
  .order-list-table .inline-copy-btn:focus-visible{
    border-color:#a9c9bc;
    background:#eef7f3;
    color:var(--brand,#0e6b4e);
  }

  .order-list-table .order-date-block{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:.04rem .26rem;
    width:100%;
    color:#33483f;
    font-size:.72rem;
    line-height:1.3;
  }

  .order-list-table .order-date-block>span{
    display:block;
    white-space:nowrap!important;
  }

  .order-list-table .order-date-block>span+span::before{
    content:"•";
    margin-right:.26rem;
    color:var(--muted,#5f726b);
  }

  .order-list-table .badge{
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    line-height:1.22;
    white-space:nowrap!important;
  }

  .order-list-table .order-customer-stack>strong,
  .order-list-table .order-source-label,
  .order-list-table .courier-name{
    display:block;
    width:100%;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .order-list-table .parcel-copy-row{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:.12rem;
    width:100%;
    min-width:0;
  }

  .order-list-table .parcel-copy-row .copy-line{
    width:100%;
    max-width:100%;
  }

  .order-list-table .order-total-col,
  .order-list-table .order-due-col{
    white-space:nowrap!important;
    font-variant-numeric:tabular-nums;
  }

  .order-list-table .order-actions-col .row-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.3rem;
    width:100%;
  }

  .order-list-table .order-actions-col .btn{
    width:100%;
    min-width:0;
    justify-content:center;
    padding:.34rem .25rem;
    font-size:.7rem;
    white-space:nowrap;
  }

  .order-table-wrap::-webkit-scrollbar{height:8px}
  .order-table-wrap::-webkit-scrollbar-thumb{border-radius:999px;background:rgba(66,96,84,.32)}
  .order-table-wrap::-webkit-scrollbar-track{background:rgba(220,231,226,.55)}
}

@media (min-width:821px) and (max-width:1180px){
  .order-list-table{font-size:.86rem}
  .order-list-table th,
  .order-list-table td{padding:.56rem .34rem}
  .order-list-table .order-cell-stack{gap:.23rem}
  .order-list-table .badge{padding:.2rem .42rem;font-size:.66rem}
  .order-list-table .small{font-size:.75rem}
  .order-list-table .tiny{font-size:.66rem}
  .order-list-table .inline-copy-btn{
    flex-basis:22px;
    width:22px;
    height:22px;
    min-width:22px;
  }
  .order-list-table .order-actions-col .btn{font-size:.67rem}
}

/* ========================================================================== 
   Dashboard KPI consistency
   Give the final four KPI cards the same coloured top border, icon tile and
   value treatment used by the first eight cards on desktop and mobile.
   ========================================================================== */
.dashboard-summary-grid .stat:nth-child(9){
  --dashboard-kpi-accent:#e4572e;
  --dashboard-kpi-soft:#fde9e2;
  border-top:3px solid var(--dashboard-kpi-accent);
}
.dashboard-summary-grid .stat:nth-child(10){
  --dashboard-kpi-accent:#0e9f6e;
  --dashboard-kpi-soft:#dff5eb;
  border-top:3px solid var(--dashboard-kpi-accent);
}
.dashboard-summary-grid .stat:nth-child(11){
  --dashboard-kpi-accent:#6366f1;
  --dashboard-kpi-soft:#e8e9fd;
  border-top:3px solid var(--dashboard-kpi-accent);
}
.dashboard-summary-grid .stat:nth-child(12){
  --dashboard-kpi-accent:#d9822b;
  --dashboard-kpi-soft:#fbeed9;
  border-top:3px solid var(--dashboard-kpi-accent);
}
.dashboard-summary-grid .stat:nth-child(n+9):nth-child(-n+12) .stat-ic{
  background:var(--dashboard-kpi-soft);
  color:var(--dashboard-kpi-accent);
}
.dashboard-summary-grid .stat:nth-child(n+9):nth-child(-n+12) .stat-value{
  background:none;
  -webkit-background-clip:border-box;
  background-clip:border-box;
  -webkit-text-fill-color:initial;
  color:var(--dashboard-kpi-accent);
}
.dashboard-summary-grid .stat.stat-danger:nth-child(n+9):nth-child(-n+12) .stat-value{
  color:var(--red)!important;
}

/* Order register copy buttons: keep the copy icon only, without an outer box. */
.order-list-table .inline-copy-btn,
.order-list-table .inline-copy-btn:hover,
.order-list-table .inline-copy-btn:focus-visible,
.order-list-table .inline-copy-btn:active{
  -webkit-appearance:none;
  appearance:none;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  padding:0!important;
}
.order-list-table .inline-copy-btn{color:#415b52}
.order-list-table .inline-copy-btn:hover,
.order-list-table .inline-copy-btn:focus-visible{color:var(--brand,#0e6b4e)}

/* Order detail header: aligned responsive document actions (desktop + mobile). */
.tea-business-ui .page-head.order-show-head{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  align-items:start!important;
  gap:.9rem!important;
}
.order-show-head>div:first-child{
  width:100%;
  min-width:0;
}
.order-show-head .order-status-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.42rem;
  min-width:0;
}
.order-show-head .order-document-toolbar{
  display:grid!important;
  grid-template-columns:minmax(92px,.62fr) repeat(4,minmax(138px,1fr))!important;
  align-items:stretch!important;
  gap:.5rem!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  padding:0!important;
  overflow:visible!important;
}
.order-show-head .order-document-toolbar>*{
  min-width:0!important;
  max-width:100%;
}
.order-show-head .order-back-button{
  display:flex!important;
  grid-column:auto!important;
  align-items:center;
  justify-content:center!important;
  width:100%!important;
  min-width:0!important;
  min-height:40px!important;
  white-space:nowrap;
}
.order-show-head .order-document-control{
  display:grid;
  grid-template-columns:minmax(0,1fr) 36px;
  align-items:stretch;
  width:100%;
  min-width:0;
}
.order-show-head .order-document-main{
  display:flex!important;
  align-items:center;
  justify-content:center!important;
  width:100%!important;
  min-width:0!important;
  min-height:40px!important;
  padding-inline:.58rem!important;
  border-radius:8px 0 0 8px!important;
  border-right:0!important;
  overflow:hidden;
  white-space:nowrap;
}
.order-show-head .order-document-main>span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.order-show-head .order-document-main>small{
  flex:0 0 auto;
  white-space:nowrap;
}
.order-show-head .order-document-size-menu{
  position:relative;
  display:block!important;
  width:36px;
  min-width:36px;
  min-height:40px;
}
.order-show-head .order-document-size-toggle{
  display:flex!important;
  align-items:center;
  justify-content:center!important;
  width:36px!important;
  min-width:36px!important;
  height:100%!important;
  min-height:40px!important;
  padding:0!important;
  border-radius:0 8px 8px 0!important;
}
.order-show-head .order-document-size-toggle>span{
  line-height:1;
  transform:translateY(-1px);
}

@media(max-width:980px){
  .order-show-head .order-document-toolbar{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .order-show-head .order-back-button{
    grid-column:1/-1!important;
  }
}
@media(max-width:430px){
  .tea-business-ui .page-head.order-show-head{
    gap:.72rem!important;
  }
  .order-show-head .order-document-toolbar{
    grid-template-columns:minmax(0,1fr)!important;
    gap:.42rem!important;
  }
  .order-show-head .order-back-button{
    grid-column:1!important;
  }
  .order-show-head .order-document-main{
    justify-content:flex-start!important;
    padding-inline:.72rem!important;
  }
}

/* Order detail document-size menu: mobile-only alignment fix. */
@media(max-width:760px){
  .order-show-head .order-document-control{
    position:relative;
    grid-template-columns:minmax(0,1fr) 36px;
    align-items:stretch;
  }
  .order-show-head .order-document-size-menu{
    display:contents!important;
    position:static!important;
    width:auto!important;
    min-width:0!important;
  }
  .order-show-head .order-document-size-toggle{
    grid-column:2;
    grid-row:1;
  }
  .order-show-head .order-document-size-list{
    position:static!important;
    grid-column:1/-1;
    grid-row:2;
    left:auto!important;
    right:auto!important;
    top:auto!important;
    bottom:auto!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    max-height:none!important;
    margin:.38rem 0 0!important;
    padding:.38rem!important;
    overflow:visible!important;
    grid-template-columns:1fr!important;
    border-radius:9px!important;
    box-shadow:0 7px 18px rgba(15,55,43,.12)!important;
  }
  .order-show-head .order-document-size-list a{
    width:100%;
    min-width:0;
    min-height:34px;
    justify-content:space-between;
    gap:.55rem;
    padding:.45rem .58rem;
    white-space:normal;
  }
  .order-show-head .order-document-size-list a small{
    flex:0 0 auto;
    color:var(--brand,#0e6b4e);
    font-size:.64rem;
    font-weight:850;
  }
}

/* =========================================================
   Order detail — Return history responsive alignment only
   ========================================================= */
.order-return-history-card{
  min-width:0;
}
.order-return-history-card > .card-head{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  align-items:start;
  gap:10px;
}
.order-return-history-card > .card-head > div{
  min-width:0;
}
.order-return-history-card > .card-head h2,
.order-return-history-card > .card-head p{
  max-width:100%;
  overflow-wrap:anywhere;
}
.order-return-history-card > .card-head p{
  margin:.35rem 0 0;
  line-height:1.5;
}
.order-return-history-card > .card-head > .btn{
  justify-self:start;
  max-width:100%;
  white-space:normal;
  text-align:center;
}
.order-return-history-card .return-history-timeline{
  min-width:0;
  width:100%;
}
.order-return-history-card .return-history-timeline .return-history-item{
  display:block!important;
  grid-template-columns:none!important;
  min-width:0;
  width:100%;
  box-sizing:border-box;
}
.order-return-history-card .return-history-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:8px;
  min-width:0;
}
.order-return-history-card .return-history-head > strong{
  flex:1 1 120px;
  min-width:0;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.order-return-history-card .return-history-head > .badge{
  flex:0 1 auto;
  max-width:100%;
  white-space:normal;
  text-align:center;
}
.order-return-history-card .return-history-money{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:stretch;
  gap:8px;
  min-width:0;
}
.order-return-history-card .return-history-money > span{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  min-width:0;
  box-sizing:border-box;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.order-return-history-card .return-history-money b{
  display:block;
  max-width:100%;
  margin-top:2px;
  white-space:nowrap;
}
.order-return-history-card .return-history-state{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  align-items:start;
  gap:7px;
  min-width:0;
}
.order-return-history-card .return-history-state > .badge{
  justify-self:start;
  max-width:100%;
  white-space:normal;
  text-align:left;
  line-height:1.35;
}
.order-return-history-card .return-history-state > small,
.order-return-history-card .return-history-created{
  min-width:0;
  max-width:100%;
  line-height:1.5;
  overflow-wrap:anywhere;
}
.order-return-history-card .return-history-item > .btn{
  max-width:100%;
  white-space:normal;
  text-align:center;
}

@media(max-width:480px){
  .order-return-history-card > .card-head > .btn,
  .order-return-history-card .return-history-item > .btn{
    width:100%;
    justify-content:center;
  }
  .order-return-history-card .return-history-head{
    flex-direction:column;
  }
  .order-return-history-card .return-history-head > strong{
    flex:0 1 auto;
    width:100%;
  }
  .order-return-history-card .return-history-money{
    grid-template-columns:minmax(0,1fr);
  }
}

/* ========================================================================== 
   POS customer contact / courier check responsive alignment only
   Keeps both phone fields and the check action inside the cart card.
   ========================================================================== */
.pos-contact-phone-bar{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:end!important;
  gap:9px;
  width:100%;
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
}
.pos-contact-phone-bar > .field{
  width:100%!important;
  min-width:0!important;
  max-width:100%;
  margin:0!important;
}
.pos-contact-phone-bar > .field > span{
  display:block;
  max-width:100%;
  line-height:1.25;
  overflow-wrap:anywhere;
}
.pos-contact-phone-bar > .field input{
  display:block;
  width:100%;
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
}
.pos-contact-phone-bar #posCourierCheck{
  grid-column:1/-1;
  justify-self:end;
  width:auto!important;
  min-width:118px;
  max-width:100%;
  margin:0;
  white-space:nowrap;
}
.pos-contact-phone-bar .pos-courier-check-message{
  grid-column:1/-1;
  display:block;
  width:100%;
  min-width:0!important;
  max-width:100%;
  padding:0!important;
  overflow-wrap:anywhere;
}

@media(max-width:620px){
  .pos-contact-phone-bar{
    grid-template-columns:minmax(0,1fr);
    align-items:stretch!important;
  }
  .pos-contact-phone-bar #posCourierCheck{
    grid-column:1;
    justify-self:stretch;
    width:100%!important;
    min-width:0;
  }
  .pos-contact-phone-bar .pos-courier-check-message{grid-column:1}
}

/* ========================================================================== 
   Dashboard expense + stock tables: mobile-only fit and alignment
   Desktop/tablet rendering remains unchanged.
   ========================================================================== */
@media(max-width:700px){
  .dashboard-responsive-page .dashboard-mobile-table-card{
    width:100%;
    min-width:0;
    max-width:100%;
    overflow:hidden;
    box-sizing:border-box;
  }
  .dashboard-responsive-page .dashboard-mobile-table-card .card-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:.5rem;
    min-width:0;
  }
  .dashboard-responsive-page .dashboard-mobile-table-card .card-head h2{
    flex:1 1 auto;
    min-width:0;
    margin:0;
    overflow-wrap:anywhere;
  }
  .dashboard-responsive-page .dashboard-mobile-table-card .card-head .btn{
    flex:0 0 auto;
    max-width:100%;
  }
  .dashboard-responsive-page .dashboard-mobile-table-card .table-wrap{
    width:100%;
    max-width:100%;
    min-width:0;
    overflow:visible!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
  }
  .dashboard-responsive-page .dashboard-mobile-table{
    display:block;
    width:100%!important;
    max-width:100%;
    min-width:0!important;
    table-layout:auto;
    border-collapse:separate;
    border-spacing:0;
    background:transparent;
  }
  .dashboard-responsive-page .dashboard-mobile-table thead{display:none}
  .dashboard-responsive-page .dashboard-mobile-table tbody{
    display:grid;
    width:100%;
    min-width:0;
    gap:.55rem;
  }
  .dashboard-responsive-page .dashboard-mobile-table tbody tr{
    display:grid;
    width:100%;
    min-width:0;
    padding:.62rem .68rem;
    border:1px solid var(--border,#dce7e2);
    border-radius:10px;
    background:#fbfdfc;
    box-sizing:border-box;
  }
  .dashboard-responsive-page .dashboard-mobile-table tbody td,
  .dashboard-responsive-page .dashboard-mobile-table tbody td.num{
    display:grid;
    grid-template-columns:minmax(86px,.78fr) minmax(0,1.22fr);
    align-items:start;
    gap:.6rem;
    width:100%!important;
    min-width:0;
    max-width:100%;
    padding:.3rem 0!important;
    border:0!important;
    border-bottom:1px dashed rgba(186,204,196,.68)!important;
    text-align:right!important;
    white-space:normal!important;
    overflow-wrap:anywhere;
    word-break:normal;
    box-sizing:border-box;
  }
  .dashboard-responsive-page .dashboard-mobile-table tbody td:last-child{
    border-bottom-color:transparent!important;
  }
  .dashboard-responsive-page .dashboard-mobile-table tbody td::before{
    content:attr(data-label);
    min-width:0;
    color:var(--text-muted,#64776e);
    font-size:.66rem;
    font-weight:800;
    line-height:1.35;
    letter-spacing:.035em;
    text-align:left;
    text-transform:uppercase;
    overflow-wrap:anywhere;
  }
  .dashboard-responsive-page .dashboard-mobile-table tbody td > code{
    display:inline-block;
    max-width:100%;
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:break-word;
  }
  .dashboard-responsive-page .dashboard-mobile-table tbody td.low{
    font-weight:800;
  }
  .dashboard-responsive-page .dashboard-mobile-table .dashboard-table-empty{
    display:block;
    padding:.45rem;
  }
  .dashboard-responsive-page .dashboard-mobile-table .dashboard-table-empty td{
    display:block;
    padding:.65rem!important;
    border:0!important;
    text-align:center!important;
  }
  .dashboard-responsive-page .dashboard-mobile-table .dashboard-table-empty td::before{display:none}
}

@media(max-width:360px){
  .dashboard-responsive-page .dashboard-mobile-table tbody td,
  .dashboard-responsive-page .dashboard-mobile-table tbody td.num{
    grid-template-columns:1fr;
    gap:.16rem;
    text-align:left!important;
  }
}


/* ===== Order details: unified courier action boxes ===== */
.return-action-dock .courier-outcome-actions{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
  gap:12px;
  align-items:stretch;
}
.return-action-dock .courier-outcome-actions .order-action-button,
.return-action-dock .courier-outcome-actions .courier-outcome-btn,
.return-action-dock .courier-outcome-actions .contact-action-btn,
.return-action-dock .courier-outcome-actions .return-receive-btn{
  width:100%!important;
  min-width:0!important;
  min-height:50px;
  display:flex!important;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  padding:12px 16px!important;
  border-radius:14px!important;
  box-shadow:0 10px 22px rgba(14,53,40,.10);
  text-align:left;
  white-space:normal;
}
.return-action-dock .courier-outcome-actions .order-action-button span:last-child{
  flex:1 1 auto;
  min-width:0;
  overflow-wrap:anywhere;
}
.return-action-dock .courier-outcome-actions .courier-outcome-icon{
  flex:0 0 34px;
  width:34px;
  height:34px;
  border-radius:10px;
  background:rgba(255,255,255,.18);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.15);
}
.return-action-dock .courier-outcome-actions .is-partial-delivery .courier-outcome-icon{
  background:#d8efe5;
  color:#0f7a57;
}
.return-action-dock .courier-outcome-actions .is-charge-return .courier-outcome-icon,
.return-action-dock .courier-outcome-actions .is-full-return .courier-outcome-icon,
.return-action-dock .courier-outcome-actions .is-receive .courier-outcome-icon,
.return-action-dock .courier-outcome-actions .is-call .courier-outcome-icon,
.return-action-dock .courier-outcome-actions .is-whatsapp .courier-outcome-icon,
.return-action-dock .courier-outcome-actions .is-exchange .courier-outcome-icon{
  background:rgba(255,255,255,.20);
}
@media (max-width: 760px){
  .return-action-dock .courier-outcome-actions{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}
@media (max-width: 520px){
  .return-action-dock .courier-outcome-actions{
    grid-template-columns:1fr!important;
  }
}

/* ===== Messaging gateway cards and provider form (2026-07-26) ===== */
.message-gateway-panel{overflow:hidden}
.message-gateway-panel-head{align-items:flex-start;gap:1rem;margin-bottom:1rem}
.message-gateway-panel-head h2{margin:0 0 .25rem}
.message-gateway-panel-head p{margin:0;max-width:680px}
.message-gateway-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;align-items:stretch}
.message-gateway-card{position:relative;display:flex;min-width:0;min-height:285px;flex-direction:column;gap:1rem;padding:1.05rem;border:1px solid #d7e6e0;border-radius:16px;background:linear-gradient(180deg,#fff 0%,#fbfefd 100%);box-shadow:0 8px 22px rgba(18,72,57,.06)}
.message-gateway-card::before{content:"";position:absolute;inset:0 auto 0 0;width:4px;border-radius:16px 0 0 16px;background:#168365}
.message-gateway-card.is-whatsapp::before{background:#20b967}
.message-gateway-card-top{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:.8rem;align-items:start;min-width:0}
.message-gateway-icon{display:grid;place-items:center;width:46px;height:46px;border-radius:14px;background:#e9f8f2;color:#08765a;font-size:.72rem;font-weight:900;letter-spacing:.02em;box-shadow:inset 0 0 0 1px #d5eee5}
.message-gateway-card.is-whatsapp .message-gateway-icon{background:#e9faef;color:#13854a;box-shadow:inset 0 0 0 1px #d1f0dc}
.message-gateway-heading{min-width:0}
.message-gateway-title-line{display:flex;align-items:center;gap:.45rem;min-width:0;flex-wrap:wrap}
.message-gateway-title-line h4{min-width:0;margin:.05rem 0 .15rem;font-size:1rem;line-height:1.25;overflow-wrap:anywhere}
.message-gateway-provider{color:var(--muted);font-size:.78rem;line-height:1.35}
.message-gateway-active{display:inline-flex;align-items:center;justify-content:center;min-height:28px;padding:.25rem .55rem;border-radius:999px;font-size:.7rem;font-weight:800;white-space:nowrap}
.message-gateway-active.is-active{background:#e8f8ef;color:#157745}
.message-gateway-active.is-inactive{background:#f1f3f2;color:#6c7773}
.message-gateway-details{display:grid;gap:.55rem;padding:.8rem;border:1px solid #e3ece8;border-radius:12px;background:#fff}
.message-gateway-detail-row{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;min-width:0;font-size:.76rem}
.message-gateway-detail-row>span{flex:0 0 auto;color:var(--muted)}
.message-gateway-detail-row>strong{min-width:0;text-align:right;overflow-wrap:anywhere}
.gateway-test-status{display:inline-flex;align-items:center;gap:.35rem}
.gateway-test-status i{display:block;width:8px;height:8px;border-radius:50%;background:#aeb8b4;box-shadow:0 0 0 3px #eef1f0}
.gateway-test-status.is-ok i{background:#28c985;box-shadow:0 0 0 3px #dff8ed}
.gateway-test-status.is-error i{background:#e35656;box-shadow:0 0 0 3px #fde8e8}
.message-gateway-result{min-height:44px;padding:.65rem .75rem;border-radius:10px;background:#f4f7f6;color:#53625d;font-size:.75rem;line-height:1.45;overflow-wrap:anywhere}
.message-gateway-result.is-ok{background:#eaf9f1;color:#12683f}
.message-gateway-result.is-error{background:#fff0f0;color:#a43c3c}
.message-gateway-actions{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.65rem;align-items:stretch;margin-top:auto}
.message-gateway-actions>.btn{min-height:42px}
.message-gateway-test-form{display:grid;grid-template-columns:minmax(110px,1fr) auto;gap:.5rem;min-width:0}
.message-gateway-test-form input{width:100%;min-width:0;height:42px}
.message-gateway-test-form .btn{min-height:42px;white-space:nowrap}
.message-gateway-help{margin:.85rem 0 0;font-size:.75rem}

.gateway-form-card{max-width:1050px}
.gateway-form-head{align-items:flex-start;gap:1rem}
.gateway-form-head h2{margin:0 0 .25rem}
.gateway-form-intro{margin:0;max-width:720px;line-height:1.5}
.gateway-form-section{margin-top:1rem;padding:1rem;border:1px solid #dce9e4;border-radius:14px;background:#fcfefd}
.gateway-section-title{display:flex;align-items:center;gap:.7rem;margin-bottom:.9rem}
.gateway-section-title strong{display:block;font-size:.94rem}
.gateway-section-title small{display:block;margin-top:.12rem;color:var(--muted);font-size:.73rem;line-height:1.4}
.gateway-step{display:grid;place-items:center;flex:0 0 auto;width:30px;height:30px;border-radius:10px;background:#e6f5ef;color:#08765a;font-weight:900}
.gateway-provider-note{margin-top:.8rem;padding:.68rem .8rem;border-radius:10px;background:#eef8f4;color:#35665a;font-size:.78rem;line-height:1.45}
.gateway-credential-alert{margin:.25rem 0 .9rem}
.gateway-info-box{margin-top:.85rem;padding:.75rem .85rem;border:1px dashed #bfdbd0;border-radius:10px;background:#f5fbf8;color:#42635a;font-size:.76rem;line-height:1.5}
.gateway-advanced{margin-top:1rem;border:1px solid #dce7e3;border-radius:13px;background:#fff;overflow:hidden}
.gateway-advanced summary{cursor:pointer;padding:.85rem 1rem;font-size:.82rem;font-weight:800;color:#264f44;background:#f7faf9;list-style-position:inside}
.gateway-advanced[open] summary{border-bottom:1px solid #e1ebe7}
.gateway-advanced-body{padding:1rem}
.gateway-json-help{white-space:pre-wrap;overflow:auto;max-height:240px}
.gateway-form-footer{position:sticky;bottom:0;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:1rem -1rem -1rem;padding:1rem;border-top:1px solid #dce9e4;background:rgba(255,255,255,.96);backdrop-filter:blur(8px)}
.gateway-toggle-group{display:flex;align-items:center;gap:1rem;flex-wrap:wrap}
.gateway-conditional[hidden]{display:none!important}

@media(max-width:980px){
  .message-gateway-grid{grid-template-columns:1fr}
  .message-gateway-card{min-height:0}
  .gateway-primary-grid,.gateway-connection-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:700px){
  .message-gateway-panel-head{flex-direction:column;align-items:stretch}
  .message-gateway-panel-head .row-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .message-gateway-panel-head .row-actions .btn{width:100%}
  .message-gateway-card{padding:.9rem;border-radius:14px}
  .message-gateway-card-top{grid-template-columns:auto minmax(0,1fr)}
  .message-gateway-active{grid-column:2;justify-self:start}
  .message-gateway-detail-row{gap:.6rem}
  .message-gateway-actions{grid-template-columns:1fr}
  .message-gateway-actions>.btn{width:100%}
  .message-gateway-test-form{grid-template-columns:1fr}
  .message-gateway-test-form .btn{width:100%}
  .gateway-form-head{flex-direction:column;align-items:stretch}
  .gateway-form-head>.btn{width:100%}
  .gateway-primary-grid,.gateway-connection-grid,.gateway-form-section .grid{grid-template-columns:1fr!important}
  .gateway-form-section{padding:.85rem}
  .gateway-form-footer{position:static;flex-direction:column;align-items:stretch;margin:1rem -.85rem -.85rem;padding:.85rem}
  .gateway-form-footer .row-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .gateway-form-footer .btn{width:100%}
}
@media(max-width:420px){
  .message-gateway-panel-head .row-actions,.gateway-form-footer .row-actions{grid-template-columns:1fr}
  .message-gateway-card-top{gap:.65rem}
  .message-gateway-icon{width:42px;height:42px;border-radius:12px}
  .message-gateway-detail-row{display:grid;grid-template-columns:1fr}
  .message-gateway-detail-row>strong{text-align:left}
}


/* ===== Messaging scheduled table, parcel ID and detail view (2026-07-26) ===== */
.scheduled-message-card{min-width:0;overflow:hidden}
.scheduled-message-head{align-items:flex-start;margin-bottom:.85rem}
.scheduled-message-head h3{margin:0 0 .2rem}
.scheduled-message-head p{margin:0;font-size:.78rem}
.scheduled-message-filters{display:grid;grid-template-columns:minmax(180px,1.2fr) repeat(3,minmax(145px,.8fr)) minmax(145px,.75fr) minmax(145px,.75fr) auto;gap:.65rem;align-items:end;margin-bottom:.9rem}
.scheduled-message-filters>*{min-width:0;width:100%}
.scheduled-message-table-wrap{position:relative;width:100%;max-width:100%;overflow:auto;border:1px solid #d9e6e1;border-radius:14px;background:#fff;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
.scheduled-message-table{width:100%;min-width:1320px;margin:0;table-layout:fixed;border-collapse:separate;border-spacing:0}
.scheduled-message-table th,.scheduled-message-table td{vertical-align:middle;padding:.78rem .72rem}
.scheduled-message-table thead th{position:sticky;top:0;z-index:3;background:#f5f9f7;white-space:nowrap;border-bottom:1px solid #d7e4df}
.scheduled-message-table tbody tr:hover td{background:#fbfefd}
.scheduled-message-table th:nth-child(1){width:165px}
.scheduled-message-table th:nth-child(2){width:170px}
.scheduled-message-table th:nth-child(3){width:115px}
.scheduled-message-table th:nth-child(4){width:120px}
.scheduled-message-table th:nth-child(5){width:145px}
.scheduled-message-table th:nth-child(6){width:205px}
.scheduled-message-table th:nth-child(7){width:285px}
.scheduled-message-table th:nth-child(8){width:105px}
.scheduled-message-table th:nth-child(9){width:90px}
.scheduled-message-table th:nth-child(10){width:125px}
.scheduled-message-table td small{display:block;margin-top:.18rem;line-height:1.35}
.msg-nowrap{display:inline-block;white-space:nowrap}
.msg-date-cell{white-space:nowrap}
.msg-copy-line{display:inline-flex;max-width:100%;align-items:center;gap:.34rem;vertical-align:middle}
.msg-copy-line code{max-width:calc(100% - 24px);overflow:hidden;text-overflow:ellipsis}
.msg-copy-btn{display:inline-grid;flex:0 0 24px;width:24px;height:24px;place-items:center;padding:0;border:0!important;border-radius:0!important;background:transparent!important;color:#168365;box-shadow:none!important;cursor:pointer;transition:transform .16s ease,color .16s ease}
.msg-copy-btn:hover{color:#075d47;transform:translateY(-1px)}
.msg-copy-btn:focus-visible{outline:2px solid #81cdb5;outline-offset:2px;border-radius:4px!important}
.msg-copy-btn.is-copied{color:#16a064}
.msg-copy-btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.msg-source-badge{display:inline-flex;align-items:center;min-height:26px;padding:.2rem .55rem;border-radius:999px;background:#eef7f3;color:#246b57;font-size:.72rem;font-weight:800;white-space:nowrap}
.msg-id-cell{white-space:nowrap}
.msg-message-cell{max-width:none!important}
.msg-message-text{display:-webkit-box;max-height:4.6em;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3;white-space:normal;overflow-wrap:anywhere;line-height:1.48}
.msg-event-link{display:block;margin-top:.2rem;white-space:nowrap}
.msg-actions-cell{position:sticky;right:0;z-index:2;background:#fff;box-shadow:-8px 0 14px rgba(20,72,57,.04)}
.scheduled-message-table thead .msg-actions-cell,.scheduled-message-table thead th:last-child{z-index:4;background:#f5f9f7}
.scheduled-message-table tbody tr:hover .msg-actions-cell{background:#fbfefd}
.msg-row-actions{display:grid;gap:.38rem;align-items:stretch}
.msg-row-actions .btn,.msg-row-actions form,.msg-row-actions form .btn{width:100%;min-width:0;margin:0}

.message-detail-card{overflow:hidden}
.message-detail-head{align-items:flex-start;gap:1rem}
.message-detail-head h2{margin:0 0 .18rem}
.message-detail-head p{margin:0}
.message-detail-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.75rem;margin-top:1rem}
.message-detail-item{display:flex;min-width:0;min-height:88px;flex-direction:column;justify-content:center;gap:.4rem;padding:.8rem .85rem;border:1px solid #dce9e4;border-radius:12px;background:#f8fbfa}
.message-detail-item small{color:var(--muted);font-size:.69rem;font-weight:800;text-transform:uppercase;letter-spacing:.035em}
.message-detail-item strong,.message-detail-item code{min-width:0;overflow-wrap:anywhere}
.message-detail-body{margin-top:1rem;padding:1rem;border:1px solid #dce9e4;border-radius:14px;background:#fff}
.message-detail-body-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.65rem}
.message-detail-body-head h3{margin:0}
.message-detail-body .message-full{margin:0;white-space:normal;overflow-wrap:anywhere;line-height:1.65}
.message-events-card .timeline-item{grid-template-columns:12px minmax(0,1fr)}
.message-events-card .timeline-item>div:last-child{display:grid;gap:.25rem;min-width:0}
.message-events-card .timeline-item p{margin:.2rem 0 0}

@media(max-width:1180px){
  .scheduled-message-filters{grid-template-columns:repeat(4,minmax(0,1fr))}
  .scheduled-message-filters .btn{min-height:42px}
  .message-detail-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:820px){
  .scheduled-message-card{padding:.8rem}
  .scheduled-message-filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem}
  .scheduled-message-table-wrap{border-radius:11px}
  .scheduled-message-table{min-width:1260px}
  .message-detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:520px){
  .scheduled-message-card{padding:.7rem}
  .scheduled-message-filters{grid-template-columns:1fr}
  .scheduled-message-filters .btn{width:100%}
  .scheduled-message-table th,.scheduled-message-table td{padding:.68rem .62rem}
  .message-detail-head{flex-direction:column;align-items:stretch}
  .message-detail-head>.btn{width:100%}
  .message-detail-grid{grid-template-columns:1fr}
  .message-detail-item{min-height:0}
  .message-detail-body-head{align-items:flex-start;flex-direction:column}
  .message-detail-body-head .btn{width:100%}
}

/* ===== Dashboard order source breakdown + icon-only recent-order copy (2026-07-26) ===== */
.dashboard-order-source-card{
  min-width:0;
  overflow:hidden;
}
.dashboard-order-source-head{
  gap:.75rem;
}
.dashboard-order-source-head h2{
  min-width:0;
}
.dashboard-order-source-overview{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.7rem;
  margin-bottom:.85rem;
}
.dashboard-order-source-kpi{
  display:flex;
  min-width:0;
  align-items:center;
  justify-content:space-between;
  gap:.7rem;
  padding:.72rem .8rem;
  border:1px solid #d9e8e2;
  border-radius:12px;
  background:linear-gradient(135deg,#f8fcfa 0%,#eef8f4 100%);
}
.dashboard-order-source-kpi span{
  color:var(--muted);
  font-size:.74rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.035em;
}
.dashboard-order-source-kpi strong{
  min-width:0;
  color:#075f47;
  font-size:1rem;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
  text-align:right;
}
.dashboard-order-source-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.58rem;
  min-width:0;
}
.dashboard-order-source-row{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) 14px;
  grid-template-areas:
    "icon main arrow"
    "icon value arrow";
  min-width:0;
  align-items:center;
  column-gap:.62rem;
  row-gap:.32rem;
  padding:.62rem .66rem;
  border:1px solid #dce9e4;
  border-radius:12px;
  background:#fff;
  color:var(--ink);
  box-shadow:0 2px 9px rgba(14,107,78,.045);
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease,background .16s ease;
}
.dashboard-order-source-row:hover{
  border-color:#a9d8c8;
  background:#fbfefd;
  box-shadow:0 7px 18px rgba(14,107,78,.09);
  transform:translateY(-1px);
}
.dashboard-order-source-row:focus-visible{
  outline:2px solid #76c9ac;
  outline-offset:2px;
}
.dashboard-order-source-icon{
  grid-area:icon;
  display:grid;
  width:34px;
  height:34px;
  place-items:center;
  align-self:start;
  border-radius:10px;
  background:linear-gradient(135deg,#dff4ec 0%,#cdece0 100%);
  color:#087559;
  font-size:.82rem;
  font-weight:900;
  box-shadow:inset 0 0 0 1px rgba(14,107,78,.08);
}
.dashboard-order-source-main{
  grid-area:main;
  display:block;
  min-width:0;
}
.dashboard-order-source-line{
  display:flex;
  min-width:0;
  align-items:baseline;
  justify-content:space-between;
  gap:.45rem;
}
.dashboard-order-source-name{
  min-width:0;
  overflow:hidden;
  color:#0c7255;
  font-size:.82rem;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.dashboard-order-source-count{
  flex:0 0 auto;
  color:#375e52;
  font-size:.72rem;
  font-weight:800;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.dashboard-order-source-count small{
  color:var(--muted);
  font-size:.66rem;
  font-weight:600;
}
.dashboard-order-source-track{
  display:block;
  height:4px;
  margin-top:.34rem;
  overflow:hidden;
  border-radius:999px;
  background:#e8f1ee;
}
.dashboard-order-source-track>span{
  display:block;
  width:var(--source-progress,0%);
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,#19a474 0%,#0f7b5c 100%);
}
.dashboard-order-source-value{
  grid-area:value;
  display:flex;
  min-width:0;
  align-items:center;
  justify-content:space-between;
  gap:.45rem;
}
.dashboard-order-source-value small{
  color:var(--muted);
  font-size:.66rem;
}
.dashboard-order-source-value strong{
  min-width:0;
  color:#1b3e34;
  font-size:.75rem;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
  text-align:right;
}
.dashboard-order-source-arrow{
  grid-area:arrow;
  color:#86a69c;
  font-size:1.1rem;
  line-height:1;
  transition:transform .16s ease,color .16s ease;
}
.dashboard-order-source-row:hover .dashboard-order-source-arrow{
  color:#0e7b5c;
  transform:translateX(2px);
}
.dashboard-order-source-empty{
  display:grid;
  min-height:150px;
  place-items:center;
  align-content:center;
  gap:.45rem;
  padding:1rem;
  border:1px dashed #cbded7;
  border-radius:12px;
  background:#f9fcfb;
  text-align:center;
}
.dashboard-order-source-empty>span{
  display:grid;
  width:42px;
  height:42px;
  place-items:center;
  border-radius:50%;
  background:#e8f5f0;
  color:#0f8261;
  font-size:1.2rem;
}

.dashboard-copy-line{
  display:inline-flex;
  max-width:100%;
  min-width:0;
  align-items:center;
  gap:.28rem;
  vertical-align:middle;
}
.dashboard-copy-line>a,
.dashboard-copy-line>code{
  min-width:0;
}
.dashboard-copy-line code{
  display:inline-block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  vertical-align:middle;
  white-space:nowrap;
}
.dashboard-copy-btn,
.dashboard-copy-btn:hover,
.dashboard-copy-btn:active{
  display:inline-grid;
  flex:0 0 22px;
  width:22px;
  height:22px;
  place-items:center;
  margin:0;
  padding:0;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:#315e52;
  box-shadow:none!important;
  font:inherit;
  font-size:17px;
  line-height:1;
  appearance:none;
  -webkit-appearance:none;
  cursor:pointer;
}
.dashboard-copy-btn{
  transition:color .16s ease,transform .16s ease;
}
.dashboard-copy-btn:hover{
  color:#07815e;
  transform:translateY(-1px);
}
.dashboard-copy-btn:focus-visible{
  outline:2px solid #7bcbb0;
  outline-offset:1px;
}

@media(max-width:640px){
  .dashboard-order-source-head{
    align-items:center;
  }
  .dashboard-order-source-overview{
    gap:.5rem;
  }
  .dashboard-order-source-kpi{
    align-items:flex-start;
    flex-direction:column;
    gap:.18rem;
    padding:.65rem .7rem;
  }
  .dashboard-order-source-kpi strong{
    text-align:left;
  }
  .dashboard-order-source-list{
    grid-template-columns:1fr;
  }
  .dashboard-order-source-row{
    padding:.64rem .7rem;
  }
}

@media(max-width:390px){
  .dashboard-order-source-overview{
    grid-template-columns:1fr;
  }
  .dashboard-order-source-head{
    align-items:flex-start;
    flex-direction:column;
  }
  .dashboard-order-source-head .btn{
    width:100%;
    justify-content:center;
  }
}

/* ========================================================================== 
   Dashboard stock alert: responsive table/card layout only
   Keeps the desktop table and prevents mobile horizontal overflow.
   ========================================================================== */
.dashboard-stock-alert-card{
  width:100%;
  min-width:0;
  max-width:100%;
  overflow:hidden;
  box-sizing:border-box;
}
.dashboard-stock-alert-card .card-head{
  min-width:0;
}
.dashboard-stock-alert-card .card-head h2{
  min-width:0;
  overflow-wrap:anywhere;
}
.dashboard-stock-alert-wrap{
  width:100%;
  min-width:0;
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-inline:contain;
  scrollbar-gutter:stable;
}
.dashboard-stock-alert-table{
  width:100%;
  min-width:680px;
  table-layout:fixed;
}
.dashboard-stock-alert-table .stock-col-sku{width:18%}
.dashboard-stock-alert-table .stock-col-product{width:31%}
.dashboard-stock-alert-table .stock-col-bucket{width:18%}
.dashboard-stock-alert-table .stock-col-warehouse{width:20%}
.dashboard-stock-alert-table .stock-col-on-hand{width:13%}
.dashboard-stock-alert-table th,
.dashboard-stock-alert-table td{
  min-width:0;
  vertical-align:middle;
}
.dashboard-stock-alert-table .stock-sku-value,
.dashboard-stock-alert-table .stock-product-name,
.dashboard-stock-alert-table .stock-warehouse-cell{
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.dashboard-stock-alert-table .stock-bucket-badge{
  display:inline-flex;
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
}
.dashboard-stock-alert-table .stock-on-hand-cell strong{
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}

@media(max-width:700px){
  .dashboard-stock-alert-card .card-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:.5rem;
  }
  .dashboard-stock-alert-card .card-head h2{
    flex:1 1 auto;
    margin:0;
  }
  .dashboard-stock-alert-card .card-head .btn{
    flex:0 0 auto;
    max-width:100%;
  }
  .dashboard-stock-alert-wrap{
    overflow:visible!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    scrollbar-gutter:auto;
  }
  .dashboard-stock-alert-table{
    display:block;
    width:100%!important;
    min-width:0!important;
    max-width:100%;
    table-layout:auto;
    border-collapse:separate;
    border-spacing:0;
    background:transparent;
  }
  .dashboard-stock-alert-table colgroup,
  .dashboard-stock-alert-table thead{
    display:none;
  }
  .dashboard-stock-alert-table tbody{
    display:grid;
    width:100%;
    min-width:0;
    gap:.65rem;
  }
  .dashboard-stock-alert-table tbody tr{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
    min-width:0;
    gap:0 .8rem;
    padding:.72rem .75rem;
    border:1px solid var(--border,#dce7e2);
    border-radius:12px;
    background:#fbfdfc;
    box-shadow:0 4px 14px rgba(18,70,54,.045);
    box-sizing:border-box;
  }
  .dashboard-stock-alert-table tbody td,
  .dashboard-stock-alert-table tbody td.num{
    display:grid;
    grid-template-columns:1fr;
    align-content:start;
    gap:.22rem;
    width:100%!important;
    min-width:0;
    max-width:100%;
    padding:.48rem 0!important;
    border:0!important;
    border-bottom:1px dashed rgba(186,204,196,.68)!important;
    text-align:left!important;
    white-space:normal!important;
    overflow-wrap:anywhere;
    box-sizing:border-box;
  }
  .dashboard-stock-alert-table tbody td::before{
    content:attr(data-label);
    min-width:0;
    color:var(--text-muted,#64776e);
    font-size:.64rem;
    font-weight:800;
    line-height:1.3;
    letter-spacing:.035em;
    text-align:left;
    text-transform:uppercase;
    overflow-wrap:anywhere;
  }
  .dashboard-stock-alert-table tbody .stock-product-cell{
    grid-column:1/-1;
    order:-1;
    padding-top:.1rem!important;
  }
  .dashboard-stock-alert-table tbody .stock-product-cell .stock-product-name{
    font-size:.84rem;
    line-height:1.45;
  }
  .dashboard-stock-alert-table tbody .stock-on-hand-cell{
    text-align:left!important;
  }
  .dashboard-stock-alert-table .stock-sku-value,
  .dashboard-stock-alert-table .stock-product-name,
  .dashboard-stock-alert-table .stock-warehouse-cell{
    max-width:100%;
    overflow:visible;
    text-overflow:clip;
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:break-word;
  }
  .dashboard-stock-alert-table tbody td:nth-last-child(-n+2){
    border-bottom-color:transparent!important;
  }
  .dashboard-stock-alert-table .dashboard-table-empty{
    display:block;
    padding:.45rem;
  }
  .dashboard-stock-alert-table .dashboard-table-empty td{
    display:block;
    padding:.75rem!important;
    border:0!important;
    text-align:center!important;
  }
  .dashboard-stock-alert-table .dashboard-table-empty td::before{display:none}
}

@media(max-width:380px){
  .dashboard-stock-alert-table tbody tr{
    grid-template-columns:minmax(0,1fr);
    gap:0;
  }
  .dashboard-stock-alert-table tbody .stock-product-cell{
    grid-column:1;
  }
  .dashboard-stock-alert-table tbody td,
  .dashboard-stock-alert-table tbody td.num{
    border-bottom:1px dashed rgba(186,204,196,.68)!important;
  }
  .dashboard-stock-alert-table tbody td:last-child{
    border-bottom-color:transparent!important;
  }
  .dashboard-stock-alert-card .card-head .btn{
    width:100%;
    justify-content:center;
  }
}

/* ===== Order details: compact visible courier action buttons (2026-07-26) ===== */
.return-action-dock{
  overflow:visible;
}
.return-action-dock .courier-outcome-actions{
  grid-column:1/-1;
  display:flex!important;
  flex-wrap:wrap;
  align-items:stretch;
  justify-content:flex-end;
  gap:10px;
  width:100%;
  min-width:0;
  margin:0;
  padding-top:12px;
  border-top:1px dashed var(--border,#dce7e2);
  overflow:visible;
}
.return-action-dock .courier-outcome-actions .order-action-button,
.return-action-dock .courier-outcome-actions .courier-outcome-btn,
.return-action-dock .courier-outcome-actions .contact-action-btn,
.return-action-dock .courier-outcome-actions .return-receive-btn{
  flex:0 1 auto!important;
  width:auto!important;
  min-width:150px!important;
  max-width:100%;
  min-height:48px;
  box-sizing:border-box;
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  gap:9px;
  padding:9px 14px!important;
  border-radius:12px!important;
  text-align:center;
  white-space:normal;
  overflow:visible;
  box-shadow:0 7px 18px rgba(14,53,40,.08);
}
.return-action-dock .courier-outcome-actions .order-action-button > span:last-child{
  flex:0 1 auto;
  min-width:0;
  line-height:1.25;
  overflow-wrap:anywhere;
}
.return-action-dock .courier-outcome-actions .courier-outcome-icon{
  flex:0 0 30px;
  width:30px;
  height:30px;
  display:grid!important;
  place-items:center;
  border-radius:9px;
  visibility:visible!important;
  opacity:1!important;
}
.return-action-dock .courier-outcome-actions .order-action-svg{
  display:block!important;
  width:18px!important;
  height:18px!important;
  color:inherit;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:2!important;
  visibility:visible!important;
  opacity:1!important;
}
.return-action-dock .courier-outcome-actions .is-partial-delivery{
  border:1px solid #8fd5bd!important;
  background:#eefaf5!important;
  color:#087b59!important;
}
.return-action-dock .courier-outcome-actions .is-partial-delivery .courier-outcome-icon{
  border:1px solid #7bcbae;
  background:#d9f2e8!important;
  color:#087b59!important;
  box-shadow:none;
}

@media(max-width:760px){
  .return-action-dock .courier-outcome-actions{
    display:flex!important;
    justify-content:stretch;
  }
  .return-action-dock .courier-outcome-actions .order-action-button,
  .return-action-dock .courier-outcome-actions .courier-outcome-btn,
  .return-action-dock .courier-outcome-actions .contact-action-btn,
  .return-action-dock .courier-outcome-actions .return-receive-btn{
    flex:1 1 calc(50% - 5px)!important;
    width:auto!important;
    min-width:0!important;
  }
}

@media(max-width:480px){
  .return-action-dock .courier-outcome-actions{
    gap:8px;
  }
  .return-action-dock .courier-outcome-actions .order-action-button,
  .return-action-dock .courier-outcome-actions .courier-outcome-btn,
  .return-action-dock .courier-outcome-actions .contact-action-btn,
  .return-action-dock .courier-outcome-actions .return-receive-btn{
    flex:1 1 100%!important;
    width:100%!important;
    min-width:0!important;
  }
}


/* ===== Order details: black outline for visible action buttons (2026-07-26) ===== */
.return-action-dock .courier-outcome-actions .order-action-button,
.return-action-dock .courier-outcome-actions .courier-outcome-btn,
.return-action-dock .courier-outcome-actions .contact-action-btn,
.return-action-dock .courier-outcome-actions .return-receive-btn{
  border:1px solid #111!important;
}

/* ===== Sidebar account/logout: responsive alignment and fit (2026-07-26) ===== */
.sidebar{
  overflow:hidden;
  height:100vh;
  height:100dvh;
}
.sidebar .nav{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
}
.sidebar-mobile-account{
  flex:0 0 auto;
  min-width:0;
  padding:.6rem .55rem calc(.6rem + env(safe-area-inset-bottom,0px));
  border-top:1px solid rgba(255,255,255,.14);
  background:rgba(3,35,25,.18);
}
.sidebar-mobile-user{
  display:flex;
  align-items:center;
  gap:.6rem;
  width:100%;
  min-width:0;
  padding:.58rem .62rem;
  border:1px solid rgba(255,255,255,.12);
  border-radius:10px;
  background:rgba(255,255,255,.07);
  color:#f3fbf7;
  text-decoration:none;
}
.sidebar-mobile-user:hover,
.sidebar-mobile-user:focus-visible{
  border-color:rgba(255,255,255,.26);
  background:rgba(255,255,255,.13);
  color:#fff;
  outline:none;
}
.sidebar-mobile-avatar{
  flex:0 0 34px;
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:rgba(255,255,255,.16);
  color:#fff;
  font-size:.86rem;
  font-weight:800;
}
.sidebar-mobile-user-copy{
  display:flex;
  flex:1 1 auto;
  min-width:0;
  flex-direction:column;
  line-height:1.25;
}
.sidebar-mobile-user-copy strong,
.sidebar-mobile-user-copy small{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.sidebar-mobile-user-copy strong{
  color:#fff;
  font-size:.82rem;
  font-weight:700;
}
.sidebar-mobile-user-copy small{
  margin-top:.12rem;
  color:rgba(229,246,238,.72);
  font-size:.7rem;
}
.sidebar-mobile-user-arrow{
  flex:0 0 auto;
  color:rgba(255,255,255,.62);
  font-size:1.1rem;
  line-height:1;
}
.sidebar-mobile-logout-form{
  width:100%;
  min-width:0;
  margin:.42rem 0 0;
}
.sidebar-mobile-logout{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  width:100%;
  min-width:0;
  min-height:40px;
  margin:0;
  padding:.52rem .68rem;
  border:1px solid rgba(255,255,255,.18);
  border-radius:10px;
  background:rgba(255,255,255,.075);
  color:#fff;
  font:inherit;
  font-size:.8rem;
  font-weight:700;
  line-height:1.2;
  cursor:pointer;
  box-shadow:none;
  appearance:none;
}
.sidebar-mobile-logout:hover,
.sidebar-mobile-logout:focus-visible{
  border-color:rgba(255,255,255,.32);
  background:rgba(255,255,255,.15);
  outline:none;
}
.sidebar-mobile-logout-icon{
  flex:0 0 20px;
  width:20px;
  height:20px;
  display:grid;
  place-items:center;
}
.sidebar-mobile-logout-icon svg{
  display:block;
  width:19px;
  height:19px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.sidebar-mobile-logout-label{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Compact desktop sidebar keeps the account controls icon-only. */
.sidebar-compact .sidebar-mobile-account{
  padding:.48rem .35rem calc(.48rem + env(safe-area-inset-bottom,0px));
}
.sidebar-compact .sidebar-mobile-user{
  justify-content:center;
  padding:.48rem .3rem;
}
.sidebar-compact .sidebar-mobile-user-copy,
.sidebar-compact .sidebar-mobile-user-arrow,
.sidebar-compact .sidebar-mobile-logout-label{
  display:none;
}
.sidebar-compact .sidebar-mobile-logout{
  padding:.5rem .3rem;
}

/* The off-canvas mobile sidebar always uses the full readable layout. */
@media(max-width:980px){
  .sidebar{
    height:100vh;
    height:100dvh;
  }
  .sidebar-compact .sidebar-mobile-account{
    padding:.6rem .55rem calc(.6rem + env(safe-area-inset-bottom,0px));
  }
  .sidebar-compact .sidebar-mobile-user{
    justify-content:flex-start;
    padding:.58rem .62rem;
  }
  .sidebar-compact .sidebar-mobile-user-copy{
    display:flex;
  }
  .sidebar-compact .sidebar-mobile-user-arrow{
    display:inline;
  }
  .sidebar-compact .sidebar-mobile-logout{
    justify-content:center;
    padding:.52rem .68rem;
  }
  .sidebar-compact .sidebar-mobile-logout-label{
    display:inline;
  }
}

@media(max-width:360px){
  .sidebar-mobile-account{
    padding-left:.42rem;
    padding-right:.42rem;
  }
  .sidebar-mobile-user{
    gap:.48rem;
    padding:.52rem;
  }
  .sidebar-mobile-avatar{
    flex-basis:31px;
    width:31px;
    height:31px;
  }
}

/* ===== Customer details page: scoped responsive layout (2026-07-26) ===== */
.customer-profile-page{
  --customer-profile-soft:#f5faf7;
  --customer-profile-line:#d9e6e0;
  --customer-profile-ink:#172821;
  --customer-profile-muted:#64776f;
  display:grid;
  gap:1rem;
  width:100%;
  min-width:0;
}
.customer-profile-page>*{min-width:0}
.customer-profile-page .card{margin-bottom:0}
.customer-profile-toolbar{
  display:flex;
  align-items:center;
  gap:.8rem;
  min-width:0;
}
.customer-profile-toolbar>.btn{flex:0 0 auto}
.customer-profile-toolbar-title{
  display:flex;
  align-items:baseline;
  flex-wrap:wrap;
  gap:.25rem .45rem;
  min-width:0;
  color:var(--customer-profile-muted);
}
.customer-profile-toolbar-title strong{
  color:var(--customer-profile-ink);
  font-size:1rem;
  line-height:1.25;
}
.customer-profile-toolbar-title span{
  min-width:0;
  overflow-wrap:anywhere;
  font-size:.86rem;
}
.customer-profile-hero{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1.25rem;
  padding:1.25rem;
  background:linear-gradient(135deg,#ffffff 0%,#f7fbf9 100%);
  overflow:hidden;
}
.customer-profile-identity{
  display:flex;
  align-items:center;
  gap:1rem;
  flex:1 1 auto;
  min-width:0;
}
.customer-profile-avatar{
  flex:0 0 64px;
  width:64px;
  height:64px;
  display:grid;
  place-items:center;
  border-radius:18px;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  color:#fff;
  font-size:1.2rem;
  font-weight:800;
  letter-spacing:.04em;
  box-shadow:0 8px 20px rgba(14,107,78,.18);
}
.customer-profile-name-block{min-width:0}
.customer-profile-name-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:.45rem .7rem;
  min-width:0;
}
.customer-profile-name-row h1{
  min-width:0;
  margin:0;
  color:var(--customer-profile-ink);
  font-size:clamp(1.45rem,2.2vw,1.9rem);
  line-height:1.15;
  overflow-wrap:anywhere;
}
.customer-profile-badges,
.customer-profile-primary-contact,
.customer-profile-actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:.45rem;
}
.customer-profile-badges{margin-top:.45rem}
.customer-profile-source{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:.18rem .55rem;
  border-radius:999px;
  background:#edf4f1;
  color:var(--customer-profile-muted);
  font-size:.75rem;
  font-weight:600;
}
.customer-profile-primary-contact{
  margin-top:.55rem;
  color:var(--customer-profile-muted);
  font-size:.88rem;
}
.customer-profile-primary-contact>a,
.customer-profile-primary-contact>span{
  display:inline-flex;
  align-items:flex-start;
  gap:.28rem;
  min-width:0;
  max-width:100%;
  overflow-wrap:anywhere;
}
.customer-profile-primary-contact a{color:var(--brand-2);font-weight:600}
.customer-profile-actions{
  flex:0 0 auto;
  justify-content:flex-end;
  max-width:390px;
}
.customer-profile-actions .btn{white-space:nowrap}
.customer-profile-kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.85rem;
  min-width:0;
}
.customer-profile-kpi{
  --profile-kpi:#0e6b4e;
  --profile-kpi-bg:#e3f3ed;
  position:relative;
  display:flex;
  align-items:center;
  gap:.8rem;
  min-width:0;
  min-height:92px;
  padding:1rem;
  border:1px solid var(--customer-profile-line);
  border-top:3px solid var(--profile-kpi);
  border-radius:13px;
  background:#fff;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.customer-profile-kpi.is-orders{--profile-kpi:#2563eb;--profile-kpi-bg:#e6eefc}
.customer-profile-kpi.is-pos{--profile-kpi:#7c3aed;--profile-kpi-bg:#eee7fb}
.customer-profile-kpi.is-crm{--profile-kpi:#0e9f9a;--profile-kpi-bg:#def3f1}
.customer-profile-kpi.is-success{--profile-kpi:#159447;--profile-kpi-bg:#e2f5e9}
.customer-profile-kpi.is-active{--profile-kpi:#d28715;--profile-kpi-bg:#fbefd9}
.customer-profile-kpi.is-failed{--profile-kpi:#d6453f;--profile-kpi-bg:#fbe7e6}
.customer-profile-kpi.is-returned{--profile-kpi:#a05a2c;--profile-kpi-bg:#f4e9df}
.customer-profile-kpi-icon{
  flex:0 0 42px;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:12px;
  background:var(--profile-kpi-bg);
  color:var(--profile-kpi);
  font-size:.95rem;
  font-weight:800;
}
.customer-profile-kpi>div{display:grid;gap:.12rem;min-width:0}
.customer-profile-kpi>div>span{
  color:var(--customer-profile-muted);
  font-size:.76rem;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.035em;
  overflow-wrap:anywhere;
}
.customer-profile-kpi>div>strong{
  color:var(--profile-kpi);
  font-size:1.45rem;
  line-height:1.1;
  font-variant-numeric:tabular-nums;
}
.customer-profile-main-grid{
  display:grid;
  grid-template-columns:minmax(0,1.55fr) minmax(300px,.85fr);
  gap:1rem;
  align-items:start;
  min-width:0;
}
.customer-profile-section{
  min-width:0;
  padding:1.2rem;
  overflow:hidden;
}
.customer-profile-section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:.8rem;
  margin-bottom:1rem;
  min-width:0;
}
.customer-profile-section-head>div{min-width:0}
.customer-profile-section-head h2{
  margin:0;
  color:var(--brand);
  font-size:1.08rem;
  line-height:1.25;
}
.customer-profile-section-head p{
  margin:.25rem 0 0;
  color:var(--customer-profile-muted);
  font-size:.82rem;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.customer-profile-count{
  flex:0 0 auto;
  min-width:30px;
  height:30px;
  display:grid;
  place-items:center;
  padding:0 .48rem;
  border-radius:999px;
  background:#e5f3ed;
  color:var(--brand);
  font-size:.78rem;
  font-weight:800;
}
.customer-profile-contact-columns{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.9rem;
}
.customer-profile-contact-group{
  min-width:0;
  padding:.9rem;
  border:1px solid var(--customer-profile-line);
  border-radius:12px;
  background:var(--customer-profile-soft);
}
.customer-profile-contact-group h3,
.customer-profile-crm-layout h3{
  margin:0 0 .65rem;
  color:var(--customer-profile-ink);
  font-size:.85rem;
}
.customer-profile-detail-list{display:grid;gap:.55rem;min-width:0}
.customer-profile-detail-row{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) auto;
  align-items:center;
  gap:.65rem;
  min-width:0;
  padding:.65rem;
  border:1px solid #e2ebe7;
  border-radius:10px;
  background:#fff;
}
.customer-profile-detail-row>div{display:grid;min-width:0}
.customer-profile-detail-row small{
  color:var(--customer-profile-muted);
  font-size:.7rem;
}
.customer-profile-detail-row a,
.customer-profile-detail-row>div>span{
  min-width:0;
  color:var(--customer-profile-ink);
  font-weight:650;
  overflow-wrap:anywhere;
}
.customer-profile-detail-icon{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:#e3f3ed;
  color:var(--brand);
  font-weight:800;
}
.customer-profile-detail-row .badge{align-self:start;white-space:nowrap}
.customer-profile-basic-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.7rem;
  margin-top:.9rem;
}
.customer-profile-basic-grid>div{
  display:grid;
  gap:.2rem;
  min-width:0;
  padding:.75rem .85rem;
  border:1px solid var(--customer-profile-line);
  border-radius:10px;
  background:#fff;
}
.customer-profile-basic-grid span{
  color:var(--customer-profile-muted);
  font-size:.72rem;
  text-transform:uppercase;
  letter-spacing:.035em;
}
.customer-profile-basic-grid strong{min-width:0;overflow-wrap:anywhere;font-size:.88rem}
.customer-profile-finance-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.7rem;
}
.customer-profile-money{
  --money-tone:#0e6b4e;
  --money-bg:#e8f5f0;
  display:grid;
  gap:.25rem;
  min-width:0;
  padding:.85rem;
  border:1px solid var(--customer-profile-line);
  border-left:4px solid var(--money-tone);
  border-radius:10px;
  background:var(--money-bg);
}
.customer-profile-money.is-received{--money-tone:#159447;--money-bg:#e9f7ed}
.customer-profile-money.is-due{--money-tone:#d6453f;--money-bg:#fdf0ef}
.customer-profile-money.is-advance{--money-tone:#2563eb;--money-bg:#edf3fd}
.customer-profile-money span{color:var(--customer-profile-muted);font-size:.74rem}
.customer-profile-money strong{
  min-width:0;
  color:var(--money-tone);
  font-size:1.12rem;
  line-height:1.2;
  overflow-wrap:anywhere;
  font-variant-numeric:tabular-nums;
}
.customer-profile-ledger-line{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.65rem;
  margin:.85rem 0;
  padding:.75rem;
  border:1px dashed var(--customer-profile-line);
  border-radius:10px;
  background:#fbfcfc;
}
.customer-profile-ledger-line>span{display:grid;gap:.15rem;color:var(--customer-profile-muted);font-size:.75rem}
.customer-profile-ledger-line strong{color:var(--customer-profile-ink);font-size:.9rem;overflow-wrap:anywhere}
.customer-profile-statement-button{min-height:42px}
.customer-profile-section-tools,
.customer-profile-courier-action{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:.55rem;
  min-width:0;
}
.customer-profile-crm-layout{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(250px,.65fr);
  gap:1rem;
  align-items:start;
  min-width:0;
}
.customer-profile-product-tags,
.customer-product-tags{
  display:flex;
  flex-wrap:wrap;
  gap:.55rem;
  min-width:0;
}
.customer-product-tag{
  display:grid;
  gap:.05rem;
  min-width:0;
  max-width:100%;
  padding:.55rem .7rem;
  border:1px solid #cfe4db;
  border-radius:10px;
  background:#f1f8f5;
}
.customer-product-tag strong,
.customer-product-tag small{min-width:0;overflow-wrap:anywhere}
.customer-product-tag strong{color:var(--brand);font-size:.82rem}
.customer-product-tag small{color:var(--customer-profile-muted);font-size:.69rem}
.customer-profile-note-panel{
  min-width:0;
  padding:1rem;
  border:1px solid #f0dfb7;
  border-radius:12px;
  background:#fffaf0;
}
.customer-profile-note-panel>span{
  display:block;
  margin-bottom:.4rem;
  color:#9a6b00;
  font-size:.72rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.customer-profile-note-panel p{margin:0;overflow-wrap:anywhere;white-space:normal}
.customer-profile-empty{margin:0;color:var(--customer-profile-muted)}
.customer-profile-empty.is-centered{text-align:center;padding:1.2rem}
.customer-profile-empty-state{
  display:flex;
  align-items:center;
  gap:.75rem;
  min-width:0;
  padding:1rem;
  border:1px dashed #cbdcd5;
  border-radius:12px;
  background:#f8fbfa;
}
.customer-profile-empty-state>span{
  flex:0 0 42px;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:#e3f3ed;
  color:var(--brand);
}
.customer-profile-empty-state>div{display:grid;min-width:0;flex:1 1 auto}
.customer-profile-empty-state strong,
.customer-profile-empty-state small{overflow-wrap:anywhere}
.customer-profile-empty-state small{color:var(--customer-profile-muted)}
.customer-courier-head{align-items:center}
.customer-overall-rate{
  --rate-tone:#d6453f;
  display:grid;
  gap:.05rem;
  min-width:112px;
  padding:.5rem .7rem;
  border:1px solid color-mix(in srgb,var(--rate-tone) 28%,#fff);
  border-radius:10px;
  background:color-mix(in srgb,var(--rate-tone) 9%,#fff);
  text-align:right;
}
.customer-overall-rate.is-good{--rate-tone:#159447}
.customer-overall-rate.is-mid{--rate-tone:#d28715}
.customer-overall-rate span{color:var(--customer-profile-muted);font-size:.66rem}
.customer-overall-rate strong{color:var(--rate-tone);font-size:1rem}
.customer-courier-summary-grid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:.65rem;
  margin-bottom:1rem;
}
.customer-courier-summary-grid>div{
  display:grid;
  gap:.15rem;
  min-width:0;
  padding:.75rem;
  border:1px solid var(--customer-profile-line);
  border-radius:10px;
  background:#f8fbfa;
  text-align:center;
}
.customer-courier-summary-grid span{color:var(--customer-profile-muted);font-size:.7rem;overflow-wrap:anywhere}
.customer-courier-summary-grid strong{color:var(--brand);font-size:1.1rem;font-variant-numeric:tabular-nums}
.customer-courier-scroll{width:100%;min-width:0;overflow:hidden}
.customer-courier-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr));
  gap:.8rem;
  min-width:0;
}
.customer-courier-provider{
  --provider-tone:#d6453f;
  min-width:0;
  padding:.9rem;
  border:1px solid var(--customer-profile-line);
  border-top:3px solid var(--provider-tone);
  border-radius:12px;
  background:#fff;
}
.customer-courier-provider.is-good{--provider-tone:#159447}
.customer-courier-provider.is-mid{--provider-tone:#d28715}
.customer-courier-provider-head,
.customer-courier-provider-name{
  display:flex;
  align-items:center;
  gap:.65rem;
  min-width:0;
}
.customer-courier-provider-head{justify-content:space-between}
.customer-courier-provider-name{flex:1 1 auto}
.customer-courier-provider-name>span{
  flex:0 0 38px;
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:color-mix(in srgb,var(--provider-tone) 12%,#fff);
  color:var(--provider-tone);
  font-weight:800;
}
.customer-courier-provider-name>div{display:grid;min-width:0}
.customer-courier-provider-name strong,
.customer-courier-provider-name small{min-width:0;overflow-wrap:anywhere}
.customer-courier-provider-name small{color:var(--customer-profile-muted);font-size:.68rem}
.customer-courier-provider-head>b{color:var(--provider-tone);font-size:1rem}
.customer-courier-progress{
  height:7px;
  margin:.75rem 0;
  border-radius:999px;
  background:#e8eeeb;
  overflow:hidden;
}
.customer-courier-progress>span{display:block;height:100%;max-width:100%;border-radius:inherit;background:var(--provider-tone)}
.customer-courier-provider-metrics{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:.5rem;
}
.customer-courier-provider-metrics>span{
  display:grid;
  gap:.05rem;
  min-width:0;
  padding:.45rem;
  border-radius:8px;
  background:#f7faf9;
  text-align:center;
}
.customer-courier-provider-metrics small{color:var(--customer-profile-muted);font-size:.65rem;overflow-wrap:anywhere}
.customer-courier-provider-metrics strong{font-size:.88rem;font-variant-numeric:tabular-nums}
.customer-profile-history-wrap{
  width:100%;
  max-width:100%;
  border:1px solid var(--customer-profile-line);
  border-radius:11px;
  overflow-x:auto;
}
.customer-profile-history-table{min-width:680px}
.customer-profile-history-table thead th{background:#f3f7f5;color:#486159}
.customer-profile-history-table th,
.customer-profile-history-table td{padding:.72rem .8rem}
.customer-profile-history-table tbody tr:last-child td{border-bottom:0}
.customer-profile-history-table code{white-space:nowrap}
.customer-profile-source-badge{
  display:inline-flex;
  align-items:center;
  min-height:25px;
  padding:.16rem .5rem;
  border-radius:999px;
  background:#e9f1fc;
  color:#2563eb;
  font-size:.72rem;
  font-weight:700;
}
.customer-profile-source-badge.is-pos{background:#eee8fb;color:#7c3aed}

/* Customer CRM product picker modal, scoped to this page only. */
.customer-profile-page .customer-crm-product-modal[hidden]{display:none!important}
.customer-profile-page .customer-crm-product-modal{
  position:fixed;
  inset:0;
  z-index:1000;
  display:grid;
  place-items:center;
  padding:1rem;
}
.customer-profile-page .customer-crm-product-backdrop{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
  background:rgba(8,28,21,.58);
  cursor:pointer;
}
.customer-profile-page .customer-crm-product-dialog{
  position:relative;
  z-index:1;
  width:min(820px,100%);
  max-height:min(88vh,780px);
  max-height:min(88dvh,780px);
  overflow:hidden;
  border:1px solid var(--customer-profile-line);
  border-radius:16px;
  background:#fff;
  box-shadow:0 24px 70px rgba(8,42,31,.24);
}
.customer-profile-page .customer-crm-product-dialog form{display:flex;flex-direction:column;max-height:inherit;min-width:0}
.customer-profile-page .customer-crm-product-dialog-head,
.customer-profile-page .customer-crm-product-dialog-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.8rem;
  padding:1rem 1.1rem;
  background:#fff;
}
.customer-profile-page .customer-crm-product-dialog-head{border-bottom:1px solid var(--customer-profile-line)}
.customer-profile-page .customer-crm-product-dialog-foot{border-top:1px solid var(--customer-profile-line);justify-content:flex-end}
.customer-profile-page .customer-crm-product-title{display:flex;align-items:center;gap:.7rem;min-width:0}
.customer-profile-page .customer-crm-product-title-icon{
  flex:0 0 42px;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:#e3f3ed;
  color:var(--brand);
  font-weight:800;
}
.customer-profile-page .customer-crm-product-title>div{min-width:0}
.customer-profile-page .customer-crm-product-title h2{margin:0;color:var(--brand);font-size:1.08rem}
.customer-profile-page .customer-crm-product-title p{margin:.18rem 0 0;color:var(--customer-profile-muted);font-size:.78rem;overflow-wrap:anywhere}
.customer-profile-page .customer-crm-product-close{
  flex:0 0 36px;
  width:36px;
  height:36px;
  border:1px solid var(--customer-profile-line);
  border-radius:10px;
  background:#fff;
  color:var(--customer-profile-ink);
  font-size:1.35rem;
  cursor:pointer;
}
.customer-profile-page .customer-crm-product-toolbar,
.customer-profile-page .customer-crm-product-summary{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:.8rem;
  padding:.9rem 1.1rem;
  min-width:0;
}
.customer-profile-page .customer-crm-product-toolbar{border-bottom:1px solid #edf2ef;background:#fbfcfc}
.customer-profile-page .customer-crm-product-search{flex:1 1 auto;min-width:0;margin:0}
.customer-profile-page .customer-crm-product-search-box{position:relative;display:block}
.customer-profile-page .customer-crm-product-search-box input{width:100%;padding-left:2rem}
.customer-profile-page .customer-crm-product-search-icon{position:absolute;left:.7rem;top:50%;transform:translateY(-50%);z-index:1;color:var(--customer-profile-muted)}
.customer-profile-page .customer-crm-selected-only{display:flex;align-items:center;gap:.4rem;flex:0 0 auto;padding-bottom:.55rem;color:var(--customer-profile-muted);font-size:.8rem}
.customer-profile-page .customer-crm-product-summary{align-items:center;border-bottom:1px solid #edf2ef}
.customer-profile-page .customer-crm-product-summary>div:first-child{display:grid;grid-template-columns:auto 1fr;column-gap:.55rem;align-items:center;min-width:0}
.customer-profile-page .customer-crm-product-summary strong,
.customer-profile-page .customer-crm-product-summary small{min-width:0;overflow-wrap:anywhere}
.customer-profile-page .customer-crm-product-summary small{grid-column:2;color:var(--customer-profile-muted);font-size:.7rem}
.customer-profile-page .customer-crm-selected-badge{grid-row:1/3;min-width:34px;height:34px;display:grid;place-items:center;border-radius:999px;background:#e3f3ed;color:var(--brand);font-weight:800}
.customer-profile-page .customer-crm-product-bulk-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.45rem}
.customer-profile-page .customer-crm-product-picker{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.65rem;
  min-height:150px;
  padding:1rem 1.1rem;
  overflow:auto;
  overscroll-behavior:contain;
}
.customer-profile-page .customer-crm-product-option{
  display:grid;
  grid-template-columns:auto 34px minmax(0,1fr);
  align-items:center;
  gap:.55rem;
  min-width:0;
  padding:.7rem;
  border:1px solid var(--customer-profile-line);
  border-radius:10px;
  background:#fff;
  cursor:pointer;
}
.customer-profile-page .customer-crm-product-option:hover,
.customer-profile-page .customer-crm-product-option.is-selected{border-color:#8bc9b2;background:#f0f8f5}
.customer-profile-page .customer-crm-product-option>input{width:16px;height:16px;margin:0}
.customer-profile-page .customer-crm-product-check{width:34px;height:34px;display:grid;place-items:center;border-radius:9px;background:#e8f2ee;color:var(--brand);font-weight:800}
.customer-profile-page .customer-crm-product-copy{display:grid;min-width:0}
.customer-profile-page .customer-crm-product-copy strong,
.customer-profile-page .customer-crm-product-copy small{min-width:0;overflow-wrap:anywhere}
.customer-profile-page .customer-crm-product-copy small{color:var(--customer-profile-muted);font-size:.7rem}
.customer-profile-page .customer-crm-no-results{grid-column:1/-1;text-align:center;color:var(--customer-profile-muted)}
body.customer-crm-modal-open{overflow:hidden}

@media(max-width:1180px){
  .customer-profile-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .customer-profile-main-grid{grid-template-columns:1fr}
  .customer-profile-finance-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .customer-courier-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:900px){
  .customer-profile-hero{align-items:flex-start;flex-direction:column}
  .customer-profile-actions{justify-content:flex-start;max-width:none;width:100%}
  .customer-profile-crm-layout{grid-template-columns:1fr}
  .customer-profile-note-panel{order:2}
  .customer-profile-finance-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  .customer-profile-page{gap:.8rem}
  .customer-profile-toolbar{align-items:flex-start;flex-direction:column;gap:.55rem}
  .customer-profile-toolbar-title{align-items:flex-start;flex-direction:column;gap:.1rem}
  .customer-profile-hero,
  .customer-profile-section{padding:.9rem}
  .customer-profile-identity{align-items:flex-start}
  .customer-profile-avatar{flex-basis:52px;width:52px;height:52px;border-radius:14px;font-size:1rem}
  .customer-profile-contact-columns,
  .customer-profile-basic-grid{grid-template-columns:1fr}
  .customer-profile-section-head,
  .customer-courier-head{align-items:flex-start;flex-direction:column}
  .customer-profile-section-tools,
  .customer-profile-courier-action{justify-content:flex-start;width:100%}
  .customer-overall-rate{text-align:left}
  .customer-courier-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .customer-profile-history-wrap{border:0;overflow:visible}
  .customer-profile-history-table{display:block;min-width:0}
  .customer-profile-history-table thead{display:none}
  .customer-profile-history-table tbody{display:grid;gap:.7rem}
  .customer-profile-history-table tr{
    display:grid;
    gap:0;
    padding:.45rem .75rem;
    border:1px solid var(--customer-profile-line);
    border-radius:11px;
    background:#fff;
    box-shadow:0 2px 10px rgba(14,60,46,.05);
  }
  .customer-profile-history-table td{
    display:grid;
    grid-template-columns:minmax(92px,38%) minmax(0,1fr);
    align-items:center;
    gap:.7rem;
    min-width:0;
    padding:.55rem 0;
    border-bottom:1px dashed #e1e9e5;
    text-align:right!important;
    white-space:normal!important;
    overflow-wrap:anywhere;
  }
  .customer-profile-history-table td:last-child{border-bottom:0}
  .customer-profile-history-table td::before{
    content:attr(data-label);
    color:var(--customer-profile-muted);
    font-size:.72rem;
    font-weight:700;
    text-align:left;
    text-transform:uppercase;
    letter-spacing:.03em;
  }
  .customer-profile-history-table td>*{justify-self:end;max-width:100%}
  .customer-profile-history-table .customer-profile-history-empty{padding:0}
  .customer-profile-history-table .customer-profile-history-empty td{display:block;text-align:center!important;border:0}
  .customer-profile-history-table .customer-profile-history-empty td::before{content:none}
  .customer-profile-page .customer-crm-product-toolbar,
  .customer-profile-page .customer-crm-product-summary{align-items:stretch;flex-direction:column}
  .customer-profile-page .customer-crm-selected-only{padding-bottom:0}
  .customer-profile-page .customer-crm-product-bulk-actions{justify-content:flex-start}
  .customer-profile-page .customer-crm-product-picker{grid-template-columns:1fr}
}
@media(max-width:520px){
  .customer-profile-kpi-grid,
  .customer-profile-finance-grid,
  .customer-profile-ledger-line,
  .customer-courier-summary-grid{grid-template-columns:1fr}
  .customer-profile-identity{flex-direction:column}
  .customer-profile-primary-contact{align-items:flex-start;flex-direction:column}
  .customer-profile-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .customer-profile-actions .btn{justify-content:center;width:100%;min-width:0;white-space:normal;text-align:center}
  .customer-profile-detail-row{grid-template-columns:34px minmax(0,1fr)}
  .customer-profile-detail-row .badge{grid-column:2;justify-self:start}
  .customer-profile-empty-state{align-items:flex-start;flex-wrap:wrap}
  .customer-profile-empty-state .btn{width:100%;justify-content:center}
  .customer-profile-page .customer-crm-product-modal{padding:.45rem}
  .customer-profile-page .customer-crm-product-dialog{border-radius:12px;max-height:96vh;max-height:96dvh}
  .customer-profile-page .customer-crm-product-dialog-head,
  .customer-profile-page .customer-crm-product-dialog-foot,
  .customer-profile-page .customer-crm-product-toolbar,
  .customer-profile-page .customer-crm-product-summary,
  .customer-profile-page .customer-crm-product-picker{padding:.75rem}
  .customer-profile-page .customer-crm-product-dialog-foot{display:grid;grid-template-columns:1fr 1fr}
  .customer-profile-page .customer-crm-product-dialog-foot .btn{justify-content:center;min-width:0}
}
@media(max-width:360px){
  .customer-profile-actions{grid-template-columns:1fr}
  .customer-profile-history-table td{grid-template-columns:1fr;gap:.2rem;text-align:left!important}
  .customer-profile-history-table td>*{justify-self:start}
}

/* ==============================
   Follow-ups page redesign
   Scoped only to .crm-followup-page
   ============================== */
.crm-followup-page{display:flex;flex-direction:column;gap:1.05rem}
.crm-followup-page .card{margin-bottom:0}
.crm-followup-stats{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:.85rem}
.crm-followup-stat{display:flex;align-items:center;justify-content:center;min-height:82px;padding:.72rem .85rem;border-radius:18px;background:#fff;position:relative;overflow:hidden;box-shadow:0 10px 24px rgba(21,65,51,.06);border:1px solid rgba(16,89,66,.08)}
.crm-followup-stat:before{content:"";position:absolute;inset:0 auto 0 0;width:4px;border-radius:18px 0 0 18px;background:transparent}
.crm-followup-stat-icon{width:46px;height:46px;border-radius:16px;display:grid;place-items:center;font-weight:800;font-size:.82rem;letter-spacing:.04em;flex:0 0 46px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.45)}
.crm-followup-stat-copy{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-width:0;width:100%;gap:.18rem}
.crm-followup-stat-copy small{font-size:.88rem;color:var(--muted);line-height:1.2;white-space:normal;overflow:visible;text-overflow:clip;word-break:break-word;margin:0 auto}
.crm-followup-stat-copy strong{font-size:1.55rem;line-height:1.05;font-weight:800;color:var(--ink);margin:0}
.crm-followup-stat--blue:before{background:#2777d9}.crm-followup-stat--blue .crm-followup-stat-icon{background:#e8f1ff;color:#2777d9}
.crm-followup-stat--green:before{background:#16a34a}.crm-followup-stat--green .crm-followup-stat-icon{background:#e8f8ee;color:#16924a}
.crm-followup-stat--amber:before{background:#d88908}.crm-followup-stat--amber .crm-followup-stat-icon{background:#fff2dc;color:#c37d06}
.crm-followup-stat--purple:before{background:#7c52dc}.crm-followup-stat--purple .crm-followup-stat-icon{background:#efe9ff;color:#7148d2}
.crm-followup-stat--teal:before{background:#0f9b8e}.crm-followup-stat--teal .crm-followup-stat-icon{background:#def8f3;color:#0a8a7f}
.crm-followup-stat--red:before{background:#d6453f}.crm-followup-stat--red .crm-followup-stat-icon{background:#fdeceb;color:#cc3f39}

.crm-followup-toolbar-card{padding:1rem 1.05rem;position:relative;z-index:4;background:#fff;border-radius:20px;box-shadow:0 12px 28px rgba(21,65,51,.06);border:1px solid rgba(16,89,66,.08)}
.crm-followup-toolbar{display:grid;grid-template-columns:170px minmax(0,1.5fr) auto auto;gap:.9rem;align-items:end}
.crm-followup-toolbar .field{margin:0}
.crm-followup-toolbar .field>span{font-size:.76rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:#6c8178;margin-bottom:.35rem}
.crm-followup-search-control{position:relative;display:flex;align-items:center;border:1px solid var(--line);border-radius:14px;background:#fff;min-height:46px;padding:0 .8rem 0 2.35rem;box-shadow:inset 0 1px 0 rgba(255,255,255,.55)}
.crm-followup-search-control input{border:0!important;box-shadow:none!important;background:transparent;width:100%;padding:.72rem 0;font:inherit;color:var(--ink)}
.crm-followup-search-control input:focus{outline:none}
.crm-followup-search-icon{position:absolute;left:.85rem;top:50%;transform:translateY(-50%);font-size:1rem;color:#7b8b85;line-height:1}
.crm-followup-search-loader{position:absolute;right:.8rem;top:50%;transform:translateY(-50%);width:18px;height:18px;border-radius:50%;border:2px solid #d6e6df;border-top-color:var(--brand);animation:crmFollowupSpin .8s linear infinite}
.crm-followup-live-search{position:relative}
.crm-followup-search-results{position:absolute;left:0;right:0;top:calc(100% + .38rem);background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 18px 34px rgba(14,60,46,.16);padding:.35rem;max-height:320px;overflow:auto;z-index:40}
.crm-followup-search-result{display:grid;grid-template-columns:40px minmax(0,1fr) auto;gap:.75rem;align-items:center;padding:.72rem .82rem;border-radius:12px;color:var(--ink)}
.crm-followup-search-result:hover,.crm-followup-search-result:focus{background:#f4fbf7;outline:none}
.crm-followup-search-result-avatar{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#dff4ea,#dbe7ff);color:#15523d;font-weight:800}
.crm-followup-search-result span{display:flex;flex-direction:column;min-width:0}
.crm-followup-search-result strong,.crm-followup-search-result small,.crm-followup-search-result em{display:block;overflow:hidden;text-overflow:ellipsis}
.crm-followup-search-result strong{font-size:.92rem;color:var(--ink);white-space:nowrap}
.crm-followup-search-result small,.crm-followup-search-result em{font-size:.76rem;color:var(--muted);white-space:nowrap;font-style:normal}
.crm-followup-search-result i{font-style:normal;font-size:1rem;font-weight:700;color:var(--brand)}
.crm-followup-search-empty{padding:1rem;text-align:center;color:var(--muted);font-size:.86rem}
.crm-followup-search-submit{min-height:46px;justify-content:center;padding-inline:1rem}
.crm-followup-advanced{align-self:end;position:relative}
.crm-followup-advanced>summary{list-style:none;min-height:46px;display:inline-flex;align-items:center;justify-content:center;padding-inline:1rem}
.crm-followup-advanced>summary::-webkit-details-marker{display:none}
.crm-followup-advanced-panel{position:absolute;right:0;top:calc(100% + .55rem);width:min(940px,92vw);display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.9rem;background:#fff;border:1px solid var(--line);border-radius:18px;padding:1rem;box-shadow:0 20px 40px rgba(14,60,46,.18)}
.crm-followup-advanced-actions{display:flex;gap:.6rem;align-items:flex-end;grid-column:span 4;justify-content:flex-end}

.crm-followup-workspace{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(330px,.95fr);gap:1rem;align-items:start}
.crm-followup-list-panel{padding:1rem 1rem .9rem;overflow:visible;background:#fff;border-radius:20px;box-shadow:0 12px 28px rgba(21,65,51,.06);border:1px solid rgba(16,89,66,.08)}
.crm-followup-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:.9rem}
.crm-followup-panel-head h2{font-size:1.1rem;line-height:1.2;margin:0 0 .18rem;color:#17312a}
.crm-followup-panel-head p{margin:0;color:var(--muted);font-size:.82rem}
.crm-followup-table-wrap{overflow:auto;border:1px solid var(--line);border-radius:16px;background:#fcfefd}
.crm-followup-table{width:100%;border-collapse:separate;border-spacing:0;min-width:760px}
.crm-followup-table thead th{position:sticky;top:0;background:#f6faf8;color:#4d655d;font-size:.73rem;text-transform:uppercase;letter-spacing:.05em;padding:.95rem .85rem;border-bottom:1px solid var(--line);white-space:nowrap;z-index:1}
.crm-followup-table tbody td{padding:.9rem .85rem;border-bottom:1px solid #e8f0ec;vertical-align:middle;background:#fff}
.crm-followup-table tbody tr:last-child td{border-bottom:0}
.crm-followup-table tbody tr:hover td{background:#fbfefd}
.crm-followup-table tbody tr.is-selected td{background:#eef9f3}
.crm-followup-table tbody tr.is-selected td:first-child{box-shadow:inset 3px 0 0 var(--brand-2)}
.crm-followup-party-cell{display:flex;align-items:center;gap:.7rem;color:var(--ink);min-width:210px}
.crm-followup-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#e0f5eb,#dbe8ff);color:#18543f;font-weight:800;flex:0 0 42px;box-shadow:0 6px 14px rgba(15,76,58,.08)}
.crm-followup-party-cell span:last-child,.crm-followup-party-cell > span:last-child{min-width:0}
.crm-followup-party-cell strong{display:block;color:#163029;font-size:.92rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crm-followup-party-cell small{display:block;color:var(--muted);font-size:.75rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crm-followup-table td small{display:block;color:var(--muted);font-size:.75rem;margin-top:.2rem}
.crm-followup-count-pill{display:inline-flex;align-items:center;justify-content:center;padding:.28rem .55rem;border-radius:999px;background:#e8f8ee;color:#178a4e;font-size:.78rem;font-weight:800;min-width:34px}
.crm-followup-status{display:inline-flex;align-items:center;gap:.3rem;padding:.34rem .64rem;border-radius:999px;font-size:.76rem;font-weight:800;line-height:1.2;white-space:nowrap}
.crm-followup-status--today{background:#fff2dc;color:#b77606}
.crm-followup-status--upcoming{background:#e8f8ee;color:#178a4e}
.crm-followup-status--overdue{background:#fdeceb;color:#c73b36}
.crm-followup-status--completed{background:#e6f8f0;color:#148455}
.crm-followup-status--none{background:#eff3f1;color:#6f7e78}
.crm-followup-row-actions{display:flex;justify-content:flex-end;gap:.35rem;flex-wrap:wrap}
.crm-followup-row-actions a{width:32px;height:32px;border:1px solid #dce6e2;border-radius:9px;display:grid;place-items:center;background:#fff;color:#2a423b;font-size:.86rem;transition:all .15s ease}
.crm-followup-row-actions a:hover{border-color:#b8dacc;background:#f0faf4;color:var(--brand)}
.crm-followup-row-actions a.is-primary{background:var(--brand);border-color:var(--brand);color:#fff}
.crm-followup-row-actions a.is-primary:hover{background:var(--brand-2);border-color:var(--brand-2)}
.crm-followup-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.32rem;padding:2.2rem 1rem;color:var(--muted);text-align:center}
.crm-followup-empty span{font-size:1.35rem;opacity:.8}
.crm-followup-empty strong{font-size:1rem;color:#264039}
.crm-followup-pagination{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:.75rem;padding-top:.9rem}
.crm-followup-pagination .is-disabled{pointer-events:none;opacity:.45}
.crm-followup-page-numbers{display:flex;align-items:center;justify-content:center;gap:.3rem;flex-wrap:wrap;min-width:0}
.crm-followup-page-link{display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:32px;padding:0 .45rem;border:1px solid #dce6e2;border-radius:9px;background:#fff;color:#274039;font-size:.8rem;font-weight:750;line-height:1;text-decoration:none;transition:background .15s ease,border-color .15s ease,color .15s ease}
.crm-followup-page-link:hover{border-color:#9fcdbb;background:#eef8f3;color:var(--brand)}
.crm-followup-page-link.is-current{border-color:var(--brand);background:var(--brand);color:#fff;box-shadow:0 5px 12px rgba(13,107,78,.18)}
.crm-followup-page-ellipsis{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:32px;color:#71827c;font-weight:800}

.crm-followup-detail-panel{display:flex;flex-direction:column;gap:1rem;position:sticky;top:84px}
.crm-followup-profile-card,.crm-followup-next-card,.crm-followup-schedule-card,.crm-followup-history-card,.crm-followup-activity-card,.crm-followup-no-selection{padding:1rem;background:#fff;border-radius:20px;box-shadow:0 12px 28px rgba(21,65,51,.06);border:1px solid rgba(16,89,66,.08)}
.crm-followup-profile-top{display:grid;grid-template-columns:58px minmax(0,1fr) auto;gap:.9rem;align-items:center;margin-bottom:.9rem}
.crm-followup-profile-avatar{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;background:linear-gradient(135deg,#1b7e55,#31b87b);color:#fff;font-size:1.15rem;font-weight:800;box-shadow:0 12px 24px rgba(14,107,78,.24)}
.crm-followup-profile-title small{display:block;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;font-size:.72rem;margin-bottom:.12rem}
.crm-followup-profile-title h2{margin:0;color:#17312a;font-size:1.35rem;line-height:1.18}
.crm-followup-profile-title p{margin:.25rem 0 0;color:var(--muted);font-size:.88rem;word-break:break-word}
.crm-followup-profile-state{display:inline-flex;align-items:center;justify-content:center;padding:.4rem .7rem;border-radius:999px;background:#e6f8ee;color:#168b4c;font-weight:800;font-size:.76rem;white-space:nowrap}
.crm-followup-quick-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.55rem;margin-bottom:.95rem}
.crm-followup-quick-actions .btn{justify-content:center;min-width:0;white-space:nowrap}
.crm-followup-profile-info{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem;margin:0;padding:0}
.crm-followup-profile-info>div{padding:.85rem .9rem;border:1px solid #e1ebe7;border-radius:14px;background:#fbfefd}
.crm-followup-profile-info dt{font-size:.74rem;color:var(--muted);margin-bottom:.25rem;text-transform:uppercase;letter-spacing:.04em}
.crm-followup-profile-info dd{margin:0;color:#183129;font-size:.92rem;font-weight:700;word-break:break-word}
.crm-followup-balance-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem;margin-top:.9rem}
.crm-followup-balance-grid>div{padding:.9rem .95rem;border-radius:16px;background:linear-gradient(180deg,#fff 0%,#fbfefd 100%);border:1px solid #e2ece8}
.crm-followup-balance-grid span{display:block;font-size:.76rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin-bottom:.28rem}
.crm-followup-balance-grid strong{display:block;font-size:1.1rem;color:#17312a;line-height:1.15}
.crm-followup-balance-grid .is-due{background:#fff7f6;border-color:#f1d3d0}.crm-followup-balance-grid .is-due strong{color:#b03b36}
.crm-followup-balance-grid .is-advance{background:#f2fbf6;border-color:#cfead9}.crm-followup-balance-grid .is-advance strong{color:#168b4c}
.crm-followup-next-card header,.crm-followup-side-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:.85rem;margin-bottom:.75rem}
.crm-followup-next-card header h3,.crm-followup-side-heading h3{margin:.15rem 0 0;font-size:1.02rem;color:#17312a;line-height:1.25}
.crm-followup-next-card header small,.crm-followup-side-heading small{display:block;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;font-size:.71rem}
.crm-followup-side-heading>span{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:34px;padding:0 .55rem;border-radius:999px;background:#eef8f3;color:#186f4b;font-weight:800}
.crm-followup-next-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem;margin-bottom:.75rem}
.crm-followup-next-meta span{display:block;padding:.8rem .9rem;border:1px solid #e1ebe7;border-radius:14px;background:#fbfefd}
.crm-followup-next-meta small{display:block;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:.71rem;margin-bottom:.22rem}
.crm-followup-next-meta strong{display:block;font-size:.91rem;line-height:1.3;color:#17312a;word-break:break-word}
.crm-followup-next-card p{margin:0;color:#304942;line-height:1.6;word-break:break-word}

.crm-followup-schedule-card summary,.crm-followup-activity-card summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:.8rem;cursor:pointer}
.crm-followup-schedule-card summary::-webkit-details-marker,.crm-followup-activity-card summary::-webkit-details-marker{display:none}
.crm-followup-schedule-card summary span small,.crm-followup-activity-card summary span small{display:block;color:var(--muted);font-size:.71rem;text-transform:uppercase;letter-spacing:.05em}
.crm-followup-schedule-card summary span strong,.crm-followup-activity-card summary span strong{display:block;color:#17312a;margin-top:.12rem}
.crm-followup-schedule-card summary i,.crm-followup-activity-card summary i{font-style:normal;color:var(--muted);transition:transform .18s ease}
.crm-followup-schedule-card[open] summary i,.crm-followup-activity-card[open] summary i{transform:rotate(180deg)}
.crm-followup-schedule-form{margin-top:.95rem}
.crm-followup-schedule-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem}
.crm-followup-field-wide{grid-column:span 2}
.crm-followup-message-options{margin-top:.8rem}
.crm-followup-schedule-submit{margin-top:.85rem}
.crm-followup-schedule-card textarea{min-height:98px;resize:vertical}
.crm-followup-history-card{overflow:hidden}
.crm-followup-timeline-list{display:flex;flex-direction:column;gap:.8rem}
.crm-followup-timeline-item{display:grid;grid-template-columns:12px minmax(0,1fr);gap:.9rem;align-items:start;position:relative}
.crm-followup-timeline-item:before{content:"";position:absolute;left:5px;top:14px;bottom:-16px;width:2px;background:#e5eeea}
.crm-followup-timeline-item:last-child:before{display:none}
.crm-followup-timeline-dot{width:12px;height:12px;border-radius:50%;margin-top:.3rem;position:relative;z-index:1;box-shadow:0 0 0 4px #fff;background:#b9c6c1}
.crm-followup-timeline-item--completed .crm-followup-timeline-dot{background:#16924a}
.crm-followup-timeline-item--pending .crm-followup-timeline-dot{background:#d88908}
.crm-followup-timeline-item--overdue .crm-followup-timeline-dot{background:#c73b36}
.crm-followup-timeline-item--cancelled .crm-followup-timeline-dot{background:#8f98a1}
.crm-followup-timeline-content{padding:.92rem;border:1px solid #e1ebe7;border-radius:16px;background:#fbfefd}
.crm-followup-timeline-content>header{display:flex;align-items:flex-start;justify-content:space-between;gap:.8rem;margin-bottom:.45rem}
.crm-followup-timeline-content strong{font-size:.93rem;color:#17312a}
.crm-followup-timeline-content small{display:block;color:var(--muted);font-size:.75rem;margin-top:.2rem}
.crm-followup-timeline-content p{margin:.45rem 0 0;color:#304942;line-height:1.55;word-break:break-word}
.crm-followup-outcome{padding:.55rem .65rem;border-radius:12px;background:#f2fbf6;border:1px solid #d4ebdc}
.crm-followup-history-actions{display:flex;flex-wrap:wrap;gap:.55rem;margin-top:.75rem}
.crm-followup-history-actions form,.crm-followup-reschedule form{display:flex;align-items:flex-end;gap:.5rem;flex-wrap:wrap}
.crm-followup-reschedule summary{list-style:none}.crm-followup-reschedule summary::-webkit-details-marker{display:none}
.crm-followup-reschedule[open] summary{margin-bottom:.55rem}
.crm-followup-complete-form input{min-width:180px}
.crm-followup-activity-list{display:flex;flex-direction:column;gap:.8rem;margin-top:.95rem}
.crm-followup-activity-list>div{display:grid;grid-template-columns:12px minmax(0,1fr);gap:.8rem;align-items:start}
.crm-followup-activity-list>div>i{width:12px;height:12px;border-radius:50%;background:#d7e6df;margin-top:.32rem;display:block}
.crm-followup-activity-list span{display:block;padding:.82rem .9rem;border:1px solid #e1ebe7;border-radius:14px;background:#fbfefd}
.crm-followup-activity-list strong{display:block;color:#17312a;font-size:.9rem}
.crm-followup-activity-list small{display:block;color:var(--muted);font-size:.75rem;margin-top:.2rem}
.crm-followup-activity-list p{margin:.38rem 0 0;color:#304942;line-height:1.55}
.crm-followup-no-selection{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:2.6rem 1rem;min-height:360px}
.crm-followup-no-selection span{font-size:2rem;line-height:1;margin-bottom:.55rem;color:#6a8b7f}
.crm-followup-no-selection h2{margin:0 0 .3rem;color:#17312a;font-size:1.16rem}
.crm-followup-no-selection p{margin:0;max-width:280px;color:var(--muted)}

@keyframes crmFollowupSpin{to{transform:translateY(-50%) rotate(360deg)}}

@media(max-width:1360px){
  .crm-followup-stats{grid-template-columns:repeat(4,minmax(0,1fr))}
  .crm-followup-toolbar{grid-template-columns:160px minmax(0,1fr) auto auto}
  .crm-followup-workspace{grid-template-columns:minmax(0,1fr) 360px}
}
@media(max-width:1180px){
  .crm-followup-workspace{grid-template-columns:1fr}
  .crm-followup-detail-panel{position:static}
  .crm-followup-quick-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:980px){
  .crm-followup-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
  .crm-followup-toolbar{grid-template-columns:1fr 1fr;align-items:stretch}
  .crm-followup-search-submit,.crm-followup-advanced>summary{width:100%}
  .crm-followup-advanced-panel{left:0;right:0;width:auto;grid-template-columns:repeat(2,minmax(0,1fr))}
  .crm-followup-advanced-actions{grid-column:span 2;justify-content:stretch}
  .crm-followup-advanced-actions .btn{flex:1;justify-content:center}
  .crm-followup-schedule-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .crm-followup-page{gap:.9rem}
  .crm-followup-stats{grid-template-columns:1fr 1fr;gap:.8rem}
  .crm-followup-stat{min-height:76px;padding:.8rem}
  .crm-followup-toolbar-card,.crm-followup-list-panel,.crm-followup-profile-card,.crm-followup-next-card,.crm-followup-schedule-card,.crm-followup-history-card,.crm-followup-activity-card,.crm-followup-no-selection{padding:.9rem}
  .crm-followup-toolbar{grid-template-columns:1fr}
  .crm-followup-search-submit{width:100%}
  .crm-followup-advanced{width:100%}
  .crm-followup-advanced>summary{width:100%}
  .crm-followup-advanced-panel{position:static;margin-top:.7rem;width:100%;box-shadow:none}
  .crm-followup-panel-head{flex-direction:column;align-items:stretch}
  .crm-followup-panel-head .btn{width:100%;justify-content:center}
  .crm-followup-table-wrap{border:0;background:transparent;overflow:visible}
  .crm-followup-table,.crm-followup-table thead,.crm-followup-table tbody,.crm-followup-table tr,.crm-followup-table td{display:block;width:100%;min-width:0}
  .crm-followup-table thead{display:none}
  .crm-followup-table tbody{display:flex;flex-direction:column;gap:.8rem}
  .crm-followup-table tbody tr{border:1px solid var(--line);border-radius:16px;overflow:hidden;background:#fff;box-shadow:0 8px 20px rgba(21,65,51,.05)}
  .crm-followup-table tbody td{border-bottom:1px solid #edf2ef;padding:.72rem .82rem;display:grid;grid-template-columns:110px minmax(0,1fr);gap:.7rem;align-items:start;background:transparent;text-align:left!important}
  .crm-followup-table tbody td:last-child{border-bottom:0}
  .crm-followup-table tbody td:before{content:"";font-size:.72rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:#688079;padding-top:.12rem}
  .crm-followup-table tbody td:nth-child(1):before{content:"Party"}
  .crm-followup-table tbody td:nth-child(2):before{content:"Contact"}
  .crm-followup-table tbody td:nth-child(3):before{content:"Orders"}
  .crm-followup-table tbody td:nth-child(4):before{content:"Pending"}
  .crm-followup-table tbody td:nth-child(5):before{content:"Next follow-up"}
  .crm-followup-table tbody td:nth-child(6):before{content:"Status"}
  .crm-followup-table tbody td:nth-child(7):before{content:"Actions"}
  .crm-followup-party-cell{min-width:0}
  .crm-followup-row-actions{justify-content:flex-start}
  .crm-followup-pagination{grid-template-columns:1fr 1fr}
  .crm-followup-page-numbers{grid-column:1/-1;grid-row:1;justify-content:flex-start;flex-wrap:nowrap;overflow-x:auto;padding-bottom:.2rem}
  .crm-followup-profile-top{grid-template-columns:50px minmax(0,1fr);align-items:start}
  .crm-followup-profile-state{grid-column:1/-1;justify-self:start}
  .crm-followup-profile-info,.crm-followup-balance-grid,.crm-followup-next-meta{grid-template-columns:1fr}
  .crm-followup-schedule-grid{grid-template-columns:1fr}
  .crm-followup-field-wide{grid-column:span 1}
  .crm-followup-history-actions,.crm-followup-history-actions form,.crm-followup-reschedule form{display:grid;grid-template-columns:1fr;align-items:stretch}
  .crm-followup-history-actions .btn,.crm-followup-reschedule .btn{width:100%;justify-content:center}
  .crm-followup-complete-form input{min-width:0;width:100%}
}
@media(max-width:520px){
  .crm-followup-stats{grid-template-columns:1fr}
  .crm-followup-stat{min-height:72px;gap:.55rem}
  .crm-followup-stat-copy small{font-size:.84rem}
  .crm-followup-stat-copy strong{font-size:1.35rem}
  .crm-followup-quick-actions{grid-template-columns:1fr}
  .crm-followup-advanced-panel{grid-template-columns:1fr}
  .crm-followup-advanced-actions{grid-column:span 1;flex-direction:column}
  .crm-followup-table tbody td{grid-template-columns:1fr;gap:.3rem}
  .crm-followup-table tbody td:before{padding-top:0}
  .crm-followup-timeline-content>header,.crm-followup-next-card header,.crm-followup-side-heading{flex-direction:column}
}

/* =====================================================
   Follow-ups: table fit + live-search empty line fix
   Scoped only to .crm-followup-page
   ===================================================== */
.crm-followup-page .crm-followup-search-results[hidden],
.crm-followup-page .crm-followup-search-loader[hidden],
.crm-followup-page .crm-followup-search-results:empty{
  display:none!important;
}
.crm-followup-page .crm-followup-live-search,
.crm-followup-page .crm-followup-search-control{
  min-width:0;
  width:100%;
}

@media(min-width:1181px){
  .crm-followup-page .crm-followup-workspace{
    grid-template-columns:minmax(0,1.75fr) minmax(320px,.85fr);
  }
  .crm-followup-page .crm-followup-table-wrap{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
  }
  .crm-followup-page .crm-followup-table{
    width:100%;
    min-width:0;
    table-layout:fixed;
  }
  .crm-followup-page .crm-followup-table th,
  .crm-followup-page .crm-followup-table td{
    min-width:0;
    overflow:hidden;
  }
  .crm-followup-page .crm-followup-table th:nth-child(1),
  .crm-followup-page .crm-followup-table td:nth-child(1){width:24%}
  .crm-followup-page .crm-followup-table th:nth-child(2),
  .crm-followup-page .crm-followup-table td:nth-child(2){width:16%}
  .crm-followup-page .crm-followup-table th:nth-child(3),
  .crm-followup-page .crm-followup-table td:nth-child(3){width:10%}
  .crm-followup-page .crm-followup-table th:nth-child(4),
  .crm-followup-page .crm-followup-table td:nth-child(4){width:10%}
  .crm-followup-page .crm-followup-table th:nth-child(5),
  .crm-followup-page .crm-followup-table td:nth-child(5){width:16%}
  .crm-followup-page .crm-followup-table th:nth-child(6),
  .crm-followup-page .crm-followup-table td:nth-child(6){width:11%}
  .crm-followup-page .crm-followup-table th:nth-child(7),
  .crm-followup-page .crm-followup-table td:nth-child(7){width:13%}

  .crm-followup-page .crm-followup-table thead th{
    padding:.76rem .42rem;
    font-size:.65rem;
    letter-spacing:.025em;
    text-align:center;
    white-space:normal;
    line-height:1.25;
  }
  .crm-followup-page .crm-followup-table thead th:first-child,
  .crm-followup-page .crm-followup-table thead th:nth-child(2){
    text-align:left;
  }
  .crm-followup-page .crm-followup-table tbody td{
    padding:.72rem .42rem;
    font-size:.78rem;
    text-align:center;
  }
  .crm-followup-page .crm-followup-table tbody td:first-child,
  .crm-followup-page .crm-followup-table tbody td:nth-child(2){
    text-align:left;
  }
  .crm-followup-page .crm-followup-party-cell{
    min-width:0;
    width:100%;
    gap:.48rem;
  }
  .crm-followup-page .crm-followup-avatar{
    width:34px;
    height:34px;
    flex:0 0 34px;
    font-size:.76rem;
  }
  .crm-followup-page .crm-followup-party-cell strong{
    font-size:.82rem;
  }
  .crm-followup-page .crm-followup-party-cell small,
  .crm-followup-page .crm-followup-table td small{
    font-size:.67rem;
    line-height:1.35;
  }
  .crm-followup-page .crm-followup-table tbody td>strong{
    display:block;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    font-size:.77rem;
    line-height:1.35;
  }
  .crm-followup-page .crm-followup-table tbody td:nth-child(2)>strong{
    white-space:nowrap;
  }
  .crm-followup-page .crm-followup-table tbody td:nth-child(5)>strong{
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .crm-followup-page .crm-followup-count-pill{
    min-width:29px;
    padding:.24rem .42rem;
    font-size:.7rem;
  }
  .crm-followup-page .crm-followup-status{
    max-width:100%;
    padding:.27rem .4rem;
    justify-content:center;
    text-align:center;
    white-space:normal;
    overflow-wrap:anywhere;
    font-size:.65rem;
  }
  .crm-followup-page .crm-followup-row-actions{
    justify-content:center;
    gap:.24rem;
  }
  .crm-followup-page .crm-followup-row-actions a{
    width:27px;
    height:27px;
    flex:0 0 27px;
    border-radius:8px;
    font-size:.74rem;
  }
}

/* ===== Customers only: action dropdown display fix (2026-07-26) ===== */
.customer-master-table .party-action-head,
.customer-master-table .party-action-cell{
  width:126px;
  min-width:126px;
  text-align:center;
}

.customer-master-table .party-action-cell{
  position:relative;
  overflow:visible;
}

.customer-master-table .party-action-dropdown{
  position:relative;
  display:inline-block;
  max-width:100%;
  margin:0;
  vertical-align:middle;
}

.customer-master-table .party-action-trigger{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.38rem;
  min-width:86px;
  min-height:38px;
  margin:0;
  padding:.42rem .68rem;
  border:1px solid #d3e0db;
  border-radius:11px;
  background:#fff;
  color:#1c2b25;
  font:inherit;
  font-size:.79rem;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
  list-style:none;
  cursor:pointer;
  user-select:none;
}

.customer-master-table .party-action-trigger::-webkit-details-marker{
  display:none;
}

.customer-master-table .party-action-trigger::marker{
  content:"";
}

.customer-master-table .party-action-dropdown[open] > .party-action-trigger{
  border-color:#6fa78f;
  background:#f1f8f5;
  color:var(--brand,#0e6b4e);
  box-shadow:0 0 0 3px rgba(14,107,78,.08);
}

.customer-master-table .party-action-dropdown:not([open]) > .party-action-menu{
  display:none !important;
}

.customer-master-table .party-action-menu{
  position:absolute;
  top:calc(100% + 7px);
  right:0;
  z-index:9999;
  display:grid;
  gap:4px;
  width:232px;
  min-width:232px;
  max-width:calc(100vw - 20px);
  max-height:calc(100vh - 20px);
  margin:0;
  padding:7px;
  overflow-x:hidden;
  overflow-y:auto;
  border:1px solid #d3e0db;
  border-radius:12px;
  background:#fff;
  box-shadow:0 16px 38px rgba(12,52,39,.2),0 4px 12px rgba(12,52,39,.08);
  text-align:left;
}

.customer-master-table .party-action-menu.is-floating{
  position:fixed;
  top:auto;
  right:auto;
  z-index:10000;
}

.customer-master-table .party-action-menu-form{
  display:block;
  width:100%;
  margin:0;
  padding:0;
}

.customer-master-table .party-action-item{
  display:flex;
  align-items:center;
  gap:.62rem;
  width:100%;
  min-width:0;
  min-height:40px;
  margin:0;
  padding:.56rem .66rem;
  border:0;
  border-radius:9px;
  background:transparent;
  color:#1c2b25;
  font:inherit;
  font-size:.8rem;
  font-weight:650;
  line-height:1.25;
  text-align:left;
  text-decoration:none;
  white-space:normal;
  overflow-wrap:anywhere;
  cursor:pointer;
  appearance:none;
}

.customer-master-table .party-action-item:hover,
.customer-master-table .party-action-item:focus-visible{
  background:#eef7f3;
  color:var(--brand,#0e6b4e);
  outline:none;
}

.customer-master-table .party-action-icon{
  display:grid;
  place-items:center;
  flex:0 0 29px;
  width:29px;
  height:29px;
  border-radius:8px;
  background:#e5f3ed;
  color:var(--brand,#0e6b4e);
  font-size:.86rem;
  font-weight:800;
  line-height:1;
}

.customer-master-table .party-action-item.is-primary{
  color:var(--brand,#0e6b4e);
}

.customer-master-table .party-action-item.is-danger{
  color:#b02d35;
}

.customer-master-table .party-action-item.is-danger:hover,
.customer-master-table .party-action-item.is-danger:focus-visible{
  background:#fff0f1;
  color:#98212a;
}

.customer-master-table .party-action-item.is-danger .party-action-icon{
  background:#fde8ea;
  color:#b02d35;
}

.customer-master-table tr.has-party-action-open,
.customer-master-table .party-action-cell.is-menu-open{
  position:relative;
  z-index:40;
}

@media(max-width:820px){
  .customer-master-table .party-action-head,
  .customer-master-table .party-action-cell{
    width:112px;
    min-width:112px;
  }

  .customer-master-table .party-action-trigger{
    min-width:80px;
    min-height:36px;
    padding:.38rem .56rem;
  }

  .customer-master-table .party-action-menu{
    width:218px;
    min-width:218px;
    max-width:calc(100vw - 16px);
    padding:6px;
  }
}

/* Quotation details: keep every status label visible and aligned on desktop/mobile. */
.quotation-details-card .card-head h2{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.42rem;
}
.quotation-details-card .quotation-status-badge{
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  min-height:26px;
  min-width:58px;
  margin:0;
  padding:.26rem .68rem!important;
  border:1px solid transparent;
  border-radius:999px;
  font-size:.76rem!important;
  font-weight:800!important;
  line-height:1.1!important;
  letter-spacing:.01em;
  white-space:nowrap;
  text-indent:0!important;
  opacity:1!important;
  visibility:visible!important;
}
.quotation-details-card .quotation-status-badge.badge-grey{
  background:#e8eef4!important;
  border-color:#d3dde7;
  color:#26352f!important;
  -webkit-text-fill-color:#26352f!important;
}
.quotation-details-card .quotation-status-badge.badge-blue{
  color:#165d85!important;
  -webkit-text-fill-color:#165d85!important;
}
.quotation-details-card .quotation-status-badge.badge-green{
  color:#166534!important;
  -webkit-text-fill-color:#166534!important;
}
.quotation-details-card .quotation-status-badge.badge-red{
  color:#991b1b!important;
  -webkit-text-fill-color:#991b1b!important;
}
@media(max-width:640px){
  .quotation-details-card .card-head h2{gap:.35rem}
  .quotation-details-card .quotation-status-badge{min-height:24px;padding:.23rem .58rem!important;font-size:.72rem!important}
}


/* ===== Messaging only: scheduled messages table responsive fit (2026-07-26) ===== */
.scheduled-message-card .scheduled-message-table-wrap{
  width:100%;
  max-width:100%;
  overflow:visible;
  border:1px solid #d9e6e1;
  border-radius:14px;
  background:#fff;
}
.scheduled-message-card .scheduled-message-table{
  width:100%;
  min-width:0!important;
  margin:0;
  table-layout:fixed;
  border-collapse:separate;
  border-spacing:0;
}
.scheduled-message-card .scheduled-message-table th,
.scheduled-message-card .scheduled-message-table td{
  min-width:0;
  padding:.72rem .48rem;
  vertical-align:middle;
  text-align:left;
  font-size:.82rem;
  line-height:1.38;
}
.scheduled-message-card .scheduled-message-table thead th{
  position:static;
  white-space:normal;
  overflow-wrap:normal;
  word-break:normal;
  line-height:1.2;
  font-size:.72rem;
  background:#f5f9f7;
}
.scheduled-message-card .scheduled-message-table th:nth-child(1){width:13%}
.scheduled-message-card .scheduled-message-table th:nth-child(2){width:13%}
.scheduled-message-card .scheduled-message-table th:nth-child(3){width:7%}
.scheduled-message-card .scheduled-message-table th:nth-child(4){width:8%}
.scheduled-message-card .scheduled-message-table th:nth-child(5){width:10%}
.scheduled-message-card .scheduled-message-table th:nth-child(6){width:13%}
.scheduled-message-card .scheduled-message-table th:nth-child(7){width:15%}
.scheduled-message-card .scheduled-message-table th:nth-child(8){width:7%}
.scheduled-message-card .scheduled-message-table th:nth-child(9){width:5%}
.scheduled-message-card .scheduled-message-table th:nth-child(10){width:9%}
.scheduled-message-card .scheduled-message-table td{
  overflow-wrap:anywhere;
  word-break:normal;
}
.scheduled-message-card .scheduled-message-table td small{
  display:block;
  margin-top:.18rem;
  line-height:1.3;
}
.scheduled-message-card .msg-date-cell,
.scheduled-message-card .msg-id-cell{
  white-space:normal;
}
.scheduled-message-card .msg-date-cell .msg-nowrap{
  display:block;
  white-space:normal;
}
.scheduled-message-card .msg-copy-line{
  display:inline-flex;
  width:100%;
  max-width:100%;
  min-width:0;
  align-items:center;
  gap:.3rem;
}
.scheduled-message-card .msg-copy-line .msg-nowrap,
.scheduled-message-card .msg-copy-line code{
  display:block;
  min-width:0;
  max-width:calc(100% - 22px);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.scheduled-message-card .msg-copy-btn{
  flex:0 0 20px;
  width:20px;
  height:20px;
}
.scheduled-message-card .msg-copy-btn svg{
  width:14px;
  height:14px;
}
.scheduled-message-card .msg-source-badge,
.scheduled-message-card .scheduled-message-table .badge{
  max-width:100%;
  min-height:24px;
  padding:.18rem .45rem;
  white-space:normal;
  text-align:center;
  line-height:1.2;
}
.scheduled-message-card .msg-message-cell{
  min-width:0;
  max-width:none!important;
}
.scheduled-message-card .msg-message-text{
  display:-webkit-box;
  max-height:4.2em;
  overflow:hidden;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  line-height:1.4;
  white-space:normal;
  overflow-wrap:anywhere;
}
.scheduled-message-card .msg-event-link{
  white-space:normal;
}
.scheduled-message-card .msg-actions-cell{
  position:static;
  right:auto;
  z-index:auto;
  background:transparent;
  box-shadow:none;
  white-space:normal;
}
.scheduled-message-card .scheduled-message-table thead .msg-actions-cell,
.scheduled-message-card .scheduled-message-table thead th:last-child{
  background:#f5f9f7;
}
.scheduled-message-card .scheduled-message-table tbody tr:hover .msg-actions-cell{
  background:transparent;
}
.scheduled-message-card .msg-row-actions{
  display:grid;
  grid-template-columns:1fr;
  gap:.3rem;
  min-width:0;
}
.scheduled-message-card .msg-row-actions .btn,
.scheduled-message-card .msg-row-actions form,
.scheduled-message-card .msg-row-actions form .btn{
  width:100%;
  min-width:0;
  margin:0;
  padding:.42rem .35rem;
  font-size:.74rem;
}

@media(max-width:1100px) and (min-width:768px){
  .scheduled-message-card .scheduled-message-table th,
  .scheduled-message-card .scheduled-message-table td{
    padding:.62rem .38rem;
    font-size:.76rem;
  }
  .scheduled-message-card .scheduled-message-table thead th{
    font-size:.66rem;
  }
  .scheduled-message-card .msg-row-actions .btn,
  .scheduled-message-card .msg-row-actions form .btn{
    padding:.38rem .25rem;
    font-size:.68rem;
  }
}

@media(max-width:767px){
  .scheduled-message-card .scheduled-message-table-wrap{
    overflow:visible;
    border:0;
    border-radius:0;
    background:transparent;
  }
  .scheduled-message-card .scheduled-message-table,
  .scheduled-message-card .scheduled-message-table tbody{
    display:block;
    width:100%;
    min-width:0!important;
  }
  .scheduled-message-card .scheduled-message-table thead{
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
    border:0;
  }
  .scheduled-message-card .scheduled-message-table tbody{
    display:grid;
    gap:.75rem;
  }
  .scheduled-message-card .scheduled-message-table tbody tr{
    display:block;
    width:100%;
    overflow:hidden;
    padding:.28rem .78rem;
    border:1px solid #d9e6e1;
    border-radius:13px;
    background:#fff;
    box-shadow:0 5px 16px rgba(25,76,61,.05);
  }
  .scheduled-message-card .scheduled-message-table tbody td{
    display:grid;
    width:100%;
    grid-template-columns:minmax(102px,34%) minmax(0,1fr);
    column-gap:.7rem;
    row-gap:.18rem;
    align-items:start;
    padding:.55rem 0;
    border:0;
    border-bottom:1px dashed #dce8e4;
    font-size:.86rem;
    text-align:left;
  }
  .scheduled-message-card .scheduled-message-table tbody td:last-child{
    border-bottom:0;
  }
  .scheduled-message-card .scheduled-message-table tbody td::before{
    grid-column:1;
    grid-row:1 / span 20;
    color:#60736c;
    font-size:.68rem;
    font-weight:800;
    line-height:1.35;
    text-transform:uppercase;
    letter-spacing:.025em;
  }
  .scheduled-message-card .scheduled-message-table tbody td>*{
    grid-column:2;
    min-width:0;
  }
  .scheduled-message-card .scheduled-message-table tbody td:nth-child(1)::before{content:"Scheduled at"}
  .scheduled-message-card .scheduled-message-table tbody td:nth-child(2)::before{content:"Recipient"}
  .scheduled-message-card .scheduled-message-table tbody td:nth-child(3)::before{content:"Channel"}
  .scheduled-message-card .scheduled-message-table tbody td:nth-child(4)::before{content:"Source"}
  .scheduled-message-card .scheduled-message-table tbody td:nth-child(5)::before{content:"Order ID"}
  .scheduled-message-card .scheduled-message-table tbody td:nth-child(6)::before{content:"Courier Parcel ID"}
  .scheduled-message-card .scheduled-message-table tbody td:nth-child(7)::before{content:"Message"}
  .scheduled-message-card .scheduled-message-table tbody td:nth-child(8)::before{content:"Status"}
  .scheduled-message-card .scheduled-message-table tbody td:nth-child(9)::before{content:"Attempts"}
  .scheduled-message-card .scheduled-message-table tbody td:nth-child(10)::before{content:"Actions"}
  .scheduled-message-card .scheduled-message-table tbody td[colspan]{
    display:block;
    padding:1rem .2rem;
    border:0;
  }
  .scheduled-message-card .scheduled-message-table tbody td[colspan]::before{
    content:none;
  }
  .scheduled-message-card .msg-copy-line{
    width:auto;
    justify-self:start;
  }
  .scheduled-message-card .msg-message-text{
    max-height:5.6em;
    -webkit-line-clamp:4;
  }
  .scheduled-message-card .msg-row-actions{
    grid-template-columns:repeat(auto-fit,minmax(84px,1fr));
  }
  .scheduled-message-card .msg-row-actions .btn,
  .scheduled-message-card .msg-row-actions form .btn{
    min-height:38px;
    font-size:.78rem;
  }
}

@media(max-width:420px){
  .scheduled-message-card .scheduled-message-table tbody tr{
    padding:.25rem .68rem;
  }
  .scheduled-message-card .scheduled-message-table tbody td{
    grid-template-columns:1fr;
    gap:.28rem;
    padding:.52rem 0;
  }
  .scheduled-message-card .scheduled-message-table tbody td::before{
    grid-column:1;
    grid-row:auto;
  }
  .scheduled-message-card .scheduled-message-table tbody td>*{
    grid-column:1;
  }
}

/* =========================================================
   Messaging > Scheduled Messages table: final column fit fix
   Scoped only to the scheduled-message table.
   ========================================================= */
@media (min-width:768px){
  .scheduled-message-card .scheduled-message-table-wrap{
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:visible;
    scrollbar-gutter:stable;
  }

  .scheduled-message-card .scheduled-message-table{
    width:100%;
    min-width:900px;
    table-layout:fixed;
  }

  .scheduled-message-card .scheduled-message-table th,
  .scheduled-message-card .scheduled-message-table td{
    box-sizing:border-box;
    min-width:0;
    padding:.68rem .32rem;
    vertical-align:middle;
  }

  .scheduled-message-card .scheduled-message-table thead th{
    font-size:.68rem;
    line-height:1.16;
    letter-spacing:0;
    overflow-wrap:normal;
    word-break:normal;
  }

  .scheduled-message-card .scheduled-message-table th:nth-child(1){width:13%}
  .scheduled-message-card .scheduled-message-table th:nth-child(2){width:13%}
  .scheduled-message-card .scheduled-message-table th:nth-child(3){width:8%}
  .scheduled-message-card .scheduled-message-table th:nth-child(4){width:8%}
  .scheduled-message-card .scheduled-message-table th:nth-child(5){width:9%}
  .scheduled-message-card .scheduled-message-table th:nth-child(6){width:11%}
  .scheduled-message-card .scheduled-message-table th:nth-child(7){width:15%}
  .scheduled-message-card .scheduled-message-table th:nth-child(8){width:7%}
  .scheduled-message-card .scheduled-message-table th:nth-child(9){width:7%}
  .scheduled-message-card .scheduled-message-table th:nth-child(10){width:9%}

  .scheduled-message-card .scheduled-message-table td{
    font-size:.76rem;
    line-height:1.32;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(2) .msg-copy-line{
    gap:.2rem;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(2) .msg-copy-line .msg-nowrap{
    max-width:calc(100% - 18px);
    overflow:visible;
    text-overflow:clip;
    font-size:.72rem;
    letter-spacing:-.015em;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(2) .msg-copy-btn{
    flex-basis:16px;
    width:16px;
    height:18px;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(2) .msg-copy-btn svg{
    width:12px;
    height:12px;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(3) strong{
    display:block;
    font-size:.78rem;
    line-height:1.15;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(3) small{
    font-size:.62rem;
    line-height:1.15;
    overflow-wrap:normal;
    word-break:normal;
  }

  .scheduled-message-card .msg-source-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:auto;
    min-height:22px;
    padding:.15rem .34rem;
    font-size:.64rem;
    white-space:nowrap;
    overflow-wrap:normal;
    word-break:normal;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(5) code,
  .scheduled-message-card .scheduled-message-table td:nth-child(6) code{
    font-size:.61rem;
  }

  .scheduled-message-card .msg-message-text{
    font-size:.74rem;
    line-height:1.36;
    -webkit-line-clamp:3;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(8),
  .scheduled-message-card .scheduled-message-table td:nth-child(9),
  .scheduled-message-card .scheduled-message-table th:nth-child(8),
  .scheduled-message-card .scheduled-message-table th:nth-child(9){
    text-align:center;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(9) strong{
    display:block;
    line-height:1.15;
  }

  .scheduled-message-card .msg-event-link{
    display:block;
    margin-top:.2rem;
    font-size:.62rem;
    line-height:1.15;
    white-space:nowrap;
    overflow-wrap:normal;
    word-break:normal;
  }

  .scheduled-message-card .msg-row-actions{
    width:100%;
    gap:.25rem;
  }

  .scheduled-message-card .msg-row-actions .btn,
  .scheduled-message-card .msg-row-actions form,
  .scheduled-message-card .msg-row-actions form .btn{
    width:100%;
    max-width:100%;
  }

  .scheduled-message-card .msg-row-actions .btn,
  .scheduled-message-card .msg-row-actions form .btn{
    min-height:36px;
    padding:.35rem .2rem;
    font-size:.7rem;
    white-space:nowrap;
  }
}

@media (min-width:768px) and (max-width:1100px){
  .scheduled-message-card .scheduled-message-table{
    min-width:880px;
  }

  .scheduled-message-card .scheduled-message-table th,
  .scheduled-message-card .scheduled-message-table td{
    padding:.6rem .26rem;
  }
}

/* =========================================================
   Messaging > Scheduled Messages table: larger readable text
   and horizontal responsiveness when the available width is low.
   Scoped only to the Scheduled Messages table.
   ========================================================= */
@media (min-width:768px){
  .scheduled-message-card .scheduled-message-table-wrap{
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:visible;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-inline:contain;
  }

  .scheduled-message-card .scheduled-message-table{
    width:100%;
    min-width:1180px;
    table-layout:fixed;
  }

  .scheduled-message-card .scheduled-message-table th,
  .scheduled-message-card .scheduled-message-table td{
    padding:.78rem .48rem;
  }

  .scheduled-message-card .scheduled-message-table thead th{
    font-size:.78rem;
    line-height:1.25;
    font-weight:700;
  }

  .scheduled-message-card .scheduled-message-table td{
    font-size:.86rem;
    line-height:1.42;
  }

  .scheduled-message-card .scheduled-message-table td small{
    font-size:.72rem;
    line-height:1.35;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(2) .msg-copy-line .msg-nowrap{
    max-width:calc(100% - 20px);
    font-size:.82rem;
    letter-spacing:0;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(3) strong{
    font-size:.88rem;
    line-height:1.25;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(3) small{
    font-size:.72rem;
    line-height:1.3;
  }

  .scheduled-message-card .msg-source-badge{
    min-height:25px;
    padding:.2rem .46rem;
    font-size:.72rem;
    line-height:1.2;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(5) code,
  .scheduled-message-card .scheduled-message-table td:nth-child(6) code{
    font-size:.72rem;
  }

  .scheduled-message-card .msg-message-text{
    font-size:.84rem;
    line-height:1.45;
  }

  .scheduled-message-card .msg-event-link{
    font-size:.72rem;
    line-height:1.3;
  }

  .scheduled-message-card .msg-row-actions .btn,
  .scheduled-message-card .msg-row-actions form .btn{
    min-height:38px;
    padding:.42rem .3rem;
    font-size:.8rem;
  }
}

@media (min-width:768px) and (max-width:1100px){
  .scheduled-message-card .scheduled-message-table{
    min-width:1180px;
  }
}

/* ===== Messaging gateway card fit/responsive adjustment (2026-07-27) ===== */
.message-gateway-grid{
  grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  gap:.75rem;
}
.message-gateway-card{
  min-height:0;
  gap:.75rem;
  padding:.9rem;
}
.message-gateway-details{
  gap:.45rem;
  padding:.68rem .72rem;
}
.message-gateway-result{
  min-height:38px;
  padding:.55rem .68rem;
}
.message-gateway-actions{
  gap:.5rem;
}
.message-gateway-actions>.btn,
.message-gateway-test-form .btn{
  min-height:40px;
}
.message-gateway-test-form input{
  height:40px;
}
@media(max-width:700px){
  .message-gateway-grid{
    grid-template-columns:1fr;
  }
}

/* ===== Message Event History: force compact status badge (2026-07-27) ===== */
.message-detail-grid .message-detail-item > .message-status-badge{
  display:inline-flex !important;
  align-items:center;
  align-self:flex-start !important;
  justify-self:start !important;
  flex:0 0 auto !important;
  width:max-content !important;
  min-width:0 !important;
  max-width:100% !important;
  white-space:nowrap;
}

/* ===== Follow-ups: confirmed-order metric card (2026-07-27) ===== */
.crm-followup-stats--customer{grid-template-columns:repeat(7,minmax(0,1fr))}
.crm-followup-stat--indigo:before{background:#4763d7}
.crm-followup-stat--indigo .crm-followup-stat-icon{background:#e9edff;color:#3f58c7}

/* ===== Follow-ups: compact and centered summary cards =====
   Scoped only to the Follow-ups page. */
.crm-followup-page .crm-followup-stats--customer{
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:.6rem;
}
.crm-followup-page .crm-followup-stat{
  min-width:0;
  min-height:64px;
  padding:.55rem .6rem;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0;
  border-radius:15px;
}
.crm-followup-page .crm-followup-stat-copy{
  width:100%;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap:.15rem;
}
.crm-followup-page .crm-followup-stat-copy small{
  display:block;
  width:100%;
  margin:0;
  font-size:.76rem;
  line-height:1.18;
  text-align:center;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  overflow-wrap:break-word;
  word-break:normal;
}
.crm-followup-page .crm-followup-stat-copy strong{
  display:block;
  margin:0;
  font-size:1.32rem;
  line-height:1;
  text-align:center;
}

/* Tablet */
@media(max-width:1199px){
  .crm-followup-page .crm-followup-stats--customer{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
}

/* Mobile */
@media(max-width:700px){
  .crm-followup-page .crm-followup-stats--customer{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.55rem;
  }
  .crm-followup-page .crm-followup-stat{
    min-height:60px;
    padding:.5rem .45rem;
  }
  .crm-followup-page .crm-followup-stat-copy small{
    font-size:.72rem;
  }
  .crm-followup-page .crm-followup-stat-copy strong{
    font-size:1.2rem;
  }
}

/* Very small mobile */
@media(max-width:390px){
  .crm-followup-page .crm-followup-stats--customer{
    grid-template-columns:1fr;
  }
}

/* ===== Customers only: clean customer-type column (2026-07-27) ===== */
.customer-master-table th:nth-child(2),
.customer-master-table td.customer-type-cell{
  width:156px;
  min-width:156px;
}

.customer-master-table td.customer-type-cell{
  vertical-align:middle;
}

.customer-master-table .customer-type-badges{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:.35rem;
  width:100%;
  min-width:0;
}

.customer-master-table .customer-type-badge,
.customer-master-table .customer-repeat-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:max-content;
  max-width:100%;
  min-height:28px;
  margin:0;
  padding:.3rem .68rem;
  border:1px solid rgba(29,78,58,.08);
  border-radius:999px;
  font-size:.72rem;
  font-weight:700;
  line-height:1.15;
  text-align:center;
  white-space:nowrap;
  overflow:visible;
  text-overflow:clip;
}

@media(max-width:700px){
  .customer-master-table th:nth-child(2),
  .customer-master-table td.customer-type-cell{
    width:148px;
    min-width:148px;
  }

  .customer-master-table .customer-type-badge,
  .customer-master-table .customer-repeat-badge{
    min-height:27px;
    padding:.28rem .58rem;
    font-size:.7rem;
  }
}

/* ===== Marketing cost only: hide inactive custom VAT input (2026-07-27) ===== */
.marketing-cost-form .calc-vat-custom[hidden]{
  display:none!important;
}

/* ===== Products only: aligned table headers and compact action dropdown ===== */
.product-list-table{
  min-width:1080px;
}

.product-list-table thead th{
  padding:.72rem .45rem;
  vertical-align:middle;
  line-height:1.15;
  text-align:center;
  white-space:normal;
  word-break:normal;
  overflow-wrap:normal;
  hyphens:none;
}

.product-list-table thead th:first-child{
  text-align:left;
}

.product-list-table th:nth-child(1){width:24%}
.product-list-table th:nth-child(2){width:12%}
.product-list-table th:nth-child(3){width:8%}
.product-list-table th:nth-child(4),
.product-list-table th:nth-child(5),
.product-list-table th:nth-child(6){width:10%}
.product-list-table th:nth-child(7){width:9%}
.product-list-table th:nth-child(8){width:7%}
.product-list-table th:nth-child(9){width:10%}

.product-list-table .product-price-heading span,
.product-list-table .product-price-heading small{
  display:block;
  width:100%;
  line-height:1.12;
  text-align:center;
}

.product-list-table .product-actions-heading,
.product-list-table .product-actions-cell{
  min-width:104px;
  text-align:center;
}

.product-list-table .product-actions-cell{
  position:relative;
  overflow:visible;
}

.product-list-table .product-action-dropdown{
  position:relative;
  display:inline-block;
  max-width:100%;
  margin:0;
  vertical-align:middle;
}

.product-list-table .product-action-trigger{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.35rem;
  min-width:88px;
  min-height:36px;
  margin:0;
  padding:.42rem .65rem;
  border:1px solid #d3e0db;
  border-radius:10px;
  background:#fff;
  color:#1c2b25;
  font:inherit;
  font-size:.76rem;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
  list-style:none;
  cursor:pointer;
  user-select:none;
}

.product-list-table .product-action-trigger::-webkit-details-marker{
  display:none;
}

.product-list-table .product-action-trigger::marker{
  content:"";
}

.product-list-table .product-action-dropdown[open] > .product-action-trigger{
  border-color:#6fa78f;
  background:#f1f8f5;
  color:var(--brand,#0e6b4e);
  box-shadow:0 0 0 3px rgba(14,107,78,.08);
}

.product-list-table .product-action-dropdown:not([open]) > .product-action-menu{
  display:none !important;
}

.product-list-table .product-action-menu{
  position:absolute;
  top:calc(100% + 7px);
  right:0;
  z-index:9999;
  display:grid;
  gap:4px;
  width:210px;
  min-width:210px;
  max-width:calc(100vw - 20px);
  max-height:calc(100vh - 20px);
  margin:0;
  padding:7px;
  overflow-x:hidden;
  overflow-y:auto;
  border:1px solid #d3e0db;
  border-radius:12px;
  background:#fff;
  box-shadow:0 16px 38px rgba(12,52,39,.2),0 4px 12px rgba(12,52,39,.08);
  text-align:left;
}

.product-list-table .product-action-menu.is-floating{
  position:fixed;
  top:auto;
  right:auto;
  z-index:10000;
}

.product-list-table .product-action-menu-form{
  display:block;
  width:100%;
  margin:0;
  padding:0;
}

.product-list-table .product-action-item{
  display:flex;
  align-items:center;
  gap:.6rem;
  width:100%;
  min-width:0;
  min-height:39px;
  margin:0;
  padding:.54rem .64rem;
  border:0;
  border-radius:9px;
  background:transparent;
  color:#1c2b25;
  font:inherit;
  font-size:.79rem;
  font-weight:650;
  line-height:1.25;
  text-align:left;
  text-decoration:none;
  white-space:normal;
  overflow-wrap:anywhere;
  cursor:pointer;
  appearance:none;
}

.product-list-table .product-action-item:hover,
.product-list-table .product-action-item:focus-visible{
  background:#eef7f3;
  color:var(--brand,#0e6b4e);
  outline:none;
}

.product-list-table .product-action-item .party-action-icon{
  display:grid;
  place-items:center;
  flex:0 0 28px;
  width:28px;
  height:28px;
  border-radius:8px;
  background:#e5f3ed;
  color:var(--brand,#0e6b4e);
  font-size:.84rem;
  font-weight:800;
  line-height:1;
}

.product-list-table .product-action-item.is-danger{
  color:#b02d35;
}

.product-list-table .product-action-item.is-danger:hover,
.product-list-table .product-action-item.is-danger:focus-visible{
  background:#fff0f1;
  color:#98212a;
}

.product-list-table .product-action-item.is-danger .party-action-icon{
  background:#fde8ea;
  color:#b02d35;
}

@media(max-width:820px){
  .product-list-table{
    min-width:0;
  }

  .product-list-table .product-actions-cell{
    text-align:left!important;
  }

  .product-list-table .product-action-dropdown{
    display:block;
    width:100%;
  }

  .product-list-table .product-action-trigger{
    width:100%;
    min-height:40px;
  }
}

/* ===== Products only: center the four price-column values on desktop ===== */
@media (min-width:821px){
  .product-list-table tbody td:nth-child(3),
  .product-list-table tbody td:nth-child(4),
  .product-list-table tbody td:nth-child(5),
  .product-list-table tbody td:nth-child(6){
    text-align:center!important;
    vertical-align:middle;
  }
}

/* ===== Expenses page: responsive refresh ===== */
.expense-index-page{
  padding:1rem;
}
.expense-list-head{
  align-items:flex-start;
  gap:1rem;
  margin-bottom:1rem;
}
.expense-list-head>div{min-width:0}
.expense-list-subtitle{
  margin:.3rem 0 0;
  color:var(--muted);
  max-width:760px;
  font-size:.92rem;
  line-height:1.45;
}
.expense-filterbar{
  display:grid;
  grid-template-columns:minmax(230px,1.5fr) repeat(3,minmax(150px,.92fr)) minmax(150px,.9fr) minmax(150px,.9fr) auto;
  gap:.85rem;
  align-items:end;
  margin-bottom:1rem;
  padding:1rem;
  border:1px solid var(--line,#dce7e2);
  border-radius:14px;
  background:linear-gradient(180deg,#fbfdfc 0%,#f6faf8 100%);
}
.expense-filterbar .field{
  margin:0;
}
.expense-filterbar .field span{
  display:block;
  margin-bottom:.35rem;
  color:var(--muted);
  font-size:.75rem;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.expense-filterbar .field input,
.expense-filterbar .field select{
  width:100%;
}
.expense-filter-actions{
  display:flex;
  align-items:end;
  justify-content:flex-start;
  gap:.55rem;
  height:100%;
}
.expense-filter-actions .btn{
  min-width:86px;
}
.expense-summary-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.9rem;
  margin-bottom:1rem;
}
.expense-summary-card{
  min-height:108px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  border:1px solid var(--line,#dce7e2);
  box-shadow:0 10px 22px rgba(16,62,46,.05);
}
.expense-summary-card .stat-label{
  font-size:.76rem;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:var(--muted);
}
.expense-summary-card .stat-value{
  font-size:2rem;
  line-height:1.1;
}
.expense-table-wrap{
  max-width:100%;
  overflow-x:auto;
  border:1px solid var(--line,#dce7e2);
  border-radius:14px;
  background:#fff;
}
.expense-table{
  width:100%;
  min-width:1060px;
}
.expense-table thead th{
  white-space:normal;
  line-height:1.15;
  vertical-align:middle;
  font-size:.74rem;
  letter-spacing:.04em;
}
.expense-table td{
  vertical-align:middle;
}
.expense-date{
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.expense-category-stack,
.expense-reference-stack,
.expense-money-stack{
  display:flex;
  flex-direction:column;
  gap:.18rem;
  min-width:0;
}
.expense-category-stack strong,
.expense-reference-stack strong,
.expense-money-stack strong{
  font-size:.92rem;
}
.expense-category-stack small,
.expense-reference-stack small,
.expense-money-stack small{
  color:var(--muted);
  line-height:1.35;
  overflow-wrap:anywhere;
}
.expense-reference-stack strong{
  overflow-wrap:anywhere;
}
.expense-total-cell strong{
  font-size:1rem;
}
.expense-actions-cell{
  justify-content:flex-start;
  flex-wrap:wrap;
  gap:.45rem;
  min-width:145px;
}
.expense-actions-cell .inline{
  display:inline-flex;
  margin:0;
}
.expense-actions-empty{
  display:inline-flex;
  align-items:center;
  min-height:34px;
}
.expense-empty-row td{
  text-align:center;
  padding:1rem!important;
}
@media (max-width:1260px){
  .expense-filterbar{
    grid-template-columns:minmax(220px,1.35fr) repeat(3,minmax(150px,1fr));
  }
}
@media (max-width:960px){
  .expense-list-head{
    flex-direction:column;
    align-items:stretch;
  }
  .expense-list-head>.btn{
    width:100%;
  }
  .expense-filterbar{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .expense-filter-search,
  .expense-filter-actions{
    grid-column:1/-1;
  }
  .expense-filter-actions .btn{
    width:100%;
  }
  .expense-summary-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:700px){
  .expense-index-page{
    padding:.85rem;
  }
  .expense-filterbar{
    grid-template-columns:1fr;
    padding:.85rem;
    gap:.75rem;
  }
  .expense-summary-grid{
    grid-template-columns:1fr;
    gap:.75rem;
  }
  .expense-summary-card{
    min-height:94px;
  }
  .expense-summary-card .stat-value{
    font-size:1.72rem;
  }
  .expense-table-wrap{
    overflow:visible;
    border:0;
    background:transparent;
  }
  .expense-table{
    min-width:0;
    display:block;
    background:transparent;
    border-collapse:separate;
    border-spacing:0;
  }
  .expense-table thead{
    display:none;
  }
  .expense-table,
  .expense-table tbody{
    display:block;
    width:100%;
  }
  .expense-table tbody{
    display:grid;
    gap:.8rem;
  }
  .expense-table tr{
    display:grid;
    grid-template-columns:1fr;
    gap:0;
    padding:.85rem;
    border:1px solid var(--line,#dce7e2);
    border-radius:14px;
    background:#fff;
    box-shadow:0 8px 20px rgba(18,70,54,.06);
  }
  .expense-table td{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:.75rem;
    width:100%;
    padding:.42rem 0!important;
    border:0!important;
    text-align:right!important;
    white-space:normal!important;
  }
  .expense-table td:before{
    content:attr(data-label);
    flex:0 0 42%;
    text-align:left;
    color:var(--muted);
    font-size:.72rem;
    font-weight:800;
    line-height:1.35;
  }
  .expense-table td.num,
  .expense-table td.num strong,
  .expense-table .expense-date{
    white-space:normal;
  }
  .expense-table td .badge,
  .expense-table td .expense-category-stack,
  .expense-table td .expense-reference-stack,
  .expense-table td .expense-money-stack{
    margin-left:auto;
    text-align:right;
    align-items:flex-end;
  }
  .expense-actions-cell{
    display:block!important;
    padding-top:.75rem!important;
    margin-top:.2rem;
    border-top:1px solid var(--line,#dce7e2)!important;
  }
  .expense-actions-cell:before{
    display:none;
  }
  .expense-actions-cell .btn,
  .expense-actions-cell .inline,
  .expense-actions-cell .inline .btn{
    width:100%;
  }
  .expense-actions-cell{
    display:grid!important;
    grid-template-columns:1fr 1fr;
    gap:.55rem;
  }
  .expense-empty-row,
  .expense-empty-row td{
    display:block!important;
    text-align:center!important;
  }
  .expense-empty-row td:before{
    display:none;
  }
}
@media (max-width:420px){
  .expense-actions-cell{
    grid-template-columns:1fr;
  }
}

/* ===== Expenses page: filter fit, category line and actions alignment ===== */
.expense-filterbar{
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.expense-filter-actions{
  align-items:flex-end;
}
.expense-filter-actions .btn{
  width:100%;
  min-height:44px;
}
.expense-table th:nth-child(2),
.expense-table td:nth-child(2){
  min-width:150px;
}
.expense-category-stack strong{
  white-space:nowrap;
  overflow:visible;
  text-overflow:clip;
}
.expense-table th:last-child,
.expense-table td:last-child{
  width:110px;
  min-width:110px;
  text-align:center;
}
.expense-actions-cell{
  justify-content:center;
  align-items:center;
  min-width:110px;
}
.expense-actions-empty{
  justify-content:center;
  width:100%;
  text-align:center;
}
@media (max-width:960px){
  .expense-filterbar{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .expense-filter-search,
  .expense-filter-actions{
    grid-column:auto;
  }
}
@media (max-width:700px){
  .expense-filterbar{
    grid-template-columns:1fr;
  }
  .expense-category-stack strong{
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .expense-table th:nth-child(2),
  .expense-table td:nth-child(2),
  .expense-table th:last-child,
  .expense-table td:last-child{
    width:auto;
    min-width:0;
  }
  .expense-actions-cell{
    min-width:0;
  }
}

/* ===== Report Center: fit, align and responsive refinement ===== */
.report-toolbar{
  overflow:visible;
}
.report-toolbar-head{
  margin-bottom:.9rem;
}
.report-toolbar-title p{
  max-width:760px;
  line-height:1.45;
}
.report-filter-form{
  grid-template-columns:minmax(220px,.95fr) minmax(0,2.35fr);
  gap:14px 16px;
  padding:0;
}
.report-selector,
.report-dynamic-filters,
.report-action-row,
.saved-report-views,
.report-saved-view-select,
.save-report-view{
  min-width:0;
}
.report-selector select,
.report-dynamic-filters select,
.report-dynamic-filters input,
.report-saved-view-select select,
.save-report-view input{
  width:100%;
  max-width:100%;
}
.report-dynamic-filters{
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
  gap:12px;
}
.report-action-row{
  align-items:center;
  gap:14px;
  padding-top:14px;
  margin-top:2px;
}
.report-view-actions,
.report-download-actions{
  gap:10px;
}
.report-view-actions .btn,
.report-download-actions .btn{
  min-width:110px;
}
.report-download-actions{
  justify-content:flex-end;
}
.saved-report-views{
  display:grid;
  grid-template-columns:minmax(220px,.9fr) minmax(0,1.1fr);
  gap:14px 18px;
  align-items:end;
  padding-top:14px;
  margin-top:14px;
}
.report-saved-view-select{
  align-self:end;
}
.save-report-view{
  display:grid;
  grid-template-columns:minmax(220px,1fr) auto auto;
  align-items:end;
  gap:10px;
  justify-self:end;
}
.save-report-view .check{
  display:inline-flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
  margin:0 2px 8px 0;
}
.save-report-view .btn{
  margin-bottom:1px;
}
.saved-report-chips{
  grid-column:1/-1;
  padding-top:4px;
}
.saved-report-chips .chip-delete{
  align-items:center;
}
@media(max-width:1180px){
  .report-filter-form{
    grid-template-columns:1fr;
  }
  .report-selector,
  .report-dynamic-filters,
  .report-action-row{
    grid-column:1;
  }
  .report-dynamic-filters{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .saved-report-views{
    grid-template-columns:1fr;
  }
  .save-report-view{
    justify-self:stretch;
  }
}
@media(max-width:860px){
  .report-toolbar,
  .report-result-card{
    padding:.9rem;
  }
  .report-dynamic-filters{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .report-action-row{
    flex-direction:column;
    align-items:stretch;
  }
  .report-view-actions,
  .report-download-actions{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    width:100%;
  }
  .report-view-actions .btn,
  .report-download-actions .btn{
    min-width:0;
    width:100%;
  }
  .save-report-view{
    grid-template-columns:1fr 1fr;
  }
  .save-report-view input{
    grid-column:1/-1;
  }
  .save-report-view .check,
  .save-report-view .btn{
    width:100%;
    justify-content:flex-start;
    margin:0;
  }
}
@media(max-width:560px){
  .report-toolbar,
  .report-result-card{
    padding:.8rem;
  }
  .report-dynamic-filters,
  .report-view-actions,
  .report-download-actions,
  .save-report-view{
    grid-template-columns:1fr;
  }
  .report-action-row{
    gap:10px;
  }
  .report-view-actions .btn,
  .report-download-actions .btn,
  .save-report-view .btn,
  .report-saved-view-select,
  .report-saved-view-select .field,
  .report-saved-view-select select{
    width:100%;
  }
}

/* ===== Report Center toolbar: fit, alignment and responsive layout ===== */
.report-center .report-toolbar{
  width:100%;
  max-width:100%;
  min-width:0;
  padding:1.15rem;
  overflow:hidden;
}
.report-center .report-toolbar-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:1rem;
}
.report-center .report-toolbar-title{
  min-width:0;
}
.report-center .report-toolbar-title h2{
  margin:0;
  line-height:1.25;
}
.report-center .report-toolbar-title p{
  margin:.28rem 0 0;
  line-height:1.45;
}
.report-center .report-filter-form{
  display:grid;
  grid-template-columns:minmax(220px,.75fr) minmax(0,2.25fr);
  gap:.9rem 1rem;
  width:100%;
  min-width:0;
  align-items:end;
}
.report-center .report-filter-form .field,
.report-center .report-filter-form .field.compact{
  min-width:0;
  width:100%;
  margin:0;
}
.report-center .report-filter-form .field>span,
.report-center .saved-report-views .field>span{
  display:block;
  margin-bottom:.38rem;
  color:var(--muted);
  font-size:.76rem;
  font-weight:800;
  line-height:1.25;
}
.report-center .report-filter-form input,
.report-center .report-filter-form select,
.report-center .saved-report-views input,
.report-center .saved-report-views select{
  width:100%;
  min-width:0;
  max-width:100%;
}
.report-center .report-selector{
  grid-column:1;
}
.report-center .report-dynamic-filters{
  grid-column:2;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:.9rem;
  min-width:0;
}
.report-center .report-action-row{
  grid-column:1/-1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  width:100%;
  min-width:0;
  margin-top:.1rem;
  padding-top:.9rem;
  border-top:1px solid var(--line,var(--border,#dce7e2));
}
.report-center .report-view-actions,
.report-center .report-download-actions{
  display:flex;
  align-items:center;
  gap:.55rem;
  flex-wrap:wrap;
  min-width:0;
}
.report-center .report-download-actions{
  justify-content:flex-end;
  margin-left:auto;
}
.report-center .report-action-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:92px;
  min-height:42px;
  padding:.58rem .85rem;
  text-align:center;
  white-space:nowrap;
}
.report-center .saved-report-views{
  display:grid;
  grid-template-columns:minmax(220px,.8fr) minmax(0,1.7fr);
  gap:.9rem 1rem;
  align-items:end;
  width:100%;
  min-width:0;
  margin-top:1rem;
  padding-top:1rem;
  border-top:1px solid var(--line,var(--border,#dce7e2));
}
.report-center .report-saved-view-select,
.report-center .save-report-view{
  width:100%;
  min-width:0;
  margin:0;
}
.report-center .report-saved-view-select{
  display:block;
}
.report-center .report-saved-view-select .field.compact{
  width:100%;
  min-width:0;
  margin:0;
}
.report-center .save-report-view{
  display:grid;
  grid-template-columns:minmax(180px,1fr) auto auto;
  gap:.65rem;
  align-items:center;
}
.report-center .save-report-view>input[name="view_name"]{
  width:100%;
  min-width:0;
}
.report-center .save-report-view .check{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.4rem;
  min-height:42px;
  margin:0;
  padding:0 .35rem;
  white-space:nowrap;
}
.report-center .save-report-view .check input{
  width:auto;
  min-width:auto;
  margin:0;
}
.report-center .save-report-view .btn{
  min-height:42px;
  white-space:nowrap;
}
.report-center .saved-report-chips{
  grid-column:1/-1;
  display:flex;
  align-items:center;
  gap:.5rem;
  flex-wrap:wrap;
  min-width:0;
}
.report-center .saved-report-chips:empty{
  display:none;
}
.report-center .saved-report-chips form{
  max-width:100%;
  margin:0;
}
.report-center .saved-report-chips .chip-delete{
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
}

@media(max-width:1080px){
  .report-center .report-filter-form{
    grid-template-columns:1fr;
  }
  .report-center .report-selector,
  .report-center .report-dynamic-filters,
  .report-center .report-action-row{
    grid-column:1;
  }
  .report-center .report-dynamic-filters{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .report-center .saved-report-views{
    grid-template-columns:1fr;
  }
  .report-center .saved-report-chips{
    grid-column:1;
  }
}

@media(max-width:700px){
  .report-center .report-toolbar{
    padding:.85rem;
    border-radius:13px;
  }
  .report-center .report-toolbar-head{
    margin-bottom:.85rem;
  }
  .report-center .report-dynamic-filters{
    grid-template-columns:1fr;
    gap:.75rem;
  }
  .report-center .report-action-row{
    display:grid;
    grid-template-columns:1fr;
    gap:.7rem;
    align-items:stretch;
  }
  .report-center .report-view-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
  }
  .report-center .report-download-actions{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    width:100%;
    margin:0;
  }
  .report-center .report-action-button{
    width:100%;
    min-width:0;
    padding:.55rem .4rem;
    white-space:normal;
  }
  .report-center .saved-report-views{
    gap:.75rem;
    margin-top:.85rem;
    padding-top:.85rem;
  }
  .report-center .save-report-view{
    grid-template-columns:1fr;
    align-items:stretch;
  }
  .report-center .save-report-view .check{
    justify-content:flex-start;
    min-height:auto;
    padding:.15rem 0;
  }
  .report-center .save-report-view .btn{
    width:100%;
  }
}

@media(max-width:420px){
  .report-center .report-view-actions,
  .report-center .report-download-actions{
    grid-template-columns:1fr;
  }
}

/* ===== Report Center: selected-report filter grid alignment fix ===== */
.report-center .report-filter-form{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.9rem 1rem;
  align-items:end;
  width:100%;
  min-width:0;
}

/* Keep Select Report and all report-specific filters in one continuous grid. */
.report-center .report-selector{
  grid-column:auto;
  min-width:0;
}
.report-center .report-dynamic-filters{
  display:contents;
}
.report-center .report-filter-form .field{
  width:100%;
  min-width:0;
  margin:0;
}
.report-center .report-filter-form .field > span{
  display:block;
  min-height:1.05rem;
  margin-bottom:.38rem;
}
.report-center .report-filter-form input,
.report-center .report-filter-form select{
  width:100%;
  min-width:0;
  max-width:100%;
  min-height:44px;
}
.report-center .report-action-row{
  grid-column:1 / -1;
  margin-top:.05rem;
}

@media(max-width:1180px){
  .report-center .report-filter-form{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:900px){
  .report-center .report-filter-form{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:640px){
  .report-center .report-filter-form{
    grid-template-columns:1fr;
    gap:.75rem;
  }
  .report-center .report-selector,
  .report-center .report-action-row{
    grid-column:1;
  }
}

/* ===== Messaging gateway card fit/responsive restoration ===== */
.message-gateway-panel .message-gateway-grid{
  grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  gap:.75rem;
}
.message-gateway-panel .message-gateway-card{
  min-height:0;
  gap:.75rem;
  padding:.9rem;
}
.message-gateway-panel .message-gateway-details{
  gap:.45rem;
  padding:.68rem .72rem;
}
.message-gateway-panel .message-gateway-result{
  min-height:38px;
  padding:.55rem .68rem;
}
.message-gateway-panel .message-gateway-actions{
  gap:.5rem;
}
.message-gateway-panel .message-gateway-actions>.btn,
.message-gateway-panel .message-gateway-test-form .btn{
  min-height:40px;
}
.message-gateway-panel .message-gateway-test-form input{
  height:40px;
}
@media(max-width:700px){
  .message-gateway-panel .message-gateway-grid{
    grid-template-columns:1fr;
  }
}

/* ===== Customers: add/edit form and CRM product picker ===== */
.customer-form-card{
  width:100%;
  max-width:1120px;
  margin-left:auto;
  margin-right:auto;
  padding:1.1rem;
}
.customer-form-head{
  align-items:flex-start;
  margin-bottom:1rem;
}
.customer-entry-form{
  display:grid;
  gap:1rem;
  min-width:0;
}
.customer-form-section{
  min-width:0;
  padding:1rem;
  border:1px solid var(--line,#dce7e2);
  border-radius:14px;
  background:#fbfdfc;
}
.customer-form-section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:.8rem;
  min-width:0;
  margin-bottom:.85rem;
}
.customer-form-section-head>div{min-width:0}
.customer-form-section-head h3{
  margin:0;
  font-size:1rem;
}
.customer-form-section-head small{
  display:block;
  margin-top:.2rem;
  line-height:1.4;
  overflow-wrap:anywhere;
}
.customer-form-grid{
  gap:.9rem;
}
.customer-form-grid .field,
.customer-form-final-section .field{
  min-width:0;
  margin-bottom:0;
}
.customer-opening-grid{
  margin:.9rem 0;
}
.customer-repeat-rows{
  display:grid;
  gap:.7rem;
}
.customer-repeat-row{
  display:grid;
  grid-template-columns:minmax(140px,.7fr) minmax(220px,1.3fr) auto 42px;
  gap:.7rem;
  align-items:end;
  min-width:0;
  margin:0;
  padding:.8rem;
  border:1px solid var(--line,#dce7e2);
  border-radius:12px;
  background:#fff;
}
.customer-address-row{
  grid-template-columns:minmax(140px,.55fr) minmax(260px,1.45fr) auto 42px;
}
.customer-repeat-row .field{
  min-width:0;
  margin:0;
}
.customer-repeat-row .radio-line,
.customer-primary-option{
  display:flex;
  align-items:center;
  gap:.4rem;
  min-height:42px;
  padding:.55rem .65rem;
  white-space:nowrap;
  border:1px solid var(--line,#dce7e2);
  border-radius:9px;
  background:#f7faf8;
}
.customer-repeat-row .repeat-remove{
  width:42px;
  height:42px;
  justify-content:center;
  padding:0;
}
.customer-crm-products-head{
  align-items:center;
}
.customer-product-count{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  flex:0 0 auto;
  min-height:36px;
  padding:.45rem .7rem;
  border-radius:999px;
  background:var(--blue-bg,#e7f0fa);
  color:var(--brand,#0e6b4e);
  font-size:.78rem;
  font-weight:700;
}
.customer-product-manager{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr);
  gap:1rem;
  align-items:start;
  min-width:0;
}
.customer-product-search-panel,
.customer-selected-products-panel{
  min-width:0;
  padding:.9rem;
  border:1px solid var(--line,#dce7e2);
  border-radius:12px;
  background:#fff;
}
.customer-product-search{
  margin:0 0 .8rem;
}
.customer-product-search-box{
  position:relative;
  display:block;
}
.customer-product-search-box>span{
  position:absolute;
  left:.75rem;
  top:50%;
  transform:translateY(-50%);
  color:var(--muted);
  pointer-events:none;
}
.customer-product-search-box input{
  width:100%;
  padding-left:2.15rem;
}
.customer-product-picker{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.65rem;
  max-height:360px;
  overflow:auto;
  overscroll-behavior:contain;
  padding-right:.2rem;
}
.customer-product-option{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:.65rem;
  align-items:center;
  min-width:0;
  padding:.7rem;
  border:1px solid var(--line,#dce7e2);
  border-radius:10px;
  background:#fbfdfc;
}
.customer-product-option[hidden]{display:none!important}
.customer-product-option.is-selected{
  border-color:#8bc9b2;
  background:#eff8f4;
}
.customer-product-checkbox{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  opacity:0!important;
  pointer-events:none!important;
}
.customer-product-option-copy,
.customer-selected-product-copy{
  display:grid;
  min-width:0;
}
.customer-product-option-copy strong,
.customer-product-option-copy small,
.customer-selected-product-copy strong,
.customer-selected-product-copy small{
  min-width:0;
  overflow-wrap:anywhere;
}
.customer-product-option-copy strong,
.customer-selected-product-copy strong{
  color:var(--ink);
  font-size:.84rem;
  line-height:1.3;
}
.customer-product-option-copy small,
.customer-selected-product-copy small{
  color:var(--muted);
  font-size:.7rem;
  line-height:1.35;
}
.customer-product-add{
  flex:0 0 auto;
  min-width:72px;
  justify-content:center;
}
.customer-product-add:disabled{
  opacity:1;
  cursor:default;
}
.customer-product-no-results,
.customer-product-empty{
  grid-column:1/-1;
  margin:.7rem 0 0;
  padding:.9rem;
  text-align:center;
  border:1px dashed var(--line,#dce7e2);
  border-radius:10px;
  background:#f8fbfa;
}
.customer-selected-products-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.7rem;
  margin-bottom:.7rem;
}
.customer-selected-products{
  display:grid;
  gap:.55rem;
  max-height:360px;
  overflow:auto;
  overscroll-behavior:contain;
}
.customer-selected-product{
  display:grid;
  grid-template-columns:minmax(0,1fr) 34px;
  align-items:center;
  gap:.55rem;
  min-width:0;
  padding:.65rem;
  border:1px solid #cfe4db;
  border-radius:10px;
  background:#f1f8f5;
}
.customer-selected-product-remove{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid #efc8c5;
  border-radius:9px;
  background:#fff;
  color:var(--red,#d6453f);
  font:inherit;
  font-size:1.1rem;
  cursor:pointer;
}
.customer-selected-products-empty{
  margin:0;
  padding:1rem .7rem;
  text-align:center;
  border:1px dashed var(--line,#dce7e2);
  border-radius:10px;
  background:#f8fbfa;
}
.customer-selected-products-empty[hidden]{display:none!important}
.customer-active-check{
  margin:0;
  width:max-content;
  max-width:100%;
  padding:.55rem .7rem;
  border:1px solid var(--line,#dce7e2);
  border-radius:9px;
  background:#fff;
}
.customer-form-actions{
  margin:0;
  padding-top:.2rem;
}

/* ===== Customers: import page ===== */
.customer-import-card{
  width:100%;
  max-width:980px;
  margin-left:auto;
  margin-right:auto;
  padding:1.1rem;
}
.customer-import-head{
  align-items:flex-start;
  gap:1rem;
}
.customer-import-head>div{
  min-width:0;
}
.customer-import-head p{
  max-width:720px;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.customer-import-layout{
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(300px,.95fr);
  gap:1rem;
  align-items:start;
}
.customer-import-upload-panel,
.customer-import-help-panel{
  min-width:0;
  padding:1rem;
  border:1px solid var(--line,#dce7e2);
  border-radius:14px;
  background:#fbfdfc;
}
.customer-import-section-head{
  display:flex;
  align-items:center;
  gap:.75rem;
  min-width:0;
  margin-bottom:1rem;
}
.customer-import-section-head>div{
  min-width:0;
}
.customer-import-section-head h3{
  margin:0;
  font-size:1rem;
}
.customer-import-section-head p{
  margin-top:.2rem;
  line-height:1.4;
  overflow-wrap:anywhere;
}
.customer-import-section-icon{
  flex:0 0 48px;
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  border-radius:12px;
  background:#e4f4ed;
  color:var(--brand,#0e6b4e);
  font-size:.72rem;
  font-weight:800;
}
.customer-import-form{
  display:grid;
  gap:.85rem;
}
.customer-import-file-field{
  margin:0;
}
.customer-import-file-box{
  display:grid!important;
  gap:.7rem;
  min-width:0;
  padding:.9rem;
  border:1px dashed #9ebeb1;
  border-radius:12px;
  background:#fff;
}
.customer-import-file-box input[type=file]{
  width:100%;
  min-width:0;
}
.customer-import-file-copy{
  display:grid;
  min-width:0;
}
.customer-import-file-copy strong,
.customer-import-file-copy small{
  min-width:0;
  overflow-wrap:anywhere;
}
.customer-import-file-copy strong{
  color:var(--brand,#0e6b4e);
}
.customer-import-file-copy small{
  color:var(--muted);
  font-size:.72rem;
  line-height:1.4;
}
.customer-import-submit{
  width:100%;
  justify-content:center;
}
.customer-import-rule{
  margin:0 0 .8rem;
  line-height:1.45;
}
.customer-import-rule strong{
  display:block;
  margin-bottom:.25rem;
}
.customer-import-summary-hint{
  display:grid;
  gap:.65rem;
}
.customer-import-summary-hint article{
  display:grid;
  grid-template-columns:38px minmax(0,1fr);
  gap:.65rem;
  align-items:start;
  min-width:0;
  padding:.7rem;
  border:1px solid var(--line,#dce7e2);
  border-radius:11px;
  background:#fff;
}
.customer-import-summary-hint article>span{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:#e4f4ed;
  color:var(--brand,#0e6b4e);
  font-weight:800;
}
.customer-import-summary-hint p{
  display:grid;
  gap:.1rem;
  min-width:0;
  margin:0;
}
.customer-import-summary-hint strong,
.customer-import-summary-hint small{
  min-width:0;
  overflow-wrap:anywhere;
}
.customer-import-summary-hint small{
  color:var(--muted);
  line-height:1.4;
}

@media(max-width:980px){
  .customer-product-manager,
  .customer-import-layout{
    grid-template-columns:1fr;
  }
  .customer-selected-products{
    max-height:260px;
  }
}
@media(max-width:760px){
  .customer-form-card,
  .customer-import-card{
    padding:.85rem;
  }
  .customer-form-section,
  .customer-import-upload-panel,
  .customer-import-help-panel{
    padding:.8rem;
  }
  .customer-form-grid{
    grid-template-columns:1fr;
  }
  .customer-repeat-row,
  .customer-address-row{
    grid-template-columns:1fr 1fr;
  }
  .customer-repeat-row .field{
    grid-column:1/-1;
  }
  .customer-repeat-row .customer-primary-option{
    grid-column:1/2;
    width:100%;
  }
  .customer-repeat-row .repeat-remove{
    grid-column:2/3;
    justify-self:end;
  }
  .customer-product-picker{
    grid-template-columns:1fr;
    max-height:330px;
  }
  .customer-form-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .customer-form-actions .btn{
    width:100%;
    justify-content:center;
  }
  .customer-import-head{
    flex-direction:column;
    align-items:stretch;
  }
  .customer-import-head>.btn{
    width:100%;
    justify-content:center;
  }
}
@media(max-width:480px){
  .customer-form-section-head,
  .customer-crm-products-head{
    flex-direction:column;
    align-items:stretch;
  }
  .customer-form-section-head .btn,
  .customer-product-count{
    width:100%;
    justify-content:center;
  }
  .customer-repeat-row,
  .customer-address-row{
    grid-template-columns:1fr;
  }
  .customer-repeat-row .field,
  .customer-repeat-row .customer-primary-option,
  .customer-repeat-row .repeat-remove{
    grid-column:1/-1;
  }
  .customer-repeat-row .repeat-remove{
    width:100%;
    justify-self:stretch;
  }
  .customer-product-option{
    grid-template-columns:1fr;
  }
  .customer-product-add{
    width:100%;
  }
  .customer-form-actions{
    grid-template-columns:1fr;
  }
}

/* =====================================================
   Follow-ups: expanded types, one-click SMS, full-page scheduler
   Scoped only to follow-up screens
   ===================================================== */
.crm-followup-quick-sms-card,
.crm-followup-schedule-launch-card{
  padding:1rem;
  background:#fff;
  border-radius:20px;
  box-shadow:0 12px 28px rgba(21,65,51,.06);
  border:1px solid rgba(16,89,66,.08);
}
.crm-followup-quick-sms-help{margin:-.2rem 0 .85rem;color:var(--muted);font-size:.82rem;line-height:1.55}
.crm-followup-panel-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:.55rem;flex-wrap:wrap}
.crm-followup-quick-sms-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem}
.crm-followup-sms-type-button{appearance:none;border:1px solid #dce9e3;border-radius:13px;background:#fbfefd;padding:.68rem .72rem;text-align:left;display:flex;align-items:center;gap:.58rem;min-width:0;cursor:pointer;transition:border-color .16s ease,background .16s ease,transform .16s ease,box-shadow .16s ease}
.crm-followup-sms-type-button:hover,.crm-followup-sms-type-button:focus-visible{border-color:#84c6a8;background:#f0faf5;box-shadow:0 8px 18px rgba(18,104,74,.1);transform:translateY(-1px);outline:none}
.crm-followup-sms-type-button:disabled{cursor:not-allowed;opacity:.55;transform:none;box-shadow:none;background:#f5f7f6;border-color:#e4e9e6}
.crm-followup-sms-type-button span{display:grid;place-items:center;flex:0 0 34px;width:34px;height:30px;border-radius:9px;background:#e4f6ec;color:#157a4d;font-size:.66rem;font-weight:900;letter-spacing:.04em}
.crm-followup-sms-type-button strong{min-width:0;color:#17312a;font-size:.79rem;line-height:1.25;overflow-wrap:anywhere}
.crm-followup-schedule-launch-card{display:flex;align-items:center;justify-content:space-between;gap:1rem;background:linear-gradient(135deg,#f8fcfa 0%,#eef8f3 100%)}
.crm-followup-schedule-launch-copy{display:flex;align-items:flex-start;gap:.8rem;min-width:0}
.crm-followup-schedule-launch-icon{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;border-radius:14px;background:var(--brand);color:#fff;font-size:1.35rem;box-shadow:0 9px 20px rgba(14,104,73,.22)}
.crm-followup-schedule-launch-copy small{display:block;color:var(--muted);font-size:.7rem;text-transform:uppercase;letter-spacing:.05em}
.crm-followup-schedule-launch-copy h3{margin:.15rem 0 .2rem;color:#17312a;font-size:1rem}
.crm-followup-schedule-launch-copy p{margin:0;color:var(--muted);font-size:.79rem;line-height:1.45}
.crm-followup-schedule-launch-actions{display:flex;flex-direction:column;gap:.5rem;flex:0 0 auto}
.crm-followup-schedule-launch-actions .btn{justify-content:center}
.crm-followup-timeline-sms-form{margin-top:.65rem}
.crm-followup-timeline-sms-form .btn{border-color:#cfe7db;background:#f3fbf7;color:#176f4b}

.crm-followup-form-page,
.crm-followup-template-page{display:flex;flex-direction:column;gap:1rem;max-width:1500px;margin:0 auto;width:100%}
.crm-followup-form-hero,
.crm-followup-template-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:1.25rem;padding:1.35rem 1.45rem;border:1px solid rgba(16,89,66,.1);border-radius:22px;background:linear-gradient(135deg,#f8fcfa 0%,#edf8f2 62%,#f8fbff 100%);box-shadow:0 14px 32px rgba(21,65,51,.07)}
.crm-followup-form-hero>div:first-child,
.crm-followup-template-hero>div:first-child{min-width:0}
.crm-followup-back-link{display:inline-flex;align-items:center;margin-bottom:.75rem;color:#176f4b;font-size:.82rem;font-weight:800}
.crm-followup-back-link:hover{text-decoration:underline}
.crm-followup-form-hero small,
.crm-followup-template-hero small{display:block;color:#658078;text-transform:uppercase;letter-spacing:.06em;font-size:.72rem;font-weight:800}
.crm-followup-form-hero h1,
.crm-followup-template-hero h1{margin:.18rem 0 .32rem;color:#163029;font-size:clamp(1.45rem,2vw,2rem);line-height:1.15}
.crm-followup-form-hero p,
.crm-followup-template-hero p{margin:0;color:#5f746d;line-height:1.55;max-width:760px}
.crm-followup-form-hero-actions{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;justify-content:flex-end}
.crm-followup-full-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(290px,350px);gap:1rem;align-items:start}
.crm-followup-form-main,.crm-followup-form-sidebar{display:flex;flex-direction:column;gap:1rem;min-width:0}
.crm-followup-form-sidebar{position:sticky;top:84px}
.crm-followup-form-section,
.crm-followup-form-actions,
.crm-followup-form-party-card,
.crm-followup-form-money-card,
.crm-followup-form-tip-card{padding:1.15rem;background:#fff;border-radius:20px;border:1px solid rgba(16,89,66,.08);box-shadow:0 12px 28px rgba(21,65,51,.06);margin:0}
.crm-followup-form-section-head{display:flex;align-items:flex-start;gap:.8rem;margin-bottom:1rem;padding-bottom:.85rem;border-bottom:1px solid #e7efeb}
.crm-followup-form-section-head>span{display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;border-radius:12px;background:#e8f7ef;color:#157649;font-weight:900}
.crm-followup-form-section-head h2{margin:0;color:#17312a;font-size:1.08rem}
.crm-followup-form-section-head p{margin:.22rem 0 0;color:var(--muted);font-size:.82rem;line-height:1.5}
.crm-followup-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.85rem}
.crm-followup-form-grid .field{margin:0;min-width:0}
.crm-followup-form-grid .field>span{font-size:.76rem;font-weight:800;letter-spacing:.03em;text-transform:uppercase;color:#60766e;margin-bottom:.36rem}
.crm-followup-form-grid input,
.crm-followup-form-grid select,
.crm-followup-form-grid textarea{width:100%}
.crm-followup-form-grid textarea{resize:vertical;min-height:120px}
.crm-followup-form-span-2{grid-column:span 2}
.crm-followup-form-span-all{grid-column:1/-1}
.crm-followup-template-preview{padding:1rem;border:1px solid #dceae3;border-radius:16px;background:linear-gradient(180deg,#fbfefd,#f4faf7)}
.crm-followup-template-preview-head{display:flex;align-items:flex-start;justify-content:space-between;gap:.8rem;margin-bottom:.7rem}
.crm-followup-template-preview-head span small{display:block;color:var(--muted);font-size:.7rem;text-transform:uppercase;letter-spacing:.05em}
.crm-followup-template-preview-head span strong{display:block;margin-top:.18rem;color:#17312a;font-size:.97rem}
.crm-followup-template-preview-head em{font-style:normal;padding:.3rem .58rem;border-radius:999px;background:#e4f7ec;color:#16844f;font-size:.72rem;font-weight:900}
.crm-followup-template-preview-head em.is-inactive{background:#f1f3f2;color:#78837f}
.crm-followup-template-preview>p{margin:0 0 .7rem;padding:.85rem;border-radius:12px;background:#fff;border:1px solid #e3ebe7;color:#304942;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.crm-followup-template-preview>small{color:var(--muted)}
.crm-followup-send-now-option{display:flex;align-items:flex-start;gap:.72rem;margin-top:.85rem;padding:.9rem 1rem;border:1px solid #dceae3;border-radius:15px;background:#fff;cursor:pointer}
.crm-followup-send-now-option input{margin-top:.2rem;width:18px;height:18px;accent-color:var(--brand)}
.crm-followup-send-now-option span{display:block;min-width:0}
.crm-followup-send-now-option strong{display:block;color:#17312a;font-size:.92rem}
.crm-followup-send-now-option small{display:block;margin-top:.18rem;color:var(--muted);line-height:1.45}
.crm-followup-form-actions{display:flex;align-items:center;justify-content:flex-end;gap:.65rem;position:sticky;bottom:.7rem;z-index:3}
.crm-followup-form-party-top{display:grid;grid-template-columns:54px minmax(0,1fr);gap:.8rem;align-items:center;padding-bottom:.9rem;border-bottom:1px solid #e7efeb}
.crm-followup-form-party-top>span{display:grid;place-items:center;width:54px;height:54px;border-radius:17px;background:linear-gradient(135deg,#1b7e55,#31b87b);color:#fff;font-weight:900;font-size:1.1rem;box-shadow:0 10px 22px rgba(14,107,78,.22)}
.crm-followup-form-party-top small{display:block;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;font-size:.7rem}
.crm-followup-form-party-top h2{margin:.15rem 0 .18rem;color:#17312a;font-size:1.16rem;line-height:1.25;overflow-wrap:anywhere}
.crm-followup-form-party-top p{margin:0;color:var(--muted);overflow-wrap:anywhere}
.crm-followup-form-party-card dl{display:grid;grid-template-columns:1fr;gap:.65rem;margin:.9rem 0 0}
.crm-followup-form-party-card dl>div{padding:.75rem .8rem;border-radius:13px;background:#f8fbfa;border:1px solid #e3ebe7}
.crm-followup-form-party-card dt{color:var(--muted);font-size:.7rem;text-transform:uppercase;letter-spacing:.04em}
.crm-followup-form-party-card dd{margin:.2rem 0 0;color:#17312a;font-weight:800;overflow-wrap:anywhere}
.crm-followup-form-money-card{display:grid;grid-template-columns:1fr;gap:.65rem}
.crm-followup-form-money-card>div{padding:.82rem .88rem;border:1px solid #e2ece7;border-radius:14px;background:#fbfefd}
.crm-followup-form-money-card span{display:block;color:var(--muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.04em}
.crm-followup-form-money-card strong{display:block;margin-top:.25rem;color:#17312a;font-size:1.05rem}
.crm-followup-form-tip-card strong{display:block;color:#17312a;margin-bottom:.7rem}
.crm-followup-form-tip-card code{display:inline-flex;margin:.18rem .18rem .18rem 0;padding:.3rem .48rem;border-radius:8px;background:#eef7f2;color:#176f4b;font-size:.72rem;overflow-wrap:anywhere}

.crm-followup-language-tabs{display:flex;align-items:center;gap:.35rem;padding:.3rem;border:1px solid #d8e7df;border-radius:13px;background:#fff}
.crm-followup-language-tabs a{padding:.55rem .85rem;border-radius:9px;color:#526861;font-size:.82rem;font-weight:800}
.crm-followup-language-tabs a.is-active{background:var(--brand);color:#fff;box-shadow:0 7px 16px rgba(14,104,73,.2)}
.crm-followup-template-variable-card{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.15rem;margin:0;border-radius:18px;background:#fff;border:1px solid rgba(16,89,66,.08)}
.crm-followup-template-variable-card strong{display:block;color:#17312a}
.crm-followup-template-variable-card p{margin:.2rem 0 0;color:var(--muted);font-size:.8rem}
.crm-followup-template-variable-list{display:flex;flex-wrap:wrap;gap:.35rem;justify-content:flex-end}
.crm-followup-template-variable-list code{padding:.32rem .52rem;border-radius:8px;background:#eef7f2;color:#176f4b;font-size:.72rem}
.crm-followup-template-form{display:flex;flex-direction:column;gap:1rem}
.crm-followup-template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.crm-followup-template-card{padding:1.05rem;margin:0;border-radius:19px;background:#fff;border:1px solid rgba(16,89,66,.08);box-shadow:0 10px 24px rgba(21,65,51,.05)}
.crm-followup-template-card>header{display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:.72rem;align-items:center;padding-bottom:.85rem;margin-bottom:.85rem;border-bottom:1px solid #e7efeb}
.crm-followup-template-card>header>span{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:#e8f7ef;color:#157649;font-weight:900}
.crm-followup-template-card header small{display:block;color:var(--muted);font-size:.68rem;overflow-wrap:anywhere}
.crm-followup-template-card header h2{margin:.16rem 0 0;color:#17312a;font-size:1rem}
.crm-followup-template-active{display:flex;align-items:center;gap:.38rem;color:#526861;font-size:.76rem;font-weight:800;cursor:pointer}
.crm-followup-template-active input{width:17px;height:17px;accent-color:var(--brand)}
.crm-followup-template-card .field{margin-bottom:.75rem}
.crm-followup-template-card textarea{width:100%;min-height:138px;resize:vertical;line-height:1.55}
.crm-followup-template-card>footer{display:flex;justify-content:flex-end;color:var(--muted);font-size:.72rem}
.crm-followup-template-actions{display:flex;align-items:center;justify-content:flex-end;gap:.65rem;padding:1rem;margin:0;position:sticky;bottom:.7rem;z-index:3;border-radius:18px;background:rgba(255,255,255,.96);backdrop-filter:blur(10px);border:1px solid rgba(16,89,66,.1);box-shadow:0 12px 28px rgba(21,65,51,.1)}

@media(max-width:1180px){
  .crm-followup-full-form{grid-template-columns:1fr}
  .crm-followup-form-sidebar{position:static;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}
}
@media(max-width:900px){
  .crm-followup-form-hero,.crm-followup-template-hero{align-items:flex-start;flex-direction:column}
  .crm-followup-form-hero-actions{justify-content:flex-start}
  .crm-followup-template-variable-card{align-items:flex-start;flex-direction:column}
  .crm-followup-template-variable-list{justify-content:flex-start}
  .crm-followup-template-grid{grid-template-columns:1fr}
  .crm-followup-form-sidebar{grid-template-columns:1fr 1fr}
  .crm-followup-form-tip-card{grid-column:1/-1}
}
@media(max-width:760px){
  .crm-followup-panel-head-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}
  .crm-followup-panel-head-actions .btn{width:100%;justify-content:center}
  .crm-followup-quick-sms-grid{grid-template-columns:1fr 1fr}
  .crm-followup-schedule-launch-card{align-items:stretch;flex-direction:column}
  .crm-followup-schedule-launch-actions{width:100%}
  .crm-followup-form-hero,.crm-followup-template-hero{padding:1rem;border-radius:18px}
  .crm-followup-form-section,.crm-followup-form-actions,.crm-followup-form-party-card,.crm-followup-form-money-card,.crm-followup-form-tip-card{padding:.9rem;border-radius:17px}
  .crm-followup-form-grid{grid-template-columns:1fr}
  .crm-followup-form-span-2,.crm-followup-form-span-all{grid-column:span 1}
  .crm-followup-form-sidebar{grid-template-columns:1fr}
  .crm-followup-form-tip-card{grid-column:auto}
  .crm-followup-form-actions,.crm-followup-template-actions{position:static;display:grid;grid-template-columns:1fr}
  .crm-followup-form-actions .btn,.crm-followup-template-actions .btn{width:100%;justify-content:center}
  .crm-followup-template-card>header{grid-template-columns:38px minmax(0,1fr)}
  .crm-followup-template-card>header>span{width:38px;height:38px}
  .crm-followup-template-active{grid-column:1/-1;justify-self:start}
}
@media(max-width:480px){
  .crm-followup-panel-head-actions{grid-template-columns:1fr}
  .crm-followup-quick-sms-grid{grid-template-columns:1fr}
  .crm-followup-language-tabs{width:100%;display:grid;grid-template-columns:1fr 1fr}
  .crm-followup-language-tabs a{text-align:center}
  .crm-followup-template-preview-head{align-items:flex-start;flex-direction:column}
  .crm-followup-form-section-head{gap:.62rem}
}

/* =====================================================
   Schedule Follow-up page: responsive UI refinement
   Scoped only to .crm-followup-form-page
   ===================================================== */
.crm-followup-form-page{
  --followup-surface:#ffffff;
  --followup-soft:#f5faf7;
  --followup-border:#dce9e2;
  --followup-text:#17312a;
  --followup-muted:#647a72;
  --followup-accent:#0f7a52;
  max-width:1440px;
  gap:1.15rem;
  padding-bottom:1rem;
  isolation:isolate;
}
.crm-followup-form-page .crm-followup-form-hero{
  position:relative;
  overflow:hidden;
  align-items:center;
  min-height:148px;
  padding:1.45rem 1.6rem;
  border:1px solid rgba(15,122,82,.14);
  border-radius:24px;
  background:
    radial-gradient(circle at 92% 18%,rgba(35,176,117,.16),transparent 31%),
    linear-gradient(135deg,#ffffff 0%,#f3fbf7 58%,#edf8f3 100%);
  box-shadow:0 18px 44px rgba(21,65,51,.08);
}
.crm-followup-form-page .crm-followup-form-hero::before,
.crm-followup-form-page .crm-followup-form-hero::after{
  content:"";
  position:absolute;
  border-radius:50%;
  pointer-events:none;
}
.crm-followup-form-page .crm-followup-form-hero::before{
  width:180px;
  height:180px;
  right:-64px;
  top:-96px;
  border:30px solid rgba(18,137,91,.055);
}
.crm-followup-form-page .crm-followup-form-hero::after{
  width:90px;
  height:90px;
  right:150px;
  bottom:-56px;
  background:rgba(18,137,91,.045);
}
.crm-followup-form-page .crm-followup-form-hero>*{
  position:relative;
  z-index:1;
}
.crm-followup-form-page .crm-followup-back-link{
  margin-bottom:.65rem;
  padding:.42rem .66rem;
  border:1px solid #d7e8df;
  border-radius:999px;
  background:rgba(255,255,255,.8);
  box-shadow:0 5px 14px rgba(21,65,51,.05);
  text-decoration:none;
}
.crm-followup-form-page .crm-followup-back-link:hover,
.crm-followup-form-page .crm-followup-back-link:focus-visible{
  background:#fff;
  border-color:#9bcdb4;
  text-decoration:none;
  outline:none;
}
.crm-followup-form-page .crm-followup-form-hero small{
  margin-bottom:.2rem;
  color:#6a8078;
}
.crm-followup-form-page .crm-followup-form-hero h1{
  margin:.15rem 0 .42rem;
  font-size:clamp(1.65rem,2.2vw,2.2rem);
  letter-spacing:-.025em;
}
.crm-followup-form-page .crm-followup-form-hero p{
  max-width:720px;
  font-size:.94rem;
}
.crm-followup-form-page .crm-followup-form-hero-actions{
  flex:0 0 auto;
  gap:.65rem;
}
.crm-followup-form-page .crm-followup-form-hero-actions .btn{
  min-height:44px;
  padding:.7rem 1rem;
  border-radius:13px;
  white-space:nowrap;
}
.crm-followup-form-page .crm-followup-full-form{
  grid-template-columns:minmax(0,1fr) minmax(310px,360px);
  gap:1.2rem;
}
.crm-followup-form-page .crm-followup-form-main,
.crm-followup-form-page .crm-followup-form-sidebar{
  gap:1.1rem;
}
.crm-followup-form-page .crm-followup-form-sidebar{
  top:92px;
}
.crm-followup-form-page .crm-followup-form-section,
.crm-followup-form-page .crm-followup-form-actions,
.crm-followup-form-page .crm-followup-form-party-card,
.crm-followup-form-page .crm-followup-form-money-card,
.crm-followup-form-page .crm-followup-form-tip-card{
  border:1px solid rgba(16,89,66,.1);
  border-radius:22px;
  background:var(--followup-surface);
  box-shadow:0 14px 34px rgba(21,65,51,.065);
}
.crm-followup-form-page .crm-followup-form-section{
  position:relative;
  padding:1.3rem;
  overflow:hidden;
  transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease;
}
.crm-followup-form-page .crm-followup-form-section::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:4px;
  background:linear-gradient(180deg,#1ca36d,#78c7a3);
  opacity:.74;
}
.crm-followup-form-page .crm-followup-form-section:focus-within{
  border-color:rgba(15,122,82,.28);
  box-shadow:0 18px 40px rgba(21,65,51,.095);
}
.crm-followup-form-page .crm-followup-form-section-head{
  gap:.9rem;
  margin-bottom:1.15rem;
  padding-bottom:1rem;
}
.crm-followup-form-page .crm-followup-form-section-head>span{
  flex-basis:40px;
  width:40px;
  height:40px;
  border-radius:13px;
  background:linear-gradient(135deg,#e5f7ed,#d8f1e4);
  color:#0e774e;
  box-shadow:inset 0 0 0 1px rgba(15,122,82,.08);
}
.crm-followup-form-page .crm-followup-form-section-head h2{
  font-size:1.16rem;
  letter-spacing:-.01em;
}
.crm-followup-form-page .crm-followup-form-section-head p{
  max-width:760px;
  font-size:.84rem;
}
.crm-followup-form-page .crm-followup-form-grid{
  gap:1rem;
}
.crm-followup-form-page .crm-followup-form-grid .field>span{
  margin-bottom:.42rem;
  color:#526a62;
  font-size:.74rem;
  letter-spacing:.045em;
}
.crm-followup-form-page .crm-followup-form-grid input,
.crm-followup-form-page .crm-followup-form-grid select,
.crm-followup-form-page .crm-followup-form-grid textarea{
  min-width:0;
  border:1px solid #d3e2da;
  border-radius:13px;
  background:#fbfefd;
  color:var(--followup-text);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.85);
  transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}
.crm-followup-form-page .crm-followup-form-grid input,
.crm-followup-form-page .crm-followup-form-grid select{
  min-height:48px;
}
.crm-followup-form-page .crm-followup-form-grid textarea{
  min-height:126px;
  padding-top:.8rem;
  line-height:1.55;
}
.crm-followup-form-page .crm-followup-form-grid input:hover,
.crm-followup-form-page .crm-followup-form-grid select:hover,
.crm-followup-form-page .crm-followup-form-grid textarea:hover{
  border-color:#b8d2c5;
  background:#fff;
}
.crm-followup-form-page .crm-followup-form-grid input:focus,
.crm-followup-form-page .crm-followup-form-grid select:focus,
.crm-followup-form-page .crm-followup-form-grid textarea:focus{
  border-color:#55aa82;
  background:#fff;
  outline:none;
  box-shadow:0 0 0 4px rgba(20,137,91,.11);
}
.crm-followup-form-page .crm-followup-auto-message-grid{
  grid-template-columns:repeat(3,minmax(0,1fr));
}
.crm-followup-form-page .crm-followup-template-preview{
  padding:1.05rem;
  border-radius:17px;
  border-color:#d6e7de;
  background:linear-gradient(180deg,#fbfefd 0%,#f1f9f5 100%);
}
.crm-followup-form-page .crm-followup-template-preview-head{
  margin-bottom:.8rem;
}
.crm-followup-form-page .crm-followup-template-preview>p{
  min-height:76px;
  padding:.95rem;
  border-radius:13px;
  border-color:#dfeae5;
  background:#fff;
  box-shadow:0 6px 16px rgba(21,65,51,.035);
}
.crm-followup-form-page .crm-followup-send-now-option{
  min-height:72px;
  align-items:center;
  border-radius:16px;
  background:#fbfefd;
  transition:border-color .16s ease,background .16s ease,box-shadow .16s ease;
}
.crm-followup-form-page .crm-followup-send-now-option:hover{
  border-color:#a9cfbb;
  background:#f5fbf8;
  box-shadow:0 8px 20px rgba(21,65,51,.05);
}
.crm-followup-form-page .crm-followup-send-now-option input{
  flex:0 0 auto;
  width:20px;
  height:20px;
}
.crm-followup-form-page .crm-followup-form-actions{
  bottom:.8rem;
  padding:1rem 1.1rem;
  background:rgba(255,255,255,.94);
  border-color:rgba(15,122,82,.16);
  box-shadow:0 15px 36px rgba(21,65,51,.12);
  backdrop-filter:blur(12px);
}
.crm-followup-form-page .crm-followup-form-actions .btn{
  min-height:45px;
  min-width:132px;
  border-radius:13px;
  justify-content:center;
}
.crm-followup-form-page .crm-followup-form-party-card,
.crm-followup-form-page .crm-followup-form-money-card,
.crm-followup-form-page .crm-followup-form-tip-card{
  padding:1.1rem;
}
.crm-followup-form-page .crm-followup-form-party-top{
  grid-template-columns:58px minmax(0,1fr);
  gap:.9rem;
}
.crm-followup-form-page .crm-followup-form-party-top>span{
  width:58px;
  height:58px;
  border-radius:18px;
}
.crm-followup-form-page .crm-followup-form-party-card dl{
  gap:.7rem;
}
.crm-followup-form-page .crm-followup-form-party-card dl>div,
.crm-followup-form-page .crm-followup-form-money-card>div{
  border-color:#dfebe5;
  background:#f8fcfa;
}
.crm-followup-form-page .crm-followup-form-money-card{
  gap:.7rem;
}
.crm-followup-form-page .crm-followup-form-tip-card{
  background:linear-gradient(180deg,#ffffff,#f7fbf9);
}
.crm-followup-form-page .crm-followup-form-tip-card code{
  border:1px solid #d9e9e1;
  background:#f1f9f5;
}

@media(max-width:1280px){
  .crm-followup-form-page .crm-followup-full-form{
    grid-template-columns:minmax(0,1fr) minmax(290px,330px);
  }
}
@media(max-width:1120px){
  .crm-followup-form-page .crm-followup-full-form{
    grid-template-columns:1fr;
  }
  .crm-followup-form-page .crm-followup-form-sidebar{
    position:static;
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    align-items:start;
  }
}
@media(max-width:900px){
  .crm-followup-form-page .crm-followup-form-hero{
    align-items:flex-start;
    flex-direction:column;
    min-height:0;
  }
  .crm-followup-form-page .crm-followup-form-hero-actions{
    width:100%;
    justify-content:flex-start;
  }
  .crm-followup-form-page .crm-followup-auto-message-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .crm-followup-form-page .crm-followup-form-sidebar{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .crm-followup-form-page .crm-followup-form-tip-card{
    grid-column:1/-1;
  }
}
@media(max-width:720px){
  .crm-followup-form-page{
    gap:.85rem;
    padding-bottom:.25rem;
  }
  .crm-followup-form-page .crm-followup-form-hero{
    padding:1rem;
    border-radius:19px;
  }
  .crm-followup-form-page .crm-followup-form-hero::before,
  .crm-followup-form-page .crm-followup-form-hero::after{
    display:none;
  }
  .crm-followup-form-page .crm-followup-form-hero h1{
    font-size:1.55rem;
  }
  .crm-followup-form-page .crm-followup-form-hero p{
    font-size:.87rem;
  }
  .crm-followup-form-page .crm-followup-form-hero-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .crm-followup-form-page .crm-followup-form-hero-actions .btn{
    width:100%;
    justify-content:center;
    white-space:normal;
    text-align:center;
  }
  .crm-followup-form-page .crm-followup-full-form,
  .crm-followup-form-page .crm-followup-form-main,
  .crm-followup-form-page .crm-followup-form-sidebar{
    gap:.85rem;
  }
  .crm-followup-form-page .crm-followup-form-section,
  .crm-followup-form-page .crm-followup-form-party-card,
  .crm-followup-form-page .crm-followup-form-money-card,
  .crm-followup-form-page .crm-followup-form-tip-card{
    padding:.95rem;
    border-radius:18px;
  }
  .crm-followup-form-page .crm-followup-form-section-head{
    margin-bottom:.9rem;
    padding-bottom:.8rem;
  }
  .crm-followup-form-page .crm-followup-form-grid,
  .crm-followup-form-page .crm-followup-auto-message-grid{
    grid-template-columns:1fr;
    gap:.8rem;
  }
  .crm-followup-form-page .crm-followup-form-span-2,
  .crm-followup-form-page .crm-followup-form-span-all{
    grid-column:auto;
  }
  .crm-followup-form-page .crm-followup-form-sidebar{
    grid-template-columns:1fr;
  }
  .crm-followup-form-page .crm-followup-form-tip-card{
    grid-column:auto;
  }
  .crm-followup-form-page .crm-followup-form-actions{
    position:static;
    display:grid;
    grid-template-columns:1fr;
    padding:.9rem;
    border-radius:18px;
  }
  .crm-followup-form-page .crm-followup-form-actions .btn{
    width:100%;
    min-width:0;
  }
}
@media(max-width:480px){
  .crm-followup-form-page .crm-followup-back-link{
    margin-bottom:.55rem;
    padding:.36rem .55rem;
    font-size:.76rem;
  }
  .crm-followup-form-page .crm-followup-form-hero-actions{
    grid-template-columns:1fr;
  }
  .crm-followup-form-page .crm-followup-form-section-head{
    gap:.65rem;
  }
  .crm-followup-form-page .crm-followup-form-section-head>span{
    flex-basis:36px;
    width:36px;
    height:36px;
  }
  .crm-followup-form-page .crm-followup-form-section-head h2{
    font-size:1.03rem;
  }
  .crm-followup-form-page .crm-followup-template-preview-head{
    gap:.55rem;
  }
  .crm-followup-form-page .crm-followup-form-party-top{
    grid-template-columns:50px minmax(0,1fr);
  }
  .crm-followup-form-page .crm-followup-form-party-top>span{
    width:50px;
    height:50px;
    border-radius:15px;
  }
}

/* =====================================================
   Schedule Follow-up: action buttons at the true form bottom
   Scope: only Cancel and Schedule Follow-up footer positioning
   ===================================================== */
.crm-followup-form-page .crm-followup-form-actions{
  position:static;
  bottom:auto;
  z-index:auto;
}

/* =====================================================
   Follow-ups: Activity + Quick Action + History bottom grid
   Scoped only to the follow-up index page
   ===================================================== */
.crm-followup-page .crm-followup-bottom-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:1rem;
  align-items:stretch;
  width:100%;
  min-width:0;
  margin-top:1rem;
}
.crm-followup-page .crm-followup-bottom-grid--two{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.crm-followup-page .crm-followup-bottom-grid>.crm-followup-activity-card,
.crm-followup-page .crm-followup-bottom-grid>.crm-followup-schedule-launch-card,
.crm-followup-page .crm-followup-bottom-grid>.crm-followup-history-card{
  min-width:0;
  width:100%;
  height:100%;
  min-height:280px;
  margin:0;
  overflow:hidden;
}
.crm-followup-page .crm-followup-bottom-grid>.crm-followup-activity-card,
.crm-followup-page .crm-followup-bottom-grid>.crm-followup-history-card{
  padding:1rem;
}
.crm-followup-page .crm-followup-bottom-grid .crm-followup-activity-card[open]{
  display:flex;
  flex-direction:column;
}
.crm-followup-page .crm-followup-bottom-grid .crm-followup-activity-card summary{
  flex:0 0 auto;
  padding-bottom:.85rem;
  border-bottom:1px solid #e6efeb;
}
.crm-followup-page .crm-followup-bottom-grid .crm-followup-activity-list{
  flex:1 1 auto;
  min-height:0;
  max-height:420px;
  overflow:auto;
  padding-right:.2rem;
  scrollbar-gutter:stable;
}
.crm-followup-page .crm-followup-bottom-grid .crm-followup-schedule-launch-card{
  align-items:flex-start;
  flex-direction:column;
  padding:1rem;
}
.crm-followup-page .crm-followup-bottom-grid .crm-followup-schedule-launch-copy{
  width:100%;
}
.crm-followup-page .crm-followup-bottom-grid .crm-followup-schedule-launch-actions{
  width:100%;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:.55rem;
  margin-top:auto;
  padding-top:1rem;
}
.crm-followup-page .crm-followup-bottom-grid .crm-followup-schedule-launch-actions .btn{
  width:100%;
  min-width:0;
}
.crm-followup-page .crm-followup-bottom-grid .crm-followup-history-card{
  display:flex;
  flex-direction:column;
}
.crm-followup-page .crm-followup-bottom-grid .crm-followup-history-card>.crm-followup-side-heading{
  flex:0 0 auto;
  padding-bottom:.85rem;
  margin-bottom:.85rem;
  border-bottom:1px solid #e6efeb;
}
.crm-followup-page .crm-followup-bottom-grid .crm-followup-timeline-list{
  flex:1 1 auto;
  min-height:0;
  max-height:420px;
  overflow:auto;
  padding-right:.2rem;
  scrollbar-gutter:stable;
}
.crm-followup-page .crm-followup-bottom-grid .crm-followup-timeline-content,
.crm-followup-page .crm-followup-bottom-grid .crm-followup-timeline-content>header,
.crm-followup-page .crm-followup-bottom-grid .crm-followup-history-actions,
.crm-followup-page .crm-followup-bottom-grid .crm-followup-history-actions form,
.crm-followup-page .crm-followup-bottom-grid .crm-followup-reschedule,
.crm-followup-page .crm-followup-bottom-grid .crm-followup-reschedule form{
  min-width:0;
}
.crm-followup-page .crm-followup-bottom-grid .crm-followup-timeline-content>header{
  flex-direction:column;
  align-items:flex-start;
}
.crm-followup-page .crm-followup-bottom-grid .crm-followup-history-actions{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  align-items:stretch;
}
.crm-followup-page .crm-followup-bottom-grid .crm-followup-history-actions form,
.crm-followup-page .crm-followup-bottom-grid .crm-followup-reschedule form{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  align-items:stretch;
  width:100%;
}
.crm-followup-page .crm-followup-bottom-grid .crm-followup-history-actions .btn,
.crm-followup-page .crm-followup-bottom-grid .crm-followup-reschedule .btn,
.crm-followup-page .crm-followup-bottom-grid .crm-followup-complete-form input{
  width:100%;
  min-width:0;
}

@media(max-width:1180px){
  .crm-followup-page .crm-followup-bottom-grid,
  .crm-followup-page .crm-followup-bottom-grid--two{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .crm-followup-page .crm-followup-bottom-grid>.crm-followup-history-card{
    grid-column:1/-1;
    min-height:0;
  }
}
@media(max-width:760px){
  .crm-followup-page .crm-followup-bottom-grid,
  .crm-followup-page .crm-followup-bottom-grid--two{
    grid-template-columns:minmax(0,1fr);
    gap:.85rem;
    margin-top:.85rem;
  }
  .crm-followup-page .crm-followup-bottom-grid>.crm-followup-activity-card,
  .crm-followup-page .crm-followup-bottom-grid>.crm-followup-schedule-launch-card,
  .crm-followup-page .crm-followup-bottom-grid>.crm-followup-history-card{
    grid-column:auto;
    min-height:0;
  }
  .crm-followup-page .crm-followup-bottom-grid .crm-followup-activity-list,
  .crm-followup-page .crm-followup-bottom-grid .crm-followup-timeline-list{
    max-height:none;
    overflow:visible;
    padding-right:0;
  }
}
/* =========================================================
   Messaging tables only: responsive fit, full data visibility,
   aligned columns and compact row-action dropdown (2026-07-27)
   ========================================================= */
.scheduled-message-card,
.message-template-card{
  overflow:visible;
}

.scheduled-message-card{
  container-name:scheduled-messages;
  container-type:inline-size;
}

.message-template-card{
  container-name:message-templates;
  container-type:inline-size;
}

.scheduled-message-card .scheduled-message-table-wrap,
.message-template-card .message-template-table-wrap{
  width:100%;
  max-width:100%;
  overflow:visible;
  border:1px solid #dce7e3;
  border-radius:14px;
  background:#fff;
}

.scheduled-message-card .scheduled-message-table,
.message-template-card .message-template-table{
  width:100%;
  min-width:0;
  table-layout:fixed;
  border-collapse:separate;
  border-spacing:0;
}

.scheduled-message-card .scheduled-message-table th,
.scheduled-message-card .scheduled-message-table td,
.message-template-card .message-template-table th,
.message-template-card .message-template-table td{
  box-sizing:border-box;
  min-width:0;
  padding:.8rem .48rem;
  vertical-align:top;
  border-color:#dfe9e5;
  text-align:left;
  white-space:normal;
  overflow:visible;
  overflow-wrap:anywhere;
  word-break:normal;
}

.scheduled-message-card .scheduled-message-table thead th,
.message-template-card .message-template-table thead th{
  position:static;
  padding-top:.72rem;
  padding-bottom:.72rem;
  background:#f4f8f6;
  color:#536861;
  font-size:.7rem;
  font-weight:800;
  line-height:1.22;
  letter-spacing:.018em;
  text-transform:uppercase;
  white-space:normal;
  overflow-wrap:normal;
  word-break:normal;
}

.scheduled-message-card .scheduled-message-table tbody tr,
.message-template-card .message-template-table tbody tr{
  transition:background-color .16s ease;
}

.scheduled-message-card .scheduled-message-table tbody tr:hover,
.message-template-card .message-template-table tbody tr:hover{
  background:#fbfdfc;
}

.scheduled-message-card .scheduled-message-table td{
  font-size:.8rem;
  line-height:1.4;
}

.scheduled-message-card .scheduled-message-table td small,
.message-template-card .message-template-table td small{
  display:block;
  margin-top:.18rem;
  line-height:1.35;
}

/* Balanced desktop widths. The dropdown replaces the former three-button column. */
.scheduled-message-card .scheduled-message-table th:nth-child(1){width:13%}
.scheduled-message-card .scheduled-message-table th:nth-child(2){width:13%}
.scheduled-message-card .scheduled-message-table th:nth-child(3){width:8%}
.scheduled-message-card .scheduled-message-table th:nth-child(4){width:9%}
.scheduled-message-card .scheduled-message-table th:nth-child(5){width:8%}
.scheduled-message-card .scheduled-message-table th:nth-child(6){width:10%}
.scheduled-message-card .scheduled-message-table th:nth-child(7){width:17%}
.scheduled-message-card .scheduled-message-table th:nth-child(8){width:7%}
.scheduled-message-card .scheduled-message-table th:nth-child(9){width:7%}
.scheduled-message-card .scheduled-message-table th:nth-child(10){width:8%}

.scheduled-message-card .scheduled-message-table th:nth-child(8),
.scheduled-message-card .scheduled-message-table th:nth-child(9),
.scheduled-message-card .scheduled-message-table th:nth-child(10),
.scheduled-message-card .scheduled-message-table td:nth-child(8),
.scheduled-message-card .scheduled-message-table td:nth-child(9),
.scheduled-message-card .scheduled-message-table td:nth-child(10){
  text-align:center;
}

/* Never hide or truncate message-table data. */
.scheduled-message-card .msg-nowrap,
.scheduled-message-card .msg-copy-line .msg-nowrap,
.scheduled-message-card .msg-copy-line code,
.scheduled-message-card .msg-event-link{
  max-width:100%;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.scheduled-message-card .msg-copy-line{
  display:flex;
  width:100%;
  max-width:100%;
  min-width:0;
  align-items:flex-start;
  justify-content:flex-start;
  gap:.3rem;
}

.scheduled-message-card .msg-copy-line .msg-nowrap,
.scheduled-message-card .msg-copy-line code{
  flex:1 1 auto;
  min-width:0;
}

.scheduled-message-card .msg-copy-btn{
  flex:0 0 20px;
  width:20px;
  height:20px;
  margin-top:0;
}

.scheduled-message-card .msg-message-cell{
  min-width:0;
  max-width:none!important;
}

.scheduled-message-card .msg-message-text{
  display:block;
  max-height:none;
  overflow:visible;
  -webkit-box-orient:initial;
  -webkit-line-clamp:unset;
  line-clamp:unset;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:normal;
}

.scheduled-message-card .msg-source-badge,
.scheduled-message-card .scheduled-message-table .badge{
  display:inline-flex;
  width:auto;
  max-width:100%;
  min-height:24px;
  align-items:center;
  justify-content:center;
  padding:.2rem .44rem;
  text-align:center;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:normal;
}

.scheduled-message-card .msg-event-link{
  display:block;
  margin-top:.18rem;
  font-size:.7rem;
}

/* Row action dropdown. */
.scheduled-message-card .msg-actions-cell{
  position:relative;
  z-index:2;
  overflow:visible;
  background:transparent;
  box-shadow:none;
  white-space:normal;
}

.scheduled-message-card .scheduled-message-table tbody tr:has(.msg-action-menu[open]){
  position:relative;
  z-index:30;
}

.scheduled-message-card .msg-action-menu{
  position:relative;
  display:inline-block;
  width:100%;
  min-width:0;
  text-align:left;
}

.scheduled-message-card .msg-action-menu[open]{
  z-index:50;
}

.scheduled-message-card .msg-action-trigger{
  display:inline-flex;
  width:100%;
  min-width:0;
  min-height:36px;
  align-items:center;
  justify-content:center;
  gap:.3rem;
  padding:.4rem .35rem;
  font-size:.73rem;
  line-height:1.1;
  cursor:pointer;
  list-style:none;
  user-select:none;
}

.scheduled-message-card .msg-action-trigger::-webkit-details-marker{
  display:none;
}

.scheduled-message-card .msg-action-trigger::marker{
  content:"";
}

.scheduled-message-card .msg-action-trigger svg{
  width:14px;
  height:14px;
  flex:0 0 14px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
  transition:transform .16s ease;
}

.scheduled-message-card .msg-action-menu[open] .msg-action-trigger{
  border-color:#83bca8;
  background:#eef8f4;
  color:#087a55;
}

.scheduled-message-card .msg-action-menu[open] .msg-action-trigger svg{
  transform:rotate(180deg);
}

.scheduled-message-card .msg-action-dropdown{
  position:absolute;
  top:calc(100% + 6px);
  right:0;
  z-index:80;
  width:max-content;
  min-width:148px;
  max-width:min(210px,calc(100vw - 32px));
  padding:.35rem;
  border:1px solid #d6e4df;
  border-radius:11px;
  background:#fff;
  box-shadow:0 14px 32px rgba(15,62,48,.18);
  text-align:left;
}

.scheduled-message-card .msg-action-dropdown form{
  display:block;
  width:100%;
  margin:0;
}

.scheduled-message-card .msg-action-item{
  display:flex;
  width:100%;
  min-height:36px;
  align-items:center;
  padding:.48rem .62rem;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#20352e;
  font:inherit;
  font-size:.78rem;
  font-weight:700;
  line-height:1.2;
  text-align:left;
  text-decoration:none;
  cursor:pointer;
}

.scheduled-message-card .msg-action-item:hover,
.scheduled-message-card .msg-action-item:focus-visible{
  background:#edf7f3;
  color:#087653;
  outline:none;
}

.scheduled-message-card .msg-action-item.is-danger{
  color:#c33d3d;
}

.scheduled-message-card .msg-action-item.is-danger:hover,
.scheduled-message-card .msg-action-item.is-danger:focus-visible{
  background:#fff0f0;
  color:#ad2929;
}

/* Message-template table alignment and complete text display. */
.message-template-card .message-template-table th:nth-child(1){width:20%}
.message-template-card .message-template-table th:nth-child(2){width:28%}
.message-template-card .message-template-table th:nth-child(3){width:12%}
.message-template-card .message-template-table th:nth-child(4){width:12%}
.message-template-card .message-template-table th:nth-child(5){width:14%}
.message-template-card .message-template-table th:nth-child(6){width:14%}

.message-template-card .message-template-table td{
  font-size:.84rem;
  line-height:1.4;
  white-space:normal;
  overflow-wrap:anywhere;
}

.message-template-card .message-template-table td:nth-child(3),
.message-template-card .message-template-table td:nth-child(4),
.message-template-card .message-template-table td:nth-child(5),
.message-template-card .message-template-table td:nth-child(6),
.message-template-card .message-template-table th:nth-child(3),
.message-template-card .message-template-table th:nth-child(4),
.message-template-card .message-template-table th:nth-child(5),
.message-template-card .message-template-table th:nth-child(6){
  text-align:center;
}

.message-template-card .message-template-table td:last-child .btn{
  min-width:72px;
}

/* Container-responsive card layout: used only when the table's own space is narrow. */
@container scheduled-messages (max-width:900px){
  .scheduled-message-card .scheduled-message-table-wrap{
    overflow:visible;
    border:0;
    border-radius:0;
    background:transparent;
  }

  .scheduled-message-card .scheduled-message-table,
  .scheduled-message-card .scheduled-message-table tbody{
    display:block;
    width:100%;
    min-width:0!important;
  }

  .scheduled-message-card .scheduled-message-table thead{
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
    border:0;
  }

  .scheduled-message-card .scheduled-message-table tbody{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.75rem;
  }

  .scheduled-message-card .scheduled-message-table tbody tr{
    display:block;
    width:100%;
    min-width:0;
    padding:.35rem .78rem;
    border:1px solid #d9e6e1;
    border-radius:14px;
    background:#fff;
    box-shadow:0 6px 18px rgba(25,76,61,.055);
  }

  .scheduled-message-card .scheduled-message-table tbody td{
    display:grid;
    width:100%;
    grid-template-columns:minmax(100px,34%) minmax(0,1fr);
    column-gap:.68rem;
    row-gap:.15rem;
    align-items:start;
    padding:.52rem 0;
    border:0;
    border-bottom:1px dashed #dce7e3;
    font-size:.82rem;
    text-align:left!important;
  }

  .scheduled-message-card .scheduled-message-table tbody td:last-child{
    border-bottom:0;
  }

  .scheduled-message-card .scheduled-message-table tbody td::before{
    content:attr(data-label);
    grid-column:1;
    grid-row:1 / span 20;
    color:#60736c;
    font-size:.66rem;
    font-weight:800;
    line-height:1.35;
    text-transform:uppercase;
    letter-spacing:.025em;
  }

  .scheduled-message-card .scheduled-message-table tbody td>*{
    grid-column:2;
    min-width:0;
  }

  .scheduled-message-card .scheduled-message-table tbody td[colspan]{
    display:block;
    padding:1rem .2rem;
    border:0;
  }

  .scheduled-message-card .scheduled-message-table tbody td[colspan]::before{
    content:none;
  }

  .scheduled-message-card .msg-copy-line{
    width:100%;
  }

  .scheduled-message-card .msg-action-menu{
    width:100%;
  }

  .scheduled-message-card .msg-action-trigger{
    width:100%;
    max-width:180px;
  }

  .scheduled-message-card .msg-action-dropdown{
    left:0;
    right:auto;
  }
}

@container scheduled-messages (max-width:620px){
  .scheduled-message-card .scheduled-message-table tbody{
    grid-template-columns:1fr;
  }
}

@container scheduled-messages (max-width:420px){
  .scheduled-message-card .scheduled-message-table tbody tr{
    padding:.3rem .68rem;
  }

  .scheduled-message-card .scheduled-message-table tbody td{
    grid-template-columns:1fr;
    gap:.28rem;
  }

  .scheduled-message-card .scheduled-message-table tbody td::before,
  .scheduled-message-card .scheduled-message-table tbody td>*{
    grid-column:1;
    grid-row:auto;
  }

  .scheduled-message-card .msg-action-trigger{
    max-width:none;
  }

  .scheduled-message-card .msg-action-dropdown{
    position:static;
    width:100%;
    max-width:none;
    margin-top:.35rem;
    box-shadow:0 8px 20px rgba(15,62,48,.12);
  }
}

@container message-templates (max-width:700px){
  .message-template-card .message-template-table-wrap{
    overflow:visible;
    border:0;
    border-radius:0;
    background:transparent;
  }

  .message-template-card .message-template-table,
  .message-template-card .message-template-table tbody{
    display:block;
    width:100%;
    min-width:0!important;
  }

  .message-template-card .message-template-table thead{
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
    border:0;
  }

  .message-template-card .message-template-table tbody{
    display:grid;
    gap:.7rem;
  }

  .message-template-card .message-template-table tbody tr{
    display:block;
    padding:.35rem .78rem;
    border:1px solid #d9e6e1;
    border-radius:13px;
    background:#fff;
    box-shadow:0 5px 16px rgba(25,76,61,.05);
  }

  .message-template-card .message-template-table tbody td{
    display:grid;
    grid-template-columns:minmax(92px,32%) minmax(0,1fr);
    gap:.65rem;
    align-items:start;
    padding:.5rem 0;
    border:0;
    border-bottom:1px dashed #dce7e3;
    text-align:left!important;
  }

  .message-template-card .message-template-table tbody td:last-child{
    border-bottom:0;
  }

  .message-template-card .message-template-table tbody td::before{
    content:attr(data-label);
    color:#60736c;
    font-size:.66rem;
    font-weight:800;
    line-height:1.35;
    text-transform:uppercase;
    letter-spacing:.025em;
  }

  .message-template-card .message-template-table tbody td[colspan]{
    display:block;
    padding:1rem .2rem;
    border:0;
  }

  .message-template-card .message-template-table tbody td[colspan]::before{
    content:none;
  }
}

@container message-templates (max-width:420px){
  .message-template-card .message-template-table tbody td{
    grid-template-columns:1fr;
    gap:.25rem;
  }
}

/* Keep responsive card labels localized from each table cell. */
@container scheduled-messages (max-width:900px){
  .scheduled-message-card .scheduled-message-table tbody td[data-label]::before{
    content:attr(data-label)!important;
  }
}
@container message-templates (max-width:700px){
  .message-template-card .message-template-table tbody td[data-label]::before{
    content:attr(data-label)!important;
  }
}

/* =========================================================
   Messaging > Scheduled Messages: keep Order ID and Courier
   Parcel ID on one line; allow horizontal table scrolling.
   Scoped only to this table. (2026-07-27)
   ========================================================= */
@media (min-width:768px){
  .scheduled-message-card .scheduled-message-table-wrap{
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-inline:contain;
  }

  .scheduled-message-card .scheduled-message-table{
    width:100%;
    min-width:1380px !important;
    table-layout:auto !important;
  }

  .scheduled-message-card .scheduled-message-table th:nth-child(5),
  .scheduled-message-card .scheduled-message-table td:nth-child(5){
    width:auto !important;
    min-width:150px;
    white-space:nowrap !important;
  }

  .scheduled-message-card .scheduled-message-table th:nth-child(6),
  .scheduled-message-card .scheduled-message-table td:nth-child(6){
    width:auto !important;
    min-width:190px;
    white-space:nowrap !important;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(5),
  .scheduled-message-card .scheduled-message-table td:nth-child(6),
  .scheduled-message-card .scheduled-message-table td:nth-child(5) *,
  .scheduled-message-card .scheduled-message-table td:nth-child(6) *{
    overflow-wrap:normal !important;
    word-break:normal !important;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(5) .msg-copy-line,
  .scheduled-message-card .scheduled-message-table td:nth-child(6) .msg-copy-line{
    display:inline-flex;
    width:auto !important;
    max-width:none !important;
    min-width:max-content;
    flex-wrap:nowrap;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(5) .msg-copy-line code,
  .scheduled-message-card .scheduled-message-table td:nth-child(6) .msg-copy-line code{
    display:inline-block;
    width:auto;
    min-width:max-content;
    max-width:none !important;
    overflow:visible !important;
    text-overflow:clip !important;
    white-space:nowrap !important;
  }

  .scheduled-message-card .scheduled-message-table td:nth-child(6) > small{
    white-space:nowrap;
  }
}

/* ==========================================================================
   Order register — column fit + horizontal scrolling (2026-07-27)
   Desktop columns get real pixel widths so every value is readable, and the
   table scrolls sideways inside its own wrapper once the screen is narrower
   than the table. Mobile (<=820px) keeps the original stacked layout.
   ========================================================================== */
@media (min-width:821px){
  .order-table-wrap{
    display:block;
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-inline:contain;
    scrollbar-width:thin;
  }

  .order-list-table{
    width:100%;
    table-layout:fixed;
    /* Below this width the wrapper scrolls instead of squeezing the columns. */
    min-width:1240px;
    margin:0;
  }

  .order-list-table.has-bulk-select col.order-col-select{width:42px}
  .order-list-table.has-bulk-select col.order-col-id{width:148px}
  .order-list-table.has-bulk-select col.order-col-customer{width:210px}
  .order-list-table.has-bulk-select col.order-col-commercial{width:160px}
  .order-list-table.has-bulk-select col.order-col-delivery{width:230px}
  .order-list-table.has-bulk-select col.order-col-status{width:180px}
  .order-list-table.has-bulk-select col.order-col-total{width:104px}
  .order-list-table.has-bulk-select col.order-col-due{width:104px}
  .order-list-table.has-bulk-select col.order-col-actions{width:150px}

  .order-list-table.no-bulk-select col.order-col-id{width:150px}
  .order-list-table.no-bulk-select col.order-col-customer{width:220px}
  .order-list-table.no-bulk-select col.order-col-commercial{width:166px}
  .order-list-table.no-bulk-select col.order-col-delivery{width:238px}
  .order-list-table.no-bulk-select col.order-col-status{width:186px}
  .order-list-table.no-bulk-select col.order-col-total{width:108px}
  .order-list-table.no-bulk-select col.order-col-due{width:108px}
  .order-list-table.no-bulk-select col.order-col-actions{width:156px}

  .order-list-table th,
  .order-list-table td{
    padding:.6rem .55rem;
    vertical-align:top;
  }

  .order-list-table th{
    white-space:nowrap;
    overflow:visible;
    text-overflow:clip;
  }

  /* Values wrap onto a second line instead of being cut off with an ellipsis. */
  .order-list-table .order-customer-stack>strong,
  .order-list-table .order-source-label,
  .order-list-table .courier-name{
    display:block;
    width:100%;
    max-width:100%;
    overflow:visible;
    text-overflow:clip;
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:break-word;
  }

  .order-list-table .copy-value,
  .order-list-table .delivery-number-line .copy-value,
  .order-list-table .parcel-copy-row code{
    display:block;
    min-width:0;
    max-width:100%;
    overflow:visible;
    text-overflow:clip;
    white-space:normal!important;
    overflow-wrap:anywhere;
    word-break:break-all;
    line-height:1.32;
  }

  .order-list-table .badge{
    max-width:100%;
    overflow:visible;
    text-overflow:clip;
    white-space:normal!important;
    line-height:1.24;
  }

  /* Identifiers, dates and money stay on one line. */
  .order-list-table .order-id-line,
  .order-list-table .order-id-line>a,
  .order-list-table .order-id-line code,
  .order-list-table .order-date-block>span,
  .order-list-table .order-total-col,
  .order-list-table .order-due-col{
    white-space:nowrap!important;
  }

  .order-list-table .copy-line{
    display:flex;
    flex-wrap:nowrap;
    align-items:flex-start;
    gap:.28rem;
    width:100%;
    min-width:0;
    max-width:100%;
  }

  .order-list-table .order-actions-col .row-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.3rem;
    width:100%;
  }

  .order-list-table .order-actions-col .btn{
    width:100%;
    min-width:0;
    justify-content:center;
    padding:.34rem .3rem;
    font-size:.72rem;
    white-space:nowrap;
  }

  .order-table-wrap::-webkit-scrollbar{height:10px}
  .order-table-wrap::-webkit-scrollbar-thumb{border-radius:999px;background:rgba(66,96,84,.38)}
  .order-table-wrap::-webkit-scrollbar-track{background:rgba(220,231,226,.55);border-radius:999px}
}

/* Workflow message opt-in controls: POS, Order Management and Courier booking. */
.workflow-message-control{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border:1px solid #d4e4dc;
  border-radius:12px;
  background:#f7fbf9;
}
.workflow-message-check{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  margin:0;
  font-weight:750;
  color:var(--text);
}
.workflow-message-check input{
  width:18px;
  height:18px;
  flex:0 0 18px;
  margin:0;
  accent-color:var(--primary);
}
.workflow-message-check span{overflow-wrap:anywhere}
.workflow-message-channel{
  display:flex;
  align-items:center;
  gap:7px;
  margin:0;
  white-space:nowrap;
  color:var(--muted);
  font-size:.75rem;
  font-weight:700;
}
.workflow-message-channel select{
  width:auto;
  min-width:112px;
  min-height:38px;
  padding:7px 28px 7px 9px;
}
.workflow-message-control-pos{grid-column:1/-1}
.bulk-dispatch-message-control{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:40px;
  padding:7px 10px;
  border:1px solid #d4e4dc;
  border-radius:10px;
  background:#fff;
  font-size:.78rem;
  font-weight:750;
}
.bulk-dispatch-message-control input{width:17px;height:17px;margin:0;accent-color:var(--primary)}

@media(max-width:760px){
  .workflow-message-control{
    align-items:stretch;
    flex-direction:column;
    gap:8px;
  }
  .workflow-message-channel{
    justify-content:space-between;
    width:100%;
  }
  .workflow-message-channel select{min-width:132px}
  .bulk-dispatch-message-control{width:100%;box-sizing:border-box}
}

@media(max-width:760px){
  .order-mobile-dock{align-items:stretch!important;flex-direction:column!important}
  .order-mobile-dock-actions{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:7px;width:100%;align-items:center}
  .order-mobile-message-control{display:flex;align-items:center;gap:6px;min-width:0;padding:5px 7px;border:1px solid #d4e4dc;border-radius:10px;background:#f7fbf9}
  .order-mobile-message-control .check{display:flex;align-items:center;gap:5px;min-width:0;margin:0;font-size:.7rem;font-weight:750;white-space:nowrap}
  .order-mobile-message-control .check input{width:16px;height:16px;margin:0;accent-color:var(--primary)}
  .order-mobile-message-control select{min-width:0;width:88px;height:34px;padding:5px 20px 5px 6px;font-size:.7rem}
  .order-mobile-dock-actions>.btn{min-width:0!important;min-height:40px!important;padding:8px 10px!important}
}
@media(max-width:430px){
  .order-mobile-dock-actions{grid-template-columns:1fr 1fr}
  .order-mobile-message-control{grid-column:1/-1;justify-content:space-between}
  .order-mobile-message-control select{width:112px}
}
.bulk-dispatch-message-control[hidden]{display:none!important}

/* =========================================================
   Order View: Payments & Financials responsive fit (2026-07-28)
   Scoped only to the payment card on the order details page.
   ========================================================= */
.order-payments-card{
  min-width:0;
  overflow:hidden;
}
.order-payments-card .card-head{
  align-items:flex-start;
  gap:.65rem;
  margin-bottom:.85rem;
}
.order-payments-card .card-head h2{
  min-width:0;
  margin:0;
  line-height:1.3;
  overflow-wrap:anywhere;
}
.order-payments-card .inline-form{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.65rem;
  width:100%;
  margin:0 0 .85rem;
  padding:.75rem;
  border:1px solid var(--line,#dce7e2);
  border-radius:12px;
  background:var(--surface-soft,#f7faf9);
}
.order-payments-card .inline-form>:where(input:not([type="hidden"]),select,button){
  min-width:0;
  width:100%;
  min-height:42px;
  margin:0;
}
.order-payments-card .inline-form input[name="reference"],
.order-payments-card .inline-form .btn{
  grid-column:1/-1;
}
.order-payments-card .inline-form .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:normal;
  line-height:1.25;
}
.order-payments-card>.table-wrap{
  max-width:100%;
  border:1px solid var(--line,#dce7e2);
  border-radius:12px;
  background:var(--panel,#fff);
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.order-payments-card>.table-wrap .table{
  min-width:430px;
  margin:0;
}
.order-payments-card>.table-wrap .table th,
.order-payments-card>.table-wrap .table td{
  padding:.62rem .68rem;
  white-space:nowrap;
}
.order-payments-card>.table-wrap .table td[colspan]{
  white-space:normal;
  text-align:center;
  padding:1rem .7rem;
}
.order-payments-card details{
  margin-top:.75rem;
  border:1px solid var(--line,#dce7e2);
  border-radius:11px;
  background:var(--panel,#fff);
  overflow:hidden;
}
.order-payments-card details>summary{
  display:flex;
  align-items:center;
  min-height:42px;
  padding:.65rem .75rem;
  cursor:pointer;
  color:var(--text,#173c32);
  font-weight:750;
  overflow-wrap:anywhere;
}
.order-payments-card details[open]>summary{
  border-bottom:1px solid var(--line,#dce7e2);
  background:var(--surface-soft,#f7faf9);
}
.order-payments-card details .table-wrap{
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.order-payments-card details .table{
  min-width:360px;
  margin:0;
}
@media(max-width:520px){
  .order-payments-card{
    padding:.9rem;
  }
  .order-payments-card .inline-form{
    grid-template-columns:minmax(0,1fr);
    padding:.65rem;
  }
  .order-payments-card .inline-form input[name="reference"],
  .order-payments-card .inline-form .btn{
    grid-column:auto;
  }
  .order-payments-card>.table-wrap .table{
    min-width:400px;
  }
}

/* =========================================================
   Notifications page responsive fit (2026-07-28)
   Scoped only to /notifications.
   ========================================================= */
.notifications-page-card{
  min-width:0;
  overflow:hidden;
}
.notifications-page-head{
  align-items:center;
  gap:1rem;
  padding-bottom:.9rem;
  margin-bottom:0;
  border-bottom:1px solid var(--line,#dfe9e4);
}
.notifications-page-head h2{margin:0}
.notifications-read-all-form{flex:0 0 auto;margin:0}
.notifications-read-all-form .btn{white-space:nowrap}
.notifications-list{
  position:relative;
  display:grid;
  gap:0;
  width:100%;
}
.notification-item{
  position:relative;
  display:grid;
  grid-template-columns:18px minmax(0,1fr);
  gap:.8rem;
  min-width:0;
  padding:1rem .15rem;
  border-bottom:1px solid var(--line,#e4ece8);
}
.notification-item:last-child{border-bottom:0}
.notification-item:before{
  content:"";
  position:absolute;
  left:5px;
  top:1.5rem;
  bottom:-1.5rem;
  width:2px;
  background:var(--line,#dfe9e4);
}
.notification-item:last-child:before{display:none}
.notification-item-dot{
  position:relative;
  z-index:1;
  width:10px;
  height:10px;
  margin-top:.38rem;
  border-radius:50%;
  background:var(--primary,#17895f);
  box-shadow:0 0 0 4px var(--surface-soft,#eef7f3);
}
.notification-item.is-read .notification-item-dot{
  background:#9aa9a2;
  box-shadow:0 0 0 4px #f0f4f2;
}
.notification-item-content{
  display:grid;
  gap:.38rem;
  min-width:0;
}
.notification-open-form{display:block;min-width:0;margin:0}
.notification-item-title{
  display:inline-block;
  max-width:100%;
  padding:0;
  color:var(--primary,#087a55);
  font-size:.98rem;
  font-weight:800;
  line-height:1.35;
  text-align:left;
  white-space:normal;
  overflow-wrap:anywhere;
}
.notification-item-body{
  max-width:100%;
  margin:0;
  color:var(--text,#233b33);
  font-size:.94rem;
  line-height:1.55;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.notification-item-meta{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.3rem;
  color:var(--muted,#6d7f78);
  font-size:.78rem;
  line-height:1.4;
}
.notification-item.is-read{opacity:.76}
.notifications-empty{
  padding:2rem 1rem;
  text-align:center;
}
@media(max-width:640px){
  .notifications-page-card{padding:.85rem}
  .notifications-page-head{
    align-items:stretch;
    flex-direction:column;
    gap:.7rem;
  }
  .notifications-read-all-form,
  .notifications-read-all-form .btn{width:100%}
  .notifications-read-all-form .btn{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:42px;
  }
  .notification-item{
    grid-template-columns:16px minmax(0,1fr);
    gap:.65rem;
    padding:.9rem 0;
  }
  .notification-item:before{left:4px}
  .notification-item-dot{width:9px;height:9px}
  .notification-item-title{font-size:.94rem}
  .notification-item-body{font-size:.9rem;line-height:1.5}
  .notification-item-meta{font-size:.75rem}
}

/* ===== Expenses only: hide the custom VAT box until Custom VAT is selected (2026-07-28) ===== */
.expense-form .calc-vat-custom[hidden]{
  display:none!important;
}

/* ========================================================================== 
   Supply & Purchase workflow — Purchase → Raw Stock → Packaging → Finished
   Scoped styles only; no unrelated page layout is changed.
   ========================================================================== */
.supply-workflow-page,.supply-stock-page{display:grid;gap:16px;min-width:0}
.supply-workflow-hero,.supply-stock-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;padding:22px 24px;border:1px solid var(--border);border-radius:18px;background:linear-gradient(135deg,rgba(5,123,86,.09),rgba(255,249,235,.9));box-shadow:var(--shadow-sm)}
.supply-workflow-hero h1,.supply-stock-hero h1{margin:4px 0 6px;font-size:clamp(1.45rem,2vw,2rem);color:var(--primary-dark)}
.supply-workflow-hero p,.supply-stock-hero p{margin:0;max-width:760px;color:var(--muted);line-height:1.55}
.supply-warehouse-filter{min-width:230px}
.supply-warehouse-filter label{display:grid;gap:6px;font-weight:700;color:var(--text)}
.supply-warehouse-filter label>span{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.supply-flow-strip{display:grid;grid-template-columns:minmax(120px,1fr) 26px minmax(120px,1fr) 26px minmax(120px,1fr) 26px minmax(120px,1fr) 26px minmax(120px,1fr);align-items:center;gap:8px;padding:14px;border:1px solid var(--border);border-radius:18px;background:var(--surface);overflow:hidden}
.supply-flow-strip>a{min-width:0;display:grid;grid-template-columns:38px 1fr;grid-template-rows:auto auto;column-gap:10px;align-items:center;padding:12px;border:1px solid transparent;border-radius:14px;color:var(--text);text-decoration:none;transition:.18s ease}
.supply-flow-strip>a:hover{border-color:rgba(5,123,86,.24);background:rgba(5,123,86,.06);transform:translateY(-1px)}
.supply-flow-strip .flow-icon{grid-row:1/3;width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:var(--primary);color:#fff;font-weight:800;box-shadow:0 6px 14px rgba(5,123,86,.18)}
.supply-flow-strip strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--primary-dark)}
.supply-flow-strip small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted)}
.supply-flow-strip>i{font-style:normal;text-align:center;color:var(--primary);font-size:1.15rem}
.supply-kpis{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}
.supply-kpi{display:grid;gap:6px;min-width:0;padding:17px 18px;text-decoration:none;border-left:4px solid var(--primary)}
.supply-kpi>span{font-size:.76rem;font-weight:800;text-transform:uppercase;letter-spacing:.035em;color:var(--muted)}
.supply-kpi>strong{font-size:1.45rem;color:var(--primary-dark);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.supply-kpi>small{color:var(--muted);line-height:1.35}
.supply-kpi.packaging{border-left-color:#b7791f}.supply-kpi.finished{border-left-color:#2563a6}.supply-kpi.pending{border-left-color:#c05621}.supply-kpi.draft{border-left-color:#7c5cbf}.supply-kpi.today{border-left-color:#16855b}
.supply-action-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.supply-action-card{display:flex;align-items:center;gap:13px;padding:17px;text-decoration:none;min-width:0}
.supply-action-card>span{flex:0 0 42px;width:42px;height:42px;display:grid;place-items:center;border-radius:13px;background:rgba(5,123,86,.1);color:var(--primary);font-size:1.25rem;font-weight:800}
.supply-action-card>div{display:grid;gap:3px;min-width:0}.supply-action-card strong{color:var(--primary-dark)}.supply-action-card small{color:var(--muted);line-height:1.35}
.supply-dashboard-panels{min-width:0}.supply-panel{min-width:0}.supply-panel .card-head{gap:12px}
.supply-mini-list{display:grid}.supply-mini-list>a{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 0;border-bottom:1px solid var(--border);text-decoration:none;color:var(--text);min-width:0}.supply-mini-list>a:last-child{border-bottom:0}.supply-mini-list>a>div{min-width:0;display:grid;gap:3px}.supply-mini-list strong,.supply-mini-list small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.supply-mini-list small{color:var(--muted)}
.empty-state-inline{padding:28px 8px;text-align:center;color:var(--muted)}
.stock-low{flex:0 0 auto;font-weight:800;color:var(--danger)}
.supply-progress{height:7px;min-width:90px;border-radius:999px;background:rgba(5,123,86,.1);overflow:hidden;margin-bottom:4px}.supply-progress i{display:block;height:100%;border-radius:inherit;background:var(--primary)}
.supply-responsive-table td small,.supply-stock-table td small{display:block;color:var(--muted);margin-top:3px}
.supply-stock-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.supply-stock-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.supply-stock-kpis>.card{display:grid;gap:7px;padding:18px;border-top:3px solid var(--primary)}.supply-stock-kpis span{font-size:.78rem;font-weight:800;text-transform:uppercase;color:var(--muted)}.supply-stock-kpis strong{font-size:1.45rem;color:var(--primary-dark)}
.supply-stock-card{min-width:0}.supply-stock-filter{display:grid;grid-template-columns:minmax(220px,1.4fr) minmax(170px,.8fr) minmax(150px,.7fr) auto auto;align-items:end;gap:10px;margin-bottom:15px}.supply-stock-filter .field{margin:0}
.supply-row-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.supply-stock-table td:first-child{min-width:190px}.supply-stock-table td:last-child{min-width:145px}
.supply-workflow-menu .navlink .i{font-size:.72rem;font-weight:800}
.status-draft{background:rgba(124,92,191,.12)!important;color:#6741a5!important;border-color:rgba(124,92,191,.28)!important}
.packaging-form-heading{align-items:flex-start}.packaging-workflow-note{display:flex;align-items:flex-start;gap:10px;margin:0 0 16px;padding:12px 14px;border:1px solid rgba(5,123,86,.22);border-radius:12px;background:rgba(5,123,86,.055);line-height:1.45}.packaging-workflow-note strong{color:var(--primary-dark);white-space:nowrap}.packaging-workflow-note span{color:var(--muted)}
.packaging-submit-actions>div{display:flex;gap:8px;flex-wrap:wrap}.packaging-submit-actions button:disabled{opacity:.55;cursor:not-allowed}
.packaging-head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}.packaging-draft-alert{display:flex;flex-direction:column;gap:4px;margin-bottom:14px}.packaging-draft-summary .summary-list dd{font-weight:800}.draft-action-buttons{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:16px}.draft-action-buttons form{margin:0}
.purchase-workflow-banner{display:flex;align-items:flex-start;gap:12px;margin:0 0 14px;padding:13px 15px;border:1px solid rgba(5,123,86,.22);border-radius:14px;background:rgba(5,123,86,.055)}.purchase-workflow-banner>span{flex:0 0 34px;width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:var(--primary);color:#fff;font-weight:800}.purchase-workflow-banner strong{display:block;color:var(--primary-dark);margin-bottom:3px}.purchase-workflow-banner p{margin:0;color:var(--muted);line-height:1.45}
.purchase-product-filter{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin-bottom:12px}.purchase-product-filter .field{min-width:230px;margin:0}.purchase-product-filter small{max-width:520px;color:var(--muted);line-height:1.4;padding-bottom:8px}

@media (max-width:1180px){
  .supply-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
  .supply-action-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .supply-flow-strip{grid-template-columns:repeat(5,minmax(145px,1fr));overflow-x:auto;scrollbar-width:thin}.supply-flow-strip>i{display:none}
}
@media (max-width:900px){
  .supply-workflow-hero,.supply-stock-hero{align-items:stretch;flex-direction:column;padding:18px}.supply-warehouse-filter{min-width:0;width:100%}.supply-stock-actions{justify-content:flex-start}
  .supply-stock-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .supply-stock-filter{grid-template-columns:repeat(2,minmax(0,1fr))}.supply-stock-filter .field:first-child{grid-column:1/-1}
}
@media (max-width:700px){
  .supply-workflow-page,.supply-stock-page{gap:12px}.supply-workflow-hero,.supply-stock-hero{border-radius:14px;padding:15px}.supply-workflow-hero h1,.supply-stock-hero h1{font-size:1.35rem}
  .supply-flow-strip{display:flex;align-items:stretch;gap:10px;padding:10px;scroll-snap-type:x mandatory}.supply-flow-strip>a{flex:0 0 210px;scroll-snap-align:start;background:rgba(5,123,86,.03)}
  .supply-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.supply-kpi{padding:14px}.supply-kpi>strong{font-size:1.16rem}.supply-kpi>small{font-size:.75rem}
  .supply-action-grid{grid-template-columns:1fr}.supply-action-card{padding:14px}
  .supply-stock-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.supply-stock-kpis>.card{padding:14px}.supply-stock-kpis strong{font-size:1.16rem}
  .supply-stock-filter{grid-template-columns:1fr}.supply-stock-filter .field:first-child{grid-column:auto}.supply-stock-filter>.btn{width:100%}
  .supply-stock-table,.supply-responsive-table{min-width:0!important}.supply-stock-table thead,.supply-responsive-table thead{display:none}.supply-stock-table tbody,.supply-responsive-table tbody{display:grid;gap:10px}.supply-stock-table tr,.supply-responsive-table tr{display:grid!important;grid-template-columns:1fr 1fr;gap:0;border:1px solid var(--border);border-radius:14px;padding:8px;background:var(--surface)}.supply-stock-table td,.supply-responsive-table td{display:grid!important;grid-template-columns:minmax(90px,.8fr) minmax(0,1.2fr);align-items:center;gap:8px;padding:8px!important;border:0!important;text-align:right!important;min-width:0!important}.supply-stock-table td::before,.supply-responsive-table td::before{content:attr(data-label);font-size:.72rem;font-weight:800;text-transform:uppercase;letter-spacing:.025em;color:var(--muted);text-align:left}.supply-stock-table td:first-child,.supply-responsive-table td:first-child{grid-column:1/-1;background:rgba(5,123,86,.05);border-radius:10px;display:block!important;text-align:left!important}.supply-stock-table td:first-child::before,.supply-responsive-table td:first-child::before{display:none}.supply-stock-table td:last-child,.supply-responsive-table td:last-child{grid-column:1/-1;display:block!important}.supply-stock-table td:last-child::before,.supply-responsive-table td:last-child::before{display:none}.supply-row-actions{justify-content:stretch}.supply-row-actions .btn{flex:1}
  .supply-dashboard-panels{grid-template-columns:1fr}.supply-mini-list>a{align-items:flex-start}.supply-mini-list strong,.supply-mini-list small{white-space:normal}
  .packaging-workflow-note{flex-direction:column;gap:4px}.packaging-submit-actions{align-items:stretch}.packaging-submit-actions>a{width:100%}.packaging-submit-actions>div{width:100%;display:grid;grid-template-columns:1fr}.packaging-submit-actions button{width:100%}.packaging-head-actions{justify-content:flex-start}.draft-action-buttons{display:grid}.draft-action-buttons .btn{width:100%}
  .purchase-product-filter{display:grid}.purchase-product-filter .field{min-width:0}.purchase-product-filter small{padding-bottom:0}
}
@media (max-width:430px){
  .supply-kpis,.supply-stock-kpis{grid-template-columns:1fr}.supply-flow-strip>a{flex-basis:190px}.supply-stock-table tr,.supply-responsive-table tr{grid-template-columns:1fr}.supply-stock-table td,.supply-responsive-table td{grid-column:1/-1}
}

/* =========================================================
   Order mobile message control + packaging wastage unit (2026-07-28)
   ========================================================= */
.quantity-unit-control{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(92px,.38fr);
  gap:8px;
  align-items:stretch;
}
.quantity-unit-control>input,
.quantity-unit-control>select{
  min-width:0;
  width:100%;
}
.wastage-equivalent-note{
  display:block;
  margin-top:6px;
  line-height:1.35;
}
.wastage-equivalent-note strong{
  color:var(--primary-dark);
}
@media(max-width:760px){
  /* The mobile dock already contains the synced message control beside Create order. */
  .workflow-message-control-order{display:none!important}
}
@media(max-width:390px){
  .quantity-unit-control{grid-template-columns:minmax(0,1fr) 86px}
}

/* =========================================================
   Suppliers only: action dropdown + profile responsive fit (2026-07-28)
   Scoped to supplier list/profile so unrelated pages remain unchanged.
   ========================================================= */
.supplier-master-table .party-action-head,
.supplier-master-table .party-action-cell{
  width:126px;
  min-width:126px;
  text-align:center;
}
.supplier-master-table .party-action-cell{
  position:relative;
  overflow:visible;
}
.supplier-master-table .party-action-dropdown{
  position:relative;
  display:inline-block;
  max-width:100%;
  margin:0;
  vertical-align:middle;
}
.supplier-master-table .party-action-trigger{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.38rem;
  min-width:88px;
  min-height:38px;
  margin:0;
  padding:.42rem .68rem;
  border:1px solid #d3e0db;
  border-radius:11px;
  background:#fff;
  color:#1c2b25;
  font:inherit;
  font-size:.79rem;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
  list-style:none;
  cursor:pointer;
  user-select:none;
}
.supplier-master-table .party-action-trigger::-webkit-details-marker{display:none}
.supplier-master-table .party-action-trigger::marker{content:""}
.supplier-master-table .party-action-dropdown[open]>.party-action-trigger{
  border-color:#6fa78f;
  background:#f1f8f5;
  color:var(--brand,#0e6b4e);
  box-shadow:0 0 0 3px rgba(14,107,78,.08);
}
.supplier-master-table .party-action-dropdown:not([open])>.party-action-menu{display:none!important}
.supplier-master-table .party-action-menu{
  position:absolute;
  top:calc(100% + 7px);
  right:0;
  z-index:9999;
  display:grid;
  gap:4px;
  width:232px;
  min-width:232px;
  max-width:calc(100vw - 20px);
  max-height:calc(100vh - 20px);
  margin:0;
  padding:7px;
  overflow-x:hidden;
  overflow-y:auto;
  border:1px solid #d3e0db;
  border-radius:12px;
  background:#fff;
  box-shadow:0 16px 38px rgba(12,52,39,.2),0 4px 12px rgba(12,52,39,.08);
  text-align:left;
}
.supplier-master-table .party-action-menu.is-floating{
  position:fixed;
  top:auto;
  right:auto;
  z-index:10000;
}
.supplier-master-table .party-action-menu-form{
  display:block;
  width:100%;
  margin:0;
  padding:0;
}
.supplier-master-table .party-action-item{
  display:flex;
  align-items:center;
  gap:.62rem;
  width:100%;
  min-width:0;
  min-height:40px;
  margin:0;
  padding:.56rem .66rem;
  border:0;
  border-radius:9px;
  background:transparent;
  color:#1c2b25;
  font:inherit;
  font-size:.8rem;
  font-weight:650;
  line-height:1.25;
  text-align:left;
  text-decoration:none;
  white-space:normal;
  overflow-wrap:anywhere;
  cursor:pointer;
  appearance:none;
}
.supplier-master-table .party-action-item:hover,
.supplier-master-table .party-action-item:focus-visible{
  background:#eef7f3;
  color:var(--brand,#0e6b4e);
  outline:none;
}
.supplier-master-table .party-action-icon{
  display:grid;
  place-items:center;
  flex:0 0 29px;
  width:29px;
  height:29px;
  border-radius:8px;
  background:#e5f3ed;
  color:var(--brand,#0e6b4e);
  font-size:.86rem;
  font-weight:800;
  line-height:1;
}
.supplier-master-table .party-action-item.is-primary{color:var(--brand,#0e6b4e)}
.supplier-master-table .party-action-item.is-danger{color:#b02d35}
.supplier-master-table .party-action-item.is-danger:hover,
.supplier-master-table .party-action-item.is-danger:focus-visible{
  background:#fff0f1;
  color:#98212a;
}
.supplier-master-table .party-action-item.is-danger .party-action-icon{
  background:#fde8ea;
  color:#b02d35;
}
.supplier-master-table tr.has-party-action-open,
.supplier-master-table .party-action-cell.is-menu-open{
  position:relative;
  z-index:40;
}

.supplier-profile-page{
  --supplier-profile-soft:#f5faf7;
  --supplier-profile-line:#d9e6e0;
  --supplier-profile-ink:#172821;
  --supplier-profile-muted:#64776f;
  display:grid;
  gap:1rem;
  width:100%;
  min-width:0;
}
.supplier-profile-page>*{min-width:0}
.supplier-profile-page .card{margin-bottom:0}
.supplier-profile-toolbar{
  display:flex;
  align-items:center;
  gap:.8rem;
  min-width:0;
}
.supplier-profile-toolbar>.btn{flex:0 0 auto}
.supplier-profile-toolbar>div{
  display:flex;
  align-items:baseline;
  flex-wrap:wrap;
  gap:.25rem .45rem;
  min-width:0;
  color:var(--supplier-profile-muted);
}
.supplier-profile-toolbar>div>strong{
  color:var(--supplier-profile-ink);
  font-size:1rem;
  line-height:1.25;
}
.supplier-profile-toolbar>div>span{
  min-width:0;
  overflow-wrap:anywhere;
  font-size:.86rem;
}
.supplier-profile-hero{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1.25rem;
  padding:1.25rem;
  background:linear-gradient(135deg,#fff 0%,#f7fbf9 100%);
  overflow:hidden;
}
.supplier-profile-identity{
  display:flex;
  align-items:center;
  gap:1rem;
  flex:1 1 auto;
  min-width:0;
}
.supplier-profile-avatar{
  flex:0 0 64px;
  width:64px;
  height:64px;
  display:grid;
  place-items:center;
  border-radius:18px;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  color:#fff;
  font-size:1.2rem;
  font-weight:800;
  letter-spacing:.04em;
  box-shadow:0 8px 20px rgba(14,107,78,.18);
}
.supplier-profile-name-block{min-width:0}
.supplier-profile-name-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:.45rem .7rem;
  min-width:0;
}
.supplier-profile-name-row h1{
  min-width:0;
  margin:0;
  color:var(--supplier-profile-ink);
  font-size:clamp(1.45rem,2.2vw,1.9rem);
  line-height:1.15;
  overflow-wrap:anywhere;
}
.supplier-profile-contact-person{
  margin:.42rem 0 0;
  color:var(--supplier-profile-muted);
  font-size:.84rem;
  overflow-wrap:anywhere;
}
.supplier-profile-contact-person strong{color:var(--supplier-profile-ink)}
.supplier-profile-primary-contact,
.supplier-profile-actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:.45rem;
}
.supplier-profile-primary-contact{
  margin-top:.55rem;
  color:var(--supplier-profile-muted);
  font-size:.88rem;
}
.supplier-profile-primary-contact>a,
.supplier-profile-primary-contact>span{
  display:inline-flex;
  align-items:flex-start;
  gap:.28rem;
  min-width:0;
  max-width:100%;
  overflow-wrap:anywhere;
}
.supplier-profile-primary-contact a{color:var(--brand-2);font-weight:600}
.supplier-profile-actions{
  flex:0 0 auto;
  justify-content:flex-end;
  max-width:420px;
}
.supplier-profile-actions .btn{white-space:nowrap}
.supplier-profile-kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.85rem;
  min-width:0;
}
.supplier-profile-kpi{
  --supplier-kpi:#0e6b4e;
  --supplier-kpi-bg:#e3f3ed;
  display:flex;
  align-items:center;
  gap:.8rem;
  min-width:0;
  min-height:92px;
  padding:1rem;
  border:1px solid var(--supplier-profile-line);
  border-top:3px solid var(--supplier-kpi);
  border-radius:13px;
  background:#fff;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.supplier-profile-kpi.is-success{--supplier-kpi:#159447;--supplier-kpi-bg:#e2f5e9}
.supplier-profile-kpi.is-active{--supplier-kpi:#d28715;--supplier-kpi-bg:#fbefd9}
.supplier-profile-kpi.is-draft{--supplier-kpi:#7c3aed;--supplier-kpi-bg:#eee7fb}
.supplier-profile-kpi.is-returned{--supplier-kpi:#2563eb;--supplier-kpi-bg:#e6eefc}
.supplier-profile-kpi.is-failed{--supplier-kpi:#d6453f;--supplier-kpi-bg:#fbe7e6}
.supplier-profile-kpi.is-qty{--supplier-kpi:#0e9f9a;--supplier-kpi-bg:#def3f1}
.supplier-profile-kpi-icon{
  flex:0 0 42px;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:12px;
  background:var(--supplier-kpi-bg);
  color:var(--supplier-kpi);
  font-size:.95rem;
  font-weight:800;
}
.supplier-profile-kpi>div{display:grid;gap:.12rem;min-width:0}
.supplier-profile-kpi>div>span{
  color:var(--supplier-profile-muted);
  font-size:.76rem;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.035em;
  overflow-wrap:anywhere;
}
.supplier-profile-kpi>div>strong{
  min-width:0;
  color:var(--supplier-kpi);
  font-size:1.45rem;
  line-height:1.1;
  overflow-wrap:anywhere;
  font-variant-numeric:tabular-nums;
}
.supplier-profile-main-grid{
  display:grid;
  grid-template-columns:minmax(0,1.55fr) minmax(300px,.85fr);
  gap:1rem;
  align-items:start;
  min-width:0;
}
.supplier-profile-section{
  min-width:0;
  padding:1.2rem;
  overflow:hidden;
}
.supplier-profile-section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:.8rem;
  margin-bottom:1rem;
  min-width:0;
}
.supplier-profile-section-head>div{min-width:0}
.supplier-profile-section-head h2{
  margin:0;
  color:var(--brand);
  font-size:1.08rem;
  line-height:1.25;
}
.supplier-profile-section-head p{
  margin:.25rem 0 0;
  color:var(--supplier-profile-muted);
  font-size:.82rem;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.supplier-profile-section-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:.5rem;
}
.supplier-profile-count{
  flex:0 0 auto;
  min-width:30px;
  height:30px;
  display:grid;
  place-items:center;
  padding:0 .48rem;
  border-radius:999px;
  background:#e5f3ed;
  color:var(--brand);
  font-size:.78rem;
  font-weight:800;
}
.supplier-profile-contact-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.7rem;
}
.supplier-profile-contact-item{
  display:grid;
  grid-template-columns:38px minmax(0,1fr);
  align-items:center;
  gap:.7rem;
  min-width:0;
  padding:.75rem .8rem;
  border:1px solid var(--supplier-profile-line);
  border-radius:11px;
  background:var(--supplier-profile-soft);
}
.supplier-profile-contact-item>div{display:grid;gap:.12rem;min-width:0}
.supplier-profile-contact-item small{color:var(--supplier-profile-muted);font-size:.7rem}
.supplier-profile-contact-item strong{min-width:0;color:var(--supplier-profile-ink);font-size:.86rem;overflow-wrap:anywhere}
.supplier-profile-contact-icon{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:#e3f3ed;
  color:var(--brand);
  font-weight:800;
}
.supplier-profile-basic-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.7rem;
  margin-top:.9rem;
}
.supplier-profile-basic-grid>div{
  display:grid;
  gap:.2rem;
  min-width:0;
  padding:.75rem .85rem;
  border:1px solid var(--supplier-profile-line);
  border-radius:10px;
  background:#fff;
}
.supplier-profile-basic-grid span,
.supplier-profile-note>span{
  color:var(--supplier-profile-muted);
  font-size:.72rem;
  text-transform:uppercase;
  letter-spacing:.035em;
}
.supplier-profile-basic-grid strong{min-width:0;overflow-wrap:anywhere;font-size:.88rem}
.supplier-profile-note{
  display:grid;
  gap:.35rem;
  margin-top:.9rem;
  padding:.8rem .9rem;
  border:1px dashed var(--supplier-profile-line);
  border-radius:10px;
  background:#fbfcfc;
}
.supplier-profile-note p{margin:0;color:var(--supplier-profile-ink);line-height:1.5;overflow-wrap:anywhere}
.supplier-profile-finance-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.7rem;
}
.supplier-profile-money{
  --supplier-money:#0e6b4e;
  --supplier-money-bg:#e8f5f0;
  display:grid;
  gap:.25rem;
  min-width:0;
  padding:.85rem;
  border:1px solid var(--supplier-profile-line);
  border-left:4px solid var(--supplier-money);
  border-radius:10px;
  background:var(--supplier-money-bg);
}
.supplier-profile-money.is-paid{--supplier-money:#159447;--supplier-money-bg:#e9f7ed}
.supplier-profile-money.is-due{--supplier-money:#d6453f;--supplier-money-bg:#fdf0ef}
.supplier-profile-money.is-advance{--supplier-money:#2563eb;--supplier-money-bg:#edf3fd}
.supplier-profile-money span{color:var(--supplier-profile-muted);font-size:.74rem}
.supplier-profile-money strong{
  min-width:0;
  color:var(--supplier-money);
  font-size:1.12rem;
  line-height:1.2;
  overflow-wrap:anywhere;
  font-variant-numeric:tabular-nums;
}
.supplier-profile-ledger-line{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.65rem;
  margin:.85rem 0;
  padding:.75rem;
  border:1px dashed var(--supplier-profile-line);
  border-radius:10px;
  background:#fbfcfc;
}
.supplier-profile-ledger-line>span{display:grid;gap:.15rem;color:var(--supplier-profile-muted);font-size:.75rem}
.supplier-profile-ledger-line strong{color:var(--supplier-profile-ink);font-size:.9rem;overflow-wrap:anywhere}
.supplier-profile-statement-button{display:flex;justify-content:center;width:100%;min-height:42px;white-space:normal;text-align:center}
.supplier-profile-table-wrap{
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  border:1px solid var(--supplier-profile-line);
  border-radius:12px;
  background:#fff;
}
.supplier-profile-table{
  width:100%;
  min-width:820px;
  margin:0;
}
.supplier-profile-table thead th{background:#f3f7f5;color:#486159;white-space:nowrap}
.supplier-profile-table th,
.supplier-profile-table td{padding:.72rem .8rem;vertical-align:middle}
.supplier-profile-table tbody tr:last-child td{border-bottom:0}
.supplier-profile-table td small{display:block;margin-top:.18rem;color:var(--supplier-profile-muted);font-size:.72rem;overflow-wrap:anywhere}
.supplier-profile-table code{white-space:nowrap}

@media(max-width:1180px){
  .supplier-profile-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .supplier-profile-main-grid{grid-template-columns:1fr}
  .supplier-profile-finance-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(max-width:900px){
  .supplier-profile-hero{align-items:flex-start;flex-direction:column}
  .supplier-profile-actions{justify-content:flex-start;max-width:none;width:100%}
  .supplier-profile-finance-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:820px){
  .supplier-master-table .party-action-head,
  .supplier-master-table .party-action-cell{width:112px;min-width:112px}
  .supplier-master-table .party-action-trigger{min-width:80px;min-height:36px;padding:.38rem .56rem}
  .supplier-master-table .party-action-menu{width:218px;min-width:218px;max-width:calc(100vw - 16px);padding:6px}
}
@media(max-width:700px){
  .supplier-profile-page{gap:.8rem}
  .supplier-profile-toolbar{align-items:flex-start;flex-direction:column;gap:.55rem}
  .supplier-profile-toolbar>div{align-items:flex-start;flex-direction:column;gap:.1rem}
  .supplier-profile-hero,
  .supplier-profile-section{padding:.9rem}
  .supplier-profile-identity{align-items:flex-start}
  .supplier-profile-avatar{flex-basis:52px;width:52px;height:52px;border-radius:14px;font-size:1rem}
  .supplier-profile-contact-grid,
  .supplier-profile-basic-grid{grid-template-columns:1fr}
  .supplier-profile-section-head{align-items:flex-start;flex-direction:column}
  .supplier-profile-section-actions{justify-content:flex-start;width:100%}
  .supplier-profile-table-wrap{border:0;overflow:visible}
  .supplier-profile-table{display:block;min-width:0}
  .supplier-profile-table thead{display:none}
  .supplier-profile-table tbody{display:grid;gap:.7rem}
  .supplier-profile-table tr{
    display:grid;
    gap:0;
    padding:.45rem .75rem;
    border:1px solid var(--supplier-profile-line);
    border-radius:11px;
    background:#fff;
    box-shadow:0 2px 10px rgba(14,60,46,.05);
  }
  .supplier-profile-table td{
    display:grid;
    grid-template-columns:minmax(105px,40%) minmax(0,1fr);
    align-items:center;
    gap:.7rem;
    min-width:0;
    padding:.55rem 0;
    border-bottom:1px dashed #e1e9e5;
    text-align:right!important;
    white-space:normal!important;
    overflow-wrap:anywhere;
  }
  .supplier-profile-table td:last-child{border-bottom:0}
  .supplier-profile-table td::before{
    content:attr(data-label);
    color:var(--supplier-profile-muted);
    font-size:.72rem;
    font-weight:700;
    text-align:left;
    text-transform:uppercase;
    letter-spacing:.03em;
  }
  .supplier-profile-table td>*{justify-self:end;max-width:100%}
  .supplier-profile-table td:first-child strong{overflow-wrap:anywhere}
  .supplier-profile-table .supplier-profile-empty-row{display:block;padding:0}
  .supplier-profile-table .supplier-profile-empty-row td{display:block;padding:1rem;text-align:center!important;border:0}
  .supplier-profile-table .supplier-profile-empty-row td::before{content:none}
}
@media(max-width:520px){
  .supplier-profile-kpi-grid,
  .supplier-profile-finance-grid,
  .supplier-profile-ledger-line{grid-template-columns:1fr}
  .supplier-profile-identity{flex-direction:column}
  .supplier-profile-primary-contact{align-items:flex-start;flex-direction:column}
  .supplier-profile-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .supplier-profile-actions .btn{justify-content:center;width:100%;min-width:0;white-space:normal;text-align:center}
}
@media(max-width:360px){
  .supplier-profile-actions{grid-template-columns:1fr}
  .supplier-profile-table td{grid-template-columns:1fr;gap:.2rem;text-align:left!important}
  .supplier-profile-table td>*{justify-self:start}
}

/* ===== Purchase register filter parameters: percentage-fit responsive grid (2026-07-28) ===== */
.purchase-filter-card{
  min-width:0;
  max-width:100%;
}
.purchase-register-filterbar{
  display:grid!important;
  grid-template-columns:
    minmax(0,.90fr)
    minmax(0,1.08fr)
    minmax(0,1.08fr)
    minmax(0,.92fr)
    minmax(0,.94fr)
    minmax(0,.94fr)
    minmax(0,.72fr)
    minmax(0,.52fr);
  align-items:stretch!important;
  gap:.55rem;
  width:100%;
  min-width:0;
  max-width:100%;
  margin:0;
}
.purchase-register-filterbar > :not(input[type="hidden"]){
  box-sizing:border-box;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  min-height:44px;
  margin:0!important;
}
.purchase-register-filterbar .filter-search{
  display:block;
  position:relative;
  flex:none;
}
.purchase-register-filterbar .filter-search > span{
  z-index:1;
  pointer-events:none;
}
.purchase-register-filterbar .filter-search input,
.purchase-register-filterbar input,
.purchase-register-filterbar select{
  box-sizing:border-box;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:44px;
}
.purchase-register-filterbar .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  min-height:44px;
  padding:.55rem .65rem;
  line-height:1.2;
  text-align:center;
  white-space:normal;
}

@media(max-width:1100px){
  .purchase-register-filterbar{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
}
@media(max-width:760px){
  .purchase-register-filterbar{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.5rem;
  }
}
@media(max-width:520px){
  .purchase-register-filterbar{
    grid-template-columns:1fr;
  }
}

/* ===== Purchase register: readable Purchase/Supplier/Warehouse columns + 12-hour time (2026-07-28) ===== */
.purchase-table{
  width:100%;
  min-width:1080px;
  table-layout:auto;
}
.purchase-table .purchase-col-purchase{
  width:18%;
  min-width:178px;
}
.purchase-table .purchase-col-supplier{
  width:17%;
  min-width:158px;
}
.purchase-table .purchase-col-warehouse{
  width:13%;
  min-width:128px;
}
.purchase-table .purchase-no-cell{
  width:100%;
  align-items:center;
}
.purchase-table .purchase-no-cell>div{
  width:100%;
  min-width:0;
}
.purchase-table .purchase-no-cell a,
.purchase-table .purchase-no-cell a strong{
  display:block;
  max-width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  word-break:normal;
}
.purchase-table .purchase-meta-line{
  display:-webkit-box;
  max-width:100%;
  margin-top:.15rem;
  line-height:1.35;
  white-space:normal;
  overflow:hidden;
  overflow-wrap:break-word;
  word-break:normal;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}
.purchase-table .purchase-supplier-name{
  display:-webkit-box;
  max-width:100%;
  line-height:1.35;
  white-space:normal;
  overflow:hidden;
  overflow-wrap:break-word;
  word-break:normal;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}
.purchase-table .purchase-col-warehouse .warehouse-chip{
  display:inline-flex;
  align-items:flex-start;
  max-width:100%;
  min-width:0;
  line-height:1.3;
  white-space:normal;
}
.purchase-table .warehouse-chip-name{
  display:-webkit-box;
  min-width:0;
  max-width:100%;
  overflow:hidden;
  overflow-wrap:break-word;
  word-break:normal;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}

@media(max-width:760px){
  .purchase-table{
    min-width:1060px;
  }
  .purchase-table .purchase-col-purchase{
    min-width:170px;
  }
  .purchase-table .purchase-col-supplier{
    min-width:150px;
  }
  .purchase-table .purchase-col-warehouse{
    min-width:122px;
  }
}

/* =========================================================
   POS checkout action area: desktop-only responsive fit (2026-07-28)
   Scoped to the two-column desktop POS layout. Mobile/tablet rules remain unchanged.
   ========================================================= */
@media(min-width:941px){
  .pos-cart .pos-actions{
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
    max-width:100%;
    gap:10px;
    align-items:stretch;
  }
  .pos-cart .pos-actions>.workflow-message-control-pos{
    order:1;
    grid-column:1/-1;
    width:100%;
    min-width:0;
    max-width:100%;
    box-sizing:border-box;
    flex-wrap:wrap;
  }
  .pos-cart .pos-actions>#holdBtn{
    order:2;
    width:100%;
    min-width:0;
    grid-column:auto;
  }
  .pos-cart .pos-actions>#checkoutBtn{
    order:3;
    width:100%;
    min-width:0;
    grid-column:auto;
  }
  .pos-cart .workflow-message-control-pos .workflow-message-check{
    flex:1 1 190px;
  }
  .pos-cart .workflow-message-control-pos .workflow-message-channel{
    flex:0 1 auto;
    min-width:0;
  }
  .pos-cart .workflow-message-control-pos .workflow-message-channel select{
    max-width:100%;
  }
  .pos-cart .pos-actions:not(:has(#holdBtn))>#checkoutBtn{
    grid-column:1/-1;
  }
}

/* =========================================================
   Follow-ups: mobile-only table + page responsiveness fix
   Desktop layout is intentionally unchanged.
   ========================================================= */
@media(max-width:760px){
  .crm-followup-page,
  .crm-followup-page .crm-followup-workspace,
  .crm-followup-page .crm-followup-list-panel,
  .crm-followup-page .crm-followup-detail-panel,
  .crm-followup-page .crm-followup-bottom-grid,
  .crm-followup-page .card{
    width:100%;
    max-width:100%;
    min-width:0;
  }

  .crm-followup-page{
    overflow-x:hidden;
  }

  .crm-followup-page .crm-followup-toolbar-card,
  .crm-followup-page .crm-followup-list-panel,
  .crm-followup-page .crm-followup-profile-card,
  .crm-followup-page .crm-followup-next-card,
  .crm-followup-page .crm-followup-quick-sms-card,
  .crm-followup-page .crm-followup-schedule-launch-card,
  .crm-followup-page .crm-followup-history-card,
  .crm-followup-page .crm-followup-activity-card,
  .crm-followup-page .crm-followup-no-selection{
    padding:.78rem;
    border-radius:15px;
  }

  .crm-followup-page .crm-followup-toolbar,
  .crm-followup-page .crm-followup-advanced-panel,
  .crm-followup-page .crm-followup-profile-info,
  .crm-followup-page .crm-followup-balance-grid,
  .crm-followup-page .crm-followup-next-meta,
  .crm-followup-page .crm-followup-schedule-grid{
    width:100%;
    min-width:0;
  }

  .crm-followup-page .crm-followup-toolbar input,
  .crm-followup-page .crm-followup-toolbar select,
  .crm-followup-page .crm-followup-toolbar button,
  .crm-followup-page .crm-followup-advanced-panel input,
  .crm-followup-page .crm-followup-advanced-panel select,
  .crm-followup-page .crm-followup-complete-form input{
    max-width:100%;
    min-width:0;
  }

  .crm-followup-page .crm-followup-panel-head,
  .crm-followup-page .crm-followup-panel-head-actions{
    width:100%;
    min-width:0;
  }

  /* Keep the customer/supplier list as a real table on phones. */
  .crm-followup-page .crm-followup-table-wrap{
    display:block;
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-inline:contain;
    border:1px solid var(--line);
    border-radius:13px;
    background:#fff;
    scrollbar-gutter:stable;
  }

  .crm-followup-page .crm-followup-table{
    display:table;
    width:100%;
    min-width:880px;
    border-collapse:separate;
    border-spacing:0;
    table-layout:auto;
  }

  .crm-followup-page .crm-followup-table thead{
    display:table-header-group;
  }

  .crm-followup-page .crm-followup-table tbody{
    display:table-row-group;
  }

  .crm-followup-page .crm-followup-table tr{
    display:table-row;
    width:auto;
    border:0;
    border-radius:0;
    box-shadow:none;
    background:transparent;
  }

  .crm-followup-page .crm-followup-table th,
  .crm-followup-page .crm-followup-table td{
    display:table-cell;
    width:auto;
    min-width:0;
    text-align:left!important;
    vertical-align:middle;
  }

  .crm-followup-page .crm-followup-table thead th{
    position:sticky;
    top:0;
    z-index:2;
    padding:.72rem .65rem;
    font-size:.67rem;
    line-height:1.25;
    white-space:nowrap;
  }

  .crm-followup-page .crm-followup-table tbody td{
    padding:.72rem .65rem;
    border-bottom:1px solid #e8f0ec;
    background:#fff;
    white-space:normal;
  }

  .crm-followup-page .crm-followup-table tbody td::before{
    content:none!important;
    display:none!important;
  }

  .crm-followup-page .crm-followup-table th:nth-child(1),
  .crm-followup-page .crm-followup-table td:nth-child(1){min-width:190px}
  .crm-followup-page .crm-followup-table th:nth-child(2),
  .crm-followup-page .crm-followup-table td:nth-child(2){min-width:145px}
  .crm-followup-page .crm-followup-table th:nth-child(3),
  .crm-followup-page .crm-followup-table td:nth-child(3){min-width:105px}
  .crm-followup-page .crm-followup-table th:nth-child(4),
  .crm-followup-page .crm-followup-table td:nth-child(4){min-width:100px}
  .crm-followup-page .crm-followup-table th:nth-child(5),
  .crm-followup-page .crm-followup-table td:nth-child(5){min-width:155px}
  .crm-followup-page .crm-followup-table th:nth-child(6),
  .crm-followup-page .crm-followup-table td:nth-child(6){min-width:115px}
  .crm-followup-page .crm-followup-table th:nth-child(7),
  .crm-followup-page .crm-followup-table td:nth-child(7){min-width:150px}

  .crm-followup-page .crm-followup-party-cell{
    min-width:0;
    width:100%;
  }

  .crm-followup-page .crm-followup-party-cell strong,
  .crm-followup-page .crm-followup-party-cell small{
    max-width:125px;
  }

  .crm-followup-page .crm-followup-row-actions{
    justify-content:flex-start;
    flex-wrap:nowrap;
    min-width:max-content;
  }

  .crm-followup-page .crm-followup-pagination{
    align-items:stretch;
  }

  .crm-followup-page .crm-followup-pagination .btn{
    width:100%;
    justify-content:center;
  }

  .crm-followup-page .crm-followup-profile-top,
  .crm-followup-page .crm-followup-profile-title,
  .crm-followup-page .crm-followup-timeline-content,
  .crm-followup-page .crm-followup-activity-list span,
  .crm-followup-page .crm-followup-schedule-launch-copy,
  .crm-followup-page .crm-followup-schedule-launch-copy>div{
    min-width:0;
    max-width:100%;
  }

  .crm-followup-page .crm-followup-profile-title h2,
  .crm-followup-page .crm-followup-profile-title p,
  .crm-followup-page .crm-followup-timeline-content strong,
  .crm-followup-page .crm-followup-timeline-content small,
  .crm-followup-page .crm-followup-timeline-content p,
  .crm-followup-page .crm-followup-activity-list strong,
  .crm-followup-page .crm-followup-activity-list small,
  .crm-followup-page .crm-followup-activity-list p,
  .crm-followup-page .crm-followup-schedule-launch-copy h3,
  .crm-followup-page .crm-followup-schedule-launch-copy p{
    overflow-wrap:anywhere;
    word-break:normal;
  }

  .crm-followup-page .crm-followup-history-actions,
  .crm-followup-page .crm-followup-history-actions form,
  .crm-followup-page .crm-followup-reschedule,
  .crm-followup-page .crm-followup-reschedule form,
  .crm-followup-page .crm-followup-timeline-sms-form{
    width:100%;
    max-width:100%;
    min-width:0;
  }
}

@media(max-width:380px){
  .crm-followup-page .crm-followup-stats{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.55rem;
  }

  .crm-followup-page .crm-followup-stat{
    min-height:66px;
    padding:.58rem .45rem;
    border-radius:13px;
  }

  .crm-followup-page .crm-followup-stat-copy small{
    font-size:.72rem;
  }

  .crm-followup-page .crm-followup-stat-copy strong{
    font-size:1.15rem;
  }
}

/* =========================================================
   Follow-ups: remaining detail sections mobile-only refinement
   Scope is limited to .crm-followup-page at phone widths.
   Desktop/tablet desktop layout remains unchanged.
   ========================================================= */
@media(max-width:760px){
  .crm-followup-page,
  .crm-followup-page *,
  .crm-followup-page *::before,
  .crm-followup-page *::after{
    box-sizing:border-box;
  }

  .crm-followup-page .crm-followup-workspace{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    width:100%;
    max-width:100%;
    min-width:0;
    gap:.78rem;
  }

  .crm-followup-page .crm-followup-detail-panel{
    position:static;
    top:auto;
    display:flex;
    flex-direction:column;
    width:100%;
    max-width:100%;
    min-width:0;
    gap:.78rem;
    overflow:visible;
  }

  .crm-followup-page .crm-followup-profile-card,
  .crm-followup-page .crm-followup-next-card,
  .crm-followup-page .crm-followup-quick-sms-card,
  .crm-followup-page .crm-followup-activity-card,
  .crm-followup-page .crm-followup-schedule-launch-card,
  .crm-followup-page .crm-followup-history-card,
  .crm-followup-page .crm-followup-no-selection{
    width:100%;
    max-width:100%;
    min-width:0;
    margin:0;
    padding:.78rem;
    border-radius:15px;
    overflow:visible;
  }

  .crm-followup-page .crm-followup-profile-top{
    grid-template-columns:46px minmax(0,1fr);
    gap:.68rem;
    align-items:center;
    width:100%;
    margin-bottom:.72rem;
  }

  .crm-followup-page .crm-followup-profile-avatar{
    width:46px;
    height:46px;
    border-radius:14px;
    font-size:1rem;
  }

  .crm-followup-page .crm-followup-profile-title,
  .crm-followup-page .crm-followup-profile-title h2,
  .crm-followup-page .crm-followup-profile-title p{
    width:100%;
    max-width:100%;
    min-width:0;
  }

  .crm-followup-page .crm-followup-profile-title h2{
    font-size:1.08rem;
    overflow-wrap:anywhere;
  }

  .crm-followup-page .crm-followup-profile-state{
    grid-column:1/-1;
    justify-self:start;
    padding:.32rem .58rem;
  }

  .crm-followup-page .crm-followup-quick-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
    gap:.5rem;
    margin-bottom:.72rem;
  }

  .crm-followup-page .crm-followup-quick-actions .btn{
    display:flex;
    width:100%;
    max-width:100%;
    min-width:0;
    min-height:38px;
    padding:.52rem .42rem;
    justify-content:center;
    text-align:center;
    white-space:normal;
    line-height:1.2;
    overflow-wrap:anywhere;
  }

  .crm-followup-page .crm-followup-profile-info,
  .crm-followup-page .crm-followup-balance-grid,
  .crm-followup-page .crm-followup-next-meta{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(132px,1fr));
    width:100%;
    max-width:100%;
    min-width:0;
    gap:.55rem;
  }

  .crm-followup-page .crm-followup-profile-info>div,
  .crm-followup-page .crm-followup-balance-grid>div,
  .crm-followup-page .crm-followup-next-meta>span{
    width:100%;
    max-width:100%;
    min-width:0;
    padding:.7rem .72rem;
    border-radius:13px;
  }

  .crm-followup-page .crm-followup-profile-info dd,
  .crm-followup-page .crm-followup-balance-grid strong,
  .crm-followup-page .crm-followup-next-meta strong{
    max-width:100%;
    overflow-wrap:anywhere;
    word-break:normal;
  }

  .crm-followup-page .crm-followup-balance-grid{
    margin-top:.6rem;
  }

  .crm-followup-page .crm-followup-next-card>header,
  .crm-followup-page .crm-followup-side-heading{
    display:flex;
    flex-direction:row;
    flex-wrap:wrap;
    align-items:flex-start;
    justify-content:space-between;
    width:100%;
    min-width:0;
    gap:.55rem;
    margin-bottom:.62rem;
  }

  .crm-followup-page .crm-followup-next-card>header>div,
  .crm-followup-page .crm-followup-side-heading>div{
    flex:1 1 145px;
    max-width:100%;
    min-width:0;
  }

  .crm-followup-page .crm-followup-next-card>header h3,
  .crm-followup-page .crm-followup-side-heading h3{
    max-width:100%;
    font-size:.96rem;
    overflow-wrap:anywhere;
  }

  .crm-followup-page .crm-followup-next-card>header .crm-followup-status,
  .crm-followup-page .crm-followup-side-heading>span{
    flex:0 0 auto;
  }

  .crm-followup-page .crm-followup-quick-sms-help{
    margin:0 0 .68rem;
    font-size:.78rem;
    line-height:1.45;
    overflow-wrap:anywhere;
  }

  .crm-followup-page .crm-followup-side-heading .btn{
    flex:1 1 100%;
    width:100%;
    max-width:100%;
    min-width:0;
    justify-content:center;
    white-space:normal;
    text-align:center;
  }

  .crm-followup-page .crm-followup-quick-sms-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(132px,1fr));
    width:100%;
    max-width:100%;
    min-width:0;
    gap:.5rem;
  }

  .crm-followup-page .crm-followup-sms-type-button{
    width:100%;
    max-width:100%;
    min-width:0;
    min-height:48px;
    padding:.58rem .62rem;
    gap:.5rem;
  }

  .crm-followup-page .crm-followup-sms-type-button span{
    flex:0 0 30px;
    width:30px;
    height:28px;
  }

  .crm-followup-page .crm-followup-sms-type-button strong{
    flex:1 1 auto;
    max-width:100%;
    min-width:0;
    overflow-wrap:anywhere;
  }

  .crm-followup-page .crm-followup-bottom-grid,
  .crm-followup-page .crm-followup-bottom-grid--two{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    width:100%;
    max-width:100%;
    min-width:0;
    gap:.78rem;
    margin-top:.78rem;
  }

  .crm-followup-page .crm-followup-bottom-grid>.crm-followup-activity-card,
  .crm-followup-page .crm-followup-bottom-grid>.crm-followup-schedule-launch-card,
  .crm-followup-page .crm-followup-bottom-grid>.crm-followup-history-card{
    grid-column:auto;
    width:100%;
    max-width:100%;
    min-width:0;
    min-height:0;
    height:auto;
    overflow:visible;
  }

  .crm-followup-page .crm-followup-activity-card summary{
    width:100%;
    max-width:100%;
    min-width:0;
    gap:.55rem;
  }

  .crm-followup-page .crm-followup-activity-card summary>span{
    flex:1 1 auto;
    max-width:100%;
    min-width:0;
  }

  .crm-followup-page .crm-followup-activity-list,
  .crm-followup-page .crm-followup-timeline-list{
    width:100%;
    max-width:100%;
    min-width:0;
    max-height:none;
    overflow:visible;
    padding-right:0;
    gap:.62rem;
  }

  .crm-followup-page .crm-followup-activity-list>div{
    grid-template-columns:9px minmax(0,1fr);
    gap:.58rem;
    width:100%;
    min-width:0;
  }

  .crm-followup-page .crm-followup-activity-list>div>i{
    width:9px;
    height:9px;
  }

  .crm-followup-page .crm-followup-activity-list span{
    width:100%;
    max-width:100%;
    min-width:0;
    padding:.7rem .72rem;
    border-radius:13px;
  }

  .crm-followup-page .crm-followup-schedule-launch-card{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:.7rem;
  }

  .crm-followup-page .crm-followup-schedule-launch-copy{
    display:grid;
    grid-template-columns:38px minmax(0,1fr);
    width:100%;
    max-width:100%;
    min-width:0;
    gap:.62rem;
  }

  .crm-followup-page .crm-followup-schedule-launch-icon{
    width:38px;
    height:38px;
    flex-basis:38px;
    border-radius:12px;
    font-size:1.08rem;
  }

  .crm-followup-page .crm-followup-schedule-launch-actions{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    width:100%;
    max-width:100%;
    min-width:0;
    gap:.5rem;
    margin-top:0;
    padding-top:.2rem;
  }

  .crm-followup-page .crm-followup-schedule-launch-actions .btn{
    width:100%;
    max-width:100%;
    min-width:0;
    justify-content:center;
    white-space:normal;
    text-align:center;
  }

  .crm-followup-page .crm-followup-history-card>.crm-followup-side-heading{
    padding-bottom:.65rem;
    margin-bottom:.65rem;
  }

  .crm-followup-page .crm-followup-timeline-item{
    grid-template-columns:9px minmax(0,1fr);
    width:100%;
    max-width:100%;
    min-width:0;
    gap:.58rem;
  }

  .crm-followup-page .crm-followup-timeline-item::before{
    left:4px;
    top:12px;
    bottom:-12px;
  }

  .crm-followup-page .crm-followup-timeline-dot{
    width:9px;
    height:9px;
    margin-top:.38rem;
  }

  .crm-followup-page .crm-followup-timeline-content{
    width:100%;
    max-width:100%;
    min-width:0;
    padding:.72rem;
    border-radius:13px;
  }

  .crm-followup-page .crm-followup-timeline-content>header{
    display:flex;
    flex-direction:row;
    flex-wrap:wrap;
    align-items:flex-start;
    justify-content:space-between;
    width:100%;
    max-width:100%;
    min-width:0;
    gap:.48rem;
  }

  .crm-followup-page .crm-followup-timeline-content>header>div{
    flex:1 1 145px;
    max-width:100%;
    min-width:0;
  }

  .crm-followup-page .crm-followup-timeline-content p,
  .crm-followup-page .crm-followup-outcome{
    max-width:100%;
    overflow-wrap:anywhere;
  }

  .crm-followup-page .crm-followup-timeline-sms-form,
  .crm-followup-page .crm-followup-history-actions,
  .crm-followup-page .crm-followup-history-actions form,
  .crm-followup-page .crm-followup-reschedule,
  .crm-followup-page .crm-followup-reschedule form,
  .crm-followup-page .crm-followup-complete-form{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    width:100%;
    max-width:100%;
    min-width:0;
    gap:.5rem;
  }

  .crm-followup-page .crm-followup-timeline-sms-form .btn,
  .crm-followup-page .crm-followup-history-actions .btn,
  .crm-followup-page .crm-followup-reschedule .btn,
  .crm-followup-page .crm-followup-history-actions input,
  .crm-followup-page .crm-followup-history-actions select,
  .crm-followup-page .crm-followup-reschedule input,
  .crm-followup-page .crm-followup-reschedule select,
  .crm-followup-page .crm-followup-complete-form input{
    width:100%;
    max-width:100%;
    min-width:0;
  }

  .crm-followup-page .crm-followup-timeline-sms-form .btn,
  .crm-followup-page .crm-followup-history-actions .btn,
  .crm-followup-page .crm-followup-reschedule .btn{
    justify-content:center;
    white-space:normal;
    text-align:center;
  }
}

@media(max-width:360px){
  .crm-followup-page .crm-followup-quick-actions,
  .crm-followup-page .crm-followup-profile-info,
  .crm-followup-page .crm-followup-balance-grid,
  .crm-followup-page .crm-followup-next-meta,
  .crm-followup-page .crm-followup-quick-sms-grid{
    grid-template-columns:minmax(0,1fr);
  }

  .crm-followup-page .crm-followup-profile-card,
  .crm-followup-page .crm-followup-next-card,
  .crm-followup-page .crm-followup-quick-sms-card,
  .crm-followup-page .crm-followup-activity-card,
  .crm-followup-page .crm-followup-schedule-launch-card,
  .crm-followup-page .crm-followup-history-card{
    padding:.68rem;
  }
}

/* ===== Data Reconciliation page: isolated responsive layout (2026-07-30) ===== */
.reconciliation-page{
  display:grid;
  gap:1rem;
  width:100%;
  max-width:100%;
  min-width:0;
}
.reconciliation-page>.card,
.reconciliation-page .reconciliation-check{margin:0}
.reconciliation-hero{
  position:relative;
  overflow:hidden;
  padding:1.25rem;
  background:
    radial-gradient(circle at 96% 4%,rgba(22,160,111,.12),transparent 28%),
    linear-gradient(135deg,#fff 0%,#fbfefc 60%,#f2faf6 100%);
}
.reconciliation-hero:before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:4px;
  background:var(--grad-brand);
}
.reconciliation-hero-head{
  position:relative;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
}
.reconciliation-title-block{
  display:flex;
  align-items:flex-start;
  gap:.85rem;
  min-width:0;
}
.reconciliation-title-icon{
  display:grid;
  place-items:center;
  flex:0 0 44px;
  width:44px;
  height:44px;
  border-radius:13px;
  background:var(--grad-brand);
  color:#fff;
  font-size:1.2rem;
  font-weight:900;
  box-shadow:0 8px 18px rgba(14,107,78,.2);
}
.reconciliation-title-block h1{
  margin:0 0 .25rem;
  font-size:clamp(1.2rem,2vw,1.55rem);
  line-height:1.25;
}
.reconciliation-title-block p{
  max-width:820px;
  line-height:1.6;
}
.reconciliation-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:.55rem;
  flex-wrap:wrap;
  flex:0 0 auto;
}
.reconciliation-actions form{display:inline-flex;margin:0}
.reconciliation-actions .btn{
  min-height:42px;
  justify-content:center;
  white-space:nowrap;
}
.reconciliation-help-note{
  position:relative;
  display:flex;
  align-items:flex-start;
  gap:.7rem;
  margin-top:1rem;
  padding:.75rem .85rem;
  border:1px solid #d8e9e1;
  border-radius:11px;
  background:rgba(244,250,247,.9);
  color:var(--muted);
}
.reconciliation-help-note p{margin:0;line-height:1.55}
.reconciliation-help-icon{
  display:grid;
  place-items:center;
  flex:0 0 22px;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#dff2e9;
  color:var(--brand);
  font-size:.78rem;
  font-weight:900;
}
.reconciliation-overview{
  display:grid;
  grid-template-columns:minmax(150px,.85fr) minmax(210px,1.2fr) minmax(180px,1fr) minmax(210px,1fr);
  gap:.75rem;
  margin-top:1rem;
}
.reconciliation-summary{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:.4rem;
  min-width:0;
  min-height:92px;
  padding:.85rem .95rem;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.88);
  box-shadow:0 4px 14px rgba(14,60,46,.045);
}
.reconciliation-summary:after{
  content:"";
  position:absolute;
  left:.95rem;
  right:.95rem;
  bottom:0;
  height:3px;
  border-radius:3px 3px 0 0;
  background:#dce9e3;
}
.reconciliation-summary-status.reconciliation-tone-passed:after{background:#16a34a}
.reconciliation-summary-status.reconciliation-tone-warning:after{background:#f59e0b}
.reconciliation-summary-status.reconciliation-tone-failed:after{background:#dc2626}
.reconciliation-summary-label{
  display:block;
  color:var(--muted);
  font-size:.69rem;
  font-weight:800;
  letter-spacing:.08em;
  line-height:1.25;
  text-transform:uppercase;
}
.reconciliation-summary-value{
  display:flex;
  align-items:center;
  gap:.55rem;
  min-width:0;
}
.reconciliation-status-mark{
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  border-radius:9px;
  background:#edf4f1;
  color:var(--brand);
  font-size:.9rem;
  font-weight:900;
}
.reconciliation-tone-passed .reconciliation-status-mark{background:#e8f7ee;color:#168044}
.reconciliation-tone-warning .reconciliation-status-mark{background:#fff4dd;color:#a86d00}
.reconciliation-tone-failed .reconciliation-status-mark{background:#fdeaea;color:#c73535}
.reconciliation-reference{
  display:inline-block;
  width:max-content;
  max-width:100%;
  padding:.3rem .5rem;
  border:1px solid #dbe7e2;
  border-radius:7px;
  background:#f5f9f7;
  color:#24463a;
  font-size:.78rem;
  line-height:1.35;
  white-space:normal;
  overflow-wrap:anywhere;
}
.reconciliation-summary-text{
  display:block;
  font-size:.92rem;
  line-height:1.4;
  overflow-wrap:anywhere;
}
.reconciliation-counts{
  display:grid;
  grid-template-columns:1fr 1fr;
  align-items:center;
  gap:.8rem;
}
.reconciliation-counts>div+div{
  border-left:1px solid var(--line);
  padding-left:.8rem;
}
.reconciliation-count{
  display:block;
  margin-top:.25rem;
  font-size:1.45rem;
  line-height:1;
}
.reconciliation-count-issues{color:#c53d3d}
.reconciliation-count-warnings{color:#b77800}
.reconciliation-empty-state{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.65rem;
  margin-top:1rem;
  min-height:82px;
  padding:1rem;
  border:1px dashed #cbded5;
  border-radius:12px;
  background:rgba(248,252,250,.86);
  color:var(--muted);
  text-align:center;
}
.reconciliation-empty-state span{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border-radius:50%;
  background:#e9f4ef;
  color:var(--brand);
  font-weight:800;
}
.reconciliation-empty-state p{margin:0}
.reconciliation-checks{
  display:grid;
  gap:.85rem;
  min-width:0;
}
.reconciliation-check{
  position:relative;
  overflow:hidden;
  min-width:0;
  padding:0;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--panel);
  box-shadow:var(--shadow);
}
.reconciliation-check:before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:4px;
  background:#aebdb6;
}
.reconciliation-check--passed:before{background:#16a34a}
.reconciliation-check--warning:before{background:#f59e0b}
.reconciliation-check--failed:before{background:#dc2626}
.reconciliation-check-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  padding:1rem 1.05rem .95rem 1.15rem;
}
.reconciliation-check-title{
  display:flex;
  align-items:flex-start;
  gap:.75rem;
  min-width:0;
}
.reconciliation-check-icon{
  display:grid;
  place-items:center;
  flex:0 0 36px;
  width:36px;
  height:36px;
  margin-top:.1rem;
  border-radius:11px;
  background:#edf3f0;
  color:#60736a;
  font-weight:900;
}
.reconciliation-check--passed .reconciliation-check-icon{background:#e9f7ef;color:#168044}
.reconciliation-check--warning .reconciliation-check-icon{background:#fff4dd;color:#a86d00}
.reconciliation-check--failed .reconciliation-check-icon{background:#fdeaea;color:#c73535}
.reconciliation-check-number{
  display:block;
  margin-bottom:.18rem;
  color:#8a9b93;
  font-size:.65rem;
  font-weight:800;
  letter-spacing:.12em;
}
.reconciliation-check h2{
  margin:0 0 .28rem;
  font-size:1rem;
  line-height:1.3;
}
.reconciliation-check p{
  max-width:920px;
  line-height:1.55;
  overflow-wrap:anywhere;
}
.reconciliation-sample-bar{
  display:flex;
  justify-content:flex-end;
  padding:.5rem 1.05rem;
  border-top:1px solid var(--line);
  background:#f9fbfa;
  color:var(--muted);
  font-size:.73rem;
  font-weight:800;
}
.reconciliation-table-wrap{
  width:100%;
  max-width:100%;
  overflow:auto;
  border:0;
  border-top:1px solid var(--line);
  border-radius:0;
  -webkit-overflow-scrolling:touch;
}
.reconciliation-table{
  width:100%;
  min-width:680px;
}
.reconciliation-table thead th{
  position:sticky;
  top:0;
  z-index:1;
  background:#f3f8f5;
}
.reconciliation-table th,
.reconciliation-table td{
  padding:.68rem .8rem;
  font-size:.78rem;
  white-space:nowrap;
}
.reconciliation-table td{
  max-width:300px;
  white-space:normal;
  overflow-wrap:anywhere;
}
.reconciliation-check-clean{
  display:flex;
  align-items:center;
  gap:.55rem;
  margin:0 1.05rem 1rem 1.15rem;
  padding:.65rem .75rem;
  border:1px solid #d9ecdf;
  border-radius:10px;
  background:#f2faf5;
  color:#187443;
}
.reconciliation-check-clean span{
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  border-radius:50%;
  background:#dff4e7;
  font-weight:900;
}
.reconciliation-history-card{
  min-width:0;
  padding:1rem;
}
.reconciliation-history-head{
  margin-bottom:.75rem;
}
.reconciliation-history-head>div{
  display:flex;
  align-items:center;
  gap:.55rem;
  min-width:0;
}
.reconciliation-history-head h2{margin:0}
.reconciliation-history-count{
  display:inline-grid;
  place-items:center;
  min-width:25px;
  height:25px;
  padding:0 .45rem;
  border-radius:999px;
  background:#e7f4ee;
  color:var(--brand);
  font-size:.72rem;
  font-weight:800;
}
.reconciliation-history-wrap{
  width:100%;
  max-width:100%;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:12px;
  -webkit-overflow-scrolling:touch;
}
.reconciliation-history-table{
  width:100%;
  min-width:760px;
}
.reconciliation-history-table thead th{
  position:sticky;
  top:0;
  z-index:1;
  background:#f3f8f5;
}
.reconciliation-history-table th,
.reconciliation-history-table td{vertical-align:middle}
.reconciliation-history-date{white-space:nowrap}
.reconciliation-table-count{
  display:inline-grid;
  place-items:center;
  min-width:28px;
  height:28px;
  padding:0 .4rem;
  border-radius:8px;
  font-size:.78rem;
}
.reconciliation-table-count-issues{background:#fcecec;color:#c13c3c}
.reconciliation-table-count-warnings{background:#fff3dd;color:#a96f00}
.reconciliation-history-empty{padding:2rem!important}
.reconciliation-table-wrap:focus,
.reconciliation-history-wrap:focus{
  outline:2px solid rgba(22,160,111,.26);
  outline-offset:2px;
}
.reconciliation-table-wrap::-webkit-scrollbar,
.reconciliation-history-wrap::-webkit-scrollbar{height:9px;width:9px}
.reconciliation-table-wrap::-webkit-scrollbar-thumb,
.reconciliation-history-wrap::-webkit-scrollbar-thumb{
  border-radius:999px;
  background:rgba(66,96,84,.32);
}
.reconciliation-table-wrap::-webkit-scrollbar-track,
.reconciliation-history-wrap::-webkit-scrollbar-track{background:rgba(220,231,226,.55)}

@media(max-width:1100px){
  .reconciliation-overview{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .reconciliation-page{gap:.75rem}
  .reconciliation-hero{padding:.95rem}
  .reconciliation-hero-head{display:block}
  .reconciliation-title-block{gap:.65rem}
  .reconciliation-title-icon{
    flex-basis:38px;
    width:38px;
    height:38px;
    border-radius:11px;
  }
  .reconciliation-title-block p{font-size:.84rem}
  .reconciliation-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    width:100%;
    margin-top:.9rem;
  }
  .reconciliation-actions form,
  .reconciliation-actions .btn{width:100%}
  .reconciliation-actions .btn{
    min-height:44px;
    padding:.55rem .65rem;
    white-space:normal;
    text-align:center;
    line-height:1.3;
  }
  .reconciliation-help-note{font-size:.82rem}
  .reconciliation-overview{grid-template-columns:1fr 1fr;gap:.6rem}
  .reconciliation-summary{min-height:84px;padding:.75rem .8rem}
  .reconciliation-summary:after{left:.8rem;right:.8rem}
  .reconciliation-counts{gap:.55rem}
  .reconciliation-counts>div+div{padding-left:.55rem}
  .reconciliation-check-head{
    padding:.85rem .85rem .8rem .95rem;
    gap:.65rem;
  }
  .reconciliation-check-title{gap:.6rem}
  .reconciliation-check-icon{
    flex-basis:32px;
    width:32px;
    height:32px;
    border-radius:9px;
  }
  .reconciliation-check h2{font-size:.92rem}
  .reconciliation-check p{font-size:.8rem}
  .reconciliation-sample-bar{padding:.45rem .85rem}
  .reconciliation-check-clean{margin:0 .85rem .85rem .95rem}
  .reconciliation-history-card{padding:.8rem}
  .reconciliation-table{min-width:640px}
  .reconciliation-history-table{min-width:720px}
}
@media(max-width:480px){
  .reconciliation-actions{grid-template-columns:1fr}
  .reconciliation-overview{grid-template-columns:1fr}
  .reconciliation-summary{min-height:78px}
  .reconciliation-counts{grid-template-columns:1fr 1fr}
  .reconciliation-check-head{display:block}
  .reconciliation-check-head>.badge{margin:.65rem 0 0 2.6rem}
  .reconciliation-help-note{align-items:flex-start}
}
@media print{
  .reconciliation-page{display:block}
  .reconciliation-page>*{margin-bottom:12px!important}
  .reconciliation-hero,
  .reconciliation-check,
  .reconciliation-history-card{box-shadow:none}
  .reconciliation-table-wrap,
  .reconciliation-history-wrap{overflow:visible}
  .reconciliation-table,
  .reconciliation-history-table{min-width:0}
  .reconciliation-table thead th,
  .reconciliation-history-table thead th{position:static}
}

/* ===== Business data clear + bulk import additions ===== */
.data-clear-card .data-clear-preserved{margin:0 0 1rem}
.data-clear-card .data-clear-preserved ul{padding-left:1.15rem;line-height:1.65}
.data-clear-all-check{
  align-items:flex-start;
  gap:.65rem;
  padding:.85rem;
  border:1px solid var(--line,#dce7e2);
  border-radius:12px;
  background:#fbfdfc;
}
.data-clear-all-check>span{display:grid;gap:.15rem;min-width:0}
.data-clear-all-check small{line-height:1.45;overflow-wrap:anywhere}
.supplier-import-card .customer-import-file-copy small{max-height:4.2em;overflow:auto}
@media(max-width:760px){
  .data-clear-card{max-width:100%}
  .data-clear-card .table{min-width:520px}
  .customer-import-head>.row-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .customer-import-head>.row-actions .btn{width:100%;justify-content:center;white-space:normal;text-align:center}
}
@media(max-width:480px){
  .customer-import-head>.row-actions{grid-template-columns:1fr}
}


/* =========================================================
   Messaging page — MOBILE ONLY responsive fix (2026-08-03)
   Scope: Messaging page only. Desktop/tablet >= 768px untouched.
   Tables remain normal tables and move horizontally on mobile.
   ========================================================= */
@media (max-width:767px){
  .messaging-page{
    width:100%;
    max-width:100%;
    min-width:0;
    overflow-x:hidden;
  }

  .messaging-page > *,
  .messaging-page .card,
  .messaging-page form,
  .messaging-page .grid,
  .messaging-page .field{
    min-width:0;
    max-width:100%;
  }

  .messaging-page .message-compose-card .grid{
    grid-template-columns:minmax(0,1fr)!important;
  }

  .messaging-page .message-compose-card input,
  .messaging-page .message-compose-card select,
  .messaging-page .message-compose-card textarea,
  .messaging-page .scheduled-message-filters > *{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }

  .messaging-page .message-compose-card > form > .btn{
    width:100%;
  }

  .messaging-page .scheduled-message-filters{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    width:100%;
  }

  .messaging-page .scheduled-message-card,
  .messaging-page .message-template-card{
    container-type:normal!important;
    container-name:none!important;
    width:100%;
    max-width:100%;
    overflow:hidden!important;
  }

  .messaging-page .scheduled-message-table-wrap,
  .messaging-page .message-template-table-wrap{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    border:1px solid #d9e6e1!important;
    border-radius:11px!important;
    background:#fff!important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
    touch-action:pan-x pan-y;
    scrollbar-width:thin;
  }

  .messaging-page .scheduled-message-table-wrap::-webkit-scrollbar,
  .messaging-page .message-template-table-wrap::-webkit-scrollbar{
    height:8px;
  }

  .messaging-page .scheduled-message-table{
    display:table!important;
    width:1620px!important;
    min-width:1620px!important;
    max-width:none!important;
    table-layout:fixed!important;
    border-collapse:separate!important;
    border-spacing:0!important;
  }

  .messaging-page .scheduled-message-table thead{
    display:table-header-group!important;
    position:static!important;
    width:auto!important;
    height:auto!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    clip:auto!important;
    clip-path:none!important;
    white-space:normal!important;
  }

  .messaging-page .scheduled-message-table tbody{
    display:table-row-group!important;
    width:auto!important;
  }

  .messaging-page .scheduled-message-table tr{
    display:table-row!important;
    width:auto!important;
    min-width:0!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }

  .messaging-page .scheduled-message-table th,
  .messaging-page .scheduled-message-table td{
    display:table-cell!important;
    box-sizing:border-box!important;
    min-width:0!important;
    padding:.68rem .62rem!important;
    border-bottom:1px solid #e2ebe7!important;
    vertical-align:middle!important;
    text-align:left;
    white-space:nowrap!important;
    overflow:visible!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
  }

  .messaging-page .scheduled-message-table tbody td::before{
    content:none!important;
    display:none!important;
  }

  .messaging-page .scheduled-message-table th:nth-child(1),
  .messaging-page .scheduled-message-table td:nth-child(1){width:175px!important;min-width:175px!important;max-width:175px!important}
  .messaging-page .scheduled-message-table th:nth-child(2),
  .messaging-page .scheduled-message-table td:nth-child(2){width:185px!important;min-width:185px!important;max-width:185px!important}
  .messaging-page .scheduled-message-table th:nth-child(3),
  .messaging-page .scheduled-message-table td:nth-child(3){width:105px!important;min-width:105px!important;max-width:105px!important}
  .messaging-page .scheduled-message-table th:nth-child(4),
  .messaging-page .scheduled-message-table td:nth-child(4){width:125px!important;min-width:125px!important;max-width:125px!important}
  .messaging-page .scheduled-message-table th:nth-child(5),
  .messaging-page .scheduled-message-table td:nth-child(5){width:155px!important;min-width:155px!important;max-width:155px!important}
  .messaging-page .scheduled-message-table th:nth-child(6),
  .messaging-page .scheduled-message-table td:nth-child(6){width:195px!important;min-width:195px!important;max-width:195px!important}
  .messaging-page .scheduled-message-table th:nth-child(7),
  .messaging-page .scheduled-message-table td:nth-child(7){width:350px!important;min-width:350px!important;max-width:350px!important}
  .messaging-page .scheduled-message-table th:nth-child(8),
  .messaging-page .scheduled-message-table td:nth-child(8){width:110px!important;min-width:110px!important;max-width:110px!important}
  .messaging-page .scheduled-message-table th:nth-child(9),
  .messaging-page .scheduled-message-table td:nth-child(9){width:95px!important;min-width:95px!important;max-width:95px!important}
  .messaging-page .scheduled-message-table th:nth-child(10),
  .messaging-page .scheduled-message-table td:nth-child(10){width:125px!important;min-width:125px!important;max-width:125px!important}

  .messaging-page .scheduled-message-table .msg-copy-line{
    display:flex!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    gap:.3rem!important;
  }

  .messaging-page .scheduled-message-table .msg-nowrap,
  .messaging-page .scheduled-message-table .msg-copy-line .msg-nowrap,
  .messaging-page .scheduled-message-table .msg-copy-line code,
  .messaging-page .scheduled-message-table .msg-event-link{
    white-space:nowrap!important;
    overflow:visible!important;
    text-overflow:clip!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
  }

  .messaging-page .scheduled-message-table td:nth-child(7),
  .messaging-page .scheduled-message-table .msg-message-cell,
  .messaging-page .scheduled-message-table .msg-message-text{
    white-space:normal!important;
    overflow-wrap:break-word!important;
    word-break:normal!important;
  }

  .messaging-page .scheduled-message-table .msg-message-text{
    display:block!important;
    max-height:none!important;
    overflow:visible!important;
    -webkit-line-clamp:unset!important;
    line-clamp:unset!important;
  }

  .messaging-page .scheduled-message-table th:nth-child(8),
  .messaging-page .scheduled-message-table th:nth-child(9),
  .messaging-page .scheduled-message-table th:nth-child(10),
  .messaging-page .scheduled-message-table td:nth-child(8),
  .messaging-page .scheduled-message-table td:nth-child(9),
  .messaging-page .scheduled-message-table td:nth-child(10){
    text-align:center!important;
  }

  .messaging-page .scheduled-message-table .msg-actions-cell{
    position:static!important;
    background:#fff!important;
    box-shadow:none!important;
    overflow:visible!important;
  }

  .messaging-page .scheduled-message-table .msg-action-menu,
  .messaging-page .scheduled-message-table .msg-action-trigger{
    width:100%!important;
    max-width:none!important;
  }

  .messaging-page .scheduled-message-table .msg-action-dropdown{
    position:static!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin-top:.35rem;
  }

  .messaging-page .message-template-table{
    display:table!important;
    width:820px!important;
    min-width:820px!important;
    max-width:none!important;
    table-layout:fixed!important;
    border-collapse:separate!important;
    border-spacing:0!important;
  }

  .messaging-page .message-template-table thead{
    display:table-header-group!important;
    position:static!important;
    width:auto!important;
    height:auto!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    clip:auto!important;
    clip-path:none!important;
    white-space:normal!important;
  }

  .messaging-page .message-template-table tbody{display:table-row-group!important}
  .messaging-page .message-template-table tr{display:table-row!important}

  .messaging-page .message-template-table th,
  .messaging-page .message-template-table td{
    display:table-cell!important;
    box-sizing:border-box!important;
    padding:.68rem .62rem!important;
    border-bottom:1px solid #e2ebe7!important;
    vertical-align:middle!important;
    white-space:nowrap!important;
    overflow:visible!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
  }

  .messaging-page .message-template-table tbody td::before{
    content:none!important;
    display:none!important;
  }

  .messaging-page .message-template-table th:nth-child(1),
  .messaging-page .message-template-table td:nth-child(1){width:150px!important;min-width:150px!important;max-width:150px!important}
  .messaging-page .message-template-table th:nth-child(2),
  .messaging-page .message-template-table td:nth-child(2){width:245px!important;min-width:245px!important;max-width:245px!important}
  .messaging-page .message-template-table th:nth-child(3),
  .messaging-page .message-template-table td:nth-child(3){width:105px!important;min-width:105px!important;max-width:105px!important}
  .messaging-page .message-template-table th:nth-child(4),
  .messaging-page .message-template-table td:nth-child(4){width:105px!important;min-width:105px!important;max-width:105px!important}
  .messaging-page .message-template-table th:nth-child(5),
  .messaging-page .message-template-table td:nth-child(5){width:105px!important;min-width:105px!important;max-width:105px!important}
  .messaging-page .message-template-table th:nth-child(6),
  .messaging-page .message-template-table td:nth-child(6){width:110px!important;min-width:110px!important;max-width:110px!important}
}


/* ===== Sidebar main menu / submenu visual separation (2026-08-05) ===== */
.sidebar .nav-dashboard,
.sidebar .nav-group-toggle{
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.08);
  color:#f4fff9;
  font-weight:700;
}
.sidebar .nav-dashboard:hover,
.sidebar .nav-group-toggle:hover{
  background:rgba(255,255,255,.16);
  border-color:rgba(255,255,255,.14);
  color:#fff;
}
.sidebar .nav-dashboard.active,
.sidebar .nav-group.active>.nav-group-toggle{
  background:linear-gradient(135deg,#19a673,#14865f);
  border-color:rgba(255,255,255,.14);
  color:#fff;
}
.sidebar .nav-submenu{
  margin:.18rem .28rem .42rem .52rem;
  padding:.28rem .28rem .34rem .62rem;
  background:rgba(2,31,22,.30);
  border-left:3px solid rgba(151,232,198,.48);
  border-radius:0 9px 9px 0;
}
.sidebar .nav-submenu .navlink{
  color:#cbe3d8;
  font-weight:500;
}
.sidebar .nav-submenu .navlink:hover{
  background:rgba(255,255,255,.08);
  color:#fff;
}
.sidebar .nav-submenu .navlink.active{
  color:#fff;
}
@media(min-width:981px){
  .sidebar-compact .nav-submenu{
    margin:.12rem 0 .3rem;
    padding:.15rem 0 .25rem;
    border-left:0;
    border-radius:8px;
  }
}

/* ===== Phase 4: Customers mobile-first list (desktop unchanged) ===== */
.customer-import-mode-field small{display:block;margin-top:.25rem;line-height:1.4}

@media(max-width:760px){
  .party-master-card{padding:.78rem}
  .party-master-card>.card-head{align-items:stretch;gap:.75rem}
  .party-master-card>.card-head,.party-master-card>.card-head .row-actions{display:grid;grid-template-columns:1fr}
  .party-master-card>.card-head .row-actions .btn{width:100%;justify-content:center}
  .party-master-filter{display:grid;grid-template-columns:1fr;gap:.55rem}
  .party-master-filter input,.party-master-filter select,.party-master-filter .btn{width:100%;min-width:0}

  .party-master-scroll{overflow:visible;border:0;background:transparent}
  .customer-master-table{display:block;width:100%;min-width:0;border:0;background:transparent}
  .customer-master-table thead{display:none}
  .customer-master-table tbody{display:grid;gap:.72rem;width:100%}
  .customer-master-table tbody tr{display:grid;grid-template-columns:1fr 1fr;gap:0;width:100%;overflow:visible;border:1px solid var(--line,#dce7e2);border-radius:14px;background:#fff;box-shadow:0 3px 10px rgba(20,55,43,.05)}
  .customer-master-table tbody tr>td{display:grid;grid-template-columns:minmax(94px,.8fr) minmax(0,1.2fr);align-items:start;gap:.55rem;width:auto!important;min-width:0!important;padding:.62rem .72rem!important;border:0!important;border-bottom:1px solid #edf2ef!important;text-align:left!important;white-space:normal!important;overflow:visible!important}
  .customer-master-table tbody tr>td::before{content:attr(data-label);min-width:0;color:var(--muted,#687a72);font-size:.7rem;font-weight:750;line-height:1.25;text-transform:none}
  .customer-master-table tbody tr>td.party-sticky-name{grid-column:1/-1;position:static!important;display:block;padding:.78rem .82rem!important;background:#f8fbfa!important;border-radius:14px 14px 0 0;box-shadow:none!important}
  .customer-master-table tbody tr>td.party-sticky-name::before{display:none}
  .customer-master-table tbody tr>td.party-sticky-name strong{font-size:.96rem}
  .customer-master-table tbody tr>td.customer-type-cell{grid-column:1/-1}
  .customer-master-table tbody tr>td:nth-last-child(2){grid-column:1/-1}
  .customer-master-table tbody tr>td.party-action-cell{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;border-bottom:0!important;padding:.7rem .82rem!important}
  .customer-master-table tbody tr>td.party-action-cell::before{content:attr(data-label);font-size:.7rem;font-weight:750;color:var(--muted,#687a72)}
  .customer-master-table .party-action-dropdown{margin-left:auto;position:relative;z-index:5}
  .customer-master-table .party-action-trigger{min-width:108px;justify-content:center}
  .customer-master-table .party-action-menu{right:0;left:auto;width:min(250px,calc(100vw - 34px));min-width:0}
  .customer-master-table td.num strong,.customer-master-table td.num .badge{justify-self:start}
  .customer-master-table .customer-type-badges{justify-content:flex-start}
}

@media(max-width:520px){
  .customer-master-table tbody tr{grid-template-columns:1fr}
  .customer-master-table tbody tr>td,.customer-master-table tbody tr>td.customer-type-cell,.customer-master-table tbody tr>td:nth-last-child(2),.customer-master-table tbody tr>td.party-action-cell{grid-column:1/-1}
  .customer-master-table tbody tr>td{grid-template-columns:minmax(88px,.72fr) minmax(0,1.28fr)}
}
.customer-mobile-address{display:none}
@media(max-width:760px){
  .customer-master-table .customer-mobile-address{display:block;min-width:0;overflow-wrap:anywhere}
}

/* =========================================================
   Customers: count-per-classification summary cards
   ========================================================= */
.customer-type-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.7rem;
  margin:0 0 .9rem;
}
.customer-type-summary-card{
  display:flex;
  flex-direction:column;
  gap:.25rem;
  padding:.7rem .85rem;
  border:1px solid var(--line,#dce7e2);
  border-radius:12px;
  background:#fff;
  box-shadow:0 4px 14px rgba(18,70,54,.045);
  text-decoration:none;
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease;
}
.customer-type-summary-card:hover,
.customer-type-summary-card:focus{
  border-color:#8cc0ac;
  box-shadow:0 6px 18px rgba(18,70,54,.09);
  transform:translateY(-1px);
  outline:none;
}
.customer-type-summary-card.is-active{
  border-color:var(--brand,#0e6b4e);
  box-shadow:0 0 0 2px rgba(14,107,78,.13),0 6px 18px rgba(18,70,54,.09);
}
.customer-type-summary-label{
  color:var(--muted,#5f726b);
  font-size:.7rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.03em;
  line-height:1.25;
}
.customer-type-summary-value{
  color:var(--tea-deep,#0d5b46);
  font-size:1.45rem;
  font-weight:900;
  line-height:1;
}
@media(max-width:760px){
  .customer-type-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem;margin-bottom:.75rem}
  .customer-type-summary-card{padding:.6rem .7rem}
  .customer-type-summary-value{font-size:1.2rem}
}

/* =========================================================
   Purchases: responsive header (hero + workflow strip)
   The hero previously kept its desktop side-by-side layout until 760px and
   the 5-step workflow strip overflowed on phones and small tablets.
   ========================================================= */
@media(max-width:1100px){
  .purchase-hero{
    align-items:flex-start;
    flex-direction:column;
    gap:.9rem;
    padding:1.15rem 1.2rem;
  }
  .purchase-hero>div:first-child{width:100%}
  .purchase-hero p{max-width:none}
  .purchase-hero-actions{width:100%}
  .purchase-hero::after{right:-6%;font-size:6.5rem}
}
@media(max-width:760px){
  .purchase-hero{padding:1rem;border-radius:15px}
  .purchase-hero h1{font-size:1.3rem;line-height:1.25}
  .purchase-hero p{font-size:.82rem;line-height:1.45;margin-top:.3rem}
  /* Decorative leaf steals horizontal room on a phone. */
  .purchase-hero::after{display:none}
  /* Actions become full-width stacked buttons instead of wrapping awkwardly. */
  .purchase-hero-actions{
    display:grid;
    grid-template-columns:1fr;
    gap:.45rem;
  }
  .purchase-hero-actions>*{width:100%}
  .purchase-hero-actions .btn{
    width:100%;
    justify-content:center;
  }
  /* Workflow strip: wraps onto as many rows as needed, no sideways scroll. */
  .purchase-hero .purchase-workflow:not(.compact),
  .purchase-page>.purchase-workflow{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.4rem;
    overflow-x:visible;
    padding:.5rem;
  }
  .purchase-hero .purchase-workflow:not(.compact)>span,
  .purchase-page>.purchase-workflow>span{
    min-width:0;
    padding:.45rem .5rem;
    grid-template-columns:26px 1fr;
    column-gap:.45rem;
  }
  .purchase-hero .purchase-workflow:not(.compact)>span i,
  .purchase-page>.purchase-workflow>span i{width:25px;height:25px;font-size:.78rem}
  .purchase-hero .purchase-workflow:not(.compact)>span strong,
  .purchase-page>.purchase-workflow>span strong{font-size:.74rem;line-height:1.2}
  .purchase-hero .purchase-workflow:not(.compact)>span small,
  .purchase-page>.purchase-workflow>span small{font-size:.63rem;line-height:1.2}
  /* The "→" separators are meaningless once the steps wrap into a grid. */
  .purchase-hero .purchase-workflow:not(.compact)>b,
  .purchase-page>.purchase-workflow>b{display:none}
}
@media(max-width:420px){
  .purchase-hero .purchase-workflow:not(.compact),
  .purchase-page>.purchase-workflow{grid-template-columns:1fr}
}

/* =========================================================
   Purchases header on desktop / laptop (above the stacking breakpoint)
   The hero was vertically centred with a narrow auto-width action column,
   so the three buttons wrapped onto two rows and left a large empty band
   to their right and below them.
   ========================================================= */
@media(min-width:1101px){
  .purchase-hero{
    align-items:flex-start;
    gap:1.5rem;
  }
  .purchase-hero>div:first-child{
    display:flex;
    flex-direction:column;
    gap:.75rem;
  }
  .purchase-hero>div:first-child>p{margin-bottom:0}
  /* Actions: one row, pinned top-right, never wrapping. */
  .purchase-hero-actions{
    flex:0 0 auto;
    flex-wrap:nowrap;
    align-self:flex-start;
    align-items:flex-start;
    padding-top:.2rem;
  }
  .purchase-hero-actions .btn{white-space:nowrap}
  /* The workflow strip now spans the full width of the text column, so the
     five steps share the space instead of bunching up on the left. */
  .purchase-hero .purchase-workflow{
    width:100%;
    margin-top:.15rem;
  }
  .purchase-hero .purchase-workflow>span{
    flex:1 1 0;
    min-width:0;
    justify-content:flex-start;
  }
  .purchase-hero .purchase-workflow>span strong{
    white-space:normal;
    overflow-wrap:anywhere;
  }
  /* The decorative leaf overlapped the action buttons at this width. */
  .purchase-hero::after{right:34%}
}

