body {
  font-size: 14px;
}
button,
input,
select,
textarea {
  font-family: inherit;
}
input,
select,
textarea {
  max-width: 100%;
}
.main {
  min-width: 0;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 16px 0;
}
.toolbar .fi {
  width: auto;
}
.right {
  margin-left: auto;
}
.error {
  color: var(--red);
}
.muted {
  color: var(--tx3);
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.demo-notice {
  padding: 8px 12px;
  background: var(--amber-bg);
  color: var(--amber-tx);
  border: 1px solid var(--bd1);
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 16px;
}
a {
  color: var(--blue);
}
.form-error {
  color: var(--red);
  margin: 12px 0;
}
.full {
  grid-column: 1/-1;
}
.subtle {
  font-size: 12px;
  color: var(--tx3);
}
.chart-bars {
  height: 140px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 12px 0;
}
.chart-column {
  flex: 1;
  background: var(--blue);
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  position: relative;
}
.chart-column:hover {
  opacity: 0.7;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.status-line {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.hc-modal-backdrop {
  z-index: 100000;
}
.hc-modal {
  max-height: 90vh;
  overflow: auto;
}
.form-row {
  align-items: start;
}
textarea.fi {
  width: 100%;
  min-height: 95px;
}
.sb-tenant {
  padding: 8px 14px;
}
.sb-tenant select {
  width: 100%;
  font-size: 12px;
  padding: 6px;
  background: var(--bg1);
  color: var(--tx1);
  border: 1px solid var(--bd1);
  border-radius: 6px;
}
.sidebar-collapsed .sb-tenant {
  display: none;
}
.table-wrap {
  overflow-x: auto;
}
.table-wrap th button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.kpi-grid {
  margin-top: 16px;
}
.ai-thread {
  min-height: 180px;
  max-height: 48vh;
  overflow: auto;
}
.ai-message {
  padding: 14px;
  border-bottom: 1px solid var(--bd1);
  white-space: pre-wrap;
  line-height: 1.7;
}
.ai-message.user {
  background: var(--bg3);
}
.pill {
  border-radius: 100px;
}
.order-line {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 8px;
  margin: 8px 0;
}
.order-line input {
  width: 100%;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.mobile-header {
  z-index: 90;
}
#root > main {
  min-height: 100vh;
}
.empty-state {
  padding: 36px;
}
.connect-card {
  margin-top: 16px;
}
.sb-item-iconly svg {
  width: 20px;
  height: 20px;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 16px 0;
}
@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar input {
    min-width: 0;
  }
  .right {
    margin-left: 0;
  }
  .order-line {
    grid-template-columns: 1.5fr 1fr;
  }
  .main {
    padding-bottom: 80px;
  }
  .hc-modal {
    width: calc(100vw - 24px);
  }
  .page-title {
    font-size: 23px;
  }
}
html[data-theme="dark"] .ai-fab {
  color: #f8fafc;
  background: #253554;
  border-color: #475569;
}
html[data-theme="dark"] .demo-notice {
  background: #2a231b;
  color: #fdba74;
}
html[data-theme="dark"] .kpi-value {
  filter: brightness(1.35);
}

html[data-theme="dark"] .b-green {
  color: #6ee7b7;
  background: #123d36;
}
html[data-theme="dark"] .b-red {
  color: #fda4af;
  background: #4c1d2b;
}
html[data-theme="dark"] .b-amber {
  color: #fcd34d;
  background: #423419;
}

/* Keep the original sidebar, typography and cards; make workspace entry explicit. */
.workspace-banner {
  margin: 20px 0 24px;
  padding: 24px;
  border: 1px solid var(--bd1);
  border-left: 4px solid var(--blue);
  border-radius: 14px;
  background: var(--bg1);
}
.workspace-eyebrow {
  color: var(--blue);
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 700;
}
.workspace-banner h2 {
  margin: 8px 0;
  font-size: 24px;
}
.workspace-banner p {
  color: var(--tx2);
  max-width: 850px;
  line-height: 1.7;
}
.workspace-grid,
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0 28px;
}
.workspace-card,
.module-card {
  background: var(--bg1);
  border: 1px solid var(--bd1);
  border-radius: 14px;
  padding: 20px;
  min-width: 0;
}
.workspace-card p {
  margin: 16px 0;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.workspace-card h3,
.module-card h3 {
  margin: 0;
  font-size: 15px;
}
.module-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.module-card p {
  color: var(--tx3);
  font-size: 12px;
  line-height: 1.7;
  margin: 8px 0 14px;
}
.module-card a {
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.module-card a:hover {
  text-decoration: underline;
}
.module-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--bg3);
  color: var(--blue);
}
.module-icon svg {
  width: 21px;
  height: 21px;
}
.module-group-title {
  margin-top: 24px;
  font-size: 14px;
  color: var(--tx2);
}
[hidden] {
  display: none !important;
}
@media (min-width: 1400px) {
  .module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .module-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .workspace-banner {
    padding: 18px;
  }
  .workspace-banner h2 {
    font-size: 20px;
  }
}
.dashboard-overview {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(230px, 1fr);
  gap: 20px;
  margin-top: 20px;
}
.dashboard-overview .form-card {
  min-width: 0;
  margin-top: 0;
}
.dashboard-actions .btn {
  display: block;
  width: 100%;
  text-align: left;
  margin-top: 10px;
}
.dashboard-actions p {
  line-height: 1.7;
  margin-top: 16px;
}
.chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--tx3);
}
.chart-legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
  background: var(--blue);
}
.chart-legend .legend-revenue::before {
  background: var(--green);
}
.daily-chart {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  height: 210px;
  align-items: stretch;
  margin: 20px 0 10px;
}
.daily-chart-day {
  flex: 1;
  min-width: 24px;
  display: flex;
  flex-direction: column;
}
.daily-chart-pair {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  flex: 1;
  border-bottom: 1px solid var(--bd1);
}
.daily-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: var(--blue);
}
.daily-bar.revenue {
  background: var(--green);
}
.daily-chart-label {
  font-size: 9px;
  color: var(--tx3);
  text-align: center;
  margin-top: 6px;
  white-space: nowrap;
}
@media (max-width: 1000px) {
  .dashboard-overview {
    grid-template-columns: 1fr;
  }
}
