/* DIVA Business OS 195.0.0 — final compact and consistency pass.
 * Loaded after business-os-r194.css. Visual overrides only; no business logic.
 */

:root {
  --dbo-control-h: 40px;
  --dbo-card-radius: 14px;
  --dbo-section-gap: 12px;
}

/* Header actions must never collide between tablet and desktop widths. */
.saas-workspace > header {
  display: grid !important;
  grid-template-columns: minmax(190px, 1fr) auto !important;
  align-items: center !important;
  gap: 14px !important;
}

.saas-workspace > header > div:last-child {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  min-width: 0 !important;
  flex-wrap: wrap !important;
}

.saas-workspace > header > div:last-child > * {
  flex: 0 0 auto !important;
}

#dbo-alert-bell,
.saas-workspace > header > div:last-child > button,
.saas-workspace > header > div:last-child > a {
  min-height: var(--dbo-control-h) !important;
  height: var(--dbo-control-h) !important;
  box-sizing: border-box !important;
}

@media (min-width: 761px) and (max-width: 1420px) {
  .saas-workspace > header { grid-template-columns: minmax(150px, .72fr) minmax(520px, 1.28fr) !important; }
  .saas-workspace > header > div:last-child { flex-wrap: nowrap !important; }
  .saas-workspace > header > div:last-child > button,
  .saas-workspace > header > div:last-child > a,
  #dbo-alert-bell { padding-inline: 10px !important; font-size: 9px !important; }
}

/* Shared compact rhythm. */
.dbo-view,
.saas-view { --dbo-local-gap: var(--dbo-section-gap); }

.dbo-head,
.saas-section-head { margin-bottom: var(--dbo-section-gap) !important; }

.dbo-head-actions > button,
.saas-section-head button,
.saas-team-head-actions button {
  min-height: var(--dbo-control-h) !important;
  border-radius: 10px !important;
}

.dbo-empty,
.saas-empty {
  min-height: 0 !important;
  padding: 22px !important;
  border-radius: var(--dbo-card-radius) !important;
}

.dbo-empty strong,
.saas-empty strong { font-size: 17px !important; }

.dbo-empty p,
.saas-empty p { margin: 0 !important; font-size: 11px !important; line-height: 1.45 !important; }

/* Team: one stable visual template for people, conversations and actions. */
.dbo-native-team .saas-conversations button {
  min-height: 52px !important;
  grid-template-columns: 36px minmax(0, 1fr) auto !important;
  align-items: center !important;
}

.dbo-native-team .saas-conversations time,
.dbo-native-team .saas-conversations time b { justify-self: end !important; }

.dbo-native-team .saas-roles article {
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) auto !important;
  grid-template-rows: auto auto auto auto !important;
  column-gap: 10px !important;
  row-gap: 3px !important;
}

.dbo-native-team .saas-roles article > span:first-child {
  grid-column: 1 !important;
  grid-row: 1 / 4 !important;
  width: 44px !important;
  height: 44px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 12px !important;
  background: #102532 !important;
}

.dbo-native-team .saas-roles h3,
.dbo-native-team .saas-roles p,
.dbo-native-team .saas-member-active,
.dbo-native-team .saas-member-paused { grid-column: 2 !important; margin: 0 !important; }

.dbo-native-team .saas-card-unread {
  grid-column: 3 !important;
  grid-row: 1 !important;
  position: static !important;
  justify-self: end !important;
  min-width: 24px !important;
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
}

.dbo-native-team .saas-member-actions,
.dbo-native-team .saas-permissions {
  grid-column: 1 / -1 !important;
}

.dbo-native-team .saas-member-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 40px 40px !important;
}

.dbo-native-team .dbo-team-assign {
  grid-column: 1 / -1 !important;
  min-height: 34px !important;
}

.dbo-native-team .saas-permissions:not([open]) { padding-bottom: 0 !important; }

/* AI center: make chat the primary work surface. */
.dbo-native-ai .saas-center-nav {
  gap: 6px !important;
  scrollbar-width: none !important;
}
.dbo-native-ai .saas-center-nav::-webkit-scrollbar,
.dbo-native-ai .saas-ai-quick::-webkit-scrollbar { display: none !important; }

.dbo-native-ai .saas-center-nav button {
  min-height: 38px !important;
  padding-inline: 13px !important;
  border-radius: 10px !important;
}

.dbo-native-ai .saas-management-chat {
  min-height: 460px !important;
  overflow: hidden !important;
}

.dbo-native-ai .saas-ai-quick button {
  min-height: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.dbo-native-ai .saas-ai-settings { border-radius: var(--dbo-card-radius) !important; }

/* CRM detail: equal summary blocks and a clear response action zone. */
.saas-deal-sheet > header > button {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  border-radius: 10px !important;
}

.saas-deal-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.saas-deal-summary > div { min-height: 72px !important; padding: 13px !important; }
.saas-deal-workflow { gap: 10px !important; margin: 12px 0 !important; }
.saas-email-composer { gap: 11px !important; margin-top: 14px !important; padding: 16px !important; }
.saas-email-composer textarea { min-height: 150px !important; }

/* Tasks and communication: denser KPI and filter surfaces. */
.dbo-task-kpis,
.dbo-calendar-kpis { gap: 8px !important; margin-bottom: 12px !important; }

.dbo-task-kpis article,
.dbo-calendar-kpis article { min-height: 78px !important; padding: 11px 13px !important; border-radius: 13px !important; }

.dbo-task-row:not(.head) { padding-block: 9px !important; }
.dbo-task-filters { scrollbar-width: none !important; }
.dbo-task-filters::-webkit-scrollbar { display: none !important; }

@media (max-width: 760px) {
  .saas-workspace > header {
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding: 10px 14px !important;
  }

  .saas-workspace > header > div:last-child { gap: 5px !important; flex-wrap: nowrap !important; }
  #dbo-alert-bell { width: 38px !important; min-width: 38px !important; padding: 0 !important; justify-content: center !important; }
  #dbo-alert-bell span { display: none !important; }

  .dbo-native-team .saas-section-head { gap: 9px !important; }
  .dbo-native-team .saas-team-head-actions { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .dbo-native-team .saas-team-head-actions button { min-width: 0 !important; padding-inline: 8px !important; font-size: 10px !important; }
  .dbo-native-team .saas-roles { grid-template-columns: 1fr !important; gap: 6px !important; }

  .dbo-native-ai .saas-editor-flow { margin-bottom: 8px !important; }
  .dbo-native-ai .saas-management-chat { min-height: 420px !important; }
  .dbo-native-ai .saas-management-chat section { min-height: 180px !important; max-height: 260px !important; }

  .saas-deal-sheet { padding: 14px !important; padding-bottom: calc(94px + env(safe-area-inset-bottom)) !important; }
  .saas-deal-sheet > header { top: -14px !important; margin: -14px -14px 12px !important; padding: 14px !important; }
  .saas-deal-summary { grid-template-columns: 1fr 1fr !important; gap: 7px !important; }
  .saas-deal-summary > div { min-height: 64px !important; padding: 10px !important; }
  .saas-deal-workflow { grid-template-columns: 1fr !important; }
  .saas-email-composer { padding: 12px !important; }
  .saas-email-composer footer { position: sticky !important; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 3 !important; padding: 8px !important; margin: 0 -4px -4px !important; border-radius: 12px !important; background: rgba(7, 20, 29, .96) !important; }

  .dbo-task-kpis,
  .dbo-calendar-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .dbo-task-kpis article,
  .dbo-calendar-kpis article { min-height: 70px !important; }
}

@media (max-width: 380px) {
  .dbo-native-team .saas-team-head-actions { grid-template-columns: 1fr !important; }
  .saas-deal-summary { grid-template-columns: 1fr !important; }
  .dbo-native-ai .saas-editor-flow { grid-template-columns: 1fr !important; }
}


/* DIVA Business OS 196 — authenticated mobile audit refinements */
@media (max-width:460px){
  .dbo-report-metrics{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  .dbo-report-metric{padding:11px 10px!important;border-radius:12px!important}
  .dbo-report-metric strong{margin-top:6px!important;font-size:21px!important}
  .dbo-report-metric small{margin-top:5px!important;font-size:7px!important}
  .dbo-report-card{padding:12px!important;border-radius:14px!important}
  .dbo-report-topgrid,.dbo-report-grid,.dbo-report-grid.lower{gap:9px!important;margin-bottom:10px!important}
  .dbo-report-filter{padding:11px!important;margin-bottom:10px!important;gap:9px!important}
}


/* DIVA Business OS 199 — natural page scroll.
 * Page headers and action rows move with content. Functional overlays,
 * calls, dialogs and the five-item mobile navigation remain fixed.
 */
.saas-workspace > header,
.saas-center-nav,
.saas-deal-sheet > header {
  position: relative !important;
  top: auto !important;
}

.saas-center-nav {
  z-index: 1 !important;
}

.saas-deal-sheet > header {
  z-index: 1 !important;
}

@media (max-width: 760px) {
  .saas-deal-sheet > header {
    top: auto !important;
  }

  .saas-email-composer footer {
    position: static !important;
    bottom: auto !important;
    z-index: auto !important;
    margin: 0 !important;
  }
}
