:root {
  --bg: #0e0d1a; --surface: #17162a; --surface-2: #1e1d36; --border: #2c2b47;
  --text: #edecf7; --text-2: #b7b5d0; --muted: #8b89a8;
  --indigo: #6366f1; --violet: #a855f7; --teal: #2dd4bf; --red: #f87171; --green: #34d399;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
a { color: var(--teal); }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 0.9em; }

/* Buttons */
.btn { border: 1px solid transparent; border-radius: 999px; padding: 9px 16px; font: inherit;
  font-weight: 600; cursor: pointer; background: var(--surface-2); color: var(--text); }
.btn-primary { background: linear-gradient(135deg, var(--indigo), var(--violet)); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* Login */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px; display: flex; flex-direction: column; gap: 12px; }
.auth-logo { font-size: 22px; font-weight: 800; }
.auth-logo span { color: var(--violet); }
.auth-tag { font-size: 12px; background: var(--surface-2); color: var(--text-2); padding: 2px 8px;
  border-radius: 999px; vertical-align: middle; }
.auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.auth-card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); }
.auth-card input { background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; color: var(--text); font: inherit; }
.auth-error { background: rgba(248,113,113,0.12); color: var(--red); border: 1px solid rgba(248,113,113,0.3);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 230px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px; }
.side-logo { font-weight: 800; font-size: 18px; line-height: 1.1; margin-bottom: 18px; }
.side-logo span:first-child { color: var(--violet); }
.side-tag { font-size: 11px; color: var(--muted); font-weight: 600; }
.side-nav { list-style: none; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-item { padding: 9px 12px; border-radius: 9px; cursor: pointer; color: var(--text-2);
  display: flex; align-items: center; gap: 9px; font-weight: 500; }
.side-item:hover { background: var(--surface-2); color: var(--text); }
.side-item.active { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--violet); }
.side-foot { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px;
  display: flex; flex-direction: column; gap: 8px; }
.side-user { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content { flex: 1; padding: 28px; overflow-x: auto; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin-bottom: 20px; max-width: 900px; }
.panel h1 { font-size: 22px; margin-bottom: 4px; }
.panel h2 { font-size: 16px; margin-bottom: 10px; }
.pill { font-size: 13px; background: var(--surface-2); color: var(--text-2); padding: 2px 10px;
  border-radius: 999px; vertical-align: middle; }
.notice { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
  padding: 12px 14px; margin-top: 12px; font-size: 14px; color: var(--text-2); }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; margin-top: 12px; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
.tbl th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Catalogue module */
.field-input { background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; color: var(--text); font: inherit; min-width: 0; }
.supplier-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.supplier-card-head .field-input { flex: 1; font-weight: 700; font-size: 15px; min-width: 140px; }
.upload-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.add-supplier-row { display: flex; gap: 8px; margin-top: 14px; }
.add-supplier-row .field-input { flex: 1; max-width: 320px; }

@media (max-width: 640px) {
  .shell { flex-direction: column; }
  .content { padding: 16px; }
  .sidebar { width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px; }
  .side-logo { margin-bottom: 0; }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .side-foot { border-top: none; margin: 0; padding: 0; flex-direction: row; margin-left: auto; }

  /* Stack the add-supplier input above its button rather than squeezing
     them onto one line — that was wrapping the button's own text onto
     two lines instead. */
  .add-supplier-row { flex-direction: column; }
  .add-supplier-row .field-input { max-width: none; }

  /* A supplier's name input + Rename + Delete no longer fit on one line
     at phone width. .content has overflow-x:auto (for wide tables on
     desktop), so instead of visibly overflowing, an unwrapped row here
     silently clipped Delete off past the scrollable edge — invisible
     unless you knew to swipe sideways. Stack it instead. */
  .supplier-card-head { flex-direction: column; align-items: stretch; }
  .supplier-card-head .field-input { min-width: 0; }
}
