/* PSK Business ERP — Purchase, Inventory and Steel module styles */

/* ---------- shared bits ---------- */
.po-ic { width: 48px; height: 48px; border-radius: 14px; }
.recv-cell { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.recv-cell .progress { flex: 1; }
.recv-cell small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; width: 34px; text-align: right; }
.sku { font-size: 12px; font-weight: 600; color: var(--text-2); background: #EEF2F8; padding: 2px 7px; border-radius: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.avail { min-width: 130px; max-width: 190px; }
.avail-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.avail-top b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.avail-top small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; }
.modal .totals input { height: 30px; }
.details .progress { margin-top: 7px; max-width: 160px; }

/* ---------- product form: conversion factors ---------- */
.alt-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.alt-row { display: grid; grid-template-columns: auto minmax(0, 1.1fr) auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.alt-row .alt-base { font-weight: 600; white-space: nowrap; }
.alt-row .icon-btn { width: 30px; height: 30px; min-height: 0; }

/* ---------- warehouses ---------- */
.wh-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.wh-head { display: flex; align-items: flex-start; gap: 12px; }
.wh-head .kpi-icon { background: var(--navy-50); color: var(--primary); width: 40px; height: 40px; }
.wh-head h3 { font-size: 15px; }
.wh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wh-stats > div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); }
.wh-stats small { display: block; color: var(--muted); font-size: 11.5px; }
.wh-stats b { font-size: 16px; font-weight: 700; }
.wh-share small { display: block; margin-top: 5px; color: var(--muted); font-size: 11.5px; }
.wh-top { list-style: none; margin: 0; padding: 0; font-size: 13px; flex: 1; }
.wh-top li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.wh-top li:last-child { border-bottom: 0; }
.wh-top a { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 500; }
.wh-top span { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wh-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: -2px; }

/* six-KPI rows: 3 × 2 on normal desktops, 6 across on very wide screens */
.kpi-grid.kpi-six, .steel-kpis .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1700px) { .kpi-grid.kpi-six, .steel-kpis .kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 760px) { .kpi-grid.kpi-six, .steel-kpis .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- steel: KPI accent ---------- */
.steel-kpis .kpi { border-top: 3px solid var(--primary); }
.steel-kpis .kpi-blue { border-top-color: var(--secondary); } .steel-kpis .kpi-teal { border-top-color: var(--teal); } .steel-kpis .kpi-violet { border-top-color: var(--violet); }
.steel-kpis .kpi-amber { border-top-color: var(--accent); } .steel-kpis .kpi-red { border-top-color: var(--danger); }

/* ---------- steel: diameter rack ---------- */
.rack { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 16px; border-radius: var(--radius); background: linear-gradient(160deg, #16365F, #0F2747); box-shadow: var(--shadow-sm); }
.rack-tile { position: relative; padding: 14px 14px 12px; border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); color: #fff; min-width: 0; }
.rack-tile.low { border-color: rgba(245, 158, 11, .6); }
.rack-rod { height: 54px; display: flex; align-items: center; }
.rack-rod i, .rod-badge i { display: block; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #E7ECF4 0%, #A9B5C7 38%, #5E6C82 72%, #3B475B 100%); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18), 0 3px 8px rgba(0, 0, 0, .35); }
.rack-d { position: absolute; right: 14px; top: 12px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.rack-d small { font-size: 11px; font-weight: 500; color: #9FB4D4; margin-left: 2px; }
.rack-t { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rack-s { font-size: 11.5px; color: #9FB4D4; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rack-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); margin-top: 10px; overflow: hidden; }
.rack-bar i { display: block; height: 100%; border-radius: 4px; background: #F59E0B; }
.rack-flag { position: absolute; right: 14px; top: 42px; display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px; background: rgba(245, 158, 11, .2); color: #FCD38A; font-size: 10.5px; font-weight: 700; }

.dia { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dia i { display: inline-block; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #DCE3EE, #7C8AA0 60%, #47546A); flex: none; }

/* stock vs minimum */
.cover-list { display: flex; flex-direction: column; gap: 11px; }
.cover-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 46px; align-items: center; gap: 12px; color: var(--text); font-size: 13px; }
.cover-row:hover { text-decoration: none; }
.cover-row:hover .cover-name { color: var(--secondary); }
.cover-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.cover-bar { position: relative; height: 8px; border-radius: 6px; background: #EEF2F8; }
.cover-bar i { display: block; height: 100%; border-radius: 6px; }
.cover-bar em, .cover-legend em { position: absolute; left: 33.33%; top: -3px; bottom: -3px; width: 2px; background: var(--primary); border-radius: 2px; }
.cover-row b { text-align: right; font-variant-numeric: tabular-nums; }
.cover-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.cover-legend span { position: relative; }
.cover-legend em { position: static; display: inline-block; height: 12px; vertical-align: -2px; margin-right: 4px; }

/* price matrix + price editor */
.price-matrix td.best { background: var(--green-50); }
.price-matrix td.best a { color: #15803D; font-weight: 700; }
.price-matrix td a { color: var(--text); font-variant-numeric: tabular-nums; }
#price-table tr.dirty td { background: var(--amber-50); }
#price-table tr.dirty input { border-color: var(--accent); }
.simple-table tr.on td { background: var(--blue-50); }

/* calculator */
.calc-out { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.calc-tile, .unit-tile { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); min-width: 0; }
.calc-tile { border-left: 3px solid var(--primary); }
.calc-tile small, .unit-tile small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.calc-tile b, .unit-tile b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0; }
.calc-tile span, .unit-tile span { color: var(--muted); font-size: 11.5px; }

/* steel product detail */
.steel-head { background: linear-gradient(160deg, #16365F, #0F2747); border-color: #0F2747; color: #fff; }
.steel-head .meta { color: #B7C7DF; }
.steel-head .btn-ghost { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; box-shadow: none; }
.steel-head .btn-ghost:hover { background: rgba(255, 255, 255, .18); }
.rod-badge { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); flex: none; }
.unit-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.unit-tile { border-top: 3px solid var(--primary); }

@media (max-width: 1280px) {
  .unit-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .calc-out { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .rack { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; gap: 8px; }
  .unit-tiles, .calc-out { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .calc-tile b, .unit-tile b { font-size: 17px; }
  .alt-row { grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto; }
  .alt-row .alt-base { display: none; }
  .wh-stats b { font-size: 14px; }
  .cover-row { grid-template-columns: minmax(0, 1fr) 70px 42px; }
  .avail { min-width: 104px; }
}
