/*
  DealerBo Theme
  - clean & bright (white/gray)
  - blue/green structure
  - orange used like "game UI" lighting for attention
  Keep it simple: mostly Bootstrap + a few custom classes.
*/

:root{
  /* Surfaces */
  /* Make the overall app background clean white (requested). */
  --bg0:#ffffff;
  --bg1:#ffffff;
  --bg2:#f7f8fb;

  /* Ink */
  --ink:#14161a;
  --muted: rgba(20,22,26,.64);

  /* Lines */
  --border: rgba(20,22,26,.12);
  --border2: rgba(20,22,26,.18);

  /* Brand (from your palette) */
  --orange:#F7931A;
  --blue:#4E9BD8;
  --green:#67B246;
  --gray:#5B6670;
  --yellow:#FFC107; /* used for GM pills/buttons */

  --orangeSoft: rgba(247,147,26,.14);
  --blueSoft: rgba(78,155,216,.12);
  --greenSoft: rgba(103,178,70,.12);

  /* Status palette (subtle, readable) */
  --pillBg: rgba(20,22,26,.06);
  --pillBd: rgba(20,22,26,.14);

  --stgBlueBg: rgba(78,155,216,.10);
  --stgBlueBd: rgba(78,155,216,.22);

  --stgGreenBg: rgba(103,178,70,.10);
  --stgGreenBd: rgba(103,178,70,.22);

  --stgOrangeBg: rgba(247,147,26,.12);
  --stgOrangeBd: rgba(247,147,26,.28);

  --stgGrayBg: rgba(148,163,184,.18);
  --stgGrayBd: rgba(148,163,184,.34);

  /* Effects */
  --shadow: 0 16px 40px rgba(10,12,16,.12);
  --shadow2: 0 10px 24px rgba(10,12,16,.10);
  --shadow1: 0 12px 32px rgba(10,12,16,.10);

  --radius:16px;
  --radius2:14px;

  /* Layout */
  --sidebar:#ffffff;
  --sidebar2:#f6f7fb;

  /* Chrome tint surfaces (sidebar + drawers). Controlled by data-chrometint. */
  --chromeSidebar: var(--sidebar2);
  --chromeDrawer: rgba(255,255,255,.98);
  --chromeDrawerHeader: rgba(255,255,255,.98);
  --chromeDrawerSection: rgba(255,255,255,.98);

  /* Accent used for tinted table headers/chips (bonus) */
  --accent: rgba(247,147,26,.95);
  --accentSoft: rgba(247,147,26,.10);

  /* Type */
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

/* Small utility tones (used across templates) */
.subtle{ color: var(--muted) !important; }
.u-username{ color: var(--muted) !important; }

body{
  color: var(--ink);
  font-family: var(--sans);
  /* Satellite background image (optional). File: /static/base_background.png */
  background: var(--bg0) url("/static/base_background.png") center / cover no-repeat fixed;
  overflow-x:hidden;
overflow-x:hidden;
}

/* Font presets (controlled via Settings > Display)
   Applied broadly (tables/cards/buttons/forms) so the whole UI actually changes. */
:root{ --uiFont: var(--sans); }
:root[data-uifont="system"]{ --uiFont: var(--sans); }
:root[data-uifont="inter"]{ --uiFont: Inter, var(--sans); }
:root[data-uifont="roboto"]{ --uiFont: Roboto, var(--sans); }
:root[data-uifont="source_sans"]{ --uiFont: "Source Sans 3", "Source Sans Pro", var(--sans); }
:root[data-uifont="mono"]{ --uiFont: var(--mono); }

html, body,
.btn, .card, .table, .dropdown-menu, .modal, .offcanvas,
input, select, textarea, .form-control, .form-select{
  font-family: var(--uiFont) !important;
}
.mono, .mono *{ font-family: var(--mono) !important; }


/* Soft background, with subtle diagonal corner (inspired by your reference images) */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events:none;
  background:
    radial-gradient(900px 380px at 20% -140px, rgba(78,155,216,.14), transparent 60%),
    radial-gradient(820px 440px at 95% 110%, rgba(103,178,70,.10), transparent 60%),
    radial-gradient(900px 380px at 55% -140px, rgba(247,147,26,.12), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,0));
  /* Keep the page neutral; tint lives in the chrome (sidebar/drawers). */
  opacity: .0;
}

body::after{
  content:"";
  display:none; /* removed decorative stripes for a cleaner neutral backdrop */
}

/* Helpers */
.mono{ font-family: var(--mono); }
.soft-hr{ border-top: 1px solid var(--border) !important; opacity: 1; }
.text-muted{ color: var(--muted) !important; }
.accent{ color: var(--orange) !important; }

a{ color: #1f6ea8; text-decoration: none; }
a:hover{ color: #185b8a; text-decoration: underline; }

/* ====== Layout shell ====== */
.shell{
  min-height: 100vh;
  display:flex;
  position:relative;
  z-index:1;
}

/* ====== Sidebar ====== */
.sidebar{
  width: 252px;
  padding: 10px;
  display:flex;
  flex-direction:column;
  gap: 10px;

  background: var(--sidebar);

  border-right: 1px solid var(--border);
  box-shadow: 12px 0 28px rgba(10,12,16,.06);

  position: sticky;
  top: 0;
  height: 100vh;
}

/* App chrome tint (sidebar + drawer surfaces)
   Enabled by default; disable via Settings > Display. */
:root .sidebar{ background: var(--chromeSidebar); }


/* Chrome tint palette (subtle by default) */
:root[data-chrometint="blue"]{
  --chromeSidebar:#f2f5ff;
  --chromeDrawer: rgba(27,118,255,.10);
  --chromeDrawerHeader: radial-gradient(900px 240px at 12% 0%, rgba(27,118,255,.20), transparent 60%), rgba(255,255,255,.96);
  --accent: rgba(27,118,255,.95);
  --accentSoft: rgba(27,118,255,.12);
}
:root[data-chrometint="gray"]{
  --chromeSidebar:#f2f4f7;
  --chromeDrawer: rgba(100,116,139,.10);
  --chromeDrawerHeader: radial-gradient(900px 240px at 12% 0%, rgba(100,116,139,.16), transparent 60%), rgba(255,255,255,.96);
  --accent: rgba(100,116,139,.95);
  --accentSoft: rgba(100,116,139,.12);
}
:root[data-chrometint="green"]{
  --chromeSidebar: rgba(103,178,70,.10);
  --chromeDrawer: rgba(69,191,85,.07);
  --chromeDrawerHeader: radial-gradient(900px 240px at 12% 0%, rgba(69,191,85,.14), transparent 60%), rgba(255,255,255,.94);
  --accent: rgba(69,191,85,.95);
  --accentSoft: rgba(69,191,85,.10);
}
:root[data-chrometint="orange"]{
  --chromeSidebar: rgba(247,147,26,.10);
  --chromeDrawer: rgba(255,109,31,.07);
  --chromeDrawerHeader: radial-gradient(900px 240px at 12% 0%, rgba(255,109,31,.14), transparent 60%), rgba(255,255,255,.94);
  --accent: rgba(255,109,31,.95);
  --accentSoft: rgba(255,109,31,.10);
}
:root[data-chrometint="purple"]{
  --chromeSidebar: rgba(167,139,250,.12);
  --chromeDrawer: rgba(167,139,250,.08);
  --chromeDrawerHeader: radial-gradient(900px 240px at 12% 0%, rgba(167,139,250,.16), transparent 60%), rgba(255,255,255,.94);
  --accent: rgba(167,139,250,.95);
  --accentSoft: rgba(167,139,250,.12);
}
:root[data-chrometint="teal"]{
  --chromeSidebar: rgba(45,212,191,.12);
  --chromeDrawer: rgba(45,212,191,.08);
  --chromeDrawerHeader: radial-gradient(900px 240px at 12% 0%, rgba(45,212,191,.16), transparent 60%), rgba(255,255,255,.94);
  --accent: rgba(45,212,191,.95);
  --accentSoft: rgba(45,212,191,.12);
}
:root[data-chrometint="pink"]{
  --chromeSidebar: rgba(236,72,153,.10);
  --chromeDrawer: rgba(255,255,255,.93);
  --chromeDrawerHeader: radial-gradient(900px 240px at 12% 0%, rgba(236,72,153,.14), transparent 60%), rgba(255,255,255,.94);
  --accent: rgba(236,72,153,.95);
  --accentSoft: rgba(236,72,153,.10);
}
:root[data-chrometint="yellow"]{
  --chromeSidebar: rgba(250,204,21,.12);
  --chromeDrawer: rgba(255,255,255,.93);
  --chromeDrawerHeader: radial-gradient(900px 240px at 12% 0%, rgba(250,204,21,.16), transparent 60%), rgba(255,255,255,.94);
  --accent: rgba(250,204,21,.95);
  --accentSoft: rgba(250,204,21,.12);
}
:root[data-chrometint="red"]{
  --chromeSidebar: rgba(239,68,68,.10);
  --chromeDrawer: rgba(255,255,255,.93);
  --chromeDrawerHeader: radial-gradient(900px 240px at 12% 0%, rgba(239,68,68,.14), transparent 60%), rgba(255,255,255,.94);
  --accent: rgba(239,68,68,.95);
  --accentSoft: rgba(239,68,68,.10);
}
:root[data-chrometint="slate"]{
  --chromeSidebar: rgba(100,116,139,.14);
  --chromeDrawer: rgba(100,116,139,.10);
  --chromeDrawerHeader: radial-gradient(900px 240px at 12% 0%, rgba(100,116,139,.18), transparent 60%), rgba(255,255,255,.96);
  --accent: rgba(100,116,139,.95);
  --accentSoft: rgba(100,116,139,.12);
}

/* More neutral tints (requested): lighter/darker variants + base tones */
:root[data-chrometint="ice"]{
  --chromeSidebar:#f7fafc;
  --chromeDrawer: rgba(255,255,255,.94);
  --chromeDrawerHeader: rgba(255,255,255,.95);
  --accent: rgba(59,130,246,.95);
  --accentSoft: rgba(59,130,246,.08);
}
:root[data-chrometint="steel"]{
  --chromeSidebar:#f2f4f6;
  --chromeDrawer: rgba(71,85,105,.08);
  --chromeDrawerHeader: radial-gradient(900px 240px at 12% 0%, rgba(71,85,105,.14), transparent 60%), rgba(255,255,255,.96);
  --accent: rgba(71,85,105,.95);
  --accentSoft: rgba(71,85,105,.12);
}
:root[data-chrometint="sand"]{
  --chromeSidebar: rgba(245,158,11,.12);
  --chromeDrawer: rgba(245,158,11,.08);
  --chromeDrawerHeader: radial-gradient(900px 240px at 12% 0%, rgba(245,158,11,.16), transparent 60%), rgba(255,255,255,.96);
  --accent: rgba(245,158,11,.95);
  --accentSoft: rgba(245,158,11,.12);
}
:root[data-chrometint="smoke"]{
  --chromeSidebar:#f1f2f4;
  --chromeDrawer: rgba(148,163,184,.10);
  --chromeDrawerHeader: radial-gradient(900px 240px at 12% 0%, rgba(148,163,184,.16), transparent 60%), rgba(255,255,255,.96);
  --accent: rgba(100,116,139,.95);
  --accentSoft: rgba(100,116,139,.10);
}
:root[data-chrometint="midnight"]{
  --chromeSidebar: rgba(30,41,59,.14);
  --chromeDrawer: rgba(30,41,59,.10);
  --chromeDrawerHeader: radial-gradient(900px 240px at 12% 0%, rgba(30,41,59,.18), transparent 60%), rgba(255,255,255,.96);
  --accent: rgba(30,41,59,.95);
  --accentSoft: rgba(30,41,59,.12);
}
:root[data-chrometint="none"]{
  --chromeSidebar:#ffffff;
  --chromeDrawer:#ffffff;
  --chromeDrawerHeader:#ffffff;
}

/* Fades / gradients */
:root[data-chrometint="rainbow"]{
  --chromeSidebar: linear-gradient(180deg, rgba(255,0,128,.07), rgba(255,165,0,.06), rgba(250,204,21,.06), rgba(69,191,85,.06), rgba(27,118,255,.06));
  --chromeDrawer: rgba(255,255,255,.93);
  --chromeDrawerHeader: linear-gradient(90deg, rgba(255,0,128,.16), rgba(255,165,0,.12), rgba(27,118,255,.14));
  --accent: rgba(27,118,255,.95);
  --accentSoft: rgba(27,118,255,.10);
}
:root[data-chrometint="halloween_fade"]{
  --chromeSidebar: linear-gradient(180deg, rgba(255,109,31,.16), rgba(17,24,39,.04));
  --chromeDrawer: rgba(255,255,255,.93);
  --chromeDrawerHeader: linear-gradient(90deg, rgba(255,109,31,.20), rgba(17,24,39,.06));
  --accent: rgba(255,109,31,.95);
  --accentSoft: rgba(255,109,31,.10);
}
:root[data-chrometint="utes"]{
  --chromeSidebar: linear-gradient(180deg, rgba(180,16,33,.14), rgba(255,255,255,0));
  --chromeDrawer: rgba(255,255,255,.93);
  --chromeDrawerHeader: linear-gradient(90deg, rgba(180,16,33,.22), rgba(255,255,255,.80));
  --accent: rgba(180,16,33,.95);
  --accentSoft: rgba(180,16,33,.10);
}
:root[data-chrometint="cougars"]{
  --chromeSidebar: linear-gradient(180deg, rgba(0,51,160,.12), rgba(255,255,255,0));
  --chromeDrawer: rgba(255,255,255,.93);
  --chromeDrawerHeader: linear-gradient(90deg, rgba(0,51,160,.20), rgba(255,255,255,.84));
  --accent: rgba(0,51,160,.95);
  --accentSoft: rgba(0,51,160,.10);
}
:root[data-chrometint="sunset"]{
  --chromeSidebar: linear-gradient(180deg, rgba(255,109,31,.14), rgba(236,72,153,.10), rgba(167,139,250,.08));
  --chromeDrawer: rgba(255,255,255,.93);
  --chromeDrawerHeader: linear-gradient(90deg, rgba(255,109,31,.18), rgba(236,72,153,.14), rgba(167,139,250,.12));
  --accent: rgba(236,72,153,.95);
  --accentSoft: rgba(236,72,153,.10);
}
:root[data-chrometint="ocean"]{
  --chromeSidebar: linear-gradient(180deg, rgba(27,118,255,.12), rgba(45,212,191,.10));
  --chromeDrawer: rgba(255,255,255,.93);
  --chromeDrawerHeader: linear-gradient(90deg, rgba(27,118,255,.18), rgba(45,212,191,.14));
  --accent: rgba(27,118,255,.95);
  --accentSoft: rgba(27,118,255,.10);
}
:root[data-chrometint="forest"]{
  --chromeSidebar: linear-gradient(180deg, rgba(34,197,94,.14), rgba(100,116,139,.06));
  --chromeDrawer: rgba(255,255,255,.93);
  --chromeDrawerHeader: linear-gradient(90deg, rgba(34,197,94,.18), rgba(100,116,139,.10));
  --accent: rgba(34,197,94,.95);
  --accentSoft: rgba(34,197,94,.10);
}



.brand{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px 12px 10px;
  border-radius: var(--radius2);

  background: rgba(255,255,255,.90);
  border: 1px solid var(--border);
  box-shadow: var(--shadow2);
  position: relative;
  overflow:hidden;
}

.brand::after{
  content:"";
  position:absolute;
  left:0;
  top:0;
  height: 4px;
  width:100%;
  background: linear-gradient(90deg, var(--orange), rgba(247,147,26,.55), transparent);
  opacity:.95;
}

.logo{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(20,22,26,.03);
  border: 1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.logo img{ height: 30px; width:auto; display:block; }

.brand .title{
  font-weight: 950;
  letter-spacing:.2px;
  line-height:1;
}
.brand .sub{
  color: var(--muted);
  font-size:.82rem;
  line-height:1.1;
  font-weight: 750;
}

/* sidebar scroll */
.navblock{ padding: 6px 6px; flex: 1 1 auto; overflow:auto; }
.navblock::-webkit-scrollbar{ width: 10px; }
.navblock::-webkit-scrollbar-thumb{ background: rgba(20,22,26,.16); border-radius: 999px; }
.navblock::-webkit-scrollbar-track{ background: transparent; }

.sb-section{
  margin-top: 10px;
  margin-bottom: 8px;
  padding: 0 6px;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(20,22,26,.52);
  font-weight: 900;
}

.sb-link{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  color: rgba(20,22,26,.88);
  text-decoration:none;
  font-weight: 900;
  font-size: .88rem;
  margin-bottom: 4px;
  border: 1px solid transparent;
  background: transparent;
  transition: transform .08s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.sb-link:hover{
  background: rgba(20,22,26,.03);
  border-color: var(--border);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(10,12,16,.06);
}

.sb-link.active{
  background: var(--orangeSoft);
  border-color: rgba(247,147,26,.35);
  color: var(--ink);
  position: relative;
}
.sb-link.active::after{
  content:"";
  position:absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 999px;
  background: var(--orange);
  opacity: .95;
}

.sb-ico{ width: 20px; text-align:center; opacity:.95; }

.sb-footer{
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.sb-logout{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  color: rgba(20,22,26,.90);
  text-decoration:none;
  font-weight: 900;
  box-shadow: var(--shadow2);
}
.sb-logout:hover{
  background: #fff;
  border-color: var(--border2);
  color: var(--ink);
}

/* ====== Main ====== */
main{
  flex: 1;
  padding: 18px;
  min-width: 0;
  position:relative;
  z-index:1;
}

.page-wrap{ max-width: 1550px; margin: 0 auto; }

.topbar{
  background: rgba(255,255,255,.74);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding: 12px 14px;
  margin-bottom: 14px;
  display:flex;
  justify-content: space-between;
  align-items:center;
  position: sticky;
  top: 12px;
  z-index: 20;
}

.topbar::after{
  content:"";
  position:absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  opacity:.68;
}

.crumb{ display:flex; align-items:center; gap: 10px; min-width:0; }
.crumb .app{ font-weight: 950; letter-spacing:.2px; color: var(--orange); }
.crumb .path{
  color: rgba(20,22,26,.55);
  font-size:.88rem;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
  font-weight: 750;
}

.userchip{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow2);
  font-weight: 900;
  color: rgba(20,22,26,.82);
}

/* ====== Cards / tables ====== */
.page-card{
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-body{ padding: 12px; }

/* ====== CD-style page header + controls (reusable) ====== */
.db-page-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom: 12px;
}

/* Back-compat: older templates used page-head/subhint/chip/controls. Keep them identical. */
.page-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom: 12px; }
.page-head h3, .page-head h2{ margin:0; font-weight: 950; letter-spacing: .2px; color: var(--ink); }
.subhint{ color: var(--muted); font-size: .92rem; font-weight: 650; }
.chip{ display:inline-flex; align-items:center; gap:8px; padding: 7px 11px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,.85); box-shadow: 0 8px 16px rgba(10,12,16,.06); font-weight: 950; color: var(--ink); }
.chip-dot{ width: 8px; height: 8px; border-radius: 999px; background: var(--orange); box-shadow: 0 0 0 4px rgba(255,109,31,.16); }

.controls{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom: 12px;
  padding: 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: rgba(255,255,255,.92); box-shadow: var(--shadow);
}
.controls .grow{ flex: 1 1 360px; min-width: 320px; }

/* Filters card helper (used by multiple pages) */
.db-filters{ border-radius: var(--radius); }
.db-filters .form-label.help{ font-weight: 850; letter-spacing: .2px; }
.db-page-head h3, .db-page-head h2{
  margin:0;
  font-weight: 950;
  letter-spacing: .2px;
  color: var(--ink);
}
.db-subhint{ color: var(--muted); font-size: .92rem; font-weight: 650; }

.db-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  box-shadow: 0 8px 16px rgba(10,12,16,.06);
  font-weight: 950;
  color: var(--ink);
}
.db-chip-dot{
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(255,109,31,.16);
}

.db-controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  margin-bottom: 12px;
}
.db-controls .grow{ flex: 1 1 360px; min-width: 320px; }

.db-make-toggle .btn{
  border-radius: 999px !important;
  font-weight: 950;
  letter-spacing: .35px;
  padding: .35rem .75rem;
  border-color: rgba(20,22,26,.16);
  color: rgba(20,22,26,.86);
  background: rgba(255,255,255,.70);
}
.db-make-toggle .btn:hover{
  border-color: rgba(20,22,26,.24);
  background: rgba(255,255,255,.92);
}

/* Optional danger pill inside a make-toggle group (eg Trash) */
.db-make-toggle .btn.db-danger{
  border-color: rgba(220,53,69,.28);
  color: rgba(220,53,69,.92);
}
.db-make-toggle .btn.db-danger:hover{
  border-color: rgba(220,53,69,.40);
  background: rgba(220,53,69,.06);
}
.db-make-toggle .btn.db-danger.active{
  border-color: rgba(220,53,69,.40);
  background: rgba(220,53,69,.10);
  box-shadow: 0 10px 18px rgba(220,53,69,.12);
  color: rgba(220,53,69,.96);
}
.db-make-toggle .btn.active{
  color:#0f1216;
  border-color: rgba(255,109,31,.40);
  background: rgba(255,109,31,.14);
  box-shadow: 0 10px 18px rgba(255,109,31,.12);
}

.db-table-scroll{
  height: calc(100vh - 260px);
  overflow: auto;
}

/* ====== Tables ====== */
/* Density system (global) */
:root{
  --tblFont: .90rem;
  --tblHeadFont: .74rem;
  --tblPadY: .34rem;
  --tblPadX: .55rem;
}
:root[data-density="compact"]{
  --tblFont: .80rem;
  --tblHeadFont: .70rem;
  --tblPadY: .18rem;
  --tblPadX: .40rem;
}

.table-compact{ font-size: var(--tblFont); }
.table-compact th, .table-compact td{ padding: var(--tblPadY) var(--tblPadX); }
.table-compact thead th{ font-size: var(--tblHeadFont) !important; letter-spacing: .08em; }
.table-compact .btn{ padding: .16rem .42rem; font-weight: 800; }

.db-table{
  /* Solid header background (no see-through). */
  --tblHeadBg: #f1f2f4;
  --tblHeadBd: rgba(20,22,26,.16);
  --tblRowHover: var(--accentSoft);
  border-color: var(--border) !important;
}
.db-table thead th{
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--tblHeadBg) !important;
  border-bottom: 1px solid var(--tblHeadBd) !important;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: var(--tblHeadFont);
  /* Left-align by default so columns feel "scannable" and consistent.
     Use Bootstrap utilities (text-center/text-end) per-column when needed. */
  text-align: left;
  vertical-align: middle;
  font-weight: 950;
}

/* Default: let columns pack tighter (more like Excel). Resizing still works. */
.db-table{ table-layout: auto; width: 100%; }
.db-table td{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-table td.db-wrap{ white-space: normal; }



/* Force table ink to be black (Excel-like). Bootstrap .text-muted still wins for muted labels. */
.db-table td, .db-table th{ color: var(--ink); }
.db-table td a{ color: var(--ink); text-decoration: none; }
.db-table td a:hover{ text-decoration: underline; }
.db-table thead th{ color: var(--ink) !important; }

/* Apply density vars to ALL db tables.
   Bootstrap's .table rules set padding; we use !important so density actually changes everywhere. */
.db-table td, .db-table th{ padding: var(--tblPadY) var(--tblPadX) !important; }
.db-table td{ font-size: var(--tblFont) !important; }
.db-table thead th{ font-size: var(--tblHeadFont) !important; }

/* Column resize grip */
/* Column resize removed */
.db-table thead th:hover .db-col-resizer::after{ opacity: 1; }

/* Sticky actions column helper */
.db-sticky-right{
  position: sticky;
  right: 0;
  z-index: 2;
  background: inherit;
}

/* ====== Drawer (reusable) ====== */
.db-drawer-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(10,12,16,.35);
  backdrop-filter: blur(2px);
  z-index: 1035;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}

/* ====== Excel-like column menu (sort + filter) ====== */
.db-colfilter{ cursor: pointer; position: relative; user-select: none; }
.db-colfilter .db-colfilter-ind{ margin-left: .35rem; opacity: .55; font-size: .85em; }
.db-colfilter.db-filtered .db-colfilter-ind{ opacity: 1; }

.db-colmenu{
  position: fixed;
  z-index: 1045;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: 70vh;
  overflow: hidden;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(20,22,26,.14);
  border-radius: 16px;
  box-shadow: var(--shadow2);
}
.db-colmenu-title{
  padding: 12px 14px;
  font-weight: 950;
  border-bottom: 1px solid rgba(20,22,26,.10);
}
.db-colmenu-actions{
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(20,22,26,.10);
}
.db-colmenu-actions .btn{ border-radius: 12px; font-weight: 900; }

.db-colmenu-foot{
  display:flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(20,22,26,.10);
  justify-content: flex-end;
  flex-wrap: wrap;
}
.db-colmenu-list{
  padding: 8px 10px 12px;
  overflow: auto;
  max-height: calc(70vh - 110px);
}
.db-colmenu-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
}
.db-colmenu-item:hover{ background: rgba(20,22,26,.05); }
.db-colmenu-item input{ transform: translateY(1px); }
.db-drawer-backdrop.show{ opacity: 1; pointer-events: auto; }

/* Variant: no dim/blur (keeps workflow moving) */
.db-drawer-backdrop.transparent{
  background: transparent;
  backdrop-filter: none;
  /* IMPORTANT: pointer-events stay disabled unless .show is present.
     Otherwise an invisible backdrop blocks the whole page. */
}

.db-drawer{
  position: fixed;
  top: 76px;
  right: 14px;
  height: calc(100vh - 98px);
  width: 0;
  background: var(--chromeDrawer);
  border: 1px solid rgba(20,22,26,.14);
  border-radius: var(--radius);
  box-shadow: -18px 0 40px rgba(10,12,16,.18);
  overflow: hidden;
  transition: width .18s ease;
  display:flex;
  flex-direction:column;
  z-index: 1045;
}
.db-drawer.open{ width: min(680px, 95vw); }

.db-drawer-header{
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(20,22,26,.12);
  display:flex;
  flex-direction: column;
  align-items:flex-start;
  justify-content:flex-start;
  gap: 10px;
  position: relative;
  background: var(--chromeDrawerHeader);
}

/* Drawer header actions: horizontal row UNDER the header info */
.db-drawer-actions{
  display:flex;
  flex-direction: row;
  align-items:center;
  justify-content:flex-start;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  width: 100%;
}

.db-drawer-actions .btn{ white-space: nowrap; }

/* App chrome tint toggle (Settings > Display)
   Legacy support: data-drawertint="0" also disables tint. */
:root[data-chrometint="none"] .db-drawer,
:root[data-chrometint="none"] .db-drawer-header{ background:#ffffff !important; }

/* Drawer header button consistency */
.db-drawer-header .btn,
.drawer-header .btn{
  border-radius: 12px;
  font-weight: 900;
  letter-spacing: .01em;
  padding: .35rem .65rem;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.db-drawer-header .btn i,
.drawer-header .btn i{ margin-right: .15rem; }



.db-drawer-body{ padding: 14px; overflow:auto; height: 100%; }

.db-drawer-section{
  border: 1px solid rgba(20,22,26,.12);
  border-radius: var(--radius2);
  padding: 12px;
  margin-bottom: 12px;
  background: var(--chromeDrawerSection);
  box-shadow: 0 12px 22px rgba(10,12,16,.08);
}

.db-drawer .form-control,
.db-drawer .form-select{
  border-radius: 12px;
  border-color: rgba(20,22,26,.18);
  font-weight: 800;
}

/* Sort UI (base.html adds these classes) */
.db-table thead th.db-sortable{
  cursor: pointer;
  user-select: none;
}
.db-table thead th.db-sortable:hover{
  background: rgba(20,22,26,.04) !important;
}
.db-table thead th.db-sortable .db-sort-ind{
  display: inline-block;
  margin-left: .35rem;
  opacity: .55;
  transform: translateY(-1px);
}
.db-table thead th[data-sort-dir="asc"] .db-sort-ind{ opacity: .95; }
.db-table thead th[data-sort-dir="desc"] .db-sort-ind{ opacity: .95; }
.db-table tbody td{ vertical-align: middle; }
.db-table td, .db-table th{ border-color: rgba(20,22,26,.10) !important; }
.db-table tbody tr{ transition: background-color .12s ease, box-shadow .12s ease; }
.db-table tbody tr:hover{ background: var(--tblRowHover) !important; }

/* Zebra striping (subtle) — should not interfere with OEM hover colors. */
.db-table./* Zebra striping (subtle but visible) */
.db-zebra.table>:not(caption)>tbody>tr:nth-of-type(even)>*{
  background-color: rgba(20,22,26,.04) !important;
}
/* Fallback for non-Bootstrap tables */
.db-zebra tbody tr:nth-of-type(even)>*{ background-color: rgba(20,22,26,.04) !important; }

/* keep odd rows clean */
.db-zebra.table>:not(caption)>tbody>tr:nth-of-type(odd)>*{
  background-color: transparent !important;
}


/* ====== Tables (uniform) ====== */
:root{
  /* Table headers should be solid (not transparent) so they feel consistent across pages/drawers */
  --db-header-bg: #eef1f5;
  --db-header-border: rgba(20,22,26,.14);
  --db-cell-pad-y: 10px;
  --db-cell-pad-x: 12px;
  --db-header-font-size: .78rem;
}

/* Header look */
.db-table thead th{
  background-color: var(--db-header-bg) !important;
  color: rgba(20,22,26,.78) !important;
  font-weight: 950 !important;
  font-size: var(--db-header-font-size) !important;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: calc(var(--db-cell-pad-y) + 2px) var(--db-cell-pad-x) !important;
  border-bottom: 1px solid var(--db-header-border) !important;
  vertical-align: middle;
}

/* Body cells */
.db-table tbody td{
  padding: var(--db-cell-pad-y) var(--db-cell-pad-x) !important;
  vertical-align: middle;
  line-height: 1.15;
}

/* Make header row slightly taller than body rows */
.db-table thead tr{ height: 46px; }
.db-table tbody tr{ height: 42px; }

/* Header inner layout (sort + filter) */
.db-th-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  min-height: 22px;
}
.sort-ind{ display:inline-flex; align-items:center; gap:6px; }
.sort-ico{ opacity:.55; font-size: .95em; }

.db-colmenu-btn{
  width: 24px;
  height: 24px;
  padding: 0 !important;
  border-radius: 6px;
  border: 1px solid rgba(20,22,26,.18);
  background: rgba(255,255,255,.65);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 2px 6px rgba(10,12,16,.06);
}
.db-colmenu-btn i{
  font-size: 14px !important;
  line-height: 1;
  opacity: .8;
}
.db-colmenu-btn:hover{
  background: rgba(255,109,31,.10);
  border-color: rgba(255,109,31,.30);
}

/* Sticky header shadow (helps it feel like a header) */
.db-table thead.sticky-top th{
  box-shadow: 0 8px 18px rgba(10,12,16,.08);
}

/* Keep OEM hover colors winning over zebra */
.db-table tbody tr.oem-ford:hover > *{ background-color: #dbeafe !important; }
.db-table tbody tr.oem-gm:hover > *{ background-color: #fff3cd !important; }

/* OEM row hover tint */

/* Persistent row selection (click row) */
.db-table tbody tr.db-selected{ background: rgba(20,22,26,.06) !important; }
.db-table tbody tr.db-selected > *{ background-color: rgba(20,22,26,.06) !important; }
.db-table tbody tr.oem-ford.db-selected{ background: rgba(78,155,216,.16) !important; }
.db-table tbody tr.oem-ford.db-selected > *{ background-color: rgba(78,155,216,.16) !important; }
.db-table tbody tr.oem-gm.db-selected{ background: #ffe8a1 !important; }
.db-table tbody tr.oem-gm.db-selected > *{ background-color: #ffe8a1 !important; }
/* Tiny "glow" accent on hover to feel consistent across all tables */
.db-table tbody tr.oem-ford:hover > td:first-child{ box-shadow: inset 3px 0 0 rgba(78,155,216,.55); }
.db-table tbody tr.oem-gm:hover > td:first-child{ box-shadow: inset 3px 0 0 rgba(255,193,7,.55); }

/* Subtle OEM indicator even when not hovered */
.db-table tbody tr.oem-ford > td:first-child{ box-shadow: inset 3px 0 0 rgba(78,155,216,.26); }
.db-table tbody tr.oem-gm > td:first-child{ box-shadow: inset 3px 0 0 rgba(255,193,7,.30); }

/* Optional wrapper (keeps sticky header nice inside cards) */
.db-table-wrap{
  max-height: 75vh;
  overflow: auto;
  padding-bottom: 10px; /* keeps bottom horizontal scrollbar accessible */
  scrollbar-gutter: stable both-edges;
  border: 1px solid rgba(20,22,26,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  box-shadow: var(--shadow1);
}

/* Small "copy" button used in VIN cells (Inventory + CDs) */
.vin-copy{
  flex: 0 0 auto;
  border-radius: 10px !important;
  padding: 4px 8px !important;
  line-height: 1;
  border: 1px solid rgba(20,22,26,.16) !important;
  background: rgba(255,255,255,.85) !important;
  color: rgba(20,22,26,.80) !important;
}
.vin-copy:hover{
  background: rgba(255,109,31,.10) !important;
  border-color: rgba(255,109,31,.28) !important;
  color: rgba(20,22,26,.92) !important;
}

/* ====== Buttons ====== */
.btn{ border-radius: 14px; font-weight: 900; }

/* Primary = orange "attention" */
.btn-primary{
  background: var(--orange);
  border-color: rgba(247,147,26,.86);
  color: rgba(20,22,26,.92);
}
.btn-primary:hover{ filter: brightness(1.03); }

/* Secondary-ish utility button */
.btn-outline-primary{
  border-color: rgba(78,155,216,.70);
  color: #1f6ea8;
}
.btn-outline-primary:hover{
  background: rgba(78,155,216,.10);
  color: #1a5d8f;
}

/* OEM buttons (consistent colors everywhere) */
.btn-oem-ford{
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
  font-weight: 900;
}
.btn-oem-gm{
  background: var(--yellow) !important;
  border-color: var(--yellow) !important;
  color: rgba(20,22,26,.92) !important;
  font-weight: 900;
}
.btn-oem-outline{
  background: transparent !important;
  border-width: 2px !important;
  font-weight: 900;
}
.btn-oem-outline.btn-oem-ford{ color: var(--blue) !important; border-color: var(--blue) !important; }
.btn-oem-outline.btn-oem-gm{ color: rgba(20,22,26,.92) !important; border-color: var(--yellow) !important; }

/* ====== Pills ====== */
.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 2px 6px;
  border-radius:999px;
  border: 1px solid var(--pillBd);
  background: var(--pillBg);
  color: rgba(20,22,26,.90);
  font-weight: 950;
  letter-spacing:.2px;
  line-height: 1.1;
}
.pill::before{
  content:"";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: rgba(148,163,184,.95);
  box-shadow: 0 0 0 3px rgba(148,163,184,.14);
}

.pill.blue{ background: var(--stgBlueBg); border-color: var(--stgBlueBd); }
.pill.blue::before{ background: var(--blue); box-shadow: 0 0 0 4px rgba(78,155,216,.16); }

.pill.yellow{ background: rgba(255,193,7,.14); border-color: rgba(255,193,7,.32); }
.pill.yellow::before{ background: var(--yellow); box-shadow: 0 0 0 4px rgba(255,193,7,.16); }

.pill.green{ background: var(--stgGreenBg); border-color: var(--stgGreenBd); }
.pill.green::before{ background: var(--green); box-shadow: 0 0 0 4px rgba(103,178,70,.16); }

.pill.orange{ background: var(--stgOrangeBg); border-color: var(--stgOrangeBd); }
.pill.orange::before{ background: var(--orange); box-shadow: 0 0 0 4px rgba(247,147,26,.16); }

.pill.gray{ background: var(--stgGrayBg); border-color: var(--stgGrayBd); }
.pill.gray::before{ background: rgba(100,116,139,.95); box-shadow: 0 0 0 4px rgba(100,116,139,.16); }

/* ====== Forms ====== */
label, .form-label{ color: var(--ink) !important; font-weight: 850; }
.form-text, small{ color: var(--muted) !important; }

input.form-control,
textarea.form-control,
select.form-select,
.form-control,
.form-select{
  background: #fff !important;
  color: var(--ink) !important;
  border: 1px solid rgba(20,22,26,.16) !important;
  border-radius: 12px;
  box-shadow: none !important;
}

.form-control::placeholder,
.form-select::placeholder{ color: rgba(20,22,26,.40) !important; }

.form-control:disabled,
.form-control[readonly],
.form-select:disabled{
  background: rgba(248,250,252,.95) !important;
  color: rgba(20,22,26,.70) !important;
}

.form-control:focus,
.form-select:focus{
  border-color: rgba(247,147,26,.65) !important;
  box-shadow: 0 0 0 .20rem rgba(247,147,26,.18) !important;
  outline: none !important;
}

.form-check-label{ color: var(--ink) !important; font-weight: 800; }
.form-check-input{ border-color: rgba(20,22,26,.20) !important; }
.form-check-input:checked{
  background-color: var(--orange) !important;
  border-color: var(--orange) !important;
}

/* ====== Modals: keep your "no dimming" preference ====== */
.modal-backdrop,
.offcanvas-backdrop{ display:none !important; opacity:0 !important; }
.modal{ background: transparent !important; }
body.modal-open{ overflow:auto !important; padding-right:0 !important; }

/* ====== Print: global sanity ====== */
@media print{
  body{ background:#fff !important; }
  body::before, body::after{
  content:"";
  display:none; /* removed decorative stripes for a cleaner neutral backdrop */
}
  .sidebar{ display:none !important; }
  .topbar{ display:none !important; }
  main{ padding: 0 !important; }
  .page-wrap{ max-width: none !important; margin: 0 !important; }
  a{ color:#000 !important; text-decoration:none !important; }
}

/* Small-screen friendly: sidebar becomes top stacked (simple) */
@media (max-width: 980px){
  .shell{ flex-direction: column; }
  .sidebar{
    position: relative;
    width: auto;
    height: auto;
    box-shadow: none;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .navblock{ max-height: 44vh; }
  .topbar{ position: relative; top: 0; }
}


/* DEBUG / verification: if you still can't see changes, dealerbo.css isn't loading */
.theme-loaded-badge{position:fixed;bottom:12px;left:12px;z-index:9999;padding:6px 10px;border-radius:999px;background:rgba(255,122,24,.10);border:1px solid rgba(255,122,24,.28);color:rgba(20,22,26,.75);font-size:12px;backdrop-filter: blur(6px);}
/* ===== DealerBo v2.1 OEM row hover overrides (apply color to cells, beats Bootstrap table-hover gray) ===== */
.db-table tbody tr:hover > *{ background-color: var(--tblRowHover) !important; }

/* Ford / GM hover tints */
.db-table tbody tr.oem-ford:hover > *{ background-color: #dbeafe !important; }
.db-table tbody tr.oem-gm:hover > *{ background-color: #fff3cd !important; }

/* If a table uses Bootstrap's .table-hover, ensure our OEM tints win */
.table-hover.db-table tbody tr.oem-ford:hover > *,
.table-hover.db-table tbody tr.oem-gm:hover > *{ box-shadow: inset 0 0 0 9999px rgba(0,0,0,0) !important; }

/* Clean up any accidental malformed selector from older builds */

/* OEM hover tint must win even on Bootstrap contextual rows (table-warning, etc.) */
.table-hover.db-table tbody tr.oem-ford:hover > *,
.table-hover.db-table tbody tr.oem-ford.table-active:hover > *,
.table-hover.db-table tbody tr.oem-ford.table-warning:hover > *,
.table-hover.db-table tbody tr.oem-ford.table-danger:hover > *,
.table-hover.db-table tbody tr.oem-ford.table-success:hover > *,
.table-hover.db-table tbody tr.oem-ford.table-info:hover > *{
  /* Solid so Ford hover doesn't get "washed" by other table tints */
  background-color: #dbeafe !important;
}

.table-hover.db-table tbody tr.oem-gm:hover > *,
.table-hover.db-table tbody tr.oem-gm.table-active:hover > *,
.table-hover.db-table tbody tr.oem-gm.table-warning:hover > *,
.table-hover.db-table tbody tr.oem-gm.table-danger:hover > *,
.table-hover.db-table tbody tr.oem-gm.table-success:hover > *,
.table-hover.db-table tbody tr.oem-gm.table-info:hover > *{
  /* Solid so Chevy hover doesn't look gray-tinted over zebra/card tints */
  background-color: #fff3cd !important;
}

/* --- Chip (counts) --- */
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  box-shadow: 0 8px 16px rgba(10,12,16,.06);
  font-weight: 950;
  color: var(--ink);
}
.chip-dot{
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(255,109,31,.16);
}


.stacked-secondary{ display:block; font-size: 12px; color: var(--muted); margin-top: 2px; }


/* lifecycle bar white */
.lifecycle-bar{ background: #fff !important; }


/* Uniform table header sizing */
.db-table thead th{
  height: 44px;
  vertical-align: middle !important;
}
.db-table thead th .db-th-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  width:100%;
}
.db-table thead th .db-colmenu-btn{
  width: 28px;
  height: 28px;
  padding: 0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(20,22,26,.16);
  background: rgba(255,255,255,.92);
  border-radius: 10px;
}
.db-table thead th .db-colmenu-btn i{ font-size: 14px; line-height: 1; }


/* =========================================
   DEALERBO – ULTRA COMPACT TABLES (OVERRIDE)
   Targets Bootstrap 5 table cell selector.
========================================= */

.table {
  font-size: 12px !important;
  border-collapse: collapse !important;
}

/* Bootstrap 5 uses .table>:not(caption)>*>* for padding */
.table>:not(caption)>*>* {
  padding: 2px 6px !important;
  white-space: nowrap !important;
  line-height: 1.1 !important;
}

/* Headers */
.table thead th,
.table thead td {
  font-weight: 600 !important;
  letter-spacing: 0.2px !important;
}

/* Even tighter for table-sm */
.table.table-sm>:not(caption)>*>* {
  padding: 1px 4px !important;
}

/* Pills / badges */
.badge,
.status-pill {
  padding: 1px 4px !important;
  font-size: 10px !important;
}

/* Remove any min-width forcing */
.table th, .table td {
  min-width: unset !important;
}

/* Optional: tighten common short columns if present */
.table td:nth-child(1),
.table td:nth-child(2),
.table td:nth-child(3),
.table td:nth-child(4),
.table td:nth-child(5),
.table th:nth-child(1),
.table th:nth-child(2),
.table th:nth-child(3),
.table th:nth-child(4),
.table th:nth-child(5) {
  padding-left: 4px !important;
  padding-right: 4px !important;
}
