:root {
  color-scheme: dark;
  --background: #07090d;
  --background-raised: #090d13;
  --sidebar: #080b10;
  --surface: #0d121a;
  --surface-raised: #111822;
  --surface-soft: #151e2b;
  --surface-hover: #182230;
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #f3f5f8;
  --text-secondary: #a8b0bf;
  --text-muted: #707b8e;
  --gold: #c9a86a;
  --gold-light: #e4c788;
  --gold-soft: rgba(201, 168, 106, 0.13);
  --green: #58d29b;
  --green-soft: rgba(88, 210, 155, 0.12);
  --cyan: #64cfda;
  --cyan-soft: rgba(100, 207, 218, 0.12);
  --amber: #efb458;
  --amber-soft: rgba(239, 180, 88, 0.12);
  --red: #ff717c;
  --red-soft: rgba(255, 113, 124, 0.12);
  --purple: #a28bfa;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
  --sidebar-width: 264px;
  --topbar-height: 72px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 72% -10%, rgba(201, 168, 106, 0.08), transparent 31rem),
    var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button,
input,
select {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}

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

svg {
  display: block;
}

.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;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: rgba(8, 11, 16, 0.96);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(201, 168, 106, 0.35);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(201, 168, 106, 0.18), rgba(201, 168, 106, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-mark svg {
  width: 21px;
  fill: var(--gold-light);
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  letter-spacing: 0.18em;
}

.brand small {
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.main-nav {
  flex: 1;
  padding: 24px 14px;
  overflow-y: auto;
}

.nav-label {
  display: block;
  margin: 0 12px 9px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-label-secondary {
  margin-top: 28px;
}

.nav-item {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  margin: 3px 0;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: 160ms ease;
}

.nav-item:hover {
  background: var(--surface-raised);
  color: var(--text);
}

.nav-item.active {
  border-color: rgba(201, 168, 106, 0.16);
  background: linear-gradient(90deg, rgba(201, 168, 106, 0.14), rgba(201, 168, 106, 0.035));
  color: var(--gold-light);
}

.nav-item.active::before {
  position: absolute;
  left: -15px;
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
  content: "";
  box-shadow: 0 0 18px rgba(201, 168, 106, 0.45);
}

.nav-item svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-light);
  font-size: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
}

.status-dot.warning {
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}

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

.support-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.support-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--gold-soft);
  color: var(--gold-light);
  font-size: 9px;
  font-weight: 800;
}

.support-card > div {
  min-width: 0;
  flex: 1;
}

.support-card strong,
.account strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-card p {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 9px;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 4px;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(100, 207, 218, 0.18);
  border-radius: 50%;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
}

.account-copy {
  min-width: 0;
  flex: 1;
}

.account-copy small {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 9, 13, 0.82);
  backdrop-filter: blur(22px);
}

.topbar-left,
.topbar-actions,
.breadcrumb,
.live-status,
.heading-actions,
.panel-header,
.chart-toolbar,
.chart-legend,
.order-controls {
  display: flex;
  align-items: center;
}

.breadcrumb {
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.breadcrumb svg {
  width: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.breadcrumb strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.topbar-actions {
  gap: 16px;
}

.global-search {
  display: flex;
  width: min(320px, 30vw);
  height: 38px;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 160ms ease, background 160ms ease;
}

.global-search:focus-within {
  border-color: rgba(201, 168, 106, 0.5);
  background: var(--surface-raised);
}

.global-search svg {
  width: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--text-muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.global-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.global-search input::placeholder {
  color: var(--text-muted);
}

.global-search kbd {
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 9px;
  white-space: nowrap;
}

.live-status {
  gap: 9px;
  padding-left: 4px;
}

.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.pulse-dot::after {
  position: absolute;
  inset: -4px;
  border: 1px solid var(--green);
  border-radius: 50%;
  content: "";
  opacity: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.7;
    transform: scale(0.5);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.3);
  }
}

.live-status strong,
.live-status small {
  display: block;
  white-space: nowrap;
}

.live-status strong {
  font-size: 10px;
  font-weight: 700;
}

.live-status small {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 9px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: 160ms ease;
}

.icon-button:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.icon-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.icon-button.compact {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
}

.icon-button.compact svg {
  width: 15px;
}

.notification-button {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border: 1px solid var(--surface);
  border-radius: 50%;
  background: var(--red);
}

.mobile-menu,
.mobile-backdrop {
  display: none;
}

.dashboard {
  max-width: 1640px;
  margin: 0 auto;
  padding: 34px 32px 54px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow,
.panel-kicker {
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.page-heading h1 {
  margin: 6px 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.page-heading p,
.panel-header p,
.dialog-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.heading-actions {
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.button.primary {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #171109;
  box-shadow: 0 10px 28px rgba(201, 168, 106, 0.15);
}

.button.primary:hover {
  background: linear-gradient(135deg, #efd69d, var(--gold-light));
}

.button.secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-secondary);
}

.button.secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
  color: var(--text);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card,
.panel {
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.018), transparent 35%),
    var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025);
}

.metric-card {
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius-md);
}

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

.metric-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
}

.metric-icon svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.metric-icon.gold {
  background: var(--gold-soft);
  color: var(--gold-light);
}

.metric-icon.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.metric-icon.cyan {
  background: var(--cyan-soft);
  color: var(--cyan);
}

.metric-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.metric-change {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.metric-change.positive {
  background: var(--green-soft);
  color: var(--green);
}

.metric-change.warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.metric-change.neutral {
  background: var(--cyan-soft);
  color: var(--cyan);
}

.metric-label,
.metric-context {
  display: block;
}

.metric-label {
  margin-bottom: 5px;
  color: var(--text-secondary);
  font-size: 11px;
}

.metric-value {
  display: block;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-value.date-value {
  font-size: 25px;
}

.metric-context {
  overflow: hidden;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 14px;
}

.panel {
  min-width: 0;
  border-radius: var(--radius-lg);
}

.inventory-panel,
.trend-panel {
  padding: 21px;
}

.panel-header {
  justify-content: space-between;
  gap: 20px;
}

.panel-header h2,
.dialog-header h2 {
  margin: 3px 0 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 500;
}

.segmented-control,
.range-control {
  display: flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--background-raised);
}

.segmented-control button,
.range-control button {
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  transition: 150ms ease;
}

.segmented-control button:hover,
.range-control button:hover {
  color: var(--text);
}

.segmented-control button.active,
.range-control button.active {
  background: var(--surface-soft);
  color: var(--gold-light);
  box-shadow: inset 0 0 0 1px var(--border);
}

.stock-list {
  display: grid;
  gap: 11px;
  margin-top: 20px;
}

.stock-item {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.014);
  transition: border-color 160ms ease, background 160ms ease;
}

.stock-item:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.026);
}

.stock-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--gold-light);
}

.product-icon svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.stock-name {
  min-width: 0;
  flex: 1;
}

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

.stock-name strong {
  font-size: 11px;
}

.stock-name small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
}

.stock-quantity {
  text-align: right;
}

.stock-quantity strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 500;
}

.stock-quantity small {
  display: block;
  color: var(--text-muted);
  font-size: 8px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
}

.progress-track {
  height: 6px;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  box-shadow: 0 0 12px rgba(201, 168, 106, 0.24);
  transition: width 500ms ease;
}

.progress-fill.low {
  background: linear-gradient(90deg, #de934b, var(--amber));
  box-shadow: 0 0 12px rgba(239, 180, 88, 0.2);
}

.progress-fill.critical {
  background: linear-gradient(90deg, #df5663, var(--red));
  box-shadow: 0 0 12px rgba(255, 113, 124, 0.22);
}

.stock-status {
  min-width: 58px;
  font-size: 9px;
  font-weight: 700;
  text-align: right;
}

.stock-status.healthy {
  color: var(--green);
}

.stock-status.low {
  color: var(--amber);
}

.stock-status.critical {
  color: var(--red);
}

.empty-state {
  padding: 48px 20px;
  color: var(--text-muted);
  text-align: center;
}

.chart-summary {
  text-align: right;
}

.chart-summary strong,
.chart-summary span {
  display: block;
}

.chart-summary strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 500;
}

.chart-summary span {
  color: var(--text-muted);
  font-size: 9px;
}

.chart-toolbar {
  justify-content: space-between;
  gap: 12px;
  margin-top: 21px;
}

.chart-legend {
  flex-wrap: wrap;
  gap: 13px;
  color: var(--text-muted);
  font-size: 8px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-line,
.legend-target {
  display: inline-block;
  width: 17px;
  height: 2px;
}

.legend-line {
  background: var(--gold-light);
}

.legend-target {
  border-top: 1px dashed var(--text-muted);
}

.chart-wrap {
  margin-top: 8px;
}

#inventoryChart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  stroke: rgba(255, 255, 255, 0.055);
  stroke-width: 1;
}

.chart-axis-label {
  fill: var(--text-muted);
  font-family: inherit;
  font-size: 9px;
}

.chart-area {
  fill: url("#areaGradient");
}

.chart-line {
  fill: none;
  stroke: var(--gold-light);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  filter: drop-shadow(0 4px 8px rgba(201, 168, 106, 0.18));
}

.chart-target {
  stroke: var(--text-muted);
  stroke-dasharray: 5 6;
  stroke-width: 1;
}

.chart-dot {
  fill: var(--surface);
  stroke: var(--gold-light);
  stroke-width: 2;
}

.orders-panel {
  grid-column: 1 / -1;
  overflow: hidden;
}

.orders-header {
  padding: 21px 21px 17px;
}

.order-controls {
  gap: 12px;
}

.order-controls select,
.field input,
.field select {
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: 0;
  background: var(--surface-soft);
  color: var(--text-secondary);
}

.order-controls select {
  height: 34px;
  padding: 0 30px 0 10px;
  font-size: 9px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--gold-light);
  font-size: 10px;
  font-weight: 700;
}

.text-button svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.table-scroll {
  overflow-x: auto;
  border-top: 1px solid var(--border);
}

table {
  width: 100%;
  min-width: 950px;
  border-collapse: collapse;
}

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

th {
  background: rgba(255, 255, 255, 0.012);
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

td {
  color: var(--text-secondary);
  font-size: 10px;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.018);
}

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

.order-id {
  color: var(--text);
  font-weight: 700;
}

.vendor-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.vendor-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--gold-light);
  font-size: 8px;
  font-weight: 800;
}

.vendor-cell strong,
.vendor-cell small {
  display: block;
}

.vendor-cell strong {
  color: var(--text);
  font-size: 10px;
}

.vendor-cell small {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 8px;
}

.order-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
}

.order-status::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.order-status.in-transit {
  background: var(--cyan-soft);
  color: var(--cyan);
}

.order-status.processing {
  background: var(--gold-soft);
  color: var(--gold-light);
}

.order-status.delivered {
  background: var(--green-soft);
  color: var(--green);
}

.order-status.action-needed {
  background: var(--red-soft);
  color: var(--red);
}

.amount-column {
  text-align: right;
}

.row-menu {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
}

.row-menu:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.order-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
}

.order-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.order-dialog form {
  padding: 24px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

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

.field {
  display: grid;
  gap: 7px;
}

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

.field > span {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
}

.field input:focus,
.field select:focus,
.order-controls select:focus {
  border-color: rgba(201, 168, 106, 0.55);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.toast-region {
  position: fixed;
  top: 88px;
  right: 20px;
  z-index: 100;
  display: grid;
  width: min(360px, calc(100% - 40px));
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(17, 24, 34, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: toast-in 220ms ease both;
}

.toast.leaving {
  animation: toast-out 180ms ease both;
}

.toast-icon {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  font-size: 10px;
}

.toast span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}

.is-refreshing svg {
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

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

  .orders-panel {
    grid-column: auto;
  }

  .global-search {
    width: 260px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }

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

  .mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    border: 0;
    background: rgba(0, 0, 0, 0.6);
  }

  .mobile-backdrop.visible {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu {
    display: grid;
  }

  .topbar-left {
    gap: 12px;
  }

  .live-status {
    display: none;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 0 16px;
  }

  .breadcrumb {
    display: none;
  }

  .global-search {
    width: min(60vw, 270px);
  }

  .global-search kbd,
  .notification-button {
    display: none;
  }

  .dashboard {
    padding: 25px 16px 40px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .heading-actions {
    width: 100%;
  }

  .heading-actions .button {
    flex: 1;
  }

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

  .panel-header,
  .orders-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented-control {
    width: 100%;
    overflow-x: auto;
  }

  .segmented-control button {
    flex: 1;
  }

  .chart-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-controls {
    width: 100%;
    justify-content: space-between;
  }

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

  .field.full {
    grid-column: auto;
  }
}

@media (max-width: 430px) {
  .topbar-actions {
    flex: 1;
  }

  .global-search {
    width: 100%;
  }

  .page-heading h1 {
    font-size: 30px;
  }

  .heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .stock-row {
    align-items: flex-start;
  }

  .stock-quantity {
    margin-left: auto;
  }

  .order-dialog form {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
