/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --c-bg: #f0f2f5;
  --c-white: #fff;
  --c-dark: #1a1a2e;
  --c-border: #e8eaed;
  --c-text: #1a1a2e;
  --c-muted: #888;
  --c-success: #2d6a4f;
  --c-danger: #c00300;
  --c-primary: #1a1a2e;
  --c-accent: #7ec8e3;
  --nav-h: 64px;
  --header-h: 52px;
  font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
}
body { background: var(--c-bg); color: var(--c-text); min-height: 100vh; }

/* ── Auth ──────────────────────────────────────────────────── */
.auth-body { background: var(--c-dark); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 380px; padding: 16px; text-align: center; }
.login-logo { width: 64px; height: 64px; background: rgba(126,200,227,.15); border-radius: 20px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
  font-size: 36px; color: var(--c-accent); }
.login-title { font-size: 22px; font-weight: 700; color: #fff; letter-spacing: .5px; }
.login-sub { font-size: 11px; color: #9eb3c2; letter-spacing: 2px; margin: 4px 0 24px; }
.login-form { background: rgba(255,255,255,.06); border-radius: 20px; padding: 24px;
  border: 1px solid rgba(255,255,255,.1); text-align: left; }
.login-form label { font-size: 13px; font-weight: 600; color: #9eb3c2; display: block; margin-bottom: 6px; }
.login-form input { width: 100%; padding: 14px 12px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15); border-radius: 10px; color: #fff; font-size: 15px; margin-bottom: 16px; }
.login-hint { margin-top: 14px; font-size: 11px; color: #556; }
.login-hint code { color: #9eb3c2; }

/* ── Header ────────────────────────────────────────────────── */
.app-header { background: var(--c-dark); color: #fff; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; position: sticky; top: 0; z-index: 200; flex-shrink: 0; }
.header-brand { display: flex; align-items: center; gap: 10px; font-size: 22px; color: var(--c-accent); }
.brand-name { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: .5px; line-height: 1.2; }
.brand-sub { font-size: 9px; color: #9eb3c2; letter-spacing: 1.5px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.user-pill { display: flex; align-items: center; gap: 8px; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: rgba(126,200,227,.2);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--c-accent); font-size: 13px; }
.user-name { font-size: 13px; color: #9eb3c2; display: none; }
@media(min-width:480px){ .user-name { display: inline; } }

/* ── Flash ─────────────────────────────────────────────────── */
.flash { padding: 12px 16px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.flash-success { background: #f0fff4; color: var(--c-success); border-bottom: 1px solid #b7e4c7; }
.flash-error   { background: #fff0f0; color: var(--c-danger);  border-bottom: 1px solid #ffc1c1; }

/* ── Bottom nav ────────────────────────────────────────────── */
.bottom-nav { background: #fff; border-top: 1px solid var(--c-border);
  display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  overflow-x: auto; height: var(--nav-h); }
.nav-item { flex: 1 0 auto; min-width: 52px; padding: 6px 0 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: #aaa; position: relative; border: none; background: none; cursor: pointer; }
.nav-icon-wrap { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.nav-item i { font-size: 19px; }
.nav-label { font-size: 9px; font-weight: 400; white-space: nowrap; }
.nav-item.active { color: var(--nav-color); }
.nav-item.active .nav-icon-wrap { background: color-mix(in srgb, var(--nav-color) 12%, transparent); }
.nav-item.active .nav-label { font-weight: 700; }
.nav-item.active::before { content:''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 3px; background: var(--nav-color); border-radius: 0 0 3px 3px; }

/* ── Page main ─────────────────────────────────────────────── */
.page-main { padding-bottom: calc(var(--nav-h) + 8px); min-height: calc(100vh - var(--header-h)); }
.page-body  { padding: 16px; max-width: 720px; margin: 0 auto; }

/* ── Wizard ────────────────────────────────────────────────── */
.wizard-bar { display: flex; align-items: center; padding: 10px 16px;
  background: #fff; border-bottom: 1px solid var(--c-border); overflow-x: auto; gap: 6px; }
.wizard-step { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.step-circle { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #e8eaed; color: #999; font-size: 12px; font-weight: 700; }
.wizard-step.active .step-circle { background: var(--c-dark); color: #fff; }
.wizard-step.done   .step-circle { background: var(--c-success); color: #fff; }
.step-label { font-size: 13px; color: #aaa; white-space: nowrap; }
.wizard-step.active .step-label { color: var(--c-dark); font-weight: 600; }
.wizard-step.done   .step-label { color: var(--c-success); }
.wizard-connector { flex: 1; min-width: 12px; height: 2px; background: #e8eaed; border-radius: 2px; }
.wizard-connector.done { background: var(--c-success); }

/* ── Cards ─────────────────────────────────────────────────── */
.card { background: #fff; border-radius: 14px; border: 1px solid var(--c-border); padding: 20px; margin-bottom: 16px; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 12px 20px;
  border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none; border: none; transition: opacity .15s; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--c-dark); color: #fff; }
.btn-success { background: var(--c-success); color: #fff; }
.btn-danger  { background: var(--c-danger); color: #fff; }
.btn-dark    { background: var(--c-dark); color: #fff; }
.btn-ghost   { background: transparent; color: #666; border: 1px solid var(--c-border); }
.btn-vendor  { background: #7b2d00; color: #fff; }
.btn-client  { background: #0353a4; color: #fff; }
.btn-danger-ghost { background: #fff0f0; color: var(--c-danger); border: none; }
.btn-full    { width: 100%; justify-content: center; }
.btn-lg      { padding: 16px 20px; font-size: 16px; }
.btn-sm      { padding: 6px 12px; font-size: 12px; }
.btn-back    { margin-bottom: 12px; font-size: 14px; }
.btn-icon    { background: rgba(255,255,255,.1); border: none; color: #9eb3c2; cursor: pointer;
  border-radius: 8px; padding: 6px 10px; font-size: 15px; display: flex; align-items: center; }
.btn-icon-sm { background: #f0f4ff; border: none; color: #1a6ea3; cursor: pointer;
  border-radius: 8px; padding: 6px 10px; font-size: 13px; line-height: 1; }
.btn-icon-sm.danger { background: #fff0f0; color: var(--c-danger); }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-group label { font-size: 13px; font-weight: 600; color: #555; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], select, textarea {
  width: 100%; padding: 12px; font-size: 14px; border: 1.5px solid var(--c-border);
  border-radius: 10px; background: #f9f9f9; color: var(--c-text);
  font-family: inherit; -webkit-appearance: none; }
input.input-plate  { font-size: 18px; font-weight: 700; letter-spacing: 2px; }
input.input-weight { font-size: 20px; font-weight: 700; }
.form-intro { font-size: 15px; color: #555; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.form-row    { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }
.form-btns   { display: flex; gap: 8px; margin-top: 4px; }
.span-2      { grid-column: 1 / -1; }
.checkbox-group { flex-direction: row; align-items: center; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.color-row   { display: flex; align-items: center; gap: 8px; }
.color-row input[type=color] { width: 40px; height: 34px; border: none; cursor: pointer; border-radius: 6px; padding: 2px; }
.flex-grow   { flex: 2; }
.align-end   { align-self: flex-end; }

/* ── Summary bar ───────────────────────────────────────────── */
.summary-bar { background: #f0f4ff; border-radius: 10px; padding: 10px 14px;
  margin-bottom: 14px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: #555; }
.summary-bar span { display: flex; align-items: center; gap: 5px; }

/* ── Category grid ─────────────────────────────────────────── */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.category-tile { background: var(--cat-bg); border: 2px solid color-mix(in srgb, var(--cat-color) 20%, transparent);
  border-radius: 14px; padding: 20px 10px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 8px; min-height: 90px; transition: transform .1s; }
.category-tile:active { transform: scale(.95); }
.category-tile i { font-size: 28px; color: var(--cat-color); }
.cat-label { font-size: 13px; font-weight: 600; color: var(--cat-color); text-align: center; }

/* ── Item grid ─────────────────────────────────────────────── */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.item-tile { background: #fff; border: 2px solid color-mix(in srgb, var(--cat-color) 20%, transparent);
  border-radius: 12px; padding: 16px 10px; cursor: pointer; font-size: 14px; font-weight: 600;
  color: var(--cat-color); min-height: 56px; transition: transform .1s; }
.item-tile:active { transform: scale(.95); }

/* ── Cat badge (step4 confirm) ─────────────────────────────── */
.cat-badge { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--cat-bg); border-radius: 12px; margin-bottom: 16px; }
.cat-badge i { font-size: 26px; color: var(--cat-color); }
.cat-badge-sub  { font-size: 12px; color: var(--cat-color); opacity: .7; }
.cat-badge-main { font-size: 18px; font-weight: 700; color: var(--cat-color); }
.review-rows { display: grid; gap: 8px; margin-bottom: 14px; }
.review-row  { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; background: #f9fafb; border-radius: 10px; font-size: 14px; }
.review-row span { color: #666; display: flex; align-items: center; gap: 6px; }
.review-row strong { font-size: 15px; }
.info-note { background: #e8f4fd; border-radius: 10px; padding: 12px; font-size: 13px;
  color: #1a6ea3; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }

/* ── Receipt card ──────────────────────────────────────────── */
.receipt-card  { max-width: 400px; margin: 0 auto; }
.receipt-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: 10px; margin-bottom: 16px; font-size: 22px; }
.receipt-in  { background: #f0fff4; color: var(--c-success); }
.receipt-out { background: #fff0f0; color: var(--c-danger); }
.receipt-title { font-weight: 700; font-size: 15px; }
.receipt-sub   { font-size: 12px; opacity: .7; }
.receipt-body  { border: 1.5px dashed #ddd; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.receipt-rows  { display: grid; gap: 6px; margin-bottom: 14px; }
.receipt-row   { display: flex; justify-content: space-between; font-size: 12px; }
.receipt-row span { color: #888; }
.receipt-actions { display: grid; gap: 8px; }
.barcode-wrap  { display: flex; justify-content: center; padding-top: 10px; border-top: 1px dashed #ccc; }

/* ── Issue ─────────────────────────────────────────────────── */
.search-bar-form { margin-bottom: 14px; }
.search-row { display: flex; gap: 8px; }
.search-input { flex: 1; }
.batch-list  { display: grid; gap: 8px; }
.batch-card  { background: #fff; border: 1px solid var(--c-border); border-radius: 12px;
  padding: 12px 14px; text-decoration: none; display: flex; justify-content: space-between;
  align-items: center; color: inherit; }
.batch-code  { font-weight: 700; font-size: 13px; }
.batch-meta  { font-size: 13px; color: #555; margin-top: 2px; }
.batch-date  { font-size: 11px; color: #aaa; }
.batch-weight { text-align: right; }
.weight-avail { font-weight: 700; font-size: 15px; color: var(--c-success); }
.weight-label { font-size: 11px; color: #aaa; }
.batch-selected-card { border: 2px solid var(--c-success); }
.selected-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.selected-tag { font-size: 11px; font-weight: 600; color: var(--c-success); letter-spacing: 1px; margin-bottom: 4px; }
.selected-code { font-weight: 700; font-size: 15px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.detail-cell { background: #f9fafb; border-radius: 8px; padding: 10px 12px; }
.detail-cell.highlight { background: #f0fff4; }
.dc-label { font-size: 11px; color: #aaa; margin-bottom: 2px; }
.dc-value { font-size: 14px; font-weight: 700; }
.detail-cell.highlight .dc-value { color: var(--c-success); }
.progress-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.progress-bar { flex: 1; height: 6px; background: #e8f5e9; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--c-success); border-radius: 99px; }
.progress-label { font-size: 12px; color: var(--c-success); font-weight: 600; white-space: nowrap; }
.issue-form { border-top: 1px solid var(--c-border); padding-top: 14px; }

/* ── Items layout ──────────────────────────────────────────── */
.items-layout { display: flex; gap: 16px; align-items: flex-start; padding: 16px; max-width: 900px; margin: 0 auto; }
.cat-sidebar  { width: 165px; flex-shrink: 0; }
.sidebar-label { font-size: 11px; font-weight: 600; color: #888; letter-spacing: 1px; margin-bottom: 8px; }
.cat-sidebar-item { display: flex; align-items: center; border-radius: 10px; border: 1.5px solid var(--c-border);
  background: #fff; margin-bottom: 6px; overflow: hidden; }
.cat-sidebar-item.active { border-color: color-mix(in srgb, var(--cat-color) 50%, transparent); background: var(--cat-bg); }
.cat-sidebar-link { flex: 1; padding: 9px 10px; display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: #555; font-size: 13px; }
.cat-sidebar-item.active .cat-sidebar-link { color: var(--cat-color); font-weight: 700; }
.cat-sidebar-link i { font-size: 14px; color: var(--cat-color); }
.cat-add-btn  { width: 100%; padding: 9px 10px; border-radius: 10px; border: 1.5px dashed #bbb;
  background: transparent; cursor: pointer; display: flex; align-items: center; gap: 8px;
  color: #888; font-size: 13px; margin-top: 4px; }
.cat-form     { background: #fff; border: 1px solid var(--c-border); border-radius: 10px; padding: 12px; margin-top: 6px; }
.cat-form input { margin-bottom: 8px; }
.item-main    { flex: 1; min-width: 0; }
.cat-header   { display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--cat-bg); border-radius: 10px; margin-bottom: 12px; }
.cat-header i { font-size: 20px; color: var(--cat-color); }
.cat-header-name { font-weight: 700; color: var(--cat-color); flex: 1; }
.cat-header-meta { text-align: right; font-size: 12px; color: color-mix(in srgb, var(--cat-color) 70%, transparent); }
.stock-total  { font-weight: 700; display: block; }
.add-item-form { display: flex; gap: 8px; margin-bottom: 12px; }
.add-item-input { flex: 1; }
.item-list    { display: grid; gap: 6px; }
.item-row     { background: #fff; border: 1px solid var(--c-border); border-radius: 10px; padding: 10px 14px; }
.item-display { display: flex; align-items: center; gap: 8px; }
.item-info    { flex: 1; min-width: 0; }
.item-name    { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.stock-bar-row { display: flex; align-items: center; gap: 6px; }
.stock-bar    { width: 80px; height: 4px; background: #e8f5e9; border-radius: 99px; overflow: hidden; flex-shrink: 0; }
.stock-fill   { height: 100%; border-radius: 99px; }
.stock-label  { font-size: 11px; font-weight: 700; white-space: nowrap; }
.no-stock     { font-size: 11px; color: #bbb; }
.item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.item-edit-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.edit-input   { flex: 1; min-width: 100px; padding: 8px 10px; font-size: 13px;
  border: 1.5px solid var(--c-border); border-radius: 8px; background: #f9f9f9; }

/* ── Partners ──────────────────────────────────────────────── */
.tab-bar  { background: #fff; border-bottom: 1px solid var(--c-border); padding: 10px 16px; display: flex; gap: 10px; }
.tab-btn  { padding: 10px 20px; border-radius: 10px; border: none; cursor: pointer; font-size: 14px;
  font-weight: 600; background: #f0f0f0; color: #666; text-decoration: none; display: flex; align-items: center; gap: 6px; }
.tab-btn.active.vendor { background: #7b2d00; color: #fff; }
.tab-btn.active.client { background: #0353a4; color: #fff; }
.tab-count { border-radius: 20px; padding: 1px 8px; font-size: 11px; background: rgba(255,255,255,.25); }
.partner-add-form { margin-bottom: 8px; }
.partner-list { display: grid; gap: 10px; }
.partner-card { background: #fff; border: 1px solid var(--c-border); border-radius: 14px; padding: 14px 16px; }
.partner-main { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.partner-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.partner-card.vendor .partner-icon { background: #ffe8d6; color: #7b2d00; }
.partner-card.client .partner-icon { background: #dde8ff; color: #0353a4; }
.partner-info { flex: 1; }
.partner-name { font-weight: 700; font-size: 15px; }
.partner-code { font-size: 12px; font-weight: 600; }
.partner-card.vendor .partner-code { color: #7b2d00; }
.partner-card.client .partner-code { color: #0353a4; }
.partner-actions { display: flex; gap: 6px; }
.partner-details { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: #666; }
.partner-details span { display: flex; align-items: center; gap: 4px; }

/* ── History ───────────────────────────────────────────────── */
.filter-card { margin-bottom: 8px; }
.filter-row  { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-btn    { padding: 8px 18px; border-radius: 20px; border: none; cursor: pointer;
  font-size: 13px; font-weight: 600; background: #f0f0f0; color: #555; }
.summary-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.summary-card  { background: #fff; border: 1px solid var(--c-border); border-radius: 12px; padding: 12px 14px; }
.summary-card.receive .sc-icon, .summary-card.receive .sc-value { color: var(--c-success); }
.summary-card.issue   .sc-icon, .summary-card.issue   .sc-value { color: var(--c-danger); }
.sc-icon  { font-size: 18px; margin-bottom: 4px; }
.sc-value { font-size: 15px; font-weight: 700; }
.sc-label { font-size: 11px; color: #aaa; }
.tx-list  { display: grid; gap: 8px; }
.tx-row   { background: #fff; border: 1px solid var(--c-border); border-radius: 12px; padding: 12px 16px;
  text-decoration: none; display: flex; justify-content: space-between; align-items: center; color: inherit; }
.tx-icon  { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 18px; margin-right: 12px; flex-shrink: 0; }
.tx-icon.receive { background: #f0fff4; color: var(--c-success); }
.tx-icon.issue   { background: #fff0f0; color: var(--c-danger); }
.tx-item  { font-weight: 700; font-size: 13px; }
.tx-code  { font-size: 12px; color: #888; }
.tx-meta  { font-size: 11px; color: #bbb; margin-top: 2px; }
.tx-weight { text-align: right; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.tx-weight.receive { color: var(--c-success); }
.tx-weight.issue   { color: var(--c-danger); }
.tx-remaining { font-size: 11px; color: #aaa; font-weight: 400; }
.tx-row .tx-info { display: flex; flex-direction: column; flex: 1; }

/* ── Settings ──────────────────────────────────────────────── */
.settings-form .settings-card { margin-bottom: 16px; }
.settings-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; color: #444; }
.option-tiles { display: grid; gap: 10px; }
.option-tile  { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-radius: 12px;
  border: 2px solid var(--c-border); cursor: pointer; background: #fff; }
.option-tile input[type=radio] { display: none; }
.option-tile i, .option-tile .flag { font-size: 22px; color: #aaa; }
.option-tile .option-main { font-weight: 700; font-size: 15px; }
.option-tile .option-sub  { font-size: 12px; color: #aaa; }
.option-tile.selected { border-color: var(--c-dark); background: var(--c-dark); }
.option-tile.selected i, .option-tile.selected .option-main { color: #fff; }
.option-tile.selected .option-sub { color: var(--c-accent); }
.muted-note  { text-align: center; color: #aaa; font-size: 13px; padding: 12px; }

/* ── Users ─────────────────────────────────────────────────── */
.user-list { display: grid; gap: 10px; }
.user-card { background: #fff; border: 1px solid var(--c-border); border-radius: 14px; padding: 14px 16px; }
.user-card.self { border-color: #1a1a2e33; }
.user-main { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.user-avatar-lg { width: 42px; height: 42px; border-radius: 12px; background: #f0f2f5;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; color: var(--c-dark); flex-shrink: 0; }
.user-fullname { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.user-sub     { font-size: 12px; color: #888; }
.user-details { flex: 1; }
.user-actions { display: flex; gap: 6px; }
.you-badge { font-size: 10px; background: var(--c-dark); color: var(--c-accent); padding: 2px 8px; border-radius: 20px; }
.user-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.role-badge   { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.role-admin   { background: #ffccd5; color: #9d0208; }
.role-manager { background: #ffe8d6; color: #7b2d00; }
.role-operator{ background: #a8dadc; color: #1d3557; }
.lang-badge   { font-size: 12px; padding: 4px 10px; border-radius: 20px; background: #f0f0f0; color: #666; }
.status-badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.status-badge.active   { background: #f0fff4; color: var(--c-success); }
.status-badge.inactive { background: #fff0f0; color: var(--c-danger); }
.last-login-badge { font-size: 11px; padding: 4px 8px; border-radius: 20px; background: #f8f8f8; color: #aaa;
  display: flex; align-items: center; gap: 3px; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex;
  align-items: center; justify-content: center; z-index: 500; padding: 16px; }
.modal-box     { background: #fff; border-radius: 16px; padding: 24px; width: min(400px, 100%); }
.modal-header  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 15px; font-weight: 700; }
.modal-form    { display: grid; gap: 12px; }

/* ── Misc ──────────────────────────────────────────────────── */
.hidden        { display: none !important; }
.mono          { font-family: monospace; letter-spacing: .5px; }
.empty-state   { text-align: center; padding: 48px 20px; color: #aaa; }
.empty-state i { font-size: 48px; display: block; margin-bottom: 12px; opacity: .3; }
.empty-state p { font-size: 15px; }
.empty-state-sm{ text-align: center; padding: 24px; color: #bbb; font-size: 14px; display: flex; align-items: center; gap: 8px; justify-content: center; }

/* ── Doc-type tiles (internal step 1) ──────────────────────── */
.doctype-tiles { display: grid; gap: 10px; }
.doctype-tile  { display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border-radius: 12px; border: 2px solid color-mix(in srgb, var(--dt-color) 25%, transparent);
  background: #fff; cursor: pointer; }
.doctype-tile input[type=radio] { display: none; }
.doctype-tile i { font-size: 26px; color: var(--dt-color); }
.dt-info { flex: 1; }
.dt-main { font-weight: 700; font-size: 15px; color: var(--c-text); }
.dt-sub  { font-size: 12px; color: #888; }
.doctype-tile.selected,
.doctype-tile:has(input:checked) { background: var(--dt-bg); border-color: var(--dt-color); }
.doctype-tile.selected .dt-main,
.doctype-tile:has(input:checked) .dt-main { color: var(--dt-color); }

/* ── Doc-type confirm badge ─────────────────────────────────── */
.doctype-confirm-badge { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--dt-bg); border-radius: 12px; margin-bottom: 16px; }
.doctype-confirm-badge i { font-size: 26px; color: var(--dt-color); }
.doctype-confirm-badge .dt-main { font-size: 17px; font-weight: 700; color: var(--dt-color); }
.doctype-confirm-badge .dt-sub  { font-size: 12px; color: color-mix(in srgb, var(--dt-color) 70%, #888); }

/* ── Doc-type badge in tx list ──────────────────────────────── */
.tx-doctype-badge { display: inline-block; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 4px; margin-right: 4px; vertical-align: middle; }

/* ── Nav badge (type code overlay) ─────────────────────────── */
.nav-icon-wrap { position: relative; }
.nav-badge { position: absolute; top: -2px; right: -4px;
  font-size: 8px; font-weight: 700; background: #888; color: #fff;
  border-radius: 4px; padding: 0 3px; line-height: 14px; white-space: nowrap; }
.nav-item.active .nav-badge { background: var(--nav-color); }
