:root {
  color: #edf4ff;
  background: #070a10;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: #070a10;
}

button, input, select { font: inherit; }

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: #9fb0c8;
}

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

.sidebar {
  background: #05070c;
  border-right: 1px solid #171d2a;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark, .icon-button, .kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.brand-mark {
  color: #93f2df;
  background: #0b4d48;
}

.brand strong, .brand span { display: block; }
.brand span, .muted { color: #8fa0ba; }

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-list button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: #aebbd0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.nav-list button.active, .nav-list button:hover {
  color: #fff;
  background: #151c2a;
}

.sync-box {
  margin-top: auto;
  border: 1px solid #233246;
  border-radius: 8px;
  padding: 12px;
  color: #b9fff0;
  background: #091119;
}

.sync-box span {
  display: block;
  margin-top: 3px;
  color: #8fa0ba;
  font-size: 12px;
}

.workspace {
  padding: 22px;
  display: grid;
  gap: 16px;
}

.topbar, .filters, .panel, .kpi {
  background: #101620;
  border: 1px solid #242d3d;
  border-radius: 8px;
}

.topbar {
  min-height: 84px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 25px; line-height: 1.15; }
.topbar p { margin-top: 6px; color: #9fb0c8; }

.icon-button {
  border: 1px solid #334158;
  color: #eaf3ff;
  background: #0b111b;
  cursor: pointer;
}

.icon-button:disabled { opacity: .55; cursor: wait; }

.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sync-message {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid #24506b;
  border-radius: 8px;
  color: #c2eaff;
  background: #0a1a27;
  font-size: 13px;
  font-weight: 700;
}

.filters {
  min-height: 62px;
  display: grid;
  grid-template-columns: 220px 210px 210px minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.field {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #334158;
  border-radius: 8px;
  padding: 0 11px;
  color: #9fb0c8;
  min-width: 0;
}

select, input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #edf4ff;
  background: transparent;
}

select { appearance: none; }
select option { color: #edf4ff; background: #101620; }
input::placeholder { color: #6f809a; }

.segmented {
  height: 42px;
  padding: 3px;
  border: 1px solid #334158;
  border-radius: 8px;
  background: #0a1019;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.segmented button {
  border: 0;
  border-radius: 6px;
  color: #9fb0c8;
  background: transparent;
  cursor: pointer;
}

.segmented button.selected {
  color: #fff;
  background: #25334a;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 12px;
}

.kpi {
  min-height: 138px;
  padding: 15px;
  display: grid;
  align-content: space-between;
}

.kpi-icon {
  color: #72e7ff;
  background: #102c3e;
}

.kpi span { color: #a8b8cf; font-size: 13px; }
.kpi strong { font-size: 27px; line-height: 1.05; }
.kpi small { color: #2df2b5; font-weight: 700; }

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, .7fr);
  gap: 14px;
}

.panel {
  padding: 16px;
  min-width: 0;
}

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

.panel-title h2 { font-size: 17px; }
.panel-title span { color: #9fb0c8; font-size: 13px; white-space: nowrap; }

.chart {
  width: 100%;
  height: 320px;
  display: block;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #b9c6d8;
  font-size: 13px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.product-card {
  border: 1px solid #2a3548;
  border-radius: 8px;
  padding: 14px;
  background: #0b111b;
  display: grid;
  gap: 12px;
}

.product-card h3 {
  font-size: 16px;
}

.product-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.product-stats div {
  min-height: 58px;
  padding: 9px;
  border: 1px solid #202b3b;
  border-radius: 7px;
  background: #0f1622;
}

.product-stats span, .addon-list span { color: #8fa0ba; font-size: 12px; }
.product-stats strong, .addon-list strong { display: block; margin-top: 3px; }

.addon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.addon-list {
  display: grid;
  gap: 8px;
}

.addon-row {
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px 74px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #202b3b;
  border-radius: 8px;
  background: #0b111b;
}

.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 1120px; border-collapse: collapse; }
th, td {
  padding: 12px 10px;
  border-top: 1px solid #273244;
  text-align: left;
  font-size: 13px;
}
th {
  color: #9fb0c8;
  background: #0b111b;
}
tbody tr:hover { background: #151e2c; }
td strong, td span { display: block; }
td span {
  margin-top: 4px;
  color: #8fa0ba;
  max-width: 520px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.audit-item {
  min-height: 76px;
  padding: 12px;
  border: 1px solid #273244;
  border-radius: 8px;
  background: #0b111b;
}

.audit-item span { display: block; color: #8fa0ba; font-size: 12px; }
.audit-item strong { display: block; margin-top: 8px; font-size: 22px; }

.hidden { display: none !important; }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .filters, .chart-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .workspace { padding: 14px; }
  .topbar { align-items: flex-start; }
  h1 { font-size: 21px; }
  .filters, .chart-grid, .addon-grid { grid-template-columns: 1fr; }
}
