:root {
  color-scheme: dark;
  --bg: #080d15;
  --panel: #0d1420;
  --panel-2: #121c2b;
  --panel-3: #172438;
  --line: #26354b;
  --line-soft: #1a283c;
  --text: #d9e6f7;
  --muted: #7f91aa;
  --accent: #21c9a7;
  --accent-2: #126d5e;
  --gold: #e0a527;
  --danger: #742638;
  --green-card: #103a2d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
}

button {
  min-height: 29px;
  padding: 0 12px;
  color: #dffbf6;
  background: linear-gradient(180deg, #17364b, #111d2c);
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

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

input,
select {
  height: 31px;
  padding: 0 10px;
}

textarea {
  min-height: 62px;
  padding: 12px;
  resize: vertical;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 17px;
}

h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

small,
time,
label,
em {
  color: var(--muted);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(700px, 1fr) 390px;
  gap: 8px;
  min-height: 100vh;
  padding: 8px;
}

.sidebar,
.workspace {
  min-width: 0;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
}

.left-panel,
.right-panel,
.chat-card,
.links-panel,
.metric {
  border: 1px solid var(--line-soft);
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.left-panel,
.right-panel {
  padding: 9px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pill-row span,
.live-dot,
.badge {
  border: 1px solid rgba(33, 201, 167, .35);
  border-radius: 999px;
  background: rgba(33, 201, 167, .08);
  color: var(--accent);
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.side-section {
  display: grid;
  gap: 8px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
}

.customer-list,
.price-list {
  display: grid;
  gap: 7px;
  max-height: 300px;
  overflow: auto;
  padding-right: 3px;
}

.customer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 58px;
  padding: 9px;
  text-align: left;
}

.customer.active {
  border-color: #2d628b;
  background: var(--panel-3);
}

.customer span {
  min-width: 0;
}

.customer strong,
.price-list strong,
.rank-list strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f0f6ff;
}

.customer small {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer em {
  font-style: normal;
  font-size: 11px;
}

.wide-button {
  width: 100%;
  background: var(--panel-3);
}

.market-watch {
  margin-top: 4px;
}

.mini-actions,
.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

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

.rank-list {
  display: grid;
  gap: 7px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.rank-list li,
.store-grid article,
.price-list article {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--panel-2);
  padding: 9px;
}

.rank-list span,
.price-list b,
.store-grid b {
  color: var(--accent);
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-rows: auto auto minmax(460px, 1fr) auto;
  gap: 8px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 34px;
}

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

.brand strong {
  color: #ecf2ff;
  font-size: 16px;
}

.brand strong::first-letter {
  color: var(--accent);
}

.brand span {
  color: #d4def0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
}

.auth {
  display: flex;
  gap: 8px;
}

.metrics {
  display: grid;
  grid-template-columns: 120px 1fr 1fr minmax(390px, 3fr);
  gap: 6px;
}

.metric {
  min-height: 112px;
  border-radius: 8px;
  padding: 12px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 21px;
  color: #f8fbff;
}

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

.metric.danger {
  background: #2a111a;
  border-color: #5b2635;
}

.metric.danger strong {
  color: #ff6d8d;
}

.metric.wide {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.metric.wide label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
}

.metric.wide input {
  width: 100%;
  height: 26px;
}

.metric.wide button {
  grid-column: 1 / -1;
}

.chat-card {
  display: grid;
  grid-template-rows: auto auto minmax(250px, 1fr) auto auto;
  border-radius: 8px;
  overflow: hidden;
}

.chat-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 145px 145px auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  background: #0a101b;
}

.chat-toolbar label {
  display: grid;
  gap: 5px;
  font-size: 10px;
  text-transform: uppercase;
}

.status {
  min-height: 34px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
}

.status.danger {
  color: #ff8ea3;
}

.conversation {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 270px;
  max-height: 430px;
  overflow: auto;
  padding: 12px;
  background:
    linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
    var(--bg);
  background-size: 100% 42px;
}

.bubble {
  max-width: 62%;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 9px 11px;
}

.bubble strong {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 12px;
}

.bubble p {
  line-height: 1.42;
}

.bubble.incoming {
  justify-self: start;
  background: #101d2b;
}

.bubble.outgoing {
  justify-self: end;
  background: var(--green-card);
  border-color: #1d6a55;
}

.quick-replies {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--line-soft);
  overflow-x: auto;
}

.quick-replies button {
  white-space: nowrap;
  background: #123d34;
  border-color: #1d6a55;
}

.reply {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 82px;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line-soft);
}

.reply input {
  height: 62px;
}

.links-panel {
  display: grid;
  gap: 8px;
  border-radius: 8px;
  padding: 10px;
}

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

.quick-links button {
  height: 28px;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.store-grid article {
  display: grid;
  gap: 4px;
}

.price-title {
  margin-top: 5px;
  padding: 7px 9px;
  border-radius: 7px;
  background: #19314c;
}

.price-list {
  max-height: 420px;
}

.price-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.price-list small {
  display: block;
  margin-top: 4px;
}

.empty,
.empty-mini {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: var(--panel-2);
}

@media (max-width: 1300px) {
  body {
    min-width: 0;
  }

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

  .right-panel {
    display: none;
  }

  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .metric.wide {
    grid-column: 1 / -1;
  }
}

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

  .left-panel {
    order: 2;
  }

  .chat-toolbar,
  .metrics,
  .reply,
  .quick-links {
    grid-template-columns: 1fr;
  }

  .bubble {
    max-width: 100%;
  }
}
