/* Future One OS — Workspace UI (Phase 2) */

:root {
  --bg: #F7F8FA;
  --line: #E7E9ED;
  --radius: 10px;
  --sidebar-accent: var(--accent, #0A66C2);
}

.sidebar-nav .nav-item {
  border-radius: 8px;
  border-left: 2px solid transparent;
  padding-left: 10px;
}
.sidebar-nav .nav-item:hover { background: #F3F4F6; }
.sidebar-nav .nav-item.active {
  background: #F4F6F8;
  color: var(--text);
  font-weight: 600;
  box-shadow: none;
  border-left-color: var(--sidebar-accent);
}
.sidebar-nav .nav-item.active .nav-icon-wrap { color: var(--sidebar-accent); }

/* Collapsible Apps nav group (Phase 4) */
.nav-section-group-apps { margin-top: 4px; }
.nav-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 12px 6px;
  border: none;
  background: none;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .1em;
  cursor: pointer;
  user-select: none;
}
.nav-section-toggle:hover { color: #64748b; }
.nav-section-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #9ca3af;
  transform: rotate(-90deg);
  transition: transform .15s ease;
}
.nav-section-group-apps.expanded .nav-section-chevron { transform: rotate(0deg); }
.nav-section-group-apps .nav-section-items { display: none; }
.nav-section-group-apps.expanded .nav-section-items { display: block; }
.nav-section-group-apps .nav-section-items .nav-item { margin-left: 2px; }
.nav-item-muted {
  opacity: 0.75;
  font-size: 12px;
}
.nav-item-muted:hover { opacity: 1; }

.nav-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #64748b;
}
.sidebar-footer .user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-footer .user-org {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-settings-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-top: 8px;
  border-radius: 8px;
  font-size: 13px;
  color: #4b5563;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
  transition: background .12s;
}
.sidebar-settings-link:hover { background: #F3F4F6; color: var(--text); }
.sidebar-settings-link.active {
  background: #F4F6F8;
  border-left: 2px solid var(--sidebar-accent);
  font-weight: 600;
}

.page-header-bar {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 32px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}
.page-header-text { flex: 1; min-width: 0; }
.page-header-title {
  font-size: 26px;
  font-weight: 650;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.page-header-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
  max-width: 640px;
}
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.header-search { position: relative; min-width: 220px; max-width: 320px; }
.header-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FAFBFC;
  font: inherit;
  font-size: 13px;
  outline: none;
}
.header-search input:focus {
  border-color: #C5D4E8;
  box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.08);
  background: #fff;
}
.header-search .header-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}
.header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  position: relative;
}
.header-icon-btn:hover { background: #FAFBFC; border-color: #D1D5DB; }
.header-icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.header-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.header-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.header-btn-primary:hover { opacity: .9; }
.header-dropdown { position: relative; }
.header-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  padding: 4px;
  z-index: 30;
}
.header-dropdown.open .header-dropdown-menu { display: block; }
.header-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.header-dropdown-item:hover { background: #F4F6F8; }

.topbar { display: none !important; }
.page .legacy-page-header { display: none !important; }

#page-workspace { padding: 24px 32px 32px; max-width: 1200px; }
.ws-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.ws-metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.ws-metric-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ws-metric-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #F4F6F8;
  color: #64748b;
}
.ws-metric-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ws-metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.ws-metric-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.ws-row-2 {
  display: grid;
  grid-template-columns: 1.85fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.ws-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ws-panel.card { padding: 0; overflow: hidden; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.section-header-title { font-size: 15px; font-weight: 650; color: var(--navy); }
.section-header-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.section-body { padding: 4px 18px 16px; }

.inbox-filters { display: flex; gap: 4px; padding: 12px 18px 0; flex-wrap: wrap; }
.inbox-filter-btn {
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.inbox-filter-btn.active {
  color: var(--text);
  background: #F4F6F8;
  border-color: var(--line);
  font-weight: 600;
}
.priority-inbox-list { list-style: none; }
.priority-inbox-item {
  display: flex;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  align-items: flex-start;
}
.priority-inbox-item:last-child { border-bottom: none; }
.priority-inbox-item:hover { background: #FAFBFC; }
.priority-inbox-item.is-unread .priority-inbox-title { font-weight: 650; }
.priority-inbox-item.is-read .priority-inbox-title { color: #64748b; }
.priority-inbox-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #F4F6F8;
  color: #64748b;
  flex-shrink: 0;
}
.priority-inbox-body { flex: 1; min-width: 0; }
.priority-inbox-title { font-size: 13px; color: var(--text); line-height: 1.4; }
.priority-inbox-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.priority-inbox-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: #94a3b8;
  flex-wrap: wrap;
}
.priority-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 8px; }
.priority-dot.high { background: var(--danger); }
.priority-dot.medium { background: var(--warning); }
.priority-dot.normal { background: transparent; }

.quick-action-list { list-style: none; padding: 8px 12px 12px; }
.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.quick-action-btn:hover { background: #FAFBFC; border-color: #D1D5DB; }
.quick-action-btn .qa-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #F4F6F8;
  color: #64748b;
}

.ws-activity-item {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.ws-activity-item:last-child { border-bottom: none; }
.ws-activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F4F6F8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
}
.ws-activity-title { font-size: 13px; color: var(--text); line-height: 1.4; }
.ws-activity-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }

.ws-app-list { list-style: none; }
.ws-app-card-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.ws-app-card-item:last-child { border-bottom: none; }
.ws-app-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #F4F6F8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  flex-shrink: 0;
}
.ws-app-card-name { font-size: 13px; font-weight: 650; color: var(--navy); }
.ws-app-card-desc { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.ws-app-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.ws-app-status { font-size: 11px; color: var(--success); font-weight: 600; }
.ws-app-open {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.ws-skeleton {
  background: linear-gradient(90deg, #F0F1F3 25%, #E8EAED 50%, #F0F1F3 75%);
  background-size: 200% 100%;
  animation: ws-shimmer 1.2s infinite;
  border-radius: 6px;
  height: 80px;
}
@keyframes ws-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.ws-empty { padding: 32px 18px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; }
.ws-empty-title { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.ws-error { padding: 16px 18px; color: var(--danger); font-size: 13px; }
.ws-ai-brief { margin-top: 16px; display: none; }
.ws-ai-brief.visible { display: block; }

/* Role gates — hide write/owner controls until session role is applied */
body:not(.portal-role-write) [data-write-only],
body:not(.portal-role-owner) [data-owner-only] {
  display: none !important;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 49;
}
.sidebar-backdrop.visible { display: block; }
body.sidebar-open { overflow: hidden; }

/* Installed Apps hub (Phase 3) */
#page-marketplace { padding: 20px 32px 32px; }
.apps-page-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.apps-summary-stat { font-size: 13px; color: var(--muted); }
.apps-summary-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy, #0f172a);
  margin-right: 6px;
}
.apps-summary-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
}
.apps-summary-note {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.5;
}
.apps-page-section { margin-bottom: 28px; }
.apps-section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.apps-section-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  margin: 0;
}
.apps-section-hint { font-size: 12px; color: var(--muted); }
.apps-search-bar { padding: 12px 14px; margin-bottom: 12px; }
.app-status-pill {
  font-size: 10px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 10px;
}
.app-status-pill.installed { background: #EAF3DE; color: #3B6D11; }
.app-status-pill.available { background: #F3F4F6; color: #64748b; }
.app-owner-note { font-size: 10px; color: var(--muted); }
.app-remove-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.app-remove-btn:hover { border-color: #fca5a5; color: #b91c1c; }
.app-action { gap: 8px; flex-wrap: wrap; }

@media (max-width: 960px) {
  .ws-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .ws-row-2, .ws-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .page-header-bar { padding: 14px; flex-wrap: wrap; }
  .page-header-title { font-size: 22px; }
  .header-search { min-width: 100%; order: 3; }
  #page-workspace { padding: 16px 14px 24px; }
  .mobile-menu { display: flex !important; }
}
.mobile-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

/* Deal Room */
.dr-deal-list {
  background: var(--ui-surface, var(--surface));
  border: 1px solid var(--ui-border, var(--line));
  border-radius: var(--radius-lg, 10px);
  overflow: hidden;
}
.dr-empty { color: var(--muted); font-size: 13px; padding: 16px; }
.dr-empty-state { padding: 48px 24px; }
.dr-empty-state .btn-new { margin-top: 16px; }
.dr-create-btn { /* primary action — uses header-btn-primary / btn-new */ }
.dr-empty.dr-err { color: var(--danger); }
.dr-hidden { display: none !important; }
.dr-deal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s ease;
  min-height: 44px;
}
.dr-deal-row:last-child { border-bottom: none; }
.dr-deal-row:hover { background: var(--ui-surface-muted, #F9FAFB); }
.dr-deal-row:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.dr-deal-title { font-size: 14px; font-weight: 600; color: var(--text); }
.dr-deal-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dr-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.dr-status[data-status="active"],
.dr-status[data-status="nda_signed"] {
  background: #ECFDF5;
  color: #059669;
}
.dr-status[data-status="draft"],
.dr-status[data-status="invited"],
.dr-status[data-status="nda_pending"] {
  background: #F3F4F6;
  color: #6B7280;
}
.dr-status[data-status="discussion_requested"] {
  background: #FFFBEB;
  color: #D97706;
}
.dr-detail-header { margin-bottom: 20px; }
.dr-back {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 12px;
  font-family: inherit;
  min-height: 36px;
}
.dr-back:hover { text-decoration: underline; }
.dr-detail-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.dr-detail-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.dr-detail-sub { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }
.dr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .dr-grid { grid-template-columns: 1fr; } }
.dr-buyer-row, .dr-doc-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.dr-buyer-row:last-child, .dr-doc-row:last-child { border-bottom: none; }
.dr-buyer-name, .dr-doc-name { font-size: 13px; font-weight: 600; }
.dr-buyer-meta, .dr-doc-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.dr-buyer-status { margin-top: 6px; display: inline-flex; }
.dr-buyer-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.dr-sm-btn { padding: 6px 12px !important; font-size: 12px !important; min-height: 32px !important; }
.dr-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  margin-bottom: 12px;
}
.dr-msg-thread {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding: 4px 0;
}
.dr-msg {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.dr-msg-buyer { background: #EFF6FF; border: 1px solid #DBEAFE; }
.dr-msg-broker { background: #F9FAFB; border: 1px solid var(--line); }
.dr-msg-meta {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dr-msg-compose { display: flex; gap: 8px; align-items: flex-end; }
.dr-msg-compose textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 44px;
}
.dr-activity-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.dr-activity-row:last-child { border-bottom: none; }
.dr-activity-title { font-size: 13px; font-weight: 500; }
.dr-activity-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
#page-dealroom { padding-top: 8px; }
.dr-buyer-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  background: #F9FAFB;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.dr-setting-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.dr-setting-cards-3 { grid-template-columns: repeat(3, 1fr); }
.dr-setting-card {
  text-align: left; padding: 14px 16px; border: 2px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; font-family: inherit; width: 100%;
}
.dr-setting-card-selected { border-color: var(--accent); background: #F0F7FF; }
.dr-setting-card-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.dr-setting-card-desc { font-size: 12px; line-height: 1.5; color: var(--muted); }
.dr-badge { font-size: 10px; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.dr-settings-block { margin-bottom: 18px; }
.dr-settings-block-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.dr-settings-sub { font-size: 12px; color: var(--muted); margin-top: -6px; margin-bottom: 12px; }
.dr-settings-hint { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.dr-setting-locked { font-size: 13px; font-weight: 600; color: var(--success); padding: 10px 12px; background: #ECFDF5; border-radius: 8px; border: 1px solid #A7F3D0; }
.dr-msg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dr-msg-wf { font-size: 10px; font-weight: 600; color: #6B7280; margin-left: 4px; }
.dr-comm-settings { margin-bottom: 16px; }
@media (max-width: 760px) {
  .dr-setting-cards, .dr-setting-cards-3 { grid-template-columns: 1fr; }
}
.dr-notify-toggles { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.dr-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; }
.dr-check input { accent-color: var(--accent); }
.dr-settings-row label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.dr-settings-row select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
}
.dr-buyer-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
}
.dr-msg-role {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 4px;
}
.dr-msg-role-buyer { background: #EFF6FF; color: #2563EB; }
.dr-msg-role-broker { background: #F3F4F6; color: #374151; }
.dr-msg-role-seller { background: #ECFDF5; color: #059669; }
.dr-msg-role-system { background: #FFFBEB; color: #D97706; }
.dr-msg-vis {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
}
.dr-msg-vis-shared { background: #DBEAFE; color: #1E40AF; }
.dr-msg-vis-internal { background: #FEE2E2; color: #991B1B; }
.dr-msg-internal { border-left: 3px solid #FCA5A5; }
@media (max-width: 760px) {
  .dr-buyer-settings { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────────────
   Future One OS — Tech UI refresh (2026.07)
   ───────────────────────────────────────────────────────────── */
:root{--fo-ink:#07152f;--fo-navy:#0b1733;--fo-cyan:#28d7ff;--fo-blue:#4f7cff;--fo-violet:#7857ff;--fo-glow:rgba(40,215,255,.22)}
body{background:radial-gradient(circle at 82% -10%,rgba(79,124,255,.08),transparent 30%),#f5f7fb}
.sidebar{background:radial-gradient(circle at 24% 0%,rgba(40,215,255,.13),transparent 32%),linear-gradient(180deg,#08152d 0%,#0b1733 54%,#071126 100%)!important;border-right:1px solid rgba(148,163,184,.15)!important;box-shadow:18px 0 50px rgba(7,21,47,.10)}
.ws-header{border-bottom-color:rgba(255,255,255,.08)!important}.ws-logo{background:linear-gradient(145deg,rgba(255,255,255,.16),rgba(255,255,255,.06))!important;border:1px solid rgba(255,255,255,.16)!important;color:#fff!important;box-shadow:0 0 0 5px rgba(40,215,255,.05),0 10px 26px rgba(0,0,0,.18)}
.ws-name,.sidebar-footer .user-name{color:#f8fbff!important}.ws-sub,.sidebar-footer .user-org,.sidebar-footer .user-email,.powered{color:#91a2bd!important}
.sidebar-nav{padding:16px 10px!important}.sidebar-nav .nav-item{min-height:46px;margin:4px 0;padding:0 13px!important;border:1px solid transparent!important;border-radius:13px!important;color:#aab8cf!important;font-weight:520!important;letter-spacing:.005em;transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease!important}
.sidebar-nav .nav-item:hover{color:#fff!important;background:rgba(255,255,255,.065)!important;border-color:rgba(255,255,255,.07)!important;transform:translateX(2px)}
.sidebar-nav .nav-item.active{color:#fff!important;background:linear-gradient(100deg,rgba(79,124,255,.28),rgba(40,215,255,.10))!important;border-color:rgba(93,190,255,.25)!important;box-shadow:0 10px 28px rgba(3,10,30,.22),inset 3px 0 0 #2bd8ff!important}
.sidebar-nav .nav-item.active .nav-icon-wrap,.sidebar-nav .nav-item:hover .nav-icon-wrap{color:#67e6ff!important}.nav-icon-wrap{color:#8193ae!important}.nav-badge{background:linear-gradient(135deg,#34d8ff,#5c75ff)!important;box-shadow:0 0 18px rgba(52,216,255,.3)}
.sidebar-footer{border-top-color:rgba(255,255,255,.08)!important;background:rgba(4,12,28,.22)}.btn-logout{border-color:rgba(255,255,255,.10)!important;background:rgba(255,255,255,.04)!important;color:#cbd6e7!important}.btn-logout:hover{background:rgba(255,255,255,.08)!important;color:#fff!important}
.page-header-bar{background:rgba(255,255,255,.84)!important;backdrop-filter:blur(18px) saturate(140%);border-bottom:1px solid rgba(148,163,184,.16)!important;box-shadow:0 1px 0 rgba(255,255,255,.8)}.page-header-title{color:var(--fo-ink)!important;font-weight:730!important}.page.active.page-enter{animation:foPageIn .22s ease both}@keyframes foPageIn{from{opacity:.4;transform:translateY(4px)}to{opacity:1;transform:none}}
.card,.ws-app-card,.fo-ws-card,.fo-ws-work-tile{border:1px solid rgba(148,163,184,.18)!important;box-shadow:0 12px 30px rgba(15,23,42,.055)!important}.fo-ws-work-grid{grid-template-columns:repeat(auto-fit,minmax(230px,1fr))!important}.fo-ws-work-tile{min-height:142px;position:relative;overflow:hidden;background:rgba(255,255,255,.88)!important;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease!important}.fo-ws-work-tile:hover{transform:translateY(-3px)!important;border-color:rgba(79,124,255,.32)!important;box-shadow:0 18px 42px rgba(15,23,42,.10)!important}
.fo-ws-work-tile-featured{color:#fff!important;background:radial-gradient(circle at 100% 0%,rgba(40,215,255,.24),transparent 35%),linear-gradient(135deg,#0a1834,#142d59 62%,#19336b)!important;border-color:rgba(95,189,255,.23)!important}.fo-ws-work-tile-featured .fo-ws-work-tile-title,.fo-ws-work-tile-featured .fo-ws-work-tile-desc{color:#fff!important}.fo-ws-work-tile-featured .fo-ws-work-tile-desc{opacity:.72}.fo-ws-work-tile-featured svg{color:#5de7ff;filter:drop-shadow(0 0 8px rgba(40,215,255,.35))}
.ws-skeleton{background:linear-gradient(90deg,#edf1f7 25%,#f8faff 42%,#edf1f7 60%)!important;background-size:300% 100%!important;animation:foShimmer 1.1s ease infinite!important}@keyframes foShimmer{0%{background-position:100% 0}100%{background-position:0 0}}
#page-dealroom .section-card,#page-dealroom .dr-deal-list,#page-dealroom .dr-msg-thread{background:rgba(255,255,255,.9)!important;border:1px solid rgba(120,140,175,.18)!important;box-shadow:0 18px 45px rgba(15,23,42,.07)!important;border-radius:18px!important}.dr-deal-row{margin:8px!important;border:1px solid transparent!important;border-radius:13px!important;transition:all .16s ease!important}.dr-deal-row:hover{background:linear-gradient(100deg,rgba(79,124,255,.07),rgba(40,215,255,.035))!important;border-color:rgba(79,124,255,.18)!important;transform:translateX(3px)}
.dr-detail-header{padding:22px 24px!important;border-radius:20px!important;color:#fff;background:radial-gradient(circle at 90% 0%,rgba(40,215,255,.24),transparent 35%),linear-gradient(135deg,#09172f,#173160)!important;box-shadow:0 18px 46px rgba(7,21,47,.18)}.dr-detail-header .dr-detail-title,.dr-detail-header .dr-detail-sub,.dr-detail-header .dr-back{color:#fff!important}.dr-grid>.section-card{transition:transform .16s ease,box-shadow .16s ease}.dr-grid>.section-card:hover{transform:translateY(-2px);box-shadow:0 22px 48px rgba(15,23,42,.10)!important}.dr-status{border-radius:999px!important;padding:6px 10px!important}.dr-msg-thread{background:linear-gradient(180deg,#f7f9fd,#fff)!important}.dr-msg{border-radius:15px!important;box-shadow:0 6px 18px rgba(15,23,42,.045)}.dr-msg-buyer{background:linear-gradient(135deg,#eef5ff,#f7fbff)!important}.dr-msg-broker{background:linear-gradient(135deg,#f7f8fb,#fff)!important}
.btn-new,.header-btn-primary,.bk-dash-cta{background:linear-gradient(135deg,#245cff,#18bfe8)!important;box-shadow:0 10px 24px rgba(36,92,255,.22)!important;border:none!important}.btn-new:hover,.header-btn-primary:hover,.bk-dash-cta:hover{transform:translateY(-1px);filter:brightness(1.03)!important}
@media(max-width:760px){.sidebar{box-shadow:24px 0 60px rgba(0,0,0,.24)}.page-header-bar{padding:16px 18px!important}.fo-ws-work-grid{grid-template-columns:1fr!important}}


/* CRM / PM MVP architecture */
.fo-module-kicker{display:block;font-size:10px;letter-spacing:.14em;font-weight:800;color:#2563eb;margin-bottom:8px}
.fo-domain-head-actions{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}
.fo-crm-nav{display:flex;gap:8px;margin:18px 0}.fo-crm-nav button{border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px 14px;font-weight:650}.fo-crm-nav button.active{background:#0f172a;color:#fff;border-color:#0f172a}
.fo-crm-pipeline{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.fo-crm-stage{padding:16px}.fo-crm-stage-name{font-size:12px;color:var(--muted);font-weight:700;text-transform:uppercase}.fo-crm-stage-count{font-size:28px;font-weight:800;margin-top:8px}.fo-crm-stage-value{color:#2563eb;font-weight:700}.fo-crm-card-mini{margin-top:16px;padding:12px;border-radius:10px;background:#f8fafc;font-size:12px;color:var(--muted)}
.fo-mvp-architecture{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:16px}.fo-mvp-architecture .card{padding:16px}.fo-mvp-architecture b{display:block;margin-bottom:7px}.fo-mvp-architecture span{display:block;color:var(--muted);font-size:12px;line-height:1.55}
.fo-integration-flow{padding:18px;display:grid;grid-template-columns:1fr auto 1fr auto;align-items:center;gap:18px}.fo-integration-flow strong,.fo-integration-flow span{display:block}.fo-integration-flow div>span{font-size:12px;color:var(--muted);margin-top:5px}.fo-flow-arrow{font-size:22px;color:#2563eb}.fo-connection-state{border-radius:999px;padding:7px 10px;background:#eef2ff;color:#4338ca;font-size:11px;font-weight:750}.fo-connection-state.connected{background:#dcfce7;color:#166534}
.language-toggle{width:100%;margin:0 0 8px;border:1px solid rgba(148,163,184,.25);background:rgba(255,255,255,.07);color:#dbeafe;border-radius:10px;padding:9px;font-weight:700;cursor:pointer}.language-toggle:hover{background:rgba(59,130,246,.18)}
@media(max-width:900px){.fo-crm-pipeline,.fo-mvp-architecture{grid-template-columns:1fr 1fr}.fo-integration-flow{grid-template-columns:1fr}.fo-flow-arrow{transform:rotate(90deg)}}
@media(max-width:560px){.fo-crm-pipeline,.fo-mvp-architecture{grid-template-columns:1fr}.fo-domain-head-actions{display:block}.fo-domain-head-actions .btn-new{margin-top:12px}}

/* ─────────────────────────────────────────────────────────────
   Workspace sidebar redesign — visual-only shell refresh
   ───────────────────────────────────────────────────────────── */
:root {
  --sidebar: 272px;
  --fo-sidebar-bg: #08152d;
  --fo-sidebar-bg-2: #0c1b3a;
  --fo-sidebar-text: #e6edf8;
  --fo-sidebar-muted: #8ea0ba;
  --fo-sidebar-border: rgba(148, 163, 184, 0.16);
  --fo-sidebar-hover: rgba(255, 255, 255, 0.075);
  --fo-sidebar-active: rgba(68, 126, 255, 0.2);
  --fo-sidebar-active-border: rgba(90, 204, 255, 0.38);
  --fo-sidebar-focus: #53d9ff;
}

.sidebar {
  width: var(--sidebar) !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(40, 215, 255, 0.18), transparent 30%),
    radial-gradient(circle at 100% 28%, rgba(120, 87, 255, 0.12), transparent 34%),
    linear-gradient(180deg, var(--fo-sidebar-bg) 0%, var(--fo-sidebar-bg-2) 52%, #071126 100%) !important;
  border-right: 1px solid var(--fo-sidebar-border) !important;
  box-shadow: 18px 0 48px rgba(7, 21, 47, 0.12) !important;
}

.ws-header {
  padding: 22px 18px 18px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.085) !important;
}
.ws-logo {
  width: 44px !important;
  height: 44px !important;
  border-radius: 15px !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.055)) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
}
.ws-name {
  color: var(--fo-sidebar-text) !important;
  font-size: 15px !important;
  font-weight: 720 !important;
  letter-spacing: -0.01em;
}
.ws-sub {
  color: var(--fo-sidebar-muted) !important;
  font-size: 11px !important;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}
.sidebar-nav .nav-section {
  display: block !important;
  padding: 16px 12px 7px !important;
  color: rgba(226, 232, 240, 0.48) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.14em !important;
  line-height: 1;
  text-transform: uppercase;
}
.sidebar-nav .nav-section:first-child { padding-top: 2px !important; }
.sidebar-nav .nav-item {
  position: relative;
  min-height: 48px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 1px solid transparent !important;
  border-radius: 15px !important;
  color: rgba(230, 237, 248, 0.72) !important;
  font-size: 14px !important;
  font-weight: 640 !important;
  letter-spacing: -0.005em;
  gap: 12px !important;
  overflow: hidden;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease !important;
}
.sidebar-nav .nav-item::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: transparent;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}
.sidebar-nav .nav-item:hover {
  background: var(--fo-sidebar-hover) !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
  color: #fff !important;
  transform: translateX(2px);
}
.sidebar-nav .nav-item.active {
  background: linear-gradient(100deg, var(--fo-sidebar-active), rgba(40, 215, 255, 0.09)) !important;
  border-color: var(--fo-sidebar-active-border) !important;
  color: #fff !important;
  box-shadow: 0 14px 32px rgba(3, 10, 30, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  transform: none;
}
.sidebar-nav .nav-item.active::before {
  background: var(--fo-sidebar-focus);
  box-shadow: 0 0 18px rgba(83, 217, 255, 0.68);
}
.nav-icon-wrap {
  width: 34px !important;
  height: 34px !important;
  border-radius: 12px;
  color: rgba(200, 213, 233, 0.78) !important;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.nav-icon-wrap .fo-icon {
  width: 19px;
  height: 19px;
  stroke-width: 1.65;
}
.sidebar-nav .nav-item:hover .nav-icon-wrap,
.sidebar-nav .nav-item.active .nav-icon-wrap {
  color: #67e6ff !important;
  background: rgba(103, 230, 255, 0.1);
  border-color: rgba(103, 230, 255, 0.18);
}
.sidebar-nav .nav-item:hover .nav-icon-wrap { transform: scale(1.03); }
.nav-badge {
  margin-left: auto;
  min-width: 22px !important;
  height: 22px;
  padding: 0 7px !important;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, #31d7ff, #6175ff) !important;
  box-shadow: 0 0 20px rgba(49, 215, 255, 0.32) !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  line-height: 20px;
}

.sidebar-footer {
  margin: 0 12px 12px;
  padding: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.085) !important;
  border-radius: 18px;
  background: rgba(3, 10, 24, 0.34) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}
.user-info {
  gap: 11px !important;
  margin-bottom: 12px !important;
}
.user-avatar {
  width: 36px !important;
  height: 36px !important;
  border-radius: 12px !important;
  background: linear-gradient(145deg, rgba(83, 217, 255, 0.22), rgba(97, 117, 255, 0.16)) !important;
  border: 1px solid rgba(103, 230, 255, 0.18);
  color: #fff !important;
}
.sidebar-footer .user-name { color: #f8fbff !important; font-size: 13px !important; }
.sidebar-footer .user-org,
.sidebar-footer .user-email,
.powered { color: rgba(203, 213, 225, 0.64) !important; }
.language-toggle,
.btn-logout {
  min-height: 38px;
  border-radius: 12px !important;
  border-color: rgba(255, 255, 255, 0.105) !important;
  background: rgba(255, 255, 255, 0.055) !important;
  color: #dbeafe !important;
}
.language-toggle:hover,
.btn-logout:hover {
  background: rgba(103, 230, 255, 0.1) !important;
  border-color: rgba(103, 230, 255, 0.22) !important;
  color: #fff !important;
}
.powered { margin-top: 12px !important; }

.sidebar-backdrop.visible {
  display: block;
  background: rgba(2, 6, 23, 0.58);
  backdrop-filter: blur(4px);
}

@media (prefers-color-scheme: light) {
  body:not(.force-dark) .sidebar {
    background:
      radial-gradient(circle at 20% 0%, rgba(10, 102, 194, 0.1), transparent 30%),
      linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    border-right-color: rgba(203, 213, 225, 0.9) !important;
    box-shadow: 14px 0 36px rgba(15, 23, 42, 0.055) !important;
  }
  body:not(.force-dark) .ws-header { border-bottom-color: rgba(203, 213, 225, 0.78) !important; }
  body:not(.force-dark) .ws-logo {
    background: linear-gradient(145deg, #eef5ff, #ffffff) !important;
    border-color: #dbeafe !important;
    color: #185FA5 !important;
    box-shadow: 0 10px 24px rgba(10, 102, 194, 0.1) !important;
  }
  body:not(.force-dark) .ws-name { color: #0f172a !important; }
  body:not(.force-dark) .ws-sub,
  body:not(.force-dark) .sidebar-footer .user-org,
  body:not(.force-dark) .sidebar-footer .user-email,
  body:not(.force-dark) .powered { color: #64748b !important; }
  body:not(.force-dark) .sidebar-nav .nav-section { color: #94a3b8 !important; }
  body:not(.force-dark) .sidebar-nav .nav-item {
    color: #475569 !important;
    border-color: transparent !important;
  }
  body:not(.force-dark) .sidebar-nav .nav-item:hover {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
  }
  body:not(.force-dark) .sidebar-nav .nav-item.active {
    background: linear-gradient(100deg, #eef5ff, #f7fbff) !important;
    border-color: #bfdbfe !important;
    color: #185FA5 !important;
    box-shadow: 0 12px 28px rgba(10, 102, 194, 0.11) !important;
  }
  body:not(.force-dark) .nav-icon-wrap {
    color: #64748b !important;
    background: #f8fafc;
    border-color: #e2e8f0;
  }
  body:not(.force-dark) .sidebar-nav .nav-item:hover .nav-icon-wrap,
  body:not(.force-dark) .sidebar-nav .nav-item.active .nav-icon-wrap {
    color: #185FA5 !important;
    background: #e8f0fb;
    border-color: #bfdbfe;
  }
  body:not(.force-dark) .sidebar-footer {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
  }
  body:not(.force-dark) .sidebar-footer .user-name { color: #0f172a !important; }
  body:not(.force-dark) .user-avatar {
    background: #e8f0fb !important;
    border-color: #bfdbfe;
    color: #185FA5 !important;
  }
  body:not(.force-dark) .language-toggle,
  body:not(.force-dark) .btn-logout {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
  }
  body:not(.force-dark) .language-toggle:hover,
  body:not(.force-dark) .btn-logout:hover {
    background: #eef5ff !important;
    border-color: #bfdbfe !important;
    color: #185FA5 !important;
  }
}

@media (prefers-color-scheme: dark) {
  .sidebar { color-scheme: dark; }
}

@media (max-width: 760px) {
  :root { --sidebar: min(86vw, 312px); }
  .sidebar {
    left: calc(-1 * var(--sidebar) - 24px) !important;
    max-width: var(--sidebar);
    transition: left 0.22s ease, transform 0.22s ease !important;
    box-shadow: 28px 0 70px rgba(0, 0, 0, 0.34) !important;
  }
  .sidebar.mobile-open { left: 0 !important; }
  .ws-header { padding-top: 20px !important; }
  .sidebar-nav { padding: 14px 10px !important; }
  .sidebar-nav .nav-item { min-height: 50px !important; }
  .sidebar-footer { margin: 0 10px 10px; }
}
