:root {
  --brand: #b5e200;
  --brand-hover: #a4cf00;
  --brand-deep: #728f00;
  --brand-soft: #f5fadf;
  --ink-950: #0b0d0f;
  --ink-900: #111418;
  --ink-800: #1b2025;
  --ink-700: #30373e;
  --ink-600: #515a63;
  --ink-500: #707a84;
  --ink-400: #98a1a9;
  --surface: #ffffff;
  --surface-subtle: #f8f9fa;
  --surface-muted: #f2f4f5;
  --canvas: #f5f6f7;
  --border: #e5e8eb;
  --border-strong: #d9dde1;
  --success: #1f6a43;
  --warning: #916200;
  --info: #315da8;
  --purple: #6940a5;
  --danger: #a13f45;
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --sidebar-width: 248px;
  --sidebar-collapsed-width: 76px;
  --demo-bar-height: 34px;
  --topbar-height: 76px;
  --shadow-xs: 0 1px 2px rgba(11, 13, 15, .025);
  --shadow-sm: 0 5px 18px rgba(11, 13, 15, .045);
  --shadow-md: 0 12px 35px rgba(11, 13, 15, .06);
}

* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink-900);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.min-w-0 { min-width: 0; }

/* Demo environment */
.demo-ribbon {
  height: var(--demo-bar-height);
  position: fixed;
  inset: 0 0 auto;
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-950);
  color: #d8dde1;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.demo-ribbon-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 0 18px;
  font-size: 11px;
  letter-spacing: .005em;
  white-space: nowrap;
}
.demo-ribbon strong { color: #fff; font-weight: 720; }
.demo-ribbon-separator { color: #5d666e; }
.demo-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(181,226,0,.12);
}
.app-shell { padding-top: var(--demo-bar-height); }

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--demo-bar-height);
  bottom: 0;
  left: 0;
  z-index: 1050;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  background: linear-gradient(180deg, #171b1f 0%, #111519 100%);
  color: #fff;
  border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: 10px 0 30px rgba(7,10,12,.035);
  transition: width .22s ease, transform .25s ease, padding .22s ease;
}
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 6px 14px;
  border-bottom: 1px solid rgba(255,255,255,.075);
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--brand);
  color: var(--ink-950);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: -.02em;
}
.brand-copy { min-width: 0; flex: 1; overflow: hidden; }
.brand-name { font-size: 12.5px; font-weight: 780; line-height: 1.15; letter-spacing: -.01em; white-space: nowrap; }
.brand-subtitle { margin-top: 3px; color: #89939b; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-collapse-btn {
  width: 30px;
  height: 30px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
  color: #8f99a2;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.sidebar-collapse-btn:hover { color: #fff; background: rgba(255,255,255,.065); border-color: rgba(255,255,255,.12); }
.sidebar-nav {
  padding: 10px 2px 12px;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #2a3137 transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #2a3137; border-radius: 20px; }
.nav-section {
  padding: 15px 10px 6px;
  color: #68727a;
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  white-space: nowrap;
}
.sidebar .nav-link {
  position: relative;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #aeb6bd;
  font-size: 12px;
  font-weight: 540;
  white-space: nowrap;
  overflow: hidden;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.sidebar .nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 3px;
  background: transparent;
}
.sidebar .nav-link i { width: 18px; flex: 0 0 18px; color: #828c94; font-size: 15px; text-align: center; }
.sidebar .nav-link > span:not(.nav-count) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.045); color: #fff; }
.sidebar .nav-link:hover i { color: #d0d6da; }
.sidebar .nav-link.active {
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.035);
  color: #fff;
  font-weight: 680;
}
.sidebar .nav-link.active::before { background: var(--brand); }
.sidebar .nav-link.active i { color: var(--brand); }
.nav-count {
  margin-left: auto;
  min-width: 19px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--brand);
  color: var(--ink-950);
  font-size: 8.5px;
  font-weight: 900;
}
.sidebar-footer {
  margin-top: auto;
  padding: 13px 6px 0;
  border-top: 1px solid rgba(255,255,255,.075);
}
.sidebar-profile { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sidebar-profile-avatar {
  width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 9px; background: #252b30; color: #fff; font-size: 9px; font-weight: 850;
}
.sidebar-profile-copy { min-width: 0; overflow: hidden; }
.sidebar-profile-name { color: #f0f2f3; font-size: 10.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-profile-role { margin-top: 2px; color: #7f8991; font-size: 9px; }
.sidebar-portfolio-link {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 8px 7px; border-radius: 8px;
  color: #909aa2; text-decoration: none; font-size: 10px;
}
.sidebar-portfolio-link:hover { color: #fff; background: rgba(255,255,255,.045); }

@media (min-width: 992px) {
  body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
    padding-inline: 10px;
  }
  body.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed-width); }
  body.sidebar-collapsed .brand-wrap { justify-content: center; padding-inline: 0; }
  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .nav-section,
  body.sidebar-collapsed .sidebar .nav-link > span:not(.nav-count),
  body.sidebar-collapsed .sidebar-profile-copy,
  body.sidebar-collapsed .sidebar-portfolio-link span { display: none; }
  body.sidebar-collapsed .sidebar-collapse-btn {
    position: absolute;
    left: 58px;
    top: 27px;
    width: 26px;
    height: 26px;
    z-index: 3;
    border-color: var(--border-strong);
    background: #fff;
    color: var(--ink-700);
    box-shadow: var(--shadow-xs);
  }
  body.sidebar-collapsed .sidebar-collapse-btn:hover { color: var(--ink-950); background: #f7f8f8; }
  body.sidebar-collapsed .sidebar-nav { padding-top: 13px; }
  body.sidebar-collapsed .sidebar .nav-link {
    justify-content: center;
    width: 48px;
    min-height: 44px;
    margin-inline: auto;
    padding: 9px;
  }
  body.sidebar-collapsed .sidebar .nav-link i { width: 20px; flex-basis: 20px; font-size: 16px; }
  body.sidebar-collapsed .sidebar .nav-link::before { top: 9px; bottom: 9px; }
  body.sidebar-collapsed .nav-count {
    position: absolute;
    top: 4px;
    right: 3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 7.5px;
  }
  body.sidebar-collapsed .sidebar-footer { padding-inline: 0; }
  body.sidebar-collapsed .sidebar-profile { justify-content: center; }
  body.sidebar-collapsed .sidebar-portfolio-link { justify-content: center; width: 44px; margin-inline: auto; }
  body.sidebar-collapsed .sidebar-portfolio-link i { margin: 0; }
}

/* Main application frame */
.main-content { margin-left: var(--sidebar-width); min-height: calc(100vh - var(--demo-bar-height)); transition: margin-left .22s ease; }
.topbar {
  height: var(--topbar-height);
  position: sticky;
  top: var(--demo-bar-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.page-title { font-size: 20px; font-weight: 790; letter-spacing: -.028em; color: var(--ink-950); }
.page-kicker { margin-top: 3px; color: var(--ink-500); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.workspace-status {
  align-items: center; gap: 7px; margin-right: 2px; color: var(--ink-500); font-size: 10.5px; font-weight: 650;
}
.workspace-status span { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-hover); box-shadow: 0 0 0 3px var(--brand-soft); }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--ink-700);
  box-shadow: var(--shadow-xs); transition: .15s ease;
}
.icon-btn:hover { border-color: var(--border-strong); background: var(--surface-subtle); color: var(--ink-950); }
.notification-dot {
  position: absolute; right: 7px; top: 7px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--brand-hover); border: 2px solid #fff;
}
.avatar {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid #22272b; border-radius: 10px; background: var(--ink-950); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: .02em;
}
.portfolio-btn {
  height: 38px; align-items: center; gap: 7px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--ink-700);
  font-size: 11px; font-weight: 700; box-shadow: var(--shadow-xs);
}
.portfolio-btn:hover { border-color: var(--border-strong); background: var(--surface-subtle); color: var(--ink-950); }
.search-box {
  min-height: 38px; display: flex; align-items: center; gap: 9px;
  padding: 0 11px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--ink-400); box-shadow: var(--shadow-xs);
}
.search-box:focus-within { border-color: #cfd6a8; box-shadow: 0 0 0 3px rgba(181,226,0,.09); }
.search-box input { width: 225px; border: 0; outline: 0; background: transparent; color: var(--ink-800); font-size: 11.5px; }
.search-box input::placeholder { color: #9aa3aa; }
.search-box kbd { padding: 2px 5px; border: 1px solid var(--border); border-radius: 5px; background: #f7f8f9; color: #87919a; font: 9px/1.2 inherit; box-shadow: none; }
.content-area { max-width: 1640px; margin: 0 auto; padding: 26px 28px 48px; }
.app-view { display: none; }
.app-view.active-view { display: block; animation: fadeIn .16s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* Application boot state */
.app-boot-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink-600);
  font-size: 11px;
  box-shadow: var(--shadow-xs);
}
.app-boot-notice i { color: var(--brand-deep); }
.app-boot-notice.is-error { border-color: #ecc6c9; background: #fff7f7; color: #7e3036; }
html[data-bgs-ready="1"] .app-boot-notice { display: none; }

/* Shared surfaces */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 19px;
  box-shadow: var(--shadow-xs);
}
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-header h2 { margin: 0; color: var(--ink-900); font-size: 14px; font-weight: 760; letter-spacing: -.015em; }
.panel-header p { margin: 4px 0 0; color: var(--ink-500); font-size: 10.5px; }
.badge-soft {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 5px 8px; border: 1px solid #e2e9bc; border-radius: 99px;
  background: var(--brand-soft); color: #5e7200; font-size: 9.5px; font-weight: 760;
}
.metric-card {
  height: 100%; min-height: 128px; padding: 17px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.metric-card:hover { transform: translateY(-1px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.metric-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.metric-label { color: var(--ink-500); font-size: 10.5px; font-weight: 650; }
.metric-icon {
  width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 9px; background: var(--brand-soft); color: var(--brand-deep); font-size: 14px;
}
.metric-value { margin-top: 12px; color: var(--ink-950); font-size: 25px; line-height: 1; font-weight: 820; letter-spacing: -.045em; }
.metric-foot { margin-top: 9px; color: var(--ink-500); font-size: 10px; }
.metric-foot .trend { margin-right: 5px; color: var(--success); font-weight: 770; }
.chart-frame { position: relative; min-height: 270px; }
.chart-frame canvas { max-height: 278px !important; }
.section-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 18px; }
.section-title { margin: 0; color: var(--ink-950); font-size: 21px; font-weight: 800; letter-spacing: -.032em; }
.section-description { max-width: 720px; margin: 4px 0 0; color: var(--ink-500); font-size: 11.5px; }
.btn { --bs-btn-font-size: 11px; --bs-btn-font-weight: 680; --bs-btn-border-radius: 9px; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: var(--ink-950); font-weight: 780; box-shadow: 0 3px 10px rgba(156,195,0,.12); }
.btn-brand:hover,.btn-brand:focus { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--ink-950); }
.btn-outline-dark { --bs-btn-color: var(--ink-700); --bs-btn-border-color: var(--border-strong); --bs-btn-hover-bg: var(--ink-950); --bs-btn-hover-border-color: var(--ink-950); --bs-btn-hover-color: #fff; background:#fff; }
.form-control,.form-select { border-color: var(--border); border-radius: 9px; font-size: 12px; }
.form-control:focus,.form-select:focus { border-color: #cbd88e; box-shadow: 0 0 0 3px rgba(181,226,0,.1); }

/* Tables */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: #fafbfb; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: 11px 9px; }
.table thead th {
  border-bottom: 1px solid var(--border); color: var(--ink-400);
  font-size: 8.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 820; white-space: nowrap;
}
.table tbody td { border-bottom-color: #eef0f2; color: var(--ink-700); font-size: 11.5px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: #fbfcfc; }
.entity-name { color: var(--ink-900); font-weight: 720; }
.entity-sub { margin-top: 2px; color: var(--ink-500); font-size: 9.5px; }
.status-pill {
  display: inline-flex; align-items: center; min-height: 22px;
  padding: 3px 7px; border: 1px solid transparent; border-radius: 99px; font-size: 9px; font-weight: 760;
}
.status-lead,.stage-new { background: #f1f5fb; border-color: #e2eaf6; color: var(--info); }
.status-prospect,.stage-proposal { background: #fff8e8; border-color: #f7e8bd; color: var(--warning); }
.stage-contacted { background: #eef8f5; border-color: #d8eee7; color: #2d7f6e; }
.stage-appointment { background: #eef6fb; border-color: #d9e9f3; color: #397b9a; }
.stage-negotiation { background: #f4f7e9; border-color: #e0e8bd; color: #718b28; }
.stage-lost { background: #f4f5f5; border-color: #e3e6e5; color: #69736f; }
.status-customer,.stage-won { background: #edf8f2; border-color: #d7eee1; color: var(--success); }
.stage-qualified { background: #f5f1fb; border-color: #e9ddf8; color: var(--purple); }
.filter-row { display: flex; gap: 10px; align-items: center; margin-bottom: 13px; }
.filter-row .search-box { flex: 1; }
.filter-row .search-box input { width: 100%; }
.empty-state { padding: 34px !important; color: var(--ink-500) !important; text-align: center !important; }

/* Pipeline */
.pipeline-board { display: grid; grid-template-columns: repeat(8,minmax(238px,1fr)); gap: 12px; overflow-x: auto; align-items: start; padding: 2px 1px 14px; scrollbar-width: thin; scrollbar-color: #8da39c transparent; scrollbar-gutter: stable; }
.pipeline-board::-webkit-scrollbar { height: 8px; }
.pipeline-board::-webkit-scrollbar-track { background: rgba(128,150,143,.10); border-radius: 99px; }
.pipeline-board::-webkit-scrollbar-thumb { background: #8da39c; border-radius: 99px; }
.pipeline-board::-webkit-scrollbar-thumb:hover { background: #6f8c83; }
.pipeline-column {
  min-width: 248px; min-height: 430px; padding: 11px;
  border: 1px solid #e5e8e9; border-radius: var(--radius-md); background: #f2f4f5;
}
.pipeline-column.drag-over { outline: 2px dashed var(--brand-hover); outline-offset: -4px; background: #f6f9e9; }
.pipeline-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 3px 12px; }
.pipeline-heading strong { color: var(--ink-800); font-size: 11px; font-weight: 760; }
.pipeline-total { color: var(--ink-500); font-size: 8.5px; font-weight: 650; }
.deal-card {
  cursor: grab; margin-bottom: 9px; padding: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 11px;
  box-shadow: var(--shadow-xs); transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.deal-card:hover { transform: translateY(-1px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.deal-card:active { cursor: grabbing; }
.deal-title { color: var(--ink-900); font-size: 11px; font-weight: 740; line-height: 1.35; }
.deal-contact { margin-top: 4px; color: var(--ink-500); font-size: 9.5px; }
.deal-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; }
.deal-value { color: var(--ink-800); font-size: 10.5px; font-weight: 800; }
.owner-chip { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--ink-900); color: #fff; font-size: 8px; font-weight: 800; }

/* Tasks and dashboard lists */
.task-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid #eef0f2; }
.task-row:last-child { border-bottom: 0; }
.task-check { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--brand-hover); }
.task-title { color: var(--ink-800); font-size: 11px; font-weight: 680; }
.task-meta { margin-top: 3px; color: var(--ink-500); font-size: 9.5px; }
.task-row.completed .task-title { color: var(--ink-400); text-decoration: line-through; }
.health-item { margin-bottom: 15px; }
.health-item:last-child { margin-bottom: 0; }
.health-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: var(--ink-600); font-size: 9.5px; }
.health-label strong { color: var(--ink-800); }
.health-bar { height: 6px; overflow: hidden; border-radius: 99px; background: #edf0f1; }
.health-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--brand-hover),var(--brand)); }
.mini-record { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eef0f2; }
.mini-record:last-child { border-bottom: 0; }
.mini-record strong { display: block; color: var(--ink-800); font-size: 10.5px; font-weight: 700; }
.mini-record div div { margin-top: 2px; color: var(--ink-500); font-size: 9.5px; }
.mini-icon { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--brand-soft); color: var(--brand-deep); font-size: 12px; }

/* Conversations */
.conversation-shell { display: grid; grid-template-columns: 310px minmax(0,1fr); height: 630px; }
.conversation-list { overflow-y: auto; border-right: 1px solid var(--border); background: #f9fafb; }
.conversation-item {
  width: 100%; display: flex; gap: 10px; padding: 14px;
  border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left;
  transition: background .12s ease;
}
.conversation-item:hover { background: #fff; }
.conversation-item.active { background: #fff; box-shadow: inset 2px 0 0 var(--brand-hover); }
.conversation-avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: var(--ink-900); color: #fff; font-size: 9px; font-weight: 800; }
.conversation-item strong { color: var(--ink-800); font-size: 10.5px; }
.conversation-company,.conversation-preview { margin-top: 2px; color: var(--ink-500); font-size: 9.5px; }
.unread-dot { min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center; border-radius: 99px; background: var(--brand); color: var(--ink-950); font-size: 8px; font-weight: 900; }
.conversation-thread { display: flex; flex-direction: column; min-width: 0; background: #fff; }
.conversation-thread-header { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 17px; border-bottom: 1px solid var(--border); }
.conversation-thread-header strong { color: var(--ink-800); font-size: 11px; }
.conversation-thread-header div div { margin-top: 2px; color: var(--ink-500); font-size: 9.5px; }
.conversation-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 20px; background: #fafbfb; }
.thread-message { max-width: 72%; padding: 10px 12px; border-radius: 12px; font-size: 11px; line-height: 1.5; }
.thread-message span { display: block; margin-top: 5px; font-size: 8px; opacity: .62; }
.thread-message.contact { align-self: flex-start; background: #fff; border: 1px solid var(--border); color: var(--ink-800); }
.thread-message.you { align-self: flex-end; background: var(--ink-900); color: #fff; }
.conversation-composer { display: flex; gap: 9px; padding: 13px; border-top: 1px solid var(--border); background: #fff; }

/* Calendar */
.calendar-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 16px; margin-bottom: 5px; border-bottom: 1px solid var(--border); }
.calendar-day { min-width: 67px; padding: 9px; border: 1px solid var(--border); border-radius: 11px; background: #fafbfb; text-align: center; }
.calendar-day span,.calendar-day small { display: block; color: var(--ink-500); font-size: 8.5px; }
.calendar-day strong { display: block; margin: 3px 0; color: var(--ink-900); font-size: 18px; line-height: 1.1; }
.calendar-day.active { border-color: var(--ink-950); background: var(--ink-950); }
.calendar-day.active strong { color: #fff; }
.calendar-day.active span,.calendar-day.active small { color: #aeb6bc; }
.appointment-row { display: grid; grid-template-columns: 66px 22px 1fr; min-height: 84px; align-items: stretch; }
.appointment-time { padding-top: 20px; color: var(--ink-500); font-size: 9.5px; font-weight: 650; }
.appointment-line { position: relative; }
.appointment-line:before { content: ""; position: absolute; top: 0; bottom: 0; left: 10px; width: 1px; background: var(--border); }
.appointment-line span { position: absolute; top: 24px; left: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand-hover); box-shadow: 0 0 0 4px var(--brand-soft); }
.appointment-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 9px 0; padding: 12px 13px; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.appointment-card strong { display: block; color: var(--ink-800); font-size: 10.5px; }
.appointment-card div div { margin-top: 3px; color: var(--ink-500); font-size: 9.5px; }
.summary-stat { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--border); color: var(--ink-600); font-size: 10.5px; }
.summary-stat strong { color: var(--ink-900); font-size: 18px; font-weight: 800; }
.summary-note { margin-top: 15px; padding: 11px; border: 1px solid var(--border); border-radius: 10px; background: #f8f9fa; color: var(--ink-500); font-size: 9.5px; line-height: 1.5; }

/* Forms / funnels / workflows */
.form-card h3,.funnel-card h3 { margin: 13px 0 5px; color: var(--ink-900); font-size: 13px; font-weight: 770; }
.form-card p,.funnel-card p { min-height: 34px; color: var(--ink-500); font-size: 10.5px; }
.form-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand-deep); font-size: 13px; }
.form-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 16px 0; }
.form-stats div { padding: 9px; border: 1px solid var(--border); border-radius: 9px; background: #fafbfb; }
.form-stats span { display: block; color: var(--ink-400); font-size: 7.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.form-stats strong { display: block; margin-top: 3px; color: var(--ink-900); font-size: 13px; }
.feature-list { margin: 0; padding-left: 18px; color: var(--ink-500); font-size: 10.5px; line-height: 1.85; }
.funnel-flow { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 15px 0; padding: 10px; border: 1px solid #e5ebcb; border-radius: 10px; background: #f8faef; }
.funnel-flow span { color: var(--ink-600); font-size: 8px; font-weight: 820; text-transform: uppercase; letter-spacing: .06em; }
.funnel-flow i { color: var(--brand-deep); font-size: 10px; }
.workflow-row { display: flex; align-items: flex-start; gap: 12px; padding: 15px 0; border-bottom: 1px solid #eef0f2; }
.workflow-row:last-child { border-bottom: 0; }
.workflow-icon { width: 37px; height: 37px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: var(--brand-soft); color: var(--brand-deep); }
.workflow-row strong { color: var(--ink-800); font-size: 11px; }
.workflow-meta { margin-top: 5px; color: var(--ink-500); font-size: 9.5px; }
.workflow-steps { display: flex; align-items: center; gap: 4px; margin-top: 9px; }
.workflow-steps span { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 6px; background: var(--ink-900); color: #fff; font-size: 8px; font-weight: 800; }
.workflow-steps i { color: var(--ink-400); font-size: 8px; }

/* AI */
.ai-panel { min-height: 575px; display: flex; flex-direction: column; }
.ai-chat { flex: 1; min-height: 380px; max-height: 505px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 1px 15px; }
.ai-message { max-width: 78%; padding: 11px 13px; border-radius: 12px; font-size: 11px; line-height: 1.55; white-space: pre-line; }
.ai-message.assistant { align-self: flex-start; border: 1px solid var(--border); background: #f6f7f8; color: var(--ink-800); }
.ai-message.user { align-self: flex-end; background: var(--ink-900); color: #fff; }
.ai-composer { display: flex; gap: 9px; padding-top: 13px; border-top: 1px solid var(--border); }
.suggestion-btn { width: 100%; padding: 10px 11px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--ink-700); text-align: left; font-size: 10.5px; font-weight: 630; transition: .14s ease; }
.suggestion-btn:hover { border-color: #d6e09c; background: #fbfdee; color: var(--ink-900); }

/* Misc */
.offcanvas-backdrop-custom { display: none; position: fixed; inset: var(--demo-bar-height) 0 0; z-index: 1040; background: rgba(5,7,9,.52); backdrop-filter: blur(2px); }
.toast { border-color: var(--border); border-radius: 12px; box-shadow: var(--shadow-md); }
.modal-content { border: 1px solid var(--border); border-radius: 15px; box-shadow: 0 30px 70px rgba(11,13,15,.16); }
.modal-header,.modal-footer { border-color: var(--border); }
.modal-title { font-size: 15px; font-weight: 780; }

@media (max-width: 1199.98px) {
  .topbar-search input { width: 190px; }
  .content-area { padding-inline: 22px; }
}

@media (max-width: 991.98px) {
  .sidebar { width: min(286px, 88vw); transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .offcanvas-backdrop-custom.show { display: block; }
  .main-content { margin-left: 0; }
  .topbar { padding: 0 18px; }
  .content-area { padding: 22px 18px 40px; }
  .conversation-shell { grid-template-columns: 280px minmax(0,1fr); }
}

@media (max-width: 767.98px) {
  :root { --demo-bar-height: 32px; --topbar-height: 68px; }
  .demo-ribbon-inner { max-width: 100vw; overflow: hidden; padding-inline: 10px; font-size: 9px; }
  .demo-ribbon-inner span:last-child,.demo-ribbon-separator:last-of-type { display: none; }
  .topbar { padding: 0 12px; }
  .page-title { font-size: 17px; }
  .page-kicker { display: none; }
  .content-area { padding: 16px 10px 32px; }
  .section-toolbar { align-items: flex-start; flex-direction: column; margin-bottom: 14px; }
  .section-toolbar .btn { width: 100%; }
  .section-title { font-size: 19px; }
  .panel { padding: 14px; border-radius: 12px; }
  .metric-card { min-height: 112px; padding: 14px; }
  .metric-value { font-size: 22px; }
  .metric-icon { width: 29px; height: 29px; }
  .chart-frame { min-height: 225px; }
  .chart-frame canvas { max-height: 230px !important; }
  .filter-row { align-items: stretch; flex-direction: column; }
  .filter-row select { width: 100% !important; }
  .pipeline-board { grid-template-columns: repeat(8,82vw); gap: 10px; }
  .ai-composer { flex-direction: column; }
  .ai-message { max-width: 92%; }
  .conversation-shell { display: block; height: auto; }
  .conversation-list { height: 235px; border-right: 0; border-bottom: 1px solid var(--border); }
  .conversation-thread { height: 500px; }
  .thread-message { max-width: 88%; }
  .appointment-row { grid-template-columns: 54px 18px 1fr; }
  .appointment-card { align-items: flex-start; flex-direction: column; }
  .form-stats { grid-template-columns: 1fr; }
  .conversation-composer { flex-direction: column; }
  .workflow-row { flex-wrap: wrap; }
  .workflow-row > .btn { width: 100%; margin-left: 49px; }
  .funnel-flow { justify-content: flex-start; overflow-x: auto; }
}

@media (max-width: 479.98px) {
  .demo-ribbon-inner span:nth-of-type(2), .demo-ribbon-inner .demo-ribbon-separator { display: none; }
  .metric-card { min-height: 104px; }
  .table > :not(caption) > * > * { padding-inline: 7px; }
}

/* v0.5 usability + data-management refinements */
.control-fit { width: auto; min-width: 150px; }
.table-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 28px; margin: -2px 0 8px; color: var(--ink-500); font-size: 11.5px;
}
.pagination-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 14px; margin-top: 8px; border-top: 1px solid var(--border);
}
.pagination-info { color: var(--ink-500); font-size: 11.5px; }
.record-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.btn-ghost {
  min-width: 31px; min-height: 31px; display: inline-grid; place-items: center;
  border: 1px solid transparent; background: transparent; color: var(--ink-500);
}
.btn-ghost:hover,.btn-ghost:focus { border-color: var(--border); background: var(--surface-subtle); color: var(--ink-900); }
.empty-state-block {
  min-height: 185px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; padding: 28px 18px; color: var(--ink-500); text-align: center;
}
.empty-state-block i { margin-bottom: 3px; color: var(--ink-400); font-size: 26px; }
.empty-state-block strong { color: var(--ink-800); font-size: 13px; }
.empty-state-block span { max-width: 360px; font-size: 11.5px; line-height: 1.55; }
.modal-subtitle { margin-top: 3px; color: var(--ink-500); font-size: 11px; }
.data-action-list { display: grid; gap: 0; }
.data-action {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.data-action:last-child { border-bottom: 0; }
.data-action strong { display: block; margin-bottom: 3px; color: var(--ink-800); font-size: 12.5px; }
.data-action p { max-width: 600px; margin: 0; color: var(--ink-500); font-size: 11.5px; line-height: 1.55; }
.danger-zone { margin-top: 3px; }
.architecture-note {
  display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 13px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface-subtle);
}
.architecture-note i { color: var(--brand-deep); font-size: 18px; }
.architecture-note p { margin: 0; color: var(--ink-600); font-size: 11.5px; line-height: 1.6; }

/* Readability pass: avoid prototype-small typography */
.sidebar .nav-link { font-size: 13px; }
.brand-name { font-size: 14px; }
.brand-subtitle { font-size: 11px; }
.page-kicker { font-size: 12px; }
.panel-header p,.section-description { font-size: 12px; line-height: 1.55; }
.metric-label { font-size: 11.5px; }
.table tbody td { font-size: 12.5px; }
.table thead th { font-size: 10.5px; }
.entity-name { font-size: 12.5px; }
.entity-sub,.task-meta,.workflow-meta,.conversation-company,.conversation-preview,.appointment-card div div { font-size: 10.5px; }
.task-title,.workflow-row strong,.appointment-card strong,.mini-record strong { font-size: 11.5px; }
.search-box input { font-size: 12px; }
.status-pill,.badge-soft { font-size: 9px; }
.form-label { color: var(--ink-700); font-size: 11.5px; font-weight: 650; }
.form-control,.form-select { font-size: 12.5px; }
.btn { font-size: 12px; }

@media (max-width: 767.98px) {
  .w-mobile-100 { width: 100%; }
  .w-mobile-100 .btn { flex: 1; }
  .control-fit { width: 100%; }
  .pagination-bar { align-items: stretch; flex-direction: column; }
  .pagination-bar .btn-group { width: 100%; }
  .pagination-bar .btn { flex: 1; }
  .data-action { align-items: stretch; flex-direction: column; }
  .data-action .btn { width: 100%; }
  .record-actions { gap: 1px; }
}
.guide-step { height: 100%; display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-subtle); }
.guide-step > span { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; background: var(--ink-900); color: #fff; font-size: 11px; font-weight: 800; }
.guide-step strong { display: block; color: var(--ink-800); font-size: 12.5px; }
.guide-step p { margin: 4px 0 0; color: var(--ink-500); font-size: 11.5px; line-height: 1.5; }
.guide-note { display: flex; align-items: flex-start; gap: 9px; padding: 12px 13px; border: 1px solid #dfe7ba; border-radius: 10px; background: #f8faef; color: var(--ink-600); font-size: 11.5px; line-height: 1.55; }
.guide-note i { margin-top: 1px; color: var(--brand-deep); }


/* v0.6 accessibility and guided exploration refinements */
.skip-link{position:fixed;left:16px;top:10px;z-index:2000;padding:10px 14px;border-radius:8px;background:#fff;color:#111;border:1px solid #dfe3e8;box-shadow:0 8px 24px rgba(0,0,0,.14);transform:translateY(-160%);transition:transform .18s ease;text-decoration:none;font-weight:700}
.skip-link:focus{transform:translateY(0)}
:where(a,button,input,select,textarea,[tabindex]):focus-visible{outline:3px solid rgba(181,226,0,.55);outline-offset:2px}
.guide-step-action{width:100%;text-align:left;border:1px solid var(--border-color,#e4e7eb);background:var(--surface,#fff);cursor:pointer;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.guide-step-action:hover{border-color:rgba(181,226,0,.9);box-shadow:0 8px 22px rgba(16,24,40,.08);transform:translateY(-1px)}
.guide-step-action small{display:inline-flex;align-items:center;gap:6px;margin-top:8px;color:#52606d;font-weight:700}
.guide-step-action:hover small{color:#111}
@media (prefers-reduced-motion: reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}

/* =========================================================
   v0.7.0 — Professional SaaS UI System
   Portfolio Demo / Prototype — Presentation Layer Refactor
   ========================================================= */
:root {
  --brand: #b5e200;
  --brand-hover: #a4cf00;
  --brand-ink: #101708;
  --app-bg: #f4f7f6;
  --surface: #ffffff;
  --surface-subtle: #f8faf9;
  --surface-muted: #eef3f1;
  --border: #e2e8e5;
  --border-strong: #d3dcd8;
  --text: #17211f;
  --text-strong: #0d1513;
  --muted: #687671;
  --muted-2: #8a9792;
  --sidebar-bg: #15312d;
  --sidebar-bg-2: #122a27;
  --sidebar-text: #dce6e2;
  --sidebar-muted: #86a09a;
  --sidebar-hover: rgba(255,255,255,.055);
  --sidebar-active: rgba(181,226,0,.09);
  --chart-primary: #1c8a70;
  --chart-secondary: #6aa321;
  --chart-grid: #e8eeeb;
  --chart-text: #7a8883;
  --shadow-card: 0 1px 2px rgba(17,35,30,.03), 0 8px 24px rgba(17,35,30,.035);
  --sidebar-width: 232px;
  --sidebar-collapsed-width: 72px;
  --demo-bar-height: 0px;
  --topbar-height: 66px;
  --radius-xs: 7px;
  --radius-sm: 9px;
  --radius-md: 12px;
  --radius-lg: 14px;
}

html[data-theme="dark"] {
  --app-bg: #0f1514;
  --surface: #151d1b;
  --surface-subtle: #192320;
  --surface-muted: #1d2825;
  --border: #2a3733;
  --border-strong: #35443f;
  --text: #dce7e3;
  --text-strong: #f4f8f6;
  --muted: #93a39d;
  --muted-2: #71837d;
  --sidebar-bg: #0c1c19;
  --sidebar-bg-2: #091714;
  --sidebar-text: #e7efec;
  --sidebar-muted: #78928a;
  --sidebar-hover: rgba(255,255,255,.06);
  --sidebar-active: rgba(181,226,0,.10);
  --chart-primary: #57b99f;
  --chart-secondary: #b5e200;
  --chart-grid: #26332f;
  --chart-text: #91a39c;
  --shadow-card: 0 1px 2px rgba(0,0,0,.2), 0 10px 28px rgba(0,0,0,.13);
}

html, body { background: var(--app-bg); color: var(--text); }
body { font-size: 13px; line-height: 1.5; }
.app-shell { padding-top: 0 !important; }
.demo-ribbon { display: none !important; }

.sidebar {
  top: 0;
  width: var(--sidebar-width);
  padding: 16px 10px 14px;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  border-right: 1px solid rgba(255,255,255,.055);
  box-shadow: none;
}
.brand-wrap {
  min-height: 52px;
  padding: 0 6px 14px;
  gap: 10px;
  border-bottom-color: rgba(255,255,255,.075);
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 10px;
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: none;
}
.brand-name { color: #f4f8f6; font-size: 12px; font-weight: 720; }
.brand-subtitle { color: var(--sidebar-muted); font-size: 9px; }
.sidebar-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255,255,255,.035);
  border-color: rgba(255,255,255,.075);
  color: #9bb0aa;
}
.sidebar-nav { padding: 7px 1px 10px; gap: 1px; }
.nav-section {
  padding: 13px 10px 5px;
  color: #66847c;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .16em;
}
.sidebar .nav-link {
  min-height: 36px;
  gap: 9px;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  color: #a9bbb5;
  font-size: 11px;
  font-weight: 520;
}
.sidebar .nav-link::before { display: none; }
.sidebar .nav-link i { color: #78968e; font-size: 13px; }
.sidebar .nav-link:hover { background: var(--sidebar-hover); color: #f7faf9; }
.sidebar .nav-link:hover i { color: #dce7e3; }
.sidebar .nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 650;
  box-shadow: inset 2px 0 0 var(--brand);
}
.sidebar .nav-link.active i { color: var(--brand); }
.nav-count {
  min-width: 17px;
  height: 17px;
  background: rgba(181,226,0,.14);
  color: var(--brand);
  font-size: 8px;
}
.sidebar-footer { border-top-color: rgba(255,255,255,.07); padding-top: 12px; }
.sidebar-profile-avatar { background: rgba(255,255,255,.07); }
.sidebar-profile-name { font-size: 10px; }
.sidebar-profile-role, .sidebar-portfolio-link { color: #769189; }

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--app-bg);
}
.topbar {
  top: 0;
  height: var(--topbar-height);
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.page-title { color: var(--text-strong); font-size: 18px; font-weight: 740; letter-spacing: -.02em; }
.page-kicker { color: var(--muted); font-size: 10px; }
.topbar-actions { gap: 7px; }
.preview-chip {
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}
.icon-btn, .portfolio-btn {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}
.icon-btn { width: 34px; height: 34px; border-radius: 8px; }
.icon-btn:hover, .portfolio-btn:hover { background: var(--surface-subtle); border-color: var(--border-strong); color: var(--text-strong); }
.avatar { background: var(--text-strong); color: var(--surface); }
html[data-theme="dark"] .avatar { background: #e7efec; color: #11201c; }
.topbar-search { width: min(310px, 27vw); background: var(--surface-subtle); border-color: var(--border); }
.topbar-search input { color: var(--text); background: transparent; }
.topbar-search input::placeholder { color: var(--muted-2); }
.topbar-search kbd { background: var(--surface); color: var(--muted); border-color: var(--border); }

.content-area { padding: 22px 24px 34px; }
.app-boot-notice { border-color: var(--border); background: var(--surface); color: var(--muted); }

.dashboard-summary-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 2px 3px;
}
.dashboard-welcome .eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.dashboard-welcome h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -.025em;
}
.dashboard-welcome p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.dashboard-summary-actions { display: flex; gap: 8px; }

.metric-card {
  min-height: 118px;
  padding: 16px 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.metric-label { color: var(--muted); font-size: 9px; font-weight: 650; }
.metric-icon {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--chart-primary);
}
.metric-value { margin-top: 13px; color: var(--text-strong); font-size: 22px; font-weight: 770; letter-spacing: -.03em; }
.metric-foot { margin-top: 6px; color: var(--muted); font-size: 9px; }
.metric-foot .trend { color: var(--chart-primary); font-weight: 700; }

.attention-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
.attention-card {
  display: grid;
  grid-template-columns: 32px minmax(0,1fr) 24px;
  align-items: center;
  gap: 11px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}
.attention-card:hover { border-color: var(--border-strong); background: var(--surface-subtle); }
.attention-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font-size: 12px; }
.attention-icon.warning { background: #fff4d7; color: #8b6416; }
.attention-icon.success { background: #e7f6f0; color: #26755e; }
html[data-theme="dark"] .attention-icon.warning { background: #3a3019; color: #e0bd6b; }
html[data-theme="dark"] .attention-icon.success { background: #163a30; color: #6ec4a9; }
.attention-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.attention-copy strong { color: var(--text-strong); font-size: 10px; font-weight: 700; }
.attention-copy small { color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attention-arrow { justify-self: end; color: var(--muted-2); }

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.panel-header { padding: 15px 16px 12px; border-bottom-color: var(--border); }
.panel-header.compact { padding-bottom: 10px; }
.panel-header h2 { color: var(--text-strong); font-size: 12px; font-weight: 710; letter-spacing: -.01em; }
.panel-header p { margin-top: 2px; color: var(--muted); font-size: 9px; }
.btn-link-clean {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--chart-primary);
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
}
.btn-link-clean:hover { color: var(--text-strong); }
.chart-frame { min-height: 300px; padding: 8px 12px 13px; }
.dashboard-chart-panel .chart-frame { height: 318px; }

.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border); }
.table thead th { color: var(--muted-2); font-size: 7.5px; letter-spacing: .08em; }
.table tbody td { color: var(--text); font-size: 10px; }
.entity-name, .deal-title, .task-title { color: var(--text-strong); }
.entity-sub, .task-meta, .deal-contact { color: var(--muted); }
.dashboard-table tbody tr:last-child td { border-bottom: 0; }

.task-row { border-bottom-color: var(--border); padding-block: 9px; }
.radar-list .task-row { padding: 10px 0; }
.radar-list .task-check { width: 14px; height: 14px; }
.radar-list .task-title { font-size: 9.5px; }
.radar-list .task-meta { font-size: 8px; }

.health-item { margin-bottom: 15px; }
.health-label { color: var(--muted); font-size: 9px; }
.health-label strong { color: var(--text-strong); }
.health-bar { height: 5px; background: var(--surface-muted); }
.health-bar span { background: var(--chart-primary); }

.mini-record { border-bottom-color: var(--border); padding: 10px 0; }
.mini-icon { background: var(--surface-muted); color: var(--chart-primary); }
.mini-record strong { color: var(--text-strong); font-size: 9.5px; }
.mini-record div { color: var(--muted); font-size: 8.5px; }

.section-title { color: var(--text-strong); }
.section-description, .table-meta, .pagination-info { color: var(--muted); }
.filter-row, .search-box, .form-control, .form-select {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.form-control:focus, .form-select:focus { border-color: #8db55c; box-shadow: 0 0 0 .18rem rgba(181,226,0,.10); }
html[data-theme="dark"] .form-control, html[data-theme="dark"] .form-select { color-scheme: dark; }
.search-box input { color: var(--text); }
.search-box input::placeholder { color: var(--muted-2); }

.btn-brand {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
  font-weight: 720;
  box-shadow: none;
}
.btn-brand:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-ink); }
.btn-outline-dark { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
.btn-outline-dark:hover { color: var(--text-strong); background: var(--surface-subtle); border-color: var(--border-strong); }
.btn-light { background: var(--surface-subtle); color: var(--text); border-color: var(--border); }
.btn-light:hover { background: var(--surface-muted); color: var(--text-strong); border-color: var(--border-strong); }

.status-pill, .badge-soft { border-color: var(--border); }
.badge-soft { background: var(--surface-subtle); color: var(--muted); }
.owner-chip { background: var(--text-strong); color: var(--surface); }
html[data-theme="dark"] .owner-chip { background: #dce7e3; color: #12201c; }

.pipeline-column { background: var(--surface-subtle); border-color: var(--border); }
.deal-card { background: var(--surface); border-color: var(--border); box-shadow: none; }
.deal-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-card); }

.modal-content, .toast { background: var(--surface); color: var(--text); border-color: var(--border); }
.modal-header, .modal-footer, .toast-header { border-color: var(--border); background: var(--surface); color: var(--text); }
.btn-close { filter: none; }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(180%); }

.conversation-shell, .conversation-list, .conversation-panel, .calendar-card, .funnel-card, .workflow-card, .product-card, .settings-card, .ai-shell {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.conversation-item { border-bottom-color: var(--border); color: var(--text); }
.conversation-item:hover, .conversation-item.active { background: var(--surface-subtle); }

.empty-state-block { color: var(--muted); }
.empty-state-block strong { color: var(--text-strong); }

@media (min-width: 992px) {
  body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); }
  body.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed-width); }
  body.sidebar-collapsed .sidebar-collapse-btn {
    left: 54px;
    top: 24px;
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
  }
}

@media (max-width: 1199.98px) {
  .dashboard-summary-row { align-items: flex-start; }
  .dashboard-summary-actions { flex-wrap: wrap; justify-content: flex-end; }
  .dashboard-chart-panel .chart-frame { height: 290px; }
}

@media (max-width: 991.98px) {
  .sidebar { top: 0; }
  .main-content { margin-left: 0; }
  .topbar { padding-inline: 18px; }
  .content-area { padding: 18px; }
  .dashboard-summary-row { flex-direction: column; align-items: stretch; }
  .dashboard-summary-actions { justify-content: flex-start; }
}

@media (max-width: 767.98px) {
  .content-area { padding: 14px 12px 24px; }
  .topbar { height: 60px; padding-inline: 12px; }
  .page-title { font-size: 16px; }
  .page-kicker { display: none; }
  .dashboard-welcome h2 { font-size: 19px; }
  .dashboard-welcome p { font-size: 10px; }
  .dashboard-summary-actions { width: 100%; }
  .dashboard-summary-actions .btn { flex: 1 1 auto; }
  .attention-grid { grid-template-columns: 1fr; }
  .attention-copy small { white-space: normal; }
  .metric-card { min-height: 108px; padding: 14px; }
  .metric-value { font-size: 20px; }
  .panel-header { padding: 13px 13px 10px; }
  .chart-frame { min-height: 250px; }
  .dashboard-chart-panel .chart-frame { height: 260px; }
  .topbar-actions .portfolio-btn, .preview-chip { display: none !important; }
}

@media (max-width: 479.98px) {
  .topbar-actions { gap: 5px; }
  .icon-btn { width: 32px; height: 32px; }
  .avatar { width: 32px; height: 32px; }
  .dashboard-summary-actions .btn { width: 100%; }
}


/* v0.7.1 navigation reliability: fixed footer + explicit scrollable menu */
.sidebar { overflow: hidden; }
.brand-wrap { flex: 0 0 auto; }
.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #4f7068 rgba(255,255,255,.035);
  padding-right: 5px;
}
.sidebar-nav::-webkit-scrollbar { width: 7px; }
.sidebar-nav::-webkit-scrollbar-track { background: rgba(255,255,255,.035); border-radius: 99px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #4f7068; border-radius: 99px; border: 1px solid rgba(8,24,20,.35); }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: #6b9086; }
.sidebar-footer { flex: 0 0 auto; background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.04) 100%); }

/* =========================================================
   v0.7.2 — Sidebar navigation single-column reliability fix
   Prevent Bootstrap .nav flex wrapping from creating a second
   navigation column when the menu exceeds the available height.
   ========================================================= */

.sidebar {
  overflow: hidden;
}

.brand-wrap {
  flex: 0 0 auto;
}

.sidebar-nav {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch;
  align-content: stretch;

  flex: 1 1 auto;
  min-height: 0;
  width: 100%;

  overflow-y: auto;
  overflow-x: hidden;

  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #4f7068 rgba(255,255,255,.035);

  padding-right: 5px;
}

/* Keep every section heading and navigation link in the same column. */
.sidebar-nav > .nav-section,
.sidebar-nav > .nav-link {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
}

.sidebar-nav::-webkit-scrollbar {
  width: 7px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: rgba(255,255,255,.035);
  border-radius: 99px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #4f7068;
  border-radius: 99px;
  border: 1px solid rgba(8,24,20,.35);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #6b9086;
}

.sidebar-footer {
  flex: 0 0 auto;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.04) 100%);
}