:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #17202a;
  --muted: #5f6b7a;
  --subtle: #8b96a5;
  --border: #e3e8ef;
  --border-strong: #cfd7e2;
  --primary: #0e7490;
  --primary-strong: #0a5d73;
  --primary-weak: #e1f1f5;
  --success: #15803d;
  --success-weak: #e8f5ec;
  --warning: #b45309;
  --warning-weak: #fdf1e2;
  --danger: #b91c1c;
  --danger-weak: #fcebeb;
  --info: #1d4ed8;
  --info-weak: #e9efff;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

html {
  max-width: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(14, 116, 144, 0.2);
  outline-offset: 2px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  background: #f6f8fb;
}

.login-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(21, 39, 61, 0.13);
  padding: 40px 40px 28px;
}

.login-visual {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: 38px 46px;
  overflow: hidden;
  color: #eaf5f7;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 38%),
    linear-gradient(160deg, #0b3346 0%, #0e5469 48%, #12758b 100%);
}

.login-visual::before,
.login-visual::after {
  position: absolute;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  content: "";
}

.login-visual::before {
  top: -170px;
  right: -150px;
  box-shadow: 0 0 0 50px rgba(255, 255, 255, 0.025), 0 0 0 100px rgba(255, 255, 255, 0.018);
}

.login-visual::after {
  bottom: -220px;
  left: -190px;
  width: 460px;
  height: 460px;
}

.login-visual-top,
.login-hero,
.login-visual-foot {
  position: relative;
  z-index: 1;
}

.login-visual-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  color: #fff;
  font-size: 16px;
}

.login-brand span {
  margin-top: 3px;
  color: rgba(224, 243, 246, 0.72);
  font-size: 11px;
}

.login-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  color: #d9f4ee;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.09em;
}

.login-hero {
  max-width: 620px;
  padding: 48px 0 30px;
}

.login-eyebrow {
  margin: 0 0 8px;
  color: #82c8d3;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-hero h1 {
  margin: 0;
  max-width: 560px;
  color: #fff;
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 780;
  line-height: 1.12;
  letter-spacing: 0;
}

.login-hero-copy {
  max-width: 520px;
  margin: 18px 0 0;
  color: rgba(232, 247, 249, 0.78);
  font-size: 16px;
  line-height: 1.7;
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
}

.login-feature-grid > div {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  column-gap: 11px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.login-feature-grid > div > span {
  display: grid;
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #b9e5e6;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 9px;
}

.login-feature-grid strong {
  color: #fff;
  font-size: 13px;
}

.login-feature-grid small {
  color: rgba(227, 244, 246, 0.65);
  font-size: 11px;
}

.login-visual-foot {
  color: rgba(225, 242, 244, 0.62);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.login-form-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 80% 12%, rgba(14, 116, 144, 0.08), transparent 28%),
    radial-gradient(circle at 12% 88%, rgba(180, 83, 9, 0.06), transparent 26%),
    #f6f8fb;
}

.login-card-heading {
  margin-bottom: 26px;
}

.login-card-heading .login-eyebrow {
  color: var(--primary);
}

.login-card-heading h2 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 26px;
  letter-spacing: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(145deg, #0e7490, #155e75);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}

.brand h1 {
  font-size: 18px;
  margin: 0;
  letter-spacing: 0;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.login-sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.login-field {
  margin-bottom: 18px;
}

.login-field label {
  display: block;
  margin-bottom: 8px;
  color: #334150;
  font-size: 12px;
  font-weight: 700;
}

.login-input-wrap {
  position: relative;
  display: flex;
  height: 48px;
  align-items: center;
  background: #fff;
  border: 1px solid #d7e0ea;
  border-radius: 9px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.11);
}

.login-input-icon {
  display: grid;
  width: 46px;
  height: 100%;
  flex: 0 0 auto;
  place-items: center;
  color: #8a97a5;
}

.login-input-wrap input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0 14px 0 2px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 14px;
}

.login-input-wrap input::placeholder {
  color: #a2acb8;
}

.login-password-toggle {
  display: grid;
  width: 42px;
  height: 100%;
  flex: 0 0 auto;
  place-items: center;
  color: #85919f;
  background: transparent;
  border: 0;
}

.login-password-toggle:hover {
  color: var(--primary);
}

.login-error {
  min-height: 18px;
  margin: -4px 0 10px;
  color: var(--danger);
  font-size: 12px;
}

.login-submit {
  height: 48px;
  border-radius: 9px;
  font-size: 14px;
}

.login-role-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 22px;
  color: #71808f;
  font-size: 11px;
}

.login-role-hint i {
  width: 3px;
  height: 3px;
  background: #b7c1cc;
  border-radius: 50%;
}

.login-security {
  margin: 18px 0 0;
  color: #97a1ac;
  font-size: 10px;
  text-align: center;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 7px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.12);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.hint {
  color: var(--subtle);
  font-size: 12px;
  margin-top: 6px;
}

.weekday-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  gap: 8px;
}

.weekday-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.weekday-option:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.weekday-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.weekday-option span {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.25;
}

.weekday-option small {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.78;
}

.hidden {
  display: none !important;
}

.vending-items {
  max-height: 45vh;
  overflow-y: auto;
}

.vending-item-row {
  position: relative;
  display: grid;
  gap: 7px;
  margin-bottom: 9px;
  padding: 11px 38px 10px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.vending-item-main {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) 86px 92px 104px 120px;
  gap: 8px;
  align-items: start;
}

.vending-item-main label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.vending-item-main input,
.vending-item-main select {
  width: 100%;
  height: 36px;
  min-width: 0;
}

.vending-item-meta {
  padding: 2px 3px 0;
  overflow: hidden;
  color: var(--subtle);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vending-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
}

.vending-items .searchable-select-trigger {
  width: 100%;
  min-height: 36px;
}

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

.detail-summary > div {
  min-width: 0;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.detail-summary span,
.detail-summary strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-summary span {
  margin-bottom: 4px;
  color: var(--subtle);
  font-size: 11px;
}

.weekday-option.active {
  color: var(--primary);
  background: rgba(14, 116, 144, 0.08);
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

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

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

.btn-secondary {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--surface-2);
}

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

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--border-strong);
}

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

.btn-sm {
  padding: 6px 10px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.layout {
  display: grid;
  grid-template-columns: 244px 1fr;
  min-height: 100vh;
  overflow-x: clip;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar .brand {
  padding: 4px 8px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}

.nav-section + .nav-section {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--subtle);
  letter-spacing: 0.04em;
  padding: 10px 12px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-item.active {
  background: var(--primary-weak);
  color: var(--primary-strong);
}

.nav-item svg {
  flex: none;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.main {
  min-width: 0;
}

.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-size: 16px;
  font-weight: 700;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-user > span:not(.avatar),
.topbar-user .avatar + span {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-weak);
  color: var(--primary-strong);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.content {
  padding: 24px;
}

.content > * {
  animation: content-in 0.18s ease both;
}

@keyframes content-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.page-head > div:first-child {
  min-width: 0;
  flex: 1 1 240px;
}

.page-head .toolbar {
  flex: 1 1 420px;
  min-width: 0;
  justify-content: flex-end;
}

.page-title {
  font-size: 20px;
  margin: 0;
}

.page-desc {
  color: var(--muted);
  margin: 4px 0 0;
}

.anchor-ops-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  padding: 4px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  scrollbar-width: none;
}

.anchor-ops-tabs::-webkit-scrollbar {
  display: none;
}

.anchor-ops-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 15px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.16s, background 0.16s, box-shadow 0.16s, transform 0.16s;
}

.anchor-ops-tab:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.anchor-ops-tab.active {
  color: var(--primary-strong);
  background: var(--primary-weak);
  box-shadow: var(--shadow-sm);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 100%;
}

.date-range-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin: -4px 0 16px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.date-range-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.date-preset-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.date-preset-btn {
  padding: 5px 9px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
}

.date-preset-btn:hover {
  color: var(--primary);
  border-color: rgba(14, 116, 144, 0.35);
}

.date-preset-btn.active {
  color: var(--primary);
  background: var(--primary-weak);
  border-color: var(--primary);
}

.date-preset-clear {
  color: var(--subtle);
}

.date-range-fields {
  display: flex;
  align-items: end;
  gap: 6px;
  margin-left: auto;
}

.date-range-fields label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
}

.date-range-fields input {
  width: 135px;
  height: 34px;
}

.date-range-separator {
  padding: 0 4px 7px;
  color: var(--subtle);
}

.search {
  position: relative;
}

.search input {
  padding-left: 34px;
  min-width: 240px;
}

.search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--subtle);
}

.grid {
  display: grid;
  gap: 16px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 18px;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  font-size: 28px;
  font-weight: 750;
  margin-top: 8px;
  letter-spacing: 0;
}

.stat-foot {
  color: var(--subtle);
  font-size: 12px;
  margin-top: 8px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.card-body {
  padding: 18px;
}

.table-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-2);
}

tbody tr:hover {
  background: var(--surface-2);
}

.sticky-actions,
th.sticky-actions {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: -10px 0 14px -14px rgba(16, 24, 40, 0.45);
}

th.sticky-actions {
  z-index: 3;
  background: #f7f9fb;
}

tbody tr:hover td.sticky-actions {
  background: var(--surface-2);
}

.num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

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

.subtle {
  color: var(--subtle);
}

.barcode-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.03em;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tag-success {
  background: var(--success-weak);
  color: var(--success);
}

.tag-warning {
  background: var(--warning-weak);
  color: var(--warning);
}

.tag-danger {
  background: var(--danger-weak);
  color: var(--danger);
}

.tag-info {
  background: var(--info-weak);
  color: var(--info);
}

.tag-neutral {
  background: #eef1f5;
  color: #55606f;
}

.alert-list {
  display: grid;
  gap: 10px;
}

.alert-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.alert-item .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 6px;
  flex: none;
}

.alert-title {
  font-weight: 600;
}

.alert-detail {
  color: var(--muted);
  font-size: 12px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.grid,
.structure-layout,
.activity-overview-grid,
.finance-kpi-grid,
.export-preset-grid,
.detail-summary,
.dashboard-quick-grid,
.room-shelf-grid {
  min-width: 0;
}

.grid > *,
.split > *,
.structure-layout > *,
.activity-overview-grid > *,
.finance-kpi-grid > *,
.export-preset-grid > *,
.detail-summary > *,
.dashboard-quick-grid > *,
.room-shelf-grid > * {
  min-width: 0;
}

.card {
  min-width: 0;
}

.overview-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inventory-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat-card-alert {
  border-color: #f3c5c2;
  background: linear-gradient(145deg, #fff, #fff7f6);
}

.structure-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.structure-main-card {
  min-width: 0;
}

.structure-issue-card {
  position: sticky;
  top: 88px;
}

.structure-body {
  display: grid;
  gap: 14px;
  padding: 0;
}

.structure-card-head {
  align-items: center;
}

.structure-breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: var(--subtle);
  font-size: 11px;
}

.structure-crumb {
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 11px;
}

button.structure-crumb {
  color: var(--primary);
  font-weight: 650;
}

button.structure-crumb:hover {
  text-decoration: underline;
}

.structure-crumb.current {
  color: var(--ink);
  font-weight: 650;
}

.structure-sep {
  color: #b5bec9;
}

.structure-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.structure-detail-label {
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.structure-detail-title {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 17px;
}

.structure-detail-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.structure-detail-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}

.structure-detail-stats > div {
  padding: 14px;
  border-right: 1px solid var(--border);
}

.structure-detail-stats > div:last-child {
  border-right: 0;
}

.structure-detail-stats span,
.structure-detail-stats strong {
  display: block;
}

.structure-detail-stats span {
  color: var(--muted);
  font-size: 11px;
}

.structure-detail-stats strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 18px;
}

.structure-base {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.structure-base-head {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--ink);
  background: #f8fafc;
  border: 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.structure-base-head:hover {
  background: #f0f6f8;
}

.structure-base-name {
  font-size: 15px;
  font-weight: 700;
}

.structure-base-meta {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.structure-base-head .tag {
  margin-left: auto;
}

.structure-table {
  font-size: 12px;
}

.link-button {
  padding: 0;
  color: var(--primary);
  background: transparent;
  border: 0;
  font-weight: 650;
  text-align: left;
}

.link-button:hover {
  text-decoration: underline;
}

.structure-ratio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.structure-ratio.normal {
  color: var(--success);
  background: var(--success-weak);
}

.structure-ratio.warning {
  color: var(--warning);
  background: var(--warning-weak);
}

.structure-ratio.danger {
  color: var(--danger);
  background: var(--danger-weak);
}

.structure-issue {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) 14px;
  align-items: start;
  gap: 9px;
  width: 100%;
  padding: 10px 11px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
}

.structure-issue + .structure-issue {
  margin-top: 8px;
}

.structure-issue:hover {
  border-color: var(--border-strong);
}

.issue-level-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
}

.structure-issue-danger .issue-level-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-weak);
}

.structure-issue-warning .issue-level-dot {
  background: var(--warning);
  box-shadow: 0 0 0 4px var(--warning-weak);
}

.structure-issue .issue-copy strong,
.structure-issue .issue-copy small {
  display: block;
}

.structure-issue .issue-copy strong {
  font-size: 12px;
  font-weight: 650;
}

.structure-issue .issue-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.structure-issue svg {
  margin-top: 3px;
  color: var(--subtle);
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding-top: 10px;
}

.bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
}

.bar {
  width: 100%;
  max-width: 42px;
  background: linear-gradient(180deg, #0e7490, #22b3c9);
  border-radius: 5px 5px 0 0;
  min-height: 2px;
}

.bar-label {
  font-size: 11px;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}

.modal {
  width: min(680px, 100%);
  max-height: 90vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.modal-body {
  padding: 20px;
  min-width: 0;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: var(--surface);
}

.icon-btn {
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: inline-grid;
  place-items: center;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.warehouse-binding-cell {
  width: min(360px, 34vw);
  max-width: 360px;
}

.warehouse-binding-count {
  margin-bottom: 6px;
}

.warehouse-binding-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
  white-space: normal;
}

.warehouse-binding-chip {
  display: inline-flex;
  max-width: 220px;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  overflow: hidden;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-warehouse-select {
  display: none;
}

.finance-warehouse-picker {
  display: grid;
  gap: 9px;
}

.finance-warehouse-toolbar {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.finance-warehouse-search {
  display: flex;
  min-width: 200px;
  min-height: 38px;
  flex: 1 1 240px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: var(--subtle);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.finance-warehouse-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.12);
}

.finance-warehouse-search input {
  min-width: 0;
  flex: 1;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.finance-warehouse-count {
  color: var(--muted);
  font-size: 11px;
}

.finance-warehouse-options {
  display: grid;
  max-height: 240px;
  gap: 5px;
  overflow-y: auto;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.finance-warehouse-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
}

.finance-warehouse-option:hover {
  border-color: rgba(14, 116, 144, 0.24);
  background: var(--primary-weak);
}

.finance-warehouse-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

.finance-warehouse-option span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.finance-warehouse-option strong,
.finance-warehouse-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-warehouse-option strong {
  font-size: 12px;
}

.finance-warehouse-option small {
  color: var(--subtle);
  font-size: 10px;
}

.finance-warehouse-option mark {
  padding: 0 1px;
  color: #8a5410;
  background: #ffe5ad;
  border-radius: 3px;
}

.finance-warehouse-chips {
  display: flex;
  min-height: 32px;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.finance-warehouse-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  padding: 4px 6px 4px 9px;
  color: var(--primary-strong);
  background: var(--primary-weak);
  border: 1px solid rgba(14, 116, 144, 0.16);
  border-radius: 999px;
  font-size: 11px;
}

.finance-warehouse-chip button {
  display: inline-grid;
  width: 18px;
  height: 18px;
  padding: 0;
  place-items: center;
  color: var(--primary-strong);
  background: transparent;
  border: 0;
  border-radius: 50%;
}

.finance-warehouse-chip button:hover {
  background: rgba(14, 116, 144, 0.12);
}

.finance-warehouse-empty {
  color: var(--subtle);
  font-size: 11px;
}

.card-pager {
  min-height: 44px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}

.account-directory-toolbar,
.room-directory-toolbar {
  display: grid;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.account-role-tabs {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.account-role-tab {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.account-role-tab b {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  color: var(--muted);
  background: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.account-role-tab:hover {
  color: var(--primary);
  border-color: rgba(14, 116, 144, 0.3);
}

.account-role-tab.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.account-role-tab.active b {
  color: var(--primary-strong);
}

.account-filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(120px, 0.7fr));
  gap: 8px;
  align-items: center;
}

.room-directory-toolbar {
  grid-template-columns: minmax(220px, 1fr) 220px;
  align-items: center;
}

.account-filter-row .search input,
.room-directory-toolbar .search input {
  width: 100%;
}

.account-scope-cell {
  display: grid;
  max-width: 260px;
  gap: 3px;
  white-space: normal;
}

.account-scope-cell strong,
.account-scope-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-scope-cell strong {
  font-size: 12px;
}

.account-scope-cell span {
  color: var(--muted);
  font-size: 11px;
}

.warehouse-stock-overview,
.warehouse-base-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.warehouse-stock-overview {
  margin-bottom: 16px;
}

.warehouse-stock-overview summary,
.warehouse-base-card summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  color: var(--ink);
  background: linear-gradient(180deg, #fff, #fbfcfd);
  cursor: pointer;
  list-style: none;
}

.warehouse-stock-overview summary::-webkit-details-marker,
.warehouse-base-card summary::-webkit-details-marker {
  display: none;
}

.warehouse-stock-overview summary > svg,
.warehouse-base-card summary > svg {
  margin-left: auto;
  color: var(--subtle);
  transition: transform 160ms ease;
}

.warehouse-stock-overview[open] summary > svg,
.warehouse-base-card[open] summary > svg {
  transform: rotate(90deg);
}

.warehouse-stock-overview summary span {
  font-size: 14px;
  font-weight: 700;
}

.warehouse-stock-overview summary small {
  color: var(--muted);
  font-size: 11px;
}

.warehouse-base-list {
  display: grid;
  gap: 12px;
}

.warehouse-base-card summary {
  flex-wrap: wrap;
}

.warehouse-base-title {
  min-width: 0;
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 750;
}

.warehouse-base-meta {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-base-stats {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 14px;
}

.warehouse-base-stats b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.warehouse-base-body {
  padding: 14px 18px 17px;
  border-top: 1px solid var(--border);
}

.warehouse-base-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
}

.warehouse-room-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.warehouse-room-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 4px 5px 4px 10px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
}

.empty {
  text-align: center;
  color: var(--subtle);
  padding: 40px 16px;
}

.scan-line {
  display: flex;
  gap: 10px;
  align-items: center;
}

.scan-zone {
  padding: 12px;
  background: var(--primary-weak);
  border: 1px solid rgba(14, 116, 144, 0.16);
  border-radius: var(--radius);
}

.scan-status {
  min-height: 20px;
  margin-top: 8px;
  color: var(--primary-strong);
  font-size: 12px;
}

.scan-status.error {
  color: var(--danger);
}

.camera-scan-panel {
  display: grid;
  gap: 10px;
}

.camera-scan-panel video {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 52vh;
  object-fit: cover;
  overflow: hidden;
  background: #0b1820;
  border-radius: var(--radius);
}

.camera-scan-guide {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.camera-scan-status {
  min-height: 20px;
  color: var(--primary-strong);
  font-size: 12px;
  text-align: center;
}

.camera-scan-status.error {
  color: var(--danger);
}

.camera-scan-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.camera-scanner-backdrop {
  z-index: 70;
}

.searchable-select {
  position: relative;
  min-width: 0;
  flex: 1;
}

.searchable-select-holder,
.searchable-select-row {
  min-width: 0;
  flex: 1;
}

.searchable-select-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15px;
  align-items: center;
  gap: 5px 10px;
  width: 100%;
  min-height: 38px;
  padding: 6px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  text-align: left;
}

.searchable-select-trigger:hover {
  border-color: var(--primary);
}

.searchable-select-value {
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-meta {
  grid-column: 1 / 2;
  overflow: hidden;
  color: var(--subtle);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-trigger > svg {
  grid-row: 1 / 3;
  grid-column: 2;
  color: var(--subtle);
  transform: rotate(90deg);
}

.searchable-select-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: min(380px, calc(100vw - 40px));
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}

.searchable-select-popup[hidden] {
  display: none;
}

.searchable-select-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--subtle);
  border-bottom: 1px solid var(--border);
}

.searchable-select-search input {
  min-width: 0;
  flex: 1;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
}

.searchable-select-count {
  padding: 7px 12px;
  color: var(--subtle);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
}

.searchable-select-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
}

.searchable-group + .searchable-group {
  margin-top: 4px;
  border-top: 1px solid var(--border-soft, var(--border));
  padding-top: 5px;
}

.searchable-group-title {
  padding: 5px 8px 3px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.searchable-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 7px;
  text-align: left;
}

.searchable-option:hover,
.searchable-option:focus-visible {
  background: var(--primary-weak);
  outline: none;
}

.searchable-option.is-active {
  background: var(--primary-weak);
}

.searchable-option > span:first-child {
  min-width: 0;
}

.searchable-option strong,
.searchable-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-option strong {
  font-size: 12px;
}

.searchable-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.searchable-option mark {
  padding: 0 1px;
  color: #8a5410;
  background: #ffe5ad;
  border-radius: 3px;
}

.searchable-empty {
  padding: 26px 10px;
  color: var(--subtle);
  font-size: 12px;
  text-align: center;
}

.package-editor-scroll {
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.package-editor-scroll:empty {
  min-height: 0;
  max-height: none;
}

.package-editor-scroll .item-row {
  padding: 7px;
  background: #fbfcfd;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.package-editor-scroll .item-row + .item-row {
  margin-top: 6px;
}

.package-editor-scroll .searchable-select-trigger {
  grid-template-columns: minmax(0, 1fr) 14px;
  min-height: 42px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.package-editor-scroll .searchable-select-value {
  display: block;
  font-size: 11px;
  line-height: 15px;
}

.package-editor-scroll .searchable-select-meta {
  grid-row: 2;
  color: var(--subtle);
  font-size: 9px;
  font-weight: 500;
  line-height: 13px;
}

.package-editor-scroll .searchable-select-trigger > svg {
  grid-row: 1 / 3;
}

.package-editor-scroll .searchable-select-popup,
.vending-items .searchable-select-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 80;
  display: flex;
  width: min(520px, calc(100vw - 32px));
  max-height: min(70vh, 520px);
  flex-direction: column;
  transform: translate(-50%, -50%);
}

.package-editor-scroll .searchable-select-popup[hidden],
.vending-items .searchable-select-popup[hidden] {
  display: none;
}

.package-editor-scroll .searchable-select-list,
.vending-items .searchable-select-list {
  max-height: none;
  flex: 1;
}

.searchable-select-compact .searchable-select-value {
  display: block;
  font-size: 11px;
  line-height: 15px;
}

.searchable-select-compact .searchable-select-meta {
  grid-row: 2;
  color: var(--subtle);
  font-size: 9px;
  font-weight: 500;
  line-height: 13px;
}

.searchable-select-compact .searchable-select-trigger > svg {
  grid-row: 1 / 3;
}

.searchable-select-compact .searchable-select-trigger {
  min-height: 42px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.batch-product-search {
  flex: 1;
}

.batch-product-search input {
  min-width: 0;
}

.batch-product-cell {
  min-width: 220px;
}

.inbound-product-summary {
  display: block;
  max-width: 380px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbound-product-summary em {
  margin-left: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
}

.scan-line input {
  flex: 1;
}

.item-row {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.8fr 0.8fr 0.8fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.inbound-cost-row {
  grid-template-columns: minmax(160px, 1.25fr) 72px 68px 100px 112px 82px 72px 28px;
  min-width: 760px;
}

.pkg-pack-cost {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.item-row .full-input {
  min-width: 0;
}

.consume-row {
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: start;
}

.consume-row-main {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.consume-product-field {
  min-width: 0;
  flex: 1;
}

.consume-product-field .searchable-select-trigger {
  min-height: 46px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.consume-row-controls {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.consume-row-controls > * {
  min-width: 0;
}

.consume-row-controls select,
.consume-row-controls input {
  width: 100%;
  min-height: 36px;
}

.consume-row .icon-btn {
  margin-top: 6px;
}

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  z-index: 100;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  background: #17202a;
  color: #fff;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

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

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.review-list {
  display: grid;
  gap: 10px;
}

.review-select {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.review-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.review-card-stats span:not(:last-child)::after {
  content: "·";
  margin-left: 18px;
  color: var(--border-strong);
}

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-12 { margin-top: 12px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--muted); }
.text-primary { color: var(--primary-strong); }

.activity-overview-stat {
  width: 100%;
  border: 1px solid var(--border);
  color: inherit;
  text-align: left;
}

.activity-overview-stat:hover {
  border-color: rgba(14, 116, 144, 0.36);
  transform: translateY(-1px);
}

.activity-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  margin-bottom: 16px;
}

.activity-rule-note {
  padding: 12px 14px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.6;
}

.activity-rank {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--muted);
  background: #eef1f5;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
}

.activity-rank.rank-1 {
  color: #854d0e;
  background: #fef3c7;
}

.activity-rank.rank-2 {
  color: #475569;
  background: #e2e8f0;
}

.activity-rank.rank-3 {
  color: #92400e;
  background: #ffedd5;
}

.activity-score {
  display: inline-grid;
  min-width: 38px;
  height: 28px;
  place-items: center;
  padding: 0 7px;
  color: var(--primary-strong);
  background: var(--primary-weak);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.activity-top-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.activity-podium {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 18px 16px 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.activity-podium-rank {
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--subtle);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.activity-podium.podium-1 {
  border-color: #f1d38b;
  background: linear-gradient(180deg, #fffdf7, #fffaf0);
}

.activity-podium.podium-2 {
  background: linear-gradient(180deg, #fbfdff, #f3f6fa);
}

.activity-podium.podium-3 {
  background: linear-gradient(180deg, #fffdfb, #fff8f3);
}

.activity-podium strong,
.activity-podium span,
.activity-podium b,
.activity-podium small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-podium strong {
  padding-right: 32px;
  font-size: 16px;
}

.activity-podium span {
  color: var(--muted);
  font-size: 12px;
}

.activity-podium b {
  margin-top: 9px;
  font-size: 23px;
  letter-spacing: 0;
}

.activity-podium small {
  color: var(--subtle);
  font-size: 11px;
}

.activity-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.activity-flow span {
  position: relative;
  padding: 5px 9px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
}

.activity-flow span:not(:last-child)::after {
  position: absolute;
  top: 50%;
  left: calc(100% + 1px);
  color: var(--subtle);
  content: "›";
  transform: translateY(-50%);
}

.activity-flow span.done {
  color: var(--success);
  background: var(--success-weak);
  border-color: rgba(21, 128, 61, 0.2);
}

.activity-mode-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #eaf0f5;
  border-radius: 9px;
}

.activity-mode-btn {
  min-height: 34px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
}

.activity-mode-btn.active {
  color: var(--primary-strong);
  background: #fff;
  box-shadow: var(--shadow);
}

.activity-playbook-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.activity-playbook-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.activity-product-inline {
  max-width: 320px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.activity-review-summary,
.activity-grant-summary {
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.activity-review-summary strong,
.activity-grant-summary strong {
  font-size: 14px;
}

.activity-review-summary span,
.activity-grant-summary span {
  color: var(--muted);
  font-size: 12px;
}

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

.activity-product-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 11px;
  color: var(--subtle);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.activity-product-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.12);
}

.activity-product-search input {
  min-width: 0;
  flex: 1;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.activity-product-count {
  color: var(--subtle);
  font-size: 10px;
}

.activity-product-options {
  display: grid;
  max-height: 210px;
  gap: 5px;
  overflow-y: auto;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.activity-product-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
}

.activity-product-option:hover {
  border-color: rgba(14, 116, 144, 0.24);
  background: var(--primary-weak);
}

.activity-product-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

.activity-product-option span,
.activity-product-option strong,
.activity-product-option small {
  min-width: 0;
}

.activity-product-option span {
  display: grid;
  gap: 2px;
}

.activity-product-option strong,
.activity-product-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-product-option strong {
  font-size: 12px;
}

.activity-product-option small {
  color: var(--subtle);
  font-size: 10px;
}

.activity-product-chips {
  display: flex;
  min-height: 34px;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.activity-product-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 6px 4px 9px;
  color: var(--primary-strong);
  background: var(--primary-weak);
  border: 1px solid rgba(14, 116, 144, 0.16);
  border-radius: 999px;
  font-size: 11px;
}

.activity-product-chip button {
  display: inline-grid;
  width: 18px;
  height: 18px;
  padding: 0;
  place-items: center;
  color: var(--primary-strong);
  background: transparent;
  border: 0;
  border-radius: 50%;
}

.activity-product-chip button:hover {
  background: rgba(14, 116, 144, 0.12);
}

.activity-product-empty {
  color: var(--subtle);
  font-size: 11px;
}

.finance-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.export-preset-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.export-preset {
  display: flex;
  min-height: 78px;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.export-preset:hover {
  border-color: var(--primary);
  background: var(--primary-weak);
}

.export-preset svg {
  flex: none;
  margin-top: 2px;
  color: var(--primary);
}

.export-preset strong,
.export-preset small {
  display: block;
}

.export-preset strong {
  color: var(--ink);
  font-size: 13px;
}

.export-preset small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 1080px) {
  .login-wrap {
    grid-template-columns: minmax(340px, 0.8fr) minmax(400px, 1fr);
  }

  .login-visual {
    padding: 30px;
  }

  .login-feature-grid {
    grid-template-columns: 1fr;
  }

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

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

  .inventory-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .export-preset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .split {
    grid-template-columns: 1fr;
  }

  .structure-layout {
    grid-template-columns: 1fr;
  }

  .structure-issue-card {
    position: static;
  }

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

  .structure-detail-stats > div:nth-child(3) {
    border-right: 0;
  }

  .structure-detail-stats > div:nth-child(n + 4) {
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 820px) {
  .topbar {
    height: auto;
    min-height: 58px;
    padding: 10px 14px;
    gap: 10px;
  }

  .topbar-title {
    font-size: 14px;
  }

  .topbar-user {
    gap: 7px;
  }

  .topbar-user .tag {
    display: none;
  }

  .searchable-select-popup {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
  }

  .package-editor-scroll .searchable-select-popup,
  .vending-items .searchable-select-popup {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: 70vh;
    transform: none;
  }

  .searchable-select-list {
    max-height: none;
    flex: 1;
  }

  .login-wrap {
    display: block;
  }

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

  .login-visual {
    display: none;
  }

  .login-form-panel {
    min-height: 100vh;
    padding: 20px;
  }

  .login-card {
    padding: 30px 24px 24px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: column;
    padding: 8px;
  }

  .sidebar .brand,
  .sidebar .nav-label,
  .sidebar-foot {
    display: none;
  }

  .nav-group {
    flex-direction: row;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-section {
    display: flex;
    flex: none;
    gap: 5px;
    padding: 0;
    border: 0;
  }

  .nav-section + .nav-section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .nav-item {
    width: auto;
    padding: 8px 10px;
    white-space: nowrap;
  }

  .content {
    padding: 16px;
  }

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

  .page-head .toolbar {
    width: 100%;
  }

  .search {
    flex: 1;
    min-width: 0;
  }

  .search input {
    width: 100%;
    min-width: 0;
  }

  .scan-line {
    flex-wrap: wrap;
  }

  .scan-line input {
    min-width: 150px;
  }

  .table-wrap table {
    min-width: 680px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .inbound-cost-row {
    min-width: 0;
    grid-template-columns: 1fr 1fr;
  }

  .consume-row {
    grid-template-columns: minmax(0, 1fr) 30px;
  }

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

  .consume-total {
    grid-column: 1 / -1;
  }

  .review-card .flex-between,
  .review-card .flex {
    flex-wrap: wrap;
  }

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

  .structure-detail-stats > div:nth-child(odd) {
    border-right: 1px solid var(--border);
  }

  .structure-detail-stats > div:nth-child(even) {
    border-right: 0;
  }

  .structure-detail-stats > div:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 520px) {
  .stat-grid,
  .overview-stat-grid,
  .inventory-stat-grid {
    grid-template-columns: 1fr;
  }

  .item-row:not(.consume-row) {
    grid-template-columns: 1fr;
  }

  .consume-row {
    grid-template-columns: minmax(0, 1fr) 30px;
  }

  .consume-row-controls {
    grid-template-columns: 1fr 1fr;
  }

  .inbound-cost-row {
    min-width: 0;
  }

  .sales-mode-switch {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar-user > span:not(.avatar),
  .topbar-user .avatar + span {
    display: none;
  }
}

/* Admin UX refresh */
:root {
  --radius: 10px;
  --shadow: 0 10px 28px rgba(18, 34, 50, 0.07);
  --shadow-lg: 0 20px 60px rgba(18, 34, 50, 0.16);
}

body {
  background:
    linear-gradient(180deg, rgba(14, 116, 144, 0.025), transparent 240px),
    var(--bg);
}

.content {
  padding: 28px;
}

.page-head {
  align-items: center;
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px;
  letter-spacing: 0;
}

.card {
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.stat-card {
  position: relative;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease;
}

.stat-card::after {
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 92px;
  height: 92px;
  background: radial-gradient(circle, rgba(14, 116, 144, 0.08), transparent 68%);
  border-radius: 50%;
  content: "";
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 116, 144, 0.2);
}

.card-head {
  padding: 17px 20px;
}

.card-body {
  padding: 20px;
}

.btn {
  border-radius: 8px;
}

.btn-primary {
  box-shadow: 0 8px 20px rgba(14, 116, 144, 0.18);
}

.topbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(227, 232, 239, 0.8);
}

.sidebar {
  background:
    linear-gradient(180deg, #fbfdff 0%, #f6f9fc 100%);
}

.nav-item.active {
  background: linear-gradient(90deg, #dff2f4, #edf6f8);
  color: #0b6477;
  box-shadow: inset 3px 0 0 #0e7490;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #465362;
}

tbody tr {
  transition: background 140ms ease;
}

.search input,
.field input,
.field select,
.field textarea,
.filter-select,
.period-select {
  border-radius: 8px;
}

.tag {
  border-radius: 7px;
}

.modal {
  border-radius: 14px;
}

.modal-head {
  padding: 19px 22px;
}

.modal-body {
  padding: 22px;
}

.toast {
  border-radius: 9px;
  box-shadow: var(--shadow-lg);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  padding: 12px 16px;
}

.pagination button {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.pagination button.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.pagination span {
  color: var(--subtle);
}

.alert-list.compact {
  max-height: 330px;
  overflow-y: auto;
  padding-right: 4px;
}

.dashboard-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.dashboard-quick-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 15px;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 150ms ease, border-color 150ms ease;
}

.dashboard-quick-card:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 116, 144, 0.25);
}

.dashboard-quick-card > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-weak);
  border-radius: 8px;
}

.dashboard-quick-card strong,
.dashboard-quick-card small {
  display: block;
}

.dashboard-quick-card strong {
  font-size: 13px;
}

.dashboard-quick-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-quick-card > svg {
  color: var(--subtle);
}

.export-field {
  display: flex;
  min-width: 180px;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.export-keyword-field {
  flex: 1;
  min-width: 220px;
}

.export-keyword-field input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: 0;
}

.export-action-panel {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.export-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.export-check {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
}

.export-check input {
  accent-color: var(--primary);
}

.export-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.export-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.export-card-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-weak);
  border-radius: 9px;
}

.export-card h3 {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 15px;
}

.export-card p {
  min-height: 38px;
  margin: 7px 0 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.export-card-disabled {
  opacity: 0.68;
}

@media (max-width: 1080px) {
  .export-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .dashboard-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .dashboard-quick-grid {
    grid-template-columns: 1fr;
  }
}

.room-shelf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.room-shelf-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease;
}

.room-shelf-card:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 116, 144, 0.28);
}

.room-shelf-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.room-shelf-card-top > div {
  min-width: 0;
}

.room-shelf-card-top strong,
.room-shelf-card-top span {
  display: block;
}

.room-shelf-card-top strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-shelf-card-top span {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-shelf-card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.room-shelf-card-stats > div {
  padding: 9px;
  background: var(--surface-2);
  border-radius: 8px;
}

.room-shelf-card-stats span,
.room-shelf-card-stats strong {
  display: block;
}

.room-shelf-card-stats span {
  color: var(--muted);
  font-size: 10px;
}

.room-shelf-card-stats strong {
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-shelf-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  color: var(--subtle);
}

.room-shelf-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 650;
}

.room-shelf-state::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
}

.room-shelf-state.success {
  color: var(--success);
}

.room-shelf-state.success::before {
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-weak);
}

.room-shelf-state.danger {
  color: var(--danger);
}

.room-shelf-state.danger::before {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-weak);
}

.shelf-filter-row {
  display: flex;
  width: fit-content;
  gap: 4px;
  padding: 4px;
  background: #eaf0f5;
  border-radius: 9px;
}

.shelf-filter-btn {
  min-height: 32px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
}

.shelf-filter-btn.active {
  color: var(--primary-strong);
  background: #fff;
  box-shadow: var(--shadow);
}

.room-shelf-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.room-shelf-detail-head h3 {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 18px;
}

.room-shelf-detail-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.room-shelf-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.room-shelf-detail-stats > div {
  min-width: 110px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 8px;
}

.room-shelf-detail-stats span,
.room-shelf-detail-stats strong {
  display: block;
}

.room-shelf-detail-stats span {
  color: var(--muted);
  font-size: 10px;
}

.room-shelf-detail-stats strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
}

.sales-mode-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #eaf0f5;
  border-radius: 9px;
}

.sales-mode-btn {
  min-height: 34px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
}

.sales-mode-btn.active {
  color: var(--primary-strong);
  background: #fff;
  box-shadow: var(--shadow);
}

.total-sales-block {
  background: #f2f8f9;
  border-color: #cfe5e7;
}

.sales-total-label {
  display: block;
  margin-bottom: 8px;
  color: #334150;
  font-size: 12px;
  font-weight: 700;
}

.total-sales-block input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: 0;
  font-size: 16px;
  font-weight: 700;
}

.consumption-sales-total {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #f2f8f9;
  border-color: #cfe5e7;
}

.consumption-sales-total span,
.consumption-sales-total strong,
.consumption-sales-total small {
  display: block;
}

.consumption-sales-total span {
  color: var(--muted);
  font-size: 11px;
}

.consumption-sales-total strong {
  color: var(--primary-strong);
  font-size: 22px;
}

.consumption-sales-total small {
  color: var(--subtle);
  font-size: 10px;
}

@media (max-width: 1080px) {
  .room-shelf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-shelf-detail-head {
    flex-direction: column;
  }
}

@media (max-width: 820px) {
  .room-shelf-grid {
    grid-template-columns: 1fr;
  }

  .room-shelf-card-stats,
  .room-shelf-detail-stats {
    grid-template-columns: 1fr;
  }
}

/* Unified UI polish */
:root {
  --bg: #f5f7fa;
  --surface-2: #f8fafc;
  --border: #e5eaf0;
  --border-strong: #d7dfe8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 18px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, 0.14);
}

body {
  background:
    linear-gradient(180deg, rgba(14, 116, 144, 0.022), transparent 260px),
    var(--bg);
}

.layout {
  grid-template-columns: 230px minmax(0, 1fr);
}

.sidebar {
  padding: 14px 9px;
  background: rgba(255, 255, 255, 0.96);
}

.sidebar .brand {
  padding: 3px 7px 16px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.nav-group {
  gap: 3px;
}

.nav-section + .nav-section {
  margin-top: 8px;
  padding-top: 8px;
}

.nav-label {
  padding: 9px 11px 5px;
}

.nav-item {
  min-height: 39px;
  margin: 1px 4px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.nav-item.active {
  background: linear-gradient(90deg, #dff3f6, #edf7f9);
  box-shadow: inset 3px 0 0 var(--primary);
}

.topbar {
  height: 62px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(226, 232, 240, 0.82);
}

.content {
  padding: 22px 26px 36px;
}

.content > * {
  max-width: 1560px;
  margin-right: auto;
  margin-left: auto;
}

.page-head {
  min-height: 66px;
  align-items: center;
  margin-bottom: 18px;
  padding: 17px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.page-title {
  font-size: 21px;
  letter-spacing: 0;
}

.page-desc {
  margin-top: 5px;
  font-size: 12px;
}

.toolbar {
  gap: 8px;
}

.toolbar input,
.toolbar select,
.field input,
.field select,
.field textarea,
.scan-line input,
.global-search input {
  min-height: 38px;
  border-radius: 8px;
}

.search input {
  min-width: 220px;
  padding-left: 36px;
}

.card {
  border-radius: 11px;
  box-shadow: var(--shadow);
}

.card-head {
  padding: 14px 18px;
  background: linear-gradient(180deg, #fff, #fbfcfd);
}

.card-title {
  font-size: 14px;
}

.card-body {
  padding: 17px 18px;
}

.stat-card {
  padding: 16px 18px;
  border-radius: 11px;
}

.stat-value {
  margin-top: 7px;
  font-size: 26px;
}

.table-wrap {
  border-radius: 0 0 11px 11px;
}

th {
  height: 40px;
  padding: 9px 13px;
  background: #f7f9fb;
  font-size: 11px;
  letter-spacing: 0.01em;
}

td {
  padding: 11px 13px;
}

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

.tag {
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
}

.btn {
  min-height: 36px;
  border-radius: 8px;
  font-size: 13px;
}

.btn-sm {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.icon-btn {
  border-radius: 8px;
}

.modal {
  border-radius: 14px;
}

.modal-head {
  padding: 17px 20px;
}

.modal-body {
  padding: 20px;
}

.modal-foot {
  padding: 15px 20px;
}

.form-grid {
  gap: 0 14px;
}

.empty {
  padding: 34px 16px;
}

.pagination {
  gap: 5px;
}

.pagination button {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
}

.room-shelf-card {
  border-radius: 11px;
}

.review-card,
.review-list .card {
  border-radius: 11px;
}

.role-finance .stat-card {
  background: linear-gradient(180deg, #fff, #fbfcfd);
}

.role-anchor .content {
  padding: 16px;
}

.role-anchor .page-head {
  padding: 15px 16px;
}

.role-anchor .btn {
  min-height: 38px;
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .main,
  .content {
    width: 100%;
    min-width: 0;
  }

  .main {
    padding-bottom: 64px;
  }

  .content {
    padding: 14px;
  }

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

  .vending-item-main {
    grid-template-columns: minmax(180px, 1.2fr) 78px 82px;
  }

  .date-range-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .date-range-fields {
    margin-left: 0;
  }

  .vending-amount-cell {
    grid-column: span 2;
  }

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

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

  .page-head {
    padding: 14px;
  }

  .toolbar {
    align-items: stretch;
  }

  .search {
    flex: 1 1 100%;
  }

  .search input {
    width: 100%;
  }

  .sidebar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    top: auto;
    z-index: 30;
    height: 58px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 6px 8px max(6px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
  }

  .nav-group {
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    overflow-x: auto;
    padding-bottom: 0;
  }

  .nav-section {
    flex: 0 0 auto;
  }

  .nav-item {
    min-width: 54px;
    min-height: 46px;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    margin: 0;
    padding: 4px 6px;
    font-size: 9px;
    text-align: center;
  }

  .nav-item svg {
    width: 17px;
    height: 17px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
    background: rgba(15, 23, 42, 0.52);
  }

  .modal {
    width: 100%;
    max-height: 94vh;
    border-radius: 18px 18px 0 0;
  }

  .modal-head,
  .modal-body,
  .modal-foot {
    padding-right: 16px;
    padding-left: 16px;
  }

  .login-card {
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 28px 20px 24px;
  }

  .login-input-wrap,
  .login-submit {
    height: 52px;
  }

  .login-field {
    margin-bottom: 20px;
  }

  .login-card-heading {
    margin-bottom: 24px;
  }

  .login-card-heading h2 {
    font-size: 24px;
  }
}

@media (max-width: 520px) {
  .topbar {
    min-height: 52px;
    padding: 7px 10px;
  }

  .topbar-title {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-user .btn {
    min-height: 32px;
    padding: 5px 7px;
    font-size: 11px;
  }

  .finance-kpi-grid,
  .export-preset-grid {
    grid-template-columns: 1fr;
  }

  .vending-item-main {
    grid-template-columns: 1fr 1fr;
  }

  .date-range-fields {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .date-range-fields input {
    width: 100%;
  }

  .vending-item-main .searchable-select,
  .vending-amount-cell {
    grid-column: 1 / -1;
  }

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

  .page-head {
    min-height: 0;
    margin-bottom: 12px;
    padding: 11px 12px;
    border-radius: 10px;
  }

  .anchor-ops-tabs {
    width: 100%;
    justify-content: flex-start;
  }

  .anchor-ops-tab {
    flex: 0 0 auto;
    min-width: 72px;
    min-height: 32px;
    padding: 0 8px;
    font-size: 11px;
  }

  .page-title {
    font-size: 17px;
  }

  .toolbar {
    gap: 6px;
  }

  .toolbar .btn {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 9px;
    font-size: 11px;
  }

  .btn {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 12px;
  }

  .btn-sm {
    min-height: 28px;
    padding: 4px 7px;
    font-size: 11px;
  }

  .toolbar input,
  .toolbar select,
  .field input,
  .field select,
  .field textarea,
  .scan-line input,
  .global-search input {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .search input {
    min-height: 34px;
    padding-left: 32px;
  }

  .card-head,
  .card-body {
    padding-right: 11px;
    padding-left: 11px;
  }

  .card-head {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .stat-card {
    padding: 11px 12px;
  }

  .stat-value {
    margin-top: 4px;
    font-size: 20px;
  }

  .stat-label,
  .stat-foot {
    font-size: 10px;
  }

  .tag {
    min-height: 22px;
    padding: 2px 7px;
    font-size: 10px;
  }

  th,
  td {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .date-preset-btn {
    padding: 4px 7px;
    font-size: 10px;
  }

  .date-range-fields input {
    height: 34px;
  }

  .modal-head {
    padding: 13px 14px;
  }

  .modal-body {
    padding: 14px;
  }

  .modal-foot {
    padding: 11px 14px;
  }

  .table-wrap table {
    min-width: 620px;
  }

  .nav-item {
    min-width: 46px;
    min-height: 46px;
    padding-right: 5px;
    padding-left: 5px;
    font-size: 9px;
  }

  .nav-item svg {
    width: 17px;
    height: 17px;
  }
}

@media (max-width: 820px) {
  .main,
  .content,
  .page-head,
  .card,
  .toolbar,
  .date-range-filter,
  .table-wrap,
  .modal-body {
    min-width: 0;
    max-width: 100%;
  }

  .content {
    padding: 12px;
  }

  .content > * {
    width: 100%;
  }

  .page-head {
    gap: 12px;
  }

  .page-head .toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    width: 100%;
  }

  .page-head .toolbar .search {
    grid-column: 1 / -1;
  }

  .page-head .toolbar .btn {
    justify-self: start;
  }

  .page-desc {
    font-size: 11px;
    line-height: 1.5;
  }

  .card-head,
  .card-body {
    padding-right: 12px;
    padding-left: 12px;
  }

  .split,
  .export-preset-grid,
  .finance-kpi-grid {
    gap: 10px;
  }

  .date-range-filter {
    margin-bottom: 12px;
    padding: 9px 10px;
  }

  .date-range-fields {
    align-items: end;
  }

  .table-wrap {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .page-head .toolbar {
    grid-template-columns: 1fr;
  }

  .page-head .toolbar .btn {
    justify-self: start;
  }

  .page-head .toolbar .search {
    grid-column: 1;
  }

  .form-grid {
    gap: 10px;
  }
}

@media (max-width: 820px) {
  .activity-overview-grid,
  .activity-top-three {
    grid-template-columns: 1fr;
  }

  .activity-podium {
    min-height: 128px;
  }

  .activity-inline-fields {
    grid-template-columns: 1fr;
  }

  .activity-flow {
    align-items: flex-start;
  }

  .warehouse-binding-cell {
    width: min(320px, calc(100vw - 76px));
    max-width: 320px;
  }

  .finance-warehouse-toolbar {
    align-items: stretch;
  }

  .finance-warehouse-search {
    flex-basis: 100%;
  }

  .finance-warehouse-options {
    max-height: 220px;
  }

  .account-filter-row {
    grid-template-columns: 1fr 1fr;
  }

  .account-filter-row .search {
    grid-column: 1 / -1;
  }

  .room-directory-toolbar {
    grid-template-columns: 1fr;
  }

  .warehouse-stock-overview summary,
  .warehouse-base-card summary {
    align-items: flex-start;
  }

  .warehouse-base-meta {
    flex-basis: 100%;
  }

  .warehouse-base-stats {
    justify-content: flex-start;
  }

  .warehouse-base-body {
    padding-right: 12px;
    padding-left: 12px;
  }
}

@media (max-width: 520px) {
  .activity-overview-grid,
  .activity-top-three {
    grid-template-columns: 1fr;
  }

  .activity-podium {
    min-height: 122px;
    padding: 15px 14px 14px;
  }

  .activity-podium b {
    font-size: 20px;
  }

  .activity-podium-rank {
    font-size: 28px;
  }

  .activity-product-options {
    max-height: 180px;
  }

  .activity-actions {
    justify-content: flex-start;
  }

  .activity-flow span:not(:last-child)::after {
    display: none;
  }

  .account-role-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-role-tab {
    justify-content: space-between;
  }

  .account-filter-row {
    grid-template-columns: 1fr;
  }

  .account-filter-row .search {
    grid-column: 1;
  }

  .warehouse-base-stats {
    gap: 5px 10px;
  }
}
