/* ===========================================================
   iLiberty Backoffice — CRM module
   Mobile-first. Desktop enhancements live under min-width.
   =========================================================== */

/* ---------- Visibility helpers (mobile-first) ----------
   Only hide — never force a display value. That way a `.bo-kanban` that is
   also `.bo-only-desktop` keeps `display: grid` instead of being flattened
   to `block` by a `display: revert !important`. */
@media (max-width: 899.98px) {
  .bo-only-desktop {
    display: none !important;
  }
}
@media (min-width: 900px) {
  .bo-only-mobile {
    display: none !important;
  }
}

/* ---------- Workspace chrome ---------- */
.bo-workspace {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 5.5rem; /* room for FAB + tab bar */
}
@media (min-width: 900px) {
  .bo-workspace {
    padding-bottom: 1.5rem;
  }
}

.bo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}
.bo-toolbar--end {
  justify-content: flex-end;
}
.bo-toolbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.bo-toolbar__stat {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.bo-toolbar__stat b {
  color: var(--text);
  font-weight: 700;
}

.bo-chiprail {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.15rem 0 0.35rem;
  scrollbar-width: none;
}
.bo-chiprail::-webkit-scrollbar {
  display: none;
}

.bo-filter {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.bo-filter:hover {
  border-color: #cbd5e1;
  color: var(--text);
}
.bo-filter--on {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}
.bo-filter__count {
  font-size: 0.72rem;
  opacity: 0.8;
}

/* ---------- Period / date range filter ---------- */
.bo-period {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.bo-period__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}
.bo-period__label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  flex: 0 0 auto;
}
.bo-period__label .material-icons {
  font-size: 1.1rem;
}
.bo-period__active {
  font-weight: 700;
  color: var(--brand-dark);
  margin-left: 0.15rem;
}
.bo-period__presets {
  flex: 1 1 auto;
  min-width: 0;
}
.bo-period__clear {
  flex: 0 0 auto;
  margin-left: auto;
}
.bo-period__custom {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}
.bo-period__custom label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.bo-period__custom input[type="date"] {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

.bo-segment {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 9999px;
  padding: 0.2rem;
  gap: 0.15rem;
}
.bo-segment button {
  border: 0;
  background: transparent;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.bo-segment button.on,
.bo-segment button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.bo-segment button small {
  margin-left: 0.25rem;
  opacity: 0.7;
}

.bo-search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 12rem;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.75rem;
}
.bo-search .material-icons {
  color: var(--text-muted);
  font-size: 1.15rem;
}
.bo-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 0.9rem;
}

/* ---------- Cards (mobile list) ---------- */
.bo-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.bo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.bo-card__link {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.9rem 1rem;
  text-align: left;
  text-decoration: none;
  color: inherit;
  width: 100%;
  border: 0;
  background: transparent;
}
.bo-card__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: space-between;
}
.bo-card__title {
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bo-card__sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.bo-card__amount {
  font-weight: 700;
  color: var(--brand-dark);
}
.bo-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid #f1f5f9;
}
.bo-card__stats span {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.bo-card__stats small {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.bo-card__stats b {
  font-size: 0.85rem;
}
.bo-card__actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.bo-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.bo-cards__empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

/* ---------- Tables (desktop) ---------- */
.bo-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.bo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.bo-table th {
  text-align: left;
  padding: 0.7rem 1rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  white-space: nowrap;
}
.bo-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.bo-table--rows tbody tr:last-child td {
  border-bottom: 0;
}
.bo-table a {
  color: inherit;
  text-decoration: none;
}
.bo-table a:hover b {
  color: var(--brand-light);
}
.bo-table a b {
  display: block;
}
.bo-table a small,
.bo-table td small {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 400;
  margin-top: 0.1rem;
}
.bo-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bo-row--click {
  cursor: pointer;
}
.bo-row--click:hover {
  background: #f8fafc;
}
.bo-row--off {
  opacity: 0.55;
}

.bo-ident {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.bo-avatar {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #e0f7fb, #d1fae5);
  color: var(--brand-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ---------- Forms / sheets ---------- */
.bo-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.bo-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
}
.bo-field > span {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.bo-field input,
.bo-field select,
.bo-field textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  background: var(--surface);
  color: var(--text);
}
.bo-field input:focus,
.bo-field select:focus,
.bo-field textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--brand-light) 40%, transparent);
  border-color: var(--brand-light);
}
.bo-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
@media (max-width: 520px) {
  .bo-field-row {
    grid-template-columns: 1fr;
  }
}
.bo-field--inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}
.bo-field--tight input {
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
}
.bo-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.875rem;
}
.bo-check--block {
  margin-top: 0.75rem;
}
.bo-check input {
  margin-top: 0.2rem;
}
.bo-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.bo-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.bo-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
}
.bo-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0c4a6e;
  border-radius: var(--radius);
  padding: 0.75rem 0.95rem;
  font-size: 0.85rem;
  line-height: 1.4;
}
.bo-notice .material-icons {
  font-size: 1.15rem;
  flex: 0 0 auto;
}
.bo-notice--warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.bo-notice--bad {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.bo-muted {
  color: var(--text-muted);
}
.bo-pos {
  color: #047857;
  font-weight: 700;
}
.bo-neg {
  color: #b91c1c;
  font-weight: 700;
}
.bo-warn {
  color: #b45309;
  font-weight: 600;
}
.bo-warn-icon {
  font-size: 1.05rem !important;
  color: var(--warning);
  vertical-align: middle;
  margin-left: 0.25rem;
}
.bo-block {
  display: inline-flex;
  margin-top: 0.75rem;
}
.bo-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  text-decoration: none;
}
.bo-icon-btn:hover {
  color: var(--brand-dark);
  border-color: #cbd5e1;
}
.bo-icon-btn .material-icons {
  font-size: 1.1rem;
}

/* Floating action button — mobile primary CTA */
.bo-fab {
  position: fixed;
  right: 1rem;
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 9999px;
  border: 0;
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 8px 24px rgb(0 191 154 / 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bo-fab .material-icons {
  font-size: 1.6rem;
}

/* ---------- Sheet (drawer / bottom sheet) ---------- */
.bo-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(15 23 42 / 0.45);
  z-index: 80;
  animation: bo-fade 0.18s ease;
}
.bo-sheet {
  position: fixed;
  z-index: 90;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  animation: bo-sheet-up 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  /* Mobile: bottom sheet */
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 1.1rem 1.1rem 0 0;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 720px) {
  .bo-sheet {
    left: auto;
    top: 0;
    bottom: 0;
    right: 0;
    width: min(28rem, 100vw);
    max-height: none;
    border-radius: 0;
    animation: bo-sheet-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .bo-sheet--wide {
    width: min(40rem, 100vw);
  }
}
.bo-sheet__handle {
  width: 2.5rem;
  height: 0.28rem;
  background: #cbd5e1;
  border-radius: 9999px;
  margin: 0.55rem auto 0;
}
@media (min-width: 720px) {
  .bo-sheet__handle {
    display: none;
  }
}
.bo-sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem 0.65rem;
  border-bottom: 1px solid var(--border);
}
.bo-sheet__titles {
  min-width: 0;
}
.bo-sheet__title {
  font-size: 1.05rem;
  font-weight: 700;
}
.bo-sheet__subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.bo-sheet__close {
  border: 0;
  background: #f1f5f9;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.bo-sheet__body {
  padding: 1rem 1.1rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

@keyframes bo-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes bo-sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes bo-sheet-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* ---------- Detail panels ---------- */
.bo-detail__hero {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.bo-detail__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.bo-detail__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1rem;
  margin: 0;
}
.bo-fact dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  font-weight: 600;
}
.bo-fact dd {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.1rem 0 0;
}
.bo-detail__notes {
  margin-top: 1rem;
}
.bo-detail__notes h3,
.bo-detail__section {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 1rem 0 0.5rem;
}
.bo-detail__notes p {
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.bo-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}
.bo-detail__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0;
}
.bo-detail__stats > div {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}
.bo-detail__stats span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.bo-detail__stats strong {
  font-size: 1.1rem;
}

.bo-people {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.bo-people li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.bo-people__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.bo-people__main b {
  font-size: 0.9rem;
}
.bo-people__main small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.bo-statusbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.bo-statusbar__error {
  color: #b91c1c;
  font-size: 0.8rem;
  width: 100%;
}

/* ---------- Kanban ---------- */
.bo-kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(16.5rem, 1fr);
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  align-items: stretch;
}
/* Desktop: board claims leftover viewport height instead of a short strip. */
@media (min-width: 900px) {
  .bo-workspace:has(> .bo-kanban) {
    flex: 1;
    min-height: calc(100dvh - var(--header-offset, 4rem) - 2rem);
  }
  .bo-workspace:has(> .bo-kanban) > .bo-kanban {
    flex: 1;
    min-height: min(70dvh, calc(100dvh - var(--header-offset, 4rem) - 11rem));
  }
}
.bo-kanban__col {
  background: #f1f5f9;
  border-radius: var(--radius);
  padding: 0.55rem;
  min-height: 12rem;
  transition: background 0.15s, outline-color 0.15s;
  outline: 2px solid transparent;
}
.bo-kanban__col--target {
  background: #e0f7fb;
  outline-color: var(--brand-light);
}
.bo-kanban__head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.45rem 0.55rem;
}
.bo-kanban__name {
  font-weight: 700;
  font-size: 0.82rem;
  flex: 1;
}
.bo-kanban__count {
  font-size: 0.72rem;
  background: #fff;
  border-radius: 9999px;
  padding: 0.1rem 0.45rem;
  color: var(--text-muted);
  font-weight: 600;
}
.bo-kanban__sum {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.bo-kanban__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 4rem;
}
.bo-kanban__empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem 0.5rem;
}
.bo-deal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.75rem;
  cursor: grab;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  touch-action: none;
}
.bo-deal:active {
  cursor: grabbing;
}
.bo-deal__title {
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.3;
}
.bo-deal__company {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.bo-deal__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
}
.bo-deal__prob {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}
.bo-deal__date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.bo-stage {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  flex: 0 0 auto;
}

/* ---------- Timeline / activities ---------- */
.bo-timeline__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.bo-timeline__list > li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.65rem;
}
.bo-timeline__icon {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: #f1f5f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.bo-timeline__icon .material-icons {
  font-size: 1rem;
}
.bo-timeline__body {
  font-size: 0.875rem;
  line-height: 1.4;
  white-space: pre-wrap;
}
.bo-timeline__meta {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.bo-timeline__empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}
.bo-note-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.bo-note-form textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  resize: vertical;
  min-height: 4rem;
}

/* ---------- Estimating calculator ---------- */
.bo-calc {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.bo-calc__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}
.bo-calc__verdict {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.35rem 0.7rem;
  border-radius: 9999px;
}
.bo-calc__verdict[data-tone="success"] {
  background: #d1fae5;
  color: #047857;
}
.bo-calc__verdict[data-tone="info"] {
  background: #dbeafe;
  color: #1d4ed8;
}
.bo-calc__verdict[data-tone="warning"] {
  background: #fef3c7;
  color: #b45309;
}
.bo-calc__verdict[data-tone="danger"] {
  background: #fee2e2;
  color: #b91c1c;
}
.bo-calc__rows {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.bo-calc__row {
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
}
.bo-calc__row:last-child {
  border-bottom: 0;
}
.bo-calc__row input,
.bo-calc__row select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.45rem;
  font-size: 0.85rem;
}
.bo-calc__desc {
  min-width: 0;
}
.bo-calc__remove {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 0.2rem;
  display: inline-flex;
}
.bo-calc__remove:hover {
  color: #b91c1c;
}
.bo-calc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.bo-calc__headroom {
  font-size: 0.85rem;
  color: #047857;
  font-weight: 600;
}
.bo-calc__headroom--bad {
  color: #b91c1c;
}
.bo-calc__saved {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.bo-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 9999px;
}
.bo-chip--success {
  background: #d1fae5;
  color: #047857;
}
.bo-chip--info {
  background: #dbeafe;
  color: #1d4ed8;
}
.bo-chip--warning {
  background: #fef3c7;
  color: #b45309;
}
.bo-chip--danger {
  background: #fee2e2;
  color: #b91c1c;
}

/* ---------- Contracts ---------- */
.bo-contract__hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, #002b49 0%, #01466f 60%, #00b6d6 140%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-md);
}
.bo-contract__hero-main {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.bo-contract__hero-main strong {
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}
.bo-contract__hero-main .chip {
  align-self: flex-start;
}
.bo-contract__hero-main .bo-muted {
  color: rgb(255 255 255 / 0.72);
}
.bo-contract__hero-margin {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}
.bo-contract__hero-margin span {
  font-size: 0.75rem;
  opacity: 0.8;
}
.bo-contract__hero-margin strong {
  font-size: 1.35rem;
}

.bo-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  transition: border-color 0.15s, background 0.15s;
}
.bo-upload:hover {
  border-color: var(--brand-light);
  background: #f0f9ff;
}
.bo-upload input {
  display: none;
}
.bo-upload .material-icons {
  font-size: 1.75rem;
  color: var(--brand-light);
}
.bo-upload span:not(.material-icons) {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}
.bo-upload small {
  font-size: 0.75rem;
}
.bo-upload--busy {
  opacity: 0.6;
  pointer-events: none;
}

.bo-files {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.bo-files li button {
  width: 100%;
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.65rem;
  align-items: center;
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
}
.bo-files li button .material-icons {
  grid-row: 1 / -1;
  color: var(--brand-light);
}
.bo-files__name {
  font-weight: 600;
  font-size: 0.875rem;
}
.bo-files__meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.bo-files__empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

.bo-delivery {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.bo-delivery__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}
@media (min-width: 720px) {
  .bo-delivery__stats {
    grid-template-columns: repeat(4, 1fr);
  }
}
.bo-delivery__stats > div {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
}
.bo-delivery__stats span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.bo-delivery__stats strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.bo-meter {
  position: relative;
  height: 0.55rem;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}
.bo-meter--lg {
  height: 0.85rem;
}
.bo-meter__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.bo-meter__mark {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--brand-dark);
  opacity: 0.35;
}

/* ---------- Dashboard ----------
   One vertical rhythm for every Painel: nav → period → KPIs → charts.
   Gutters are always 1rem so 2-tile and 6-tile pages align the same way. */
.bo-dash {
  --bo-dash-gap: 1rem;
  display: flex;
  flex-direction: column;
  gap: var(--bo-dash-gap);
}
.bo-dash > .bo-dashnav,
.bo-dash > .bo-period,
.bo-dash > .bo-kpis,
.bo-dash > .bo-alerts,
.bo-dash > .bo-grid,
.bo-dash > .bo-grid--dash,
.bo-dash > .bo-panel-portals,
.bo-dash > .panel-card {
  margin-bottom: 0;
  margin-top: 0;
}

.bo-kpis {
  display: grid;
  /* auto-fit: 2 KPIs fill the row; 6 KPIs pack without empty tracks. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
  gap: var(--bo-dash-gap, 1rem);
  margin-bottom: 1rem;
}
@media (min-width: 720px) {
  .bo-kpis {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  }
}
@media (min-width: 1100px) {
  .bo-kpis {
    grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  }
}

.bo-grid {
  display: grid;
  gap: var(--bo-dash-gap, 1rem);
  margin-bottom: 1rem;
}
.bo-grid--2 {
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .bo-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
}

.bo-summary-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.bo-summary-strip > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}
.bo-summary-strip span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.bo-summary-strip strong {
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.bo-stalled {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}
.bo-stalled li {
  margin: 0;
}
.bo-stalled a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 0.12rem 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #eef2f6;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.03);
  color: inherit;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease,
    box-shadow 0.12s ease;
}
.bo-stalled a:hover,
.bo-stalled a:focus-visible {
  background: #fff;
  border-color: #dbeafe;
  box-shadow: 0 2px 6px rgb(15 23 42 / 0.06);
  outline: none;
}
.bo-stalled__title {
  grid-column: 1;
  grid-row: 1;
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--brand-dark);
  min-width: 0;
  overflow-wrap: anywhere;
}
.bo-stalled__meta {
  grid-column: 1;
  grid-row: 2;
  font-size: 0.74rem;
  color: var(--text-muted);
  min-width: 0;
  overflow-wrap: anywhere;
}
.bo-stalled__age {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

/* ---------- Charts ---------- */
.bo-chart {
  position: relative;
  height: var(--bo-chart-h, 180px);
}
.bo-chart__svg {
  width: 100%;
  height: calc(100% - 1.4rem);
  overflow: visible;
}
.bo-chart__grid {
  stroke: #e2e8f0;
  stroke-width: 1;
}
.bo-chart__area {
  animation: bo-draw 0.7s ease both;
}
.bo-chart__line {
  fill: none;
  stroke: var(--brand-light);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: bo-draw 0.8s ease both;
}
.bo-chart__dots {
  position: absolute;
  inset: 0 0 1.4rem 0;
  pointer-events: none;
}
.bo-chart__dot-hit {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 9999px;
  pointer-events: auto;
  cursor: pointer;
}
.bo-chart__dot {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: var(--brand-primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgb(0 182 214 / 0.35);
  pointer-events: none;
}
.bo-chart__axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  text-transform: capitalize;
}
.bo-chart__empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 2rem 0;
  text-align: center;
}

.bo-cols {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: var(--bo-chart-h, 200px);
}
.bo-cols__legend {
  display: flex;
  gap: 0.85rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.bo-cols__legend i,
.bo-donut__legend i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  margin-right: 0.3rem;
  vertical-align: middle;
}
.bo-cols__plot {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  min-height: 0;
}
.bo-cols__group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  height: 100%;
}
.bo-cols__bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 0.2rem;
  width: 100%;
  justify-content: center;
}
.bo-cols__bar {
  width: 0.7rem;
  max-width: 40%;
  border-radius: 4px 4px 0 0;
  animation: bo-grow 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.bo-cols__label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.bo-funnel {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.bo-funnel__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}
.bo-funnel__name {
  font-weight: 600;
}
.bo-funnel__conv {
  color: var(--text-muted);
  font-size: 0.72rem;
}
.bo-funnel__track {
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
}
.bo-funnel__bar {
  height: 1.55rem;
  border-radius: inherit;
  display: flex;
  align-items: center;
  padding: 0 0.65rem;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  animation: bo-grow-x 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--bo-delay, 0ms);
  min-width: 2rem;
}
.bo-funnel__amount {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.bo-funnel__row-link,
.bo-funnel__row-static {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  padding: 0.35rem 0;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.bo-funnel__row-link {
  cursor: pointer;
  transition: background 0.12s ease;
}
.bo-funnel__row-link:hover,
.bo-funnel__row-link:focus-visible,
.bo-funnel__row-static:hover,
.bo-funnel__row-static:focus-visible {
  background: #f8fafc;
  outline: none;
}
.bo-metric-tip {
  cursor: help;
}
.bo-metric-link {
  color: inherit;
  text-decoration: none;
}
.bo-rank__row-link {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: #f8fafc;
  border: 1px solid #eef2f6;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.03);
  transition: background 0.12s ease, border-color 0.12s ease,
    box-shadow 0.12s ease;
}
.bo-rank__row-link:hover,
.bo-rank__row-link:focus-visible {
  background: #fff;
  border-color: #dbeafe;
  box-shadow: 0 2px 6px rgb(15 23 42 / 0.06);
  outline: none;
}
.bo-donut__legend-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.25rem;
}
.bo-donut__legend-link:hover,
.bo-donut__legend-link:focus-visible {
  background: #f8fafc;
}
.bo-cols__group-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.bo-cols__group-link:hover .bo-cols__bar,
.bo-cols__group-link:focus-visible .bo-cols__bar {
  filter: brightness(1.05);
}
.bo-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  font-size: 0.84rem;
}
.bo-kanban__col--focus {
  box-shadow: inset 0 0 0 2px rgb(0 191 154 / 0.35);
}
.bo-kanban__head-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  color: inherit;
  text-decoration: none;
}
.bo-kanban__head-link:hover .bo-kanban__count,
.bo-kanban__head-link:focus-visible .bo-kanban__count {
  text-decoration: underline;
}
.bo-summary-strip a,
.bo-summary-strip button.bo-summary-link {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: inherit;
}
.bo-summary-strip a:hover,
.bo-summary-strip a:focus-visible {
  box-shadow: inset 0 0 0 2px rgb(0 191 154 / 0.25);
}

.bo-detail__stats a {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.bo-detail__stats a:hover,
.bo-detail__stats a:focus-visible {
  box-shadow: inset 0 0 0 2px rgb(0 191 154 / 0.25);
  outline: none;
}
.bo-num a {
  color: var(--brand-dark);
  font-weight: 600;
  text-decoration: none;
}
.bo-num a:hover,
.bo-num a:focus-visible {
  text-decoration: underline;
}

.bo-rank {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.bo-rank__row {
  margin: 0;
}
.bo-rank__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}
.bo-rank__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--brand-dark);
}
.bo-rank__track {
  display: block;
  background: #e2e8f0;
  border-radius: 9999px;
  height: 0.45rem;
  overflow: hidden;
}
.bo-rank__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  animation: bo-grow-x 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--bo-delay, 0ms);
  min-width: 0;
}
.bo-rank__value {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  color: var(--brand-dark);
}
.bo-rank__value small {
  display: block;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.bo-donut {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  align-items: center;
  position: relative;
}
.bo-donut__svg {
  width: 8.5rem;
  height: 8.5rem;
  transform: rotate(-90deg);
}
.bo-donut__track {
  fill: none;
  stroke: #f1f5f9;
  stroke-width: 12;
}
.bo-donut__slice {
  fill: none;
  stroke-width: 12;
  stroke-linecap: butt;
  animation: bo-draw 0.7s ease both;
}
.bo-donut__center {
  position: absolute;
  left: 0;
  width: 8.5rem;
  height: 8.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.bo-donut__center strong {
  font-size: 1.05rem;
}
.bo-donut__center span {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.bo-donut__legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
}
.bo-donut__legend li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.bo-donut__legend b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

@keyframes bo-draw {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes bo-grow {
  from {
    transform: scaleY(0);
    transform-origin: bottom;
  }
  to {
    transform: scaleY(1);
    transform-origin: bottom;
  }
}
@keyframes bo-grow-x {
  from {
    transform: scaleX(0);
    transform-origin: left;
  }
  to {
    transform: scaleX(1);
    transform-origin: left;
  }
}
@keyframes bo-pop {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ---------- Convert / disqualify forms ---------- */
.bo-convert,
.bo-disqualify {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Sticky KPI rail on mobile dashboard */
@media (max-width: 899px) {
  .bo-kpis {
    position: sticky;
    top: var(--header-offset, 4rem);
    z-index: 5;
    background: linear-gradient(to bottom, var(--bg) 70%, transparent);
    padding-bottom: 0.5rem;
    margin-left: -0.15rem;
    margin-right: -0.15rem;
  }
  .bo-kpis .stat-tile {
    padding: 0.65rem 0.7rem;
  }
  .bo-kpis .stat-tile__value {
    font-size: 1.05rem;
  }
  .bo-kpis .stat-tile__label {
    font-size: 0.68rem;
  }
}

/* View head: stack actions under title on phones */
@media (max-width: 699px) {
  .view-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .view-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .view-head-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* ===========================================================
   PART 2 — Design-system completion
   Everything below was added during the UX audit. It closes the
   classes that shipped in markup without a rule, neutralises the
   legacy stylesheet where it leaks into this app, and adds the
   accelerators (toasts, sorting, shortcuts) the CRM needs.
   =========================================================== */

/* ---------- Focus: one visible ring everywhere ----------
   The app had no :focus-visible rule at all, so keyboard users were
   navigating on browser defaults that vanish against the dark header. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.app-top-header :where(a, button, [tabindex]):focus-visible,
.bo-kanban__head :where(a, button):focus-visible {
  outline-color: #fff;
}
.bo-row:focus-visible,
tr[tabindex]:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: -2px;
}

/* Skip link — ~12 nav links precede <main> on every page. */
.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--brand-dark);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 0.15s ease;
}
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--brand-light);
  outline-offset: 2px;
}

/* Respect the OS motion preference — the sheets and charts all animate. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Legacy stylesheet overrides ----------
   styles.css belongs to the marketing site and hides the KPI context
   line below 900px, which removed every trend delta on phone and
   tablet. This puts it back. */
@media (max-width: 900px) {
  .stat-tile__hint {
    display: block !important;
  }
}

/* ---------- Contrast: muted text had no headroom at 11–12px ---------- */
.bo-table th,
.app-sidebar-footer,
.bo-table a small,
.bo-table td small,
.bo-muted,
.view-subtitle {
  color: #475569;
}

/* ---------- Rows: one interaction model for every list ---------- */
.bo-row {
  transition: background 0.12s ease;
}
.bo-row--click,
.bo-row:has(> td > .bo-rowlink) {
  cursor: pointer;
}
.bo-row--click:hover,
.bo-row:has(> td > .bo-rowlink):hover {
  background: #f8fafc;
}
/* The whole row is a link target: the anchor sits in the first cell and
   is stretched across the row, so middle-click and ⌘-click work. */
.bo-rowlink {
  position: static;
  color: inherit;
  text-decoration: none;
}
.bo-rowlink::after {
  content: "";
  position: absolute;
  inset: 0;
}
.bo-table--rows tbody tr {
  position: relative;
}
.bo-rowlink:focus-visible::after {
  outline: 2px solid var(--brand-light);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}
/* Anything genuinely interactive inside a linked row must sit above the
   stretched hit area. */
.bo-table--rows tbody td .chip,
.bo-table--rows tbody td button,
.bo-table--rows tbody td a:not(.bo-rowlink) {
  position: relative;
  z-index: 1;
}

.bo-person {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.bo-person > span:last-child {
  min-width: 0;
}
.bo-person b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Sortable table headers ---------- */
.bo-th-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.bo-th-sort:hover {
  color: var(--text);
}
.bo-th-sort .material-icons {
  font-size: 1rem !important;
  /* Faint but never invisible: a column that can be sorted should look like
     it, without the icons competing with the labels. */
  opacity: 0.25;
  transition: opacity 0.12s ease;
}
.bo-th-sort:hover .material-icons {
  opacity: 0.6;
}
[aria-sort="ascending"] .bo-th-sort,
[aria-sort="descending"] .bo-th-sort {
  color: var(--text);
}
[aria-sort="ascending"] .bo-th-sort .material-icons,
[aria-sort="descending"] .bo-th-sort .material-icons {
  opacity: 1;
  color: var(--brand-light);
}
.bo-num .bo-th-sort {
  justify-content: flex-end;
  width: 100%;
}

/* ---------- List meta bar (result counts, truncation warning) ---------- */
.bo-listmeta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #475569;
}
.bo-listmeta b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.bo-listmeta__sep {
  opacity: 0.4;
}
.bo-listmeta__warn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #b45309;
  font-weight: 600;
}
.bo-listmeta__warn .material-icons {
  font-size: 1rem !important;
}
.bo-listmeta__clear {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--brand-light);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- List pagination ---------- */
.bo-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: #475569;
}
.bo-pagination__summary b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.bo-pagination__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}
.bo-pagination__size {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.bo-pagination__size-label {
  white-space: nowrap;
}
.bo-pagination__select {
  font: inherit;
  font-size: 0.8125rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.bo-pagination__pages {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.bo-pagination__btn,
.bo-pagination__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.375rem;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.bo-pagination__btn .material-icons {
  font-size: 1.25rem !important;
}
.bo-pagination__btn:hover,
.bo-pagination__num:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
}
.bo-pagination__num--on {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--brand-light);
  font-weight: 600;
}
.bo-pagination__btn--disabled {
  opacity: 0.35;
  pointer-events: none;
}
.bo-pagination__ellipsis {
  padding: 0 0.25rem;
  opacity: 0.5;
}

/* ---------- Dashboard alert (was completely unstyled) ---------- */
.bo-alert {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  color: #92400e;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
a.bo-alert:hover {
  background: #fef3c7;
  box-shadow: var(--shadow);
}
.bo-alert > .material-icons {
  /* Amber-500 on the alert's cream background is 2.07:1. This icon carries
     meaning next to the text, so it needs to clear 3:1 like any other
     informative graphic. */
  color: #b45309;
  flex: 0 0 auto;
}
.bo-alert > span:nth-child(2) {
  flex: 1 1 auto;
  min-width: 0;
}
.bo-alert b {
  font-weight: 700;
}
.bo-alert__go {
  flex: 0 0 auto;
  opacity: 0.6;
  transition: transform 0.15s ease;
}
.bo-alert:hover .bo-alert__go {
  transform: translateX(2px);
  opacity: 1;
}
.bo-alert--info {
  background: #eff6ff;
  border-color: #bfdbfe;
  border-left-color: var(--info);
  color: #1e40af;
}
.bo-alert--info > .material-icons {
  color: var(--info);
}

/* ---------- Command palette (all 15 classes shipped unstyled) ---------- */
.cmdk-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgb(15 23 42 / 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 1rem 1rem;
  animation: bo-fade 0.14s ease;
}
.cmdk-panel {
  width: min(40rem, 100%);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cmdk-in 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cmdk-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.cmdk-input-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.cmdk-input-row > .material-icons {
  color: var(--text-muted);
  flex: 0 0 auto;
}
.cmdk-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font-size: 1rem;
  color: var(--text);
  padding: 0.15rem 0;
}
.cmdk-input::placeholder {
  color: #94a3b8;
}
.cmdk-input::-webkit-search-cancel-button {
  display: none;
}
.cmdk-esc {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #475569;
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.cmdk-esc:hover {
  background: #f1f5f9;
  color: var(--text);
}
.cmdk-results {
  overflow-y: auto;
  padding: 0.4rem;
  -webkit-overflow-scrolling: touch;
}
.cmdk-hint {
  margin: 0.3rem 0.6rem 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
.cmdk-empty {
  margin: 0;
  padding: 1.6rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.cmdk-hit {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
}
.cmdk-hit--active {
  background: var(--nav-active);
}
.cmdk-hit-icon {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: #475569;
  font-size: 1.05rem !important;
}
.cmdk-hit--active .cmdk-hit-icon {
  background: #fff;
  color: var(--brand-light);
}
.cmdk-hit-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.cmdk-hit-title {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmdk-hit-sub {
  font-size: 0.76rem;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmdk-hit-kind {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.12rem 0.5rem;
}
@media (max-width: 640px) {
  .cmdk-backdrop {
    padding: 0;
    align-items: stretch;
  }
  .cmdk-panel {
    width: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}

/* ---------- Keyboard shortcut sheet ---------- */
.kbd-grid {
  display: grid;
  gap: 1.2rem;
}
@media (min-width: 640px) {
  .kbd-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.kbd-group h3 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
.kbd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.32rem 0;
  font-size: 0.86rem;
}
.kbd-keys {
  display: inline-flex;
  gap: 0.22rem;
  flex: 0 0 auto;
}
kbd,
.kbd {
  display: inline-block;
  min-width: 1.5rem;
  text-align: center;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #f8fafc;
  color: #475569;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.3;
}

/* ---------- Toasts + undo ---------- */
.bo-toasts {
  position: fixed;
  z-index: 150;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 5.5rem);
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  width: min(30rem, calc(100vw - 1.5rem));
  pointer-events: none;
}
@media (min-width: 900px) {
  .bo-toasts {
    left: auto;
    right: 1.25rem;
    transform: none;
    bottom: 1.25rem;
  }
}
.bo-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.8rem 0.7rem 0.9rem;
  border-radius: var(--radius);
  background: #0f2233;
  color: #e2e8f0;
  box-shadow: var(--shadow-lg);
  font-size: 0.87rem;
  animation: bo-toast-in 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes bo-toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.bo-toast--success .bo-toast__icon {
  color: var(--brand-primary);
}
.bo-toast--error {
  background: #7f1d1d;
}
.bo-toast--error .bo-toast__icon {
  color: #fecaca;
}
.bo-toast__icon {
  flex: 0 0 auto;
  font-size: 1.15rem !important;
}
.bo-toast__text {
  flex: 1 1 auto;
  min-width: 0;
}
.bo-toast__undo {
  flex: 0 0 auto;
  border: 1px solid rgb(255 255 255 / 0.25);
  background: rgb(255 255 255 / 0.08);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}
.bo-toast__undo:hover {
  background: rgb(255 255 255 / 0.18);
}
.bo-toast__close {
  flex: 0 0 auto;
  border: 0;
  background: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0.15rem;
}
.bo-toast__close:hover {
  opacity: 1;
}
.bo-toast__close .material-icons {
  font-size: 1.05rem !important;
}

/* ---------- Deal drawer: stage picker (was the touch dead end) ----------
   The two closing stages used to render outside the drawer with
   overflow:visible, so a touch user could never mark a deal won or lost. */
.bo-stage-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.4rem;
}
.bo-stage-picker__label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.bo-stage-picker .bo-filter {
  justify-content: center;
  min-height: 2.5rem;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}
.bo-stage-picker .bo-filter:disabled {
  opacity: 1;
  cursor: default;
}
.bo-stage-picker .bo-filter--won {
  border-color: #a7f3d0;
  color: #047857;
  background: #ecfdf5;
}
.bo-stage-picker .bo-filter--won:hover:not(:disabled) {
  background: #d1fae5;
  border-color: #6ee7b7;
}
.bo-stage-picker .bo-filter--lost {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
}
.bo-stage-picker .bo-filter--lost:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #fca5a5;
}
.bo-stage-sum {
  font-variant-numeric: tabular-nums;
  color: #475569;
  font-size: 0.8rem;
}

/* ---------- Deal drawer hero facts (ran together: "ValorR$ 0,00") ---------- */
.bo-detail {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.bo-detail__hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.75rem;
}
.bo-detail__hero > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.bo-detail__hero-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.bo-detail__hero-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.bo-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.bo-inline-input {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.bo-inline-input select {
  flex: 0 0 auto;
}
.bo-inline-input input {
  flex: 1 1 10rem;
  min-width: 0;
}
.bo-inline-input select,
.bo-inline-input input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  font: inherit;
  font-size: 0.88rem;
  background: var(--surface);
  color: var(--text);
}
.bo-inline-input .btn {
  flex: 0 0 auto;
}
.bo-danger {
  color: #b91c1c;
  border-color: #fecaca;
}
.bo-danger:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #fca5a5;
}
.chip-won {
  background: #d1fae5;
  color: #047857;
}

/* ---------- Estimating calculator ----------
   The row was a 6-column grid collapsing to a naive 1fr 1fr under 900px,
   which orphaned every label from its field. It is now four named blocks
   that stack cleanly at any width. */
.bo-calc__verdict-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.bo-calc__verdict-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.75;
}
.bo-calc__verdict-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.bo-calc__verdict-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  background: rgb(15 23 42 / 0.08);
}
.bo-calc__verdict-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.6rem 1rem;
  margin: 0.9rem 0 0;
}
.bo-calc__verdict-facts > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.bo-calc__verdict-facts dt {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}
.bo-calc__verdict-facts dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bo-calc__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  align-items: end;
  padding: 0.85rem 0.9rem;
}
.bo-calc__row-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.bo-calc__row-index {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
}
.bo-calc__row-head .bo-calc__desc {
  flex: 1 1 auto;
  min-width: 0;
}
.bo-calc__row-picks,
.bo-calc__row-nums {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
}
.bo-calc__row-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.2rem;
  border-top: 1px dashed var(--border);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bo-calc__row-total small {
  font-weight: 600;
  font-size: 0.75rem;
  color: #475569;
}
/* The row goes wide when the *list* is wide, not when the window is. On a
   1440px screen the item list still only gets ~580px once the sidebar and the
   verdict panel take their share, and a four-column row does not fit in that.
   Browsers without container queries keep the stacked layout, which is the
   safe end of the trade. */
.bo-calc__rows {
  container-type: inline-size;
  container-name: calcrows;
}
@container calcrows (min-width: 760px) {
  .bo-calc__row {
    grid-template-columns:
      minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(7rem, auto);
    gap: 0.75rem;
    align-items: end;
  }
  /* Once the row reads as a table, the first row's labels serve as the header
     and repeating them down the list is just noise. */
  .bo-calc__row:not(:first-child) .bo-field--tight > span {
    display: none;
  }
  .bo-calc__row-total {
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    border-top: 0;
    padding-top: 0;
    gap: 0.1rem;
  }
}
@container calcrows (min-width: 460px) {
  /* Middle ground: the numbers deserve a row of their own before the whole
     line does. */
  .bo-calc__row-nums {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .bo-calc__row-picks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Sidebar + header bits that shipped unstyled ---------- */
.app-nav-link-label,
.app-nav-section-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-sidebar-copyright {
  opacity: 0.75;
}
.app-sidebar-drawer-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
.app-header-auth-ms-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}
.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ---------- Auth + login screens (every class was unstyled) ---------- */
.auth-callback-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bg);
}
.auth-callback-card {
  width: min(24rem, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}
.auth-callback-message {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.auth-callback-message--error {
  color: #b91c1c;
  font-weight: 600;
}
.auth-callback-retry {
  margin-top: 0.2rem;
}
.auth-callback-spinner {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--brand-primary);
  animation: bo-spin 0.7s linear infinite;
}
@keyframes bo-spin {
  to {
    transform: rotate(360deg);
  }
}
.login-email-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: left;
  margin-bottom: 0.7rem;
}
.login-email-field span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}
.login-email-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
}
.login-email-field input:focus {
  border-color: var(--brand-light);
  outline: 0;
  box-shadow: 0 0 0 3px rgb(0 182 214 / 0.15);
}
.login-email-submit {
  width: 100%;
  justify-content: center;
}
.login-page-error {
  margin: 0.6rem 0 0;
  padding: 0.6rem 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: #b91c1c;
  font-size: 0.84rem;
  text-align: left;
}

/* ---------- Charts: rows that had no layout ---------- */
.bo-funnel__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  padding: 0.35rem 0;
}
.bo-funnel__count {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  /* The bar behind this number is whatever colour the stage is configured
     with, so white text on it can land anywhere from 2:1 to 12:1. Its own
     dark scrim makes the count readable on every stage colour. */
  background: rgb(15 23 42 / 0.55);
  border-radius: 9999px;
  padding: 0.05rem 0.4rem;
  margin: 0 0.2rem;
}
.bo-cols__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: #475569;
}
.bo-contract {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---------- Tables: make horizontal overflow discoverable ----------
   On iPad the STATUS column sat off-screen behind an invisible
   touch scrollbar. */
.bo-table-wrap {
  position: relative;
  scrollbar-width: thin;
}
.bo-table-wrap::-webkit-scrollbar {
  height: 8px;
}
.bo-table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
.bo-table-scroller {
  position: relative;
}
.bo-table-scroller::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.5rem;
  pointer-events: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: linear-gradient(
    to right,
    rgb(255 255 255 / 0),
    rgb(255 255 255 / 0.95)
  );
  opacity: 0;
  transition: opacity 0.15s ease;
}
.bo-table-scroller[data-overflow="true"]::after {
  opacity: 1;
}
.bo-table-scroller[data-scrolled="end"]::after {
  opacity: 0;
}
.bo-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* ---------- Layout: fill the main column on every screen ----------
   A centered 1600px cap left ~30% of ultrawide monitors as empty gutters.
   CRM work rewards density and scanning width — tables, kanban and the
   dashboard should claim the full main area. */
.view {
  max-width: none;
  width: 100%;
  margin-inline: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.view > .bo-workspace {
  flex: 1;
  min-width: 0;
}
.bo-table-wrap,
.bo-table-scroller {
  width: 100%;
}

/* Dashboard chart mosaic — auto-fit so 1 card fills the row, 2–3 pack. */
.bo-grid--dash {
  display: grid;
  gap: var(--bo-dash-gap, 1rem);
  margin-bottom: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .bo-grid--dash {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  }
}

/* Ultrawide: denser grids so the extra pixels become information, not void. */
@media (min-width: 1500px) {
  .view {
    padding-inline: 2rem;
  }
  /* auto-fit (not fill): two-panel rows expand to full width; empty tracks collapse. */
  .bo-grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(26rem, 1fr));
  }
  .bo-grid--dash {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  }
  .bo-kpis {
    grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  }
  .bo-kanban {
    grid-auto-columns: minmax(18rem, 1fr);
  }
  .bo-alerts {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  }
  .bo-table {
    width: 100%;
  }
}
@media (min-width: 1920px) {
  .view {
    padding-inline: 2.5rem;
  }
  .bo-dash {
    --bo-dash-gap: 1rem;
  }
  .bo-grid,
  .bo-grid--dash {
    gap: var(--bo-dash-gap, 1rem);
  }
  .bo-grid--dash {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  }
  .bo-kanban {
    grid-auto-columns: minmax(20rem, 1fr);
    gap: 1rem;
  }
  .bo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
    gap: 0.85rem;
    align-items: start;
  }
}

/* ---------- FAB: stop it covering card content ---------- */
.bo-fab {
  bottom: calc(env(safe-area-inset-bottom, 0px) + 4.9rem);
}
.bo-cards {
  padding-bottom: 3.5rem;
}

/* ---------- Kanban: closed stages are history, not work in progress ---------- */
.bo-kanban__col--closed {
  flex: 0 0 3rem;
  width: 3rem;
  min-width: 3rem;
  padding: 0;
  cursor: pointer;
}
.bo-kanban__col--closed .bo-kanban__list,
.bo-kanban__col--closed .bo-kanban__sum {
  display: none;
}
.bo-kanban__col--closed .bo-kanban__head {
  height: 100%;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
  padding: 0.7rem 0.25rem;
}
.bo-kanban__col--closed .bo-kanban__name {
  writing-mode: vertical-rl;
  white-space: nowrap;
}
.bo-kanban__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #475569;
  border-radius: 9999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.bo-kanban__toggle:hover {
  border-color: #cbd5e1;
  color: var(--text);
}
.bo-kanban__toggle .material-icons {
  font-size: 1.05rem !important;
}
.bo-deal__meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: #475569;
}
.bo-deal__meta .material-icons {
  font-size: 0.9rem !important;
}
.bo-deal__meta--stale {
  color: #b45309;
  font-weight: 600;
}

/* ---------- Tablet: 720–899px was getting the phone layout ----------
   An iPad in portrait showed one kanban card per screen with 600px of
   dead space. These widths get a denser, two-up treatment. */
@media (min-width: 640px) and (max-width: 899.98px) {
  .bo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
    gap: 0.7rem;
    align-items: start;
  }
  .bo-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
  .bo-kpis {
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  }
}
@media (min-width: 720px) and (max-width: 899.98px) {
  .view {
    padding-inline: 1.5rem;
  }
  .mobile-tabbar {
    justify-content: center;
    gap: 1.5rem;
  }
  .mobile-tabbar .mtab {
    flex: 0 1 7rem;
  }
}

/* ---------- Small phones ---------- */
@media (max-width: 360px) {
  .view {
    padding-inline: 0.85rem;
  }
  .bo-toolbar__right {
    width: 100%;
  }
  .bo-search {
    width: 100%;
  }
}

.bo-alerts {
  display: grid;
  gap: var(--bo-dash-gap, 1rem);
  margin-bottom: 1rem;
}
@media (min-width: 900px) {
  .bo-alerts {
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  }
}

.login-page-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.login-page-actions--stack {
  flex-direction: column;
  align-items: stretch;
}
.bo-toast--info .bo-toast__icon {
  color: #7dd3fc;
}

/* The empty row is a single message, not an icon + body pair: without this it
   inherited the 2rem icon column and wrapped one word per line. */
.bo-timeline__list > li.bo-timeline__empty {
  display: block;
}

/* The note form stacked three full-width controls on a 1440px screen. */
@media (min-width: 700px) {
  .bo-note-form {
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
  }
  .bo-note-form select {
    flex: 0 0 auto;
    width: auto;
  }
  .bo-note-form input {
    flex: 1 1 auto;
    min-width: 0;
  }
  .bo-note-form .btn {
    flex: 0 0 auto;
  }
}

/* Touch targets: 40px is under the 44px everyone's guidelines ask for. */
.bo-stage-picker .bo-filter,
.bo-icon-btn,
.bo-sheet__close {
  min-height: 44px;
}
.bo-stage-picker .bo-filter {
  min-width: 44px;
}

/* ---------- Calculator verdict panel ----------
   The base rule styles a small inline pill (`margin-left:auto`, pill radius,
   6px padding) but the markup is a full panel with a heading, a four-item
   definition list and an advice paragraph. The result was an amber blob
   floating over the page. This is the panel the markup actually describes. */
.bo-calc__verdict {
  margin-left: 0;
  font-size: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  /* Keep the margin visible while the user scrolls the line items that
     produce it — the whole point of the panel. */
  position: sticky;
  top: calc(var(--header-offset, 4rem) + 0.5rem);
  z-index: 3;
}
.bo-calc__verdict[data-tone="success"] {
  border-color: #a7f3d0;
}
.bo-calc__verdict[data-tone="info"] {
  border-color: #bfdbfe;
}
.bo-calc__verdict[data-tone="warning"] {
  border-color: #fde68a;
}
.bo-calc__verdict[data-tone="danger"] {
  border-color: #fecaca;
}
.bo-calc__headroom {
  margin: 0.75rem 0 0;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.45;
}
@media (min-width: 1100px) {
  /* On a wide screen the verdict rides alongside the line items instead of
     pushing them below the fold. */
  .bo-calc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 19rem;
    grid-template-areas:
      "controls verdict"
      "notice   verdict"
      "rows     verdict"
      "actions  verdict"
      "saved    verdict";
    align-items: start;
    column-gap: 1.25rem;
  }
  .bo-calc__verdict {
    grid-area: verdict;
  }
  .bo-calc__controls {
    grid-area: controls;
  }
  .bo-calc__rows {
    grid-area: rows;
  }
  .bo-calc__actions {
    grid-area: actions;
  }
  .bo-calc__saved {
    grid-area: saved;
  }
  .bo-calc > .bo-notice {
    grid-area: notice;
  }
  .bo-calc__verdict-facts {
    grid-template-columns: 1fr 1fr;
  }
}
.bo-calc__rows--empty {
  margin: 0;
  padding: 1.5rem 1.15rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* `.bo-search` carries `flex: 1 1 12rem` for the toolbar row. Dropped straight
   into `.bo-workspace` — a column flex — that grow factor applies to the
   vertical axis and the field swells to fill the page. */
.bo-workspace > .bo-search {
  flex: 0 0 auto;
}
.bo-summary-strip strong {
  display: block;
}
.bo-summary-strip small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.bo-chart-empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ---------- Contrast corrections (axe/Lighthouse) ----------
   Brand cyan is a fill colour, not a text colour: #00b6d6 on the page
   background measures 2.3:1 against the 4.5:1 minimum. The darker cyan keeps
   the family and clears the bar at 5.4:1. */
.bo-listmeta__clear,
.bo-listmeta__export,
.bo-listmeta button,
.bo-listmeta a {
  color: #0e7490;
}
/* Slate-500 on slate-100 lands at 4.34:1 — just under. Slate-600 clears it. */
.chip-cancel {
  color: #475569;
}

/* ---------- Accessible action green ----------
   `--brand-primary` (#00bf9a) is the iLiberty green and stays the brand
   colour for fills, charts and decoration. It is not a *text* colour: white
   on it measures 2.35:1, and the same green as a label on white measures the
   same, both well under the 4.5:1 minimum. `--brand-primary-ink` is the same
   hue taken dark enough to carry white text at 4.9:1, and is used only where
   contrast is actually being asked of it. */
:root {
  --brand-primary-ink: #00806a;
}
.btn-primary,
.btn-primary:visited {
  background: var(--brand-primary-ink);
  border-color: var(--brand-primary-ink);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: #006e5b;
  border-color: #006e5b;
}
.bo-fab {
  background: var(--brand-primary-ink);
  box-shadow: 0 8px 24px rgb(0 128 106 / 0.35);
}
.mobile-tabbar .mtab.active,
.mobile-tabbar .mtab.active span,
.mobile-tabbar .mtab.active .material-icons {
  color: var(--brand-primary-ink);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Kanban board — UniConecta Ações v2 parity (bo-kb-*)
   ═══════════════════════════════════════════════════════════════════════════ */

.bo-kanban-hub {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.bo-kb-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bo-kb-variant-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  margin-bottom: 0.35rem;
  border-radius: 10px;
  flex-shrink: 0;
}

.bo-kb-variant-toolbar__hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
}

.bo-kb-variant-toolbar__hint .material-icons {
  font-size: 1rem;
  color: #94a3b8;
}

.bo-kb-variant-toolbar__stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
}

.bo-kb-variant-toolbar__stat .material-icons {
  font-size: 1rem;
  color: #64748b;
}

.bo-kb-variant-toolbar--v2 {
  background: linear-gradient(90deg, #f1f5f9, #f8fafc);
  border: 1px solid #cbd5e1;
}

.bo-kanban-hub--v2 .bo-kb-board--v2 {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 1rem;
  padding: 0.15rem 0.5rem 0.75rem;
  align-items: stretch;
}

.bo-kanban-hub--v2 .bo-kb-col--v2 {
  flex: 0 0 280px;
  min-width: 280px;
  width: 280px;
  max-width: none;
  min-height: 0;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.06);
}

.bo-kanban-hub--v2 .bo-kb-col--v2::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--col-accent, #64748b);
}

.bo-kanban-hub--v2 .bo-kb-col-head--v2 {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: #f8fafc;
  padding: 0.75rem 0.875rem;
  margin: 0;
  border-bottom: 1px solid #e2e8f0;
}

.bo-kb-col-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex-shrink: 0;
}

.bo-kb-col-icon .material-icons {
  font-size: 1rem;
}

.bo-kb-col-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 1;
  margin: 0;
  min-width: 0;
}

.bo-kb-col-head-link {
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.bo-kb-col-head-link:hover .bo-kb-col-title,
.bo-kb-col-head-link:focus-visible .bo-kb-col-title {
  text-decoration: underline;
}

.bo-kb-col-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 99px;
  padding: 0.1rem 0.5rem;
  font-variant-numeric: tabular-nums;
  min-width: 1.75rem;
  text-align: center;
}

.bo-kb-col-subtitle {
  flex: 1 1 100%;
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  font-variant-numeric: tabular-nums;
}

.bo-kanban-hub--v2 .bo-kb-col-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: auto;
  padding: 0.625rem 0.75rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  -webkit-overflow-scrolling: touch;
}

.bo-kanban-hub--v2 .bo-kb-col-body > .bo-kb-card {
  flex-shrink: 0;
  flex-grow: 0;
  min-height: min-content;
}

.bo-kb-col-empty {
  font-size: 0.8rem;
  color: #94a3b8;
  text-align: center;
  padding: 2rem 0.5rem;
  border: 1px dashed #e2e8f0;
  border-radius: 8px;
  margin: 0.5rem 0;
}

.bo-kb-card {
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 0.625rem 0.75rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.bo-kanban-hub--v2 .bo-kb-card--v2 {
  padding: 0.875rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 4px 12px rgb(15 23 42 / 0.04);
  gap: 0.45rem;
}

.bo-kanban-hub--v2 .bo-kb-card--v2:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 4px rgb(15 23 42 / 0.06), 0 8px 20px rgb(15 23 42 / 0.08);
  transform: translateY(-1px);
}

.bo-kb-card--v2[data-attention="stale"] {
  border-left: 4px solid #ef4444;
}

.bo-kb-card-v2__row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.bo-kb-title--v2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.bo-kanban-hub--v2 .bo-kb-title--v2 {
  font-size: 0.925rem;
}

.bo-kb-card-v2__amount {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary, #1e293b);
}

.bo-kb-card-v2__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  font-size: 0.7rem;
  color: #64748b;
}

.bo-kb-src--v2,
.bo-kb-due--v2,
.bo-kb-meta-chip {
  font-size: 0.68rem;
}

.bo-kb-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.bo-kb-meta-chip .material-icons {
  font-size: 0.85rem;
}

.bo-kb-meta-chip--stale {
  color: #dc2626;
  font-weight: 600;
}

.bo-kb-col--focus {
  outline: 2px solid var(--brand-light, #00b6d6);
  outline-offset: 2px;
}

.bo-kb-col--collapsed {
  flex: 0 0 3.25rem !important;
  min-width: 3.25rem !important;
  width: 3.25rem !important;
  cursor: pointer;
}

.bo-kb-col--collapsed .bo-kb-col-head--v2 {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.75rem 0.35rem;
  gap: 0.35rem;
  border-bottom: none;
  height: 100%;
}

.bo-kb-col--collapsed .bo-kb-col-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.72rem;
  flex: 1;
  text-align: center;
}

.bo-kb-col--collapsed .bo-kb-col-count {
  order: -1;
}

.bo-kb-movesheet__backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgb(15 23 42 / 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: bo-kb-sheet-fade 0.18s ease-out;
}

.bo-kb-movesheet {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 0.5rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px rgb(15 23 42 / 0.25);
  animation: bo-kb-sheet-up 0.22s cubic-bezier(0.25, 0.8, 0.35, 1);
}

@keyframes bo-kb-sheet-fade {
  from {
    opacity: 0;
  }
}

@keyframes bo-kb-sheet-up {
  from {
    transform: translateY(24%);
    opacity: 0.6;
  }
}

.bo-kb-movesheet__grip {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: #cbd5e1;
  margin: 0.25rem auto 0.75rem;
}

.bo-kb-movesheet__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bo-kb-movesheet__lead {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #64748b);
}

.bo-kb-movesheet__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.bo-kb-movesheet__opt {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 48px;
  padding: 0.55rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  cursor: pointer;
  text-align: left;
}

.bo-kb-movesheet__opt .material-icons {
  font-size: 1.15rem;
  color: var(--opt-color, #64748b);
}

.bo-kb-movesheet__opt--active {
  border-color: var(--opt-color, #64748b);
  background: color-mix(in srgb, var(--opt-color, #64748b) 8%, #fff);
}

.bo-kb-movesheet__opt-label {
  flex: 1;
}

.bo-kb-movesheet__opt-check {
  color: var(--opt-color, #64748b) !important;
}

.bo-kb-movesheet__cancel {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  min-height: 44px;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted, #475569);
  cursor: pointer;
}

.bo-kb-colnav {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.2rem 0.1rem 0.5rem;
  flex-shrink: 0;
}

.bo-kb-colnav::-webkit-scrollbar {
  display: none;
}

.bo-kb-colnav__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #475569);
  cursor: pointer;
  white-space: nowrap;
}

.bo-kb-colnav__chip--active {
  border-color: var(--chip-color, #64748b);
  background: color-mix(in srgb, var(--chip-color, #64748b) 9%, #fff);
  color: color-mix(in srgb, var(--chip-color, #64748b) 80%, #1e293b);
}

.bo-kb-colnav__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--chip-color, #64748b);
}

.bo-kb-colnav__count {
  font-size: 0.72rem;
  font-weight: 700;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  min-width: 1.5rem;
  text-align: center;
}

.bo-kb-colnav__chip--active .bo-kb-colnav__count {
  background: color-mix(in srgb, var(--chip-color, #64748b) 18%, #fff);
}

.bo-kb-card-v2__move {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 44px;
  padding: 0.45rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--move-color, #64748b) 35%, #e2e8f0);
  border-radius: 8px;
  background: color-mix(in srgb, var(--move-color, #64748b) 6%, #fff);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  cursor: pointer;
  text-align: left;
}

.bo-kb-card-v2__move .material-icons {
  font-size: 1.1rem;
  color: var(--move-color, #64748b);
}

.bo-kb-card-v2__move-label {
  flex: 1;
}

.bo-kb-card-v2__move-swap {
  color: var(--text-muted, #94a3b8) !important;
}

@media (min-width: 900px) {
  .bo-workspace:has(> .bo-kanban-hub) {
    flex: 1;
    min-height: calc(100dvh - var(--header-offset, 4rem) - 2rem);
  }

  .bo-workspace:has(> .bo-kanban-hub) > .bo-kanban-hub {
    flex: 1;
    min-height: min(70dvh, calc(100dvh - var(--header-offset, 4rem) - 11rem));
  }
}

@media (min-width: 768px) {
  .bo-kb-colnav,
  .bo-kb-card-v2__move {
    display: none;
  }
}

@media (max-width: 767px) {
  .bo-kb-variant-toolbar--v2 {
    display: none;
  }

  .bo-kanban-hub--v2 .bo-kb-board--v2 {
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0.5rem;
    gap: 0.6rem;
    padding: 0.1rem 0.5rem 1rem;
  }

  .bo-kanban-hub--v2 .bo-kb-col--v2:not(.bo-kb-col--collapsed) {
    flex: 0 0 min(calc(100% - 1.5rem), 340px);
    min-width: min(calc(100% - 1.5rem), 340px);
    width: min(calc(100% - 1.5rem), 340px);
    scroll-snap-align: start;
  }

  .bo-kanban-hub--v2 .bo-kb-card--v2 {
    padding: 0.7rem 0.75rem;
    gap: 0.5rem;
  }
}

/* ===========================================================
   Contextual inspection — hover card + detail sheet
   Every number can explain itself: see lib/ui/inspect.ts and
   islands/Inspector.tsx.

   Written phone-first. On a touch screen there is no hover, so
   the card does not exist and a tap opens the sheet — which is
   already a bottom sheet, inside thumb reach. The hover card is
   added back only where a fine pointer can actually hover.
   =========================================================== */

/* The affordance. Links keep the pointer cursor they earned; a metric that
   only explains itself gets the help cursor and a hairline underline so it
   reads as inspectable instead of decorative. */
[data-bo-inspect] {
  cursor: help;
}

a[data-bo-inspect],
[data-bo-inspect] a,
a [data-bo-inspect],
button[data-bo-inspect] {
  cursor: pointer;
}

span[data-bo-inspect]:not(.bo-chart__dot-hit),
b[data-bo-inspect],
strong[data-bo-inspect] {
  text-decoration: underline 1px dotted rgb(100 116 139 / 0.45);
  text-underline-offset: 3px;
}

[data-bo-inspect]:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.bo-funnel__row-link[data-bo-inspect]:focus-visible,
.bo-funnel__row-static[data-bo-inspect]:focus-visible,
.bo-rank__row-link[data-bo-inspect]:focus-visible {
  outline: none;
}

/* A finger is not a mouse pointer: on touch the marks that open a sheet need
   a target you can actually hit without zooming. */
@media (pointer: coarse) {
  .bo-chart__dot-hit {
    width: 2.25rem;
    height: 2.25rem;
  }

  .bo-chart__dot {
    inset: 0.45rem;
  }

  .bo-funnel__count,
  .bo-kb-col-count {
    padding: 0.25rem 0.55rem;
  }
}

.bo-tone--success {
  color: var(--success);
}

.bo-tone--warning {
  color: var(--warning);
}

.bo-tone--danger {
  color: var(--error);
}

.bo-tone--info {
  color: var(--brand-light);
}

/* --- hover card ------------------------------------------------------- */

/* Hidden by default: a phone never opens it, and a display:none element costs
   nothing. Capability, not width — a small laptop window still hovers. */
.bo-hovercard {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .bo-hovercard {
    display: block;
    position: fixed;
    z-index: 120;
    width: min(20rem, calc(100vw - 1rem));
    padding: 0.7rem 0.8rem 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 0.78rem;
    color: var(--text);
    animation: bo-hovercard-in 0.12s ease both;
  }
}

@keyframes bo-hovercard-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bo-hovercard {
    animation: none;
  }
}

.bo-hovercard__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.bo-hovercard__title {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.bo-hovercard__value {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.bo-hovercard__sub {
  margin-top: 0.15rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.bo-hovercard__facts {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.bo-hovercard__facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.bo-hovercard__facts dt {
  color: var(--text-muted);
}

.bo-hovercard__facts dd {
  font-weight: 600;
  text-align: right;
}

.bo-hovercard__period {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.bo-hovercard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.bo-hovercard__more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.4rem;
  margin: -0.2rem -0.4rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--brand-primary);
  cursor: pointer;
}

.bo-hovercard__more:hover {
  background: rgb(0 191 154 / 0.1);
}

.bo-hovercard__more .material-icons {
  font-size: 1rem;
}

.bo-hovercard__more kbd {
  font: inherit;
  font-size: 0.66rem;
  padding: 0 0.28rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  background: var(--bg);
}

.bo-hovercard__hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* --- detail sheet ----------------------------------------------------- */

.bo-inspect {
  display: grid;
  gap: 1rem;
  /* Company names, deal titles and stage names are user data and can be one
     long unbroken string. Better to break it than to scroll the sheet
     sideways on a 360px screen. */
  overflow-wrap: anywhere;
}

.bo-inspect__value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.bo-inspect__facts {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.bo-inspect__facts > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.88rem;
}

.bo-inspect__facts > div + div {
  border-top: 1px solid var(--border);
}

.bo-inspect__facts dt {
  color: var(--text-muted);
}

.bo-inspect__facts dd {
  font-weight: 600;
  margin-left: auto;
  text-align: right;
}

.bo-inspect__block h3 {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.bo-inspect__block h3 .material-icons {
  font-size: 1rem;
  flex: none;
}

.bo-inspect__block p {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}

.bo-inspect__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin-top: 0.5rem;
  padding: 0;
  list-style: none;
}

.bo-inspect__meta li {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.bo-inspect__meta .material-icons {
  font-size: 0.95rem;
}

.bo-inspect__note {
  display: flex;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  background: rgb(245 158 11 / 0.1);
  color: #7c4a03;
  font-size: 0.84rem;
  line-height: 1.45;
}

.bo-inspect__note .material-icons {
  font-size: 1rem;
  flex: none;
}

.bo-inspect__items {
  display: grid;
  gap: 0.45rem;
  padding: 0;
  list-style: none;
}

.bo-inspect__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 0.12rem 0.75rem;
  align-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.03);
  color: inherit;
  text-decoration: none;
  font-size: 0.84rem;
  transition: background 0.12s ease, border-color 0.12s ease,
    box-shadow 0.12s ease;
}

a.bo-inspect__item:hover,
a.bo-inspect__item:focus-visible {
  background: #fff;
  border-color: #dbeafe;
  box-shadow: 0 2px 6px rgb(15 23 42 / 0.06);
  outline: none;
}

.bo-inspect__item-label {
  grid-column: 1;
  grid-row: 1;
  font-weight: 600;
  color: var(--brand-dark);
  min-width: 0;
  overflow-wrap: anywhere;
}

.bo-inspect__item-meta {
  grid-column: 1;
  grid-row: 2;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

.bo-inspect__item-value {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  font-weight: 700;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--brand-dark);
  white-space: nowrap;
}

.bo-inspect__more {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Actions stack full-width on a phone: they are the reason the sheet opened
   on touch, so they get the whole thumb-friendly row. */
.bo-inspect__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.2rem;
}

.bo-inspect__actions .btn {
  flex: 1 1 100%;
  justify-content: center;
  min-height: 2.75rem;
}

@media (min-width: 720px) {
  .bo-inspect {
    gap: 0.9rem;
  }

  .bo-inspect__value {
    font-size: 1.9rem;
  }

  .bo-inspect__facts > div {
    font-size: 0.82rem;
    padding: 0.5rem 0.7rem;
  }

  .bo-inspect__block p {
    font-size: 0.85rem;
  }

  .bo-inspect__item {
    min-height: 0;
    font-size: 0.82rem;
  }

  .bo-inspect__actions .btn {
    flex: 1 1 auto;
    min-height: 0;
  }
}

/* Dashboard panel switcher — scrolls on phones */
.bo-dashnav {
  margin-bottom: 1rem;
}
.bo-dashnav__list {
  list-style: none;
  margin: 0;
  padding: 0.15rem;
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: #f1f5f9;
  border-radius: 9999px;
}
.bo-dashnav__list::-webkit-scrollbar { display: none; }
.bo-dashnav__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  min-height: 2.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.bo-dashnav__item .material-icons { font-size: 1.05rem; }
.bo-dashnav__item--on {
  background: var(--surface);
  color: var(--brand-dark);
  box-shadow: var(--shadow);
}
.bo-dashnav__short { display: none; }
@media (max-width: 520px) {
  .bo-dashnav__label { display: none; }
  .bo-dashnav__short { display: inline; }
}

.bo-panel-portals {
  display: grid;
  gap: var(--bo-dash-gap, 1rem);
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .bo-panel-portals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .bo-panel-portals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.bo-panel-portal {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.03);
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  min-height: 4.5rem;
}
.bo-panel-portal:hover,
.bo-panel-portal:focus-visible {
  background: #fff;
  border-color: #dbeafe;
  box-shadow: 0 2px 6px rgb(15 23 42 / 0.06);
  outline: none;
}
.bo-panel-portal__icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(120deg, #e0f7fb, #dcfce8);
  color: #0e7490;
  flex-shrink: 0;
}
.bo-panel-portal__icon .material-icons { font-size: 1.2rem; }
.bo-panel-portal__body { flex: 1; min-width: 0; }
.bo-panel-portal__title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--brand-dark);
  margin: 0;
}
.bo-panel-portal__desc {
  margin: 0.2rem 0 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.bo-panel-portal__go {
  color: var(--text-muted);
  align-self: center;
}
