/* Lifted from the <style> block of mocks/admin/inventory/returns.html.
   Left behind on purpose: the :root token block, .ti, .img-ph, .content and
   .topbar-* - all of them either fight admin.css or already live there. */

.ret-stats-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:20px}


.req-note{display:flex;gap:10px;align-items:flex-start;background:var(--primary-ll);border:1px solid var(--primary-l);border-radius:12px;padding:13px 16px;margin-bottom:16px;font-size:13px;line-height:1.7;color:var(--primary)}
.req-note i{font-size:16px;flex-shrink:0;margin-top:2px}
/* The flex column holding the text. Named so it keeps the note's own size -
   a bare div is not a phrasing element, so the shared inherit rule skips it. */
.req-note>div{font-size:inherit}
.photo-chip{display:inline-flex;align-items:center;gap:4px;background:#F1F5F9;color:#475569;border-radius:8px;padding:3px 9px;font-size:11px;font-weight:700}

.ret-list{display:flex;flex-direction:column;gap:10px;}
.ret-card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:16px;display:flex;align-items:center;gap:14px;cursor:pointer;transition:.15s;}
.ret-card:hover{border-color:var(--primary);box-shadow:var(--elev-1);}
.ret-card-icon{width:48px;height:48px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:24px;flex-shrink:0;}
.ret-card-icon.pending{color:var(--warning)}
.ret-card-icon.partial{color:var(--primary)}
.ret-card-info{flex:1;min-width:0;}
.ret-card-top{display:flex;align-items:center;gap:8px;margin-bottom:4px;}
.ret-card-id{font-weight:700;font-size:14px;color:var(--text);}
.ret-card-type{font-size:11px;padding:2px 8px;border-radius:10px;font-weight:600;}
.type-sales{background:var(--primary-l);color:var(--primary);}
.ret-card-customer{font-size:13px;color:var(--text2);}
.ret-card-meta{display:flex;gap:12px;margin-top:6px;flex-wrap:wrap}
.ret-meta-item{font-size:11px;color:var(--muted);display:flex;align-items:center;gap:4px;}
.ret-card-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px;flex-shrink:0;}
.ret-card-amount{font-size:16px;font-weight:700;}
.ret-status{font-size:11px;padding:3px 10px;border-radius:10px;font-weight:600;}
.status-pending{background:var(--warning-l);color:var(--warning);}
.status-partial{background:var(--primary-l);color:var(--primary);}
.status-done{background:var(--success-l);color:var(--success);}
.btn-receive{background:var(--primary);color:#fff;border:none;padding:8px 16px;border-radius:8px;font-size:13px;font-weight:700;cursor:pointer;white-space:nowrap;font-family:inherit}
.btn-receive:hover{background:var(--primary-d);}

.log-filters{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap;}
.log-filters select,.log-filters input{padding:7px 12px;border:1px solid var(--border);border-radius:8px;font-size:13px;font-family:inherit;color:var(--text);background:var(--card);outline:none;}
.log-filters select:focus,.log-filters input:focus{border-color:var(--primary);}
.log-table{width:100%;border-collapse:collapse;background:var(--card);border-radius:12px;overflow:hidden;box-shadow:var(--elev-1);}
.log-table th{background:var(--bg);color:var(--muted);padding:10px 14px;text-align:right;font-size:11px;font-weight:700;border-bottom:2px solid var(--border)}
.log-table td{padding:11px 14px;border-bottom:1px solid var(--border);font-size:13px;vertical-align:middle;}
.log-table tr:last-child td{border-bottom:none;}
.log-table tr:hover td{background:var(--primary-ll);}
.move-type{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:8px;font-size:11px;font-weight:700;}
.move-in{background:var(--success-l);color:var(--success);}
.move-out{background:var(--danger-l);color:var(--danger);}
.move-writeoff{background:var(--slate-l);color:var(--slate);}
.move-adjust{background:var(--warning-l);color:var(--warning);}
.qty-change{font-weight:700;}
.qty-plus{color:var(--success);}
.qty-minus{color:var(--danger);}
.qty-neutral{color:var(--slate);}

.damaged-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px;}
.damaged-card{background:var(--card);border:1px solid var(--danger-l);border-radius:12px;padding:14px;}
.damaged-card-top{display:flex;align-items:center;gap:10px;margin-bottom:10px;}
.damaged-icon{width:40px;height:40px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:20px;color:var(--danger)}
.damaged-rows{display:flex;flex-direction:column;gap:6px;}
.damaged-row{display:flex;justify-content:space-between;font-size:12px;}
.damaged-row .dl{color:var(--muted);}
.damaged-row .dv{font-weight:600;}

/* From the receive modal in the mockup */
.rec-instruction{background:var(--primary-ll);border:1px solid var(--primary-l);border-radius:10px;padding:10px 14px;font-size:12px;color:var(--primary);margin-bottom:14px;line-height:1.7}
.rec-section-title{font-size:13px;font-weight:700;margin-bottom:10px;display:flex;align-items:center;gap:6px}
.rec-table{width:100%;border-collapse:collapse;border:1px solid var(--border);border-radius:10px;overflow:hidden}
.rec-table th{background:var(--bg);padding:9px 12px;text-align:right;font-size:11px;font-weight:700;color:var(--muted)}
.rec-table td{padding:9px 12px;border-bottom:1px solid var(--border);font-size:13px;vertical-align:middle}
.rec-table tr:last-child td{border-bottom:none}
.prod-cell{display:flex;align-items:center;gap:8px}
.prod-emoji{color:#A9B7CE}
.inv-qty{font-weight:700;color:var(--muted)}
.cond-select{padding:6px 10px;border:1px solid var(--border);border-radius:8px;font-size:12px;font-family:inherit;background:var(--card);outline:none;width:100%}
.cond-good{border-color:var(--success);color:var(--success)}
.cond-damaged{border-color:var(--danger);color:var(--danger)}

/* The return's stages, tinted the way its badges are: waiting, in motion, in the
   building, seen, closed - and a refusal in the rejection colour, not in grey, for
   the same reason an order's cancellation stopped being grey. */
.st-tab.ret-all{background:var(--bg)}
.st-tab.ret-pending{background:#FEF3C7}
.st-tab.ret-approved{background:var(--primary-l)}
.st-tab.ret-collected{background:var(--orange-l)}
.st-tab.ret-inspected{background:var(--accent-l)}
.st-tab.ret-done{background:var(--success-l)}
.st-tab.ret-void{background:var(--danger-l);color:var(--danger)}

.ret-row{cursor:pointer}
.ret-row:hover{background:var(--bg)}
.ret-row-date{font-size:11px;color:var(--muted)}
.ret-search{min-width:280px}

.rec-subtitle{font-size:11px;color:var(--muted);margin-top:2px}
/* The reason box replaces the footer buttons rather than sitting above them: it is
   the question being asked, and leaving "موافقة" reachable beside it invites the
   wrong one. */
.rec-reject{display:flex;gap:8px;align-items:center;width:100%}
.rec-reject .form-input{flex:1}

/* Scoped the way the order modal's are: the alignment helpers belong to the table
   that uses them rather than being loose utilities the whole admin inherits. */
.rec-table .ta-c{text-align:center}
.rec-table .ta-l{text-align:left}
.rec-table .num{font-weight:700}
.rec-table th.col-prod{min-width:200px}
.rec-table th.col-cond{min-width:160px}
.log-table .muted-cell{color:var(--muted)}
.rec-instruction.is-after{margin-top:14px}

/* Registering a return by hand. */
.reg-picks{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}
.reg-pick{display:flex;align-items:center;gap:12px;width:100%;padding:10px 14px;border:1px solid var(--border);border-radius:var(--radius);background:var(--card);font-family:inherit;font-size:13px;color:var(--text);cursor:pointer;text-align:start}
.reg-pick:hover{border-color:var(--primary);background:var(--primary-ll)}
.reg-pick span{color:var(--muted)}
.reg-pick-total{margin-inline-start:auto;font-weight:700;color:var(--text2)}

/* Two events, not two labels for one: the goods are either here or they are not, and
   the answer decides whether a driver still has to go. */
.reg-how{display:flex;gap:10px;margin-bottom:14px}
.reg-how-btn{flex:1;display:flex;align-items:center;gap:10px;padding:12px 14px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--card);font-family:inherit;color:var(--text);cursor:pointer;text-align:start}
.reg-how-btn i{font-size:20px;color:var(--muted)}
.reg-how-btn b{display:block;font-size:13px;font-weight:700;line-height:1.5}
.reg-how-btn small{display:block;font-size:12px;color:var(--muted);line-height:1.55}
.reg-how-btn.is-on{border-color:var(--primary);background:var(--primary-ll);box-shadow:var(--elev-1)}
.reg-how-btn.is-on i{color:var(--primary)}

.reg-qty{display:flex;align-items:center;gap:8px;justify-content:center}
.reg-qty .form-input{width:74px;text-align:center}
.reg-max{font-size:11px;color:var(--muted);white-space:nowrap}
.rec-table tr.reg-done{opacity:.55}

.reg-override{display:flex;align-items:flex-start;gap:8px;padding:10px 14px;border:1px solid var(--warning);border-radius:var(--radius);background:var(--warning-ll);font-size:12px;line-height:1.55}
.reg-override input{margin-top:2px}

/* ── The screen on one axis ───────────────────────────────────────────────────
   The header stood at 20 and everything under it ran wall to wall, so the page
   read as a title with four loose objects below rather than one screen - the same
   thing measured and fixed on orders, invoices and customers.
   And the bands needed a rhythm as well as an axis: the strip carried no top margin
   at all, so the cards sat flush against the header's bottom edge with nothing
   between the title and the figures; the gaps under it were 20 and 18, against the
   12 every other screen uses between bands. One value now, on all of them. */
.ret-stats-strip{margin:12px 20px}
.req-note{margin:0 20px 12px}

/* The filter row is this screen's own band, so it takes the panel's padding and
   the hairline the shared .filters-row gets. */
.control-panel>.log-filters{margin:0;padding:12px 16px;border-bottom:1px solid var(--border)}
.control-panel>.log-filters:last-child{border-bottom:none}

/* Inside a panel the table is the panel's body: its own radius and shadow would
   draw a second frame around the first (the trap from 9 September). */
.list-panel>.log-table{border-radius:0;box-shadow:none}
/* The cards need air; the pager under them is the panel's footer and must stay flush
   with its edge, the way the tables' do. So the padding goes on the body, not the panel. */
.dmg-body{padding:16px}

/* The sentence under a panel, on the panel's axis rather than stuck to the page
   edge. Not .ref-note: that name already belongs to the catalogue tabs, where it
   is a panel's own footer with a rule over it and a card background - same word,
   different object, which is the collision check's whole job. */
.ret-hint{margin:0 20px 20px;font-size:12px;color:var(--muted);line-height:1.6}
.ret-hint strong{color:var(--text2)}

/* The running total beside the damaged filters. Counted over everything that matches,
   not over the page - a figure taken off a page changes when you turn it. */
.dmg-sum{margin-inline-start:auto;display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:var(--danger)}

/* A payment row that is also a button: it opens the note. Same row, so the invoice's
   two histories read as one kind of thing. */
.inv-cn-row{width:100%;border:none;background:none;font-family:inherit;cursor:pointer;text-align:start}
.inv-cn-row:hover{background:var(--primary-ll)}
.inv-cn-row .ph-amount{color:var(--danger)}

/* Splitting a line by condition. Each state gets a box and the row says what is still
   unplaced - every unit has to land somewhere or there are goods nobody accounts for. */
.cond-split{display:flex;flex-direction:column;gap:5px;min-width:190px}
.cond-row{display:flex;align-items:center;gap:8px}
.cond-lbl{flex:1;font-size:12px;color:var(--text2)}
.cond-row .form-input{width:64px;text-align:center;padding:5px 6px}
.cond-left{font-size:11px;color:var(--warning);font-weight:700}
.cond-left.is-done{color:var(--success)}

/* ---- the stocktake ---- */

/* The row is the way into the sheet, the same as an order row and an invoice row. */
.sc-row{cursor:pointer}

/* A surplus and a shortage are two directions of the same figure, and the eye needs
   to tell them apart down a column without reading the sign. */
.sc-plus{color:var(--success);font-weight:700}
.sc-minus{color:var(--danger);font-weight:700}

/* What the sheet says about itself, across the top of the window. */
.sc-sub{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);margin-top:4px;line-height:1.45}

.sc-stats{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin-bottom:12px}

.sc-stat{border:1px solid var(--border);border-radius:var(--radius);background:var(--card);padding:10px 12px;line-height:1.45}
.sc-s-lbl{display:block;font-size:11px;color:var(--muted)}
.sc-s-val{font-size:16px;font-weight:800;margin-top:2px}

/* The counted-quantity box. Narrow on purpose: it holds a shelf count, not a price. */
.sc-qty{width:76px;text-align:center;padding:5px 6px}

/* Goods on an order that has not left yet: physically on the shelf, already out of the
   balance. The figure carries the colour rather than the row - on a real shelf most
   products have something on order, and tinting every row turns the table yellow and
   stops meaning anything. */
.sc-hold{font-size:11px;font-weight:700;color:var(--warning)}

.sc-report{margin:16px 20px 0}

/* ---- the stock report ---- */

/* Twelve columns of figures. They are narrow and the product name is not, so the name
   takes whatever is left and the rest are sized to a four-digit quantity. */
.led-table th, .led-table td { white-space: nowrap; }
.led-table td:first-child, .led-table th:first-child { white-space: normal; min-width: 180px; }

/* What the whole filter holds, beside the filters. Not the damaged tab's red - that
   one is a loss and this is simply what is on the shelf. */
.led-sum {
    margin-inline-start: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text2);
}

/* The print button and the sentences that keep the report from being misread, on the
   same line under the table - both are about the table as a whole. */
.led-foot {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 12px 20px 0;
}

.led-foot .ret-hint { margin: 0; flex: 1; }
