:root {
  --bg: #eef1f7;
  --bg-2: #e4e9f2;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #d7dee8;
  --accent: #0f6b4c;
  --c-teal: #0d9488;
  --c-blue: #2563eb;
  --c-indigo: #4f46e5;
  --c-violet: #7c3aed;
  --c-amber: #d97706;
  --c-orange: #ea580c;
  --c-rose: #e11d48;
  --c-sky: #0284c7;
  --c-lime: #65a30d;
  --accent-2: #ea580c;
  --warn: #b91c1c;
  --ok: #15803d;
  --side: #0b1f33;
  --side-text: #e2e8f0;
  --radius: 12px;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12);
  --font: "DM Sans", "Segoe UI", sans-serif;
  --display: "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(13, 148, 136, .18), transparent 55%),
    radial-gradient(800px 380px at 92% 0%, rgba(37, 99, 235, .16), transparent 50%),
    radial-gradient(700px 360px at 70% 100%, rgba(234, 88, 12, .10), transparent 45%),
    linear-gradient(180deg, #f4f7fb, #e8eef8 45%, #eef2f7);
}
body.topnav-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--c-blue); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--c-indigo); }

/* —— Top bar: multi-color enterprise —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .75rem 1.25rem;
  background:
    linear-gradient(90deg, #071a2c 0%, #0b2a4a 28%, #123a3a 58%, #1a2744 100%);
  color: var(--side-text);
  box-shadow: 0 10px 30px rgba(7, 26, 44, .35);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, #0d9488, #2563eb, #7c3aed, #ea580c, #e11d48) 1;
}
.brand {
  display: flex;
  gap: .7rem;
  align-items: center;
  text-decoration: none !important;
  flex-shrink: 0;
}
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #14b8a6, #2563eb 55%, #7c3aed);
  color: #fff; font-weight: 800;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}
.brand strong { display: block; color: #fff; font-size: 1.05rem; line-height: 1.15; }
.brand small { color: #94a3b8; font-size: .75rem; }

.topnav {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
}
.topnav > a,
.nav-drop-btn {
  color: #cbd5e1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: .55rem .85rem;
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.topnav > a:hover,
.nav-drop-btn:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(148, 163, 184, .25);
  color: #fff;
}
.topnav > a.active,
.nav-drop.active-parent > .nav-drop-btn {
  background: linear-gradient(135deg, rgba(13,148,136,.35), rgba(37,99,235,.35));
  border-color: rgba(96, 165, 250, .45);
  color: #fff;
}
.nav-drop { position: relative; }
.nav-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #dbe3ef;
  border-top: 3px solid #2563eb;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: .4rem;
  z-index: 120;
}
/* Click-to-open: menu stays until closed (JS adds .is-open) */
.nav-drop.is-open > .nav-drop-menu { display: grid; }
.nav-drop.is-open > .nav-drop-btn {
  background: linear-gradient(135deg, rgba(13,148,136,.35), rgba(37,99,235,.35));
  border-color: rgba(96, 165, 250, .45);
  color: #fff;
}
.nav-drop-menu a {
  display: block;
  color: var(--ink);
  padding: .55rem .75rem;
  border-radius: 8px;
  text-decoration: none !important;
  font-size: .9rem;
  font-weight: 500;
}
.nav-drop-menu a:hover,
.nav-drop-menu a.active {
  background: linear-gradient(90deg, #ecfeff, #eff6ff);
  color: #1d4ed8;
}
.nav-drop-wide {
  min-width: 280px;
  max-height: 70vh;
  overflow: auto;
}
.drop-section {
  margin: .5rem .4rem .2rem;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-left: auto;
}
.user-chip {
  font-size: .8rem;
  color: #94a3b8;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(148,163,184,.25);
}
.logout { margin: 0; }
.logout button {
  background: linear-gradient(135deg, #ea580c, #e11d48);
  border: 0;
  color: #fff;
  border-radius: 8px;
  padding: .45rem .85rem;
  cursor: pointer;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
}
.logout button:hover { filter: brightness(1.08); }

.main {
  padding: 1.5rem 1.75rem 2rem;
  min-width: 0;
  width: min(1280px, 100%);
  margin: 0 auto;
  flex: 1;
}

.page-head {
  display: flex; justify-content: space-between; align-items: end;
  gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.page-head h1 {
  font-family: var(--display);
  font-size: 1.9rem;
  margin: 0;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #0f766e, #1d4ed8 50%, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-head p { margin: .35rem 0 0; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: linear-gradient(135deg, #0f766e, #2563eb);
  color: #fff !important;
  border: 0; border-radius: 9px; padding: .55rem 1rem;
  font-weight: 600; cursor: pointer; text-decoration: none !important;
  font: inherit;
  box-shadow: 0 6px 14px rgba(37, 99, 235, .25);
}
.btn.secondary { background: linear-gradient(135deg, #334155, #475569); box-shadow: none; }
.btn.ghost {
  background: #fff; color: var(--ink) !important;
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.warn { background: linear-gradient(135deg, #ea580c, #e11d48); }
.btn.small { padding: .35rem .65rem; font-size: .85rem; box-shadow: none; }

/* Flow strip chips */
.flow-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .4rem;
  align-items: center;
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  padding: .9rem 1rem;
  margin-bottom: 1.15rem;
  font-size: .86rem;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.flow-strip .flow-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .65rem;
  border-radius: 999px;
  font-weight: 600;
  color: #0f172a;
  border: 1px solid transparent;
}
.flow-strip .flow-chip strong { font-weight: 800; }
.flow-strip .arrow { color: #94a3b8; font-weight: 700; }
.chip-1 { background: #ccfbf1; border-color: #99f6e4; }
.chip-2 { background: #dbeafe; border-color: #bfdbfe; }
.chip-3 { background: #ede9fe; border-color: #ddd6fe; }
.chip-4 { background: #ffedd5; border-color: #fed7aa; }
.chip-5 { background: #dcfce7; border-color: #bbf7d0; }
.chip-6 { background: #fef3c7; border-color: #fde68a; }
.chip-7 { background: #fce7f3; border-color: #fbcfe8; }
.chip-8 { background: #e0e7ff; border-color: #c7d2fe; }
.chip-9 { background: #fee2e2; border-color: #fecaca; }
.chip-10 { background: #ecfccb; border-color: #d9f99d; }

.stats, .kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .9rem;
  margin-bottom: 1.25rem;
}
.kpi {
  border-radius: 16px;
  padding: 1.05rem 1.15rem;
  color: #fff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, .14);
  border: 1px solid rgba(255,255,255,.28);
  min-height: 96px;
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  right: -20px; top: -20px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.kpi span { display: block; opacity: .92; font-size: .82rem; font-weight: 700; letter-spacing: .02em; position: relative; z-index: 1; }
.kpi strong { font-size: 1.5rem; font-weight: 800; position: relative; z-index: 1; }
.kpi-teal { background: linear-gradient(145deg, #0f766e, #2dd4bf); }
.kpi-blue { background: linear-gradient(145deg, #1d4ed8, #38bdf8); }
.kpi-amber { background: linear-gradient(145deg, #b45309, #fbbf24); color: #1c1917; }
.kpi-green { background: linear-gradient(145deg, #15803d, #4ade80); }
.kpi-purple { background: linear-gradient(145deg, #6d28d9, #c084fc); }
.kpi-coral { background: linear-gradient(145deg, #c2410c, #fb923c); }
.kpi-slate { background: linear-gradient(145deg, #334155, #94a3b8); }
.kpi-red { background: linear-gradient(145deg, #9f1239, #fb7185); }

.panel, .enterprise-panel {
  background: var(--panel);
  border: 1px solid #d7dee8;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}
.enterprise-panel {
  border: 1px solid #d0dae8;
  border-top: 4px solid #2563eb;
}
.panel h2, .enterprise-panel h2 {
  margin: 0 0 .85rem;
  font-size: 1.05rem;
  color: #0f172a;
}
.chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.chart-card canvas { max-height: 260px; }
.chart-card.accent-teal { border-top-color: #0d9488; }
.chart-card.accent-blue { border-top-color: #2563eb; }
.chart-card.accent-violet { border-top-color: #7c3aed; }
.chart-card.accent-orange { border-top-color: #ea580c; }

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 1rem;
}
@media (max-width: 1100px) {
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topbar { padding: .65rem .9rem; }
  .topnav { width: 100%; order: 3; }
  .topbar-right { margin-left: 0; }
}

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left; padding: .7rem .55rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}
th {
  color: #475569;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
}
tbody tr:hover { background: #f8fafc; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.actions form { display: inline; margin: 0; }

.badge {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.badge.warn { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.badge.muted { background: #e2e8f0; color: #475569; border-color: #cbd5e1; }

.form {
  display: grid;
  gap: .85rem;
  max-width: 720px;
}
.form label { display: grid; gap: .35rem; font-weight: 600; }
.form label.inline {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 600;
}
.form input, .form select, .form textarea {
  font: inherit; padding: .55rem .7rem;
  border: 1px solid #cbd5e1; border-radius: 9px;
  background: #fff;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: 2px solid rgba(37, 99, 235, .25);
  border-color: #60a5fa;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
@media (max-width: 700px) { .form-row { grid-template-columns: 1fr; } }

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: .75rem;
  overflow-x: auto;
}
.pipeline-wide {
  grid-template-columns: repeat(6, minmax(160px, 1fr));
}
.pipe-col {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid #d7dee8;
  border-radius: var(--radius);
  padding: .7rem;
  min-height: 280px;
  border-top: 4px solid #2563eb;
}
.pipe-col:nth-child(2) { border-top-color: #0d9488; }
.pipe-col:nth-child(3) { border-top-color: #7c3aed; }
.pipe-col:nth-child(4) { border-top-color: #d97706; }
.pipe-col:nth-child(5) { border-top-color: #ea580c; }
.pipe-col:nth-child(6) { border-top-color: #e11d48; }
.pipe-col h3 {
  margin: 0 0 .7rem;
  font-size: .85rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.deal-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: .7rem;
  margin-bottom: .55rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .04);
}
.deal-card strong { display: block; margin-bottom: .25rem; }
.deal-card .meta { color: var(--muted); font-size: .85rem; }
.deal-card .stage-moves {
  display: flex; flex-wrap: wrap; gap: .3rem;
  margin-top: .5rem;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(700px 360px at 15% 10%, rgba(45, 212, 191, .35), transparent 60%),
    radial-gradient(600px 300px at 85% 20%, rgba(96, 165, 250, .3), transparent 55%),
    linear-gradient(160deg, #0b1f33, #123a3a 40%, #1e1b4b 75%, #7c2d12);
  grid-column: 1 / -1;
}
.login-box {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 1.75rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, #14b8a6, #2563eb, #a855f7) 1;
}
.login-box h1 {
  font-family: var(--display);
  margin: 0 0 .25rem;
}
.login-box p { color: var(--muted); margin-top: 0; }
.site-footer {
  margin-top: 2rem;
  color: var(--muted);
  font-size: .85rem;
}
.flash { color: var(--warn); margin-bottom: .75rem; font-weight: 600; }
.flash-ok { color: var(--ok); margin-bottom: .75rem; font-weight: 600; }
.empty { color: var(--muted); padding: .5rem 0; }
.hint { color: var(--muted); font-size: .8rem; font-weight: 400; }
.formula-chip {
  display: inline-block;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  padding: .15rem .45rem;
  font-size: .8rem;
  max-width: 22rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.formula-bom-panel {
  margin: .25rem 0 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8faf8 0%, #fff 40%);
  display: grid;
  gap: .75rem;
}
.formula-bom-panel[hidden] { display: none !important; }
.formula-bom-head { display: grid; gap: .25rem; }
.formula-bom-table-wrap { overflow-x: auto; }
.formula-bom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.formula-bom-table th,
.formula-bom-table td {
  border-bottom: 1px solid var(--line);
  padding: .45rem .35rem;
  text-align: left;
  vertical-align: middle;
}
.formula-bom-table th { color: var(--muted); font-weight: 600; font-size: .78rem; }
.formula-bom-table select,
.formula-bom-table input {
  width: 100%;
  margin: 0;
}
.report-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.report-list { margin: 0; padding-left: 1.1rem; line-height: 1.7; }

.page-head-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.module-kicker {
  margin: 0 0 .2rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.module-chip {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
  background: var(--mod-accent, var(--accent));
}
.module-section-label {
  margin: 1.25rem 0 .65rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* —— Module tile gallery (hub page) —— */
.module-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.5rem;
}

/* Full-viewport module hub — tiles fill the screen */
body.module-hub-page .main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1rem 1.25rem .75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
body.module-hub-page .page-head-hub {
  margin-bottom: .75rem;
  flex-shrink: 0;
}
body.module-hub-page .page-head-hub h1 {
  font-size: 1.55rem;
}
body.module-hub-page .page-head-hub p {
  margin-top: .2rem;
  font-size: .9rem;
}
body.module-hub-page .module-tile-grid-fill {
  flex: 1;
  width: 100%;
  margin: 0;
  min-height: calc(100vh - 11rem);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: 1fr;
  align-content: stretch;
  gap: .85rem;
}
body.module-hub-page .module-tile {
  min-height: 0;
  height: 100%;
}
body.module-hub-page .site-footer {
  margin-top: .75rem;
  flex-shrink: 0;
}
@media (min-width: 1400px) {
  body.module-hub-page .module-tile-grid-fill {
    grid-template-columns: repeat(5, 1fr);
  }
}
@media (min-width: 1100px) and (max-width: 1399px) {
  body.module-hub-page .module-tile-grid-fill {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 700px) {
  body.module-hub-page .module-tile-grid-fill {
    min-height: auto;
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
}

.module-tile {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-height: 168px;
  padding: 1.2rem 1.25rem 1.1rem;
  border-radius: 14px;
  border: 1px solid #d5dde8;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
  color: var(--ink);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.module-tile::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--mod-accent, var(--accent));
}
.module-tile::after {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: var(--mod-accent, var(--accent));
  opacity: .08;
  pointer-events: none;
}
.module-tile:hover {
  text-decoration: none;
  color: var(--ink);
  transform: translateY(-3px);
  border-color: #b8c4d4;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .14);
}
.module-tile-code {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: .28rem .65rem;
  border-radius: 8px;
  background: var(--mod-accent, var(--accent));
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .05em;
}
.module-tile-title {
  font-family: var(--display);
  font-size: 1.12rem;
  line-height: 1.25;
  font-weight: 700;
}
.module-tile-desc {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
  flex: 1;
}
.module-tile-go {
  margin-top: .2rem;
  font-size: .86rem;
  font-weight: 700;
  color: var(--mod-accent, var(--accent));
}

/* legacy aliases */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.module-card {
  display: grid; gap: .45rem; padding: 1.15rem 1.2rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow);
  color: inherit; text-decoration: none; border-top: 3px solid var(--mod-accent, var(--accent));
}
.module-code { font-size: .75rem; font-weight: 800; letter-spacing: .06em; color: var(--mod-accent, var(--accent)); }
.module-name { font-family: var(--display); font-size: 1.05rem; line-height: 1.25; }
.module-blurb { color: var(--muted); font-size: .88rem; line-height: 1.4; }
.module-cta { margin-top: .35rem; font-size: .85rem; font-weight: 700; color: var(--mod-accent, var(--accent)); }

.module-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .65rem;
}
.module-shortcut {
  display: block;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-weight: 600;
  font-size: .9rem;
}
.module-shortcut:hover {
  border-color: var(--accent);
  background: #f0fdf6;
  text-decoration: none;
}

/* —— Modules mega-menu (top nav tiles) —— */
.nav-drop-modules { position: relative; }
.nav-drop-modules > .nav-drop-btn {
  text-decoration: none;
}
.nav-drop-modules > .nav-drop-btn.active,
.nav-drop-modules.active-parent > .nav-drop-btn {
  background: rgba(255,255,255,.14);
}
.nav-modules-panel {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 130;
  width: min(920px, calc(100vw - 2rem));
  padding: .85rem;
  border-radius: 14px;
  border: 1px solid #d5dde8;
  border-top: 3px solid #2563eb;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
  grid-template-columns: 1fr !important;
  gap: .75rem !important;
}
.nav-drop-modules.is-open > .nav-modules-panel {
  display: grid;
}
.nav-modules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}
.nav-module-tile {
  display: grid;
  gap: .28rem;
  padding: .75rem .8rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  min-height: 96px;
  border-left: 4px solid var(--mod-accent, var(--accent));
}
.nav-module-tile:hover,
.nav-module-tile.is-current {
  text-decoration: none;
  color: var(--ink);
  border-color: #cbd5e1;
  background: #f8fafc;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}
.nav-module-code {
  display: inline-flex;
  width: fit-content;
  padding: .15rem .45rem;
  border-radius: 6px;
  background: var(--mod-accent, var(--accent));
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.nav-module-name {
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.25;
}
.nav-module-blurb {
  font-size: .75rem;
  color: var(--muted);
  line-height: 1.35;
}
.nav-modules-all {
  display: block;
  text-align: center;
  padding: .55rem;
  border-radius: 8px;
  background: #f1f5f9;
  font-weight: 700;
  font-size: .86rem;
  color: var(--ink);
}
.nav-modules-all:hover { background: #e2e8f0; text-decoration: none; }
.nav-current-mod {
  display: inline-flex;
  align-items: center;
  padding: .25rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff;
  background: var(--mod-accent, var(--accent));
  align-self: center;
}
@media (max-width: 900px) {
  .nav-modules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-modules-panel { width: min(560px, calc(100vw - 1.5rem)); }
}
@media (max-width: 640px) {
  .nav-modules-grid { grid-template-columns: 1fr; }
  .module-tile-grid { grid-template-columns: 1fr; }
}

.salesman-mobile .btn,
.salesman-mobile .nav-drop-btn,
.salesman-mobile .topnav > a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
@media (max-width: 820px) {
  .salesman-mobile .kpi-grid { grid-template-columns: 1fr 1fr; }
  .salesman-mobile .chart-grid { display: none; }
  .salesman-mobile .pipeline-wide { grid-template-columns: 1fr; }
  .salesman-mobile .page-head h1 { font-size: 1.45rem; }
}

.install-box {
  max-width: 640px;
  margin: 2rem auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
body.login-page, body.install-page {
  display: block;
  background: none;
}
