/* StockPulse — Shared Styles */

:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;

  --primary: #2563eb;
  --primary2: #1d4ed8;

  --danger: #ef4444;
  --warn: #f59e0b;
  --good: #22c55e;
  --over: #fb923c;

  --shadow: 0 12px 28px rgba(0,0,0,.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  background: radial-gradient(1200px 600px at 10% 0%, #eef2ff 0%, transparent 55%),
              radial-gradient(1200px 600px at 90% 0%, #ecfeff 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  overflow-x: auto;
}

.appWrap {
  width: 100%;
  margin: 18px 0 36px;
  padding: 0 14px;
  min-width: 360px;
}

/* ===== Topbar ===== */
.topbar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brandLine {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.brand {
  color: #00a9b5;
  font-weight: 900;
  letter-spacing: .2px;
  font-size: 20px;
}
.sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.pillMini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fafafa;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  user-select: none;
  white-space: nowrap;
}
.dotMini { width: 9px; height: 9px; border-radius: 999px; background: var(--primary); }

.topActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

/* ===== Buttons ===== */
button {
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
  font-size: 13px;
  transition: transform .08s ease, background .12s ease, box-shadow .12s ease, opacity .12s ease;
  box-shadow: 0 6px 14px rgba(37,99,235,.18);
}
button:hover { background: var(--primary2); transform: translateY(-1px); }
button:active { transform: translateY(0px); }
button.secondary { background: #0f766e; box-shadow: 0 6px 14px rgba(15,118,110,.16); }
button.secondary:hover { background: #115e59; }
button.warn { background: #b45309; box-shadow: 0 6px 14px rgba(180,83,9,.16); }
button.warn:hover { background: #92400e; }
button.gray { background: #374151; box-shadow: 0 6px 14px rgba(55,65,81,.16); }
button.gray:hover { background: #1f2937; }
button:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ===== Cards ===== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

/* ===== Summary pills ===== */
.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.pill {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fafafa;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.dot { width: 10px; height: 10px; border-radius: 999px; background: #9ca3af; }
.pill.critical .dot { background: var(--danger); }
.pill.ok .dot { background: var(--warn); }
.pill.good .dot { background: var(--good); }
.pill.over .dot { background: var(--over); }
.pill.invalid .dot { background: #6b7280; }
.pill.total { background: #fff; }
.pill.mode {
  background: rgba(37,99,235,.08);
  border-color: rgba(37,99,235,.25);
}
.pill.mode .dot { background: var(--primary); }

.pill.dirty {
  background: rgba(37,99,235,.08);
  border-color: rgba(37,99,235,.25);
}
.pill.dirty .dot { background: var(--primary); }

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: .4px;
  font-size: 12px;
}
.badge.critical { background: rgba(239,68,68,.12); color: var(--danger); border: 1px solid rgba(239,68,68,.25); }
.badge.ok { background: rgba(245,158,11,.15); color: #92400e; border: 1px solid rgba(245,158,11,.25); }
.badge.good { background: rgba(34,197,94,.12); color: #166534; border: 1px solid rgba(34,197,94,.25); }
.badge.invalid { background: rgba(107,114,128,.12); color: #374151; border: 1px solid rgba(107,114,128,.25); }
.badge.over { background: rgba(251,146,60,.14); color: #9a3412; border: 1px solid rgba(251,146,60,.25); }

/* ===== Chips ===== */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 11.5px;
  letter-spacing: .2px;
  border: 1px solid transparent;
  background: #f3f4f6;
  color: #111827;
  white-space: nowrap;
}
.chip.type { background: rgba(37,99,235,.10); border-color: rgba(37,99,235,.20); color: #1d4ed8; }
.chip.tag { background: rgba(15,118,110,.10); border-color: rgba(15,118,110,.18); color: #115e59; }
.chip.audAll { background: rgba(34,197,94,.10); border-color: rgba(34,197,94,.18); color: #166534; }
.chip.audMgr { background: rgba(245,158,11,.10); border-color: rgba(245,158,11,.18); color: #92400e; }
.chip.arch { background: rgba(107,114,128,.10); border-color: rgba(107,114,128,.18); color: #374151; }
.chip.role { background: rgba(37,99,235,.10); border-color: rgba(37,99,235,.20); color: #1d4ed8; }
.chip.inactive { background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.18); color: #b91c1c; }
.chip.pin { background: rgba(15,118,110,.10); border-color: rgba(15,118,110,.18); color: #115e59; }
.chip.removed { background: rgba(55,65,81,.10); border-color: rgba(55,65,81,.18); color: #1f2937; }

/* ===== Hints ===== */
.hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.5;
}

/* ===== Login ===== */
.loginGrid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
  align-items: stretch;
}
.loginHero {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(0,169,181,.10), rgba(37,99,235,.10));
}
.loginHero h1 { margin: 0 0 8px; font-size: 24px; }
.loginHero p { margin: 0; color: var(--muted); font-weight: 650; line-height: 1.4; }
.loginBox label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 900;
  margin-bottom: 6px;
}
.loginBox input {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-weight: 750;
  background: #fff;
  margin-bottom: 10px;
}
.loginBox input:focus {
  outline: none;
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.loginError {
  background: rgba(239,68,68,.10);
  border: 1px solid rgba(239,68,68,.25);
  color: #b91c1c;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 750;
  font-size: 13px;
  margin-bottom: 10px;
}

/* ===== Home / Dashboard ===== */
.homeHeader {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.homeHeader h2 { margin: 0; font-size: 18px; }
.homeHeader small { color: var(--muted); font-weight: 700; }

.storeGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 12px;
}
.storeCard {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,.05);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 190px;
  position: relative;
  transition: transform .10s ease, box-shadow .12s ease, border-color .12s ease;
}
.storeCard:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0,0,0,.08);
  border-color: rgba(37,99,235,.22);
}
.storeTitle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.storeTitle .name {
  font-weight: 900;
  font-size: 15px;
  letter-spacing: .1px;
}
.storeTitle .meta {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.35;
}

.storeActionsCol {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: auto;
}
.btnTiny {
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 800;
  width: 100%;
  justify-content: center;
}
.ghost {
  background: rgba(17,24,39,.06);
  color: var(--text);
  border: 1px solid rgba(17,24,39,.10);
  box-shadow: none;
}
.ghost:hover { background: rgba(17,24,39,.10); transform: none; }
button.danger, .btnTiny.danger {
  background: rgba(239,68,68,.10);
  color: #b91c1c;
  border: 1px solid rgba(239,68,68,.20);
  box-shadow: none;
}
button.danger:hover, .btnTiny.danger:hover { background: rgba(239,68,68,.20); transform: none; }
.storeCard.storeDeleted { opacity: 0.55; border-style: dashed; }

.homeFilters {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
}
.homeFilters input, .homeFilters select {
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-weight: 750;
  background: #fff;
}
.homeFilters input:focus, .homeFilters select:focus {
  outline: none;
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

/* ===== Section Titles ===== */
.sectionTitle {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.sectionTitle h2 { margin: 0; font-size: 18px; letter-spacing: .15px; }
.sectionTitle small { color: var(--muted); font-weight: 700; }

/* ===== Two-column grid ===== */
.grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  align-items: start;
}

/* ===== Controls / Filters ===== */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.controls .label, .filters .label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  margin-right: 2px;
}
.controls input[type="text"], .controls select,
.filters input, .filters select {
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-weight: 700;
  background: #fff;
}
.controls input:focus, .controls select:focus,
.filters input:focus, .filters select:focus {
  outline: none;
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fafafa;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  user-select: none;
}
.toggle input { transform: translateY(1px); }

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.tabBtn {
  background: rgba(17,24,39,.06);
  color: var(--text);
  border: 1px solid rgba(17,24,39,.10);
  box-shadow: none;
  font-weight: 850;
}
.tabBtn:hover { background: rgba(17,24,39,.10); transform: none; }
.tabBtn.active {
  background: rgba(37,99,235,.12);
  border-color: rgba(37,99,235,.25);
  color: #1d4ed8;
}
.tabView { display: none; }
.tabView.active { display: block; }

/* ===== Charts ===== */
.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.chartCard {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}
.chartCard h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .2px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.chartCard h3 small {
  color: var(--muted);
  font-weight: 800;
  font-size: 11px;
}
canvas {
  width: 100%;
  height: 240px;
  display: block;
  border-radius: 12px;
  background: #fafafa;
  border: 1px solid var(--line);
}

/* ===== Tables ===== */
.tableWrap {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0b1220;
  color: #fff;
  font-weight: 800;
  font-size: 12.5px;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  white-space: nowrap;
  text-align: left;
}
tbody td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  white-space: nowrap;
}
tbody tr:hover td { background: #f9fafb; }

/* ===== Forms ===== */
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 900;
  margin: 8px 0 6px;
}
input[type="text"], input[type="email"], input[type="password"],
textarea, select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-weight: 700;
  background: #fff;
}
textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.4;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.formGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.actionsRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

/* ===== Note form / list ===== */
.noteForm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.noteActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  margin-top: 10px;
}
.noteList {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.noteRow {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}
.noteRow:last-child { border-bottom: none; }
.noteLeft { flex: 1; min-width: 0; }
.noteTitle {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 6px;
}
.noteMeta {
  color: var(--muted);
  font-weight: 750;
  font-size: 12px;
}
.noteText {
  font-weight: 650;
  color: #111827;
  white-space: pre-wrap;
  word-break: break-word;
}
.noteBtns {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== Icon buttons ===== */
.iconBtn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  border: 1px solid rgba(17,24,39,.10);
  background: rgba(17,24,39,.06);
  color: #111827;
  font-weight: 900;
  cursor: pointer;
}
.iconBtn:hover { background: rgba(17,24,39,.10); transform: none; }
.iconBtn.danger {
  background: rgba(239,68,68,.10);
  border: 1px solid rgba(239,68,68,.18);
  color: #b91c1c;
}
.iconBtn.danger:hover { background: rgba(239,68,68,.16); }
.iconBtn.restore {
  background: rgba(34,197,94,.10);
  border: 1px solid rgba(34,197,94,.18);
  color: #166534;
}
.iconBtn.restore:hover { background: rgba(34,197,94,.16); }
.iconBtn.keep {
  background: rgba(55,65,81,.10);
  border: 1px solid rgba(55,65,81,.18);
  color: #1f2937;
}
.iconBtn.keep:hover { background: rgba(55,65,81,.16); }

/* ===== User list ===== */
.list {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.row {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}
.row:last-child { border-bottom: none; }
.left { flex: 1; min-width: 0; }
.titleLine {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 6px;
}
.name {
  font-weight: 900;
  letter-spacing: .1px;
}
.meta {
  color: var(--muted);
  font-weight: 750;
  font-size: 12px;
}
.btns {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== Rail card ===== */
.railCard code {
  background: #f3f4f6;
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 12px;
}
.railNotesHeader {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.railNotesHeader h2 { margin: 0; font-size: 16px; }
.railNotesHeader small { color: var(--muted); font-weight: 750; }
.railNoteList .noteRow { padding: 10px 10px; }
.railNoteList .noteText { font-size: 13px; }
.railNoteList .noteBtns { display: none; }

/* ===== Toggle row (admin permissions) ===== */
.toggleRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
  margin-top: 10px;
}
.toggleRow .leftSide { min-width: 0; }
.toggleRow b { display: block; font-size: 12.5px; letter-spacing: .1px; }
.toggleRow small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  font-size: 11.5px;
  line-height: 1.35;
  margin-top: 2px;
}

/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.55);
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 14px;
}
.modal .mcard {
  background: var(--card);
  border: 1px solid var(--line);
  width: min(760px, 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.mrow { display: flex; gap: 10px; flex-wrap: wrap; }
.mrow .field { flex: 1; min-width: 220px; }
.mrow label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 900;
  margin: 8px 0 6px;
}
.mrow input {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-weight: 750;
  background: #fff;
}
.mrow input:focus {
  outline: none;
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ===== Inventory-specific ===== */
#stockpulseView .table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
#stockpulseView .table-scroll {
  border-radius: var(--radius);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 40px 6px 14px;
}
#stockpulseView table { border-collapse: collapse; width: 100%; min-width: 1180px; }
#stockpulseView thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0b1220;
  color: #fff;
  font-weight: 750;
  font-size: 13px;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  text-align: center;
  white-space: nowrap;
  user-select: none;
}
#stockpulseView th.sortable { cursor: pointer; }
#stockpulseView th.sortable:hover { background: #111a2e; }
#stockpulseView th .th-wrap { display: inline-flex; gap: 8px; align-items: center; justify-content: center; }
#stockpulseView th.left .th-wrap { justify-content: flex-start; }
#stockpulseView .sort-ind { font-size: 11px; opacity: .85; display: inline-block; min-width: 12px; text-align: center; }
#stockpulseView tbody td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  vertical-align: middle;
  overflow: visible;
  white-space: nowrap;
}
#stockpulseView tbody tr:hover td { background: #f9fafb; }
#stockpulseView tr.row-dirty td { background: rgba(37,99,235,.06); }
#stockpulseView tr.row-dirty td:first-child { box-shadow: inset 4px 0 0 rgba(37,99,235,.35); }
#stockpulseView td.nameCell {
  text-align: left;
  min-width: 260px;
  font-weight: 650;
  padding-left: 14px;
  white-space: normal;
}
#stockpulseView .nameWrap { display: flex; flex-direction: column; gap: 6px; }
#stockpulseView input[type="number"] {
  width: 86px;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: center;
  font-weight: 650;
  transition: background .12s ease, box-shadow .12s ease, border-color .12s ease;
}
#stockpulseView input.locked { background: #f3f4f6; color: #6b7280; }
#stockpulseView input:focus {
  outline: none;
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
#stockpulseView input.invalid {
  border-color: rgba(239,68,68,.55) !important;
  box-shadow: 0 0 0 4px rgba(239,68,68,.10) !important;
}
#stockpulseView input.currentInput.heat-critical { background: rgba(239,68,68,.10); border-color: rgba(239,68,68,.25); }
#stockpulseView input.currentInput.heat-ok { background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.22); }
#stockpulseView input.currentInput.heat-good { background: rgba(34,197,94,.10); border-color: rgba(34,197,94,.22); }
#stockpulseView input.currentInput.heat-over { box-shadow: 0 0 0 4px rgba(251,146,60,.14); border-color: rgba(251,146,60,.35); }
#stockpulseView .overstockCell { min-width: 150px; }
#stockpulseView .overBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 850;
  font-size: 12px;
  background: rgba(251,146,60,.14);
  color: #9a3412;
  border: 1px solid rgba(251,146,60,.25);
}
#stockpulseView th.spacer, #stockpulseView td.spacer {
  width: 28px; min-width: 28px; padding: 0 !important;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
#stockpulseView thead th.spacer {
  background: #0b1220;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
#stockpulseView .row-confirm {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(37,99,235,.20);
  background: rgba(37,99,235,.10);
  color: var(--primary2);
  cursor: pointer;
  font-weight: 900;
  transition: transform .10s ease, box-shadow .10s ease, background .12s ease;
  box-shadow: none;
}
#stockpulseView .row-confirm:hover { background: rgba(37,99,235,.16); transform: translateY(-1px); }
#stockpulseView .row-confirm.hidden { display: none; }
#stockpulseView .row-confirm.pulse { box-shadow: 0 0 0 6px rgba(37,99,235,0.12); }
#stockpulseView .row-delete {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(239,68,68,.20);
  background: rgba(239,68,68,.10);
  color: #b91c1c;
  cursor: pointer;
  font-weight: 900;
  transition: transform .10s ease, background .12s ease, box-shadow .10s ease, opacity .12s ease;
  opacity: 0;
  pointer-events: none;
}
#stockpulseView .row-delete:hover { background: rgba(239,68,68,.16); transform: translateY(-1px); }
.edit-mode #stockpulseView tbody tr:hover .row-delete { opacity: 1; pointer-events: auto; }
#stockpulseView .unitWrap { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
#stockpulseView .unitSelect {
  height: 34px; border-radius: 10px; border: 1px solid var(--line);
  padding: 6px 10px; background: #fff; font-weight: 700; min-width: 92px;
}
#stockpulseView .casePackInput { width: 86px; }
#stockpulseView .derived { font-weight: 800; color: #374151; }
#stockpulseView .derived small { font-weight: 700; color: var(--muted); margin-left: 6px; }
#stockpulseView .levelsWrap { display: flex; gap: 8px; justify-content: center; align-items: center; }
#stockpulseView .levelsWrap .lvl { display: flex; flex-direction: column; gap: 4px; align-items: center; }
#stockpulseView .levelsWrap .lvl label { font-size: 10px; font-weight: 900; color: var(--muted); letter-spacing: .2px; line-height: 1; margin: 0; }
#stockpulseView .levelsWrap input[type="number"] { width: 76px; padding: 6px 6px; border-radius: 10px; }
.staff-view #stockpulseView .col-unit,
.staff-view #stockpulseView .col-levels { display: none !important; }
.staff-view #stockpulseView .col-waste { display: table-cell !important; }
.staff-view #stockpulseView tbody td { padding: 7px 8px; font-size: 12.5px; }
.staff-view #stockpulseView thead th { padding: 10px 8px; font-size: 12.5px; }
.staff-view #stockpulseView input[type="number"] { width: 72px; padding: 6px 6px; }
.staff-view #stockpulseView .levelsWrap { gap: 6px; }
.staff-view #stockpulseView .nameWrap { gap: 4px; }
#stockpulseView .row-actions-btn {
  display: inline-flex; padding: 7px 10px; border-radius: 10px;
  border: 1px solid rgba(17,24,39,.12); background: rgba(17,24,39,.06);
  color: #111827; cursor: pointer; font-weight: 900; line-height: 1;
  align-items: center; justify-content: center; min-width: 36px;
}
#stockpulseView .row-actions-btn:hover { background: rgba(17,24,39,.10); }
#stockpulseView .row-menu {
  position: fixed; z-index: 2000; background: #fff;
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 8px; min-width: 240px; display: none;
}
#stockpulseView .row-menu button {
  width: 100%; background: transparent; color: var(--text);
  border: 1px solid transparent; box-shadow: none; text-align: left;
  padding: 10px 10px; border-radius: 10px; font-weight: 750; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
#stockpulseView .row-menu button:hover { background: #f3f4f6; transform: none; }
#stockpulseView .row-menu .danger { color: #b91c1c; }
#stockpulseView .row-menu .danger:hover { background: rgba(239,68,68,.10); }
#stockpulseView .catPill {
  font-size: 12px; font-weight: 800; color: var(--muted);
}
#stockpulseView .catPill .catText {
  border-radius: 6px; padding: 1px 4px;
}
#stockpulseView .catPill .catText:focus {
  outline: none; background: rgba(37,99,235,.08);
}
#stockpulseView .itemName {
  font-weight: 700; font-size: 13px;
}
#stockpulseView .itemName:focus {
  outline: none; background: rgba(37,99,235,.08); border-radius: 6px;
}
#stockpulseView .actionsCell {
  display: flex; gap: 4px; align-items: center; justify-content: center;
}
#stockpulseView .controls {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
#stockpulseView .unitSelect.locked { background: #f3f4f6; color: #6b7280; }
#stockpulseView .footer {
  text-align: center; color: var(--muted); font-size: 13px; margin-top: 12px; line-height: 1.5;
}
#stockpulseView th.col-waste, #stockpulseView td.col-waste { display: none; }
#stockpulseView .pill.mode {
  background: rgba(15,118,110,.08);
  border-color: rgba(15,118,110,.20);
}
#stockpulseView .pill.mode .dot { background: #0f766e; }

#stockpulseView .bulk {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
#stockpulseView .bulk .label {
  font-size: 12px; color: var(--muted); font-weight: 750; margin-right: 2px;
}
#stockpulseView select, #stockpulseView .bulk input[type="number"] {
  height: 36px; border-radius: 10px; border: 1px solid var(--line);
  padding: 6px 10px; font-weight: 650; background: #fff;
}
#stockpulseView select:focus, #stockpulseView .bulk input[type="number"]:focus {
  outline: none;
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
#stockpulseView .filters {
  display: flex; flex-wrap: nowrap; gap: 8px; align-items: center;
  justify-content: center;
  padding-top: 10px; border-top: 1px dashed var(--line); margin-top: 10px;
}
#stockpulseView .filters .label {
  font-size: 12px; color: var(--muted); font-weight: 800; margin-right: 2px; white-space: nowrap;
}
#stockpulseView .filters input[type="text"], #stockpulseView .filters select {
  height: 36px; border-radius: 10px; border: 1px solid var(--line);
  padding: 6px 8px; font-weight: 650; background: #fff; font-size: 12px;
}
#stockpulseView .filters input[type="text"] { width: 160px; }
#stockpulseView .filters .toggle { white-space: nowrap; font-size: 12px; }

/* ===== Responsive ===== */
@media (max-width: 1060px) {
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .storeGrid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .loginGrid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .charts { grid-template-columns: 1fr; }
  canvas { height: 220px; }
  .noteForm { grid-template-columns: 1fr; }
  .formGrid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .storeGrid { grid-template-columns: 1fr; }
}
