:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-alt: #eef4f7;
  --text: #17212b;
  --muted: #607080;
  --border: #d7dee5;
  --primary: #0f6b5f;
  --primary-dark: #0a5047;
  --danger: #b42318;
  --warning: #9a6700;
  --success: #116329;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

label span {
  font-size: 13px;
  font-weight: 700;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 60px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.brand {
  font-size: 18px;
  font-weight: 800;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.nav a,
.logout-form {
  color: var(--muted);
}

.nav a {
  padding: 8px 10px;
  border-radius: 6px;
}

.nav a:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.logout-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.footer {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel,
.stat,
.login-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.panel h2 {
  margin-bottom: 14px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  display: grid;
  gap: 4px;
  padding: 16px;
}

.stat strong {
  font-size: 28px;
}

.stat span {
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 9px 13px;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  border-color: #aeb9c5;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.danger {
  border-color: #f1b8b3;
  background: #fff5f5;
  color: var(--danger);
}

.btn.subtle {
  min-height: 34px;
  padding: 7px 10px;
}

.btn.full {
  width: 100%;
}

.login-shell {
  display: grid;
  min-height: calc(100vh - 120px);
  place-items: center;
}

.login-body {
  background: #0e1117;
  color: #e8ecf4;
  --admin-bg-base: #0e1117;
  --admin-bg-card: #161b27;
  --admin-bg-card2: #1c2333;
  --admin-bg-hover: #212840;
  --admin-border: #2a3350;
  --admin-border-light: #354060;
  --admin-text-primary: #e8ecf4;
  --admin-text-secondary: #8b96b0;
  --admin-text-dim: #4a5568;
  --admin-accent: #3b82f6;
  --admin-accent-glow: rgba(59, 130, 246, 0.18);
  --admin-accent-light: #93c5fd;
}

.login-body .page {
  width: 100%;
  min-height: 100vh;
  margin: 0;
}

.auth-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  align-items: center;
  gap: clamp(28px, 6vw, 76px);
  min-height: 100vh;
  padding: clamp(24px, 5vw, 72px);
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.08), transparent 34%),
    linear-gradient(90deg, rgba(14, 17, 23, 1), rgba(14, 17, 23, 0.92)),
    var(--admin-bg-base);
}

.auth-shell::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--admin-accent), transparent);
}

.auth-hero {
  max-width: 620px;
  color: var(--admin-text-primary);
}

.auth-kicker {
  margin-bottom: 14px;
  color: var(--admin-accent-light);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-hero h1 {
  max-width: 12em;
  font-size: clamp(34px, 5vw, 60px);
}

.auth-hero p {
  max-width: 32em;
  margin-top: 14px;
  color: var(--admin-text-secondary);
  font-size: 17px;
}

.auth-card-stack {
  display: grid;
  width: min(430px, 100%);
}

.login-panel {
  display: grid;
  width: min(380px, 100%);
  gap: 14px;
  padding: 28px;
}

.auth-panel {
  width: 100%;
  border: 1px solid var(--admin-border);
  background: var(--admin-bg-card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  color: var(--admin-text-primary);
}

.auth-panel[hidden] {
  display: none;
}

.auth-panel label {
  color: var(--admin-text-secondary);
}

.auth-panel input,
.auth-panel textarea {
  border-color: var(--admin-border);
  background: var(--admin-bg-base);
  color: var(--admin-text-primary);
}

.auth-panel input::placeholder,
.auth-panel textarea::placeholder {
  color: var(--admin-text-dim);
}

.login-panel h1 {
  margin-bottom: 8px;
}

.auth-panel-head {
  display: grid;
  gap: 6px;
}

.auth-panel-head h1 {
  margin: 0;
}

.auth-panel-head p {
  margin: 0;
  color: var(--admin-text-secondary);
}

.auth-panel .btn.primary {
  border-color: var(--admin-accent);
  background: var(--admin-accent);
  color: #fff;
}

.auth-register-entry {
  display: grid;
  gap: 10px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-bg-card2);
  padding: 12px;
}

.auth-register-entry div {
  display: grid;
  gap: 2px;
}

.auth-register-entry strong {
  color: var(--admin-text-primary);
  font-size: 14px;
}

.auth-register-entry span {
  color: var(--admin-text-secondary);
  font-size: 13px;
}

.auth-register-button {
  width: 100%;
  border-color: var(--admin-border-light);
  background: var(--admin-bg-hover);
  color: var(--admin-accent-light);
  font-weight: 900;
}

.auth-register-button:hover {
  border-color: var(--admin-accent);
  color: var(--admin-text-primary);
}

.auth-panel textarea {
  min-height: 86px;
}

.flash-list {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 1500;
  display: grid;
  justify-items: end;
  gap: 6px;
  width: min(360px, calc(100vw - 32px));
  margin: 0;
  pointer-events: none;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.flash-list.is-hiding {
  opacity: 0;
  transform: translateY(8px);
}

.flash-list .flash {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.5;
  text-align: right;
  text-shadow: 0 1px 8px rgba(15, 23, 42, 0.62);
}

.flash-list .flash.error {
  border-color: #f1b8b3;
  color: var(--danger);
}

.flash-list .flash.success {
  border-color: #aadbb7;
  color: var(--success);
}

.flash-list .flash.warning {
  border-color: #f4d58b;
  color: var(--warning);
}

.admin-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  min-width: 150px;
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
  color: #e5edf8;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  padding: 10px 13px;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.admin-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.admin-toast.success {
  border-color: rgba(34, 197, 94, 0.42);
}

.admin-toast.error {
  border-color: rgba(239, 68, 68, 0.48);
  color: #fecaca;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.segmented input {
  width: auto;
}

.quick-create,
.filter-bar {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.filter-bar {
  grid-template-columns: 2fr 0.9fr 0.9fr 0.9fr 0.9fr auto;
}

.quick-create {
  grid-template-columns: 130px 1.3fr 1fr auto;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.table-wrap.compact {
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f9fafb;
  color: #344054;
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge.pending {
  background: #fff7d6;
  color: #7a4d00;
}

.badge.received,
.badge.shipped {
  background: #dff6e7;
  color: #116329;
}

.badge.exception {
  background: #ffe0dc;
  color: #9f1d14;
}

.badge.void {
  background: #eaecf0;
  color: #475467;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-list a {
  display: grid;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
}

.compact-list a:hover {
  background: var(--surface-alt);
}

.compact-list span {
  color: var(--muted);
  font-size: 13px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px 14px;
  margin: 0;
}

.detail-grid dt {
  color: var(--muted);
  font-weight: 700;
}

.detail-grid dd {
  margin: 0;
}

.actions-row {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.actions-row form,
.upload-form,
.inline-form {
  display: flex;
  gap: 8px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline div {
  display: grid;
  gap: 3px;
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}

.timeline span,
.empty {
  color: var(--muted);
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .auth-shell {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 24px;
    padding: 24px 16px;
  }

  .auth-hero h1 {
    font-size: 34px;
  }

  .topbar,
  .toolbar,
  .split {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar,
  .quick-create {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
    padding: 12px 16px;
  }

  .logout-form {
    justify-content: space-between;
  }
}

/* ===== Old WMS-like mode home and scan work surfaces ===== */
body.mode-home,
body.scan-work {
  min-height: 100vh;
  overflow: hidden;
  background: #0a0e1a;
  color: #e8ecf4;
  user-select: none;
}

.home-admin-bar {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8ea0bd;
  font-size: 13px;
}

.home-admin-bar form {
  margin: 0;
}

.home-admin-bar button {
  min-height: 34px;
  border: 1px solid #2a3a55;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.9);
  color: #e8ecf4;
  padding: 0 12px;
  cursor: pointer;
}

.mode-home-body {
  display: flex;
  height: calc(100vh - 42px);
  padding: 22px 24px 16px;
}

.mode-grid {
  display: grid;
  width: 100%;
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mode-tile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  border: 3px solid #2a3a55;
  border-radius: 20px;
  background: #111827;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mode-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.mode-tile:hover {
  transform: scale(1.015);
}

.mode-tile:hover::before {
  opacity: 1;
}

.mode-tile.receive { border-color: #22c55e; }
.mode-tile.receive::before { background: radial-gradient(ellipse at center, rgba(34, 197, 94, 0.14), transparent 70%); }
.mode-tile.receive:hover { box-shadow: 0 0 52px rgba(34, 197, 94, 0.32); }
.mode-tile.receive .mode-icon,
.mode-tile.receive .mode-title { color: #22c55e; }

.mode-tile.ship { border-color: #ef4444; }
.mode-tile.ship::before { background: radial-gradient(ellipse at center, rgba(239, 68, 68, 0.14), transparent 70%); }
.mode-tile.ship:hover { box-shadow: 0 0 52px rgba(239, 68, 68, 0.34); }
.mode-tile.ship .mode-icon,
.mode-tile.ship .mode-title { color: #ef4444; }

.mode-tile.query { border-color: #3b82f6; }
.mode-tile.query::before { background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.14), transparent 70%); }
.mode-tile.query:hover { box-shadow: 0 0 52px rgba(59, 130, 246, 0.3); }
.mode-tile.query .mode-icon,
.mode-tile.query .mode-title { color: #3b82f6; }

.mode-tile.import { border-color: #f59e0b; }
.mode-tile.import::before { background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.14), transparent 70%); }
.mode-tile.import:hover { box-shadow: 0 0 52px rgba(245, 158, 11, 0.3); }
.mode-tile.import .mode-icon,
.mode-tile.import .mode-title { color: #f59e0b; }

.mode-tile.exception { border-color: #f97316; }
.mode-tile.exception::before { background: radial-gradient(ellipse at center, rgba(249, 115, 22, 0.14), transparent 70%); }
.mode-tile.exception:hover { box-shadow: 0 0 52px rgba(249, 115, 22, 0.3); }
.mode-tile.exception .mode-icon,
.mode-tile.exception .mode-title { color: #f97316; }

.mode-tile.admin { border-color: #14b8a6; }
.mode-tile.admin::before { background: radial-gradient(ellipse at center, rgba(20, 184, 166, 0.14), transparent 70%); }
.mode-tile.admin:hover { box-shadow: 0 0 52px rgba(20, 184, 166, 0.3); }
.mode-tile.admin .mode-icon,
.mode-tile.admin .mode-title { color: #14b8a6; }

.mode-icon,
.mode-title,
.mode-sub {
  position: relative;
  z-index: 1;
}

.mode-icon {
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1;
}

.mode-title {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 900;
  letter-spacing: 8px;
}

.mode-sub {
  color: #5a6a8a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
}

.mode-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  height: 42px;
  border-top: 1px solid #2a3a55;
  background: #111827;
  color: #5a6a8a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 1px;
}

body.scan-work .work-header {
  height: 64px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #111827;
  border-bottom: 2px solid #2a3a55;
}

body.scan-work .mode-badge {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 4px;
  padding: 6px 18px;
  border-radius: 8px;
  border: 2px solid;
}

body.scan-work .mode-badge.receive {
  color: #22c55e;
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
}

body.scan-work .mode-badge.ship {
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

body.scan-work .mode-badge.return {
  color: #c084fc;
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.15);
}

.work-customer-pill {
  min-width: 0;
  max-width: min(280px, 24vw);
  overflow: hidden;
  border: 1px solid #2a3a55;
  border-radius: 8px;
  background: #1a2235;
  color: #8ea0bd;
  padding: 8px 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 900;
}

.header-time {
  color: #e8ecf4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
}

body.scan-work .header-actions {
  display: flex;
  gap: 10px;
}

.work-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 48px;
  border: 2px solid #2a3a55;
  border-radius: 8px;
  background: #1a2235;
  color: #e8ecf4;
  padding: 8px 16px;
  font-size: 17px;
  font-weight: 900;
}

body.scan-work .work-body {
  --scan-top-card-height: 154px;
  position: relative;
  display: grid;
  grid-template-columns: 34% 66%;
  gap: 16px;
  height: calc(100vh - 64px);
  padding: 16px;
  overflow: hidden;
  background: #0f1629;
}

body.scan-work .work-body::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

body.scan-work .work-body.receive::before {
  background: radial-gradient(ellipse at center, rgba(34, 197, 94, 0.36), transparent 62%);
}

body.scan-work .work-body.ship::before {
  background: radial-gradient(ellipse at center, rgba(239, 68, 68, 0.32), transparent 62%);
}

body.scan-work .work-body.return::before {
  background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.32), transparent 62%);
}

body.scan-work .work-body.flash::before,
body.scan-work .work-body.warn-flash::before,
body.scan-work .work-body.error-flash::before {
  opacity: 0.3;
}

.scan-pane,
.result-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}

.scan-card,
.recent-panel,
body.scan-work .result-banner,
body.scan-work .primary-metric,
body.scan-work .meta-card {
  border: 2px solid #2a3a55;
  border-radius: 18px;
  background: #111827;
}

.scan-card {
  flex: 0 0 auto;
  display: flex;
  height: var(--scan-top-card-height);
  min-height: var(--scan-top-card-height);
  flex-direction: column;
  justify-content: center;
  padding: 18px;
}

.scan-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #8ea0bd;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.scan-label-title {
  flex: 0 0 auto;
  color: #aab8d0;
  font-weight: 900;
  letter-spacing: 0;
}

.scan-label-dot {
  flex: 0 0 auto;
  color: #48617f;
  font-weight: 900;
  letter-spacing: 0;
}

.scan-label em {
  min-width: 0;
  color: #8ea0bd;
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scanner-input {
  display: block;
  width: 100%;
  height: 82px;
  border: 3px solid #2a3a55;
  border-radius: 16px;
  background: #0a0e1a;
  color: #e8ecf4;
  padding: 0 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(24px, 4.2vw, 44px);
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 76px;
  outline: none;
  overflow: hidden;
  resize: none;
  white-space: nowrap;
}

.scanner-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 28px rgba(59, 130, 246, 0.3);
}

body.scan-work.receive .scanner-input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 28px rgba(34, 197, 94, 0.28);
}

body.scan-work.ship .scanner-input:focus {
  border-color: #ef4444;
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.28);
}

body.scan-work.return .scanner-input:focus {
  border-color: #a855f7;
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.28);
}

.sound-notice {
  margin-top: 10px;
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 900;
}

.recent-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  scrollbar-width: none;
}

.recent-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.recent-title {
  margin-bottom: 10px;
  color: #8ea0bd;
  font-size: 18px;
  font-weight: 900;
}

.recent-panel a {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  border: 1px solid #2a3a55;
  border-radius: 12px;
  background: #0d1424;
  padding: 10px;
}

.recent-item {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  border: 1px solid #2a3a55;
  border-radius: 12px;
  background: #0d1424;
  padding: 10px;
}

.recent-item.new {
  animation: recentSlide 0.36s ease-out;
  border-color: rgba(59, 130, 246, 0.72);
}

.recent-panel strong {
  color: #e8ecf4;
  overflow-wrap: anywhere;
}

.recent-panel em,
.recent-panel p {
  color: #5a6a8a;
  font-style: normal;
}

body.scan-work.return .recent-item em {
  color: #ff0000;
}

body.scan-work .result-banner {
  display: flex;
  height: var(--scan-top-card-height);
  min-height: var(--scan-top-card-height);
  flex-direction: column;
  justify-content: center;
  padding: 16px 22px;
}

.result-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

body.scan-work .result-message {
  font-size: clamp(30px, 4.6vw, 52px);
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.1;
  min-width: 0;
}

body.scan-work .result-message.receive,
body.scan-work .result-message.in {
  color: #22c55e;
}

body.scan-work .result-message.ship,
body.scan-work .result-message.out {
  color: #ef4444;
}

body.scan-work .result-message.return,
body.scan-work .result-message.return-duplicate {
  color: #c084fc;
}

body.scan-work .result-message.warn {
  color: #f97316;
}

body.scan-work .result-message.error {
  color: #f97316;
  animation: shake 0.5s ease-out;
}

body.scan-work .result-message.pop {
  animation: successPop 0.35s ease-out;
}

.result-code {
  margin-top: 8px;
  color: #e8ecf4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: 2px;
  overflow-wrap: anywhere;
}

.result-code.empty {
  color: #5a6a8a;
}

.undo-scan-btn {
  flex: 0 0 auto;
  min-width: 116px;
  height: 38px;
  border: 1px solid rgba(248, 113, 113, 0.5);
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
}

.undo-scan-btn:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.86);
  background: rgba(185, 28, 28, 0.45);
}

.undo-scan-btn:disabled {
  border-color: rgba(90, 106, 138, 0.42);
  background: rgba(30, 41, 59, 0.5);
  color: #64748b;
  cursor: not-allowed;
}

body.scan-work .primary-metric {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

body.scan-work .primary-metric .label {
  position: relative;
  z-index: 4;
  margin-bottom: 10px;
  color: #5a6a8a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 4px;
}

body.scan-work .primary-metric .value {
  position: relative;
  z-index: 5;
  color: #e8ecf4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(52px, 8vw, 104px);
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
  text-align: center;
}

body.scan-work .work-body.scan-pulse .primary-metric,
body.scan-work .work-body.scan-pulse .result-banner {
  animation: scanPulse 0.42s ease-out;
}

body.scan-work .work-body[data-tone="in"] .primary-metric .value,
body.scan-work .work-body[data-tone="receive"] .primary-metric .value {
  color: #22c55e;
}

body.scan-work .work-body[data-tone="out"] .primary-metric .value,
body.scan-work .work-body[data-tone="ship"] .primary-metric .value {
  color: #ef4444;
}

body.scan-work .work-body[data-tone="return"] .primary-metric .value,
body.scan-work .work-body[data-tone="return-duplicate"] .primary-metric .value {
  color: #c084fc;
}

body.scan-work .work-body[data-tone="error"] .primary-metric .value {
  color: #f97316;
}

.scan-hint-bar {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 18px;
  margin-top: 18px;
  color: #8ea0bd;
  font-size: 16px;
  font-weight: 800;
}

body.scan-work .meta-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body.scan-work .meta-card {
  padding: 14px 16px;
}

body.scan-work .meta-card .label {
  display: block;
  color: #5a6a8a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
}

body.scan-work .meta-card strong {
  display: block;
  margin-top: 4px;
  color: #e8ecf4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 34px;
}

body.scan-work .meta-card strong.today-sku-count {
  color: #ef4444;
}

body.scan-work .meta-card strong.meta-bump {
  animation: metaBump 0.34s ease-out;
}

.scan-feedback-overlay {
  --feedback-color: rgba(34, 197, 94, 0.92);
  --feedback-soft: rgba(34, 197, 94, 0.28);
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.94);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.scan-feedback-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--feedback-soft), transparent 46%);
  opacity: 0;
  border-radius: 18px;
}

.scan-feedback-overlay.show {
  opacity: 1;
  transform: scale(1);
}

.scan-feedback-overlay.show::before {
  animation: scanFeedbackFlash 0.9s ease-out forwards;
}

.scan-feedback-overlay.receive {
  --feedback-color: rgba(34, 197, 94, 0.92);
  --feedback-soft: rgba(34, 197, 94, 0.28);
}

.scan-feedback-overlay.ship,
.scan-feedback-overlay.error {
  --feedback-color: rgba(239, 68, 68, 0.92);
  --feedback-soft: rgba(239, 68, 68, 0.28);
}

.scan-feedback-overlay.return {
  --feedback-color: rgba(168, 85, 247, 0.92);
  --feedback-soft: rgba(168, 85, 247, 0.3);
}

.scan-feedback-overlay.return-duplicate {
  --feedback-color: rgba(192, 132, 252, 0.82);
  --feedback-soft: rgba(168, 85, 247, 0.18);
}

.scan-feedback-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(320px, 70%);
  height: min(320px, 70%);
  overflow: visible;
}

.scan-feedback-card::before,
.scan-feedback-card::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(280px, 100%);
  height: min(280px, 100%);
  border: 7px solid var(--feedback-color);
  border-radius: 50%;
  box-shadow: 0 0 34px var(--feedback-soft), 0 0 72px var(--feedback-soft);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.32);
}

.scan-feedback-card::after {
  border-width: 4px;
  filter: blur(1px);
}

.scan-feedback-overlay.show .scan-feedback-card::before {
  animation: scanFeedbackRipple 0.78s ease-out;
}

.scan-feedback-overlay.show .scan-feedback-card::after {
  animation: scanFeedbackRipple 0.82s ease-out 0.1s;
}

.scan-feedback-icon {
  position: relative;
  z-index: 1;
  display: flex;
  width: clamp(96px, 14vw, 138px);
  height: clamp(96px, 14vw, 138px);
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  filter: blur(1.8px);
  opacity: 0.42;
  box-shadow: none;
}

.scan-feedback-overlay.ship .scan-feedback-icon,
.scan-feedback-overlay.error .scan-feedback-icon {
  background: transparent;
  box-shadow: none;
}

.scan-feedback-overlay.return .scan-feedback-icon {
  background: transparent;
  box-shadow: none;
}

.scan-feedback-overlay:not(.error) .scan-feedback-icon::before {
  content: "";
  width: 42px;
  height: 70px;
  border-right: 10px solid var(--feedback-color);
  border-bottom: 10px solid var(--feedback-color);
  border-radius: 4px;
  transform: rotate(45deg) translate(-2px, -3px);
  box-shadow: 0 0 18px var(--feedback-soft), 0 0 42px var(--feedback-soft);
}

.scan-feedback-overlay.ship:not(.error) .scan-feedback-icon::before {
  border-color: var(--feedback-color);
}

.scan-feedback-overlay.return:not(.error) .scan-feedback-icon::before,
.scan-feedback-overlay.return-duplicate:not(.error) .scan-feedback-icon::before {
  border-color: var(--feedback-color);
}

.scan-feedback-overlay.error .scan-feedback-icon::before,
.scan-feedback-overlay.error .scan-feedback-icon::after {
  content: "";
  position: absolute;
  width: 54px;
  height: 9px;
  border-radius: 999px;
  background: var(--feedback-color);
  box-shadow: 0 0 18px var(--feedback-soft), 0 0 42px var(--feedback-soft);
}

.scan-feedback-overlay.error .scan-feedback-icon::before {
  transform: rotate(45deg);
}

.scan-feedback-overlay.error .scan-feedback-icon::after {
  transform: rotate(-45deg);
}

@keyframes successPop {
  0% { transform: scale(0.86); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes scanFeedbackRipple {
  0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.18); }
  62% { opacity: 0.3; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.55); }
}

@keyframes scanFeedbackFlash {
  0% { opacity: 0.55; }
  100% { opacity: 0; }
}

@keyframes scanPulse {
  0% { transform: scale(0.985); border-color: #60a5fa; box-shadow: 0 0 0 rgba(96, 165, 250, 0); }
  45% { transform: scale(1.012); border-color: #93c5fd; box-shadow: 0 0 36px rgba(96, 165, 250, 0.22); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(96, 165, 250, 0); }
}

@keyframes recentSlide {
  0% { opacity: 0; transform: translateY(-8px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes metaBump {
  0% { transform: scale(0.88); color: #93c5fd; }
  60% { transform: scale(1.12); color: #22c55e; }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

@media (max-width: 760px) {
  body.mode-home,
  body.scan-work {
    overflow: auto;
  }

  .home-admin-bar {
    position: static;
    justify-content: flex-end;
    padding: 10px 12px 0;
  }

  .mode-home-body {
    height: auto;
    min-height: calc(100dvh - 94px);
    padding: 12px;
  }

  .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(122px, 1fr));
    gap: 12px;
  }

  .mode-title {
    font-size: 25px;
    letter-spacing: 4px;
  }

  .mode-sub {
    font-size: 10px;
    letter-spacing: 1px;
  }

  .mode-footer {
    flex-wrap: wrap;
    height: auto;
    min-height: 42px;
    padding: 8px;
    gap: 8px 14px;
  }

  body.scan-work .work-header {
    height: auto;
    min-height: 64px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  body.scan-work .header-actions {
    justify-content: stretch;
  }

  .work-btn {
    flex: 1;
  }

  body.scan-work .work-body {
    --scan-top-card-height: auto;
    height: auto;
    min-height: calc(100dvh - 150px);
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .scanner-input {
    height: 70px;
    font-size: 24px;
    line-height: 64px;
  }

  .scan-label {
    flex-wrap: wrap;
    gap: 4px 10px;
  }

  .scan-label-dot {
    display: none;
  }

  .scan-label em {
    flex-basis: 100%;
    white-space: normal;
  }

  body.scan-work .primary-metric .value {
    font-size: clamp(38px, 12vw, 68px);
  }

  .result-title-row {
    align-items: flex-start;
  }
}

/* ===== Admin console shell, aligned with the original WMS backend style ===== */
body.admin-shell {
  height: 100vh;
  overflow: hidden;
  background: #0e1117;
  color: #e8ecf4;
  --admin-bg-base: #0e1117;
  --admin-bg-card: #161b27;
  --admin-bg-card2: #1c2333;
  --admin-bg-hover: #212840;
  --admin-border: #2a3350;
  --admin-border-light: #354060;
  --admin-text-primary: #e8ecf4;
  --admin-text-secondary: #8b96b0;
  --admin-text-dim: #4a5568;
  --admin-accent: #3b82f6;
  --admin-accent-glow: rgba(59, 130, 246, 0.18);
  --admin-accent-light: #93c5fd;
}

.admin-topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  border-bottom: 1px solid var(--admin-border);
  background: var(--admin-bg-card);
  padding: 0 22px;
}

.admin-topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--admin-accent), transparent);
  opacity: 0.55;
}

.admin-topbar .topbar-left,
.admin-topbar .topbar-right {
  display: flex;
  align-items: center;
}

.admin-topbar .topbar-left {
  gap: 14px;
}

.admin-topbar .topbar-right {
  gap: 10px;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  height: 38px;
  border: 1px solid var(--admin-accent);
  border-radius: 8px;
  background: var(--admin-accent-glow);
  color: var(--admin-accent-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
}

.title-main {
  display: block;
  color: var(--admin-text-primary);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
}

.title-sub {
  display: block;
  color: var(--admin-text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.sys-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--admin-text-secondary);
  font-size: 12px;
}

.ready-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.95);
}

.admin-topbar .clock {
  min-width: 82px;
  color: var(--admin-accent-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: right;
}

.btn-topbar,
.admin-logout button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-bg-card2);
  color: var(--admin-text-secondary);
  padding: 0 11px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.btn-topbar:hover,
.admin-logout button:hover {
  border-color: var(--admin-accent);
  color: var(--admin-text-primary);
}

.btn-topbar-primary {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.dropdown-wrap {
  position: relative;
}

.customer-switcher,
.customer-create {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-bg-card2);
  color: var(--admin-text-secondary);
  padding: 0 7px;
  font-size: 12px;
  font-weight: 800;
}

.customer-switcher span {
  color: var(--admin-text-dim);
}

.customer-switcher select {
  width: 118px;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--admin-text-primary);
  padding: 0 4px;
  font-size: 12px;
  font-weight: 900;
}

.customer-create input {
  width: 96px;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--admin-text-primary);
  padding: 0 4px;
  font-size: 12px;
}

.customer-create button {
  min-height: 26px;
  border: 1px solid rgba(59, 130, 246, 0.38);
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.customer-dropdown-wrap .dropdown-menu {
  min-width: 260px;
}

.customer-dropdown-btn {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-section-title {
  color: var(--admin-text-dim);
  padding: 10px 14px 6px;
  font-size: 11px;
  font-weight: 900;
}

.dropdown-form {
  margin: 0;
}

.customer-option {
  justify-content: space-between;
  gap: 16px;
}

.customer-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-option strong {
  color: #86efac;
  font-size: 11px;
}

.customer-option.active {
  background: rgba(34, 197, 94, 0.12);
  color: var(--admin-text-primary);
}

.customer-create-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
}

.customer-create-inline input {
  min-width: 0;
  min-height: 32px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #050a14;
  color: var(--admin-text-primary);
  padding: 0 10px;
  font-size: 12px;
}

.customer-create-inline button {
  min-height: 32px;
  border: 1px solid rgba(59, 130, 246, 0.42);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: none;
  min-width: 245px;
  overflow: hidden;
  border: 1px solid var(--admin-border-light);
  border-radius: 14px;
  background: var(--admin-bg-card);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: flex;
  width: 100%;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--admin-text-secondary);
  padding: 14px 16px;
  text-align: left;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--admin-bg-hover);
  color: var(--admin-text-primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--admin-border);
}

.admin-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--admin-text-secondary);
  font-size: 12px;
}

.admin-logout span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(59, 130, 246, 0.32);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--admin-text-primary);
  padding: 0 11px;
  font-weight: 800;
}

.admin-main-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  height: calc(100vh - 58px);
  overflow: hidden;
}

.admin-shell.no-sidebar-page .admin-main-layout {
  grid-template-columns: minmax(0, 1fr);
}

.admin-shell.no-sidebar-page .admin-sidebar {
  display: none;
}

.admin-sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  border-right: 1px solid var(--admin-border);
  background: var(--admin-bg-card);
  padding: 12px;
}

.admin-content {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--admin-bg-base);
  padding: 14px 20px 18px;
}

.admin-shell .stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-shell .stat-card {
  display: block;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: var(--admin-bg-card2);
  padding: 10px 8px;
  text-align: center;
}

.admin-shell .stat-card:hover {
  border-color: var(--admin-accent);
  background: var(--admin-bg-hover);
}

.admin-shell .stat-card.stat-warn { border-color: rgba(249, 115, 22, 0.35); }
.admin-shell .stat-card.stat-danger { border-color: rgba(239, 68, 68, 0.35); }
.admin-shell .stat-card.stat-ok { border-color: rgba(34, 197, 94, 0.35); }

.admin-shell .stat-num {
  color: var(--admin-accent-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px;
  font-weight: 900;
}

.admin-shell .stat-card.stat-warn .stat-num { color: #f97316; }
.admin-shell .stat-card.stat-danger .stat-num { color: #ef4444; }
.admin-shell .stat-card.stat-ok .stat-num { color: #22c55e; }

.admin-shell .stat-label {
  margin-top: 2px;
  color: var(--admin-text-secondary);
  font-size: 12px;
}

.side-section {
  display: grid;
  gap: 6px;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  background: rgba(28, 35, 51, 0.58);
  padding: 10px;
}

.side-title {
  color: var(--admin-text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.side-section a {
  border-radius: 8px;
  color: var(--admin-text-secondary);
  padding: 7px 8px;
  font-weight: 800;
}

.side-section a:hover {
  background: var(--admin-bg-hover);
  color: var(--admin-text-primary);
}

.side-actions {
  gap: 8px;
}

.side-action-grid {
  display: grid;
  gap: 8px;
}

.side-action-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: var(--admin-bg-card2);
  color: var(--admin-text-primary);
  padding: 8px 10px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.side-action-card:hover {
  transform: translateY(-1px);
  background: var(--admin-bg-hover);
}

.side-action-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 17px;
}

.side-action-card strong {
  font-size: 14px;
  font-weight: 900;
}

.side-action-card.receive { border-color: rgba(34, 197, 94, 0.42); }
.side-action-card.ship { border-color: rgba(239, 68, 68, 0.42); }
.side-action-card.return { border-color: rgba(168, 85, 247, 0.46); }
.side-action-card.return-record { border-color: rgba(59, 130, 246, 0.45); }
.side-action-card.ledger { border-color: rgba(20, 184, 166, 0.46); }

.admin-hero,
.admin-panel,
.admin-shell .panel {
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  background: var(--admin-bg-card);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.34);
}

.inventory-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  background: var(--admin-bg-card);
  padding: 18px 20px;
}

.inventory-page-head h1 {
  color: var(--admin-text-primary);
  font-size: 24px;
  font-weight: 900;
}

.inventory-page-head p {
  color: var(--admin-text-secondary);
}

.inventory-dashboard-grid {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  grid-template-rows: minmax(370px, 1fr) minmax(150px, 0.36fr);
  gap: 14px;
}

.inventory-panel,
.flow-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.inventory-title-row {
  display: grid;
  grid-template-columns: minmax(210px, max-content) minmax(360px, 600px);
  align-items: center;
  justify-content: space-between;
  column-gap: 14px;
}

.inventory-title-row > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.inventory-panel .inventory-title-row,
.flow-panel .panel-title-row {
  min-height: 40px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--admin-border);
  background: var(--admin-bg-card2);
  padding: 4px 10px;
}

.flow-panel .panel-title-row {
  min-height: 30px;
  padding: 0 10px;
}

.inventory-title-row h2,
.flow-panel .panel-title-row h2 {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.panel-inline-note {
  color: var(--admin-text-secondary);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.inventory-filter-form {
  display: grid;
  justify-self: end;
  width: min(481px, 100%);
  grid-template-columns: minmax(0, 275px) 136px 54px;
  gap: 8px;
}

.inventory-filter-form input,
.inventory-filter-form select,
.inventory-filter-form button {
  height: 32px;
  min-height: 32px;
  padding-top: 0;
  padding-bottom: 0;
}

.inventory-filter-form input,
.inventory-filter-form select {
  padding-left: 12px;
  padding-right: 12px;
}

.inventory-filter-form input {
  padding-left: 6px;
  padding-right: 6px;
}

.inventory-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.inventory-panel .admin-table-wrap,
.flow-panel .admin-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
  overflow: auto;
  scrollbar-color: rgba(96, 165, 250, 0.72) rgba(15, 23, 42, 0.78);
  scrollbar-width: thin;
}

.inventory-panel .admin-table-wrap::-webkit-scrollbar,
.flow-panel .admin-table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.inventory-panel .admin-table-wrap::-webkit-scrollbar-track,
.flow-panel .admin-table-wrap::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.78);
  border-radius: 999px;
}

.inventory-panel .admin-table-wrap::-webkit-scrollbar-thumb,
.flow-panel .admin-table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid rgba(15, 23, 42, 0.78);
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.82);
}

.inventory-panel .admin-table-wrap::-webkit-scrollbar-corner,
.flow-panel .admin-table-wrap::-webkit-scrollbar-corner {
  background: rgba(15, 23, 42, 0.78);
}

.inventory-table-wrap td {
  vertical-align: middle;
}

.sku-cell {
  min-width: 230px;
}

.sku-code-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 24px;
  line-height: 1;
}

.sku-code-text {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.72);
  color: var(--admin-text-secondary);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.icon-action:hover {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(37, 99, 235, 0.22);
  color: var(--admin-text-primary);
}

.icon-action:active {
  transform: translateY(1px);
}

.icon-action:disabled {
  cursor: wait;
  opacity: 0.58;
}

.copy-sku-btn {
  font-size: 12px;
}

.favorite-sku-btn {
  color: #64748b;
  font-size: 15px;
}

.inventory-table-wrap .copy-sku-btn {
  width: 19px;
  height: 19px;
  border-radius: 5px;
  font-size: 10px;
}

.inventory-table-wrap .favorite-sku-btn {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-size: 12px;
}

.favorite-sku-btn.active {
  border-color: rgba(234, 179, 8, 0.5);
  background: rgba(234, 179, 8, 0.12);
  color: #facc15;
}

.location-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid rgba(59, 130, 246, 0.32);
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
}

.stock-num {
  color: var(--admin-text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
}

.stock-num.low {
  color: #f97316;
}

.stock-num.zero {
  color: #ef4444;
}

.row-actions {
  width: 54px;
  text-align: center;
  white-space: nowrap;
}

.btn-action,
.row-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 24px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: transparent;
  color: var(--admin-text-secondary);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-action:hover,
.row-actions a:hover {
  border-color: var(--admin-accent);
  background: var(--admin-bg-hover);
  color: var(--admin-accent-light);
}

.btn-action.danger:hover {
  border-color: rgba(239, 68, 68, 0.7);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.return-action-cell {
  position: relative;
  width: 58px;
  text-align: right;
}

.return-action-menu-wrap {
  position: relative;
  display: inline-flex;
}

.return-action-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 80;
  display: grid;
  min-width: 108px;
  overflow: hidden;
  border: 1px solid var(--admin-border-light);
  border-radius: 8px;
  background: var(--admin-bg-card);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
}

.return-action-menu[hidden] {
  display: none;
}

.return-action-menu form {
  margin: 0;
}

.return-action-menu-item {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--admin-text-secondary);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.return-action-menu-item:hover {
  background: var(--admin-bg-hover);
  color: var(--admin-text-primary);
}

.return-action-menu-item.danger {
  color: #fca5a5;
}

.return-action-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.op-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: var(--admin-bg-card2);
  color: var(--admin-text-primary);
  padding: 1px 6px;
  font-size: 12px;
  font-weight: 900;
}

.positive {
  color: #22c55e !important;
}

.negative {
  color: #ef4444 !important;
}

.muted {
  color: var(--admin-text-secondary);
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.admin-hero h1,
.admin-shell h1 {
  color: var(--admin-text-primary);
  font-size: 24px;
  font-weight: 900;
}

.admin-hero p,
.admin-shell p {
  color: var(--admin-text-secondary);
}

.admin-hero-actions,
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-shell .btn,
.admin-shell button.btn {
  border-color: var(--admin-border);
  background: var(--admin-bg-card2);
  color: var(--admin-text-primary);
}

.admin-shell .btn:hover {
  border-color: var(--admin-accent);
}

.admin-shell .btn.primary,
.admin-shell .btn.admin-primary {
  border-color: var(--admin-accent);
  background: var(--admin-accent);
  color: #fff;
}

.admin-shell .btn.danger {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.admin-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-action-grid.three-only {
  min-height: 220px;
}

.admin-action-card {
  display: grid;
  gap: 6px;
  min-height: 132px;
  border: 2px solid var(--admin-border);
  border-radius: 16px;
  background: var(--admin-bg-card);
  padding: 16px;
  align-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.admin-action-card:hover {
  transform: translateY(-2px);
  background: var(--admin-bg-hover);
}

.admin-action-card span {
  font-size: 34px;
}

.admin-action-card strong {
  color: var(--admin-text-primary);
  font-size: 20px;
}

.admin-action-card em {
  color: var(--admin-text-secondary);
  font-style: normal;
}

.admin-action-card.receive { border-color: rgba(34, 197, 94, 0.52); }
.admin-action-card.ship { border-color: rgba(239, 68, 68, 0.52); }
.admin-action-card.package { border-color: rgba(59, 130, 246, 0.52); }
.admin-action-card.import { border-color: rgba(245, 158, 11, 0.52); }
.admin-action-card.exception { border-color: rgba(249, 115, 22, 0.52); }
.admin-action-card.users { border-color: rgba(20, 184, 166, 0.52); }
.admin-action-card.return { border-color: rgba(168, 85, 247, 0.58); }
.admin-action-card.return:hover { box-shadow: 0 0 34px rgba(168, 85, 247, 0.18); }

.admin-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.return-records-page {
  display: grid;
  min-height: 0;
  height: 100%;
  grid-template-rows: minmax(0, 1fr);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.return-records-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.return-records-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  border-bottom: 1px solid rgba(42, 51, 80, 0.85);
  padding: 0 2px 7px;
  margin-bottom: 7px;
}

.return-records-title {
  display: flex;
  min-width: max-content;
  align-items: center;
}

.return-records-title h2 {
  margin: 0;
}

.return-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 150px 130px 130px auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(42, 51, 80, 0.86);
  border-radius: 10px;
  background: rgba(10, 14, 26, 0.34);
  padding: 6px;
  margin-bottom: 8px;
}

.return-records-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.return-records-table-wrap table {
  font-size: 12px;
}

.return-records-table-wrap th,
.return-records-table-wrap td {
  padding: 6px 10px;
  line-height: 1.25;
}

.return-records-table-wrap th {
  height: 28px;
  font-size: 11px;
}

.return-records-table-wrap td {
  height: 40px;
}

.return-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.return-status-pill.unmatched {
  border-color: rgba(249, 115, 22, 0.46);
  background: rgba(249, 115, 22, 0.12);
  color: #fdba74;
}

.return-status-pill.matched,
.return-status-pill.stocked {
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.return-status-pill.exception,
.return-status-pill.void {
  border-color: rgba(239, 68, 68, 0.44);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

.return-remark-cell {
  min-width: 180px;
}

.return-remark-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  min-width: 300px;
}

.return-remark-form[hidden] {
  display: none;
}

.return-remark-form input {
  min-height: 30px;
  border-radius: 7px;
  padding: 0 9px;
}

.admin-panel {
  min-width: 0;
  padding: 16px;
}

.panel-title-row {
  margin-bottom: 12px;
}

.panel-title-row h2,
.admin-shell h2 {
  color: var(--admin-text-primary);
  font-size: 18px;
  font-weight: 900;
}

.panel-title-row a {
  color: var(--admin-accent-light);
  font-size: 13px;
  font-weight: 800;
}

.admin-table-wrap,
.admin-shell .table-wrap {
  overflow-x: auto;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  background: var(--admin-bg-card);
}

.admin-shell table {
  width: 100%;
  border-collapse: collapse;
}

.admin-shell th,
.admin-shell td {
  border-bottom: 1px solid var(--admin-border);
  color: var(--admin-text-secondary);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}

.inventory-panel th,
.inventory-panel td,
.flow-panel th,
.flow-panel td {
  padding: 5px 9px;
  line-height: 1.15;
}

.inventory-panel thead th {
  height: 32px;
}

.inventory-panel tbody td {
  height: 40px;
}

.admin-shell th {
  background: var(--admin-bg-card2);
  color: var(--admin-text-primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.inventory-panel thead th,
.flow-panel thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.admin-shell tr:hover td {
  background: rgba(33, 40, 64, 0.46);
}

.admin-shell tr:last-child td {
  border-bottom: 0;
}

.user-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 24px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 900;
}

.user-status-pill.active {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.user-status-pill.pending {
  border-color: rgba(250, 204, 21, 0.44);
  background: rgba(250, 204, 21, 0.12);
  color: #fde68a;
}

.user-status-pill.inactive {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.1);
  color: var(--admin-text-dim);
}

.users-table {
  min-width: 1320px;
}

.users-table-wrap {
  max-height: max(360px, calc(100vh - 332px));
  overflow: auto;
}

.users-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.users-table th,
.users-table td {
  white-space: nowrap;
}

.users-table td {
  vertical-align: middle;
}

.users-table th,
.users-table td {
  padding: 7px 10px;
}

.users-table input {
  min-height: 32px;
  padding: 5px 8px;
}

.users-table .btn.subtle {
  min-height: 32px;
  padding: 5px 9px;
}

.user-account-cell {
  min-width: 132px;
}

.users-table .signup-info-cell,
.users-table .user-account-cell {
  white-space: normal;
}

.signup-info-cell {
  min-width: 150px;
  max-width: 220px;
  line-height: 1.55;
  vertical-align: top;
}

.last-login-ip-cell {
  min-width: 118px;
}

.user-password-tools,
.user-row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.user-password-tools {
  min-width: 326px;
}

.user-password-tools form,
.user-row-actions form {
  margin: 0;
}

.user-password-tools .inline-form {
  display: grid;
  grid-template-columns: 150px auto;
  align-items: center;
  gap: 6px;
}

.user-password-tools input {
  width: 100%;
  min-width: 0;
}

.user-row-actions {
  min-width: 160px;
}

.login-events-table {
  min-width: 980px;
}

.login-events-table-wrap {
  max-height: calc(100vh - 240px);
  overflow: auto;
}

.login-events-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.login-result-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 24px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 900;
}

.login-result-pill.success {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.login-result-pill.failure {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.login-user-agent-cell {
  max-width: 380px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.admin-shell .toolbar,
.admin-shell .filter-bar,
.admin-shell .quick-create,
.admin-shell .split {
  margin-bottom: 0;
}

.admin-shell .toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  background: var(--admin-bg-card);
  padding: 16px 18px;
}

.admin-shell .filter-bar,
.admin-shell .quick-create {
  border-color: var(--admin-border);
  background: var(--admin-bg-card);
}

.admin-shell .panel {
  padding: 16px;
}

.admin-shell input,
.admin-shell select,
.admin-shell textarea {
  border-color: var(--admin-border);
  background: var(--admin-bg-base);
  color: var(--admin-text-primary);
}

.admin-shell input::placeholder,
.admin-shell textarea::placeholder {
  color: var(--admin-text-dim);
}

.customer-admin-page {
  display: grid;
  min-height: 0;
  gap: 12px;
}

.customer-admin-head,
.customer-create-panel {
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  background: var(--admin-bg-card);
  padding: 14px 16px;
}

.customer-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.customer-admin-head h1 {
  color: var(--admin-text-primary);
  font-size: 22px;
  font-weight: 900;
}

.customer-admin-head p {
  color: var(--admin-text-secondary);
  font-size: 13px;
}

.customer-create-panel {
  display: grid;
  grid-template-columns: minmax(280px, 420px) auto;
  align-items: end;
  justify-content: start;
  gap: 10px;
}

.customer-create-panel label {
  display: grid;
  gap: 6px;
}

.customer-create-panel label span {
  color: var(--admin-text-secondary);
  font-size: 12px;
  font-weight: 900;
}

.customer-create-panel input {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 11px;
}

.customer-table-panel {
  overflow: hidden;
  padding: 0;
}

.customer-table-panel .panel-title-row {
  min-height: 40px;
  border-bottom: 1px solid var(--admin-border);
  padding: 0 12px;
}

.customer-table-wrap {
  border: 0;
  border-radius: 0;
}

.customer-table th,
.customer-table td {
  padding: 9px 12px;
  vertical-align: middle;
}

.customer-table th {
  background: var(--admin-bg-card2);
  color: var(--admin-text-primary);
}

.customer-name-cell {
  min-width: 260px;
}

.customer-name-view {
  color: var(--admin-text-primary);
  font-weight: 900;
}

.customer-inline-edit {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  max-width: 520px;
  margin: 0;
}

.customer-inline-edit[hidden] {
  display: none;
}

.customer-inline-edit input {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 10px;
}

.customer-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.customer-status-pill.active {
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.customer-status-pill.inactive {
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(148, 163, 184, 0.08);
  color: var(--admin-text-secondary);
}

.customer-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.customer-row-actions form {
  margin: 0;
}

.customer-row-actions .danger {
  border-color: rgba(239, 68, 68, 0.42);
  color: #fca5a5;
}

.customer-row-actions .danger:hover {
  border-color: rgba(239, 68, 68, 0.68);
  color: #fecaca;
}

.admin-shell.ledger-page-shell .admin-content {
  overflow: hidden;
  padding: 10px 14px 12px;
}

.ledger-page {
  position: relative;
  display: grid;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  align-content: stretch;
  gap: 5px;
  overflow: hidden;
  grid-template-rows: 30px 48px minmax(0, 1fr) 330px;
}

.ledger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: var(--admin-bg-card);
  min-height: 0;
  padding: 2px 10px;
}

.ledger-head-title {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.ledger-head h1 {
  color: var(--admin-text-primary);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.1;
}

.ledger-head-title span {
  color: var(--admin-text-secondary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.ledger-head .btn {
  min-height: 24px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1;
}

.ledger-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.ledger-summary-card {
  display: grid;
  gap: 2px;
  min-height: 0;
  align-content: start;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: var(--admin-bg-card);
  padding: 7px 10px 4px;
}

.ledger-summary-card.balance {
  border-color: rgba(20, 184, 166, 0.48);
}

.ledger-summary-card span {
  color: var(--admin-text-secondary);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
}

.ledger-summary-card strong {
  color: var(--admin-text-primary);
  font-size: clamp(17px, 1.8vw, 21px);
  font-weight: 900;
  line-height: 1.05;
}

.ledger-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 7px;
  min-height: 0;
}

.ledger-form {
  display: grid;
  align-content: stretch;
  gap: 4px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 7px 8px;
}

.ledger-form-payment,
.ledger-form-charge {
  grid-template-rows: 22px repeat(4, minmax(0, 1fr));
}

.ledger-form .panel-title-row {
  margin-bottom: 0;
}

.ledger-form .panel-title-row h2 {
  font-size: 14px;
  letter-spacing: 0;
}

.ledger-form label span {
  font-size: 10.5px;
  letter-spacing: 0;
}

.ledger-form input,
.ledger-form select {
  min-height: 26px;
  border-color: var(--admin-border);
  background: var(--admin-bg-card2);
  color: var(--admin-text-primary);
  padding: 0 10px;
}

.ledger-form-payment > label > input,
.ledger-form-payment > label > select,
.ledger-form-charge > label > input,
.ledger-form-charge > label > select {
  height: 37px;
  min-height: 37px;
}

.ledger-form-payment > label,
.ledger-form-charge > label {
  align-self: center;
  width: 100%;
}

.ledger-form input[type="file"] {
  min-width: 0;
  padding: 4px 8px;
  font-size: 10.5px;
  line-height: 27px;
}

.ledger-form input[type="file"]::file-selector-button {
  height: 25px;
  margin-right: 10px;
  border: 1px solid rgba(59, 130, 246, 0.42);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
  padding: 0 8px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
}

.ledger-form .btn {
  width: 100%;
  height: 29px;
  min-height: 29px;
  padding: 3px 10px;
  font-size: 12px;
}

.ledger-submit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  align-items: end;
  align-self: center;
  gap: 8px;
  width: 100%;
}

.ledger-submit-row label {
  min-width: 0;
}

.ledger-submit-row input[type="file"] {
  height: 37px;
  min-height: 37px;
}

.ledger-submit-row .btn {
  height: 37px;
  min-height: 37px;
}

.ledger-amount-input-wrap {
  position: relative;
  min-width: 0;
}

.ledger-amount-input-wrap input {
  width: 100%;
  height: 37px;
  min-height: 37px;
  padding-right: 86px;
}

.ledger-amount-label em {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: var(--admin-text-secondary);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

.ledger-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}

.ledger-check input {
  width: 17px;
  height: 17px;
  margin: 0;
}

.ledger-check span {
  color: var(--admin-text-primary);
  font-size: 14px;
}

.ledger-fee-table {
  display: grid;
  gap: 7px;
  align-content: start;
  margin-top: 7px;
}

.ledger-fee-row {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) minmax(78px, 98px) minmax(64px, 78px);
  gap: 9px;
  align-items: center;
  min-height: 28px;
}

.ledger-fee-head {
  min-height: 16px;
  color: var(--admin-text-muted);
  font-size: 10.5px;
  font-weight: 900;
}

.ledger-fee-row > span {
  color: var(--admin-text-primary);
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0;
}

.ledger-switch {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 26px;
  margin: 0;
  color: var(--admin-text-primary);
  font-size: 11px;
  font-weight: 800;
}

.ledger-form-settings {
  align-content: stretch;
  grid-template-rows: 22px auto minmax(0, 1fr);
  gap: 4px;
}

.ledger-charge-title-row {
  justify-content: flex-start;
  gap: 8px;
}

.ledger-settings-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.ledger-manage-fees-btn {
  width: auto;
  flex: 0 0 auto;
  height: 22px;
  min-height: 22px;
  border-color: rgba(96, 165, 250, 0.36);
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  padding: 0 9px;
  font-size: 11px;
  line-height: 1;
}

.ledger-form .ledger-manage-fees-btn {
  width: auto;
  height: 22px;
  min-height: 22px;
  padding: 0 9px;
}

.ledger-settings-actions {
  display: flex;
  align-self: end;
  justify-content: flex-end;
  margin-top: 0;
}

.ledger-form-settings .ledger-settings-save-btn {
  width: 118px;
  min-width: 118px;
  height: 37px;
  min-height: 37px;
  padding: 3px 10px;
  font-size: 12px;
  line-height: 1;
  justify-self: auto;
}

.ledger-switch input {
  width: 16px;
  height: 16px;
  min-height: auto;
  margin: 0;
}

.ledger-table-panel {
  display: flex;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  padding: 6px 10px 8px;
}

.ledger-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
  margin-bottom: 4px;
}

.ledger-title-row h2 {
  font-size: 15px;
  line-height: 1;
}

.ledger-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ledger-title-row .panel-inline-note {
  font-size: 11px;
}

.ledger-title-row .ledger-export-btn {
  height: 22px;
  min-height: 22px;
  border-color: rgba(20, 184, 166, 0.46);
  background: rgba(20, 184, 166, 0.1);
  color: #5eead4;
  padding: 0 8px;
  font-size: 11px;
  line-height: 1;
}

.ledger-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.ledger-table-wrap table {
  min-width: 1120px;
}

.ledger-table-wrap thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

.ledger-table-wrap th,
.ledger-table-wrap td {
  padding: 5px 9px;
  font-size: 12px;
  vertical-align: middle;
}

.ledger-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--admin-bg-card2);
  box-shadow: 0 1px 0 var(--admin-border);
}

.ledger-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 20px;
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  background: var(--admin-bg-card2);
  color: var(--admin-text-primary);
  font-size: 11px;
  font-weight: 900;
}

.ledger-type.payment {
  border-color: rgba(34, 197, 94, 0.42);
  color: #86efac;
}

.ledger-type.charge {
  border-color: rgba(239, 68, 68, 0.42);
  color: #fca5a5;
}

.ledger-type.adjustment {
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}

.ledger-remark-cell {
  min-width: 220px;
  white-space: nowrap;
}

.ledger-remark-view {
  display: inline-block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.ledger-remark-edit-btn {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin-left: 6px;
  padding: 0;
  font-size: 11px;
  vertical-align: middle;
}

.ledger-remark-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ledger-remark-form[hidden] {
  display: none;
}

.ledger-remark-form input {
  width: 210px;
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.ledger-remark-form .btn {
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.ledger-attachment-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border: 1px solid rgba(59, 130, 246, 0.42);
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.ledger-attachment-link:hover {
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
  border-color: rgba(147, 197, 253, 0.8);
}

.ledger-attachment-modal[hidden] {
  display: none;
}

.ledger-attachment-modal {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 7, 18, 0.58);
  padding: 24px;
}

.ledger-attachment-dialog {
  display: grid;
  width: min(560px, calc(100vw - 48px));
  max-height: min(680px, calc(100vh - 72px));
  grid-template-rows: auto minmax(220px, 1fr) auto;
  gap: 12px;
  border: 1px solid rgba(59, 130, 246, 0.72);
  border-radius: 12px;
  background: #0f172a;
  box-shadow: 0 22px 72px rgba(0, 0, 0, 0.54);
  padding: 16px;
}

.ledger-attachment-head,
.ledger-attachment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ledger-attachment-head h2 {
  color: var(--admin-text-primary);
  font-size: 18px;
  font-weight: 900;
}

.ledger-attachment-head p {
  color: var(--admin-text-secondary);
  font-size: 12px;
}

.ledger-attachment-stage {
  display: grid;
  min-height: 260px;
  place-items: center;
  overflow: auto;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: #020617;
}

.ledger-attachment-stage img {
  display: block;
  max-width: 100%;
  max-height: 56vh;
  object-fit: contain;
}

.ledger-fee-modal[hidden] {
  display: none;
}

.ledger-fee-modal {
  position: fixed;
  z-index: 92;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 7, 18, 0.62);
  padding: 24px;
}

.ledger-fee-dialog {
  display: grid;
  width: min(760px, calc(100vw - 48px));
  max-height: min(720px, calc(100vh - 72px));
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  border: 1px solid rgba(20, 184, 166, 0.58);
  border-radius: 12px;
  background: #0f172a;
  box-shadow: 0 24px 76px rgba(0, 0, 0, 0.56);
  padding: 14px;
}

.ledger-fee-dialog-head,
.ledger-fee-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ledger-fee-dialog-head h2 {
  color: var(--admin-text-primary);
  font-size: 17px;
  font-weight: 900;
}

.ledger-fee-dialog-head p,
.ledger-fee-section-title span {
  color: var(--admin-text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.ledger-fee-dialog-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.ledger-fee-manage-section {
  display: grid;
  gap: 8px;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.42);
  padding: 10px;
}

.ledger-fee-section-title h3 {
  color: var(--admin-text-primary);
  font-size: 14px;
  font-weight: 900;
}

.ledger-fee-system-list,
.ledger-fee-item-list {
  display: grid;
  gap: 6px;
}

.ledger-fee-system-row,
.ledger-fee-create-row,
.ledger-fee-item-row {
  display: grid;
  align-items: center;
  gap: 8px;
}

.ledger-fee-system-row {
  grid-template-columns: minmax(160px, 1fr) 100px 86px;
  min-height: 34px;
  border: 1px solid rgba(42, 51, 80, 0.78);
  border-radius: 8px;
  background: rgba(28, 35, 51, 0.72);
  padding: 0 10px;
}

.ledger-fee-system-row strong,
.ledger-fee-system-row span,
.ledger-fee-system-row em {
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.ledger-fee-system-row strong {
  color: var(--admin-text-primary);
}

.ledger-fee-system-row span {
  color: #93c5fd;
}

.ledger-fee-system-row em {
  color: #86efac;
  text-align: right;
}

.ledger-fee-create-row,
.ledger-fee-item-row {
  grid-template-columns: minmax(150px, 1fr) 104px 74px 64px 64px;
}

.ledger-fee-create-row {
  grid-template-columns: minmax(150px, 1fr) 104px 74px 72px;
  border-bottom: 1px solid rgba(42, 51, 80, 0.76);
  padding-bottom: 8px;
}

.ledger-fee-create-row input,
.ledger-fee-item-row input {
  height: 32px;
  min-height: 32px;
  padding: 0 9px;
  font-size: 12px;
}

.ledger-fee-enabled {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 32px;
}

.ledger-fee-enabled input {
  width: 16px;
  height: 16px;
  min-height: auto;
  margin: 0;
}

.ledger-fee-enabled span {
  color: var(--admin-text-primary);
  font-size: 11px;
  font-weight: 900;
}

.ledger-fee-create-row .btn,
.ledger-fee-item-row .btn {
  height: 32px;
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

.btn.subtle.danger {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}

.btn.subtle.danger:hover {
  border-color: rgba(239, 68, 68, 0.72);
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
}

.ledger-fee-empty {
  color: var(--admin-text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.admin-shell label,
.admin-shell .empty,
.admin-shell .plain-list,
.admin-shell .compact-list span {
  color: var(--admin-text-secondary);
}

.event-list {
  display: grid;
  gap: 8px;
}

.event-list a {
  display: grid;
  gap: 4px;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: var(--admin-bg-card2);
  padding: 10px;
}

.event-list a:hover {
  background: var(--admin-bg-hover);
}

.event-list strong {
  color: var(--admin-text-primary);
}

.event-list span,
.event-list em {
  color: var(--admin-text-secondary);
  font-style: normal;
}

.admin-shell .flash {
  border: 0;
  background: transparent;
}

/* Dashboard SKU detail flow, matching the original WMS interaction. */
.inventory-dashboard-grid {
  grid-template-rows: auto minmax(0, 1fr) minmax(126px, 0.32fr);
  gap: 8px;
}

.inventory-dashboard-grid.flow-expanded {
  grid-template-rows: auto minmax(0, 0.68fr) minmax(252px, 0.72fr);
}

.sku-detail-card {
  grid-row: 1;
  overflow: hidden;
  padding: 0;
}

.inventory-panel {
  grid-row: 2;
  padding: 0;
}

.flow-panel {
  grid-row: 3;
  padding: 0;
}

.sku-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  border-bottom: 1px solid var(--admin-border);
  background: var(--admin-bg-card2);
  padding: 0 10px;
}

.sku-detail-header > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.sku-detail-label {
  color: var(--admin-text-secondary);
  font-size: 12px;
  font-weight: 900;
}

.sku-detail-header strong {
  color: var(--admin-text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.sku-detail-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-bg-card);
  color: var(--admin-text-secondary);
  cursor: pointer;
}

.sku-detail-close:hover {
  border-color: var(--admin-accent);
  color: var(--admin-text-primary);
}

.sku-detail-content {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
}

.sku-detail-media {
  display: grid;
  width: 100px;
  height: 100px;
  min-height: 100px;
  aspect-ratio: 1 / 1;
  place-items: center;
  border-right: 1px solid var(--admin-border);
  background: rgba(15, 23, 42, 0.42);
  color: var(--admin-text-dim);
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  padding: 4px;
}

.sku-detail-media img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.sku-detail-media.no-image {
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.08), transparent),
    var(--admin-bg-card);
}

.sku-detail-body {
  display: grid;
  grid-template-columns: repeat(6, minmax(112px, 1fr));
  gap: 0;
}

.sku-detail-item {
  display: grid;
  gap: 3px;
  min-height: 100px;
  border-right: 1px solid var(--admin-border);
  padding: 9px 11px;
}

.sku-detail-item:last-child {
  border-right: 0;
}

.sku-detail-item span {
  color: var(--admin-text-dim);
  font-size: 12px;
  font-weight: 900;
}

.sku-detail-item strong {
  color: var(--admin-text-primary);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.detail-stock {
  color: #22c55e !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 19px !important;
}

.detail-stock.low {
  color: #f97316 !important;
}

.detail-stock.zero {
  color: #ef4444 !important;
}

.inventory-row {
  cursor: pointer;
}

.inventory-row.selected-row td {
  background: rgba(59, 130, 246, 0.18) !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.62);
  padding: 20px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-panel {
  width: min(460px, 100%);
  overflow: hidden;
  border: 1px solid var(--admin-border-light);
  border-radius: 16px;
  background: var(--admin-bg-card);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--admin-border);
  background: var(--admin-bg-card2);
  padding: 14px 16px;
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--admin-border);
  border-bottom: 0;
}

.modal-footer-spacer {
  flex: 1 1 auto;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-bg-card);
  color: var(--admin-text-secondary);
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--admin-accent);
  color: var(--admin-text-primary);
}

.modal-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  color: var(--admin-text-secondary);
  font-size: 13px;
  font-weight: 900;
}

.form-field input[readonly] {
  background: rgba(31, 41, 55, 0.62);
  color: var(--admin-text-secondary);
  cursor: default;
}

.modal-hint {
  margin: 0;
  color: var(--admin-text-secondary);
  font-size: 13px;
}

.file-picker {
  display: grid;
  gap: 8px;
}

.file-picker span {
  color: var(--admin-text-secondary);
  font-size: 13px;
  font-weight: 900;
}

.sku-image-picker {
  border: 1px dashed var(--admin-border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.36);
  padding: 10px;
}

.sku-image-picker input {
  cursor: pointer;
}

.import-status {
  min-height: 22px;
  color: var(--admin-text-secondary);
  font-size: 13px;
}

.import-status.success {
  color: #22c55e;
}

.import-status.error {
  color: #f97316;
}

@media (max-width: 1100px) {
  body.admin-shell {
    overflow: auto;
  }

  .admin-main-layout {
    height: auto;
    min-height: calc(100vh - 58px);
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    display: none;
  }

  .admin-topbar {
    height: auto;
    min-height: 58px;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
  }

  .admin-topbar .topbar-right {
    flex-wrap: wrap;
  }

  .admin-content {
    overflow: visible;
  }

  .inventory-dashboard-grid {
    height: auto;
    min-height: 980px;
    grid-template-rows: minmax(560px, auto) minmax(260px, auto);
  }

  .return-records-page {
    height: auto;
  }

  .ledger-page {
    grid-template-rows: auto auto auto minmax(190px, auto);
    overflow: visible;
  }

  .ledger-table-panel {
    height: 220px;
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .admin-action-grid,
  .admin-two-col {
    grid-template-columns: 1fr;
  }

  .return-records-head {
    align-items: stretch;
    flex-direction: column;
  }

  .return-records-title {
    min-width: 0;
  }

  .admin-hero,
  .return-records-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-bar,
  .quick-create {
    grid-template-columns: 1fr;
  }

  .inventory-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-filter-form {
    justify-self: stretch;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .sku-detail-content {
    grid-template-columns: 1fr;
  }

  .sku-detail-media {
    width: min(180px, calc(100% - 24px));
    height: auto;
    min-height: 0;
    margin: 12px auto;
    aspect-ratio: 1 / 1;
    border-right: 0;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
  }

  .sku-detail-body {
    grid-template-columns: 1fr;
  }

  .return-filter-bar {
    grid-template-columns: 1fr;
  }

  .ledger-head {
    align-items: stretch;
    flex-direction: column;
  }

  .ledger-summary-grid,
  .ledger-action-grid {
    grid-template-columns: 1fr;
  }

  .ledger-page {
    grid-template-rows: auto;
  }

  .ledger-submit-row {
    grid-template-columns: 1fr;
  }

  .ledger-fee-dialog-head,
  .ledger-fee-section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .ledger-fee-system-row,
  .ledger-fee-create-row,
  .ledger-fee-item-row {
    grid-template-columns: 1fr;
  }
}
