:root {
  --app-bg: #f3f7f6;
  --app-surface: #ffffff;
  --app-surface-2: #f7fbfa;
  --app-surface-3: #eef5f3;
  --app-border: #e1ebe8;
  --app-border-strong: #cbdad6;
  --app-text: #14211f;
  --app-muted: #5f746f;
  --app-muted-2: #849792;
  --app-primary: #0f766e;
  --app-primary-strong: #0b5b55;
  --app-primary-soft: #e4f3f0;
  --app-primary-soft-2: #c9e9e3;
  --app-warning: #b45309;
  --app-warning-soft: #fef3c7;
  --app-danger: #b91c1c;
  --app-danger-soft: #fee2e2;
  --app-success: #15803d;
  --app-success-soft: #dcfce7;
  --app-radius: 18px;
  --app-radius-md: 14px;
  --app-radius-sm: 10px;
  --app-shadow: 0 1px 2px rgba(20, 45, 40, 0.03), 0 10px 30px rgba(20, 45, 40, 0.05);
  --app-shadow-lg: 0 24px 70px rgba(15, 40, 36, 0.16);
  --app-sidebar-width: 272px;

  --bs-primary-base: #0f766e;
  --bs-primary-fg: #0f766e;
  --bs-primary-fg-emphasis: #0b5b55;
  --bs-primary-bg: #0f766e;
  --bs-primary-bg-subtle: #e4f3f0;
  --bs-primary-bg-muted: #c9e9e3;
  --bs-primary-border: #9bd3ca;
  --bs-primary-contrast: #ffffff;
  --bs-primary-focus-ring: rgba(15, 118, 110, 0.28);
  --bs-body-font-family: "Avenir Next", "Segoe UI", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  --bs-body-color: var(--app-text);
  --bs-body-bg: var(--app-bg);
}

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  font-size: 16px;
}

body {
  min-height: 100dvh;
  margin: 0;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: var(--bs-body-font-family);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.015em;
}

a {
  color: var(--app-primary);
  text-decoration: none;
}

a:hover {
  color: var(--app-primary-strong);
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  vertical-align: -0.15em;
}

.app-root {
  min-height: 100dvh;
}

.boot-screen {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
}

.app-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--app-primary-soft-2);
  border-top-color: var(--app-primary);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Brand */
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #149c90, #0b5b55);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.28);
  flex: none;
}

.brand-mark .icon {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.brand-mark-lg {
  width: 64px;
  height: 64px;
  border-radius: 20px;
}

.brand-mark-lg .icon {
  width: 34px;
  height: 34px;
}

/* Shell */
.app-shell {
  min-height: 100dvh;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--app-sidebar-width);
  padding: 22px 18px;
  background: var(--app-surface);
  border-right: 1px solid var(--app-border);
  display: none;
  flex-direction: column;
  z-index: 20;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 22px;
}

.sidebar-brand-text {
  min-width: 0;
}

.sidebar-brand-title {
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.sidebar-brand-sub {
  color: var(--app-muted-2);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 3px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 12px;
}

.nav-section-label {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--app-muted-2);
  padding: 14px 12px 6px;
}

.nav-link-app {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--app-muted);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.nav-link-app .icon {
  width: 19px;
  height: 19px;
  color: var(--app-muted-2);
  transition: color 0.16s ease;
}

.nav-link-app:hover {
  background: var(--app-surface-2);
  color: var(--app-text);
}

.nav-link-app.is-active {
  background: var(--app-primary-soft);
  color: var(--app-primary-strong);
}

.nav-link-app.is-active .icon {
  color: var(--app-primary);
}

.nav-badge {
  margin-inline-start: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--app-warning-soft);
  color: #92400e;
  font-size: 0.7rem;
  font-weight: 700;
}

.sidebar-footer {
  border-top: 1px solid var(--app-border);
  padding-top: 14px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: var(--app-surface-2);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--app-primary-soft-2);
  color: var(--app-primary-strong);
  font-weight: 750;
  font-size: 0.85rem;
  flex: none;
}

.user-meta {
  min-width: 0;
  flex: 1;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  color: var(--app-muted-2);
}

.user-actions {
  display: flex;
  gap: 2px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--app-muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.icon-btn:hover {
  background: var(--app-surface-3);
  color: var(--app-text);
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

.install-btn {
  margin-top: 10px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px dashed var(--app-border-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--app-primary-strong);
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}

.install-btn:hover {
  background: var(--app-primary-soft);
  border-color: var(--app-primary-border, #9bd3ca);
}

.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 62px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--app-border);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.topbar-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.topbar-brand .brand-mark .icon {
  width: 19px;
  height: 19px;
}

.topbar-title {
  font-size: 0.92rem;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.app-main {
  min-width: 0;
  padding: 20px 16px calc(42px + env(safe-area-inset-bottom));
}

@media (min-width: 1024px) {
  .app-sidebar {
    display: flex;
  }

  .mobile-topbar {
    display: none;
  }

  .app-main {
    margin-inline-start: var(--app-sidebar-width);
    padding: 34px clamp(24px, 3vw, 44px) 60px;
    max-width: 1560px;
  }
}

/* Page */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.page-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 780;
  letter-spacing: -0.025em;
}

.page-sub {
  margin: 5px 0 0;
  color: var(--app-muted);
  font-size: 0.86rem;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.section-sub {
  margin: 3px 0 0;
  color: var(--app-muted);
  font-size: 0.78rem;
}

/* Panels */
.panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--app-border);
  flex-wrap: wrap;
}

.panel-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 750;
}

.panel-sub {
  margin: 3px 0 0;
  color: var(--app-muted);
  font-size: 0.76rem;
}

.panel-body {
  padding: 18px;
}

.panel-body-flush {
  padding: 0;
}

.panel-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  position: relative;
  padding: 16px;
  border-radius: var(--app-radius-md);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow);
  min-width: 0;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -20px -34px auto;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--app-primary-soft);
  opacity: 0.45;
}

.stat-card.is-warning::after { background: var(--app-warning-soft); }
.stat-card.is-danger::after { background: var(--app-danger-soft); }
.stat-card.is-success::after { background: var(--app-success-soft); }

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--app-primary-soft);
  color: var(--app-primary-strong);
  margin-bottom: 14px;
}

.stat-icon .icon {
  width: 20px;
  height: 20px;
}

.stat-card.is-warning .stat-icon { background: var(--app-warning-soft); color: #92400e; }
.stat-card.is-danger .stat-icon { background: var(--app-danger-soft); color: var(--app-danger); }
.stat-card.is-success .stat-icon { background: var(--app-success-soft); color: var(--app-success); }

.stat-label {
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--app-muted);
  margin-bottom: 2px;
}

.stat-value {
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  font-weight: 780;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.stat-note {
  margin-top: 5px;
  font-size: 0.72rem;
  color: var(--app-muted-2);
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  .stat-card {
    padding: 18px;
  }
}

/* Notices */
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--app-radius-md);
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  font-size: 0.84rem;
}

.notice .icon {
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.notice-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #78350f;
}

.notice-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #7f1d1d;
}

.notice-info {
  background: var(--app-primary-soft);
  border-color: var(--app-primary-soft-2);
  color: var(--app-primary-strong);
}

.notice-body {
  min-width: 0;
  flex: 1;
}

.notice-title {
  font-weight: 700;
  margin-bottom: 2px;
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-2);
  color: var(--app-muted);
  font-size: 0.71rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.chip .icon {
  width: 13px;
  height: 13px;
}

.chip-primary {
  background: var(--app-primary-soft);
  border-color: var(--app-primary-soft-2);
  color: var(--app-primary-strong);
}

.chip-warning {
  background: var(--app-warning-soft);
  border-color: #fde68a;
  color: #92400e;
}

.chip-danger {
  background: var(--app-danger-soft);
  border-color: #fecaca;
  color: #991b1b;
}

.chip-success {
  background: var(--app-success-soft);
  border-color: #bbf7d0;
  color: #166534;
}

.chip-neutral {
  background: #f1f5f4;
  border-color: #e2e8e6;
  color: #52615d;
}

.chip-cabinet {
  background: #edf7f5;
  border-color: #cfe8e3;
  color: #0b5b55;
  font-variant-numeric: tabular-nums;
}

.chip-lg {
  min-height: 30px;
  padding: 4px 12px;
  font-size: 0.78rem;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* Buttons */
.btn {
  border-radius: 11px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.btn-sm {
  border-radius: 9px;
}

.btn-icon {
  border-radius: 10px;
}

@media (max-width: 1023.98px) {
  .btn,
  .btn-solid,
  .btn-outline,
  .btn-subtle,
  .btn-text {
    min-height: 44px;
  }

  .btn-sm {
    min-height: 38px;
  }

  .btn-icon {
    width: 44px;
    height: 44px;
  }
}

.btn-link {
  color: var(--app-primary);
  font-weight: 650;
}

/* Forms */
.form-label {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--app-text);
  margin-bottom: 6px;
}

.form-control {
  border-radius: 11px;
  border-color: var(--app-border-strong);
  min-height: 42px;
  font-size: 0.9rem;
  background-color: var(--app-surface);
}

.form-control:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.form-control::placeholder {
  color: var(--app-muted-2);
}

.form-text {
  font-size: 0.73rem;
  color: var(--app-muted);
}

textarea.form-control {
  min-height: 84px;
}

.input-group-text {
  border-radius: 11px;
  border-color: var(--app-border-strong);
  background: var(--app-surface-2);
  color: var(--app-muted);
  font-size: 0.82rem;
}

@media (max-width: 1023.98px) {
  .form-control {
    min-height: 46px;
    font-size: 1rem;
  }
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.form-section {
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: var(--app-surface-2);
}

.form-section-title {
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: var(--app-muted);
  margin-bottom: 12px;
}

.required::after {
  content: " *";
  color: var(--app-danger);
}

/* Search and filters */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box > .icon {
  position: absolute;
  inset-inline-start: 14px;
  width: 20px;
  height: 20px;
  color: var(--app-muted-2);
  pointer-events: none;
}

.search-input {
  width: 100%;
  min-height: 48px;
  padding-inline: 44px 42px;
  border: 1px solid var(--app-border-strong);
  border-radius: 14px;
  background: var(--app-surface);
  font-size: 0.94rem;
  color: var(--app-text);
  outline: 0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.search-input:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.11);
}

.search-clear {
  position: absolute;
  inset-inline-end: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--app-muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.search-clear:hover {
  background: var(--app-surface-3);
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-select {
  width: auto;
  min-width: 120px;
  min-height: 38px;
  padding-block: 4px;
  font-size: 0.82rem;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-muted {
  color: var(--app-muted);
  font-size: 0.78rem;
}

/* Segmented control */
.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--app-surface-3);
  border: 1px solid var(--app-border);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segmented-btn {
  border: 0;
  background: transparent;
  color: var(--app-muted);
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}

.segmented-btn:hover {
  color: var(--app-text);
}

.segmented-btn.is-active {
  background: var(--app-surface);
  color: var(--app-primary-strong);
  box-shadow: 0 1px 4px rgba(20, 45, 40, 0.08);
}

.segmented-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--app-surface-3);
  font-size: 0.68rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.segmented-btn.is-active .segmented-count {
  background: var(--app-primary-soft);
  color: var(--app-primary-strong);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  --bs-table-bg: transparent;
  width: 100%;
  margin: 0;
  font-size: 0.84rem;
  color: var(--app-text);
}

.table > :not(caption) > * > * {
  padding: 11px 14px;
  border-bottom-color: var(--app-border);
  vertical-align: middle;
}

.table thead th {
  padding-block: 10px;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--app-muted-2);
  background: var(--app-surface-2);
  border-bottom: 1px solid var(--app-border);
  white-space: nowrap;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table-hover tbody tr:hover {
  background: #f6fbf9;
}

.row-click {
  cursor: pointer;
}

.cell-main {
  min-width: 160px;
}

.cell-title {
  font-weight: 700;
  color: var(--app-text);
  line-height: 1.35;
}

.cell-sub {
  margin-top: 3px;
  font-size: 0.72rem;
  color: var(--app-muted-2);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cell-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  color: var(--app-muted-2);
}

.cell-num {
  text-align: end;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}

.cell-actions {
  text-align: end;
  white-space: nowrap;
}

.table-empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--app-muted);
}

@media (max-width: 767.98px) {
  .stack-table thead {
    display: none;
  }

  .stack-table tbody tr {
    display: block;
    padding: 13px 15px;
    border-bottom: 1px solid var(--app-border);
  }

  .stack-table tbody tr:last-child {
    border-bottom: 0;
  }

  .stack-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 4px 0;
    border: 0;
    text-align: end;
  }

  .stack-table tbody td::before {
    content: attr(data-label);
    flex: none;
    font-size: 0.7rem;
    font-weight: 650;
    color: var(--app-muted-2);
    text-align: start;
  }

  .stack-table tbody td:not([data-label])::before {
    display: none;
  }

  .stack-table tbody td.cell-main {
    display: block;
    text-align: start;
    padding-bottom: 8px;
  }

  .stack-table tbody td.cell-main::before {
    display: none;
  }

  .stack-table tbody td.cell-actions {
    justify-content: flex-end;
    padding-top: 8px;
  }

  .stack-table tbody td.cell-actions::before {
    display: none;
  }
}

/* Lists */
.list {
  display: flex;
  flex-direction: column;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--app-border);
  min-width: 0;
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row-click {
  cursor: pointer;
  transition: background-color 0.14s ease;
}

.list-row-click:hover {
  background: var(--app-surface-2);
}

.list-main {
  min-width: 0;
  flex: 1;
}

.list-title {
  font-size: 0.84rem;
  font-weight: 680;
  line-height: 1.35;
}

.list-sub {
  margin-top: 3px;
  font-size: 0.72rem;
  color: var(--app-muted-2);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.list-side {
  text-align: end;
  flex: none;
}

.list-side-value {
  font-size: 0.86rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.list-side-label {
  font-size: 0.68rem;
  color: var(--app-muted-2);
  margin-top: 2px;
}

.expiry-date {
  width: 64px;
  flex: none;
  text-align: center;
  padding: 7px 4px;
  border-radius: 10px;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
}

.expiry-date-month {
  font-size: 0.65rem;
  font-weight: 650;
  color: var(--app-muted-2);
}

.expiry-date-value {
  font-size: 0.92rem;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.expiry-date.is-danger {
  background: #fef2f2;
  border-color: #fecaca;
}

.expiry-date.is-warning {
  background: #fffbeb;
  border-color: #fde68a;
}

/* Progress */
.progress-line {
  margin-top: 6px;
}

.progress-track {
  height: 7px;
  border-radius: 999px;
  background: var(--app-surface-3);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #14b8a6, #0f766e);
  transition: width 0.35s ease;
}

.progress-fill.is-warning {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.progress-fill.is-danger {
  background: linear-gradient(90deg, #f87171, #dc2626);
}

.progress-legend {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--app-muted);
  margin-top: 5px;
}

/* Bar chart */
.bar-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: 190px;
  padding-top: 18px;
}

.bar-col {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.bar-value {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--app-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bar {
  width: 100%;
  max-width: 42px;
  min-height: 4px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #2dd4bf, #0f766e);
  transition: height 0.4s ease;
}

.bar.is-current {
  background: linear-gradient(180deg, #fbbf24, #d97706);
}

.bar-label {
  font-size: 0.66rem;
  color: var(--app-muted-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Detail dialog content */
.detail-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.detail-hero-main {
  min-width: 0;
  flex: 1;
}

.detail-name {
  font-size: 1.12rem;
  font-weight: 780;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.detail-meta {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.detail-stat {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
}

.detail-stat-label {
  font-size: 0.68rem;
  color: var(--app-muted-2);
  font-weight: 650;
}

.detail-stat-value {
  margin-top: 2px;
  font-size: 1.05rem;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.location-card {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: var(--app-primary-soft);
  border: 1px solid var(--app-primary-soft-2);
  color: var(--app-primary-strong);
}

.location-card .icon {
  width: 24px;
  height: 24px;
}

.location-label {
  font-size: 0.7rem;
  font-weight: 650;
  opacity: 0.8;
}

.location-value {
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.subsection {
  margin-top: 20px;
}

.subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.subsection-title {
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: var(--app-muted);
  margin: 0;
}

.batch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.batch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  font-size: 0.71rem;
  color: var(--app-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.batch-chip strong {
  color: var(--app-text);
}

.batch-chip.is-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.batch-chip.is-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

/* Empty / loading / error */
.empty-state {
  padding: 48px 22px;
  text-align: center;
  color: var(--app-muted);
}

.empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  color: var(--app-muted-2);
}

.empty-icon .icon {
  width: 26px;
  height: 26px;
}

.empty-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--app-text);
}

.empty-text {
  font-size: 0.78rem;
  margin-top: 3px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: #edf3f1;
  border-radius: 8px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: shimmer 1.4s infinite;
}

.skeleton-line {
  height: 12px;
  margin-bottom: 9px;
}

.skeleton-line:last-child {
  margin-bottom: 0;
}

.page-loading {
  padding: 26px;
}

.error-page {
  min-height: 50vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 10px;
}

/* Toast */
.toast-region {
  position: fixed;
  z-index: 3000;
  inset-inline: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  width: min(420px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #14211f;
  color: #fff;
  box-shadow: 0 14px 40px rgba(10, 30, 26, 0.28);
  font-size: 0.82rem;
  animation: toast-in 0.22s ease both;
}

.toast-item .icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.toast-item.is-error {
  background: #7f1d1d;
}

.toast-item.is-success {
  background: #14532d;
}

.toast-msg {
  flex: 1;
  min-width: 0;
}

.toast-action {
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 0.75rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

.toast-close {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 6px;
  flex: none;
}

@media (min-width: 640px) {
  .toast-region {
    inset-inline: auto 20px;
    bottom: 20px;
    align-items: flex-end;
  }
}

/* Dialogs and drawers */
dialog.dialog {
  --bs-dialog-width: 560px;
  --bs-dialog-border-radius: 18px;
  padding: 0;
  max-width: calc(100vw - 28px);
  max-height: calc(100dvh - 40px);
  color: var(--app-text);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow-lg);
}

dialog.dialog.dialog-lg {
  --bs-dialog-width: 760px;
}

dialog.dialog.dialog-xl {
  --bs-dialog-width: 980px;
}

dialog.dialog::backdrop {
  background: rgba(12, 30, 27, 0.42);
  backdrop-filter: blur(4px);
}

.dialog-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--app-border);
}

.dialog-title {
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.dialog-body {
  padding: 18px;
}

.dialog-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--app-border);
  gap: 8px;
}

.dialog-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--app-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  margin-inline-start: auto;
}

.dialog-close:hover {
  background: var(--app-surface-3);
}

@media (max-width: 575.98px) {
  dialog.dialog {
    width: calc(100vw - 20px);
    max-width: none;
    max-height: calc(100dvh - 20px);
    margin: 10px auto;
  }

  dialog.dialog .dialog-footer {
    flex-wrap: wrap;
  }

  dialog.dialog .dialog-footer .btn {
    flex: 1;
  }
}

dialog.drawer {
  --bs-drawer-width: 298px;
  --bs-drawer-border-radius: 0 18px 18px 0;
  width: min(298px, calc(100vw - 42px));
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0 18px 18px 0;
  padding: 0;
  background: var(--app-surface);
}

dialog.drawer::backdrop {
  background: rgba(12, 30, 27, 0.42);
  backdrop-filter: blur(3px);
}

.drawer-header {
  padding: 16px 16px 10px;
  border-bottom: 0;
}

.drawer-body {
  padding: 0 14px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

.drawer-footer {
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Login */
.login-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--app-bg);
}

.login-brand {
  display: none;
  position: relative;
  overflow: hidden;
  padding: 48px;
  color: #eafffb;
  background:
    radial-gradient(circle at 18% 12%, rgba(45, 212, 191, 0.22), transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(20, 184, 166, 0.18), transparent 40%),
    linear-gradient(160deg, #0c3f3a 0%, #0b2f2c 100%);
  flex-direction: column;
  justify-content: space-between;
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: auto -90px -120px auto;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 1px solid rgba(153, 246, 228, 0.18);
  box-shadow: 0 0 0 42px rgba(153, 246, 228, 0.04), 0 0 0 84px rgba(153, 246, 228, 0.03);
}

.login-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.login-brand-head {
  display: flex;
  align-items: center;
  gap: 13px;
}

.login-brand-head .brand-mark {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.login-brand-name {
  font-size: 1rem;
  font-weight: 750;
}

.login-brand-sub {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(234, 255, 251, 0.58);
  margin-top: 3px;
}

.login-copy {
  margin-top: clamp(60px, 12vh, 150px);
}

.login-title {
  font-size: clamp(2rem, 3.4vw, 3.1rem);
  font-weight: 780;
  letter-spacing: -0.04em;
  line-height: 1.12;
  margin: 0;
}

.login-foot {
  position: relative;
  z-index: 1;
  font-size: 0.7rem;
  color: rgba(234, 255, 251, 0.4);
}

.login-card-wrap {
  display: grid;
  place-items: center;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
}

.login-card {
  width: min(410px, 100%);
}

.login-mobile-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.login-card-title {
  font-size: 1.55rem;
  font-weight: 780;
  letter-spacing: -0.03em;
  margin: 0;
}

.login-card-sub {
  color: var(--app-muted);
  font-size: 0.84rem;
  margin: 6px 0 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-inline-end: 46px;
}

.password-toggle {
  position: absolute;
  inset-inline-end: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--app-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.password-toggle:hover {
  background: var(--app-surface-3);
}

.login-error {
  display: none;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--app-danger-soft);
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.8rem;
}

.login-error.is-visible {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.login-footer {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--app-border);
  color: var(--app-muted-2);
  font-size: 0.72rem;
  line-height: 1.6;
}

@media (min-width: 900px) {
  .login-page {
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  }

  .login-brand {
    display: flex;
  }

  .login-card-wrap {
    padding: 40px;
  }

  .login-mobile-brand {
    display: none;
  }
}

/* Inventory */
.search-panel {
  padding: 16px;
  border-radius: var(--app-radius);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-row .search-box {
  flex: 1;
  min-width: 220px;
}

.atc-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--app-border);
  cursor: pointer;
  transition: background-color 0.14s ease;
}

.atc-card:last-child {
  border-bottom: 0;
}

.atc-card:hover {
  background: var(--app-surface-2);
}

.atc-code {
  width: 64px;
  flex: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  font-weight: 750;
  color: var(--app-primary-strong);
  background: var(--app-primary-soft);
  border: 1px solid var(--app-primary-soft-2);
  border-radius: 9px;
  padding: 7px 6px;
  text-align: center;
}

.atc-info {
  min-width: 0;
  flex: 1;
}

.atc-name {
  font-size: 0.84rem;
  font-weight: 680;
  line-height: 1.35;
}

.atc-meta {
  font-size: 0.72rem;
  color: var(--app-muted-2);
  margin-top: 3px;
}

/* Expiry */
.expiry-scope {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.scope-card {
  min-width: 0;
  padding: 13px 14px;
  border-radius: var(--app-radius-md);
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  text-align: start;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.scope-card:hover {
  border-color: var(--app-border-strong);
}

.scope-card.is-active {
  border-color: var(--app-primary);
  background: var(--app-primary-soft);
}

.scope-card.is-danger.is-active {
  border-color: #fca5a5;
  background: #fef2f2;
}

.scope-card.is-warning.is-active {
  border-color: #fcd34d;
  background: #fffbeb;
}

.scope-label {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--app-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.scope-value {
  font-size: 1.35rem;
  font-weight: 780;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
  line-height: 1.2;
}

.scope-note {
  font-size: 0.68rem;
  color: var(--app-muted-2);
  margin-top: 2px;
}

/* Stocktake */
.stocktake-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}

.stocktake-hero-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.stocktake-month {
  font-size: 1.3rem;
  font-weight: 780;
  letter-spacing: -0.03em;
}

.stocktake-meta {
  margin-top: 4px;
  color: var(--app-muted);
  font-size: 0.78rem;
}

.stocktake-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.progress-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.74rem;
  color: var(--app-muted);
}

.stocktake-list {
  display: flex;
  flex-direction: column;
}

.drug-block {
  border-bottom: 1px solid var(--app-border);
}

.drug-block:last-child {
  border-bottom: 0;
}

.drug-block-head {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 104px 40px;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  text-align: start;
  cursor: pointer;
  color: inherit;
}

.drug-block-head:hover {
  background: var(--app-surface-2);
}

.drug-block.is-open .drug-block-head {
  background: var(--app-surface-2);
}

.drug-block-name {
  font-size: 0.84rem;
  font-weight: 680;
  line-height: 1.35;
}

.drug-block-sub {
  margin-top: 3px;
  font-size: 0.7rem;
  color: var(--app-muted-2);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.drug-block-col {
  text-align: end;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.drug-block-col-label {
  display: block;
  font-size: 0.63rem;
  font-weight: 650;
  color: var(--app-muted-2);
  margin-bottom: 1px;
}

.drug-block-chevron {
  display: grid;
  place-items: center;
  color: var(--app-muted-2);
  transition: transform 0.18s ease;
}

.drug-block.is-open .drug-block-chevron {
  transform: rotate(180deg);
}

.drug-block-body {
  display: none;
  padding: 0 16px 16px;
  background: var(--app-surface-2);
}

.drug-block.is-open .drug-block-body {
  display: block;
}

.batch-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 120px;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--app-border);
}

.batch-editor:last-child {
  border-bottom: 0;
}

.batch-expiry {
  font-size: 0.8rem;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

.batch-system {
  text-align: end;
  font-size: 0.78rem;
  color: var(--app-muted);
  font-variant-numeric: tabular-nums;
}

.qty-input {
  color: var(--app-text);
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--app-border-strong);
  border-radius: 9px;
  background: var(--app-surface);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  text-align: end;
  outline: 0;
}

.qty-input::placeholder {
  color: var(--app-muted-2);
}

.qty-input:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.inbound-row {
  margin-top: 12px;
  padding: 12px;
  border-radius: 11px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.inbound-label {
  font-size: 0.78rem;
  font-weight: 650;
}

.inbound-label span {
  display: block;
  font-size: 0.68rem;
  color: var(--app-muted-2);
  font-weight: 500;
  margin-top: 2px;
}

.inbound-input {
  width: 120px;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: var(--app-muted-2);
}

.save-state.is-saving {
  color: var(--app-warning);
}

.save-state.is-saved {
  color: var(--app-success);
}

.session-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--app-border);
  flex-wrap: wrap;
}

.session-row:last-child {
  border-bottom: 0;
}

/* Reports */
.report-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.month-input {
  width: 160px;
  min-height: 42px;
}

.report-doc {
  padding: 20px;
}

.report-doc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--app-text);
  margin-bottom: 14px;
}

.report-doc-title {
  font-size: 1.15rem;
  font-weight: 780;
  letter-spacing: -0.02em;
  margin: 0;
}

.report-doc-sub {
  font-size: 0.74rem;
  color: var(--app-muted);
  margin-top: 4px;
}

.report-doc-meta {
  text-align: end;
  font-size: 0.72rem;
  color: var(--app-muted);
}

.report-group {
  margin-top: 18px;
}

.report-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--app-surface-3);
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--app-text);
  margin-bottom: 4px;
}

.report-group-key {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 750;
  color: var(--app-primary-strong);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.report-table th,
.report-table td {
  border: 1px solid var(--app-border);
  padding: 6px 8px;
  vertical-align: middle;
}

.report-table th {
  background: var(--app-surface-2);
  font-size: 0.65rem;
  font-weight: 750;
  color: var(--app-muted);
  text-align: center;
  white-space: nowrap;
}

.report-table td.num {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.report-table td.center {
  text-align: center;
}

.report-table .drug-name-cell {
  min-width: 220px;
}

.report-total-row td {
  background: var(--app-surface-2);
  font-weight: 750;
}

.report-batch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.report-batch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.report-batch.is-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.report-batch.is-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.report-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--app-muted);
  font-size: 0.82rem;
}

.report-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 4px;
  align-items: end;
  height: 120px;
  padding-top: 10px;
}

.report-chart .bar-value {
  font-size: 0.58rem;
}

.report-chart .bar-label {
  font-size: 0.58rem;
}

/* Users */
.perm-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.perm-matrix {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  overflow: hidden;
}

.perm-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--app-border);
  font-size: 0.8rem;
}

.perm-row:last-child {
  border-bottom: 0;
}

.perm-row-head {
  background: var(--app-surface-2);
  font-size: 0.68rem;
  font-weight: 750;
  color: var(--app-muted);
}

.perm-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--app-muted);
  cursor: pointer;
}

.perm-option input {
  accent-color: var(--app-primary);
}

.perm-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.user-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--app-muted);
}

/* Utilities */
.muted { color: var(--app-muted); }
.muted-2 { color: var(--app-muted-2); }
.tiny { font-size: 0.7rem; }
.small { font-size: 0.8rem; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex-1 { flex: 1; min-width: 0; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.text-end { text-align: end; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 768px) {
  .page-body {
    gap: 20px;
  }

  .expiry-scope {
    display: flex;
  }

  .scope-card {
    flex: 1 1 0;
    min-width: 132px;
  }

  .panel-body {
    padding: 20px;
  }

  .stat-note {
    font-size: 0.74rem;
  }
}

@media (min-width: 1280px) {
  .stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Grid helpers for dashboard */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 1024px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-main-side {
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  }
}

/* Offline banner */
.offline-banner {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
  font-size: 0.78rem;
}

.offline-banner.is-visible {
  display: flex;
}

/* Print */
.print-only {
  display: none;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 10pt;
  }

  .app-sidebar,
  .mobile-topbar,
  .page-head,
  .no-print,
  .toast-region,
  .app-spinner,
  .offline-banner {
    display: none !important;
  }

  .app-main {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }

  .page-body {
    gap: 0;
  }

  .panel {
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  .panel-header,
  .panel-footer {
    display: none !important;
  }

  .panel-body,
  .report-doc {
    padding: 0 !important;
  }

  .print-only {
    display: block !important;
  }

  .report-doc-head {
    border-bottom: 1.5pt solid #000;
  }

  .report-group {
    break-inside: avoid;
  }

  .report-group-head {
    background: #eee !important;
    border: 1px solid #999;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-table th,
  .report-table td {
    border-color: #999 !important;
    padding: 2.5pt 3.5pt;
    font-size: 8pt;
  }

  .report-table th {
    background: #f2f2f2 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-batch {
    border: 0;
    background: transparent;
    padding: 0;
    font-size: 7.5pt;
  }

  .report-batch-list {
    gap: 2pt 7pt;
  }

  .chip,
  .badge {
    border: 0;
    background: transparent !important;
    padding: 0;
    font-size: 8pt;
  }
}

/* Refinements */
.min-w-0 {
  min-width: 0;
}

.page-body > .page-head {
  margin-bottom: 2px;
}

@media (max-width: 767.98px) {
  .stat-grid .stat-card:last-child:nth-child(5) {
    grid-column: span 2;
  }
}

@media (min-width: 768px) {
  .stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .stocktake-hero .detail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stocktake-hero {
    padding: 22px;
  }
}

@media (min-width: 1280px) {
  .stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.batch-editor-head {
  padding-block: 0 7px;
  border-bottom: 1px solid var(--app-border);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--app-muted-2);
}

.batch-editor-head span:nth-child(2),
.batch-editor-head span:nth-child(3) {
  text-align: end;
}

.qty-input.is-saved {
  border-color: #86efac;
  background: #f0fdf4;
}

dialog.drawer .drawer-header {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

dialog.drawer .drawer-body .sidebar-nav {
  padding-top: 4px;
}

dialog.drawer .drawer-body .nav-section-label:first-child {
  padding-top: 2px;
}

.detail-stat code,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  color: var(--app-text);
  background: var(--app-surface-3);
  border: 1px solid var(--app-border);
  border-radius: 6px;
  padding: 2px 6px;
  overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
  .drug-block-head {
    grid-template-columns: minmax(0, 1fr) 64px 76px 28px;
    gap: 8px;
    padding: 12px;
  }

  .drug-block-col {
    font-size: 0.74rem;
  }

  .batch-editor {
    grid-template-columns: minmax(0, 1fr) 58px 88px;
    gap: 7px;
  }

  .batch-editor-head {
    grid-template-columns: minmax(0, 1fr) 58px 88px;
  }

  .inbound-input {
    width: 112px;
  }

  .stocktake-hero {
    padding: 16px;
  }

  .report-doc {
    padding: 14px;
  }

  .report-table {
    font-size: 0.72rem;
  }

  .report-table th,
  .report-table td {
    padding: 5px 6px;
  }
}

@media (max-width: 420px) {
  .drug-block-head {
    grid-template-columns: minmax(0, 1fr) 58px 70px 22px;
    gap: 6px;
  }

  .drug-block-col-label {
    font-size: 0.58rem;
  }

  .batch-editor,
  .batch-editor-head {
    grid-template-columns: minmax(0, 1fr) 52px 82px;
  }
}

@media print {
  .report-chart .bar {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Keep dialog header/footer visible and scroll only the body */
dialog.dialog {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

dialog.dialog .dialog-header,
dialog.dialog .dialog-footer {
  flex: none;
}

dialog.dialog .dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

dialog.drawer {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

dialog.drawer .drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

dialog.drawer .drawer-footer {
  flex: none;
}

@media (max-width: 1023.98px) {
  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .filter-select,
  .month-input {
    min-height: 44px;
  }

  .search-clear,
  .password-toggle,
  .dialog-close {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 575.98px) {
  .report-chart .bar-value {
    display: none;
  }

  .report-chart .bar-label {
    font-size: 0.6rem;
  }
}

/* ATC filter drawer */
.atc-name-inline {
  font-size: 0.68rem;
  color: var(--app-muted-2);
}

.atc-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  white-space: nowrap;
}

.atc-filter-btn .icon {
  width: 15px;
  height: 15px;
}

.atc-filter-btn.is-active {
  background: var(--app-primary-soft);
  border-color: var(--app-primary-soft-2);
  color: var(--app-primary-strong);
}

.filter-active {
  margin-top: 2px;
}

.atc-active-chip {
  gap: 7px;
  padding-inline: 10px 5px;
  max-width: 100%;
}

.atc-active-chip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-clear {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: rgba(15, 118, 110, 0.12);
  color: inherit;
  cursor: pointer;
}

.chip-clear:hover {
  background: rgba(15, 118, 110, 0.22);
}

.chip-clear .icon {
  width: 12px;
  height: 12px;
}

dialog.drawer.atc-drawer {
  --bs-drawer-width: 390px;
  width: min(390px, calc(100vw - 22px));
}

.atc-search-box {
  margin-bottom: 14px;
}

.atc-tree {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

.atc-main {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface);
  overflow: hidden;
}

.atc-main-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: start;
  cursor: pointer;
}

.atc-main-head:hover,
.atc-main.is-open .atc-main-head {
  background: var(--app-surface-2);
}

.atc-main-code {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--app-primary-soft);
  color: var(--app-primary-strong);
  font-size: 0.78rem;
  font-weight: 750;
}

.atc-main-name {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.atc-main-count {
  font-size: 0.68rem;
  color: var(--app-muted-2);
  font-variant-numeric: tabular-nums;
}

.atc-main-chevron {
  color: var(--app-muted-2);
  transition: transform 0.18s ease;
}

.atc-main.is-open .atc-main-chevron {
  transform: rotate(180deg);
}

.atc-main-body {
  border-top: 1px solid var(--app-border);
  padding: 4px 0;
}

.atc-select-row,
.atc-sub-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: start;
  cursor: pointer;
}

.atc-select-row:hover,
.atc-sub-head:hover {
  background: var(--app-surface-2);
}

.atc-select-row.is-active,
.atc-sub-head.is-active {
  background: var(--app-primary-soft);
  color: var(--app-primary-strong);
}

.atc-main-all {
  padding-inline-start: 20px;
  font-size: 0.78rem;
  font-weight: 650;
}

.atc-row-label {
  font-weight: 700;
  color: var(--app-primary-strong);
  white-space: nowrap;
}

.atc-row-name {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.atc-row-count {
  font-size: 0.68rem;
  color: var(--app-muted-2);
  white-space: nowrap;
}

.atc-subgroup {
  padding: 0 8px 4px;
}

.atc-sub-head {
  border-radius: 8px;
  padding: 7px 8px;
}

.atc-sub-code {
  flex: none;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--app-primary-soft);
  color: var(--app-primary-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 750;
}



/* Sidebar collapse */
.app-sidebar {
  transition: width 0.18s ease, padding 0.18s ease;
}

.sidebar-toggle {
  position: absolute;
  top: 30px;
  inset-inline-end: -13px;
  z-index: 3;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--app-border);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--app-surface);
  color: var(--app-muted);
  box-shadow: 0 3px 10px rgba(20, 45, 40, 0.12);
  cursor: pointer;
}

.sidebar-toggle .icon {
  width: 14px;
  height: 14px;
}

.sidebar-toggle:hover {
  border-color: var(--app-primary-soft-2);
  background: var(--app-primary-soft);
  color: var(--app-primary-strong);
}

.install-label {
  white-space: nowrap;
}

.login-theme-toggle {
  position: fixed;
  top: 16px;
  inset-inline-end: 16px;
  z-index: 20;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow);
}

@media (min-width: 1024px) {
  .app-main {
    transition: margin-inline-start 0.18s ease;
  }

  .app-shell.is-collapsed .app-sidebar {
    width: 84px;
    padding: 22px 10px;
  }

  .app-shell.is-collapsed .app-main {
    margin-inline-start: 84px;
  }

  .app-shell.is-collapsed .sidebar-brand {
    justify-content: center;
    padding-inline: 0;
  }

  .app-shell.is-collapsed .sidebar-brand-text,
  .app-shell.is-collapsed .nav-label,
  .app-shell.is-collapsed .nav-badge,
  .app-shell.is-collapsed .user-meta,
  .app-shell.is-collapsed .user-actions {
    display: none;
  }

  .app-shell.is-collapsed .sidebar-nav {
    gap: 6px;
  }

  .app-shell.is-collapsed .nav-section-label {
    height: 1px;
    margin: 9px 8px;
    padding: 0;
    overflow: hidden;
    background: var(--app-border);
    color: transparent;
    font-size: 0;
    letter-spacing: 0;
  }

  .app-shell.is-collapsed .nav-link-app {
    justify-content: center;
    padding: 12px 0;
  }

  .app-shell.is-collapsed .nav-link-app .icon {
    width: 21px;
    height: 21px;
  }

  .app-shell.is-collapsed .user-card {
    justify-content: center;
    padding: 7px;
    background: transparent;
  }

  .app-shell.is-collapsed .install-btn {
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 0;
    border-style: solid;
  }

  .app-shell.is-collapsed .install-label {
    display: none;
  }
}

/* Dark mode */
[data-bs-theme="dark"] {
  --app-bg: #0b1513;
  --app-surface: #111f1c;
  --app-surface-2: #162723;
  --app-surface-3: #1b302b;
  --app-border: #263d37;
  --app-border-strong: #35564e;
  --app-text: #e8f3f0;
  --app-muted: #a2b7b1;
  --app-muted-2: #7e958f;
  --app-primary: #2dd4bf;
  --app-primary-strong: #99f6e4;
  --app-primary-soft: #11332f;
  --app-primary-soft-2: #1a4a43;
  --app-warning: #fbbf24;
  --app-warning-soft: #3a2c0d;
  --app-danger: #f87171;
  --app-danger-soft: #3b1515;
  --app-success: #4ade80;
  --app-success-soft: #12301b;
  --app-shadow: 0 1px 2px rgba(0, 0, 0, 0.28), 0 12px 32px rgba(0, 0, 0, 0.22);
  --app-shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.5);
  --bs-body-color: var(--app-text);
  --bs-body-bg: var(--app-bg);
  --bs-primary-base: #2dd4bf;
  --bs-primary-fg: #5eead4;
  --bs-primary-fg-emphasis: #99f6e4;
  --bs-primary-bg: #14b8a6;
  --bs-primary-bg-subtle: #11332f;
  --bs-primary-bg-muted: #1a4a43;
  --bs-primary-border: #2dd4bf;
  --bs-primary-contrast: #042f2b;
  --bs-primary-focus-ring: rgba(45, 212, 191, 0.28);
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
  background: #172a25;
}

[data-bs-theme="dark"] .mobile-topbar {
  background: rgba(17, 31, 28, 0.92);
}

[data-bs-theme="dark"] .notice-warning,
[data-bs-theme="dark"] .offline-banner {
  background: #3a2c0d;
  border-color: #6b4f1a;
  color: #fcd34d;
}

[data-bs-theme="dark"] .notice-danger,
[data-bs-theme="dark"] .login-error {
  background: #3b1515;
  border-color: #7f1d1d;
  color: #fca5a5;
}

[data-bs-theme="dark"] .chip-warning {
  background: #3a2c0d;
  border-color: #6b4f1a;
  color: #fcd34d;
}

[data-bs-theme="dark"] .chip-danger {
  background: #3b1515;
  border-color: #7f1d1d;
  color: #fca5a5;
}

[data-bs-theme="dark"] .chip-success {
  background: #12301b;
  border-color: #166534;
  color: #86efac;
}

[data-bs-theme="dark"] .chip-neutral {
  background: #1a2926;
  border-color: #2b413b;
  color: #a8bcb7;
}

[data-bs-theme="dark"] .chip-cabinet {
  background: #12332f;
  border-color: #1d4a43;
  color: #99f6e4;
}

[data-bs-theme="dark"] .expiry-date.is-danger,
[data-bs-theme="dark"] .batch-chip.is-danger,
[data-bs-theme="dark"] .report-batch.is-danger,
[data-bs-theme="dark"] .scope-card.is-danger.is-active {
  background: #3b1515;
  border-color: #7f1d1d;
  color: #fca5a5;
}

[data-bs-theme="dark"] .expiry-date.is-warning,
[data-bs-theme="dark"] .batch-chip.is-warning,
[data-bs-theme="dark"] .report-batch.is-warning,
[data-bs-theme="dark"] .scope-card.is-warning.is-active {
  background: #3a2c0d;
  border-color: #6b4f1a;
  color: #fcd34d;
}

[data-bs-theme="dark"] .nav-badge {
  color: #fcd34d;
}

[data-bs-theme="dark"] .stat-card.is-warning .stat-icon {
  color: #fcd34d;
}

[data-bs-theme="dark"] .stat-card.is-danger .stat-icon {
  color: #fca5a5;
}

[data-bs-theme="dark"] .stat-card.is-success .stat-icon {
  color: #86efac;
}

[data-bs-theme="dark"] .qty-input {
  color: var(--app-text);
}

[data-bs-theme="dark"] .qty-input::placeholder,
[data-bs-theme="dark"] .search-input::placeholder {
  color: var(--app-muted-2);
}

[data-bs-theme="dark"] .qty-input.is-saved {
  border-color: #166534;
  background: #12301b;
}

[data-bs-theme="dark"] .skeleton {
  background: #1a2e2a;
}

[data-bs-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
}

[data-bs-theme="dark"] .report-doc-head {
  border-bottom-color: var(--app-border-strong);
}

[data-bs-theme="dark"] .chip-clear {
  background: rgba(45, 212, 191, 0.18);
}

[data-bs-theme="dark"] .chip-clear:hover {
  background: rgba(45, 212, 191, 0.3);
}

[data-bs-theme="dark"] .toast-item {
  background: #1b3a34;
}

[data-bs-theme="dark"] .toast-item.is-error {
  background: #5f1717;
}

[data-bs-theme="dark"] .toast-item.is-success {
  background: #14532d;
}

[data-bs-theme="dark"] .sidebar-toggle {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

.user-role {
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .app-sidebar .user-actions {
    gap: 0;
  }

  .app-sidebar .user-actions .icon-btn {
    width: 32px;
    height: 32px;
  }

  .app-sidebar .user-actions .icon-btn .icon {
    width: 16px;
    height: 16px;
  }
}

.sidebar-tools {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-top: 10px;
}

.sidebar-tools .install-btn {
  flex: 1;
  margin-top: 0;
}

.sidebar-theme {
  width: 42px;
  height: 42px;
  flex: none;
  border: 1px dashed var(--app-border-strong);
  border-radius: 12px;
}

@media (min-width: 1024px) {
  .app-shell.is-collapsed .sidebar-tools {
    flex-direction: column;
  }

  .app-shell.is-collapsed .sidebar-theme {
    width: 100%;
    height: 44px;
  }
}

.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

@media print {
  .report-doc-title,
  .report-doc-sub,
  .report-doc-meta,
  .report-doc .muted,
  .report-doc .muted-2,
  .report-doc .cell-sub,
  .report-doc .cell-code,
  .report-group-head,
  .report-group-key,
  .report-table th,
  .report-table td,
  .report-batch,
  .report-doc .chip,
  .report-doc .badge {
    color: #000 !important;
  }

  .report-doc-head {
    border-bottom-color: #000 !important;
  }

  .report-group-head {
    background: #eee !important;
    border: 1px solid #999 !important;
  }

  .report-group-key {
    background: #fff !important;
    border-color: #999 !important;
  }

  .report-table th {
    background: #f2f2f2 !important;
  }

  .report-total-row td {
    background: #f2f2f2 !important;
    color: #000 !important;
  }

  .report-batch {
    background: transparent !important;
    border: 0 !important;
  }
}

@media print {
  .panel,
  .report-doc,
  .report-table,
  .report-table td {
    background: #fff !important;
  }

  .report-table th,
  .report-total-row td {
    background: #f2f2f2 !important;
  }
}

@media print {
  :root,
  html,
  body {
    background: #fff !important;
    color-scheme: light !important;
  }
}


.detail-grid-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .detail-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
