:root {
  --bg: #0b0f14;
  --surface: #111821;
  --surface-2: #151f2a;
  --surface-3: #1b2734;
  --line: #263342;
  --text: #edf3f8;
  --muted: #92a2b2;
  --accent: #38bdf8;
  --accent-2: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: #081018;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #061017;
  font-weight: 900;
}

.brand p,
.brand h1,
.topbar h2,
.section-header h3,
.panel h4 {
  margin: 0;
}

.brand p,
.eyebrow {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand h1 {
  font-size: 1rem;
}

.nav {
  display: grid;
  gap: 6px;
  margin-bottom: 22px;
}

.nav-item {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

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

.sidebar-card,
.panel,
.status-card,
.service-card,
.summary-pill,
.metric-card,
.employee-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sidebar-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.main {
  min-width: 0;
  padding: 24px;
}

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-card,
.service-card,
.summary-pill {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
}

.status-card {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
}

.status-dot.open {
  background: var(--accent-2);
}

.muted {
  color: var(--muted);
}

.primary-button,
.danger-button,
.icon-button {
  border-radius: 8px;
  cursor: pointer;
  transition: 160ms ease;
}

.primary-button {
  padding: 13px 16px;
  background: var(--accent);
  color: #061017;
  font-weight: 800;
}

.primary-button.active {
  background: var(--danger);
  color: #fff;
}

.danger-button {
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
}

.icon-button {
  width: 34px;
  height: 34px;
  background: var(--surface-3);
  color: var(--text);
}

.primary-button:hover,
.danger-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

.section-header,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.metric-card {
  padding: 16px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric-card strong {
  display: block;
  font-size: 1.7rem;
}

.metric-card small {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
}

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

.panel {
  padding: 16px;
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
}

.badge.ok {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

.badge.warn {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.badge.danger {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.badge.neutral {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.stock-actions {
  display: flex;
  gap: 8px;
}

.stock-row-low {
  background: rgba(245, 158, 11, 0.08);
}

.stock-row-empty {
  background: rgba(239, 68, 68, 0.09);
}

.compact-list,
.stack {
  display: grid;
  gap: 10px;
}

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

.list-row:last-child {
  border-bottom: 0;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  height: 230px;
  align-items: end;
  padding-top: 16px;
}

.bar-item {
  display: grid;
  align-items: end;
  gap: 8px;
  height: 100%;
}

.bar {
  min-height: 6px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.bar-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.employee-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.employee-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.employee-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.employee-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.employee-stat {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-2);
}

.employee-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.settings-list {
  display: grid;
  gap: 14px;
}

.settings-list div {
  display: grid;
  gap: 4px;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .topbar,
  .two-columns {
    grid-template-columns: 1fr;
    display: grid;
  }

  .kpi-grid,
  .employee-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .main,
  .sidebar {
    padding: 16px;
  }

  .nav,
  .kpi-grid,
  .employee-grid,
  .topbar-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

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