/* Typography */
.h1{
  font-size: 22px;
  margin: 0 0 6px;
  letter-spacing: .2px;
}

.sub{
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* Grid */
.grid{
  display: grid;
  gap: var(--gap, 12px);
}
.grid-4{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2{ grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 980px){
  .grid-4{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px){
  .grid-4,
  .grid-2{ grid-template-columns: 1fr; }
}

/* Card */
.card{
  background: rgba(17,24,39,.62);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius, 16px);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card__hd{
  padding: 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.card__bd{ padding: 14px; }
.card__ft{
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* KPI */
.kpi{
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.kpi__dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--brand);
  margin-top: 6px;
}
.kpi__meta b{
  display: block;
  font-size: 18px;
  color: var(--text);
}
.kpi__meta span{
  color: var(--muted);
  font-size: 12px;
}

/* Badges */
.badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size: 12px;
}
.badge--ok{
  border-color: rgba(34,197,94,.25);
  background: rgba(34,197,94,.10);
  color: #b7f7cb;
}
.badge--warn{
  border-color: rgba(245,158,11,.25);
  background: rgba(245,158,11,.10);
  color: #ffe2b3;
}
.badge--bad{
  border-color: rgba(239,68,68,.25);
  background: rgba(239,68,68,.10);
  color: #ffd0d0;
}

/* Buttons */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor: pointer;
}
.btn:hover{ background: rgba(255,255,255,.09); }

.btn--primary{
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: rgba(34,197,94,.35);
  color: #04110a;
  font-weight: 700;
}
.btn--ghost{ background: transparent; }

/* Table */
.table{
  width: 100%;
  border-collapse: collapse;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  overflow: hidden;
}
.table th,
.table td{
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: left;
  font-size: 13px;
}
.table th{
  color: var(--muted);
  font-weight: 600;
}
.table tr:hover td{ background: rgba(255,255,255,.03); }
.table td a{
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Toolbar + Fields */
.toolbar{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.field{
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(17,24,39,.55);
}
.field input,
.field select{
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
}
.field label{
  color: var(--muted);
  font-size: 12px;
}

/* Toast */
.toast-host{
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}
.toast{
  width: min(420px, calc(100vw - 28px));
  background: rgba(17,24,39,.92);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.toast b{ display: block; margin-bottom: 4px; }
.toast p{
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* Modal */
.modal[hidden]{ display: none; }
.modal{
  position: fixed;
  inset: 0;
  z-index: 300;
}
.modal__panel{
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(820px, calc(100vw - 28px));
  max-height: min(80vh, 740px);
  overflow: auto;
  background-color: rgb(27, 36, 64);
}

/* Processor pill (single, final version) */
.proc-pill{
  --proc: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: color-mix(in srgb, var(--proc) 18%, transparent);
  color: var(--text);
}
.proc-pill .dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--proc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--proc) 22%, transparent);
}

/* Select (used in table cells) */
.field-select{
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.22);
  color: var(--text);
  outline: none;
}




/* Dark dropdown (select + opened options) */
.field select,
.field-select{
  background: rgba(0,0,0,.22);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.10);
}

/* Opened list items (works in many browsers) */
.field select option,
.field-select option{
  background-color: #020a18;   /* your dark background */
  color: rgba(255,255,255,.92);
}

/* Optional: optgroup label styling */
.field select optgroup,
.field-select optgroup{
  background-color: #0b1220;
  color: rgba(255,255,255,.70);
}


/*  */
.badge--vendor{
  border-color: rgba(56,189,248,.25);
  background: rgba(56,189,248,.12);
  color: #cfeaff;
  font-weight: 600;
}


/*  */
.layout-wide .container{ max-width:none !important; width:100%; }
.layout-wide .card__bd{ padding:10px; }
.layout-wide .table th, .layout-wide .table td{ padding:10px 10px; font-size:12px; white-space:nowrap; }
/* Wide table readability */
.layout-wide .table th{
  white-space: nowrap;
}

.layout-wide .table td{
  white-space: nowrap;
}

/* Allow only VIN cell to wrap nicely */
.layout-wide .table td:nth-child(2){
  white-space: normal;
  min-width: 240px;
}
/* Full-width mode for data-heavy pages (Deals) */
.layout-wide .container{
  max-width: none !important;
  width: 100%;
}

.layout-wide main{
  width: 100%;
}

/* Tighten table spacing so more columns fit */
.layout-wide .table th,
.layout-wide .table td{
  padding: 10px 10px;
  font-size: 12px;
}

/* Optional: reduce card padding so table has more room */
.layout-wide .card__bd{
  padding: 10px;
}
.deals-list{
  display: grid;
  gap: 12px;
}

.deal-card{
  background: rgba(17,24,39,.62);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}

.deal-card__hd{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin-bottom: 10px;
}

.deal-card__title{
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .2px;
}

.deal-card__sub{
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.deal-card__actions{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.deal-card__grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.kv{
  padding: 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.06);
}

.kv--wide{
  grid-column: 1 / -1;
}

.kv .k{
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.kv .v{
  font-size: 13px;
  color: rgba(255,255,255,.92);
}

.toggle{
  display:flex;
  align-items:center;
  gap: 10px;
  user-select:none;
}

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

@media (max-width: 1100px){
  .deal-card__grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px){
  .deal-card__grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px){
  .deal-card__grid{ grid-template-columns: 1fr; }
  .deal-card__actions{ justify-content: flex-start; }
}
