/* Badge Vault — dark theme matching designz3d.com: navy panels, thin borders, teal #2ec4b6 accents. */
:root {
  color-scheme: dark;
  --bg: #0d1520;
  --panel: #0f1e2c;
  --deep: #0a1018;
  --line: #1e3a4a;
  --text: #ffffff;
  --soft: #8ab4c2;
  --muted: #6a8a9a;
  --teal: #2ec4b6;
  --teal-hi: #4fd6c9;
  --teal-tint: rgba(46,196,182,.1);
  --teal-line: rgba(46,196,182,.3);
  --warn: #f0b45b;
  --warn-tint: rgba(240,180,91,.12);
  --bad: #f2867b;
  --bad-tint: rgba(242,134,123,.12);
  --good: #6fd3a0;
  --good-tint: rgba(111,211,160,.12);
  --radius: 8px;
  --radius-card: 16px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-underline-offset: 2px; }
a:hover { color: var(--teal-hi); }
h1, h2, h3 { font-weight: 500; line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 26px; letter-spacing: -.01em; }
h2 { font-size: 17px; }
h2 span { color: var(--teal); }
p { margin: 0 0 1em; max-width: 72ch; }
strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lead { font-size: 15px; color: var(--soft); margin-top: -.25em; }
.code { font-weight: 600; letter-spacing: .06em; white-space: nowrap; color: var(--soft); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
[hidden] { display: none !important; }
.count { display: inline-block; min-width: 22px; padding: 0 7px; margin-left: 6px; border-radius: 20px; background: var(--teal-tint); color: var(--teal); font-size: 12px; text-align: center; }

.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--teal-tint); border: .5px solid var(--teal-line); color: var(--teal);
  font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; padding: 4px 12px; border-radius: 20px; margin-bottom: 12px; }

/* ---------- top bar ---------- */
.topbar { background: var(--deep); border-bottom: .5px solid var(--line); display: flex; align-items: center; gap: 28px; padding: 0 24px; min-height: 62px; flex-wrap: wrap; }
.brand { color: var(--text) !important; text-decoration: none; display: flex; align-items: baseline; gap: 10px; }
.brand-word { font-weight: 700; letter-spacing: .18em; font-size: 16px; }
.brand-word span { color: var(--teal); }
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a { color: var(--soft); text-decoration: none; padding: 20px 11px 17px; border-bottom: 2px solid transparent; font-size: 14px; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--teal); }
.who { margin-left: auto; display: flex; gap: 16px; align-items: center; font-size: 13px; }
.who a, .who .linklike { color: var(--soft); }
.who form { margin: 0; }
.demo-bar { background: var(--warn-tint); border-bottom: .5px solid rgba(240,180,91,.35); color: #f6d39d; font-size: 13px; padding: 9px 24px; text-align: center; }
.demo-bar a { color: #ffd593; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; }

/* ---------- the storage badge ---------- */
.badge-card {
  --edge: var(--teal);
  position: relative; aspect-ratio: 85.6 / 54; width: 100%; max-width: 440px;
  background: linear-gradient(160deg, #13263a, var(--panel) 60%); border-radius: var(--radius-card); border: .5px solid var(--line);
  border-left: 6px solid var(--edge);
  box-shadow: 0 24px 50px -26px rgba(46,196,182,.35), 0 2px 0 rgba(0,0,0,.3);
  padding: 28px 24px 16px 22px; display: grid; grid-template-rows: auto 1fr auto; gap: 4px; margin-bottom: 20px;
}
.badge-card.state-low { --edge: var(--warn); }
.badge-card.state-out { --edge: var(--bad); }
.badge-card .slot, .login-card .slot { position: absolute; top: 10px; left: 50%; width: 50px; height: 8px; margin-left: -25px; border-radius: 4px; background: var(--deep); box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
.badge-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.badge-company { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-state { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); white-space: nowrap; }
.state-low .badge-state { color: var(--warn); }
.state-out .badge-state { color: var(--bad); }
.badge-count { display: flex; align-items: center; gap: 14px; }
.badge-count .qty { font-size: clamp(44px, 8vw, 64px); font-weight: 600; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.badge-count .qty-label { font-size: 13px; color: var(--muted); line-height: 1.4; }
.badge-code { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.badge-code .barcode { height: 40px; width: auto; max-width: 100%; border-radius: 3px; }
.code-text { font-weight: 500; letter-spacing: .12em; font-size: 12px; color: var(--soft); }

/* ---------- layout ---------- */
.client-hero { display: grid; grid-template-columns: minmax(280px, 440px) 1fr; gap: 40px; align-items: center; margin-bottom: 28px; }
.hero-side h1 { font-size: 30px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; align-items: center; }
.actions form { margin: 0; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head .actions { margin: 0; }
.panel { background: var(--panel); border: .5px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.panel.narrow { max-width: 780px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; margin-bottom: 20px; }
.two-col > .panel { margin-bottom: 0; }
.empty { color: var(--muted); margin: 0; }

/* ---------- forms ---------- */
label { display: block; font-weight: 500; font-size: 13px; }
.opt, .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.opt { margin-left: 4px; }
.hint { display: block; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input:not([type]), select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--text);
  background: var(--deep); border: .5px solid var(--line); border-radius: 6px;
}
input:disabled, select:disabled, textarea:disabled { color: var(--soft); opacity: .8; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: 2px solid var(--teal-tint); }
input[type=file] { display: block; margin-top: 8px; font: inherit; font-size: 13px; font-weight: 400; color: var(--soft); }
input[type=file]::file-selector-button { font: inherit; color: var(--text); background: var(--deep); border: .5px solid var(--line); border-radius: 6px; padding: 7px 12px; margin-right: 10px; cursor: pointer; }
input[type=radio], input[type=checkbox], input[type=range] { accent-color: var(--teal); }
.w-num { max-width: 140px; }
.w-mid { max-width: 320px; }
.stack > * + * { margin-top: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row + label, .row + .row { margin-top: 16px; }
fieldset { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
fieldset > * + * { margin-top: 14px; }
fieldset.tight { margin: 0; }
legend { font-weight: 500; font-size: 15px; padding: 0; margin-bottom: 12px; }
.small-legend { font-size: 13px; margin-bottom: 6px; }
.form-grid { max-width: 840px; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }
.choices { display: grid; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; background: var(--deep); border: .5px solid var(--line); border-radius: var(--radius); font-weight: 400; cursor: pointer; transition: border-color .2s; }
.choice:hover { border-color: var(--teal-line); }
.choice input { margin-top: 4px; }
.choice:has(input:checked) { border-color: var(--teal); background: rgba(46,196,182,.08); }
.choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.compact-choices { grid-template-columns: 1fr 1fr; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.inline-form label { flex: 0 1 auto; }
.inline-form .w-num { width: 140px; }
.inline-form .check { align-self: center; }
.wrap-form { margin-top: 20px; padding-top: 20px; border-top: .5px solid var(--line); }
.wrap-form label:not(.check) { flex: 1 1 180px; }
.login-fieldset { background: var(--deep); border: .5px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 8px 0 0; }
.login-fieldset legend { float: left; width: 100%; margin-bottom: 12px; }
.login-fieldset legend + * { clear: both; }
.role-form, .pw-form { margin: 0; }
.role-form select { margin: 0; width: auto; min-width: 150px; padding: 7px 10px; }
.pw-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pw-form input[type=password] { margin: 0; width: 170px; padding: 7px 10px; }
.search { display: flex; gap: 8px; align-items: center; }
.search input, .search select { margin: 0; min-width: 0; }
.photo-preview { max-width: 160px; border-radius: 6px; border: .5px solid var(--line); }
.photo-full { max-width: 100%; max-height: 360px; border-radius: 6px; border: .5px solid var(--line); display: block; margin-bottom: 8px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; font: 500 14px var(--font);
  color: var(--text) !important; background: var(--panel); border: .5px solid var(--line); border-radius: var(--radius); text-decoration: none; cursor: pointer; transition: border-color .2s, background .2s; }
.btn:hover { border-color: rgba(46,196,182,.55); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: var(--deep) !important; }
.btn-primary:hover { background: var(--teal-hi); border-color: var(--teal-hi); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted) !important; }
.btn-small { padding: 7px 12px; font-size: 13px; }
.btn-big { padding: 15px 22px; font-size: 16px; width: 100%; }
.btn-wide { width: 100%; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--teal); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.linklike.danger, .danger { color: var(--bad); }

/* ---------- tables + lists ---------- */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
.data th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 0 12px 8px 0; border-bottom: .5px solid var(--line); white-space: nowrap; }
.data td { padding: 11px 12px 11px 0; border-bottom: .5px solid #13283a; vertical-align: middle; }
.data tr:last-child td { border-bottom: 0; }
.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.data tr.inactive td { color: var(--muted); }
.neg { color: var(--bad); font-weight: 600; }
.pos { color: var(--good); font-weight: 600; }
.row-actions { display: flex; gap: 14px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 9px 0; border-bottom: .5px solid #13283a; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 14px; color: var(--soft); }
.plain-list li:last-child { border-bottom: 0; }
.plain-list .num { min-width: 3.2em; font-variant-numeric: tabular-nums; }
.fields { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0 0 20px; }
.fields dt { color: var(--muted); font-size: 13px; }
.fields dd { margin: 0; }

/* ---------- chips + messages ---------- */
.chip, .stock-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip-submitted { background: rgba(122,162,247,.14); color: #a9c1ff; }
.chip-in_progress { background: var(--teal-tint); color: var(--teal); }
.chip-proof_sent { background: var(--warn-tint); color: var(--warn); }
.chip-completed { background: var(--good-tint); color: var(--good); }
.chip-cancelled { background: rgba(138,180,194,.1); color: var(--muted); }
.stock-pill.state-ok { background: var(--good-tint); color: var(--good); }
.stock-pill.state-low { background: var(--warn-tint); color: var(--warn); }
.stock-pill.state-out { background: var(--bad-tint); color: var(--bad); }
.flash { padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 18px; border: .5px solid var(--line); border-left: 3px solid; background: var(--panel); font-size: 14px; }
.flash-success { border-left-color: var(--teal); }
.flash-error { border-left-color: var(--bad); background: #1f1418; }
.flash-info { border-left-color: var(--warn); }
.note-from-us { background: var(--deep); border: .5px solid var(--line); border-left: 3px solid var(--teal); border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 16px; margin-bottom: 18px; color: var(--soft); font-size: 14px; max-width: none; }

/* ---------- customer dashboard ---------- */
.promo { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; margin-bottom: 20px;
  background: linear-gradient(120deg, rgba(46,196,182,.10), var(--deep) 55%); border: 1px solid rgba(46,196,182,.45); border-radius: var(--radius); padding: 20px 22px; }
.promo h2 { margin: 0 0 .3rem; font-size: 18px; }
.promo p { margin: 0; color: var(--soft); font-size: 14px; }
.promo-icon { width: 50px; height: 50px; border-radius: 10px; background: var(--teal-tint); border: .5px solid var(--teal-line); display: flex; align-items: center; justify-content: center; color: var(--teal); }

/* ---------- templates ---------- */
.tmpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 14px; }
.small-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tmpl { margin: 0; background: var(--deep); border: .5px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.tmpl-preview { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: #071019; overflow: hidden; }
.tmpl-preview img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.tmpl-file { flex-direction: column; gap: 6px; color: var(--muted) !important; text-decoration: none; font-size: 12px; }
.tmpl-file span { font-size: 20px; font-weight: 600; letter-spacing: .08em; color: var(--teal); border: .5px solid var(--teal-line); border-radius: 6px; padding: 10px 14px; background: var(--teal-tint); }
.tmpl figcaption { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.tmpl figcaption .muted { font-size: 12px; }
.tmpl-actions { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; }
.tmpl-actions form { margin: 0; }
.tmpl-upload { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 12px 16px; align-items: end; }
.tmpl-upload .hint { grid-column: 1 / -1; margin: 0; }
.tmpl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tmpl-option { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--deep); border: .5px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 400; font-size: 13px; }
.tmpl-option:has(input:checked) { border-color: var(--teal); background: rgba(46,196,182,.08); }
.tmpl-option img { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: #071019; border-radius: 4px; }
.tmpl-ext { display: flex; align-items: center; justify-content: center; aspect-ratio: 4/3; background: #071019; border-radius: 4px; color: var(--teal); font-weight: 600; letter-spacing: .08em; }

/* ---------- send badges ---------- */
.send-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-bottom: 20px; }
.send-grid .panel { margin-bottom: 0; }
.step-panel { position: relative; padding-left: 64px; }
.step-n { position: absolute; left: 20px; top: 20px; width: 28px; height: 28px; border-radius: 50%; background: var(--teal-tint); border: .5px solid var(--teal-line);
  display: flex; align-items: center; justify-content: center; color: var(--teal); font-size: 13px; font-weight: 500; }
.ship-label { background: #fff; color: #0a1018; border-radius: 10px; padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 560px; }
.ship-label address { font-style: normal; font-weight: 600; font-size: 15px; line-height: 1.45; }
.ship-label-k { display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #4a5a66; margin-bottom: 4px; }
.ship-label-from { border-left: 2px solid #0a1018; padding-left: 16px; display: flex; flex-direction: column; gap: 6px; }
.ship-label-from .barcode { width: 100%; height: 56px; }
.ship-label-code { font-weight: 700; letter-spacing: .1em; font-size: 15px; }
.address-big { font-size: 17px; line-height: 1.55; color: var(--text); background: var(--deep); border: .5px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }

/* ---------- staff overview ---------- */
.tally { display: grid; grid-template-columns: repeat(4, 1fr); border: .5px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 20px; }
.tally-item { padding: 18px 20px; text-decoration: none; color: var(--muted) !important; font-size: 13px; border-right: .5px solid var(--line); }
.tally-item:last-child { border-right: 0; }
.tally-n { display: block; color: var(--text); font-size: 30px; font-weight: 600; line-height: 1.1; }
.tally-item.is-warn .tally-n { color: var(--warn); }

/* ---------- scan station ---------- */
.scan-bar { background: var(--deep); border: .5px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; }
.scan-bar label { color: var(--soft); }
.scan-input-row { display: flex; gap: 10px; margin-top: 8px; }
.scan-input-row input { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 12px 16px; }
.scan-input-row .btn { flex: none; }
.scan-result { background: var(--panel); border: .5px solid var(--line); border-left: 3px solid var(--teal); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 20px; font-size: 16px; animation: land .6s ease-out; }
@keyframes land { from { background: rgba(46,196,182,.25); } }
.scan-grid { display: grid; grid-template-columns: minmax(280px, 440px) 1fr; gap: 28px; align-items: start; }
.scan-links { display: flex; gap: 12px; align-items: center; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.mode { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: var(--deep); border: .5px solid var(--line); border-radius: var(--radius); font-weight: 400; cursor: pointer; }
.mode input { margin-top: 5px; }
.mode:has(input:checked) { border-color: var(--teal); background: rgba(46,196,182,.08); }
kbd { font: 600 11px var(--font); border: .5px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--muted); }
.qty-input { font-size: 22px !important; font-weight: 600; max-width: 180px; }
.scan-empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 48px 24px; text-align: center; color: var(--muted); }
.scan-empty p { margin: 0 auto; }

/* ---------- login ---------- */
.login { display: grid; place-items: center; min-height: 72vh; }
.login-card { position: relative; width: 100%; max-width: 420px; background: var(--panel); border: .5px solid var(--line); border-left: 6px solid var(--teal);
  border-radius: var(--radius-card); padding: 40px 30px 26px; box-shadow: 0 24px 50px -26px rgba(46,196,182,.35); }
.login-card h1 { font-size: 28px; }
.demo-box { margin-top: 22px; padding-top: 18px; border-top: .5px solid var(--line); }
.demo-box p { font-size: 13px; color: var(--soft); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .client-hero, .scan-grid, .two-col, .send-grid { grid-template-columns: 1fr; gap: 20px; }
  .tally { grid-template-columns: repeat(2, 1fr); }
  .tally-item:nth-child(2) { border-right: 0; }
  .tally-item:nth-child(-n+2) { border-bottom: .5px solid var(--line); }
  .promo { grid-template-columns: auto 1fr; }
  .promo .btn { grid-column: 1 / -1; justify-self: start; }
  .tmpl-upload { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 20px 16px 48px; }
  .topbar { padding: 12px 16px 0; gap: 0 16px; }
  .nav a { padding: 12px 9px 10px; }
  .who { margin-left: 0; width: 100%; padding-bottom: 10px; }
  .row, .compact-choices { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .step-panel { padding-left: 18px; padding-top: 58px; }
  .step-n { left: 18px; top: 18px; }
  h1 { font-size: 22px; }
  .hero-side h1 { font-size: 24px; }
  .badge-card { padding: 26px 18px 14px 18px; }
  .fields { grid-template-columns: 1fr; gap: 2px; }
  .fields dd { margin-bottom: 10px; }
  .ship-label { grid-template-columns: 1fr; }
  .ship-label-from { border-left: 0; border-top: 2px solid #0a1018; padding: 12px 0 0; }
  .small-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .promo { grid-template-columns: 1fr; }
  table.data { min-width: 560px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
