/* =========================================================
   نظام المشتريات — واجهة بأسلوب Odoo
   ========================================================= */
:root{
  /* الهوية */
  --brand:#714B67;           /* بنفسجي Odoo */
  --brand-hover:#5e3e56;
  --brand-soft:#f5eff4;
  --brand-soft-2:#ece1ea;
  --brand-line:#d6c3d1;
  --action:#017E84;          /* الأزرق المخضر للروابط والحالات */
  --action-hover:#01666b;
  --action-soft:#e3f1f2;

  /* الأسطح والنصوص */
  --bg:#f2f3f5;
  --surface:#ffffff;
  --surface-2:#f8f9fa;
  --surface-3:#eceef1;
  --line:#dee2e6;
  --line-2:#eceef1;
  --ink:#1f2937;
  --ink-2:#4b5563;
  --ink-3:#6b7280;
  --ink-4:#9ca3af;

  /* الحالات */
  --success:#146c43; --success-soft:#d1e7dd; --success-line:#a3cfbb;
  --warning:#7a5200; --warning-soft:#fff3cd; --warning-line:#ffe08a;
  --danger:#a52834;  --danger-soft:#f8d7da;  --danger-line:#f1aeb5;
  --info:#055160;    --info-soft:#d7f3f9;    --info-line:#9eeaf9;
  --neutral:#495057; --neutral-soft:#e9ecef;

  --nav-h:46px;
  --radius:4px;
  --shadow-sm:0 1px 2px rgba(16,24,40,.05);
  --shadow-pop:0 10px 28px rgba(16,24,40,.16);
  --font:"IBM Plex Sans Arabic","Segoe UI",Tahoma,system-ui,sans-serif;
  --mono:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;
}

*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--font);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
[hidden]{display:none!important}
:focus-visible{outline:2px solid var(--action);outline-offset:1px}
.sprite{position:absolute;width:0;height:0;overflow:hidden}
.i{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}
.o-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.o-muted{color:var(--ink-3)}
.o-sku{direction:ltr;unicode-bidi:isolate;font-family:var(--mono);font-size:11.5px;letter-spacing:-.01em}

/* ---------- الأزرار ---------- */
.o-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;padding:0 12px;border:1px solid transparent;border-radius:var(--radius);font-size:13.5px;font-weight:500;line-height:1;white-space:nowrap;text-decoration:none;transition:background-color .15s,border-color .15s,color .15s}
.o-btn .i{width:15px;height:15px}
.o-btn-primary{background:var(--brand);border-color:var(--brand);color:#fff}
.o-btn-primary:hover{background:var(--brand-hover);border-color:var(--brand-hover)}
.o-btn-secondary{background:var(--surface-3);border-color:var(--surface-3);color:var(--ink)}
.o-btn-secondary:hover{background:#dfe2e6;border-color:#dfe2e6}
.o-btn.o-btn-link{background:transparent;color:var(--action);padding:0 8px}
.o-btn.o-btn-link:hover{color:var(--action-hover);background:var(--action-soft)}
.o-btn-sm{height:28px;padding:0 10px;font-size:13px}
.o-btn-lg{height:42px;padding:0 22px;font-size:15px}
.o-btn-link{border:0;background:none;padding:2px 4px;color:var(--action);font-size:13px;font-weight:500}
.o-btn-link:hover{color:var(--action-hover);text-decoration:underline}
.o-btn-link.danger{color:var(--danger)}
.o-btn-icon{display:inline-grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:var(--radius);background:transparent;color:var(--ink-2);transition:background-color .15s,color .15s;list-style:none}
.o-btn-icon:hover{background:var(--surface-3);color:var(--ink)}
.o-btn-icon::-webkit-details-marker{display:none}

/* ---------- الشريط الرئيسي ---------- */
#app{min-height:100%;display:flex;flex-direction:column}
.o-navbar{position:sticky;top:0;z-index:30;flex:none;height:var(--nav-h);display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 10px;background:var(--brand);color:#fff}
.o-nav-start,.o-nav-end{display:flex;align-items:center;gap:2px;min-width:0;height:100%}
.o-app-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:6px;background:rgba(255,255,255,.14);flex:none}
.o-app-icon .i{width:19px;height:19px;stroke-width:1.7}
.o-app-name{padding:0 10px 0 14px;font-size:15.5px;font-weight:600;white-space:nowrap}
.o-menu{display:flex;align-items:stretch;height:100%}
.o-menu-item{display:inline-flex;align-items:center;gap:6px;height:100%;padding:0 12px;border:0;background:transparent;color:rgba(255,255,255,.88);font-size:13.5px;white-space:nowrap;transition:background-color .15s}
.o-menu-item:hover{background:rgba(0,0,0,.14);color:#fff}
.o-menu-item.active{background:rgba(0,0,0,.18);color:#fff;font-weight:600}
.o-menu-item:focus-visible,.o-nav-btn:focus-visible{outline-color:#fff;outline-offset:-3px}
.o-counter{display:inline-grid;place-items:center;min-width:19px;height:19px;padding:0 5px;border-radius:10px;background:rgba(255,255,255,.22);font-size:11px;font-weight:600;font-variant-numeric:tabular-nums}
.o-source{max-width:360px;padding-inline-end:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:rgba(255,255,255,.8)}
.o-nav-btn{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 11px;border:1px solid rgba(255,255,255,.38);border-radius:var(--radius);font-size:13px;font-weight:500;white-space:nowrap;cursor:pointer;transition:background-color .15s}
.o-nav-btn:hover{background:rgba(255,255,255,.12)}
.o-company{display:inline-flex;align-items:center;gap:7px;padding-inline-start:12px;font-size:13px;white-space:nowrap}
.o-avatar{display:grid;place-items:center;width:26px;height:26px;border-radius:var(--radius);background:#fff;color:var(--brand);font-weight:700;font-size:13px}

/* ---------- شاشة البداية ---------- */
.o-nocontent{flex:1;display:grid;place-items:center;padding:32px 16px;background:var(--surface);overflow:auto}
.o-drop{width:100%;max-width:580px;padding:36px 28px;text-align:center;border:2px dashed transparent;border-radius:8px;transition:border-color .2s,background-color .2s}
.o-drop.over{border-color:var(--action);background:var(--action-soft)}
.o-nocontent-art{color:var(--ink-4);margin-bottom:10px}
.o-drop h2{margin:0 0 8px;font-size:21px;font-weight:600}
.o-drop p{margin:0 0 12px;color:var(--ink-2)}
.o-sheets{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:0 0 22px;padding:0;list-style:none}
.o-sheets li{padding:2px 10px;border-radius:12px;background:var(--surface-3);color:var(--ink-2);font-size:12.5px;font-weight:500}
.o-hint{margin:18px 0 0!important;font-size:12px;color:var(--ink-3)!important}

/* ---------- الهيكل ---------- */
.o-action{display:grid;grid-template-columns:minmax(0,1fr) 440px;align-items:stretch}
.o-catalog{display:flex;flex-direction:column;min-width:0;background:var(--surface);scroll-margin-top:var(--nav-h)}
.o-content{position:relative;flex:1;min-height:0;background:var(--surface)}
.o-content.is-kanban{background:var(--bg)}

/* ---------- لوحة التحكم (Control Panel) ---------- */
.o-cp{position:relative;z-index:12;flex:none;display:grid;grid-template-columns:auto minmax(240px,1fr) auto;align-items:center;gap:8px 16px;min-height:56px;padding:10px 16px;background:var(--surface);border-bottom:1px solid var(--line)}
.o-cp-start{display:flex;align-items:center;gap:6px;min-width:0}
.o-cp-end{display:flex;align-items:center;gap:12px;justify-self:end}
.o-breadcrumb{display:flex;align-items:center;gap:6px;min-width:0;margin:0;padding:0;list-style:none;font-size:17px;line-height:1.3}
.o-breadcrumb li{white-space:nowrap}
.o-breadcrumb li+li::before{content:"/";margin-inline-end:6px;color:var(--ink-4)}
.o-breadcrumb .active{min-width:0;overflow:hidden;text-overflow:ellipsis;font-weight:600}
.o-bc-link{padding:0;border:0;background:none;color:var(--action);font:inherit}
.o-bc-link:hover{text-decoration:underline}

/* البحث مع الـ facets */
.o-cp-search{position:relative;justify-self:center;width:100%;max-width:660px;min-width:0}
.o-searchview{display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-height:34px;padding:2px 10px 2px 2px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);cursor:text;transition:border-color .15s}
.o-searchview:focus-within{border-color:var(--action)}
.o-search-ico{color:var(--ink-3);margin-inline-end:2px}
.o-facets{display:contents}
.o-facet{display:inline-flex;align-items:stretch;max-width:100%;height:24px;border-radius:3px;background:var(--surface-3);font-size:12.5px;overflow:hidden}
.o-facet-ico{display:grid;place-items:center;padding:0 6px;background:var(--brand);color:#fff}
.o-facet-ico .i{width:12px;height:12px}
.o-facet.group .o-facet-ico{background:var(--action)}
.o-facet-val{display:flex;align-items:center;gap:4px;padding:0 7px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.o-facet-val b{font-weight:600}
.o-facet-x{display:grid;place-items:center;width:22px;padding:0;border:0;background:transparent;color:var(--ink-3)}
.o-facet-x:hover{color:var(--danger);background:#e2e5e9}
.o-facet-x .i{width:12px;height:12px}
#fSearch{flex:1 1 140px;min-width:100px;height:28px;padding:0 2px;border:0;outline:none;background:transparent;font-size:13.5px}
#fSearch::placeholder{color:var(--ink-4)}
.o-search-toggle{display:grid;place-items:center;width:30px;height:28px;margin-inline-start:auto;padding:0;border:0;border-inline-start:1px solid var(--line);background:transparent;color:var(--ink-2)}
.o-search-toggle:hover,.o-search-toggle[aria-expanded="true"]{color:var(--brand)}
.o-search-toggle .i{transition:transform .15s}
.o-search-toggle[aria-expanded="true"] .i{transform:rotate(180deg)}

.o-search-panel{position:absolute;top:calc(100% + 4px);inset-inline:0;z-index:40;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:8px 0;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-pop)}
.o-sp-col{min-width:0;padding:2px 0;border-inline-start:1px solid var(--line-2)}
.o-sp-col:first-child{border-inline-start:0}
.o-sp-col h4{display:flex;align-items:center;gap:8px;margin:0 0 4px;padding:6px 16px;font-size:13.5px;font-weight:600}
.c-filter{color:var(--brand)} .c-group{color:var(--action)} .c-sort{color:#b26a00}
.o-sp-col hr{margin:6px 16px;border:0;border-top:1px solid var(--line-2)}
.o-sp-item{position:relative;display:block;width:100%;padding:5px 16px;padding-inline-start:34px;border:0;background:none;text-align:start;font-size:13px;color:var(--ink);transition:background-color .1s}
.o-sp-item:hover{background:var(--surface-2)}
.o-sp-item .o-check{position:absolute;top:50%;inset-inline-start:13px;width:14px;height:14px;margin-top:-7px;color:var(--action);stroke-width:2.6;visibility:hidden}
.o-sp-item.on{font-weight:600}
.o-sp-item.on .o-check{visibility:visible}
.o-sp-select{display:flex;align-items:center;gap:8px;padding:4px 16px;font-size:13px;color:var(--ink-2)}
.o-sp-select select{flex:1;min-width:0;height:30px;padding:0 6px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);font-size:13px}

/* الترقيم وتبديل العرض */
.o-pager{display:flex;align-items:center;gap:3px;font-size:13px;color:var(--ink-2);white-space:nowrap;font-variant-numeric:tabular-nums}
.o-pager-value{padding-inline-end:6px}
.o-pager-value b{font-weight:500;color:var(--ink)}
.o-pager button{display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;border-radius:var(--radius);background:var(--surface-3);color:var(--ink)}
.o-pager button:hover:not(:disabled){background:#dfe2e6}
.o-pager button:disabled{opacity:.4;cursor:default}
.o-switch-view{display:flex;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.o-switch-view button{display:grid;place-items:center;width:34px;height:30px;padding:0;border:0;background:var(--surface);color:var(--ink-3)}
.o-switch-view button+button{border-inline-start:1px solid var(--line)}
.o-switch-view button:hover{color:var(--ink)}
.o-switch-view button[aria-pressed="true"]{background:var(--action-soft);color:var(--action)}

/* القوائم المنسدلة */
.o-dropdown{position:relative}
.o-dropdown>summary{list-style:none}
.o-dropdown>summary::-webkit-details-marker{display:none}
.o-dropdown[open]>summary{background:var(--surface-3);color:var(--ink)}
.o-dropdown-menu{position:absolute;top:calc(100% + 4px);inset-inline-start:0;z-index:40;width:310px;padding:6px 0;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-pop)}
.o-dropdown-note{margin:2px 14px 6px;font-size:12px;color:var(--ink-3)}
.o-dropdown-menu button{display:block;width:100%;padding:7px 14px;border:0;background:none;text-align:start}
.o-dropdown-menu button:hover{background:var(--surface-2)}
.o-dropdown-menu b{display:block;font-size:13.5px;font-weight:500}
.o-dropdown-menu small{display:block;font-size:12px;color:var(--ink-3)}
.o-dropdown-menu .danger b{color:var(--danger)}
.o-dropdown-menu hr{margin:4px 0;border:0;border-top:1px solid var(--line-2)}

/* ---------- لوحة المؤشرات (Dashboard) ---------- */
.o-dashboard{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:1px;background:var(--line-2);border-bottom:1px solid var(--line)}
.o-tile{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:1px;min-width:0;padding:10px 16px;border:0;background:var(--surface);text-align:start;transition:background-color .15s}
.o-tile:hover{background:var(--surface-2)}
.o-tile b{font-size:21px;font-weight:600;line-height:1.25;font-variant-numeric:tabular-nums;color:var(--ink)}
.o-tile span{font-size:12px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.o-tile.t-A b{color:var(--success)} .o-tile.t-B b{color:#9a6700} .o-tile.t-out b{color:var(--danger)} .o-tile.t-order b{color:var(--brand)} .o-tile.t-chg b{color:var(--action)}
.o-tile.on{background:var(--brand-soft)}
.o-tile.on::after{content:"";position:absolute;inset-inline:0;bottom:0;height:2px;background:var(--brand)}

/* ---------- عرض القائمة (List view) ---------- */
.o-list{width:100%;border-collapse:separate;border-spacing:0;font-size:13px;background:var(--surface)}
.o-list th,.o-list td{padding:6px 8px;text-align:start;vertical-align:middle;border-bottom:1px solid var(--line-2)}
.o-list thead th{position:sticky;top:var(--sticky-top,0);z-index:2;height:38px;background:var(--surface);border-bottom:1px solid var(--line);font-weight:600;color:var(--ink);white-space:nowrap}
.o-list .c-num{text-align:end;white-space:nowrap;font-variant-numeric:tabular-nums}
.o-list tbody tr:hover>td,.o-list tbody tr:hover>th{background:var(--surface-2)}
.o-catalog-list th:first-child,.o-catalog-list td:first-child{padding-inline-start:16px}
.o-catalog-list th:last-child,.o-catalog-list td:last-child{padding-inline-end:16px}
.o-th-sub{font-weight:400;color:var(--ink-3);font-size:11.5px}
.o-sort{display:inline-flex;align-items:center;gap:4px;padding:0;border:0;background:none;font:inherit;color:inherit}
.o-sort .i{width:13px;height:13px;opacity:0;color:var(--ink-3);transition:opacity .15s}
th:hover .o-sort .i,.o-sort:focus-visible .i{opacity:.7}
th[aria-sort] .o-sort .i{opacity:1;color:var(--ink)}

.c-img{width:52px}
.c-grade{width:100px}
.c-avail{width:120px}
.c-qty{width:1%;white-space:nowrap}
.c-cost{font-weight:600}
.c-cost small{display:block;font-size:11.5px;font-weight:400;color:var(--ink-3)}
.o-row.in-order>td{background:var(--brand-soft)}
.o-row.in-order:hover>td{background:var(--brand-soft-2)}
.o-row.in-order>td:first-child{box-shadow:inset -3px 0 0 var(--brand)}
.o-thumb{display:grid;place-items:center;width:38px;height:38px;border:1px solid var(--line-2);border-radius:var(--radius);background:#fff;object-fit:contain;cursor:zoom-in;color:var(--ink-4)}
.o-thumb.noimg{background:var(--surface-2)}
.o-thumb .i{width:18px;height:18px;stroke-width:1.5}
.o-name{display:block;max-width:100%;padding:0;border:0;background:none;text-align:start;font:inherit;font-weight:500;line-height:1.4;color:var(--ink)}
.o-name:hover{color:var(--action);text-decoration:underline}
.o-sub{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;margin-top:2px;font-size:12px;color:var(--ink-3)}
.o-sub .o-dot{color:var(--ink-4)}
.o-tag{display:inline-flex;align-items:center;height:18px;padding:0 7px;border-radius:9px;background:var(--surface-3);color:var(--ink-2);font-size:11px;font-weight:500;white-space:nowrap}
.o-tag.first{background:var(--brand-soft-2);color:var(--brand)}
.o-tag.ondemand{background:var(--danger-soft);color:var(--danger)}

.o-badge{display:inline-flex;align-items:center;gap:5px;height:20px;padding:0 8px;border-radius:10px;font-size:11.5px;font-weight:500;white-space:nowrap;background:var(--neutral-soft);color:var(--neutral)}
.o-badge.dot::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}
.a-in{background:var(--success-soft);color:var(--success)}
.a-partial{background:var(--warning-soft);color:var(--warning)}
.a-out{background:var(--danger-soft);color:var(--danger)}
.a-unknown{background:var(--neutral-soft);color:var(--ink-3)}
.st-0{background:var(--neutral-soft);color:var(--neutral)}
.st-1{background:var(--info-soft);color:var(--info)}
.st-2{background:var(--success-soft);color:var(--success)}
.st-3{background:var(--danger-soft);color:var(--danger)}
.st-cur{background:var(--brand-soft-2);color:var(--brand)}

.o-grade{display:inline-flex;align-items:baseline;gap:4px;height:22px;padding:0 7px;border-radius:var(--radius);font-size:13px;font-weight:700;line-height:22px;white-space:nowrap}
.o-grade small{font-size:11px;font-weight:500;opacity:.85;font-variant-numeric:tabular-nums}
.g-A{background:var(--success-soft);color:var(--success)}
.g-B{background:var(--warning-soft);color:var(--warning)}
.g-C{background:var(--neutral-soft);color:var(--neutral)}
.g-{background:var(--surface-2);color:var(--ink-4)}
.o-grade-wrap{display:inline-flex;align-items:center;gap:3px;white-space:nowrap}
.o-gchg{display:inline-grid;place-items:center;width:16px;height:16px;border-radius:50%}
.o-gchg .i{width:12px;height:12px;stroke-width:3}
.o-gchg.up{background:var(--success-soft);color:var(--success)}
.o-gchg.down{background:var(--danger-soft);color:var(--danger)}
.o-tag.market{background:var(--action-soft);color:var(--action);font-variant-numeric:tabular-nums}
.o-trend{display:inline-block;padding:0 6px;border-radius:9px;font-size:11.5px;font-weight:600;line-height:18px;font-variant-numeric:tabular-nums;white-space:nowrap}
.o-trend.up{background:var(--success-soft);color:var(--success)}
.o-trend.down{background:var(--danger-soft);color:var(--danger)}
.o-trend.flat{color:var(--ink-3)}

/* عدّاد الكمية */
.o-qty{display:flex;align-items:center;gap:8px}
.o-step{display:inline-flex;align-items:stretch;height:28px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);overflow:hidden;flex:none}
.o-step button{display:grid;place-items:center;width:27px;padding:0;border:0;background:transparent;color:var(--ink-2);transition:background-color .1s}
.o-step button:hover{background:var(--surface-3);color:var(--ink)}
.o-step button:active{background:#dfe2e6}
.o-step .i{width:13px;height:13px;stroke-width:2.4}
.o-step input{width:44px;padding:0;border:0;border-inline:1px solid var(--line-2);background:transparent;text-align:center;font-size:13px;font-weight:600;font-variant-numeric:tabular-nums;-moz-appearance:textfield;appearance:textfield}
.o-step input::-webkit-outer-spin-button,.o-step input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.o-step input:focus{outline:none;background:var(--action-soft)}
.o-step:focus-within{border-color:var(--action)}
.in-order .o-step{border-color:var(--brand-line)}
.in-order .o-step input{color:var(--brand)}
.o-sugg{padding:0;border:0;background:none;font-size:12px;color:var(--action);white-space:nowrap}
.o-sugg:hover{text-decoration:underline}

/* صفوف التجميع */
.o-group-row>th,.o-group-row>td{background:var(--surface-2);border-bottom:1px solid var(--line);cursor:pointer}
.o-group-row:hover>th,.o-group-row:hover>td{background:var(--surface-3)!important}
.o-group-btn,.o-kgroup-head{display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:none;font:inherit;font-weight:600;color:var(--ink);text-align:start}
.o-caret{width:14px;height:14px;color:var(--ink-3);transition:transform .15s}
.open>th .o-caret,.o-kgroup.open .o-caret{transform:rotate(-90deg)}
.o-group-count{font-weight:400;color:var(--ink-3)}
.o-group-agg{font-weight:500;color:var(--ink-2);font-size:12.5px}
.o-group-agg b{color:var(--brand)}

/* لا توجد نتائج */
.o-empty-list{padding:56px 16px;text-align:center;color:var(--ink-2)}
.o-empty-list h3{margin:8px 0 4px;font-size:16px;color:var(--ink)}
.o-empty-list p{margin:0 0 14px}
.o-empty-ico{width:40px;height:40px;color:var(--ink-4);stroke-width:1.5}

/* ---------- عرض البطاقات (Kanban) ---------- */
.o-kanban{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:8px;padding:12px 16px}
.o-card{display:grid;grid-template-columns:64px minmax(0,1fr);gap:12px;padding:10px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);transition:border-color .15s,box-shadow .15s}
.o-card:hover{box-shadow:0 2px 8px rgba(16,24,40,.08)}
.o-card.in-order{border-color:var(--brand-line);box-shadow:inset -3px 0 0 var(--brand)}
.o-card .o-thumb{width:64px;height:64px}
.o-card .o-thumb .i{width:26px;height:26px}
.o-card-body{display:flex;flex-direction:column;gap:4px;min-width:0}
.o-card .o-name{font-weight:600;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.o-card-meta{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;margin-top:2px}
.o-rank{font-size:12px;color:var(--ink-3);font-variant-numeric:tabular-nums}
.o-card-foot{display:flex;align-items:flex-end;justify-content:space-between;gap:8px;margin-top:auto;padding-top:6px}
.o-price{flex:none;font-size:15px;font-weight:600;line-height:1.2;white-space:nowrap;font-variant-numeric:tabular-nums}
.o-price small{font-size:11.5px;font-weight:500;color:var(--ink-3)}
.o-price span{display:block;font-size:11.5px;font-weight:400;color:var(--ink-3)}
.o-kgroup{border-bottom:1px solid var(--line)}
.o-kgroup-head{display:flex;width:100%;padding:11px 16px;background:var(--surface);cursor:pointer}
.o-kgroup-head:hover{background:var(--surface-2)}
.o-kgroup-head .o-group-agg{margin-inline-start:auto}
.o-kgroup .o-kanban{padding-top:10px}

/* ---------- نموذج أمر الشراء (Form view) ---------- */
.o-form{display:flex;flex-direction:column;min-width:0;background:var(--bg);border-inline-start:1px solid var(--line)}
.o-form-cp{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:56px;padding:10px 16px;background:var(--surface);border-bottom:1px solid var(--line);flex:none}
.o-form-cp .o-breadcrumb{font-size:15.5px}
.o-form-header{display:flex;flex-direction:column;gap:8px;padding:8px 16px 10px;background:var(--surface);border-bottom:1px solid var(--line);flex:none}
.o-form-buttons{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.o-form-buttons .o-btn{padding:0 9px;font-size:13px}
.o-form-buttons #btnCancel{padding:0 6px}
.o-form-buttons #btnCancel{margin-inline-start:auto}

/* شريط الحالة (Statusbar) */
.o-statusbar{display:flex;height:30px}
.o-stage{flex:1 1 0;min-width:0;display:flex;align-items:center;justify-content:center;padding:0 16px;margin-inline-start:-8px;border:0;background:var(--surface-3);color:var(--ink-2);font-size:12.5px;font-weight:500;white-space:nowrap;clip-path:polygon(100% 0,10px 0,0 50%,10px 100%,100% 100%,calc(100% - 10px) 50%);transition:background-color .15s,color .15s}
.o-stage:first-child{margin-inline-start:0;clip-path:polygon(100% 0,10px 0,0 50%,10px 100%,100% 100%);border-radius:0 var(--radius) var(--radius) 0}
.o-stage:hover:not(.current){background:#dfe2e6;color:var(--ink)}
.o-stage.current{background:var(--action);color:#fff;font-weight:600;cursor:default}
.o-stage.cancel.current{background:var(--danger)}
.o-stage:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--ink)}

.o-form-body{flex:1;min-height:0;padding:12px}
.o-alerts{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}
.o-alerts:empty{display:none}
.o-alert{display:flex;align-items:flex-start;gap:8px;padding:7px 10px;border:1px solid;border-radius:var(--radius);font-size:12.5px;line-height:1.45}
.o-alert .i{width:15px;height:15px;margin-top:1px}
.o-alert.danger{background:var(--danger-soft);border-color:var(--danger-line);color:#842029}
.o-alert.warning{background:var(--warning-soft);border-color:var(--warning-line);color:#664d03}
.o-alert.info{background:var(--info-soft);border-color:var(--info-line);color:var(--info)}

.o-sheet{position:relative;padding:16px 16px 14px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden}
.o-sheet-title{margin-bottom:12px;padding-inline-end:56px}
.o-title-label{display:block;font-size:12px;font-weight:500;color:var(--ink-3)}
.o-title-input{width:100%;padding:1px 0;border:0;border-bottom:1px solid transparent;background:transparent;font-size:22px;font-weight:600;line-height:1.3;color:var(--ink);font-variant-numeric:tabular-nums}
.o-title-input:hover{border-bottom-color:var(--line)}
.o-title-input:focus{outline:none;border-bottom-color:var(--action)}

.o-group{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:2px 18px}
.o-group>label{padding:5px 0;font-size:13px;font-weight:600;white-space:nowrap}
.o-field{min-width:0}
.o-input{width:100%;height:30px;padding:0 2px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;font-size:13.5px;color:var(--ink);transition:border-color .15s}
.o-input:hover{border-bottom-color:var(--ink-4)}
.o-input:focus{outline:none;border-bottom-color:var(--action);box-shadow:0 1px 0 var(--action)}
.o-input::placeholder{color:var(--ink-4)}
.o-input[type=number]{font-variant-numeric:tabular-nums}
.o-field-suffix{display:flex;align-items:center;gap:6px}
.o-field-suffix span{font-size:12.5px;color:var(--ink-3)}
.o-help{margin:6px 0 0;font-size:12px;color:var(--ink-3)}
.o-help:empty{display:none}

.o-budget{margin-top:12px;font-size:12.5px}
.o-budget:empty{display:none}
.b-row{display:flex;justify-content:space-between;gap:8px;margin-bottom:5px;color:var(--ink-2)}
.b-row b{color:var(--success);font-variant-numeric:tabular-nums}
.b-row b.bad{color:var(--danger)}
.o-progress{height:6px;border-radius:3px;background:var(--surface-3);overflow:hidden}
.o-progress i{display:block;height:100%;border-radius:inherit;background:var(--success);transition:width .3s}
.o-progress i.near{background:#d08700}
.o-progress i.over{background:var(--danger)}
.o-progress.thin{height:3px;margin-top:4px}
.o-progress.thin i{background:var(--action)}

/* الدفتر (Notebook) */
.o-notebook{margin-top:16px}
.o-tabs{display:flex;gap:2px;border-bottom:1px solid var(--line)}
.o-tabs [role=tab]{margin-bottom:-1px;padding:7px 12px;border:1px solid transparent;border-bottom:0;border-radius:var(--radius) var(--radius) 0 0;background:none;font-size:13px;font-weight:500;color:var(--ink-2);white-space:nowrap}
.o-tabs [role=tab]:hover{color:var(--ink);border-color:var(--line-2)}
.o-tabs [role=tab][aria-selected="true"]{border-color:var(--line);background:var(--surface);color:var(--ink);font-weight:600;box-shadow:0 1px 0 var(--surface)}
.o-tab-count{display:inline-grid;place-items:center;min-width:19px;height:18px;margin-inline-start:4px;padding:0 5px;border-radius:9px;background:var(--brand-soft-2);color:var(--brand);font-size:11px;font-weight:600;font-variant-numeric:tabular-nums}
.o-tab-count:empty{display:none}
.o-tab-panel{padding-top:8px}
.o-lines-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:24px;font-size:12px}

.o-lines{font-size:12.5px}
.o-lines th,.o-lines td{padding:6px 4px}
.o-lines thead th{position:static;height:32px;font-size:12px;color:var(--ink-2)}
.o-lines .ln-name{font-weight:500;line-height:1.35}
.o-lines .ln-sub{margin-top:1px;color:var(--ink-3)}
.o-lines .ln-total{font-weight:600}
.o-lines .ln-unit{font-size:11px;color:var(--ink-3)}
.o-lines .o-step{height:26px}
.o-lines .o-step button{width:23px}
.o-lines .o-step input{width:36px;font-size:12.5px}
.o-lines tfoot td{border-bottom:0;border-top:1px solid var(--line);background:var(--surface-2);font-weight:600;font-variant-numeric:tabular-nums}
.o-lines .c-rm{width:30px;text-align:end}
.ln-rm{width:28px;height:28px;color:var(--ink-4)}
.ln-rm:hover{background:var(--danger-soft);color:var(--danger)}
.ln-rm .i{width:15px;height:15px}
.o-flag{display:inline-block;margin-inline-start:5px;padding:0 6px;border-radius:9px;font-size:10.5px;font-weight:600;vertical-align:1px}
.o-flag.out{background:var(--danger-soft);color:var(--danger)}
.o-flag.c{background:var(--neutral-soft);color:var(--neutral)}
.o-lines-empty{margin:4px 0 0;padding:26px 12px;border:1px dashed var(--line);border-radius:var(--radius);text-align:center;font-size:13px;color:var(--ink-2)}
.o-lines-empty p{margin:4px 0 0}
.o-lines-empty .i{vertical-align:-3px}
.o-lines-empty .o-empty-ico{width:32px;height:32px}
.o-cats td small{font-size:11px}
.o-textarea{width:100%;min-height:110px;padding:8px 10px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);font-size:13.5px;resize:vertical;transition:border-color .15s}
.o-textarea:focus{outline:none;border-color:var(--action)}

/* الإجماليات */
.o-form-footer{flex:none;padding:10px 16px 12px;background:var(--surface);border-top:1px solid var(--line)}
.o-totals{display:grid;grid-template-columns:1fr auto;gap:3px 18px;width:min(100%,340px);margin:0;margin-inline-start:auto;font-size:13px;font-variant-numeric:tabular-nums}
.o-totals dt{color:var(--ink-2)}
.o-totals dd{margin:0;text-align:end;font-weight:500;white-space:nowrap}
.o-totals dd small{font-size:11.5px;font-weight:400}
.o-totals .good{color:var(--success)}
.o-totals .grand{margin-top:4px;padding-top:7px;border-top:1px solid var(--line);font-size:16px;font-weight:700;color:var(--ink)}

/* الشريط القُطري (Ribbon) */
.o-ribbon{position:absolute;top:0;left:0;z-index:1;width:96px;height:96px;overflow:hidden;pointer-events:none}
.o-ribbon span{position:absolute;top:23px;left:-36px;width:140px;padding:4px 0;background:var(--success);color:#fff;text-align:center;font-size:12px;font-weight:700;transform:rotate(-45deg);box-shadow:0 1px 3px rgba(0,0,0,.2)}
.o-ribbon.cancel span{background:var(--danger)}

/* ---------- النوافذ (Dialog) ---------- */
.o-modal{position:fixed;inset:0;z-index:60;display:flex;align-items:flex-start;justify-content:center;padding:48px 16px 16px;background:rgba(17,24,39,.5);overflow:auto}
.o-dialog{display:flex;flex-direction:column;width:100%;max-width:800px;max-height:calc(100vh - 64px);background:var(--surface);border-radius:6px;box-shadow:0 20px 50px rgba(0,0,0,.25)}
.o-dialog.lg{max-width:980px}
.o-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px 10px 16px;padding-inline:16px 10px;border-bottom:1px solid var(--line)}
.o-dialog-head h3{margin:0;font-size:17px;font-weight:600}
.o-dialog-head h3 .o-muted{font-weight:400;font-size:14px}
.o-dialog-body{flex:1;min-height:0;padding:16px;overflow:auto}
.o-dialog-foot{display:flex;flex-wrap:wrap;gap:8px;padding:12px 16px;border-top:1px solid var(--line)}
.o-dialog-foot:empty{display:none}
.o-table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:var(--radius)}
.o-table-wrap .o-list thead th{position:static;background:var(--surface-2)}
.o-table-wrap .o-list tr:last-child>td{border-bottom:0}
.o-orders td{white-space:nowrap}
.o-orders tbody tr{cursor:pointer}
.o-orders tr.cur>td{background:var(--brand-soft)}
.om-act{display:flex;gap:2px;justify-content:flex-end}
.o-dialog-body .o-help{margin-top:12px}

/* بطاقة المنتج */
.o-detail{display:grid;grid-template-columns:220px minmax(0,1fr);gap:22px}
.o-detail-img{display:block;width:100%;aspect-ratio:1;object-fit:contain;border:1px solid var(--line-2);border-radius:var(--radius);background:#fff}
.o-detail-ph{display:grid;place-items:center;background:var(--surface-2);color:var(--ink-4)}
.o-detail-ph .i{width:48px;height:48px;stroke-width:1.2}
.o-detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.o-detail-head h2{margin:0 0 2px;font-size:19px;font-weight:600;line-height:1.4}
.o-detail-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.o-ro-group{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:7px 20px;margin:16px 0;font-size:13px}
.o-ro-group dt{font-weight:600}
.o-ro-group dd{margin:0;color:var(--ink-2);font-variant-numeric:tabular-nums}
.o-why{margin-top:10px;padding:8px 12px;border-inline-start:3px solid var(--action);border-radius:var(--radius);background:var(--surface-2);font-size:13px}
.o-why b{display:block;margin-bottom:2px;font-size:12px;font-weight:600;color:var(--ink-3)}

/* تفصيل الدرجة */
.o-breakdown{margin-top:16px}
.o-bd-row{display:grid;grid-template-columns:minmax(130px,1.5fr) minmax(70px,1fr) 44px 52px;align-items:center;gap:10px;padding:4px 0;font-size:12.5px}
.o-breakdown.no-w .o-bd-row{grid-template-columns:minmax(130px,1.5fr) minmax(70px,1fr) 44px}
.o-bd-label small{color:var(--ink-3);font-size:11px}
.o-bd-bar{height:6px;border-radius:3px;background:var(--surface-3);overflow:hidden}
.o-bd-bar i{display:block;height:100%;border-radius:inherit;background:var(--action)}
.o-bd-val{text-align:end;color:var(--ink-2);font-variant-numeric:tabular-nums}
.o-bd-pts{text-align:end;font-weight:600;color:var(--brand);font-variant-numeric:tabular-nums}
.o-bd-row.total{margin-top:4px;padding-top:7px;border-top:1px solid var(--line);font-weight:700}
.o-bd-row.total .o-bd-pts{font-size:14px}

/* سوق التصنيف */
.o-market{margin-top:16px;padding:10px 12px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-2)}
.o-market-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.o-market-head .o-section-title{margin:0}
.o-market-vol{font-size:12.5px;color:var(--ink-2);white-space:nowrap}
.o-market-vol b{font-size:16px;color:var(--action);font-variant-numeric:tabular-nums}
.o-market-read{margin:6px 0 0;font-size:12.5px;color:var(--ink-2);line-height:1.7}
.o-kws{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.o-kw{display:inline-flex;align-items:center;gap:6px;height:24px;padding:0 8px;border:1px solid var(--line);border-radius:12px;background:var(--surface);font-size:12px}
.o-kw b{font-weight:600;color:var(--ink-2);font-variant-numeric:tabular-nums}

/* نافذة الدراسة */
.o-study>.o-tabs{position:sticky;top:-16px;z-index:3;margin:-16px -16px 14px;padding:10px 16px 0;background:var(--surface);overflow-x:auto}
.o-study-head h2{margin:0 0 4px;font-size:18px;font-weight:600;line-height:1.5}
.o-study-head p{margin:0;color:var(--ink-2);font-size:13px}
.o-study-sec{margin-top:20px}
.o-study-sec h3{margin:0 0 10px;padding-bottom:6px;border-bottom:1px solid var(--line);font-size:15px;font-weight:600}
.o-study-p{margin:6px 0;padding:7px 12px;border-inline-start:3px solid var(--brand-line);border-radius:var(--radius);background:var(--surface-2);font-size:13px;line-height:1.75}
.o-study-table{font-size:12.5px}
.o-study-table td{vertical-align:top;line-height:1.6}
.o-study-table td.c-num{vertical-align:middle}
.o-study-table td:first-child b{white-space:nowrap}
.o-study-table .o-total-row td{background:var(--surface-2);font-weight:600}
.o-vol{display:inline-block;width:70px;height:6px;margin-inline-end:8px;border-radius:3px;background:var(--surface-3);vertical-align:middle;overflow:hidden}
.o-vol i{display:block;height:100%;border-radius:inherit;background:var(--action)}
.o-legend-n{display:block;margin-top:2px;font-size:20px;font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums}
.o-legend .o-legend-n small{display:inline;margin:0;font-size:12px;font-weight:400}
.o-legend-range{display:block;font-size:12px;color:var(--ink-2)}

/* دليل التقييم */
.o-legend{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:4px 0 20px}
.o-legend div{padding:10px 12px;border:1px solid var(--line);border-top-width:3px;border-radius:var(--radius);font-size:13px}
.o-legend b{display:block;margin-bottom:2px;font-size:14.5px}
.o-legend small{display:block;margin-top:4px;color:var(--ink-3);font-size:12px}
.o-legend .l-A{border-top-color:var(--success)} .o-legend .l-A b{color:var(--success)}
.o-legend .l-B{border-top-color:#d08700} .o-legend .l-B b{color:var(--warning)}
.o-legend .l-C{border-top-color:var(--ink-4)} .o-legend .l-C b{color:var(--neutral)}
.o-section-title{margin:0 0 8px;font-size:14px;font-weight:600}
.o-info-intro{margin:0 0 10px;color:var(--ink-2);font-size:13px}
.o-clusters td{vertical-align:top}
.o-clusters td small{display:block;color:var(--ink-3);font-size:11.5px}

/* ---------- الإشعارات ---------- */
.o-notify{position:fixed;top:calc(var(--nav-h) + 10px);left:16px;z-index:70;min-width:260px;max-width:min(400px,calc(100% - 32px));padding:11px 14px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-inline-start:4px solid var(--action);border-radius:var(--radius);box-shadow:var(--shadow-pop);font-size:13.5px;font-weight:500;opacity:0;transform:translateX(-12px);pointer-events:none;transition:opacity .2s,transform .2s}
.o-notify.show{opacity:1;transform:none}
.o-notify .o-btn-link{margin-inline-start:10px;font-weight:600}

.o-fab{position:fixed;bottom:16px;inset-inline:16px;z-index:30;height:48px;border:0;border-radius:6px;background:var(--brand);color:#fff;font-size:15px;font-weight:600;box-shadow:0 8px 24px rgba(0,0,0,.25)}
.o-fab b{display:inline-grid;place-items:center;min-width:26px;height:26px;margin-inline-start:8px;padding:0 6px;border-radius:13px;background:#fff;color:var(--brand)}

#printArea{display:none}

/* ---------- سطح المكتب: تطبيق بملء الشاشة ---------- */
@media (min-width:1181px){
  body{overflow:hidden}
  #app{height:100vh}
  .o-action{flex:1;min-height:0}
  .o-catalog,.o-form{min-height:0}
  .o-content{overflow:auto}
  .o-form-body{overflow:auto}
}
@media (max-width:1440px){
  .o-action{grid-template-columns:minmax(0,1fr) 410px}
  .o-catalog-list .o-qty{flex-direction:column;align-items:flex-start;gap:2px}
  .c-avail{width:104px}
}
@media (max-width:1366px){
  .o-action{grid-template-columns:minmax(0,1fr) 400px}
}

/* ---------- شاشات متوسطة ---------- */
@media (max-width:1180px){
  .o-action{grid-template-columns:minmax(0,1fr)}
  .o-catalog{--sticky-top:var(--nav-h)}
  .o-form{border-inline-start:0;border-top:1px solid var(--line)}
  .o-form-body{padding:16px}
  .o-sheet{max-width:980px;margin-inline:auto;width:100%}
  .o-form-footer{padding-bottom:16px}
}
@media (max-width:1180px) and (min-width:761px){
  .o-group{grid-template-columns:max-content minmax(0,1fr) max-content minmax(0,1fr)}
}
@media (max-width:1060px){
  .o-cp{grid-template-columns:minmax(0,1fr) auto}
  .o-cp-search{grid-column:1/-1;grid-row:2;max-width:none}
}
@media (max-width:900px){
  .o-source,.o-company-name{display:none}
  /* المؤشرات شريط أفقي قابل للتمرير بدل التفاف الصفوف */
  .o-dashboard{display:flex;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:none}
  .o-dashboard::-webkit-scrollbar{display:none}
  .o-tile{flex:0 0 calc((100% - 3px) / 3.4);scroll-snap-align:start}
}

/* ---------- الجوال ---------- */
@media (max-width:760px){
  body{font-size:14.5px}
  .o-navbar{padding:0 8px;gap:6px}
  .o-app-name{display:none}
  .o-menu-item{padding:0 9px;font-size:13.5px}
  #navCatalog{display:none}
  .o-company{display:none}
  #fileBtnLabel{display:none}
  .o-nav-btn{width:38px;justify-content:center;padding:0}
  .o-cp{padding:8px 12px;gap:8px}
  .o-breadcrumb{font-size:16px}
  .o-switch-view{display:none}
  .o-search-panel{grid-template-columns:1fr;max-height:min(70vh,520px);overflow:auto}
  .o-sp-col{border-inline-start:0;border-top:1px solid var(--line-2)}
  .o-sp-col:first-child{border-top:0}
  .o-sp-item{padding-block:9px}
  .o-tile{padding:9px 12px}
  .o-tile b{font-size:18px}
  .o-tile span{font-size:11.5px;white-space:normal;line-height:1.3}
  .o-kanban{grid-template-columns:minmax(0,1fr);padding:10px 12px}
  .o-form-cp{padding:8px 12px}
  .o-form-header{padding:8px 12px 10px}
  .o-form-buttons .o-btn-primary,.o-form-buttons .o-btn-secondary{flex:1 1 auto}
  .o-form-buttons #btnCancel{margin-inline-start:0}
  .o-form-body{padding:12px 12px 16px}
  .o-sheet{padding:14px 12px 12px}
  .o-form-footer{padding:10px 12px 88px}
  .o-totals{width:100%}
  .o-cp-start .o-dropdown{position:static}
  .o-cp-start .o-dropdown-menu{top:52px;inset-inline:12px;width:auto}
  .o-modal{padding:12px}
  .o-dialog{max-height:calc(100vh - 24px)}
  .o-detail{grid-template-columns:1fr}
  .o-detail-img{max-width:240px;margin:0 auto}
  .o-legend{grid-template-columns:1fr}
  .o-bd-row,.o-breakdown.no-w .o-bd-row{grid-template-columns:minmax(0,1fr) 56px 34px 42px;gap:6px}
  .o-breakdown.no-w .o-bd-row{grid-template-columns:minmax(0,1fr) 56px 34px}
  .o-notify{top:auto;bottom:76px;left:12px;right:12px;max-width:none}
}
@media (max-width:400px){
  .o-lines .ln-unit{display:none}
}

/* أهداف لمس أكبر على الأجهزة اللمسية */
@media (pointer:coarse){
  .o-btn{height:40px}
  .o-btn-sm{height:36px}
  .o-btn-icon{width:40px;height:40px}
  .o-step{height:36px}
  .o-step button{width:36px}
  .o-step input{width:46px}
  .o-lines .o-step{height:34px}
  .o-lines .o-step button{width:32px}
  .o-pager button{width:36px;height:36px}
  .o-facet{height:28px}
  .o-facet-x{width:28px}
  .o-sugg{padding:6px 2px}
  .ln-rm{width:36px;height:36px}
  .o-input{height:38px}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition:none!important;animation:none!important}
}

/* =========================================================
   الطباعة — تقرير أمر شراء بأسلوب تقارير Odoo
   ========================================================= */
@media print{
  @page{size:A4;margin:12mm 12mm 14mm}
  html,body{height:auto;overflow:visible!important;background:#fff}
  #app,.o-modal,.o-notify,.o-fab{display:none!important}
  #printArea{display:block;color:#1f2937;font-size:11px;line-height:1.45;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .r-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;padding-bottom:10px;border-bottom:2px solid var(--brand)}
  .r-company{display:flex;gap:10px;align-items:center}
  .r-logo{display:grid;place-items:center;width:42px;height:42px;border-radius:6px;background:var(--brand);color:#fff}
  .r-logo .i{width:26px;height:26px;stroke-width:1.6}
  .r-company b{display:block;font-size:15px}
  .r-company div div{color:#6b7280;font-size:10.5px}
  .r-supplier{min-width:200px;padding:8px 12px;border:1px solid #dee2e6;border-radius:4px}
  .r-supplier span{display:block;color:#6b7280;font-size:10px}
  .r-supplier b{font-size:13px}
  .r-title{margin:16px 0 10px;font-size:22px;font-weight:600;color:var(--brand)}
  .r-title span{direction:ltr;unicode-bidi:isolate}
  .r-info{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:14px}
  .r-info span{display:block;color:#6b7280;font-size:10px;font-weight:600}
  .r-info b{font-size:12px;font-weight:500}
  .r-table{width:100%;border-collapse:collapse}
  .r-table th{padding:6px;border-bottom:2px solid #1f2937;text-align:start;font-size:10.5px;font-weight:700}
  .r-table td{padding:5px 6px;border-bottom:1px solid #e5e7eb;vertical-align:middle}
  .r-table .num{text-align:end;white-space:nowrap;font-variant-numeric:tabular-nums}
  .r-table .sku-h{text-align:left}
  .r-table .sku{direction:ltr;text-align:left;font-family:var(--mono);font-size:9.5px;white-space:nowrap}
  .r-table img{display:block;width:30px;height:30px;object-fit:contain}
  .r-table small{display:block;color:#6b7280;font-size:9.5px}
  .r-table tbody tr:nth-child(even) td{background:#fafafa}
  .r-totals-wrap{display:flex;justify-content:flex-end;margin-top:10px}
  .r-totals{width:280px;border-collapse:collapse}
  .r-totals td{padding:5px 8px;border-bottom:1px solid #e5e7eb}
  .r-totals .num{text-align:end;font-variant-numeric:tabular-nums;white-space:nowrap}
  .r-totals .grand td{border-top:2px solid #1f2937;border-bottom:0;background:var(--brand-soft);font-size:13px;font-weight:700}
  .r-h3{margin:18px 0 6px;font-size:12px;font-weight:700}
  .r-notes{margin-top:14px;padding:8px 10px;border:1px solid #dee2e6;border-radius:4px}
  .r-sign{display:grid;grid-template-columns:1fr 1fr;gap:48px;margin-top:44px}
  .r-sign div{padding-top:6px;border-top:1px solid #1f2937;text-align:center;color:#4b5563}
  .r-foot{margin-top:24px;padding-top:6px;border-top:1px solid #e5e7eb;text-align:center;color:#9ca3af;font-size:9.5px}
  tr{page-break-inside:avoid}
}
