:root {
  --bg: #f4f7fb;
  --bg-soft: #ffffff;
  --text: #0f172a;
  --muted: #667085;
  --line: #e5e7eb;
  --primary: #0f172a;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --success: #059669;
  --warning: #d97706;
  --danger: #b45309;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

body.dark {
  --bg: #081120;
  --bg-soft: #0f1b31;
  --text: #eef4ff;
  --muted: #9fb0cb;
  --line: rgba(255,255,255,.09);
  --primary: #eef4ff;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, .12);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fdba74;
  --shadow: 0 20px 45px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(14,165,233,.08), transparent 24%),
    var(--bg);
  color: var(--text);
}

a { text-decoration: none; color: inherit; }
button, input { font: inherit; }

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

.sidebar {
  background: linear-gradient(180deg, #09111f, #0d1830);
  color: white;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #60a5fa, #22c55e);
  color: white;
  font-weight: 800;
}
.brand small { color: rgba(255,255,255,.6); display: block; margin-bottom: 4px; }
.brand h1 { font-size: 1.25rem; margin: 0; }

.menu { display: grid; gap: 8px; }
.menu-item {
  padding: 14px 16px;
  border-radius: 16px;
  color: rgba(255,255,255,.82);
  transition: .25s ease;
}
.menu-item:hover,
.menu-item.active {
  background: rgba(255,255,255,.12);
  color: white;
}

.sidebar-card {
  margin-top: auto;
  background: linear-gradient(135deg, rgba(96,165,250,.92), rgba(34,197,94,.92));
  border-radius: 26px;
  padding: 20px;
  color: #081120;
  box-shadow: var(--shadow);
}
.sidebar-card p,
.sidebar-card span { margin: 0; display: block; }
.sidebar-card strong { font-size: 2rem; display: block; margin: 8px 0; }
.sidebar-card span { line-height: 1.6; opacity: .88; }
.sidebar-card button {
  margin-top: 16px;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: rgba(8,17,32,.88);
  color: white;
  cursor: pointer;
}

.main-content { padding: 28px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}
.topbar h2 { margin: 6px 0 0; font-size: 1.9rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  color: var(--muted);
  margin: 0;
}
.topbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.search-box input {
  width: 290px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
}
.ghost-btn,
.primary-btn,
.actions-grid button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  transition: .25s ease;
}
.ghost-btn {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--line);
}
.ghost-btn.small { padding: 10px 14px; border-radius: 12px; }
.primary-btn {
  background: linear-gradient(135deg, var(--accent), #22c55e);
  color: white;
  box-shadow: var(--shadow);
}

.hero,
.panel,
.stat-card {
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.48);
  box-shadow: var(--shadow);
}
body.dark .hero,
body.dark .panel,
body.dark .stat-card {
  background: rgba(15,27,49,.8);
  border-color: rgba(255,255,255,.06);
}

.hero {
  border-radius: 30px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.5fr .7fr;
  gap: 18px;
  align-items: center;
}
.hero h3 { font-size: 2rem; margin: 10px 0; max-width: 700px; }
.hero-text { color: var(--muted); line-height: 1.7; max-width: 780px; }
.hero-badge {
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: white;
  border-radius: 24px;
  padding: 22px;
}
.hero-badge span,
.hero-badge small { display: block; opacity: .8; }
.hero-badge strong { display: block; font-size: 1.7rem; margin: 10px 0; }

.stats-grid,
.content-grid,
.actions-grid {
  display: grid;
  gap: 18px;
}
.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 22px 0;
}
.stat-card {
  border-radius: 24px;
  padding: 22px;
}
.stat-card span,
.stat-card small { color: var(--muted); }
.stat-card strong {
  display: block;
  font-size: 2rem;
  margin: 12px 0 8px;
}

.content-grid {
  grid-template-columns: 1.6fr .9fr;
  margin-bottom: 18px;
}
.lower-grid { grid-template-columns: 1.05fr .95fr; }
.panel {
  border-radius: 28px;
  padding: 24px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.panel-head h3 { margin: 6px 0 0; }
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}
th, td {
  padding: 15px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
th { color: var(--muted); font-weight: 600; }

.status {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
}
.status.process { background: rgba(245,158,11,.14); color: var(--warning); }
.status.packed { background: rgba(59,130,246,.14); color: #2563eb; }
.status.waiting { background: rgba(148,163,184,.16); color: #64748b; }
.status.done { background: rgba(16,185,129,.14); color: var(--success); }

.chart {
  height: 220px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding-top: 10px;
}
.chart div {
  flex: 1;
  border-radius: 18px 18px 6px 6px;
  background: linear-gradient(180deg, #60a5fa, #1d4ed8);
}
.chart-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
}

.product-list,
.activity-list {
  display: grid;
  gap: 14px;
}
.product-item,
.activity-item {
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--accent-soft);
  border: 1px solid rgba(37,99,235,.1);
}
.product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.product-item h4,
.product-item p { margin: 0; }
.product-item p { color: var(--muted); margin-top: 4px; }
.activity-item { line-height: 1.6; }

.actions-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.actions-grid button {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
}
.actions-grid button:hover,
.ghost-btn:hover,
.primary-btn:hover,
.sidebar-card button:hover {
  transform: translateY(-2px);
}

.hamburger {
  display: none;
  margin-right: 12px;
  border: 0;
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 12px;
  width: 42px;
  height: 42px;
  cursor: pointer;
}

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

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -100%;
    width: 300px;
    z-index: 20;
    transition: .3s ease;
  }
  .sidebar.show { left: 0; }
  .main-content { padding: 18px; }
  .hamburger { display: inline-grid; place-items: center; }
  .topbar { flex-direction: column; }
  .search-box input { width: 100%; }
  .topbar-actions { width: 100%; }
  .topbar-actions > * { flex: 1 1 auto; }
}

@media (max-width: 640px) {
  .stats-grid,
  .actions-grid { grid-template-columns: 1fr; }
  .hero h3 { font-size: 1.5rem; }
  .topbar h2 { font-size: 1.4rem; }
}
