:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090b0f;
  color: #f4f6fa;
  font-size: 13px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: #090b0f;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

input,
select {
  min-height: 28px;
  width: 100%;
  padding: 0 9px;
  border: 1px solid #303742;
  border-radius: 3px;
  outline: none;
  background: #111720;
  color: #f4f6fa;
}

select option {
  background: #111720;
}

input:focus,
select:focus {
  border-color: #b20d46;
  box-shadow: 0 0 0 2px rgba(178, 13, 70, 0.22);
}

.shell,
.app-shell {
  width: 100%;
}

.auth-shell {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  width: min(920px, 100%);
  gap: 24px;
}

.login-brand,
.brand-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-title > div,
.workspace,
.inventory-panel,
.detail-card,
.chart-card,
.content-head > div {
  min-width: 0;
}

.login-brand img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 50%;
}

.login-brand p {
  margin: 0 0 4px;
  color: #d9a3b8;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
}

.brand-title img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 50%;
  flex: 0 0 auto;
}

.hero-copy {
  display: grid;
  gap: 12px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 1.2rem;
  line-height: 1;
  font-weight: 500;
}

h2 {
  font-size: 1rem;
  font-weight: 500;
}

.lede {
  max-width: 520px;
  margin: 0;
  color: #aeb8c7;
  font-size: 0.86rem;
  line-height: 1.45;
}

.login-form,
.inventory-panel,
.detail-card,
.chart-card,
.loading-band {
  border: 1px solid #28303a;
  border-radius: 3px;
  background: #0f141c;
}

.login-form {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.login-form label {
  color: #aeb8c7;
  font-size: 0.74rem;
  font-weight: 500;
}

.form-error {
  margin: 0;
  color: #ff9b9b;
  font-size: 0.78rem;
  font-weight: 500;
}

.primary,
.secondary,
.icon-button,
.profile-button,
.sidebar button,
.content-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 3px;
  font-weight: 500;
}

.primary {
  border: 1px solid #e3b357;
  background: #e3b357;
  color: #101217;
}

.secondary,
.icon-button {
  border: 1px solid #303742;
  background: #151b24;
  color: #dce5f2;
}

.app-shell {
  display: grid;
  grid-template-rows: 38px minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 28vw) max-content;
  align-items: center;
  gap: 12px;
  padding: 5px 10px;
  border-bottom: 1px solid #2a313b;
  background: #0f141b;
}

.topbar h1 {
  overflow: hidden;
  margin: 0;
  font-size: 0.86rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-subtitle {
  margin: 1px 0 0;
  color: #8e99a8;
  font-size: 0.68rem;
  font-weight: 400;
}

.top-search {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  height: 28px;
  border: 1px solid #303742;
  border-radius: 3px;
  background: #0b1017;
  color: #8e99a8;
}

.top-search span {
  display: grid;
  place-items: center;
}

.top-search input {
  min-height: 26px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.top-actions {
  display: flex;
  justify-content: end;
  gap: 6px;
}

.icon-button {
  width: 28px;
  padding: 0;
  border-radius: 3px;
}

.profile-wrap {
  position: relative;
}

.profile-button {
  gap: 7px;
  padding: 0 7px 0 4px;
  border: 1px solid #303742;
  background: #151b24;
  color: #dce5f2;
}

.profile-button span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  background: #b20d46;
  color: white;
  font-size: 0.72rem;
}

.profile-button strong {
  font-size: 0.76rem;
  font-weight: 500;
}

.profile-button i {
  color: #8e99a8;
  font-style: normal;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  display: grid;
  gap: 8px;
  width: 220px;
  padding: 10px;
  border: 1px solid #303742;
  border-radius: 3px;
  background: #111720;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
}

.profile-menu span,
.profile-menu a {
  color: #aeb8c7;
  font-size: 0.76rem;
}

.profile-menu a {
  text-decoration: none;
}

.profile-menu button {
  min-height: 28px;
  border: 1px solid #303742;
  border-radius: 3px;
  background: #0d121a;
  color: #f4f6fa;
}

.app-body {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  min-height: 0;
}

.app-body.sidebar-open {
  grid-template-columns: 176px minmax(0, 1fr);
}

.sidebar {
  display: grid;
  grid-template-rows: auto repeat(4, auto) 1fr;
  gap: 3px;
  min-height: 0;
  padding: 10px 8px;
  border-right: 1px solid #2a313b;
  background: #0d1218;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.sidebar p {
  margin: 2px 8px 8px;
  color: #8e99a8;
  font-size: 0.66rem;
  font-weight: 500;
  text-transform: uppercase;
}

.sidebar-toggle {
  display: none;
  width: 28px;
  min-height: 28px;
  border: 1px solid #303742;
  border-radius: 3px;
  background: #151b24;
  color: #dce5f2;
}

.sidebar button {
  justify-content: start;
  gap: 8px;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: #c8d1df;
  font-size: 0.76rem;
  font-weight: 400;
}

.sidebar button:hover,
.sidebar button.active {
  background: #1a2230;
  color: #ffffff;
}

.sidebar button.active {
  box-shadow: inset 3px 0 0 #b20d46;
}

.sidebar button span {
  width: 18px;
  color: #91a0b5;
}

.sidebar-foot {
  align-self: end;
  display: grid;
  gap: 3px;
  padding-top: 12px;
}

.workspace {
  display: grid;
  grid-template-rows: 72px auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  background: #090b0f;
}

.content-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 7px;
  border-bottom: 1px solid #242c36;
}

.content-head h2,
.content-head p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-head p {
  margin: 3px 0 0;
  color: #8e99a8;
  font-size: 0.76rem;
}

.content-tabs {
  display: flex;
  gap: 4px;
  align-items: center;
}

.content-tabs button {
  min-height: 26px;
  padding: 0 9px;
  border: 0;
  background: transparent;
  color: #aeb8c7;
  font-size: 0.76rem;
  font-weight: 400;
}

.content-tabs button.active {
  background: #b20d46;
  color: #ffffff;
}

.loading-band {
  margin: 8px 12px;
  padding: 7px 10px;
  color: #dce5f2;
  font-weight: 500;
}

.details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 24vw);
  min-height: 0;
  height: 100%;
  gap: 8px;
  padding: 7px 10px 10px;
  overflow: hidden;
}

.inventory-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) repeat(3, minmax(140px, 0.65fr));
  gap: 6px;
  padding: 7px;
  border-bottom: 1px solid #242c36;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 5px 8px;
  border-bottom: 1px solid #242c36;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #121820;
  color: #8e99a8;
  font-size: 0.66rem;
  text-transform: uppercase;
}

tbody tr:hover,
tbody tr.selected {
  background: #17202b;
}

td strong {
  display: block;
  color: #f4f6fa;
  font-size: 0.76rem;
  font-weight: 500;
}

td small {
  display: block;
  max-width: 360px;
  margin-top: 3px;
  color: #8e99a8;
  font-size: 0.7rem;
}

.mobile-list {
  display: none;
}

.detail-card {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.detail-card h2 {
  font-size: 0.9rem;
}

.eyebrow {
  width: fit-content;
  margin: 0;
  padding: 5px 8px;
  border: 1px solid rgba(178, 13, 70, 0.42);
  border-radius: 3px;
  background: rgba(178, 13, 70, 0.14);
  color: #ff9fbd;
  font-size: 0.66rem;
  font-weight: 500;
  text-transform: uppercase;
}

.item-photo,
.photo-empty {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 3px;
}

.item-photo {
  object-fit: cover;
}

.photo-empty {
  display: grid;
  place-items: center;
  border: 1px dashed #303742;
  color: #8e99a8;
}

dl {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 6px 9px;
  margin: 0;
  font-size: 0.74rem;
}

dt {
  color: #8e99a8;
  font-weight: 500;
}

dd {
  margin: 0;
}

.executive-grid {
  display: grid;
  grid-template-rows: auto auto;
  min-height: 0;
  height: 100%;
  gap: 8px;
  padding: 8px 12px 12px;
  align-content: start;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
}

.metric {
  display: grid;
  gap: 5px;
  min-height: 64px;
  padding: 8px;
  border: 1px solid #28303a;
  border-radius: 3px;
  background: #0f141c;
}

.metric span {
  color: #8e99a8;
  font-size: 0.7rem;
}

.metric strong {
  font-size: 1rem;
  font-weight: 500;
}

.metric small {
  color: #d9a3b8;
  font-size: 0.68rem;
  font-weight: 400;
}

.chart-card {
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  align-self: start;
}

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

.section-head h2 {
  margin-top: 7px;
}

.chart-wrap {
  display: grid;
  justify-items: start;
  align-items: start;
  min-height: 390px;
  padding: 8px 0 0 8px;
}

.donut-shell {
  position: relative;
  display: grid;
  place-items: center;
  width: min(50vh, 440px);
  max-width: min(100%, 440px);
  aspect-ratio: 1;
}

.donut-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 14px 34px rgba(0, 0, 0, 0.28));
}

.donut-track {
  fill: none;
  stroke: #18202b;
  stroke-width: 36;
}

.donut-slice {
  cursor: help;
  stroke: #0f141c;
  stroke-width: 1;
  transition: opacity 0.12s ease, transform 0.12s ease;
  transform-origin: 100px 100px;
}

.donut-slice:hover {
  opacity: 0.86;
  transform: scale(1.015);
}

.donut-center {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44%;
  aspect-ratio: 1;
  border: 1px solid #28303a;
  border-radius: 50%;
  background: #0f141c;
  text-align: center;
}

.donut-center strong {
  max-width: 92%;
  overflow: hidden;
  font-size: 1rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-center span {
  color: #8e99a8;
  font-size: 0.72rem;
}

.chart-callout {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 2px;
  min-width: 104px;
  max-width: 142px;
  padding: 5px 7px;
  border-left: 3px solid;
  border-radius: 3px;
  background: rgba(17, 23, 32, 0.94);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.chart-callout.left {
  text-align: left;
  transform: translate(8px, -50%);
}

.chart-callout.right {
  text-align: right;
  transform: translate(calc(-100% - 8px), -50%);
}

.chart-callout span {
  overflow: hidden;
  color: #dce5f2;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-callout strong {
  color: #8e99a8;
  font-size: 0.66rem;
  font-weight: 500;
}

.chart-tooltip {
  position: fixed;
  z-index: 20;
  display: grid;
  gap: 3px;
  min-width: 128px;
  padding: 7px 9px;
  border: 1px solid #303742;
  border-radius: 3px;
  background: #111720;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
  pointer-events: none;
  transform: translate(12px, 12px);
}

.chart-tooltip strong {
  font-size: 0.78rem;
  font-weight: 500;
}

.chart-tooltip span {
  color: #aeb8c7;
  font-size: 0.72rem;
}

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

  .top-search {
    display: none;
  }

  .app-body {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .app-body.sidebar-open {
    grid-template-columns: 176px minmax(0, 1fr);
  }

  .sidebar {
    padding: 8px 6px;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar p,
  .sidebar button {
    font-size: 0;
  }

  .app-body.sidebar-open .sidebar p {
    font-size: 0.66rem;
  }

  .app-body.sidebar-open .sidebar button {
    justify-content: start;
    padding: 0 8px;
    font-size: 0.76rem;
  }

  .sidebar button {
    justify-content: center;
    padding: 0;
  }

  .sidebar button span {
    font-size: 0.82rem;
  }

  .sidebar-foot {
    display: none;
  }

  .workspace {
    grid-template-rows: 58px auto minmax(0, 1fr);
  }

  .content-head {
    padding: 8px;
  }

  .content-head p {
    display: none;
  }

  .details-grid {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 26vw);
    padding: 8px;
  }

  .chart-wrap {
    min-height: 340px;
  }

  .toolbar {
    grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(110px, 0.55fr));
  }

  .summary-cards {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

@media (max-width: 980px) {
  .details-grid,
  .chart-wrap {
    grid-template-columns: 1fr;
  }

  .donut-shell {
    width: min(72vw, 340px);
  }

  .chart-callout {
    min-width: 88px;
    max-width: 110px;
    padding: 4px 6px;
  }

  .chart-wrap {
    justify-items: start;
  }

  .table-wrap {
    display: none;
  }

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

  .toolbar input {
    grid-column: 1 / -1;
  }

  .mobile-list {
    display: grid;
    gap: 7px;
    overflow: auto;
    padding: 8px;
  }

  .item-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100%;
    min-height: 60px;
    padding: 7px;
    border: 1px solid #28303a;
    border-radius: 3px;
    background: #111720;
    color: inherit;
    text-align: left;
  }

  .item-card.selected {
    border-color: #b20d46;
    background: #1b1420;
  }

  .item-card img,
  .thumb-empty {
    width: 46px;
    height: 46px;
    border-radius: 3px;
  }

  .item-card img {
    object-fit: cover;
  }

  .thumb-empty {
    display: grid;
    place-items: center;
    background: rgba(178, 13, 70, 0.18);
    color: #ff9fbd;
    font-weight: 500;
    text-transform: uppercase;
  }

  .item-card-main,
  .item-card-meta {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .item-card-main strong,
  .item-card-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .item-card-main small,
  .item-card-meta small {
    color: #8e99a8;
  }

  .item-card-meta {
    justify-items: end;
  }

  .detail-card {
    max-height: 30dvh;
  }

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

@media (max-width: 560px) {
  :root {
    font-size: 12px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 6px;
    padding: 5px 6px;
  }

  .brand-title h1 {
    max-width: 150px;
  }

  .profile-button strong,
  .profile-button i,
  .app-subtitle {
    display: none;
  }

  .content-tabs button {
    padding: 0 7px;
  }

  .content-head {
    display: grid;
    align-items: start;
    gap: 6px;
  }

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

  .toolbar input {
    grid-column: auto;
  }

  .summary-cards {
    grid-template-columns: 1fr 1fr;
  }

  .auth-shell {
    align-items: start;
    padding: 18px 14px;
    overflow: auto;
  }

  .login-panel {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 14px;
    width: 100%;
  }

  .login-brand {
    align-items: center;
    gap: 8px;
  }

  .login-brand img {
    width: 46px;
    height: 46px;
  }

  .login-brand h1 {
    font-size: 1.05rem;
  }

  .lede {
    font-size: 0.82rem;
  }

  .login-form {
    width: 100%;
    padding: 12px;
  }
}
