:root{
--panel:#ffffff;
--text:#111827;
--muted:#6b7280;

  --panel:#ffffff;
  --panel2:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:rgba(17,24,39,.10);
  --shadow:0 12px 32px rgba(17,24,39,.08);
  --red:#c40000;
  --radius:18px;
  --pill:999px;
  --max:1200px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  display:flex;
  flex-direction:column;
  min-height:100vh;
  margin:0;
  font-family:var(--font);
  background:linear-gradient(180deg, var(--bg2), var(--bg));
  color:var(--text);
}
a{color:inherit;text-decoration:none}
.muted{color:var(--muted)}
.sep{border:0;border-top:1px solid var(--line);margin:14px 0}

/* Top bar */
.topbar{
  position:sticky; top:0; z-index:50;
  background:rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.topbar-inner{
  max-width:var(--max); margin:0 auto; padding:10px 14px;
  display:flex; align-items:center; gap:14px;
}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brand-mark{
  width:14px;height:14px;border-radius:6px;
  background:linear-gradient(135deg,var(--red),#111);
  box-shadow:0 0 0 3px rgba(196,0,0,.12);
}
.brand-text{font-weight:900;letter-spacing:.3px}
.brand-sub{
  font-size:12px;color:var(--muted);
  padding:2px 8px;border:1px solid var(--line);border-radius:var(--pill);
  background:#fff;
}

.topnav{display:flex;gap:8px;flex:1;justify-content:center;flex-wrap:wrap}
.navlink{
  padding:8px 12px;border-radius:var(--pill);
  border:1px solid transparent;
  color:var(--muted);
}
.navlink.active{
  color:var(--text);
  border-color:rgba(196,0,0,.25);
  background:linear-gradient(135deg, rgba(196,0,0,.10), rgba(255,255,255,.65));
}
.topbar-actions{display:flex;align-items:center;gap:10px}
.role{display:flex;align-items:center;gap:8px}

.page{
  max-width:var(--max);
  margin:0 auto;
  padding:14px;
  flex:1;              /* THIS makes footer stay at bottom */
  width:100%;
}

/* Hero / sections */
.section{padding:10px 0}
.section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin:6px 0 12px}
.hero{padding:10px 0 18px}
.hero-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:14px}
@media (max-width: 980px){.hero-grid{grid-template-columns:1fr}}
h1{font-size:44px;margin:8px 0 8px;font-weight:1000;letter-spacing:-.5px}
.lead{font-size:16px;line-height:1.6;color:var(--muted);max-width:55ch}
.hero-ctas{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0 10px}
.hero-badges{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.badge{
  font-size:12px;color:var(--muted);
  border:1px solid var(--line);
  padding:6px 10px;border-radius:var(--pill);
  background:#fff;
}

/* Cards */
.card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.card-link{transition:transform .12s ease, border-color .12s ease}
.card-link:hover{transform:translateY(-2px);border-color:rgba(196,0,0,.22)}
.card-head{
  padding:12px 14px;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg, rgba(17,24,39,.02), rgba(255,255,255,0));
}
.card-body{padding:14px}

.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.grid2{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
@media (max-width: 980px){.grid3,.grid2{grid-template-columns:1fr}}

/* Buttons */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:10px 14px;border-radius:14px;border:1px solid var(--line);
  font-weight:900;cursor:pointer;
  background:#fff;
}
.btn:hover{border-color:rgba(196,0,0,.22)}
.btn-primary{
  border-color:rgba(196,0,0,.55);
  background:linear-gradient(135deg, rgba(196,0,0,.55), rgba(0,0,0,.06));
  color:#fff;
}
.btn-soft{
  background:linear-gradient(135deg, rgba(17,24,39,.04), rgba(17,24,39,.01));
}
.btn-ghost{background:transparent}

/* Pills */
/* Pills */
.pill{
  display:inline-flex;align-items:center;gap:6px;
  padding:8px 12px;border-radius:var(--pill);
  border:1px solid rgba(17,24,39,.14);
  background:#fff;
  color:var(--text);
  font-weight:900;
}
.pill-small{padding:4px 10px;font-size:12px}

/* Primary / main */
.pill-main{
  border-color:rgba(196,0,0,.28);
  background:#fff;
  box-shadow:0 1px 0 rgba(17,24,39,.04);
}

/* Demo pill (subtle, not pink) */
.pill-demo{
  border-color:rgba(196,0,0,.35);
  background:#fff;
}

/* Neutral pills */
.pill-ghost{
  color:var(--muted);
  background:#fff;
  border-color:rgba(17,24,39,.12);
}

/* Status pills: stronger contrast */
.pill-next{border-color:rgba(196,0,0,.28);background:rgba(196,0,0,.08)}

.pill-ok{border-color:rgba(0,140,90,.30);background:rgba(0,140,90,.10)}
.pill-warn{border-color:rgba(180,120,0,.30);background:rgba(180,120,0,.10)}
.pill-bad{border-color:rgba(200,40,40,.30);background:rgba(200,40,40,.10)}
.pill-soft{border-color:rgba(80,120,200,.26);background:rgba(80,120,200,.10)}
.pill-dark{border-color:rgba(17,24,39,.18);background:rgba(17,24,39,.06);color:var(--text)}

.pill-role{color:var(--muted)}
.pill-status{color:var(--muted)}

/* Tables */
.table-wrap{overflow:auto;border-radius:14px;border:1px solid var(--line)}
.table{width:100%;border-collapse:separate;border-spacing:0}
.table th,.table td{padding:12px 10px;border-bottom:1px solid var(--line);vertical-align:top;background:#fff}
.table th{color:var(--muted);font-weight:900;text-align:left;background:#fbfcfe;position:sticky;top:0}
.rowlink{cursor:pointer}
.rowlink:hover td{background:rgba(196,0,0,.04)}

/* Footer */
.footer{
  width:100%;
  border-top:1px solid rgba(17,24,39,.12);
  margin-top:20px;
  background:#3A3B3C;     /* DealerApps-ish grey bar */
  padding:0;
}

.footer-inner{
  max-width:var(--max);
  margin:0 auto;
  padding:14px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  color:#fff;                 /* darker grey text */
}
.footer .muted{color:#fff}

/* App shell */
.app{display:grid;grid-template-columns:260px 1fr;gap:12px;align-items:start}
@media (max-width: 980px){.app{grid-template-columns:1fr}}
.sidebar{
  position:sticky;top:72px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#fff;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.sidebar-head{padding:14px;border-bottom:1px solid var(--line)}
.sidebar-title{font-weight:1000}
.sidebar-sub{color:var(--muted);font-size:12px;margin-top:2px}
.snav{display:flex;flex-direction:column;padding:8px}
.snav-item{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:10px 10px;border-radius:14px;color:var(--muted);
  border:1px solid transparent;
}
.snav-item:hover{color:var(--text);border-color:rgba(196,0,0,.18);background:rgba(196,0,0,.04)}
.snav-item.active{color:var(--text);border-color:rgba(196,0,0,.25);background:linear-gradient(135deg, rgba(196,0,0,.08), rgba(255,255,255,.85))}
.snav-sep{height:1px;background:var(--line);margin:8px 6px}
.sidebar-foot{padding:12px;border-top:1px solid var(--line)}
.chip{font-size:11px;color:var(--muted);border:1px solid var(--line);padding:2px 8px;border-radius:var(--pill);background:#fff}

.app-main{min-height:60vh}
.app-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:6px 0 12px}

/* Delivery board */
.board{display:grid;grid-template-columns:repeat(5, 1fr);gap:10px;align-items:start}
@media (max-width: 1200px){.board{grid-template-columns:repeat(2, 1fr)}}
@media (max-width: 720px){.board{grid-template-columns:1fr}}
.col{border:1px solid var(--line);border-radius:16px;background:#fff;overflow:hidden;box-shadow:var(--shadow)}
.col-head{padding:10px 12px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);background:#fbfcfe}
.dcard{margin:10px;border:1px solid var(--line);border-radius:16px;background:#fff;overflow:hidden}
.dcard-top{padding:10px 12px;display:flex;justify-content:space-between;gap:10px;align-items:flex-start;border-bottom:1px solid var(--line)}
.tasks{padding:10px 12px}
.task{display:flex;align-items:center;gap:10px;padding:6px 0}
.task-right{margin-left:auto;color:var(--muted);font-size:12px}
.dot{width:10px;height:10px;border-radius:6px}
.dot-todo{background:rgba(17,24,39,.12);border:1px solid rgba(17,24,39,.12)}
.dot-done{background:rgba(0,140,90,.22);border:1px solid rgba(0,140,90,.22)}
.note{padding:10px 12px;color:var(--muted);border-top:1px solid var(--line);font-size:12.5px;line-height:1.4}

.dc-ready{border-color:rgba(0,140,90,.18)}
.dc-blocked{border-color:rgba(200,40,40,.18)}
.dc-delivered{border-color:rgba(17,24,39,.14)}
.dc-progress{border-color:rgba(80,120,200,.18)}
.dc-scheduled{border-color:rgba(180,120,0,.18)}

/* Key-value */
.kv{display:grid;grid-template-columns:140px 1fr;gap:10px;align-items:center}
.k{color:var(--muted);font-weight:900;font-size:12px}
.v{font-weight:900}

/* Timeline */
.timeline{display:flex;flex-direction:column;gap:12px}
.titem{display:flex;gap:10px}
.tdot{width:10px;height:10px;border-radius:6px;background:rgba(196,0,0,.55);margin-top:6px;box-shadow:0 0 0 3px rgba(196,0,0,.10)}

/* Tiles */
.tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
@media (max-width: 980px){.tiles{grid-template-columns:1fr}}
.tile{border:1px solid var(--line);border-radius:16px;padding:12px;background:#fff;box-shadow:var(--shadow)}
.tile-k{color:var(--muted);font-weight:900;font-size:12px}
.tile-v{font-size:26px;font-weight:1000;margin:4px 0 2px}

/* Search UI */
.search-wrap{position:relative;min-width:280px}
.search{
  width:100%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  outline:none;
  background:#fff;
  font-weight:700;
}
.search:focus{border-color:rgba(196,0,0,.28); box-shadow:0 0 0 3px rgba(196,0,0,.08)}
.sresults{
  position:absolute;left:0;right:0;top:44px;
  background:#fff;border:1px solid var(--line);border-radius:14px;
  box-shadow:var(--shadow); overflow:hidden; display:none;
}
.sresults.show{display:block}
.sitem{padding:10px 12px;border-bottom:1px solid var(--line);cursor:pointer}
.sitem:last-child{border-bottom:0}
.sitem:hover{background:rgba(196,0,0,.04)}
.sitem strong{display:block}
.sitem .muted{font-size:12px}

/* KPI strip */
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:10px 0 12px}
@media (max-width: 980px){.kpis{grid-template-columns:repeat(2,1fr)}}
.kpi{
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  box-shadow:var(--shadow);
  padding:12px;
}
.kpi .k{color:var(--muted);font-size:12px;font-weight:900}
.kpi .v{font-size:22px;font-weight:1000;margin-top:4px}
.kpi .s{color:var(--muted);font-size:12px;margin-top:2px}

/* Demo toast (works with your existing demo.js injection too) */
/* Sticky app head (CRM + other pages) */
.app-head{
  position: sticky;
  top: 64px;                 /* below topbar */
  z-index: 20;
  background: rgba(248,250,252,.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(17,24,39,.10);
  border-radius: 16px;
  padding: 10px 12px;
}
@media (max-width: 980px){
  .app-head{ top: 62px; }
}
/* Accordion (Activity groups) */
.acc{
  border:1px solid rgba(17,24,39,.10);
  border-radius:16px;
  background:#fff;
  margin-bottom:10px;
  overflow:hidden;
}
.acc summary{
  list-style:none;
  cursor:pointer;
  padding:12px 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  background:#fbfcfe;
  border-bottom:1px solid rgba(17,24,39,.08);
}
.acc summary::-webkit-details-marker{display:none}
.acc[open] summary{background:#fff}
.acc-body{padding:12px}
/* Mobile sidebar drawer */
@media (max-width: 980px){
  .sidebar{
    position: fixed;
    top: 64px;
    left: 10px;
    right: 10px;
    max-height: 78vh;
    transform: translateY(-120%);
    transition: transform .18s ease;
    z-index: 60;
  }
  .sidebar.open{ transform: translateY(0); }
  .app{ grid-template-columns: 1fr; }
}
.mobilebar{display:none;margin-bottom:10px}
@media (max-width: 980px){ .mobilebar{display:block} }

