/* Supplies reference design. All rules stay within this workspace. */
#suppliesView {
    --sp-ink: #111e42;
    --sp-ink-soft: #334568;
    --sp-primary: #253597;
    --sp-primary-dark: #1f2d88;
    --sp-primary-soft: #edf3ff;
    --sp-muted: #75829d;
    --sp-line: #dfe7f2;
    --sp-line-soft: #e7edf6;
    color: var(--sp-ink);
}
#suppliesView .sp-shell { gap: 26px; padding: 16px 2px 2px; }
#suppliesView .sp-icon { width: 24px; height: 24px; flex: 0 0 24px; }
#suppliesView .sp-hero { align-items: flex-start; padding: 0; gap: 24px; }
#suppliesView .sp-hero-copy { flex: 1 1 280px; }
#suppliesView .sp-eyebrow { font-size: .85rem; font-weight: 500; color: #6285ff; }
#suppliesView .sp-eyebrow::before { width: 20px; }
#suppliesView .sp-hero h2 { margin: 12px 0 0; font-size: 2rem; font-weight: 800; }
#suppliesView .sp-hero-stats { grid-template-columns: repeat(2, minmax(200px, 235px)); gap: 16px; }
#suppliesView .sp-stat { position: relative; min-height: 108px; gap: 1px; padding: 12px 18px 12px 74px; border-radius: 12px; background: #fff; box-shadow: 0 2px 5px #14244a06; }
#suppliesView .sp-stat > span:not(.sp-stat-icon) { font-size: .9rem; font-weight: 600; }
#suppliesView .sp-stat > strong { font-size: 1.9rem; color: var(--sp-ink); }
#suppliesView .sp-stat > small { font-size: .85rem; }
#suppliesView .sp-stat-accent > strong { color: #193bb4; }
#suppliesView .sp-stat-icon { position: absolute; inset-inline-end: 16px; top: 13px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: #6186ed; background: #eef4ff; }
#suppliesView .sp-stat:first-child .sp-stat-icon { color: #526988; }
#suppliesView .sp-tabs { gap: 8px; padding: 8px 10px; border-radius: 14px; background: #fff; box-shadow: 0 3px 9px #13294b05; }
#suppliesView .sp-tab { position: relative; gap: 14px; min-height: 76px; border: 0; border-radius: 10px; padding: 12px 18px; }
#suppliesView .sp-tab.is-active { color: var(--sp-primary); background: linear-gradient(110deg,#f3f7ff,#edf3ff); box-shadow: none; }
#suppliesView .sp-tab.is-active::after { content: ''; position: absolute; inset-inline: 2px; bottom: -3px; height: 3px; background: var(--sp-primary); border-radius: 0 0 6px 6px; }
#suppliesView .sp-tab-icon { width: 46px; height: 46px; flex-basis: 46px; color: #586a89; background: #f6f8fc; }
#suppliesView .sp-tab.is-active .sp-tab-icon { background: transparent; color: var(--sp-primary); }
#suppliesView .sp-tab-icon svg { width: 26px; height: 26px; }
#suppliesView .sp-tab-copy strong { font-size: 1rem; font-weight: 700; }
#suppliesView .sp-tab-copy small { font-size: .86rem; color: #7383a4; }
#suppliesView .sp-card { border-color: var(--sp-line); border-radius: 14px; box-shadow: 0 3px 7px #14244a06; }
#suppliesView .sp-card-head { padding: 18px 20px; align-items: center; }
#suppliesView .sp-card-title { gap: 10px; align-items: flex-start; }
#suppliesView .sp-card-icon { width: 38px; height: 38px; flex-basis: 38px; color: #1756ed; border-radius: 11px; background: #f0f5ff; }
#suppliesView .sp-card-title h3 { font-size: 1.18rem; font-weight: 750; color: var(--sp-ink); }
#suppliesView .sp-card-title p { font-size: .87rem; color: #7f8ca6; }
#suppliesView .sp-assign-layout { grid-template-columns: minmax(0,1fr) minmax(235px,270px); gap: 16px; align-items: stretch; }
#suppliesView .sp-assign-main { gap: 14px; }
#suppliesView .sp-supply-card .sp-card-head { padding-bottom: 14px; }
#suppliesView .sp-supply-controls { display: grid; grid-template-columns: minmax(190px,1fr) minmax(0,2fr); align-items: center; gap: 20px; margin: 0 16px; padding: 16px; border: 1px solid #d3e1f5; border-radius: 12px; background: linear-gradient(115deg,#f7faff,#f5f9ff); }
#suppliesView .sp-supply-controls > .sp-field > label { color: var(--sp-ink); font-size: 1rem; }
#suppliesView .sp-summary:not(.is-empty) { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; padding: 0; border: 0; border-radius: 0; background: transparent; }
#suppliesView .sp-summary.is-empty { border: 0; background: transparent; padding: 0; }
#suppliesView .sp-summary-mark { display: none; }
#suppliesView .sp-summary-metric { position: relative; min-width: 0; min-height: 74px; padding: 6px 42px 0 8px; border-inline-start: 1px solid #d9e4f4; text-align: center; align-content: center; gap: 5px; }
#suppliesView .sp-metric-icon { position: absolute; inset-inline-start: 14px; top: 10px; color: #1554f5; }
#suppliesView .sp-summary-metric > small { font-size: .87rem; font-weight: 500; }
#suppliesView .sp-summary-metric > strong { display: flex; justify-content: center; align-items: baseline; gap: 8px; flex-wrap: wrap; color: var(--sp-ink); font-size: 1.7rem; font-weight: 750; }
#suppliesView .sp-summary-metric strong small { font-size: .88rem; }
#suppliesView .sp-shell .form-control,
#suppliesView .sp-shell .form-select { min-height: 44px; border-radius: 8px; border-color: #d5dfef; font-size: .95rem; color: var(--sp-ink); box-shadow: 0 1px 2px #14244a03; }
#suppliesView .sp-shell .form-control:focus,
#suppliesView .sp-shell .form-select:focus { border-color: #839ae3; box-shadow: 0 0 0 3px #25359710; }
#suppliesView .sp-shell .form-control:disabled { background: #f7f9fc; color: #a1acc1; border-color: #e1e8f3; opacity: 1; }
#suppliesView .sp-shell .btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 11px 25px; border: 1px solid #293795; border-radius: 10px; background: linear-gradient(115deg,#253795,#303f9d); color: #fff; font-size: 1rem; font-weight: 650; box-shadow: 0 2px 3px #2535970a; }
#suppliesView .sp-shell .btn-primary:hover:not(:disabled) { background: #202f86; }
#suppliesView .sp-projects-card { overflow: visible; }
#suppliesView .sp-projects-head { border-radius: 14px 14px 0 0; }
#suppliesView .sp-count { background: #eaf0f7; color: #29395f; font-size: .85rem; padding: 6px 14px; font-weight: 600; }
#suppliesView .sp-head-actions .btn { font-size: .8rem; }
#suppliesView .sp-project-item { padding: 16px 20px; border-top: 1px solid #e0e7f2; gap: 14px; }
#suppliesView .sp-project-item.is-selected { background: linear-gradient(100deg,#f5f8ff,#edf3ff); box-shadow: none; }
#suppliesView .sp-project-head { grid-template-columns: 24px 38px minmax(0,1fr); gap: 12px; }
#suppliesView .sp-project-symbol { display: grid; place-items: center; width: 38px; height: 38px; color: #1556ed; background: #eff4ff; border-radius: 10px; }
#suppliesView .sp-project-symbol .sp-icon { width: 23px; height: 23px; }
#suppliesView .sp-project-title strong { font-size: 1rem; line-height: 1.6; }
#suppliesView .sp-project-title small { font-size: .83rem; color: #8791a6; }
#suppliesView .sp-check,
#suppliesView .sp-check > span { width: 24px; height: 24px; border-radius: 6px; }
#suppliesView .sp-check input:checked + span { background: #2542b7; border-color: #2542b7; box-shadow: 0 1px 2px #25359712; }
#suppliesView .sp-project-item:not(.is-selected) .sp-project-fields { opacity: 1; }
#suppliesView .sp-input.has-unit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    direction: rtl;
    align-items: stretch;
    border: 1px solid #d5dfef;
    border-radius: 8px;
    background: #fff;
}
#suppliesView .sp-input.has-unit .form-control {
    min-width: 0;
    width: 100%;
    padding: .48rem .55rem;
    border: 0;
    border-radius: 0 7px 7px 0;
    direction: ltr;
    text-align: right;
    box-shadow: none;
    appearance: auto;
}
#suppliesView .sp-input.has-unit > small {
    position: static;
    inset: auto;
    min-width: 0;
    padding: 4px 6px;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    overflow-wrap: normal;
    line-height: 1.4;
    border-inline-start: 1px solid #e0e6f1;
    font-size: .81rem;
    color: #7987a2;
}
#suppliesView .sp-input.has-unit:focus-within {
    border-color: #839ae3;
    box-shadow: 0 0 0 3px #25359710;
}
#suppliesView .sp-input.has-unit:has(input:disabled) { background: #f7f9fc; border-color: #e1e8f3; }
#suppliesView .sp-project-item[data-touched] .sp-field.is-invalid .sp-input.has-unit { border-color: #f87171; background: #fff8f8; }
#suppliesView .sp-line-total strong { display: flex; flex-direction: column; gap: 2px; font-size: 1.1rem; color: var(--sp-ink); }
#suppliesView .sp-line-total strong small { color: #7d89a3; font-size: .79rem; font-weight: 500; }
#suppliesView .sp-dock { margin-top: 0; padding: 20px; background: linear-gradient(110deg,#fbfcff,#f4f7fc); border-radius: 0 0 14px 14px; gap: 14px; }
#suppliesView .sp-kpis { flex: 1 1 430px; gap: 0; }
#suppliesView .sp-kpis > div { position: relative; display: grid; grid-template-columns: 34px minmax(0,1fr); flex: 1 1 150px; min-width: 0; padding: 0 12px; border: 0; border-inline-end: 1px solid #dce4f1; border-radius: 0; background: transparent; gap: 8px; }
#suppliesView .sp-kpis dt { font-size: .83rem; font-weight: 500; color: #7d89a3; }
#suppliesView .sp-kpis dt { grid-column: 2; grid-row: 1; align-self: center; }
#suppliesView .sp-kpis dd { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 7px; min-width: 0; max-width: 100%; font-size: clamp(1.05rem, 2.1cqi, 1.45rem); color: var(--sp-ink); direction: rtl; text-align: start; white-space: normal; }
#suppliesView .sp-kpis dd > span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; direction: ltr; unicode-bidi: isolate; }
#suppliesView .sp-kpis dd small { font-size: .85rem; font-weight: 500; }
#suppliesView .sp-kpis .is-value { background: transparent; border-color: #dce4f1; }
#suppliesView .sp-kpis .is-value dd { color: var(--sp-ink); }
#suppliesView .sp-kpi-icon { position: static; grid-column: 1; grid-row: 1; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #edf3ff; color: #1558f6; }
#suppliesView .sp-dock-actions { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; }
#suppliesView .sp-dock-actions [role="status"] { flex: 1 1 100%; max-width: 35ch; font-size: .78rem; }
#suppliesView .sp-dock-actions [role="status"]:empty { display: none; }
#suppliesView .sp-dock-actions .btn { min-height: 54px; }
#suppliesView .sp-history { align-self: stretch; }
#suppliesView .sp-history-head { display: flex; flex-direction: row; padding: 18px 16px 14px; align-items: flex-start; gap: 8px; }
#suppliesView .sp-history-head h3 { font-size: 1rem; font-weight: 700; color: var(--sp-ink); }
#suppliesView .sp-history-head p { font-size: .79rem; color: #8a95aa; }
#suppliesView .sp-history-icon { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; color: #2761ef; background: #f1f5ff; }
#suppliesView .sp-history-list { padding: 6px 12px 14px; gap: 10px; }
#suppliesView .sp-history-row { grid-template-columns: 36px minmax(0,1fr); align-items: start; gap: 10px; padding: 16px 12px; border: 1px solid #e4eaf5; border-radius: 10px; background: #fff; }
#suppliesView .sp-history-row:last-child { border-bottom: 1px solid #e4eaf5; }
#suppliesView .sp-history-avatar { width: 36px; height: 36px; color: #2b5ce6; background: #f1f5ff; border-radius: 10px; }
#suppliesView .sp-history-avatar .sp-icon { width: 21px; height: 21px; }
#suppliesView .sp-history-info { gap: 7px; }
#suppliesView .sp-history-info strong { font-size: .94rem; color: var(--sp-ink); }
#suppliesView .sp-history-info b { color: #17852b; font-size: .91rem; }
#suppliesView .sp-history-info small { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .81rem; color: #8b99b1; }
#suppliesView .sp-history-info small .sp-icon { width: 15px; height: 15px; flex-basis: 15px; }
#suppliesView .sp-empty { padding: 14px; margin: 12px 16px; border-style: solid; background: #f8faff; font-size: .88rem; }
#suppliesView .sp-empty strong { font-size: .9rem; font-weight: 500; }
/* The add tab uses the same cards, input heights, indigo actions and table rhythm. */
#suppliesView .sp-form-card { padding-bottom: 18px; }
#suppliesView .sp-form-grid { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); padding-inline: 20px; }
#suppliesView .sp-form-actions { margin-inline: 20px; }
#suppliesView .sp-form-note { color: #8490a8; flex-basis: 320px; }
#suppliesView .sp-search { background: #f9fbff; border-color: #dde5f1; border-radius: 9px; }
#suppliesView .sp-search input { color: var(--sp-ink); }
#suppliesView table.data-table.sp-catalog-table thead th { background: #f4f7fc !important; color: var(--sp-ink) !important; border-color: #e3eaf5 !important; font-weight: 650 !important; padding-block: 16px !important; }
#suppliesView table.data-table.sp-catalog-table tbody td { padding-block: 15px !important; border-color: #e5ebf5 !important; }
#suppliesView table.data-table.sp-catalog-table tbody tr:nth-child(even) td { background: #f8faff; }
#suppliesView .sp-row-action { color: #2f419f; border-color: #dce4f5; background: #f5f8ff; }
#suppliesView .sp-table-foot { padding: 14px 18px; background: #fbfcff; border-radius: 0 0 14px 14px; }
#suppliesView .sp-page-btn.is-active { background: var(--sp-primary); border-color: var(--sp-primary); }
@container supply-assignment (min-width: 760px) {
    #suppliesView .sp-allocation-head,
    #suppliesView .sp-project-item { display: grid; grid-template-columns: minmax(215px,1.1fr) minmax(0,3fr); gap: 18px; align-items: center; }
    #suppliesView .sp-allocation-head { padding: 15px 20px; background: #f5f8fd; border-color: #e1e8f4; color: var(--sp-ink); font-size: .92rem; }
    #suppliesView .sp-allocation-head > div,
    #suppliesView .sp-project-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) minmax(78px,.65fr); gap: 14px; }
    #suppliesView .sp-allocation-head > div > span { text-align: center; }
    #suppliesView .sp-allocation-head small { display: block; margin-top: 3px; color: #8692a9; font-weight: 400; font-size: .8rem; }
    #suppliesView .sp-project-fields { padding: 0; }
    #suppliesView .sp-project-fields > .sp-field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    #suppliesView .sp-project-fields .sp-line-total { justify-content: center; text-align: center; }
}
@media (max-width: 1250px) {
    #suppliesView .sp-assign-layout { grid-template-columns: minmax(0,1fr); }
    #suppliesView .sp-history { order: 2; }
    #suppliesView .sp-history-list { grid-template-columns: repeat(auto-fit,minmax(215px,1fr)); }
}
@media (max-width: 900px) {
    #suppliesView .sp-hero-stats { flex: 1 1 100%; grid-template-columns: repeat(2,minmax(0,1fr)); }
    #suppliesView .sp-supply-controls { grid-template-columns: minmax(0,1fr); gap: 14px; }
    #suppliesView .sp-summary-metric:first-child { border-inline-start: 0; }
    #suppliesView .sp-kpis { flex-basis: auto; width: 100%; }
    #suppliesView .sp-dock-actions { width: 100%; }
}
@media (max-width: 720px) {
    #suppliesView .sp-shell { gap: 16px; padding-top: 12px; }
    #suppliesView .sp-hero h2 { font-size: 1.7rem; }
    #suppliesView .sp-stat { min-height: 100px; padding: 12px; padding-inline-end: 56px; }
    #suppliesView .sp-stat-icon { width: 34px; height: 34px; inset-inline-end: 10px; }
    #suppliesView .sp-stat > span:not(.sp-stat-icon) { font-size: .8rem; }
    #suppliesView .sp-stat strong { font-size: 1.6rem; }
    #suppliesView .sp-stat > small { font-size: .76rem; }
    #suppliesView .sp-tabs { display: grid; grid-template-columns: minmax(0,1fr); padding: 6px; }
    #suppliesView .sp-tab { padding: 10px 12px; min-height: 66px; }
    #suppliesView .sp-tab-copy strong { font-size: .93rem; }
    #suppliesView .sp-tab-copy small { font-size: .77rem; }
    #suppliesView .sp-card-head { padding: 16px; }
    #suppliesView .sp-card-title h3 { font-size: 1.06rem; }
    #suppliesView .sp-card-title p { font-size: .8rem; }
    #suppliesView .sp-supply-controls { margin-inline: 12px; padding: 12px; }
    #suppliesView .sp-summary:not(.is-empty) { gap: 8px; }
    #suppliesView .sp-summary-metric { padding: 5px 8px; min-height: 70px; }
    #suppliesView .sp-metric-icon { display: none; }
    #suppliesView .sp-summary-metric > small { font-size: .78rem; }
    #suppliesView .sp-summary-metric > strong { font-size: 1.4rem; }
    #suppliesView .sp-project-item { padding: 14px; }
    #suppliesView .sp-project-fields { padding-inline-start: 0; }
    #suppliesView .sp-dock { padding: 16px; }
    #suppliesView .sp-kpis { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,150px),1fr)); gap: 14px 0; }
    #suppliesView .sp-kpis > div { padding: 0 8px; min-width: 0; }
    #suppliesView .sp-kpi-icon { position: static; margin-bottom: 5px; width: 32px; height: 32px; }
    #suppliesView .sp-kpi-icon .sp-icon { width: 20px; height: 20px; }
    #suppliesView .sp-kpis dt { font-size: .73rem; }
    #suppliesView .sp-kpis dd { font-size: 1.05rem; }
    #suppliesView .sp-kpis dd small { font-size: .7rem; }
    #suppliesView .sp-dock-actions { flex: 0 1 auto; align-items: stretch; }
    #suppliesView .sp-dock-actions [role="status"] { flex: 0 1 auto; max-width: none; }
    #suppliesView .sp-form-grid { grid-template-columns: minmax(0,1fr); padding-inline: 16px; }
    #suppliesView .sp-form-actions { margin-inline: 16px; }
    #suppliesView .sp-form-note { flex: 0 1 auto; }
}

/* Intrinsic sizing keeps units whole and large totals inside their own cells. */
#suppliesView .sp-line-total { min-width: 0; max-width: 100%; }
#suppliesView .sp-line-total strong,
#suppliesView .sp-line-total [data-sa-total] { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
@container supply-assignment (max-width: 759px) {
    #suppliesView .sp-project-fields { grid-template-columns: repeat(auto-fit,minmax(min(100%,180px),1fr)); }
    #suppliesView .sp-kpis { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,150px),1fr)); gap: 14px 0; }
}

/* Clear deduction type and material selection, limited to the invoice deductions. */
#deductionCardsContainer .ded-desc {
    min-height: 46px;
    width: 100%;
    min-width: 0;
    border: 1.5px solid #9aaed0;
    border-radius: 9px;
    padding-block: 10px;
    padding-inline-start: 12px;
    font-size: .96rem;
    color: #17324d;
    background-color: #f8faff;
}
#deductionCardsContainer .ded-desc:focus { border-color: #253597; box-shadow: 0 0 0 3px #2535971c; }
#deductionCardsContainer .is-materials-deduction .ded-desc { border-color: #7588cb; background-color: #eef3ff; font-weight: 650; }
#deductionCardsContainer .ded-material-choice {
    position: relative;
    align-items: center;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    padding: 6px 8px;
    border-radius: 8px;
    touch-action: manipulation;
}
/* Style the actual checkbox so its visible bounds and focus target agree. */
#deductionCardsContainer .ded-material-choice > input {
    appearance: none;
    position: static;
    inset: auto;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
    border: 2px solid #788ba9;
    border-radius: 6px;
    background: #fff no-repeat center / 20px 20px;
    box-shadow: 0 1px 2px #17324d0a;
    transition: border-color .15s ease, background-color .15s ease;
}
#deductionCardsContainer .ded-material-check { display: none; }
#deductionCardsContainer .ded-material-choice > input:checked {
    border-color: #253597;
    background-color: #253597;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4 10-10'/%3E%3C/svg%3E");
}
#deductionCardsContainer .ded-material-choice > input:focus-visible { outline: 3px solid #a8b8f1; outline-offset: 3px; }
#deductionCardsContainer .ded-material-choice > input:disabled { opacity: .5; cursor: not-allowed; }
@media (hover: hover) {
    #deductionCardsContainer .ded-material-choice:hover { background-color: #e7edfa; }
    #deductionCardsContainer .ded-material-choice:hover > input:not(:disabled) { border-color: #253597; }
}
@media (pointer: coarse) {
    #deductionCardsContainer .ded-material-choice { min-height: 48px; padding-block: 10px; }
}
#deductionCardsContainer .ded-material-row.is-selected { border-color: #a9b8e6; background: #eef3ff; box-shadow: inset -3px 0 0 #253597; }
#deductionCardsContainer .ded-material-main strong { font-size: .94rem; }

/* The summary remains a real RTL table: shared column widths align every cell. */
#deductionCardsContainer .ded-materials-summary-table-wrap {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}
#deductionCardsContainer .ded-materials-summary-table {
    width: 100%;
    min-width: 520px;
    table-layout: fixed;
    direction: rtl;
}
#deductionCardsContainer .ded-materials-summary-table th,
#deductionCardsContainer .ded-materials-summary-table td {
    padding: 12px 10px;
    text-align: center;
    vertical-align: middle;
    font-size: .85rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
    white-space: normal;
}
#deductionCardsContainer .ded-materials-summary-table th:first-child,
#deductionCardsContainer .ded-materials-summary-table td:first-child { text-align: start; }
#deductionCardsContainer .ded-materials-summary-table th { color: #526789; font-weight: 650; background: #f6f8fc; }
#deductionCardsContainer .ded-materials-summary-name { min-width: 0; color: #29445f; }
#deductionCardsContainer .ded-materials-summary-number { white-space: normal; }
#deductionCardsContainer .ded-materials-summary-value { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 3px 5px; min-width: 0; }
#deductionCardsContainer .ded-materials-summary-value b { max-width: 100%; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; unicode-bidi: isolate; font-weight: 700; }
#deductionCardsContainer .ded-materials-summary-value small { font-size: .78rem; white-space: nowrap; color: #6b7e99; }

/* Reference layout: title and tabs, four metrics, horizontal form, compact register. */
#suppliesView {
    --sp-primary: #0755ff;
    --sp-primary-dark: #0046e5;
    --sp-ink: #16194f;
    --sp-muted: #7b86b4;
    --sp-line: #e1ebfc;
    background: radial-gradient(ellipse at 40% 0, #e5efff80, transparent 62%), #f0f7ff !important;
    border-radius: 16px;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}
#suppliesView .sp-shell { gap: 16px; padding: 8px 12px 2px; }
#suppliesView .sp-hero { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(0, 2.2fr); gap: 18px 24px; align-items: center; }
#suppliesView .sp-hero-copy { text-align: right; }
#suppliesView .sp-eyebrow { display: none; }
#suppliesView .sp-hero h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.85rem; line-height: 1.35; font-weight: 700; }
#suppliesView .sp-title-icon { width: 32px; height: 32px; color: var(--sp-primary); }
#suppliesView .sp-hero p { margin: 4px 0 0; color: var(--sp-muted); font-size: .9rem; line-height: 1.5; }
#suppliesView .sp-tabs { display: flex; justify-self: center; width: min(100%, 690px); align-self: center; gap: 0; padding: 0; border: 0; border-radius: 9px; background: #ffffffb8; box-shadow: 0 4px 15px #1d67e509; }
#suppliesView .sp-tab { flex: 1 1 0; justify-content: center; gap: 12px; min-height: 44px; padding: 10px 12px; border-radius: 8px; color: #6975a7; background: transparent; }
#suppliesView .sp-tab.is-active { color: #fff; background: var(--sp-primary); box-shadow: 0 4px 12px #0755ff25; }
#suppliesView .sp-tab.is-active::after { display: none; }
#suppliesView .sp-tab:hover:not(.is-active) { background: #eaf1ff; }
#suppliesView .sp-tab-icon, #suppliesView .sp-tab.is-active .sp-tab-icon { width: 24px; height: 24px; flex-basis: 24px; background: transparent; color: inherit; }
#suppliesView .sp-tab-icon svg { width: 23px; height: 23px; }
#suppliesView .sp-tab-copy strong { color: inherit; font-size: .86rem; font-weight: 600; }
#suppliesView .sp-tab-copy small { display: none; }
#suppliesView .sp-hero-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; width: 100%; }
#suppliesView .sp-stat { --stat-color: #0755ff; --stat-tint: #e2eaff; position: relative; isolation: isolate; overflow: hidden; display: grid; align-content: center; gap: 0; min-height: 96px; padding: 10px 18px 10px 85px; border: 0; border-inline-start: 3px solid var(--stat-color); border-radius: 10px; background: #ffffffed; box-shadow: 0 5px 18px #3b77cc0a; }
#suppliesView .sp-stat::before { content: ''; position: absolute; z-index: -1; bottom: -18px; left: 35px; width: 160px; height: 62px; border-radius: 50%; background: radial-gradient(ellipse at 50% 0, var(--stat-tint), transparent 70%); transform: rotate(-9deg); }
#suppliesView .sp-stat::after { content: ''; position: absolute; z-index: -1; bottom: 5px; left: 32px; width: 162px; height: 43px; opacity: .5; background: var(--stat-color); clip-path: polygon(0 100%, 12% 98%, 23% 89%, 32% 72%, 40% 41%, 47% 20%, 54% 13%, 61% 18%, 68% 38%, 76% 70%, 87% 92%, 100% 100%, 87% 94%, 76% 73%, 68% 41%, 61% 21%, 54% 16%, 47% 23%, 40% 44%, 32% 75%, 23% 91%, 12% 100%); }
#suppliesView .sp-stat > span:not(.sp-stat-icon) { color: var(--sp-ink); font-size: .83rem; font-weight: 600; line-height: 1.6; }
#suppliesView .sp-stat > strong { color: var(--sp-ink); font-size: 1.75rem; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; }
#suppliesView .sp-stat > small { color: var(--sp-muted); font-size: .76rem; }
#suppliesView .sp-stat-icon { inset-inline-start: auto; inset-inline-end: 16px; top: 14px; width: 64px; height: 64px; border-radius: 50%; background: var(--stat-tint); color: var(--stat-color); }
#suppliesView .sp-stat:first-child .sp-stat-icon { color: var(--stat-color); }
#suppliesView .sp-stat .sp-stat-icon { color: var(--stat-color); }
#suppliesView .sp-stat-icon .sp-icon { width: 31px; height: 31px; }
#suppliesView .sp-stat-active { --stat-color: #11c78c; --stat-tint: #d7f7ed; }
#suppliesView .sp-stat-inactive { --stat-color: #ff4054; --stat-tint: #ffe1e5; }
#suppliesView .sp-stat-accent { --stat-color: #555dff; --stat-tint: #e0e2ff; }
#suppliesView .sp-card { border: 1px solid #edf3ff; border-radius: 12px; background: #ffffffed; box-shadow: 0 4px 20px #3879d409; }
#suppliesView .sp-card-head { padding: 12px 18px 8px; }
#suppliesView .sp-card-title { align-items: flex-start; gap: 10px; }
#suppliesView .sp-card-icon, #suppliesView .sp-table-head .sp-card-icon { width: 30px; height: 30px; flex-basis: 30px; border-radius: 0; background: transparent; color: var(--sp-primary); }
#suppliesView .sp-card-icon svg { width: 29px; height: 29px; }
#suppliesView .sp-card-title h3 { margin: 0; font-size: 1.18rem; font-weight: 700; }
#suppliesView .sp-card-title p { margin: 3px 0 0; color: var(--sp-muted); font-size: .8rem; line-height: 1.5; }
#suppliesView .sp-catalog { gap: 14px; }
#suppliesView .sp-form-card { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 0 32px; min-height: 136px; padding: 0 12px 12px; background: repeating-linear-gradient(135deg, transparent 0 140px, #edf4ff40 140px 176px, transparent 176px 220px), #ffffffec; }
#suppliesView .sp-form-card .sp-card-head { grid-column: 1 / -1; padding: 11px 5px 6px; }
#suppliesView .sp-form-grid { width: 100%; display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; padding: 0 12px; margin: 0; }
#suppliesView .sp-form-grid .form-group { gap: 4px; }
#suppliesView .sp-form-grid label { font-size: .82rem; color: var(--sp-ink); }
#suppliesView .sp-shell .form-control, #suppliesView .sp-shell .form-select { min-height: 38px; border-radius: 6px; border-color: #d0ddf9; background-color: #fbfcff; color: #747fa9; font-size: .83rem; }
#suppliesView .sp-shell .form-control::placeholder { color: #8893b9; }
#suppliesView .sp-shell .form-control:focus, #suppliesView .sp-shell .form-select:focus { border-color: #719cff; box-shadow: 0 0 0 3px #0755ff12; }
#suppliesView .sp-form-actions { align-self: end; width: 100%; margin: 0; padding: 0; border: 0; }
#suppliesView .sp-shell .btn-primary { min-height: 42px; border: 1px solid var(--sp-primary); border-radius: 8px; background: var(--sp-primary) !important; box-shadow: 0 4px 12px #0755ff25; font-size: .86rem; }
#suppliesView .sp-shell .btn-primary:hover:not(:disabled) { background: var(--sp-primary-dark) !important; }
#suppliesView .sp-form-actions .btn { width: 100%; flex-direction: row; gap: 8px; }
#suppliesView .sp-form-actions .btn > span { font-size: 1.35rem; font-weight: 400; line-height: 1; }
#suppliesView .sp-form-status { grid-column: 1 / -1; margin: 7px 12px 0; }
#suppliesView .sp-table-card { overflow: hidden; padding: 0 11px; }
#suppliesView .sp-table-head { display: flex; align-items: center; gap: 16px; padding: 9px 5px 12px; }
#suppliesView .sp-table-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-inline-start: auto; }
#suppliesView .sp-table-tools .sp-count { order: 3; padding: 6px 15px; background: #e8edf8; color: #6673a4; font-size: .78rem; }
#suppliesView .sp-search { order: 2; width: 226px; flex: 0 1 226px; height: 34px; border: 1px solid #d3dffa; border-radius: 6px; background: #fff; color: #7886b5; }
#suppliesView .sp-search input { font-size: .8rem; }
#suppliesView .sp-search input::placeholder { color: #8592b9; }
#suppliesView .sp-sort-slot { order: 1; }
#suppliesView .sp-sort-slot .table-date-sort { padding: 0; gap: 5px; }
#suppliesView .sp-sort-slot .table-date-sort > span, #suppliesView .sp-sort-slot select[aria-label="عمود التاريخ للترتيب"] { display: none; }
#suppliesView .sp-sort-slot .table-date-sort select { min-height: 32px; min-width: 105px; padding: 4px 8px; border-color: #d3dffa; font-size: .76rem; color: #7785ac; }
#suppliesView .sp-table-scroll { margin: 0; border: 1px solid #e1ebfd; border-radius: 5px; overflow-x: auto; }
#suppliesView table.data-table.sp-catalog-table { table-layout: fixed; width: 100%; min-width: 800px; margin: 0; }
#suppliesView table.data-table.sp-catalog-table thead th { padding: 7px 8px !important; background: #eaf4ff !important; border-color: #e1ecfb !important; color: var(--sp-ink) !important; font-size: .78rem !important; text-align: center; font-weight: 600 !important; }
#suppliesView table.data-table.sp-catalog-table tbody td { padding: 4px 8px !important; border-color: #e9f0fb !important; color: #7b87b0; text-align: center; font-size: .82rem; line-height: 1.6; height: 32px; }
#suppliesView table.data-table.sp-catalog-table th:nth-child(1) { width: 4%; }
#suppliesView table.data-table.sp-catalog-table th:nth-child(2) { width: 24%; }
#suppliesView table.data-table.sp-catalog-table th:nth-child(3) { width: 10%; }
#suppliesView table.data-table.sp-catalog-table th:nth-child(4) { width: 23%; }
#suppliesView table.data-table.sp-catalog-table th:nth-child(5) { width: 13%; }
#suppliesView table.data-table.sp-catalog-table th:nth-child(6) { width: 12%; }
#suppliesView table.data-table.sp-catalog-table th:nth-child(7) { width: 14%; }
#suppliesView table.data-table.sp-catalog-table td:last-child { min-width: 0; }
#suppliesView .sp-item-name { color: var(--sp-ink); font-size: .85rem; font-weight: 600; }
#suppliesView .sp-unit { display: inline; padding: 0; background: transparent; color: #7c87b4; border: 0; font-size: .82rem; font-weight: 500; }
#suppliesView .sp-chips { justify-content: center; gap: 5px; }
#suppliesView .sp-chip { max-width: 100%; padding: 2px 12px; border-radius: 20px; background: #e5efff; color: var(--sp-primary); font-size: .74rem; line-height: 1.5; }
#suppliesView .sp-chip-more { padding-inline: 10px; }
#suppliesView .sp-status-toggle { gap: 9px; }
#suppliesView .sp-status-toggle-track { flex-basis: 33px; width: 33px; height: 18px; background: #9ca6c8; }
#suppliesView .sp-status-toggle-track::after { width: 14px; height: 14px; top: 2px; inset-inline-start: 2px; }
#suppliesView .sp-status-toggle-input:checked + .sp-status-toggle-track { background: #11c38b; }
#suppliesView .sp-status-toggle-input:checked + .sp-status-toggle-track::after { inset-inline-start: 17px; }
#suppliesView .sp-status-toggle-text { font-size: .75rem; }
#suppliesView .sp-status-toggle-input:checked ~ .sp-status-toggle-text { color: #12b682; }
#suppliesView .sp-status-toggle-input:not(:checked) ~ .sp-status-toggle-text { color: #8a94b7; }
#suppliesView .sp-row-action { min-height: 24px; width: 112px; justify-content: center; padding: 2px 8px; border-radius: 6px; border-color: #d7e5ff; background: #edf4ff; color: var(--sp-primary); font-size: .75rem; }
#suppliesView .sp-row-action:hover { background: #dfeaff; border-color: #afc9ff; }
#suppliesView .sp-table-foot { padding: 12px 0 7px; border: 0; background: transparent; }
#suppliesView .sp-page-size { flex-direction: row; gap: 14px; font-size: .77rem; color: #8591b7; }
#suppliesView .sp-page-size select { min-width: 73px; min-height: 31px; color: var(--sp-ink); border-color: #e0e9fa; border-radius: 5px; }
#suppliesView .sp-pagination { direction: ltr; gap: 4px; }
#suppliesView .sp-page-btn { min-width: 32px; min-height: 30px; border: 1px solid #e1eafb; border-radius: 5px; color: #7a87b1; font-size: .8rem; }
#suppliesView .sp-page-btn.is-active { background: var(--sp-primary); border-color: var(--sp-primary); color: #fff; box-shadow: 0 2px 6px #0755ff25; }
@media (max-width: 1100px) {
    #suppliesView .sp-hero { grid-template-columns: minmax(230px, 1fr) minmax(0, 1.7fr); }
    #suppliesView .sp-hero-stats { gap: 12px; }
    #suppliesView .sp-stat { padding-inline-start: 12px; padding-inline-end: 65px; }
    #suppliesView .sp-stat-icon { width: 46px; height: 46px; inset-inline-end: 10px; top: 22px; }
    #suppliesView .sp-stat > span:not(.sp-stat-icon) { font-size: .76rem; }
    #suppliesView .sp-form-card { grid-template-columns: minmax(0, 1fr) 180px; gap: 0 18px; }
    #suppliesView .sp-table-head { flex-wrap: wrap; }
}
@media (max-width: 760px) {
    #suppliesView .sp-shell { padding: 10px 4px; gap: 14px; }
    #suppliesView .sp-hero { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    #suppliesView .sp-hero h2 { font-size: 1.6rem; }
    #suppliesView .sp-tabs { width: 100%; }
    #suppliesView .sp-tab { min-height: 44px; padding: 8px 5px; gap: 6px; }
    #suppliesView .sp-tab-copy strong { font-size: .76rem; }
    #suppliesView .sp-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    #suppliesView .sp-stat { min-height: 100px; padding-inline-end: 54px; }
    #suppliesView .sp-stat-icon { width: 34px; height: 34px; top: 16px; }
    #suppliesView .sp-stat-icon .sp-icon { width: 23px; height: 23px; }
    #suppliesView .sp-stat::before, #suppliesView .sp-stat::after { opacity: .2; }
    #suppliesView .sp-stat > small { font-size: .68rem; }
    #suppliesView .sp-form-card { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 0 12px 14px; }
    #suppliesView .sp-form-card .sp-card-head { padding-bottom: 0; }
    #suppliesView .sp-form-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 0; }
    #suppliesView .sp-form-actions { width: 100%; margin: 0; flex-direction: row; }
    #suppliesView .sp-table-head { flex-direction: column; align-items: stretch; padding-block: 12px; gap: 12px; }
    #suppliesView .sp-table-tools { width: 100%; margin: 0; gap: 8px; }
    #suppliesView .sp-search { flex: 1 1 170px; width: auto; }
    #suppliesView .sp-sort-slot { flex: 1 0 100%; order: 4; }
    #suppliesView .sp-table-foot { gap: 12px; }
    #suppliesView .sp-page-size { width: 100%; justify-content: space-between; }
    #suppliesView .sp-pagination { margin-inline: auto; }
    #suppliesView .sp-card-title h3 { font-size: 1.05rem; }
    #suppliesView .sp-card-title p { font-size: .75rem; }
    #suppliesView .sp-table-scroll { max-height: none; }
    #suppliesView .sp-row-action { min-height: 36px; }
    #suppliesView .sp-status-toggle { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
    #suppliesView *, #suppliesView *::before, #suppliesView *::after { transition: none !important; }
}
