@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Sora:wght@400;500;600;700;800&display=swap");
:root {
  --bg-1: #030a18;
  --bg-2: #0b1f49;
  --bg-3: #184dad;
  --surface: rgba(255, 255, 255, 0.68);
  --surface-2: rgba(255, 255, 255, 0.82);
  --surface-soft: rgba(255, 255, 255, 0.52);
  --text: #091428;
  --text-strong: #040d1c;
  --muted: #334663;
  --line: rgba(17, 42, 88, 0.2);
  --line-soft: rgba(255, 255, 255, 0.6);
  --brand: #2168ff;
  --brand-dark: #10347f;
  --brand-soft: rgba(33, 104, 255, 0.14);
  --accent: #f9c942;
  --accent-soft: rgba(249, 201, 66, 0.26);
  --nav: rgba(4, 16, 39, 0.62);
  --nav-2: rgba(10, 31, 74, 0.62);
  --shadow: 0 18px 45px rgba(3, 12, 29, 0.24);
  --shadow-soft: 0 10px 28px rgba(6, 25, 58, 0.18);
  --radius: 18px;
  --sidepanel-compact-width: 72px;
  --sidepanel-expanded-width: 238px;
  --sidepanel-compact-offset: 104px;
  --sidepanel-expanded-offset: 276px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
  font-family: "Sora", "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.5;
  background:
    radial-gradient(circle at 8% 10%, rgba(249, 201, 66, 0.24), transparent 28%),
    radial-gradient(circle at 92% 15%, rgba(33, 104, 255, 0.45), transparent 35%),
    radial-gradient(circle at 75% 100%, rgba(249, 201, 66, 0.2), transparent 38%),
    linear-gradient(130deg, var(--bg-1) 0%, var(--bg-2) 44%, var(--bg-3) 100%);
}
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
  filter: blur(10px);
}
body::before {
  width: 360px;
  height: 360px;
  left: -110px;
  top: 28%;
  background: rgba(249, 201, 66, 0.2);
}
body::after {
  width: 480px;
  height: 480px;
  right: -170px;
  bottom: -120px;
  background: rgba(28, 83, 219, 0.32);
}
a {
  text-decoration: none;
  color: inherit;
}
main {
  flex: 1 0 auto;
}
.container {
  width: 100%;
  margin: 0;
  padding: 0 3%;
}
/* ---- Top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: 1%;
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
  transition: transform 0.24s ease, opacity 0.24s ease;
}
.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 0 3%;
}
.logo {
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #eef4ff;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  padding: 8px 12px;
  white-space: nowrap;
}
.logo span {
  color: var(--accent);
}
.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 14px;
  color: rgba(238, 245, 255, 0.82);
  border: 1px solid transparent;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}
.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(249, 201, 66, 0.52);
  transform: translateY(-1px);
}
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
}
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.greeting-chip {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  font-family: "Space Grotesk", "Sora", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0;
  white-space: nowrap;
}
.updates-btn {
  padding: 8px 12px;
  font-size: 13px;
}

/* ---- Sidepanel Layout ---- */
body.has-sidepanel main {
  padding-left: var(--sidepanel-compact-offset);
  padding-top: 6px;
}
body.has-sidepanel.sidepanel-open main {
  padding-left: var(--sidepanel-expanded-offset);
}
body.has-sidepanel .container {
  width: 100%;
}
body.has-sidepanel .topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  margin-left: var(--sidepanel-compact-offset);
  transition: margin-left 0.24s ease, transform 0.24s ease, opacity 0.24s ease;
}
body.has-sidepanel.sidepanel-open .topbar {
  margin-left: var(--sidepanel-expanded-offset);
}
body.has-sidepanel .nav-wrap {
  position: relative;
  padding: 0 3%;
  justify-content: flex-start;
}
body.has-sidepanel .logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}
body.has-sidepanel .menu-toggle {
  order: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
body.has-sidepanel .topbar-meta {
  order: 3;
  margin-left: 14px;
  flex: 1;
  min-width: 0;
}
body.has-sidepanel .topbar-meta .greeting-chip {
  margin-right: auto;
}
body.has-sidepanel .topbar-meta .updates-btn {
  margin-left: auto;
}
body.has-sidepanel .nav.sidepanel-nav {
  position: fixed;
  top: 18px;
  left: 16px;
  bottom: 18px;
  width: var(--sidepanel-compact-width);
  padding: 12px 8px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(175deg, rgba(3, 15, 37, 0.72), rgba(8, 30, 68, 0.68));
  box-shadow: 0 20px 40px rgba(1, 7, 20, 0.3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 6px;
  overflow-y: auto;
  overflow-x: visible;
  z-index: 46;
  transform: translateX(0);
  transition: width 0.24s ease, padding 0.24s ease, transform 0.24s ease;
}
body.has-sidepanel.sidepanel-open .nav.sidepanel-nav {
  width: var(--sidepanel-expanded-width);
  padding: 16px 12px;
}
body.has-sidepanel .nav .sidepanel-title {
  color: rgba(245, 250, 255, 0.86);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 10px 8px;
}
body.has-sidepanel.sidepanel-collapsed .nav .sidepanel-title {
  display: none;
}
body.has-sidepanel .nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 10px 11px;
  color: rgba(232, 242, 255, 0.86);
  font-size: 14px;
  position: relative;
}
body.has-sidepanel .nav a:hover,
body.has-sidepanel .nav a.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(249, 201, 66, 0.48);
  color: #ffffff;
  transform: none;
}
body.has-sidepanel .nav .sidepanel-icon-link .nav-icon {
  width: 20px;
  min-width: 20px;
  text-align: center;
  font-size: 16px;
  line-height: 1;
}
body.has-sidepanel .nav .sidepanel-icon-link .nav-label {
  white-space: nowrap;
}
body.has-sidepanel .nav .nav-utility-start {
  margin-top: 0;
}
body.has-sidepanel .nav .nav-userline {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  color: rgba(214, 228, 250, 0.9);
  font-size: 12px;
  line-height: 1.35;
  padding: 12px 10px 0;
}
body.has-sidepanel .nav .nav-userline:hover {
  background: transparent;
  border-color: transparent;
}
body.has-sidepanel .nav .nav-utility-link {
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}
body.has-sidepanel.sidepanel-collapsed .nav a {
  justify-content: center;
  padding: 10px 8px;
  min-height: 42px;
}
body.has-sidepanel.sidepanel-collapsed .nav .nav-userline {
  display: none;
}
body.has-sidepanel.sidepanel-collapsed .nav .nav-utility-start {
  margin-top: auto;
}
body.has-sidepanel.sidepanel-collapsed .nav .sidepanel-icon-link .nav-label {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: rgba(8, 20, 48, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 9px;
  color: #f3f7ff;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  box-shadow: 0 10px 22px rgba(2, 8, 24, 0.4);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
body.has-sidepanel.sidepanel-collapsed .nav .sidepanel-icon-link:hover .nav-label,
body.has-sidepanel.sidepanel-collapsed .nav .sidepanel-icon-link:focus-visible .nav-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
body.has-sidepanel.sidepanel-open .nav .sidepanel-icon-link .nav-label {
  position: static;
  transform: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: inherit;
  padding: 0;
  opacity: 1;
  pointer-events: auto;
  box-shadow: none;
  font-size: 14px;
}
body.has-sidepanel.sidepanel-collapsed .topbar-meta {
  margin-left: auto;
}
.sidepanel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 9, 22, 0.5);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
body.navbar-hidden .topbar {
  transform: translateY(calc(-100% - 12px));
  opacity: 0;
}
/* ---- Page header ---- */
.page-header {
  padding: 30px 0 18px;
  color: #f4f8ff;
}
.page-header h1 {
  margin: 0 0 6px;
  font-family: "Space Grotesk", "Sora", sans-serif;
  font-size: 32px;
  line-height: 1.1;
}
.page-header p {
  margin: 0;
  color: rgba(231, 239, 255, 0.9);
  font-size: 15px;
}
/* ---- Sections ---- */
main section {
  padding: 0 0 36px;
}
.section-head {
  margin-bottom: 20px;
}
.section-head h2 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", "Sora", sans-serif;
  font-size: 28px;
  color: #f4f8ff;
}
.section-head p {
  margin: 0;
  max-width: 860px;
  color: rgba(231, 239, 255, 0.86);
}
/* ---- Grid & Cards ---- */
.grid {
  display: grid;
  gap: 18px;
}
.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid.auto {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.grid > * {
  min-width: 0;
}
.card,
.tile,
.table-wrap,
.modal-card,
.account-form {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h3,
.card h4 {
  margin: 0 0 10px;
  color: var(--text-strong);
}
.card p {
  margin: 0;
  color: var(--muted);
}
.card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.card li {
  margin-bottom: 8px;
}
.highlight {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.82), rgba(235, 245, 255, 0.66));
  border-color: rgba(249, 201, 66, 0.5);
}
/* ---- KPI tiles ---- */
.kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}
.tile {
  background: linear-gradient(145deg, var(--surface-2), var(--surface-soft));
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}
.tile .num {
  font-family: "Space Grotesk", "Sora", sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 4px;
}
/* ---- BDE Dashboard ---- */
.bde-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.bde-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
}
.bde-kpi-tile {
  background: linear-gradient(145deg, rgba(243, 250, 255, 0.86), rgba(217, 233, 255, 0.68));
  border: 1px solid rgba(150, 176, 221, 0.56);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow-soft);
}
.bde-kpi-tile h4 {
  margin: 0;
  font-size: 15px;
  color: #35527f;
}
.bde-kpi-tile .num {
  margin-top: 4px;
  font-family: "Space Grotesk", "Sora", sans-serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: #10347f;
}
.bde-kpi-tile.bde-kpi-win {
  background: linear-gradient(145deg, rgba(237, 251, 240, 0.9), rgba(214, 241, 222, 0.76));
  border-color: rgba(120, 178, 141, 0.6);
}
.bde-kpi-tile.bde-kpi-warn {
  background: linear-gradient(145deg, rgba(255, 249, 228, 0.92), rgba(255, 237, 191, 0.78));
  border-color: rgba(196, 165, 85, 0.58);
}
.compact-table {
  min-width: 0;
}
.compact-table th,
.compact-table td {
  padding: 9px 11px;
}
.compact-table th {
  font-size: 11px;
}
/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.tertiary {
  background: rgba(255, 255, 255, 0.48);
  color: #173769;
  border-color: rgba(20, 60, 131, 0.24);
}
.btn.btn-dark {
  background: linear-gradient(110deg, var(--brand-dark), var(--brand));
  color: #ffffff;
  border-color: rgba(249, 201, 66, 0.58);
  box-shadow: 0 10px 20px rgba(14, 44, 105, 0.3);
}
.btn.btn-dark:hover {
  filter: brightness(1.06);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
/* ---- Tags & Badges ---- */
.tag {
  background: var(--brand-soft);
  color: #0f3c9b;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge.new,
.stage-select.stage-new {
  background: #e6efff;
  color: #194fc2;
}
.badge.draft,
.stage-select.stage-draft {
  background: #d8e7ff;
  color: #173f95;
}
.badge.submitted,
.stage-select.stage-submitted {
  background: #c8dcff;
  color: #0f3279;
}
.badge.negotiation,
.stage-select.stage-negotiation {
  background: #fff2cb;
  color: #6d4f00;
}
.badge.won,
.stage-select.stage-won {
  background: #e8f7ff;
  color: #0a4e78;
}
.badge.lost,
.stage-select.stage-lost {
  background: #e8edf5;
  color: #2a3342;
}
.badge.dormant,
.stage-select.stage-dormant {
  background: #e2e8f0;
  color: #36465b;
}
/* ---- Stage select (inline dropdown) ---- */
.stage-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.stage-select:focus {
  outline: 2px solid rgba(249, 201, 66, 0.6);
  border-color: rgba(19, 57, 128, 0.4);
}
/* ---- Days-since badge ---- */
.days-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.days-badge.days-ok {
  background: #e6efff;
  color: #194fc2;
}
.days-badge.days-warn {
  background: #fff2cb;
  color: #6b4d00;
}
.days-badge.days-overdue {
  background: #ffe2a8;
  color: #5b3e00;
}
.days-badge.days-closed {
  background: #e2e8f0;
  color: #36465b;
}
.days-badge.days-none {
  background: #dbe4f2;
  color: #5c6f8e;
}
/* ---- Filters ---- */
.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
}
.pipeline-filters {
  grid-template-columns: 2fr repeat(2, minmax(150px, 1fr)) auto;
  align-items: end;
}
.bd-filters {
  grid-template-columns: 2fr repeat(2, minmax(140px, 1fr));
}
.pipeline-filter-actions {
  display: flex;
  justify-content: flex-end;
}
label {
  font-size: 13px;
  font-weight: 700;
  color: #1f3a68;
  display: block;
  margin-bottom: 5px;
}
input,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(22, 57, 117, 0.24);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font: inherit;
}
input:focus,
select:focus {
  outline: 2px solid rgba(249, 201, 66, 0.62);
  border-color: rgba(26, 70, 147, 0.45);
}
input[type="file"] {
  padding: 8px 10px;
}
.other-input {
  margin-top: 8px;
}
.pipeline-summary-wrap {
  position: relative;
  margin-top: 10px;
  height: 280px;
}
.pipeline-summary-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
}
.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
/* ---- Table ---- */
.table-wrap {
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.table-spacing {
  margin-top: 18px;
}
#bdTrackerRows td {
  white-space: nowrap;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(20, 57, 126, 0.14);
  text-align: left;
  vertical-align: middle;
}
th {
  background: linear-gradient(100deg, #0f2f78, #1a56d6);
  color: #ffffff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
tbody tr:nth-child(even) td {
  background: rgba(239, 246, 255, 0.6);
}
tbody tr:hover td {
  background: rgba(255, 243, 207, 0.58);
}
.small,
.muted {
  font-size: 13px;
  color: var(--muted);
}
.empty-row {
  text-align: center;
  color: var(--muted);
  padding: 32px !important;
}
.doc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #1a56d6;
  text-decoration: underline;
  text-underline-offset: 2px;
  font: inherit;
  font-size: 13px;
}
.btn-link:hover {
  color: #0f2f78;
}
.doc-link {
  color: #1a56d6;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 13px;
}
.doc-link:hover {
  color: #0f2f78;
}
/* ---- Icon buttons ---- */
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1;
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.btn-edit {
  color: #0f2f78;
  background: #dbe8ff;
}
.btn-edit:hover {
  background: #c5d8ff;
}
.btn-history {
  color: #6f4c00;
  background: #fff2cb;
}
.btn-history:hover {
  background: #ffe8a5;
}
.btn-delete {
  color: #2a3342;
  background: #e7ecf5;
}
.btn-delete:hover {
  background: #d8e0ed;
}
/* ---- Modal ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 10, 24, 0.64);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal-backdrop.hidden {
  display: none;
}
.modal-card {
  width: min(860px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: rgba(247, 251, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 48px rgba(2, 8, 20, 0.34);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.modal-head h3 {
  margin: 0;
}
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(20, 57, 126, 0.18);
  background: rgba(255, 255, 255, 0.88);
  color: #1f3559;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}
.doc-preview-card {
  width: min(760px, 100%);
}
.doc-preview-body {
  margin-top: 10px;
  border: 1px solid rgba(20, 57, 126, 0.14);
  border-radius: 14px;
  overflow: hidden;
  min-height: 260px;
  background: #f6f9ff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doc-preview-frame {
  width: 100%;
  height: 380px;
  border: 0;
  background: #ffffff;
}
.doc-preview-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 380px;
  height: auto;
}
.doc-preview-empty {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.version-history-card {
  width: min(760px, 100%);
}
.version-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  max-height: 56vh;
  overflow: auto;
  padding-right: 2px;
}
.version-item {
  border: 1px solid rgba(20, 57, 126, 0.14);
  border-radius: 12px;
  background: rgba(235, 244, 255, 0.72);
  padding: 11px 12px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 1fr));
  gap: 12px;
}
.form-field {
  display: grid;
}
.required {
  color: #8a6500;
}
.field-error {
  min-height: 16px;
  font-size: 12px;
  color: #9d1600;
  margin-top: 3px;
}
.input-error {
  border-color: #c3371d !important;
}
.hidden {
  display: none !important;
}
/* ---- Auth ---- */
.auth-card {
  width: min(560px, 100%);
  margin: 0 auto;
}
.auth-actions {
  justify-content: flex-start;
}
.auth-message {
  min-height: 20px;
  margin-top: 10px;
}
.auth-message.error {
  color: #9d1600;
}
.auth-message.success {
  color: #0f4f7a;
}
/* ---- Account Panel ---- */
.account-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 10, 24, 0.45);
  display: flex;
  justify-content: flex-end;
  z-index: 70;
}
.account-panel {
  width: min(420px, 92vw);
  height: 100%;
  background: rgba(244, 249, 255, 0.94);
  border-left: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: -10px 0 30px rgba(2, 6, 23, 0.24);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 20px;
  overflow: auto;
}
.account-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.account-panel-head h3 {
  margin: 0;
}
.account-userline {
  margin-bottom: 14px;
}
.account-form {
  border: 1px solid rgba(20, 57, 126, 0.14);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.76);
}
.account-form h4 {
  margin: 0 0 10px;
  font-size: 15px;
}
/* ---- Profile Page ---- */
.profile-identity-card {
  display: flex;
  align-items: center;
}
.profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", "Sora", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(140deg, #144fc4, #1f74ff);
  box-shadow: 0 10px 20px rgba(8, 38, 95, 0.34);
}
.profile-role {
  margin-top: 6px;
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #10347f;
  background: rgba(33, 104, 255, 0.14);
  border: 1px solid rgba(19, 68, 163, 0.22);
}
.calendar-head {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.calendar-weekdays {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.calendar-weekdays span {
  font-size: 12px;
  color: #315484;
  font-weight: 700;
  text-align: center;
}
.calendar-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.calendar-cell {
  min-height: 54px;
  border-radius: 11px;
  border: 1px solid rgba(20, 57, 126, 0.16);
  background: rgba(255, 255, 255, 0.72);
}
.calendar-cell.empty {
  border-color: transparent;
  background: transparent;
}
.calendar-day-btn {
  cursor: pointer;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #173769;
  font: inherit;
}
.calendar-day-btn:hover {
  border-color: rgba(33, 104, 255, 0.45);
}
.calendar-day-btn.selected {
  border-color: rgba(20, 57, 126, 0.42);
  background: rgba(227, 238, 255, 0.86);
}
.calendar-day-btn.today {
  box-shadow: inset 0 0 0 1px rgba(249, 201, 66, 0.74);
}
.calendar-day-number {
  font-size: 13px;
  font-weight: 700;
}
.calendar-day-dots {
  display: flex;
  gap: 3px;
  min-height: 8px;
}
.calendar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.calendar-dot.sent {
  background: #2168ff;
}
.calendar-dot.due {
  background: #f9c942;
}
.calendar-dot.closed {
  background: #4f8ae8;
}
.calendar-legend {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.calendar-legend .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}
.calendar-legend .dot.sent {
  background: #2168ff;
}
.calendar-legend .dot.due {
  background: #f9c942;
}
.calendar-legend .dot.closed {
  background: #4f8ae8;
}
#calendarHint {
  margin-top: 8px;
}
.calendar-events-list {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}
.calendar-events-list li {
  color: #133866;
}
.account-proposals-grid .table-wrap table {
  min-width: 640px;
}
/* ---- Toast ---- */
.toast-stack {
  position: fixed;
  top: 80px;
  right: 18px;
  display: grid;
  gap: 8px;
  z-index: 60;
  width: min(340px, 92vw);
}
.toast {
  border-radius: 12px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(252, 253, 255, 0.92);
  box-shadow: 0 10px 24px rgba(15, 23, 32, 0.16);
  font-size: 14px;
}
.toast.success {
  border-color: #93beff;
  background: #eaf3ff;
  color: #11418e;
}
.toast.error {
  border-color: #ffd177;
  background: #fff6e2;
  color: #7b5600;
}
.toast.info {
  border-color: #b9d2ff;
  background: #eef5ff;
  color: #1a4aa6;
}
/* ---- Charts ---- */
.chart-bars {
  display: grid;
  gap: 12px;
}
.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 36px;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}
.bar {
  height: 13px;
  border-radius: 999px;
  background: rgba(20, 57, 126, 0.12);
  overflow: hidden;
  border: 1px solid rgba(20, 57, 126, 0.15);
}
.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
/* ---- Pipeline Board ---- */
.pipeline-board-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}
.pipeline-board {
  min-width: 1380px;
  display: grid;
  grid-template-columns: repeat(10, minmax(230px, 1fr));
  gap: 14px;
  align-items: start;
}
.pipeline-stage-column {
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 16px;
  background: rgba(246, 251, 255, 0.6);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.pipeline-stage-column-closed {
  background: linear-gradient(150deg, rgba(255, 248, 223, 0.85), rgba(245, 252, 255, 0.66));
}
.pipeline-stage-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 11px;
  border-bottom: 1px solid rgba(20, 57, 126, 0.14);
  background: rgba(222, 236, 255, 0.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pipeline-stage-head h3 {
  margin: 0;
  font-size: 14px;
}
.pipeline-stage-head span {
  min-width: 26px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(33, 104, 255, 0.12);
  color: #10347f;
}
.pipeline-stage-list {
  padding: 10px;
  display: grid;
  gap: 10px;
  max-height: 72vh;
  overflow-y: auto;
}
.pipeline-card {
  border: 1px solid rgba(20, 57, 126, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 18px rgba(10, 33, 79, 0.12);
  padding: 10px;
  display: grid;
  gap: 9px;
}
.pipeline-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pipeline-card-id {
  font-family: "Space Grotesk", "Sora", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #0f3279;
  min-width: 0;
  word-break: break-word;
}
.pipeline-stage-select {
  min-width: 120px;
  font-size: 11px;
  padding: 4px 8px;
}
.pipeline-card-company {
  font-size: 14px;
  font-weight: 700;
  color: #1b3e73;
}
.pipeline-card-meta {
  margin: 0;
  display: grid;
  gap: 6px;
}
.pipeline-card-meta div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
}
.pipeline-card-meta dt {
  font-size: 11px;
  font-weight: 700;
  color: #4a6690;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pipeline-card-meta dd {
  margin: 0;
  font-size: 12px;
  color: #112f5b;
  min-width: 0;
  word-break: break-word;
}
.pipeline-empty {
  border: 1px dashed rgba(20, 57, 126, 0.22);
  border-radius: 11px;
  padding: 10px;
  text-align: center;
  background: rgba(239, 246, 255, 0.66);
  color: #35527f;
  font-size: 12px;
}
/* ---- Company Tracker ---- */
.company-filters {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}
.company-grid {
  display: grid;
  gap: 20px;
}
.company-card {
  padding: 22px;
}
.company-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.company-info {
  flex: 1;
  min-width: 180px;
}
.company-name {
  margin: 0 0 8px;
  font-family: "Space Grotesk", "Sora", sans-serif;
  font-size: 22px;
}
.company-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.company-summary {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.stat-block {
  text-align: right;
  min-width: 68px;
}
.stat-num {
  font-family: "Space Grotesk", "Sora", sans-serif;
  font-size: 23px;
  font-weight: 700;
  color: #0f3279;
  line-height: 1.1;
}
.stat-value {
  font-size: 16px;
}
.stat-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.company-stages {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.company-proposals-wrap .table-wrap {
  box-shadow: none;
  border-radius: 12px;
}
.company-proposals-wrap table {
  min-width: 680px;
}
.company-proposals-wrap th {
  font-size: 11px;
}
.company-proposals-wrap td {
  font-size: 13px;
  padding: 10px 12px;
}
/* ---- Latest Changes ---- */
.latest-changes-card {
  width: min(700px, 100%);
}
.latest-changes-subhead {
  margin-bottom: 12px;
}
.latest-changes-list {
  display: grid;
  gap: 10px;
  max-height: 56vh;
  overflow: auto;
}
.latest-change-item {
  border: 1px solid rgba(20, 57, 126, 0.14);
  border-radius: 12px;
  background: rgba(242, 248, 255, 0.76);
  padding: 11px 12px;
}
.latest-change-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}
/* ---- Home Updates ---- */
.home-updates-card h3 {
  margin-bottom: 4px;
}
.home-update-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0 12px;
}
.home-update-item {
  border: 1px solid rgba(20, 57, 126, 0.14);
  border-radius: 12px;
  padding: 12px 13px;
  background: rgba(241, 248, 255, 0.72);
}
.home-update-num {
  font-family: "Space Grotesk", "Sora", sans-serif;
  font-size: 27px;
  font-weight: 700;
  color: #10347f;
  line-height: 1.1;
  margin-bottom: 3px;
}
.home-reachback-title {
  margin: 10px 0 8px;
}
.home-reachback-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
}
.home-reachback-list li {
  color: #163663;
}

/* ---- Engagement ---- */
.engagement-header {
  display: block;
}
.engagement-header-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}
.engagement-header-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.engagement-controls {
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.engagement-controls label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  min-width: 52px;
  font-size: 12px;
  color: rgba(233, 241, 255, 0.94);
}
.engagement-controls select {
  width: auto;
  min-width: 170px;
}
#engagementScopeLine {
  margin-top: 0;
  line-height: 1.35;
  color: rgba(231, 239, 255, 0.86);
}
.engagement-charts-grid {
  align-items: stretch;
}
.eng-chart-wrap {
  position: relative;
  width: 100%;
  height: 320px;
  margin-top: 10px;
}
.eng-chart-wrap-wide {
  height: 360px;
}
.eng-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
.eng-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(20, 57, 126, 0.2);
  background: rgba(238, 246, 255, 0.65);
  color: #20406f;
}
.rank-chart {
  margin-top: 10px;
}
.rank-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(170px, 1fr) minmax(66px, auto);
  gap: 10px;
  align-items: center;
}
.rank-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  color: #0f2f78;
}
.rank-pill {
  flex: 0 0 auto;
  display: inline-block;
  min-width: 28px;
  text-align: center;
  border-radius: 999px;
  border: 1px solid rgba(20, 57, 126, 0.2);
  background: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  font-weight: 700;
  color: #1a4aa6;
  padding: 3px 6px;
}
.rank-value {
  font-weight: 700;
  color: #0e2f71;
  font-size: 13px;
  text-align: right;
}
/* ---- Footer ---- */
.footer {
  display: none !important;
}
/* ---- Motion ---- */
@keyframes fade-slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.kpi .tile,
.grid .card,
.table-wrap {
  animation: fade-slide-up 420ms ease both;
}
/* ---- Responsive ---- */
@media (max-width: 1200px) {
  .filters {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
  .pipeline-filters {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
  .bd-filters {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
  .bde-kpi-grid {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }
  .pipeline-filter-actions {
    justify-content: flex-start;
  }
  body.has-sidepanel.sidepanel-open main {
    padding-left: 258px;
  }
  body.has-sidepanel.sidepanel-open .topbar {
    margin-left: 258px;
  }
  body.has-sidepanel.sidepanel-open .nav.sidepanel-nav {
    width: 222px;
  }
}
@media (max-width: 980px) {
  .grid.cols-2,
  .grid.cols-3,
  .filters,
  .company-filters,
  .pipeline-filters,
  .bd-filters,
  .bde-kpi-grid,
  .form-grid {
    grid-template-columns: 1fr;
    display: grid;
  }
  .bde-header {
    align-items: flex-start;
  }
  .nav-wrap {
    align-items: center;
  }
  body.has-sidepanel main {
    padding-left: 0;
  }
  body.has-sidepanel .topbar {
    margin-left: 0;
  }
  body.has-sidepanel.sidepanel-open main {
    padding-left: 0;
  }
  body.has-sidepanel.sidepanel-open .topbar {
    margin-left: 0;
  }
  body.has-sidepanel .topbar-meta {
    margin-left: 12px;
    flex: 1;
  }
  body.has-sidepanel .logo {
    display: none;
  }
  body.has-sidepanel .nav.sidepanel-nav {
    top: 12px;
    bottom: 12px;
    left: 10px;
    width: min(78vw, 300px);
    padding: 16px 12px;
    transform: translateX(-115%);
    overflow-x: hidden;
  }
  body.has-sidepanel.sidepanel-open .nav.sidepanel-nav {
    width: min(78vw, 300px);
    transform: translateX(0);
  }
  body.has-sidepanel .nav .sidepanel-title {
    display: block;
  }
  body.has-sidepanel .nav .sidepanel-icon-link .nav-label {
    position: static;
    opacity: 1;
    transform: none;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: auto;
    color: inherit;
  }
  body.has-sidepanel .nav .nav-userline {
    display: block;
  }
  body.has-sidepanel.sidepanel-open .sidepanel-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  .company-header {
    flex-direction: column;
  }
  .company-summary {
    flex-direction: row;
    justify-content: flex-start;
  }
  .stat-block {
    text-align: left;
  }
  .eng-chart-wrap {
    height: 280px;
  }
  .eng-chart-wrap-wide {
    height: 310px;
  }
  .pipeline-summary-wrap {
    height: 250px;
  }
}
@media (max-width: 640px) {
  body.has-sidepanel .nav-wrap {
    gap: 10px;
  }
  body.has-sidepanel .updates-btn {
    padding: 8px 10px;
    font-size: 12px;
  }
  .page-header h1 {
    font-size: 27px;
  }
  .card,
  .tile {
    padding: 18px;
  }
  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .rank-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .rank-value {
    text-align: left;
  }
  .engagement-header {
    align-items: stretch;
  }
  .engagement-header-top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .engagement-controls {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }
  .engagement-controls select {
    min-width: 0;
    width: 100%;
  }
  .eng-chart-wrap {
    height: 240px;
  }
  .eng-chart-wrap-wide {
    height: 270px;
  }
  .pipeline-summary-wrap {
    height: 220px;
  }
  .table-wrap table {
    min-width: 760px;
  }
}
