body {
  min-height: 100vh;
  background: radial-gradient(circle at 85% 5%, rgba(67, 217, 204, 0.16), transparent 28rem), linear-gradient(135deg, #071016 0%, #132228 54%, #101918 100%);
  color: #eef7f3;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  border-right: 1px solid rgba(180, 221, 223, 0.16);
  background: rgba(7, 16, 22, 0.72);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 32px;
  color: #eef7f3;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(67, 217, 204, 0.46);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(67, 217, 204, 0.22), rgba(117, 209, 126, 0.12));
  color: #43d9cc;
  font-size: 0.78rem;
  font-weight: 800;
}

.brand small,
.eyebrow,
.metric-card span,
.metric-card small,
.stack-list small {
  color: #8ba5a4;
}

.nav-link {
  padding: 12px 14px;
  border-radius: 8px;
  color: #bed1ce;
}

.nav-link:hover {
  background: rgba(67, 217, 204, 0.12);
  color: #eef7f3;
}

.content {
  padding: 30px;
}

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

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

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

.refresh-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(180, 221, 223, 0.16);
  border-radius: 8px;
  background: rgba(15, 26, 34, 0.86);
  color: #43d9cc;
  font-weight: 800;
  text-decoration: none;
}

.range-toggle {
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(180, 221, 223, 0.16);
  border-radius: 8px;
  background: rgba(15, 26, 34, 0.86);
}

.range-toggle a {
  min-width: 76px;
  padding: 11px 13px;
  color: #abc1bd;
  text-align: center;
  text-decoration: none;
}

.range-toggle .active {
  background: #43d9cc;
  color: #071016;
  font-weight: 800;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 0.95;
}

h2 {
  font-size: 1rem;
}

.eyebrow {
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.status-pill,
.panel,
.metric-card {
  border: 1px solid rgba(180, 221, 223, 0.16);
  border-radius: 8px;
  background: rgba(15, 26, 34, 0.86);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.status-pill {
  padding: 8px 12px;
  color: #43d9cc;
}

.kpi-grid,
.dashboard-grid {
  display: grid;
  gap: 16px;
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 16px;
}

.metric-card,
.panel {
  padding: 20px;
}

.metric-card {
  display: grid;
  gap: 10px;
  min-height: 136px;
}

.metric-card strong {
  font-size: 2rem;
}

.metric-card.accent strong {
  color: #e8b44a;
}

.small-text {
  font-size: 1rem !important;
}

.dashboard-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.workspace {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 16px;
  align-items: stretch;
}

.wide {
  grid-column: span 2;
}

.panel-wide {
  grid-column: span 2;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.pill,
.pill-link {
  align-self: flex-start;
  padding: 6px 10px;
  border: 1px solid rgba(67, 217, 204, 0.42);
  border-radius: 999px;
  color: #43d9cc;
  font-size: 0.78rem;
  text-decoration: none;
}

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

.bar-wrap {
  display: grid;
  height: 100%;
  align-items: end;
  gap: 10px;
  color: #8ba5a4;
  font-size: 0.8rem;
}

.bar {
  display: block;
  min-height: 8px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #43d9cc, rgba(117, 209, 126, 0.42));
}

.line-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 12px;
  height: 190px;
  padding-top: 8px;
  border-bottom: 1px solid rgba(180, 221, 223, 0.16);
}

.bar-link {
  display: block;
  width: 100%;
  height: var(--height);
  min-height: 8%;
  align-self: end;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #43d9cc, rgba(117, 209, 126, 0.36));
  transition: filter 160ms ease, transform 160ms ease;
}

.bar-link:hover {
  filter: brightness(1.25);
  transform: translateY(-3px);
}

.chart-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  padding-top: 12px;
  color: #8ba5a4;
  font-size: 0.78rem;
}

.donut {
  display: grid;
  width: min(210px, 72vw);
  aspect-ratio: 1;
  place-items: center;
  margin: 10px auto 22px;
  border-radius: 50%;
  background: radial-gradient(circle, #111d25 0 56%, transparent 57%), conic-gradient(#43d9cc 0 var(--readiness, 0%), rgba(232, 180, 74, 0.82) var(--readiness, 0%) 94%, rgba(239, 114, 111, 0.8) 94%);
}

.donut span {
  font-size: 2.25rem;
  font-weight: 850;
}

.legend,
.timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legend li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #c6d8d4;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: auto;
}

.green {
  background: #75d17e;
}

.amber {
  background: #e8b44a;
}

.red {
  background: #ef726f;
}

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

.stack-list div {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(180, 221, 223, 0.16);
}

.stack-list i {
  grid-column: 1 / -1;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #43d9cc 0 var(--width), rgba(255, 255, 255, 0.08) var(--width));
}

.calendar-controls {
  display: grid;
  grid-template-columns: 36px 1fr 0.9fr 36px;
  gap: 8px;
  margin-bottom: 14px;
}

.calendar-form {
  display: contents;
}

.calendar-controls select,
.calendar-controls .icon-button {
  min-width: 0;
  height: 36px;
  border: 1px solid rgba(180, 221, 223, 0.16);
  border-radius: 8px;
  background: #111d25;
  color: #eef7f3;
  padding: 0 10px;
  text-decoration: none;
}

.calendar-controls .icon-button {
  display: grid;
  place-items: center;
  padding: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekday,
.calendar-empty,
.calendar-grid a {
  min-height: 46px;
}

.calendar-weekday {
  display: grid;
  place-items: center;
  color: #8ba5a4;
  font-size: 0.72rem;
  font-weight: 800;
}

.calendar-grid a {
  display: grid;
  gap: 3px;
  align-content: center;
  padding: 6px;
  border: 1px solid rgba(180, 221, 223, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #eef7f3;
  text-align: left;
  text-decoration: none;
}

.calendar-grid a span {
  overflow: hidden;
  color: #8ba5a4;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-grid a:hover,
.calendar-grid .selected-date {
  border-color: rgba(67, 217, 204, 0.7);
  background: rgba(67, 217, 204, 0.13);
}

.timeline li {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(180, 221, 223, 0.16);
}

.timeline.compact li {
  grid-template-columns: 48px 1fr;
  padding: 10px 0;
  font-size: 0.9rem;
}

.stacked-form {
  display: grid;
  gap: 12px;
}

.stacked-form p {
  display: grid;
  gap: 6px;
  margin: 0;
}

.stacked-form label,
.inventory-table small {
  color: #8ba5a4;
  font-size: 0.82rem;
}

.stacked-form input,
.stacked-form select,
.stacked-form textarea {
  border-color: rgba(180, 221, 223, 0.16);
  background-color: #111d25;
  color: #eef7f3;
}

.stacked-form .form-check-input {
  width: 1.1rem;
  height: 1.1rem;
}

.inventory-table td:first-child {
  display: grid;
  gap: 2px;
}

.inventory-table th,
.inventory-table td {
  min-width: 96px;
}

.sku-map-form {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 76px auto;
  gap: 8px;
}

.sku-map-form select,
.sku-map-form input {
  border-color: rgba(180, 221, 223, 0.16);
  background-color: #111d25;
  color: #eef7f3;
}

.threshold-form {
  display: grid;
  grid-template-columns: 96px auto;
  gap: 8px;
  align-items: center;
}

.threshold-form input {
  border-color: rgba(180, 221, 223, 0.16);
  background-color: #111d25;
  color: #eef7f3;
}

.component-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-tabs {
  display: grid;
  gap: 14px;
}

.tool-tabs > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tab-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid rgba(180, 221, 223, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.tab-toggle label {
  display: grid;
  min-height: 38px;
  place-items: center;
  color: #abc1bd;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
}

.tab-panel {
  display: none;
}

#movement-tab-add:checked ~ .tab-toggle label[for=movement-tab-add],
#movement-tab-manage:checked ~ .tab-toggle label[for=movement-tab-manage],
#component-tab-add:checked ~ .tab-toggle label[for=component-tab-add],
#component-tab-manage:checked ~ .tab-toggle label[for=component-tab-manage],
#location-tab-add:checked ~ .tab-toggle label[for=location-tab-add],
#location-tab-manage:checked ~ .tab-toggle label[for=location-tab-manage] {
  background: #43d9cc;
  color: #071016;
}

#movement-tab-add:checked ~ .movement-add-panel,
#movement-tab-manage:checked ~ .movement-manage-panel,
#component-tab-add:checked ~ .component-add-panel,
#component-tab-manage:checked ~ .component-manage-panel,
#location-tab-add:checked ~ .location-add-panel,
#location-tab-manage:checked ~ .location-manage-panel {
  display: block;
}

.location-list {
  display: grid;
  gap: 10px;
}

.location-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid rgba(180, 221, 223, 0.16);
}

.location-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.location-row small,
.location-row .empty-note {
  color: #8ba5a4;
}

.empty-note {
  margin: 0;
  color: #8ba5a4;
}

.import-form {
  display: grid;
  gap: 14px;
  max-width: 720px;
}

.auth-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.auth-card {
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid rgba(180, 221, 223, 0.16);
  border-radius: 8px;
  background: rgba(15, 26, 34, 0.86);
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
  }
  .kpi-grid,
  .dashboard-grid,
  .workspace {
    grid-template-columns: 1fr;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .panel-wide,
  .wide {
    grid-column: auto;
  }
}
