/* =========================================================================
   DealerMaster — "Prairie Fintech" refresh (2026)
   A warm, premium reskin layered over neon_glass.css. Loaded LAST so it wins
   the cascade; all rules scoped to body.theme-neon for safety.
   Palette: brushed gold (cattle/grain/money) + sage (finance) on warm charcoal.
   ========================================================================= */

body.theme-neon {
  /* ---- tokens ---- */
  --fg:        #f3ede1;
  --muted:     rgba(243, 237, 225, .62);
  --muted-2:   rgba(243, 237, 225, .42);
  --border:    rgba(255, 255, 255, .09);

  --gold:      #f4b740;
  --gold-soft: #ffd585;
  --gold-deep: #e7a52c;
  --sage:      #5fd0a0;
  --rose:      #ff8a7a;

  --accent:     var(--gold);
  --link:       var(--gold);
  --link-hover: var(--gold-soft);

  --font-display: "Space Grotesk", system-ui, "Segoe UI", sans-serif;
  --font-body:    "Inter", system-ui, "Segoe UI", Tahoma, sans-serif;

  /* ---- warm-charcoal backdrop with gold + sage aurora ---- */
  background:
    radial-gradient(1100px 620px at 10% -8%, rgba(244, 183, 64, .12), transparent 55%),
    radial-gradient(1000px 680px at 102% 4%, rgba(95, 208, 160, .08), transparent 58%),
    linear-gradient(168deg, #15110c 0%, #1c1812 46%, #110e0a 100%) fixed !important;
  color: var(--fg);
  font-family: var(--font-body);
  letter-spacing: .005em;
}

/* ---- typography ---- */
body.theme-neon h1,
body.theme-neon h2,
body.theme-neon h3,
body.theme-neon h4,
body.theme-neon .sidebar__title,
body.theme-neon .page-title,
body.theme-neon .card-title,
body.theme-neon .section-title {
  font-family: var(--font-display);
  text-shadow: none;          /* kill the cyan glow */
  letter-spacing: -.01em;
  font-weight: 600;
}
body.theme-neon h1, body.theme-neon h2 { color: var(--fg); }
body.theme-neon .card-title,
body.theme-neon .section-title { color: var(--gold-soft); }
body.theme-neon .page-title { color: var(--fg); }

body.theme-neon a { color: var(--link); }
body.theme-neon a:hover { color: var(--link-hover); }
body.theme-neon .muted,
body.theme-neon .text-muted { color: var(--muted) !important; }
body.theme-neon .form-help { color: var(--muted); font-size: .82rem; }

/* ---- glass cards: softer, warmer, no janky page-wide hover lift ---- */
body.theme-neon .neon-glass-card,
body.theme-neon .neon-card {
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.022));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 20px 44px -24px rgba(0,0,0,.75);
}
body.theme-neon .neon-glass-card:hover {
  transform: none;            /* stop the whole shell from lifting */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 20px 44px -24px rgba(0,0,0,.75);
}

/* The top context bar: slim with a hairline gold accent */
body.theme-neon .context-bar {
  border-top: 2px solid rgba(244,183,64,.55);
  padding: .7rem 1.1rem;
}

/* ---- buttons ---- */
body.theme-neon .btn-glass {
  background: rgba(255,255,255,.06);
  color: var(--fg);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 11px;
  padding: .5rem .95rem;
  font-weight: 600;
  letter-spacing: .01em;
  box-shadow: none;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease, color .16s ease;
}
body.theme-neon .btn-glass:hover {
  background: rgba(244,183,64,.14);
  color: var(--gold-soft);
  border-color: rgba(244,183,64,.5);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -10px rgba(244,183,64,.6);
}

/* Primary actions (submit buttons) get a solid gold fill automatically */
body.theme-neon button.btn-glass[type="submit"],
body.theme-neon input.btn-glass[type="submit"] {
  background: linear-gradient(180deg, #f7c453, var(--gold-deep));
  color: #2a1e07;
  border-color: rgba(244,183,64,.7);
  font-weight: 700;
}
body.theme-neon button.btn-glass[type="submit"]:hover,
body.theme-neon input.btn-glass[type="submit"]:hover {
  background: linear-gradient(180deg, #ffd072, #f0b13a);
  color: #2a1e07;
  box-shadow: 0 10px 26px -10px rgba(244,183,64,.65);
}

/* Bootstrap outline buttons retinted to the warm palette */
body.theme-neon .btn-outline-info     { color: var(--gold);  border-color: rgba(244,183,64,.5); }
body.theme-neon .btn-outline-info:hover{ background: rgba(244,183,64,.16); color: var(--gold-soft); border-color: var(--gold); }
body.theme-neon .btn-outline-warning  { color: #f0a85a; border-color: rgba(240,168,90,.5); }
body.theme-neon .btn-outline-warning:hover{ background: rgba(240,168,90,.16); color: #ffc488; border-color: #f0a85a; }
body.theme-neon .btn-outline-success  { color: var(--sage);  border-color: rgba(95,208,160,.5); }
body.theme-neon .btn-outline-success:hover{ background: rgba(95,208,160,.16); color: #9af0cb; border-color: var(--sage); }
body.theme-neon .btn-outline-secondary{ color: var(--muted); border-color: rgba(255,255,255,.18); }
body.theme-neon .btn-outline-secondary:hover{ background: rgba(255,255,255,.08); color: var(--fg); border-color: rgba(255,255,255,.3); }

/* ---- tables ---- */
body.theme-neon .table,
body.theme-neon .q-table,
body.theme-neon .data-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--fg);
  color: var(--fg);
  border-color: rgba(255,255,255,.08);
}
body.theme-neon .table > thead th,
body.theme-neon .q-table thead th,
body.theme-neon .data-table thead th {
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .07em;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid rgba(244,183,64,.28);
}
body.theme-neon .table-hover > tbody > tr:hover,
body.theme-neon .q-table tbody tr:hover {
  background: rgba(244,183,64,.07) !important;
}
body.theme-neon .table tfoot th,
body.theme-neon .table tfoot td,
body.theme-neon .q-table tfoot th {
  border-top: 1px solid rgba(244,183,64,.3);
  color: var(--gold-soft);
  font-weight: 700;
}

/* ---- inputs ---- */
body.theme-neon .form-control,
body.theme-neon .form-select,
body.theme-neon .input-glass,
body.theme-neon .textarea-glass,
body.theme-neon select.input-glass {
  background: rgba(0,0,0,.28);
  color: var(--fg);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 11px;
}
body.theme-neon .form-control::placeholder,
body.theme-neon .input-glass::placeholder { color: var(--muted-2); }
body.theme-neon .form-control:focus,
body.theme-neon .form-select:focus,
body.theme-neon .input-glass:focus,
body.theme-neon .textarea-glass:focus,
body.theme-neon select.input-glass:focus {
  border-color: rgba(244,183,64,.6);
  box-shadow: 0 0 0 .18rem rgba(244,183,64,.14);
  outline: none;
}

/* ---- sidebar ---- */
body.theme-neon .sidebar__title {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: 1.18rem;
  color: var(--fg);
}
body.theme-neon .sidebar__title::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f7c453, var(--gold-deep));
  box-shadow: 0 0 12px rgba(244,183,64,.6);
}
body.theme-neon .sidebar__link {
  border-radius: 11px;
  color: var(--muted);
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
body.theme-neon .sidebar__link:hover {
  background: rgba(244,183,64,.10);
  border-color: rgba(244,183,64,.22);
  color: var(--fg);
  transform: translateX(2px);
}
body.theme-neon .sidebar__link.is-active {
  background: rgba(244,183,64,.15);
  border-color: rgba(244,183,64,.42);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--gold);
}
body.theme-neon .sidebar__code { color: rgba(244,183,64,.72); }
body.theme-neon .sidebar__group {
  color: var(--muted-2);
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .08em;
}

/* Tidy sidebar scrollbar */
body.theme-neon .glass--sidebar::-webkit-scrollbar { width: 8px; }
body.theme-neon .glass--sidebar::-webkit-scrollbar-thumb {
  background: rgba(244,183,64,.25);
  border-radius: 8px;
}
body.theme-neon .glass--sidebar::-webkit-scrollbar-track { background: transparent; }

/* ---- helper components used across forms ---- */
body.theme-neon .alert-glass {
  background: rgba(244,183,64,.08);
  border: 1px solid rgba(244,183,64,.32);
  border-radius: 12px;
  padding: .75rem 1rem;
}
body.theme-neon .form-error-block {
  background: rgba(255,138,122,.10);
  border: 1px solid rgba(255,138,122,.4);
  border-radius: 12px;
  padding: .6rem .9rem;
  color: #ffcfc7;
}
body.theme-neon .badge-glass {
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(244,183,64,.3);
  color: var(--gold-soft);
}

/* ---- kill leftover debug / off-theme cruft ---- */
body.theme-neon .glow-success { outline: none !important; }   /* removes the hotpink debug outline */

/* ---- shared layout primitives (these classes were used in templates but never
   defined in any CSS, so cards stacked with no gap and headers overlapped) ---- */
body.theme-neon .page-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  margin-bottom: 1.15rem;
}
body.theme-neon .page-header__meta {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.05rem;
  min-width: 0;
}

body.theme-neon .form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}
body.theme-neon .form-grid-2 .span-2 { grid-column: 1 / -1; }
@media (max-width: 720px) {
  body.theme-neon .form-grid-2 { grid-template-columns: 1fr; }
}

/* Vertical rhythm between stacked top-level content blocks (cards, grids, header).
   Covers both bare content and content wrapped in a <form> (e.g. the quick entry
   form). Direct children only, so cards inside a .form-grid-2 keep their grid gap. */
body.theme-neon .main-content > * + *,
body.theme-neon .main-content > form > * + * { margin-top: 1.15rem; }

/* Form field grouping inside the grid. */
body.theme-neon .form-group { display: flex; flex-direction: column; gap: .3rem; }
body.theme-neon .form-label { font-weight: 600; color: var(--muted); font-size: .85rem; }
