:root {
  --ink: #17202a;
  --muted: #697386;
  --line: #d9e0ea;
  --panel: #ffffff;
  --bg: #f4f7fb;
  --brand: #0f766e;
  --brand-dark: #115e59;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

a {
  text-decoration: none;
}

.auth-bg {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #eef7f5, #f7f8fb 45%, #fff7ed);
}

.auth-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(30, 41, 59, .12);
}

.auth-card h1 {
  font-size: 25px;
  margin: 10px 0 6px;
}

.auth-logo {
  display: block;
  width: min(280px, 100%);
  height: auto;
  margin: 0 auto 14px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: #102326;
  color: #fff;
  padding: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: grid;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 20px;
}

.sidebar-logo {
  width: 100%;
  max-width: 190px;
  height: auto;
  background: #fff;
  border-radius: 8px;
  padding: 6px;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar nav a {
  color: #d8eeee;
  padding: 10px 12px;
  border-radius: 7px;
}

.sidebar nav a:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.content {
  padding: 22px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.topbar span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.menu-btn {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 7px 10px;
}

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

.page-title h1 {
  margin: 0;
  font-size: 26px;
}

.page-actions,
.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

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

.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

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

.metric strong {
  display: block;
  font-size: 28px;
  margin-top: 6px;
}

.table {
  vertical-align: middle;
}

.table-responsive {
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

.form-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.toggle-chip-group {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 14px;
  line-height: 1;
}

.toggle-chip:hover,
.toggle-chip:focus {
  border-color: var(--brand);
  color: var(--brand);
}

.icon-action {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  color: var(--brand);
  font-size: 24px;
  line-height: 1;
  padding: 0;
}

.icon-action:hover,
.icon-action:focus {
  border-color: var(--brand);
  background: #f0fdfa;
}

.collapse-panel {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 8px;
}

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

.muted-note {
  color: var(--muted);
  font-size: 13px;
}

.stock-pair-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.dealer-summary {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  color: var(--muted);
}

.choice-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.choice-search {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.choice-search:focus {
  box-shadow: none;
}

.choice-list-body {
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  display: grid;
  gap: 6px;
}

.choice-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.choice-item small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.choice-item:hover {
  border-color: var(--brand);
  background: #f7fffd;
}

.choice-item input {
  margin-top: 3px;
}

.choice-empty {
  display: none;
  padding: 12px;
  text-align: center;
}

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark);
}

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

  .sidebar {
    position: fixed;
    left: -280px;
    width: 260px;
    z-index: 10;
    transition: left .2s ease;
  }

  .sidebar-open .sidebar {
    left: 0;
  }

  .menu-btn {
    display: inline-block;
  }

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

@media (max-width: 560px) {
  .content {
    padding: 12px;
  }

  .page-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .form-toolbar {
    align-items: stretch;
  }
}
