:root {
  --primary: #132f4c;
  --primary-strong: #071a2d;
  --accent: #f3a847;
  --accent-strong: #d88716;
  --teal: #008577;
  --danger: #b42318;
  --success: #067647;
  --warning: #b54708;
  --ink: #16202a;
  --muted: #5c6670;
  --line: #d6dbe1;
  --soft: #eef2f5;
  --surface: #ffffff;
  --page: #e8edf3;
  --shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  min-height: 38px;
  padding: 9px 10px;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  text-transform: uppercase;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 430px);
  gap: 32px;
  align-items: center;
  padding: 42px;
  background:
    linear-gradient(90deg, rgba(19, 47, 76, 0.94), rgba(0, 133, 119, 0.82)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='900' viewBox='0 0 1400 900'%3E%3Crect width='1400' height='900' fill='%23e8edf3'/%3E%3Cg fill='%23ffffff' opacity='.34'%3E%3Crect x='120' y='120' width='240' height='150' rx='8'/%3E%3Crect x='430' y='120' width='240' height='150' rx='8'/%3E%3Crect x='740' y='120' width='240' height='150' rx='8'/%3E%3Crect x='1050' y='120' width='240' height='150' rx='8'/%3E%3Crect x='120' y='330' width='240' height='150' rx='8'/%3E%3Crect x='430' y='330' width='240' height='150' rx='8'/%3E%3Crect x='740' y='330' width='240' height='150' rx='8'/%3E%3Crect x='1050' y='330' width='240' height='150' rx='8'/%3E%3Crect x='120' y='540' width='240' height='150' rx='8'/%3E%3Crect x='430' y='540' width='240' height='150' rx='8'/%3E%3Crect x='740' y='540' width='240' height='150' rx='8'/%3E%3Crect x='1050' y='540' width='240' height='150' rx='8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
}

.login-brand {
  color: #fff;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  max-width: 760px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--primary-strong);
  font-weight: 900;
  letter-spacing: 0;
  flex: 0 0 auto;
}

.login-brand h1 {
  margin: 8px 0 12px;
  font-size: clamp(34px, 6vw, 66px);
  line-height: 1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: #ffe0a3;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.login-copy {
  margin: 0;
  max-width: 580px;
  color: #e8f1f8;
  font-size: 18px;
  line-height: 1.5;
}

.login-panel {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  gap: 14px;
}

.split-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quick-login {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.tiny-button {
  border: 0;
  border-radius: 6px;
  min-height: 38px;
  padding: 8px 12px;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: var(--primary-strong);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button,
.icon-button,
.tiny-button {
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--ink);
}

.danger-button {
  background: var(--danger);
  color: #fff;
}

.tiny-button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 20;
  width: min(360px, calc(100vw - 36px));
  background: var(--primary-strong);
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  transform: translateY(-90px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  min-height: 66px;
  background: var(--primary-strong);
  color: #fff;
  display: grid;
  grid-template-columns: minmax(210px, 270px) minmax(280px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 10px 18px;
}

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

.brand-row small {
  display: block;
  color: #cbd5e1;
  margin-top: 2px;
}

.search-wrap {
  display: grid;
  grid-template-columns: 130px 1fr 92px;
  align-items: stretch;
}

.search-wrap select,
.search-wrap input,
.search-wrap button {
  border-radius: 0;
  min-height: 42px;
}

.search-wrap select {
  border-radius: 6px 0 0 6px;
  border-right: 0;
}

.search-wrap button {
  border: 0;
  border-radius: 0 6px 6px 0;
  background: var(--accent);
  color: var(--primary-strong);
  font-weight: 900;
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.top-actions .ghost-button {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.category-strip {
  min-height: 40px;
  background: var(--primary);
  color: #fff;
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  padding: 0 16px;
}

.category-strip button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #fff;
  min-height: 30px;
  padding: 4px 10px;
  white-space: nowrap;
}

.category-strip button:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.workspace {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: calc(100vh - 106px);
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 14px;
  overflow-y: auto;
}

.session-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.session-card small {
  color: var(--muted);
}

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

.nav-list button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #344054;
  padding: 10px;
  text-align: left;
  font-weight: 800;
}

.nav-list button.active,
.nav-list button:hover {
  background: #eef6ff;
  color: var(--primary-strong);
}

.view-root {
  padding: 18px;
  min-width: 0;
}

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

.view-header h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0;
}

.view-header p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

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

.panel-title h3 {
  margin: 0;
  font-size: 17px;
}

.metric {
  display: grid;
  gap: 8px;
}

.metric small {
  color: var(--muted);
  font-weight: 800;
}

.metric strong {
  font-size: 28px;
}

.metric span {
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  background: #edf7ed;
  color: var(--success);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.pending {
  background: #fff4e5;
  color: var(--warning);
}

.status-pill.danger {
  background: #fff0ee;
  color: var(--danger);
}

.status-pill.neutral {
  background: #eef2f5;
  color: #475467;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.bar-chart {
  display: grid;
  gap: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: 70px 1fr 54px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar-track {
  height: 12px;
  background: #edf2f7;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--accent));
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
}

.product-art {
  min-height: 150px;
  display: grid;
  place-items: center;
  padding: 16px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(7, 26, 45, 0.2), rgba(255, 255, 255, 0.08)),
    var(--art, var(--teal));
}

.product-art.has-image {
  min-height: 165px;
  padding: 0;
  background: #f8fafc;
}

.product-art img {
  display: block;
  width: 100%;
  height: 165px;
  object-fit: cover;
}

.product-art span {
  display: grid;
  place-items: center;
  width: 96px;
  height: 80px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 38px;
  font-weight: 900;
}

.product-body {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.product-body h3 {
  margin: 0;
  font-size: 16px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.price-row strong {
  font-size: 18px;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  border-left: 3px solid var(--teal);
  padding-left: 10px;
}

.timeline-item strong {
  display: block;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compare-link {
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}

.chat-box {
  height: 280px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.chat-message {
  max-width: 82%;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.chat-message.me {
  justify-self: end;
  background: #e6f7f4;
}

.mobile-only {
  display: none;
}

@media (max-width: 1020px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .grid.four,
  .grid.three,
  .grid.two {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    display: none;
    position: fixed;
    inset: 106px auto 0 0;
    width: 280px;
    z-index: 10;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    display: block;
  }

  .mobile-only {
    display: inline-grid;
  }
}

@media (max-width: 760px) {
  .login-screen {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .login-brand {
    display: grid;
  }

  .split-fields,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .search-wrap {
    grid-template-columns: 86px 1fr 76px;
  }

  .view-root {
    padding: 12px;
  }

  .view-header {
    display: grid;
  }
}
