/* ================= Inventory Manager — extends style.css ================= */

.mgr-hero{ padding:80px 0 48px; }
.mgr-hero h1{ font-size:clamp(2.1rem, 4.5vw, 3rem); line-height:1.08; }
.mgr-hero h1 em{ font-style:normal; color:var(--royal-bright); }
.mgr-hero .sub{ max-width:560px; margin-top:12px; color:var(--silver-dim); font-size:0.95rem; }

/* nav pill for current page */
.pill-nav-active{ color:var(--royal-bright) !important; }

/* ---- stat strip (plain, no boxes — just numbers) ---- */
.stat-strip{
  display:flex; flex-wrap:wrap; gap:36px;
  margin-top:36px; padding-top:28px; border-top:1px solid var(--panel-line);
}
.stat-box{ min-width:90px; }
.stat-box .n{ font-family:'IBM Plex Mono'; font-size:1.7rem; color:#fff; font-weight:600; line-height:1; }
.stat-box .l{ font-family:'IBM Plex Mono'; font-size:0.66rem; letter-spacing:0.08em; text-transform:uppercase; color:var(--silver-dim); margin-top:8px; }
.stat-box.warn .n{ color:#e0a52c; }
.stat-box.crit .n{ color:#e0294b; }

/* ---- toolbar ---- */
.toolbar{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
  margin-bottom:24px;
}
.toolbar .search-wrap{ position:relative; flex:1 1 240px; min-width:200px; }
.toolbar .search-wrap i{ position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--silver-dim); font-size:0.8rem; }
.toolbar select{ width:auto; min-width:140px; }

/* ---- bottom utility row (understated, text-like) ---- */
.bottom-bar{
  display:flex; gap:6px; flex-wrap:wrap; margin-top:16px;
  padding-top:16px; border-top:1px solid var(--panel-line);
}

input[type="text"], input[type="number"], input[type="search"], select, textarea{
  font-family:'IBM Plex Mono'; font-size:0.83rem; color:#fff;
  background:var(--black); border:1px solid var(--panel-line); border-radius:var(--radius);
  padding:10px 14px; width:100%;
  transition:border-color .15s ease;
}
.toolbar .search-wrap input{ padding-left:38px; }
input::placeholder, textarea::placeholder{ color:var(--silver-dim); }
input:focus, select:focus, textarea:focus{ outline:none; border-color:var(--royal-bright); }
select{ appearance:none; -webkit-appearance:none; cursor:pointer; }

.field{ display:flex; flex-direction:column; gap:6px; }
.field label{
  font-family:'IBM Plex Mono'; font-size:0.66rem; letter-spacing:0.08em; text-transform:uppercase; color:var(--silver-dim);
}
.field-row{ display:grid; grid-template-columns:repeat(auto-fit, minmax(160px,1fr)); gap:14px; }

button{ font-family:inherit; cursor:pointer; }
.btn{ border:1px solid var(--royal-bright); background:transparent; border-radius:var(--radius); }
.btn.sm{ padding:8px 14px; font-size:0.7rem; }
.btn.primary{ background:var(--royal); border-color:var(--royal-bright); }
.btn.primary:hover{ background:var(--royal-bright); }
.btn.ghost{ border-color:transparent; color:var(--silver-dim); }
.btn.ghost:hover{ color:#fff; border-color:var(--panel-line); }
.btn.danger{ border-color:transparent; color:var(--silver-dim); }
.btn.danger:hover{ color:#ff6b83; border-color:#e0294b; }
.btn:disabled{ opacity:0.35; cursor:not-allowed; }

/* ---- inventory table ---- */
.inv-table-wrap{ border-top:1px solid var(--panel-line); }
table.inv{ width:100%; border-collapse:collapse; font-family:'IBM Plex Mono'; font-size:0.82rem; }
table.inv th{
  text-align:left; color:var(--silver-dim); font-weight:500; text-transform:uppercase;
  letter-spacing:0.05em; font-size:0.66rem; padding:14px 10px; border-bottom:1px solid var(--panel-line);
  cursor:pointer; white-space:nowrap; user-select:none;
}
table.inv th:first-child{ padding-left:0; }
table.inv th:hover{ color:var(--royal-bright); }
table.inv th .arrow{ opacity:0.5; margin-left:4px; font-size:0.6rem; color:var(--royal-bright); }
table.inv td{ padding:14px 10px; border-bottom:1px solid var(--panel-line); vertical-align:middle; color:var(--silver); }
table.inv td:first-child{ padding-left:0; }
table.inv td:last-child, table.inv th:last-child{ padding-right:0; }
table.inv tbody tr:last-child td{ border-bottom:none; }
table.inv tbody tr{ transition:background .15s ease; }
table.inv tbody tr:hover{ background:rgba(63,107,255,0.04); }
table.inv td.name{ color:#fff; font-weight:500; }
table.inv td.sku{ color:var(--silver-dim); }

.src-badge{
  font-size:0.62rem; letter-spacing:0.05em; text-transform:uppercase;
  color:var(--silver-dim); white-space:nowrap; display:inline-block;
}
.src-badge.vex{ color:#8fa8ff; }
.src-badge.robosource{ color:#f0c060; }

.qty-cell{ display:flex; align-items:center; gap:10px; }
.qty-cell .qbtn{
  width:22px; height:22px; border:none; border-radius:var(--radius);
  background:transparent; color:var(--silver-dim); display:flex; align-items:center; justify-content:center;
  font-size:0.95rem; line-height:1; flex-shrink:0;
}
.qty-cell .qbtn:hover{ color:var(--royal-bright); }
.qty-cell .qnum{ min-width:22px; text-align:center; font-weight:600; color:#fff; }
.qty-cell .qnum.low{ color:#e0a52c; }
.qty-cell .qnum.zero{ color:#e0294b; }

.stock-tag{ font-size:0.66rem; text-transform:uppercase; letter-spacing:0.05em; }
.stock-tag.ok{ color:var(--silver-dim); }
.stock-tag.low{ color:#f0c060; }
.stock-tag.out{ color:#ff6b83; }

.row-actions{ display:flex; gap:4px; justify-content:flex-end; opacity:0; transition:opacity .15s ease; }
table.inv tbody tr:hover .row-actions{ opacity:1; }
.icon-btn{
  width:26px; height:26px; border-radius:var(--radius); border:none;
  background:transparent; color:var(--silver-dim); display:flex; align-items:center; justify-content:center;
  font-size:0.78rem;
}
.icon-btn:hover{ color:var(--royal-bright); }
.icon-btn.del:hover{ color:#ff6b83; }

.empty-state{ text-align:center; padding:60px 20px; color:var(--silver-dim); }
.empty-state i{ font-size:1.8rem; margin-bottom:12px; display:block; opacity:0.4; }

/* ---- modal (add/edit item) ---- */
.modal-overlay{
  position:fixed; inset:0; background:rgba(10,12,16,0.82); backdrop-filter:blur(4px);
  display:none; align-items:center; justify-content:center; z-index:100; padding:20px;
}
.modal-overlay.active{ display:flex; }
.modal-box{
  width:100%; max-width:540px; max-height:90vh; overflow-y:auto;
  border:1px solid var(--panel-line); border-radius:14px;
  background:var(--panel);
  padding:26px; position:relative;
}
.modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; }
.modal-head h3{ font-size:1.1rem; }
.modal-close{ background:none; border:none; color:var(--silver-dim); font-size:1.2rem; }
.modal-close:hover{ color:#fff; }
.modal-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:24px; }

/* ---- toast ---- */
.toast{
  position:fixed; bottom:24px; right:24px; background:var(--panel); border:1px solid var(--panel-line);
  border-left:2px solid var(--royal-bright);
  border-radius:var(--radius); padding:13px 18px; font-family:'IBM Plex Mono'; font-size:0.78rem;
  color:#fff; z-index:200; box-shadow:0 14px 30px -20px rgba(0,0,0,0.7);
  transform:translateY(20px); opacity:0; pointer-events:none; transition:all .2s ease;
}
.toast.show{ transform:translateY(0); opacity:1; }

.hidden{ display:none !important; }

@media (max-width:700px){
  .toolbar{ flex-direction:column; align-items:stretch; }
  table.inv{ min-width:560px; }
  .inv-table-wrap{ overflow-x:auto; }
  .row-actions{ opacity:1; }
}
