/* CPS Super Admin 360: shell, tenant directory, and profile logo controls. */
.cps-platform-admin .brand-mark.cps-platform-brand-mark {
  overflow: hidden;
  padding: 3px;
  border: 1px solid #e3e7f2;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}
.cps-platform-admin .cps-platform-brand-image { display: block; width: 100%; height: 100%; object-fit: contain; }
#dashboardScreen .cps-tenant-profile-avatar.has-logo { padding: 3px; background: #fff; }
#dashboardScreen .cps-tenant-logo-image { display: block; width: 100%; height: 100%; object-fit: contain; }
#dashboardScreen.dashboard.cps-v6-dashboard { grid-template-columns: 240px minmax(0, 1fr); }
#dashboardScreen .sidebar,
#dashboardScreen .sidebar.cps-v6-sidebar,
#dashboardScreen .sidebar.cps-v9-sidebar {
  box-sizing: border-box; width: 240px; min-width: 240px; height: 100%; min-height: 0; max-height: 100dvh;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain;
}
#dashboardScreen .main-area {
  width: 100%; min-width: 0; min-height: 0; height: 100%; overflow-x: hidden; overflow-y: auto;
  overscroll-behavior-y: contain; padding: 18px clamp(16px, 2vw, 30px) 28px;
}
#dashboardScreen .topbar {
  top: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; margin-bottom: 18px;
}
#dashboardScreen #overviewPanel .welcome[hidden] { display: none; }
#dashboardScreen .topbar > div:first-of-type { min-width: 180px; flex: 1 1 280px; }
#dashboardScreen .top-actions { min-width: 0; flex: 0 1 auto; }
#dashboardScreen .panel,
#dashboardScreen .data-card,
#dashboardScreen .section-title,
#dashboardScreen .table-wrap { min-width: 0; max-width: 100%; }
#dashboardScreen .table-wrap { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
#dashboardScreen table { min-width: 720px; }
#dashboardScreen #tenantsPanel .table-wrap table { min-width: 860px; }
#dashboardScreen #tenantsPanel .section-title { align-items: center; flex-wrap: wrap; gap: 12px; }
#dashboardScreen #tenantsPanel .section-title > div { min-width: 0; flex: 1 1 240px; }
#dashboardScreen #tenantSearch { width: min(100%, 340px); min-width: min(220px, 100%); }
#dashboardScreen .cps-tenant-profile-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 14px; margin: 16px 0;
}
#dashboardScreen .cps-tenant-profile-card {
  display: flex; min-width: 0; min-height: 168px; flex-direction: column; gap: 14px; padding: 16px;
  border: 1px solid #dfe5f3; border-radius: 15px; background: linear-gradient(145deg, #fff 0%, #f8f9ff 100%);
  box-shadow: 0 7px 20px rgba(37, 47, 98, .055);
}
#dashboardScreen .cps-tenant-profile-heading {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-width: 0;
}
#dashboardScreen .cps-tenant-profile-heading > div:nth-child(2) { min-width: 0; }
#dashboardScreen .cps-tenant-profile-heading h3 {
  margin: 0 0 4px; color: #242a52; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere;
}
#dashboardScreen .cps-tenant-profile-heading small {
  display: block; color: #727d98; font: 11px/1.45 Consolas, "Courier New", monospace; overflow-wrap: anywhere;
}
#dashboardScreen .cps-tenant-profile-avatar {
  display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #dce3f6; border-radius: 12px;
  color: #fff; background: linear-gradient(145deg, #406fd1, #7356cb); font-size: 17px; font-weight: 850;
}
#dashboardScreen .cps-tenant-profile-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 10px 0;
  border-top: 1px solid #edf0f7; border-bottom: 1px solid #edf0f7;
}
#dashboardScreen .cps-tenant-profile-stats div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
#dashboardScreen .cps-tenant-profile-stats strong { color: #252b55; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
#dashboardScreen .cps-tenant-profile-stats span { color: #77819b; font-size: 10px; }
#dashboardScreen .cps-tenant-profile-actions {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: auto;
}
#dashboardScreen .cps-tenant-profile-actions button { min-height: 36px; padding: 8px 12px; }
#dashboardScreen .cps-tenant-profile-actions label {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; color: #53607e; font-size: 12px; cursor: pointer;
}
#dashboardScreen .cps-tenant-profile-actions input { width: 16px; height: 16px; margin: 0; accent-color: #6752d2; }
#dashboardScreen button:focus-visible,
#tenant360Dialog button:focus-visible,
#tenant360Dialog input:focus-visible { outline: 3px solid rgba(103, 82, 210, .35); outline-offset: 2px; }
#dashboardScreen .cps-360-menu-toggle,
#dashboardScreen .cps-360-nav-backdrop { display: none; }
.cps-360-dialog {
  width: min(980px, calc(100vw - 40px)); max-width: 980px; max-height: min(90dvh, 900px); padding: 0; overflow: auto;
  border: 1px solid #dfe4f1; border-radius: 18px; color: #252a50; background: #f7f8fd;
  box-shadow: 0 28px 90px rgba(18, 24, 58, .28);
}
.cps-360-dialog::backdrop { background: rgba(15, 20, 48, .55); backdrop-filter: blur(4px); }
.cps-360-dialog-head {
  position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; border-bottom: 1px solid #e8ebf3; background: rgba(255, 255, 255, .96);
}
.cps-360-dialog-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.cps-360-avatar {
  display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 14px; color: #fff;
  background: linear-gradient(145deg, #426ed0, #7255c6); font-size: 14px; font-weight: 900;
}
.cps-360-avatar.has-logo { padding: 3px; border: 1px solid #e2e6f0; background: #fff; }
.cps-360-avatar .cps-tenant-logo-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.cps-360-logo-manager { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 14px; }
.cps-360-logo-preview {
  display: grid; width: 112px; height: 92px; place-items: center; overflow: hidden; border: 1px solid #e1e6f0;
  border-radius: 10px; color: #5b55aa; background: #fff; font-size: 19px; font-weight: 850;
}
.cps-360-logo-preview.has-logo { padding: 5px; }
.cps-360-logo-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cps-360-logo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cps-360-logo-controls label { display: inline-flex; min-height: 36px; align-items: center; padding: 8px 11px; border: 1px solid #e0e4f2; border-radius: 9px; color: #59628a; background: #fff; font-size: 11px; font-weight: 750; cursor: pointer; }
.cps-360-logo-controls input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.cps-360-logo-controls button { min-height: 36px; padding: 8px 11px; }
.cps-360-logo-note { margin: 8px 0 0; color: #7a849c; font-size: 10px; line-height: 1.45; }
.cps-360-eyebrow { margin: 0 0 3px; color: #6954ca; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.cps-360-dialog h2 { margin: 0; color: #24294d; font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
.cps-360-muted { margin: 4px 0 0; color: #77809a; font-size: 11px; overflow-wrap: anywhere; }
.cps-360-tabs { display: flex; gap: 6px; padding: 12px 18px 0; overflow-x: auto; border-bottom: 1px solid #e3e7f1; background: #fff; }
.cps-360-tabs button {
  min-height: 38px; flex: 0 0 auto; padding: 8px 11px; border: 0; border-bottom: 2px solid transparent;
  color: #69738c; background: transparent; font-size: 11px; font-weight: 750; cursor: pointer;
}
.cps-360-tabs button[aria-selected="true"] { border-bottom-color: #6652d2; color: #4f42ae; }
.cps-360-message {
  margin: 15px 18px 0; padding: 10px 12px; border: 1px solid #dfe5f4; border-radius: 10px; color: #515f7d;
  background: #f1f4fb; font-size: 12px; line-height: 1.5;
}
.cps-360-message[data-tone="error"] { border-color: #efcaca; color: #9c2f3d; background: #fff5f5; }
.cps-360-message[data-tone="good"] { border-color: #cde9dc; color: #17684d; background: #f1fbf6; }
.cps-360-content { min-height: 190px; padding: 16px 18px; }
.cps-360-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cps-360-kpi,
.cps-360-section { min-width: 0; padding: 13px; border: 1px solid #e2e6f0; border-radius: 12px; background: #fff; }
.cps-360-kpi span,
.cps-360-section small { display: block; color: #77809a; font-size: 10px; line-height: 1.45; }
.cps-360-kpi b { display: block; margin-top: 5px; color: #282d57; font-size: 20px; overflow-wrap: anywhere; }
.cps-360-section { margin-top: 12px; }
.cps-360-section h3 { margin: 0 0 9px; color: #2b3158; font-size: 13px; }
.cps-360-section p { margin: 7px 0 0; color: #65708b; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.cps-360-color { display: inline-flex; align-items: center; gap: 6px; }
.cps-360-color::before { width: 14px; height: 14px; border: 1px solid #d5d9e5; border-radius: 4px; background: var(--tenant-accent); content: ""; }
.cps-360-table-wrap { max-width: 100%; overflow-x: auto; }
.cps-360-table-wrap table { min-width: 480px; }
.cps-360-edit-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.cps-360-edit-form label { display: grid; gap: 6px; color: #56617c; font-size: 11px; font-weight: 750; }
.cps-360-edit-form input {
  width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid #dce2ef; border-radius: 9px;
  color: #252a50; background: #fff;
}
.cps-360-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 18px; }
.cps-360-actions button { min-height: 36px; padding: 8px 11px; }
.cps-360-module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cps-360-module-row {
  display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; padding: 10px;
  border: 1px solid #e6e9f2; border-radius: 10px; background: #fff;
}
.cps-360-module-row > div { min-width: 0; }
.cps-360-module-row b { display: block; color: #30365f; font-size: 11px; overflow-wrap: anywhere; }
.cps-360-module-row small { display: block; margin-top: 3px; color: #7a849c; font-size: 10px; line-height: 1.4; }
.cps-360-module-boundary { flex: 0 0 auto; color: #7b668e; font-size: 9px; font-weight: 750; }
.cps-360-module-row button { flex: 0 0 auto; min-height: 32px; padding: 6px 9px; }
@media (max-width: 1100px) {
  #dashboardScreen .main-area { padding-right: 18px; padding-left: 18px; }
  #dashboardScreen .top-actions { flex: 1 1 100%; justify-content: flex-start; }
  .cps-360-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  #dashboardScreen.dashboard.cps-v6-dashboard {
    display: block; width: 100%; height: auto; min-height: 100dvh; overflow: visible;
  }
  #dashboardScreen .sidebar,
  #dashboardScreen .sidebar.cps-v6-sidebar,
  #dashboardScreen .sidebar.cps-v9-sidebar {
    position: fixed; z-index: 60; top: 0; left: 0; width: min(300px, 86vw); min-width: 0; height: 100vh; height: 100dvh;
    max-height: 100dvh; padding-bottom: max(16px, env(safe-area-inset-bottom)); overflow-x: hidden; overflow-y: auto;
    transform: translateX(-105%); visibility: hidden; transition: transform .2s ease, visibility .2s ease;
  }
  #dashboardScreen.cps-360-nav-open .sidebar { transform: translateX(0); visibility: visible; }
  #dashboardScreen .main-area { width: 100%; height: auto; min-height: 100dvh; overflow: visible; padding: 12px 14px 24px; }
  #dashboardScreen .topbar {
    position: relative; top: auto; z-index: 30; margin: -12px -14px 14px; padding: 12px 14px; border-radius: 0 0 14px 14px;
  }
  #dashboardScreen .cps-360-menu-toggle {
    display: inline-flex; min-height: 38px; flex: 0 0 auto; align-items: center; gap: 8px; padding: 8px 10px;
    border: 1px solid #dedff0; border-radius: 9px; color: #49428e; background: #fff; font-size: 12px; font-weight: 750; cursor: pointer;
  }
  #dashboardScreen .cps-360-nav-backdrop {
    position: fixed; z-index: 50; inset: 0; display: block; visibility: hidden; border: 0; background: rgba(14, 17, 41, .48);
    opacity: 0; pointer-events: none; transition: opacity .2s ease, visibility .2s ease;
  }
  #dashboardScreen.cps-360-nav-open .cps-360-nav-backdrop { visibility: visible; opacity: 1; pointer-events: auto; }
  #dashboardScreen .cps-tenant-profile-grid { grid-template-columns: minmax(0, 1fr); }
  #dashboardScreen .cps-v9-nav-group { display: flex; }
}
@media (max-width: 520px) {
  #dashboardScreen .main-area { padding-right: 10px; padding-left: 10px; }
  #dashboardScreen .topbar { margin-right: -10px; margin-left: -10px; padding-right: 10px; padding-left: 10px; }
  #dashboardScreen .topbar > div:first-of-type { flex-basis: 180px; }
  #dashboardScreen .topbar h1 { font-size: 18px; overflow-wrap: anywhere; }
  #dashboardScreen .top-actions { align-items: stretch; }
  #dashboardScreen .topbar .status { max-width: 100%; overflow-wrap: anywhere; }
  #dashboardScreen #tenantSearch { width: 100%; min-width: 0; }
  #dashboardScreen .cps-tenant-profile-card { padding: 13px; }
  #dashboardScreen .cps-tenant-profile-heading { grid-template-columns: 38px minmax(0, 1fr); }
  #dashboardScreen .cps-tenant-profile-heading > .active-chip,
  #dashboardScreen .cps-tenant-profile-heading > .inactive-chip { grid-column: 2; justify-self: start; }
  #dashboardScreen .cps-tenant-profile-avatar { width: 38px; height: 38px; }
  #dashboardScreen .cps-tenant-profile-stats { gap: 6px; }
  #dashboardScreen .cps-tenant-profile-stats strong { font-size: 14px; }
  #dashboardScreen .cps-tenant-profile-actions { align-items: stretch; }
  #dashboardScreen .cps-tenant-profile-actions button { flex: 1 1 160px; }
  .cps-360-dialog { width: calc(100vw - 16px); max-height: 94dvh; border-radius: 14px; }
  .cps-360-dialog-head { align-items: flex-start; padding: 13px; }
  .cps-360-dialog h2 { font-size: 16px; }
  .cps-360-tabs { padding-right: 9px; padding-left: 9px; }
  .cps-360-content { padding: 12px; }
  .cps-360-message { margin-right: 12px; margin-left: 12px; }
  .cps-360-actions { padding: 0 12px 12px; }
  .cps-360-edit-form { grid-template-columns: minmax(0, 1fr); }
  .cps-360-module-grid { grid-template-columns: minmax(0, 1fr); }
  .cps-360-logo-manager { grid-template-columns: 82px minmax(0, 1fr); gap: 10px; }
  .cps-360-logo-preview { width: 82px; height: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  #dashboardScreen .sidebar, #dashboardScreen .cps-360-nav-backdrop { transition: none; }
}/* Compact application shell: the topbar owns the page title and global actions. */
#dashboardScreen .topbar { min-width: 0; gap: 10px; }
#dashboardScreen .topbar > div:first-of-type { min-width: 0; flex: 1 1 190px; }
#dashboardScreen .top-actions { min-width: 0; gap: 6px; flex-wrap: wrap; }
#dashboardScreen .mc-global-search { min-width: 0; }
#dashboardScreen .mc-global-search input { min-width: 0; max-width: 100%; }
@media (max-width: 700px) {
  #dashboardScreen .topbar { margin-left: 0; margin-right: 0; }
  #dashboardScreen .top-actions { width: 100%; justify-content: flex-start; }
  #dashboardScreen .mc-global-search { flex: 1 1 160px; }
}
