﻿:root {
  --blue: #1687f7;
  --blue-soft: #e8f3ff;
  --ink: #182235;
  --muted: #6b7280;
  --line: #e5eaf2;
  --bg: #f4f7fb;
  --card: #ffffff;
  --red: #ef4444;
  --green: #13ce66;
  --amber: #f6b73c;
  --violet: #6d5dfc;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at 84% 4%, rgba(19, 206, 102, 0.16), transparent 30%),
    radial-gradient(circle at 18% -8%, rgba(22, 135, 247, 0.14), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 48%);
  color: var(--ink);
  font-family: Inter, Arial, "Microsoft YaHei", sans-serif;
  margin: 0;
  padding-left: 86px !important;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 950;
  min-height: 44px;
  padding: 10px 15px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary {
  background: linear-gradient(180deg, #168bff 0%, var(--blue) 100%);
  box-shadow: 0 12px 28px rgba(0, 122, 255, 0.22);
  color: #fff;
}

.secondary {
  background: var(--blue-soft);
  color: #0b63ce;
}

.danger {
  background: #fff2f2;
  color: #c5222a;
}

input,
select {
  background: #ffffff;
  border: 1px solid #d8dee8;
  border-radius: 12px;
  color: var(--ink);
  min-height: 44px;
  outline: none;
  padding: 10px 12px;
  width: 100%;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(22, 135, 247, 0.12);
}

.app-sidebar {
  background: rgba(15, 23, 42, 0.86) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 0 28px 28px 0 !important;
  box-shadow: 18px 0 48px rgba(15, 23, 42, 0.18) !important;
  color: #ffffff;
  display: flex !important;
  flex-direction: column;
  gap: 18px;
  height: calc(100vh - 24px) !important;
  left: 12px !important;
  overflow: hidden !important;
  padding: 14px 10px !important;
  position: fixed !important;
  top: 12px !important;
  transition: width 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  width: 62px !important;
  z-index: 1000;
}

.app-sidebar:hover,
.app-sidebar:focus-within {
  background: rgba(15, 23, 42, 0.94) !important;
  box-shadow: 24px 0 70px rgba(15, 23, 42, 0.26) !important;
  width: 226px !important;
}

.app-sidebar a {
  color: inherit;
  text-decoration: none;
}

.app-sidebar-brand,
.app-nav-item {
  align-items: center;
  border-radius: 18px;
  display: grid !important;
  gap: 12px !important;
  grid-template-columns: 40px 1fr !important;
  min-height: 48px !important;
  padding: 4px !important;
  white-space: nowrap;
}

.app-sidebar-logo,
.app-nav-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 14px !important;
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 40px !important;
  font-size: 16px !important;
  font-weight: 950;
  height: 40px !important;
  justify-content: center;
  width: 40px !important;
}

.app-sidebar-logo {
  background: linear-gradient(145deg, #fff174 0%, #ffd60a 58%, #ffc400 100%);
  color: #101827;
}

.app-sidebar-title,
.app-nav-label {
  min-width: 140px !important;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-sidebar:hover .app-sidebar-title,
.app-sidebar:hover .app-nav-label,
.app-sidebar:focus-within .app-sidebar-title,
.app-sidebar:focus-within .app-nav-label {
  opacity: 1;
  transform: translateX(0);
}

.app-sidebar-title strong,
.app-nav-label {
  display: block;
  font-size: 15px !important;
  font-weight: 950;
}

.app-sidebar-title small {
  color: rgba(255, 255, 255, 0.62);
  display: block;
  font-size: 12px !important;
  margin-top: 2px;
}

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

.app-nav-item.active {
  background: linear-gradient(135deg, #13ce66, #1687f7);
  color: #ffffff !important;
  box-shadow: 0 14px 30px rgba(19, 206, 102, 0.24);
}

.page-wrapper {
  margin-left: 0 !important;
  max-width: 1440px !important;
  padding: 36px 22px 64px !important;
}

.hero {
  align-items: center;
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, #0f5132, #13ce66 56%, #1687f7);
  border-radius: 22px;
  box-shadow: 0 14px 28px rgba(19, 206, 102, 0.22);
  color: #fff;
  display: flex;
  font-size: 24px;
  font-weight: 950;
  height: 58px;
  justify-content: center;
  width: 58px;
}

.hero-copy {
  min-width: 0;
}

.hero h1 {
  font-size: clamp(32px, 4vw, 46px);
  line-height: 0.98;
  margin: 3px 0;
}

.hero p,
.status,
.eyebrow {
  color: var(--muted);
  margin: 0;
}

.eyebrow {
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.inventory-store-badge {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 4px;
  margin-left: auto;
  min-width: 300px;
  padding: 9px 12px;
}

.inventory-store-badge span {
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.inventory-command-panel,
.panel,
.metric-card,
.chart-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.2);
}

.inventory-command-panel {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.3fr);
  padding: 18px;
}

.command-main {
  display: grid;
  gap: 10px;
}

.main-action {
  font-size: 17px;
  min-height: 52px;
  width: fit-content;
}

.command-tools {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) 150px 86px 86px;
}

.status {
  font-size: 13px;
  line-height: 1.45;
}

.error-text {
  color: #c5222a !important;
}

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

.metric-card {
  display: grid;
  gap: 6px;
  min-height: 116px;
  padding: 18px;
}

.metric-card span {
  color: #64748b;
  font-size: 13px;
  font-weight: 950;
}

.metric-card strong {
  font-size: 34px;
  line-height: 1.05;
}

.metric-card small {
  color: #7c8799;
  font-weight: 800;
}

.alert-card strong {
  color: #c5222a;
}

.muted-metric strong {
  color: #475569;
}

.main-inventory-grid {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(360px, 0.78fr) minmax(720px, 1.22fr);
}

.panel,
.chart-card {
  padding: 18px;
}

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

.panel-head h2 {
  font-size: 22px;
  line-height: 1.1;
  margin: 4px 0 0;
}

.restock-cards {
  display: grid;
  gap: 10px;
  max-height: 590px;
  overflow: auto;
}

.restock-card {
  align-items: center;
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  border: 1px solid #e6edf7;
  border-radius: 18px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 14px;
}

.restock-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restock-card small {
  color: var(--muted);
  display: block;
  line-height: 1.45;
  margin-top: 4px;
}

.restock-qty {
  color: #0f766e;
  font-size: 24px;
  font-weight: 950;
  text-align: right;
}

.restock-action {
  color: #0b63ce;
  font-size: 12px;
  font-weight: 950;
  grid-column: 1 / -1;
}

.row-count {
  background: #f4f7fb;
  border-radius: 999px;
  color: #64748b;
  font-size: 13px;
  font-weight: 950;
  padding: 8px 12px;
}

.table-shell {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: auto;
}

.inventory-table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

.inventory-table th,
.inventory-table td {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  padding: 12px 10px;
  text-align: center;
  vertical-align: middle;
}

.inventory-table th {
  background: rgba(244, 247, 251, 0.94);
  color: #475569;
  font-weight: 950;
  position: sticky;
  top: 0;
  z-index: 2;
}

.inventory-table td:nth-child(2) {
  min-width: 260px;
  text-align: left;
}

.sku-cell strong,
.sku-cell small {
  display: block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-cell small {
  color: var(--muted);
  margin-top: 4px;
}

.inventory-table input.inline-number {
  border-radius: 10px;
  min-height: 36px;
  padding: 6px 8px;
  text-align: center;
  width: 76px;
}

.health-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 950;
  justify-content: center;
  min-width: 82px;
  padding: 5px 9px;
}

.health-pill.out,
.health-pill.critical {
  background: #fff2f2;
  color: #c5222a;
}

.health-pill.low {
  background: #fff8e6;
  color: #a76000;
}

.health-pill.healthy {
  background: #ecfff5;
  color: #069650;
}

.health-pill.excess {
  background: #f0edff;
  color: #5b21b6;
}

.health-pill.unknown {
  background: #eef2f7;
  color: #475569;
}

.action-text {
  color: #0b63ce;
  font-weight: 950;
  max-width: 160px;
}

.advanced-panel {
  margin-top: 16px;
}

.advanced-panel summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
}

.advanced-panel summary::-webkit-details-marker {
  display: none;
}

.advanced-panel summary span {
  font-size: 18px;
  font-weight: 950;
}

.advanced-panel summary small {
  color: var(--muted);
  font-weight: 800;
}

.advanced-controls {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) repeat(3, auto);
  margin-top: 18px;
}

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

.field span {
  color: #4b5563;
  font-size: 13px;
  font-weight: 950;
}

.compact-field input {
  text-align: center;
}

.chart-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 0.85fr 1.15fr;
  margin-top: 16px;
}

.chart-wrap {
  height: 260px;
  position: relative;
}

.compact-head h2 {
  font-size: 18px;
}

.empty-state {
  align-content: center;
  color: var(--muted);
  font-weight: 900;
  justify-content: center;
  min-height: 160px;
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 1280px) {
  .inventory-command-panel,
  .main-inventory-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }

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

  .advanced-controls {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }
}

@media (max-width: 900px) {
  body {
    padding-left: 0 !important;
  }

  .app-sidebar {
    border-radius: 0 !important;
    height: auto !important;
    left: 0 !important;
    position: static !important;
    top: 0 !important;
    width: 100% !important;
  }

  .app-sidebar:hover,
  .app-sidebar:focus-within {
    width: 100% !important;
  }

  .app-sidebar-brand,
  .app-nav-label,
  .app-sidebar-title {
    display: none !important;
  }

  .app-sidebar-nav {
    display: flex;
    overflow-x: auto;
  }

  .app-nav-item {
    min-height: 54px !important;
    min-width: 54px;
    padding: 0 !important;
  }

  .app-nav-icon {
    flex-basis: 54px !important;
    height: 54px !important;
    width: 54px !important;
  }

  .page-wrapper {
    padding: 18px 14px 34px !important;
  }

  .hero {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .inventory-store-badge {
    margin-left: 0;
    min-width: 100%;
  }

  .command-tools,
  .metric-grid,
  .advanced-controls {
    grid-template-columns: 1fr;
  }

  .main-action {
    width: 100%;
  }
}
