:root {
  --brand: #f58220;
  --brand-dark: #d96500;
  --yellow: #f7c84b;
  --green: #4c8f17;
  --green-dark: #2f6f11;
  --ink: #252019;
  --muted: #7d756c;
  --soft: #f7f9fb;
  --line: #e5e9ef;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --shadow: rgba(36, 52, 71, 0.08);
  --topbar: rgba(255, 255, 255, 0.92);
  --corporate: #243447;
  --corporate-soft: #edf2f7;
}

/* Invoice workspace */
.invoice-document { max-width: 1180px; margin: 0 auto; }
.invoice-paper { background: var(--surface, #fff); border: 1px solid rgba(37,32,25,.1); border-right: 5px solid var(--brand); border-radius: 20px; box-shadow: 0 18px 45px rgba(37,32,25,.08); overflow: hidden; padding: clamp(1.25rem,3vw,2.5rem); transition: box-shadow .2s ease, transform .2s ease; }
.invoice-paper:hover { box-shadow: 0 22px 55px rgba(37,32,25,.13); transform: translateY(-2px); }
.invoice-heading { display: flex; justify-content: space-between; gap: 2rem; padding-bottom: 2rem; border-bottom: 2px solid rgba(37,32,25,.08); }
.invoice-heading h2 { color: var(--brand-dark); font-size: clamp(2rem,5vw,3.75rem); font-weight: 800; letter-spacing: .08em; margin: .2rem 0; }
.invoice-meta { display: grid; gap: .7rem; min-width: min(100%,330px); }
.invoice-meta label { align-items: center; color: var(--muted); display: grid; font-size: .78rem; font-weight: 700; gap: .35rem; grid-template-columns: 92px 1fr; text-transform: uppercase; }
.invoice-customer-block, .invoice-footer-block { padding: 2rem 0; }
.invoice-source-panel { background: rgba(245,130,32,.06); border: 1px solid rgba(245,130,32,.18); border-radius: 14px; margin-top: 1.5rem; padding: 1rem; }
.receiving-order-card { background: var(--surface); border: 1px solid var(--line); border-right: 4px solid var(--brand); border-radius: 16px; color: var(--ink); display: grid; gap: .35rem; padding: 1rem; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.receiving-order-card:hover { border-color: var(--brand); box-shadow: 0 14px 30px var(--shadow); transform: translateY(-3px); }
.receiving-order-card small, .receiving-order-card p { color: var(--muted); margin: 0; }
.invoice-block-label { color: var(--brand-dark); display: block; font-size: .75rem; font-weight: 800; letter-spacing: .12em; margin-bottom: .8rem; text-transform: uppercase; }
.invoice-lines-wrap { border-bottom: 1px solid rgba(37,32,25,.08); border-top: 1px solid rgba(37,32,25,.08); padding: 1.5rem 0; }
.invoice-lines-table thead th { background: rgba(245,130,32,.1); border: 0; color: var(--ink); font-size: .75rem; letter-spacing: .05em; padding: .85rem; text-transform: uppercase; }
.invoice-lines-table td { border-bottom-color: rgba(37,32,25,.07); padding: .75rem .5rem; vertical-align: middle; }
.invoice-unit { color: var(--muted); font-size: .86rem; font-weight: 700; white-space: nowrap; }
.invoice-totals { background: rgba(245,130,32,.06); border-radius: 16px; padding: 1rem 1.25rem; }
.invoice-totals > div { align-items: center; display: grid; gap: 1rem; grid-template-columns: 1fr 150px; min-height: 48px; }
.invoice-totals label, .invoice-totals span { color: var(--muted); font-weight: 700; }
.invoice-totals strong { text-align: right; }
.invoice-grand-total { border-top: 2px solid rgba(37,32,25,.12); color: var(--brand-dark); font-size: 1.25rem; margin-top: .75rem; padding-top: .75rem; }
.invoice-grand-total strong { font-size: 1.55rem; }
.invoice-actions { display: flex; gap: .75rem; justify-content: flex-end; padding-top: 1.25rem; }

@media (max-width: 767.98px) {
  .invoice-heading { flex-direction: column; }
  .invoice-meta label { grid-template-columns: 1fr; }
  .invoice-lines-wrap { overflow-x: auto; }
  .invoice-lines-table { min-width: 850px; }
}

[data-theme="dark"] {
  --ink: #fff7ea;
  --muted: #c9b9a6;
  --soft: #211812;
  --line: #3a2a1f;
  --sidebar: #17110d;
  --surface: #211812;
  --surface-alt: #2b1f16;
  --shadow: rgba(0, 0, 0, 0.28);
  --topbar: rgba(23, 17, 13, 0.92);
  --corporate: #f8fafc;
  --corporate-soft: #2f241b;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dashboard-page {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
}

[data-theme="dark"] body,
[data-theme="dark"] .dashboard-page {
  background: linear-gradient(180deg, #130e0a 0%, #211812 100%);
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 15% 18%, rgba(247, 200, 75, 0.28), transparent 32%),
    radial-gradient(circle at 82% 14%, rgba(76, 143, 23, 0.12), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #fff7ea 52%, #fefcf6 100%);
}

[data-theme="dark"] .auth-page {
  background:
    radial-gradient(circle at 15% 18%, rgba(247, 200, 75, 0.16), transparent 32%),
    radial-gradient(circle at 82% 14%, rgba(76, 143, 23, 0.18), transparent 28%),
    linear-gradient(135deg, #130e0a 0%, #211812 54%, #151f0f 100%);
}

.auth-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 34px;
  align-items: center;
}

.auth-brand {
  color: var(--ink);
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(245, 130, 32, 0.14);
}

[data-theme="dark"] .brand-logo {
  background: #fff;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
}

.brand-logo-lg {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  padding: 6px;
}

.auth-brand h1 {
  max-width: 650px;
  margin: 22px 0 16px;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.brand-copy {
  max-width: 560px;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow,
.section-kicker {
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
}

.auth-brand .eyebrow {
  color: var(--green);
  margin-top: 22px;
}

.auth-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.auth-highlights span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(245, 130, 32, 0.09);
  font-size: 0.9rem;
}

.auth-card .card {
  border-radius: 24px;
  border: 1px solid var(--line) !important;
  background: var(--surface);
  color: var(--ink);
}

.form-control,
.input-group-text,
.btn {
  border-radius: 12px;
}

.form-control,
.form-select,
.input-group-text {
  background-color: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--surface);
  color: var(--ink);
  border-color: var(--brand);
  box-shadow: 0 0 0 0.25rem rgba(245, 130, 32, 0.18);
}

.form-control::placeholder {
  color: var(--muted);
}

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

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-dark);
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar);
  color: var(--ink);
  padding: 22px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 38px rgba(36, 52, 71, 0.05);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand small {
  color: var(--muted);
  font-size: 0.74rem;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 11px 14px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--brand-dark);
}

.sidebar-group {
  display: grid;
  gap: 6px;
}

.sidebar-group-toggle {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.sidebar-group-toggle span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.sidebar-group-toggle:hover,
.sidebar-group.active .sidebar-group-toggle {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--brand-dark);
}

.sidebar-group-caret {
  font-size: 0.72rem;
  transition: transform 0.2s;
}

.sidebar-group-toggle:not(.collapsed) .sidebar-group-caret {
  transform: rotate(180deg);
}

.sidebar-subnav {
  padding-left: 14px;
}

.sidebar-subnav a {
  min-height: 40px;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-weight: 400;
}

.main-panel {
  min-width: 0;
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.user-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

.icon-button {
  width: 46px;
  height: 46px;
  min-width: 46px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: 0 12px 28px var(--shadow);
}

.icon-button:hover {
  border-color: rgba(245, 130, 32, 0.48);
  color: var(--brand-dark);
  transform: translateY(-1px);
}

.theme-toggle {
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.auth-theme-toggle {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 10;
}

.avatar {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--yellow));
  color: #fff;
  font-weight: 800;
}

.notification-button {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  border: 2px solid var(--surface);
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
}

.notification-menu {
  width: min(380px, calc(100vw - 32px));
  padding: 10px;
}

.notification-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 12px;
  border-bottom: 1px solid var(--line);
}

.notification-menu-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.notification-item {
  display: flex;
  gap: 10px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}

.notification-item > i {
  margin-top: 4px;
  color: var(--muted);
}

.notification-item.unread > i,
.notification-item.unread strong {
  color: var(--brand-dark);
}

.notification-item strong,
.notification-item p,
.notification-item small {
  display: block;
}

.notification-item p {
  margin: 3px 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.notification-item small {
  color: var(--muted);
  font-size: 0.72rem;
}

.notification-empty {
  padding: 18px 10px;
  color: var(--muted);
  text-align: center;
}

.notification-more {
  margin-top: 8px;
  border-radius: 8px;
  font-weight: 800;
  text-align: center;
}

.content-wrap {
  padding: 28px;
}

/* Dashboard components below are intentionally generic for client-specific reuse. */
.metric-card,
.panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 16px 36px var(--shadow);
}

.metric-card {
  min-height: 190px;
}

.report-stat-card {
  position: relative;
  height: 100%;
  min-height: 168px;
  overflow: hidden;
  border-right: 5px solid var(--brand);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-right-color 0.2s ease;
}

.report-stat-card:hover {
  transform: translateY(-5px);
  border-right-color: var(--green);
  box-shadow: 0 22px 44px rgba(36, 52, 71, 0.16);
}

.report-filter-panel {
  border-right: 5px solid var(--brand);
}

.report-preset-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dynamic-report-chart {
  position: relative;
  height: 390px;
}

.storage-cabinet-list {
  display: grid;
  gap: 28px;
}

.storage-cabinet {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 42px var(--shadow);
}

.storage-cabinet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 4px solid var(--cabinet-accent);
  background: var(--surface-alt);
}

.storage-cabinet-head p,
.storage-cabinet-note {
  color: var(--muted);
  font-size: 0.86rem;
}

.cabinet-code {
  min-width: 64px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--cabinet-accent);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-align: center;
  box-shadow: 0 8px 18px rgba(36, 52, 71, 0.15);
}

.storage-cabinet-note {
  margin: 0;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.cabinet-scroll {
  overflow-x: auto;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(36, 52, 71, 0.04) 25%, transparent 25%) 0 0 / 18px 18px,
    var(--surface-alt);
}

.cabinet-frame {
  min-width: max-content;
  padding: 14px;
  border: 8px solid #5d4636;
  border-radius: 8px;
  background: linear-gradient(90deg, #6d503b, #8a684e 48%, #624834);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.12),
    0 16px 32px rgba(36, 30, 24, 0.2);
}

.cabinet-shelf-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 8px 8px 14px;
  border-bottom: 10px solid #4e392b;
  background: linear-gradient(180deg, #86664e, #684c39);
}

.cabinet-shelf-row + .cabinet-shelf-row {
  padding-top: 14px;
}

.cabinet-shelf-row:last-child {
  border-bottom: 0;
  padding-bottom: 8px;
}

.shelf-row-label {
  width: 72px;
  min-width: 72px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 7px;
  background: rgba(30, 22, 17, 0.72);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.cabinet-slot-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--cabinet-columns), minmax(135px, 1fr));
  gap: 9px;
}

.cabinet-slot {
  position: relative;
  min-height: 142px;
  padding: 12px;
  overflow: hidden;
  border: 2px solid rgba(93, 70, 54, 0.42);
  border-radius: 7px;
  background: #f8f5ef;
  color: #252019;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cabinet-slot:hover {
  z-index: 2;
  transform: translateY(-3px);
  border-color: var(--cabinet-accent);
  box-shadow: 0 12px 24px rgba(36, 30, 24, 0.24);
}

.cabinet-slot.occupied {
  border-top: 5px solid var(--cabinet-accent);
  background: linear-gradient(145deg, #fff 0%, #f5f1e9 100%);
}

.cabinet-slot.empty {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.7);
}

.slot-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #766a60;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.slot-item {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding-right: 28px;
}

.slot-item strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.slot-item small {
  color: #81766d;
  font-size: 0.72rem;
}

.slot-item > span:last-child {
  margin-top: 5px;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.slot-box-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 8px;
  background: rgba(245, 130, 32, 0.13);
  color: var(--brand-dark);
}

.slot-empty-state {
  min-height: 100px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: #978b80;
  font-size: 0.76rem;
}

.slot-empty-state i {
  font-size: 1.15rem;
}

.slot-action {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 8px;
}

.storage-slot-focus {
  outline: 4px solid var(--yellow);
  outline-offset: 2px;
  animation: storage-pulse 1.4s ease-in-out 2;
}

@keyframes storage-pulse {
  50% { box-shadow: 0 0 0 10px rgba(247, 200, 75, 0.28); }
}

.storage-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
}

.storage-empty > i {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--corporate-soft);
  color: var(--brand);
  font-size: 1.7rem;
}

.storage-empty p {
  max-width: 560px;
  color: var(--muted);
}

.costing-method-grid {
  display: grid;
  gap: 12px;
}

.costing-method-option {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: start;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface-alt);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.costing-method-option:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 12px 24px var(--shadow);
}

.costing-method-option:has(input:checked) {
  border-color: var(--brand);
  background: linear-gradient(135deg, rgba(245, 130, 32, 0.1), var(--surface));
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.1);
}

.costing-method-option input {
  position: absolute;
  top: 14px;
  right: 14px;
  accent-color: var(--brand);
}

.costing-method-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(245, 130, 32, 0.13);
  color: var(--brand-dark);
}

.costing-method-option > span:last-child {
  display: grid;
  gap: 5px;
  padding-right: 18px;
}

.costing-method-option strong,
.costing-method-option small,
.costing-method-option em {
  display: block;
}

.costing-method-option small {
  color: var(--muted);
  line-height: 1.45;
}

.costing-method-option em {
  color: var(--green-dark);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 700;
}

[data-theme="dark"] .report-stat-card:hover {
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.34);
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--line);
}

.dropdown-menu {
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-color: var(--ink);
  --bs-dropdown-link-color: var(--ink);
  --bs-dropdown-link-hover-bg: var(--soft);
  --bs-dropdown-link-hover-color: var(--brand-dark);
  --bs-dropdown-border-color: var(--line);
}

.text-primary,
.text-info {
  color: var(--brand) !important;
}

.text-success {
  color: var(--green) !important;
}

.bg-primary-subtle,
.bg-info-subtle {
  background-color: rgba(245, 130, 32, 0.13) !important;
}

.bg-success-subtle {
  background-color: rgba(76, 143, 23, 0.13) !important;
}

.bg-warning-subtle {
  background-color: rgba(247, 200, 75, 0.2) !important;
}

.text-bg-primary {
  background-color: var(--brand) !important;
}

.text-bg-success {
  background-color: var(--green) !important;
}

.metric-icon {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
}

.metric-card p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.metric-card h3 {
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.cycle-stat {
  height: 100%;
  min-height: 172px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-alt);
}

.cycle-stat span {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--line);
}

[data-theme="dark"] .cycle-stat span {
  background: var(--surface);
}

.cycle-stat p,
.cycle-stat small {
  margin: 0;
  color: var(--muted);
}

.cycle-stat p {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cycle-stat strong {
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1;
}

/* Dashboard carousel teaches core inventory benefits before the live statistics. */
.benefit-carousel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 42px var(--shadow);
}

.benefit-carousel .carousel-item {
  min-height: 360px;
  background: var(--corporate);
}

.benefit-carousel img {
  height: 360px;
  object-fit: cover;
}

.benefit-carousel.image-carousel .carousel-item {
  background: #ff8a00;
}

.benefit-carousel.image-carousel img {
  height: clamp(360px, 42vw, 620px);
  object-fit: contain;
}

.benefit-carousel .carousel-caption {
  right: auto;
  bottom: 32px;
  left: 32px;
  max-width: min(560px, calc(100% - 64px));
  padding: 0;
  text-align: left;
}

.benefit-carousel .carousel-caption h2 {
  margin: 6px 0 10px;
  color: #fff;
  font-size: clamp(1.7rem, 3vw, 3rem);
  font-weight: 800;
  letter-spacing: 0;
}

.benefit-carousel .carousel-caption p {
  max-width: 520px;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1rem;
}

.benefit-carousel .carousel-caption .section-kicker {
  color: var(--yellow);
}

.benefit-carousel .carousel-control-prev,
.benefit-carousel .carousel-control-next {
  width: 56px;
}

.benefit-carousel .carousel-indicators {
  margin-bottom: 16px;
}

.benefit-carousel .carousel-indicators [data-bs-target] {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 50%;
}

.benefit-modal .modal-dialog {
  max-width: min(1180px, calc(100vw - 36px));
}

.benefit-modal .modal-content {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.benefit-modal .modal-body {
  padding: 0;
  background: #ff8a00;
}

.modal-image-carousel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.modal-image-carousel .carousel-item {
  background: #ff8a00;
}

.modal-image-carousel img {
  max-height: calc(100vh - 190px);
  object-fit: contain;
}

.modal-image-carousel .carousel-control-prev,
.modal-image-carousel .carousel-control-next {
  width: 64px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.28), transparent);
}

.modal-image-carousel .carousel-control-next {
  background: linear-gradient(270deg, rgba(0, 0, 0, 0.28), transparent);
}

.chart-panel {
  min-height: 354px;
}

.dashboard-bars {
  display: grid;
  gap: 14px;
}

.dashboard-bar-row {
  display: grid;
  gap: 8px;
}

.dashboard-bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.dashboard-bar-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-bar-meta strong {
  flex: 0 0 auto;
  color: var(--ink);
}

.dashboard-bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.dashboard-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--green));
}

.dashboard-bars.vertical {
  min-height: 240px;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  align-items: end;
  gap: 12px;
  padding-top: 8px;
}

.dashboard-bars.vertical .dashboard-bar-row {
  min-height: 230px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
}

.dashboard-bars.vertical .dashboard-bar-track {
  width: 100%;
  height: 170px;
  display: flex;
  align-items: end;
  border-radius: 10px;
}

.dashboard-bars.vertical .dashboard-bar-track span {
  width: 100% !important;
}

.dashboard-bars.vertical .dashboard-bar-meta {
  min-height: 48px;
  display: grid;
  justify-items: center;
  text-align: center;
}

.dashboard-bars.vertical .dashboard-bar-meta span {
  max-width: 100%;
  white-space: normal;
}

.dashboard-donut-wrap {
  min-height: 250px;
  display: grid;
  place-items: center;
  gap: 18px;
}

.dashboard-donut {
  width: 168px;
  height: 168px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  background:
    conic-gradient(var(--green) 0 calc(var(--healthy-stock) * 1%), var(--brand) 0 100%);
}

.dashboard-donut::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
}

.dashboard-donut span,
.dashboard-donut small {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
}

.dashboard-donut span {
  align-self: end;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.dashboard-donut small {
  align-self: start;
  color: var(--muted);
  font-size: 0.78rem;
}

.dashboard-legend {
  width: 100%;
  display: grid;
  gap: 8px;
}

.dashboard-legend span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
}

.legend-dot.green {
  background: var(--green);
}

.legend-dot.orange {
  background: var(--brand);
}

.dashboard-empty-graph {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-alt);
}

.store-page {
  min-height: 100vh;
  color: var(--ink);
  background: var(--soft);
}

.store-header {
  color: #fff;
  background: linear-gradient(135deg, var(--corporate) 0%, var(--brand-dark) 100%);
}

.store-nav,
.store-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.store-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
}

.store-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.store-brand:hover {
  color: #fff;
}

.store-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}

.store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.store-hero {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 54px 0 70px;
}

.store-hero span,
.store-section-head span,
.product-category {
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.store-hero h1 {
  max-width: 760px;
  margin: 10px 0 14px;
  color: #fff;
  font-size: clamp(2rem, 5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: 0;
}

.store-hero p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
}

.store-shell {
  padding: 30px 0 54px;
}

.store-category-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -56px 0 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 16px 36px var(--shadow);
}

.store-category-strip a {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.store-category-strip a.active,
.store-category-strip a:hover {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.store-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

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

.store-section-head h2,
.cart-panel h2 {
  margin: 4px 0 0;
  font-weight: 800;
  letter-spacing: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.product-card,
.cart-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 16px 36px var(--shadow);
}

.product-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 20px;
}

.product-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--brand);
  background: var(--surface-alt);
}

.product-category {
  color: var(--brand-dark);
}

.product-card h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.product-card p {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.product-meta strong {
  color: var(--ink);
}

.product-cart-form {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
}

.cart-panel {
  position: sticky;
  top: 24px;
  padding: 20px;
}

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px auto;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin: 16px 0;
  font-size: 1.1rem;
}

.checkout-form {
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.checkout-form h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.store-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
  background: var(--surface);
}

.metric-status {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--corporate-soft);
  color: var(--corporate);
  font-weight: 800;
  line-height: 1;
}

.metric-status.positive {
  background: rgba(76, 143, 23, 0.12);
  color: var(--green);
}

.metric-status.review {
  background: rgba(247, 200, 75, 0.2);
  color: #8a5d00;
}

.priority-list p {
  color: var(--muted);
}

.table > :not(caption) > * > * {
  padding: 16px 12px;
}

.priority-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-item,
.priority-list li {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.task-item:last-child,
.priority-list li:last-child {
  border-bottom: 0;
}

.task-item p,
.priority-list p {
  margin: 4px 0 0;
  font-size: 0.88rem;
}

.corporate-table thead th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom-width: 1px;
}

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

.table-search {
  width: min(360px, 100%);
}

.table-search .input-group-text {
  color: var(--muted);
}

.table-pagination {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.page-link {
  color: var(--brand-dark);
  background: var(--surface);
  border-color: var(--line);
}

.page-item.active .page-link {
  background: var(--brand);
  border-color: var(--brand);
}

.handoff-card {
  display: grid;
  justify-items: start;
  gap: 14px;
  min-height: 100%;
}

.progress-ring {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface) 0 56%, transparent 57%),
    conic-gradient(var(--green) 0 92%, var(--line) 92% 100%);
}

.progress-ring span {
  color: var(--ink);
  font-size: 1.8rem;
  font-weight: 800;
}

.credential-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(76, 143, 23, 0.13), rgba(247, 200, 75, 0.18));
  border: 1px solid var(--line);
}

.permission-grid {
  display: grid;
  gap: 8px;
}

.permission-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.5fr) repeat(4, minmax(62px, 0.5fr));
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-alt);
}

.permission-head {
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.check-cell {
  display: grid;
  place-items: center;
  min-height: 28px;
}

.check-cell input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

@media (max-width: 991px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

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

  .cart-panel {
    position: static;
  }

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .content-wrap,
  .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }

}

@media (max-width: 575px) {
  .auth-page {
    padding: 18px;
  }

  .store-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .store-actions {
    width: 100%;
  }

  .store-actions .btn {
    flex: 1 1 auto;
  }

  .store-hero {
    padding: 34px 0 64px;
  }

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

  .cart-line {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

  .auth-card .card-body,
  .content-wrap {
    padding: 18px;
  }

  .dynamic-report-chart {
    height: 320px;
  }

  .storage-cabinet-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .cabinet-scroll {
    padding: 12px;
  }

  .shelf-row-label {
    width: 54px;
    min-width: 54px;
  }

  .benefit-carousel img,
  .benefit-carousel .carousel-item {
    height: 390px;
  }

  .benefit-carousel .carousel-caption {
    bottom: 44px;
    left: 22px;
    max-width: calc(100% - 44px);
  }
}
