/* Shared Control Center shell — Platform vs Tenant identity (FEAT-065.1) */

.cc-shell {
  min-height: 100vh;
  margin: 0;
  font-family: var(--bp-font-family);
  line-height: 1.5;
  color: var(--bp-platform-text);
}

/* --- Platform CC (EMPREAR brand) + Tenant CC --- */

.cc-shell--platform {
  background: var(--bp-platform-bg);
  color: var(--bp-platform-text);
}

.cc-shell--tenant {
  background: var(--bp-tenant-bg, var(--bp-platform-bg));
  color: var(--bp-tenant-text, var(--bp-platform-text));
  font-family: var(--tenant-font, var(--bp-font-family));
}

.cc-shell--auth {
  background: var(--bp-gradient-hero-glow);
}

.cc-shell--platform .cc-header,
.cc-shell--tenant .cc-header {
  border-bottom: 1px solid var(--bp-platform-border);
}

.cc-shell--platform .cc-header h1,
.cc-shell--tenant .cc-header h1 {
  color: var(--bp-white);
}

.cc-shell--platform .cc-nav a {
  color: var(--bp-gray-light);
}

.cc-shell--tenant .cc-nav a {
  color: var(--tenant-secondary, #3b82f6);
}

.cc-shell--platform .cc-nav a:hover,
.cc-shell--platform .cc-nav a[aria-current="page"],
.cc-shell--tenant .cc-nav a:hover,
.cc-shell--tenant .cc-nav a[aria-current="page"] {
  color: var(--bp-white);
}

.cc-shell--platform .cc-nav a[aria-current="page"] {
  font-weight: 600;
  text-decoration: none;
  box-shadow: inset 0 -2px 0 var(--bp-brand-secondary);
}

.cc-shell--tenant .cc-nav a[aria-current="page"] {
  font-weight: 600;
  text-decoration: none;
  box-shadow: inset 0 -2px 0 var(--tenant-secondary, #3b82f6);
}

.cc-shell--platform .cc-main .bp-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
}

.cc-shell--platform .cc-main .bp-billing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1px;
  grid-auto-flow: dense;
  column-gap: 1rem;
  row-gap: 0;
  align-items: start;
}

.cc-shell--platform .cc-main .bp-billing-widget {
  min-width: 0;
  align-self: start;
  margin-bottom: 1rem;
}

.cc-shell--platform .cc-main .bp-data-table-wrap {
  overflow-x: auto;
}

@media (max-width: 900px) {
  .cc-shell--platform .cc-main .bp-billing-grid {
    grid-template-columns: 1fr;
  }
}

.cc-shell--platform .cc-main .bp-kpi-card,
.cc-shell--platform .cc-main .bp-card,
.cc-shell--platform .cc-main .card {
  background: var(--bp-gradient-card);
  color: var(--bp-platform-text);
  border: 1px solid var(--bp-border);
}

.cc-shell--platform .cc-main .bp-kpi-card__label,
.cc-shell--platform .cc-main .bp-kpi-card__value,
.cc-shell--platform .cc-main h2,
.cc-shell--platform .cc-main .bp-page-header,
.cc-shell--platform .cc-main .bp-page-header h1 {
  color: var(--bp-platform-text);
}

.cc-shell--platform .cc-main .bp-kpi-card__hint,
.cc-shell--platform .cc-main .bp-page-header p {
  color: color-mix(in srgb, var(--bp-platform-text) 72%, transparent);
}

.cc-shell--platform .cc-main .bp-data-table th,
.cc-shell--platform .cc-main .bp-data-table td {
  color: var(--bp-platform-text);
  border-bottom-color: var(--bp-border);
}

.cc-shell--platform .cc-main .bp-data-table th,
.cc-shell--platform .bp-data-table th {
  background: #222;
  color: var(--bp-brand-accent);
}

.cc-shell--platform .bp-data-table-sort {
  color: var(--bp-brand-accent);
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.cc-shell--platform .bp-billing-providers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  align-items: start;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.cc-shell--platform .bp-billing-providers__card {
  padding: 0.75rem;
}

.cc-shell--platform .bp-billing-providers__summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  list-style: none;
}

.cc-shell--platform .bp-billing-providers__summary::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--bp-brand-accent);
  border-bottom: 2px solid var(--bp-brand-accent);
  transform: rotate(-45deg);
  flex: 0 0 auto;
  margin-bottom: 0.15rem;
}

.cc-shell--platform .bp-billing-providers__card[open] > .bp-billing-providers__summary::before {
  transform: rotate(45deg);
  margin-bottom: 0;
  margin-top: 0.15rem;
}

.cc-shell--platform .bp-billing-providers__summary::-webkit-details-marker {
  display: none;
}

.cc-shell--platform .bp-billing-providers__summary .bp-billing-providers__head {
  flex: 1 1 auto;
  margin: 0;
}

.cc-shell--platform .bp-provider-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.cc-shell--platform .bp-switch {
  position: relative;
  width: 2.4rem;
  height: 1.35rem;
  flex: 0 0 auto;
}

.cc-shell--platform .bp-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cc-shell--platform .bp-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #3a3a3a;
  cursor: pointer;
}

.cc-shell--platform .bp-switch span::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: #f5f5f5;
  transition: transform 0.15s ease;
}

.cc-shell--platform .bp-switch input:checked + span {
  background: var(--bp-brand-accent);
}

.cc-shell--platform .bp-switch input:checked + span::after {
  transform: translateX(1rem);
}

.cc-shell--platform .bp-switch input:focus-visible + span {
  outline: 2px solid var(--bp-brand-accent);
  outline-offset: 2px;
}

.cc-shell--platform .bp-billing-providers__card:not([open]) .bp-billing-providers__body,
.cc-shell--platform .bp-billing-providers__card:not([open]) > form {
  display: none;
}

.cc-shell--platform .bp-billing-providers .bp-filter-bar {
  flex-direction: column;
  align-items: stretch;
  height: auto;
  align-self: start;
  margin: 0;
}

.cc-shell--platform .bp-billing-providers__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.25rem;
}

.cc-shell--platform .bp-billing-providers__info {
  margin-left: auto;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--bp-brand-accent);
  background: transparent;
  color: var(--bp-brand-accent);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.cc-shell--platform .bp-billing-providers__guide::backdrop {
  background: rgb(0 0 0 / 62%);
}

.cc-shell--platform .bp-billing-providers__guide {
  max-width: 28rem;
  background: var(--bp-platform-bg, #111);
  color: var(--bp-platform-text);
  border: 1px solid color-mix(in srgb, var(--bp-platform-text) 24%, transparent);
  border-radius: 0.75rem;
  padding: 1rem 1.15rem;
}

.cc-shell--platform .bp-billing-providers__guide h3 {
  margin: 0 0 0.6rem;
}

.cc-shell--platform .bp-billing-providers__guide ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.cc-shell--platform .bp-billing-providers__head strong {
  display: block;
  color: var(--bp-platform-text);
  font-size: 1rem;
  line-height: 1.2;
}

.cc-shell--platform .bp-billing-providers__head small {
  color: color-mix(in srgb, var(--bp-platform-text) 68%, transparent);
  font-size: 0.75rem;
}

.cc-shell--platform .bp-billing-providers__logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.cc-shell--platform #asignar .bp-filter-bar {
  align-items: flex-end;
  background: transparent;
  border: 0;
  padding: 0;
}

.cc-shell--platform #asignar .bp-filter-bar__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 14rem;
  min-width: 12rem;
}

.cc-shell--platform .cc-main .bp-filter-bar label {
  color: var(--bp-platform-text);
}

.cc-shell--platform .bp-select,
.cc-shell--platform .bp-input,
.cc-shell--platform .bp-textarea {
  background: color-mix(in srgb, var(--bp-platform-text) 8%, var(--bp-platform-bg));
  color: var(--bp-platform-text);
  border-color: color-mix(in srgb, var(--bp-platform-text) 28%, transparent);
}

.cc-shell--platform .bp-select option {
  background: var(--bp-platform-bg);
  color: var(--bp-platform-text);
}

.cc-shell--platform .card,
.cc-shell--tenant .card {
  background: var(--bp-gradient-card);
  color: var(--bp-platform-text);
  box-shadow: none;
  border: 1px solid var(--bp-border);
}

.cc-shell--platform a:not(.bp-btn):not(.cc-btn):not(.portal-btn):not(.btn-primary) {
  color: var(--bp-brand-accent);
}

.cc-shell--tenant a:not(.bp-btn):not(.cc-btn):not(.portal-btn):not(.btn-primary) {
  color: var(--tenant-secondary, #3b82f6);
}

/* Tenant CC shares Magro surfaces; Theme Engine paints accents only */

/* --- Identity banner --- */

.cc-identity-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  position: relative;
  background: var(--bp-black);
  color: var(--bp-white);
}

.cc-identity-banner::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--bp-gradient-cmyk-bar);
}

.cc-identity-banner--tenant::after {
  background: var(--tenant-secondary, var(--bp-cmyk-magenta));
}

.cc-identity-banner--platform,
.cc-identity-banner--tenant {
  border-bottom: none;
}

.cc-shell--auth .cc-identity-banner {
  display: none;
}

.cc-identity-banner__scope {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cc-identity-banner__separator {
  opacity: 0.7;
}

.cc-identity-banner__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-left: auto;
}

.cc-identity-banner__role {
  background: rgb(255 255 255 / 18%);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-weight: 600;
}

.cc-identity-banner__actor {
  font-weight: 600;
}

.cc-identity-banner__hint {
  opacity: 0.85;
  font-size: 0.78rem;
}

.cc-identity-banner__workspace {
  color: var(--bp-white);
  border-color: rgb(255 255 255 / 35%);
}

.cc-identity-banner .bp-role-preview__toggle {
  color: var(--bp-white);
  border-color: rgb(255 255 255 / 35%);
}

.cc-identity-banner .bp-role-preview__toggle:hover {
  background: rgb(255 255 255 / 12%);
}

@media (max-width: 640px) {
  .cc-identity-banner__actions {
    margin-left: 0;
    width: 100%;
  }
}

/* --- Header + nav --- */

.cc-header {
  padding: 1.25rem 1.5rem 1rem;
  margin-bottom: 0;
}

.cc-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}

.cc-subtitle {
  margin: 0;
  color: var(--bp-platform-text-muted);
  font-size: 0.95rem;
}

.cc-shell--platform .cc-subtitle,
.cc-shell--tenant .cc-subtitle {
  color: var(--bp-platform-text-muted);
}

.cc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 0.75rem;
}

.cc-nav a {
  text-decoration: none;
  font-size: 0.92rem;
}

.cc-nav a:hover {
  text-decoration: underline;
}

/* --- Tenant module-aware nav (FEAT-065.4) --- */

.cc-nav--tenant {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
}

.cc-nav-section {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  width: 100%;
}

.cc-nav-section__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bp-gray);
  min-width: 6.5rem;
}

.cc-shell--platform .cc-nav-section__label,
.cc-shell--tenant .cc-nav-section__label {
  color: var(--bp-gray);
}

.cc-nav-section__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

@media (max-width: 640px) {
  .cc-nav-section {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- Main content --- */

/* Main width/padding owned by layout.css (.bp-main-wrap .cc-main) */
.cc-main:has(.cc-widget-grid) {
  max-width: 1100px;
}

/* --- Dashboard widgets (FEAT-065.2) --- */

.cc-widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.cc-widget {
  background: var(--bp-gradient-card);
  border-radius: var(--bp-radius-lg);
  padding: 1.1rem 1.2rem 1.15rem;
  box-shadow: none;
  border: 1px solid var(--bp-border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform var(--bp-motion-normal) var(--bp-ease),
    box-shadow var(--bp-motion-normal) var(--bp-ease),
    border-color var(--bp-motion-normal) var(--bp-ease);
}

.cc-widget:hover {
  transform: translateY(-3px);
  box-shadow: var(--bp-shadow-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.cc-shell--platform .cc-widget,
.cc-shell--tenant .cc-widget {
  background: var(--bp-gradient-card);
  border-color: var(--bp-border);
  color: var(--bp-platform-text);
}

.cc-widget__title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bp-gray);
}

.cc-shell--platform .cc-widget__title,
.cc-shell--tenant .cc-widget__title {
  color: var(--bp-gray);
}

.cc-widget__value {
  margin: 0;
  font-size: 2.15rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: var(--bp-letter-display);
  font-variant-numeric: tabular-nums;
  color: var(--bp-white);
}

.cc-shell--platform .cc-widget__value,
.cc-shell--tenant .cc-widget__value {
  color: var(--bp-white);
}

.cc-widget__explanation {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--bp-platform-text-muted);
  flex-grow: 1;
}

.cc-shell--platform .cc-widget__explanation,
.cc-shell--tenant .cc-widget__explanation {
  color: var(--bp-platform-text-muted);
}

.cc-widget__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  margin-top: auto;
}

.cc-widget__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 2.4rem;
  text-decoration: none;
  text-align: center;
}

.cc-widget__detail {
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--bp-cmyk-cyan);
  align-self: flex-start;
  line-height: 1.3;
}

.cc-shell--platform .cc-widget__action.btn-primary {
  background: var(--bp-gradient-cta);
}

.cc-shell--tenant .cc-widget__action.btn-primary,
.cc-shell--tenant .cc-widget__action.btn-primary:link,
.cc-shell--tenant .cc-widget__action.btn-primary:visited,
.cc-shell--tenant .cc-widget__action.btn-primary:hover {
  background: var(--tenant-primary, var(--bp-gradient-cta));
  color: var(--tenant-on-primary, #fff);
  border-color: transparent;
  box-shadow: none;
}

.cc-shell--platform .cc-widget__detail,
.cc-shell--tenant .cc-widget__detail {
  color: var(--bp-cmyk-cyan);
}

.cc-widget--attention {
  border-color: rgba(246, 215, 107, 0.45);
  box-shadow: 0 0 0 1px rgba(246, 215, 107, 0.18);
}

.cc-shell--platform .cc-widget--attention,
.cc-shell--tenant .cc-widget--attention {
  border-color: rgba(246, 215, 107, 0.45);
  box-shadow: 0 0 0 1px rgba(246, 215, 107, 0.18);
}

.cc-widget--attention .cc-widget__value {
  color: var(--bp-cmyk-yellow);
}

.cc-shell--platform .cc-widget--attention .cc-widget__value,
.cc-shell--tenant .cc-widget--attention .cc-widget__value {
  color: var(--bp-cmyk-yellow);
}

.cc-widget--info {
  border-left: 3px solid var(--bp-cmyk-cyan);
}

.cc-widget--primary {
  grid-column: 1 / -1;
}

@media (min-width: 720px) {
  .cc-widget--primary {
    grid-column: span 2;
  }
}

.cc-widget-empty {
  color: #64748b;
  margin: 0;
}

/* --- Tenant/module management (FEAT-065.3) --- */

.cc-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.cc-page-header h2 {
  margin: 0;
}

.cc-page-header__action {
  text-decoration: none;
}

.cc-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.cc-mgmt-table {
  width: 100%;
}

.cc-table-scroll {
  overflow-x: auto;
}

.cc-mgmt-table--matrix th,
.cc-mgmt-table--matrix td {
  text-align: center;
  min-width: 3rem;
}

.cc-mgmt-table--matrix th:first-child,
.cc-mgmt-table--matrix td:first-child {
  text-align: left;
  min-width: 180px;
}

.cc-help-text {
  font-size: 0.85rem;
  color: #475569;
  margin: 0 0 0.75rem;
}

.cc-shell--platform .cc-help-text {
  color: #cbd5e1;
}

.cc-back-link {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.cc-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1rem;
}

.cc-inline-form label {
  font-size: 0.85rem;
}

.cc-inline-form select {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.cc-mgmt-form label {
  display: block;
  margin-top: 0.75rem;
}

.cc-mgmt-form input,
.cc-mgmt-form select {
  display: block;
  margin-bottom: 0.25rem;
}

.cc-link-button {
  background: none;
  border: none;
  color: var(--bp-cmyk-cyan);
  cursor: pointer;
  text-decoration: underline;
  font: inherit;
  padding: 0;
}

.cc-shell--platform .cc-link-button,
.cc-shell--tenant .cc-link-button {
  color: var(--bp-cmyk-cyan);
}

.status-pill--on {
  background: #dcfce7;
  color: #166534;
}

.status-pill--off {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill--active {
  background: #dcfce7;
  color: #166534;
}

.status-pill--staging {
  background: #fef3c7;
  color: #92400e;
}

.status-pill--future {
  background: #e2e8f0;
  color: #475569;
}

.status-pill--health-ok {
  background: #dcfce7;
  color: #166534;
}

.status-pill--health-attention {
  background: #fef3c7;
  color: #92400e;
}

.status-pill--health-blocked {
  background: #fee2e2;
  color: #991b1b;
}

.cc-flash-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.cc-flash {
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.cc-flash--success {
  background: #dcfce7;
  color: #166534;
}

.cc-flash--error {
  background: #fee2e2;
  color: #991b1b;
}

.cc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  font-size: 0.85rem;
}

.cc-legend li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cc-domain-boundary {
  background: rgba(230, 82, 151, 0.08);
  border-left: 4px solid var(--bp-cmyk-magenta);
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  border-radius: 0 6px 6px 0;
}

.cc-shell--platform .cc-domain-boundary {
  background: #1e293b;
  border-left-color: var(--bp-brand-accent);
}

.cc-domain-boundary--ticket {
  background: #fef3c7;
  border-left-color: #d97706;
}

.cc-shell--tenant .cc-domain-boundary--ticket {
  background: #fffbeb;
}

/* --- Ticket cockpit (FEAT-065.7) --- */

.cc-cockpit-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.cc-cockpit-header h2 {
  margin: 0.15rem 0 0;
}

.cc-cockpit-next-action {
  margin-bottom: 1rem;
  border-left: 4px solid #cbd5e1;
}

.cc-cockpit-next-action--active {
  border-left-color: var(--bp-cmyk-magenta);
  box-shadow: 0 0 0 1px rgb(230 82 151 / 15%);
}

.cc-cockpit-next-action h3 {
  margin-top: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.cc-cockpit-next-action__label {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.cc-cockpit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.cc-workflow-stepper {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cc-workflow-step {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 0.82rem;
  color: #475569;
}

.cc-workflow-step--complete {
  background: #dcfce7;
  color: #166534;
}

.cc-workflow-step--current {
  background: var(--bp-cmyk-magenta);
  color: #fff;
  font-weight: 600;
}

.cc-activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cc-activity-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.9rem;
}

.status-pill--priority-normal {
  background: #e2e8f0;
  color: #334155;
}

.status-pill--priority-attention {
  background: #fef3c7;
  color: #92400e;
}

.status-pill--priority-critical {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill--sla-ok {
  background: #dcfce7;
  color: #166534;
}

.status-pill--sla-due_soon {
  background: #fef3c7;
  color: #92400e;
}

.status-pill--sla-overdue {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill--sla-closed {
  background: #e2e8f0;
  color: #475569;
}

/* --- Workflow + approval UX (FEAT-065.8) --- */

.cc-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  margin-left: 0.35rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.status-pill--attention {
  background: #fef3c7;
  color: #92400e;
  margin-left: 0.35rem;
}

.status-pill--permission-read {
  background: #e2e8f0;
  color: #334155;
}

.status-pill--permission-write {
  background: #fef3c7;
  color: #92400e;
}

.status-pill--permission-destructive {
  background: #fee2e2;
  color: #991b1b;
}

/* --- MCP management UI (FEAT-065.10) --- */

.cc-domain-boundary--mcp {
  background: #f5f3ff;
  border-left: 4px solid #7c3aed;
}

.cc-mcp-permission-legend dt {
  margin-top: 0.35rem;
}

.cc-mcp-issue-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.cc-mcp-issue-form input[type="text"] {
  min-width: 220px;
}

.cc-mcp-token-reveal {
  border-left: 4px solid var(--bp-cmyk-magenta);
}

.cc-domain-boundary--approval {
  background: #fff7ed;
  border-left: 4px solid #ea580c;
}

.cc-approval-banner {
  padding: 1rem 1.1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 4px solid #ea580c;
  background: #fff7ed;
}

.cc-approval-banner--destructive {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.cc-approval-actions__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-secondary {
  background: #fff;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #f8fafc;
}

.cc-code-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem;
  overflow-x: auto;
  font-size: 0.85rem;
}

/* --- Tenant Harness guided config (FEAT-065.9) --- */

.cc-domain-boundary--harness {
  background: #f0f9ff;
  border-left: 4px solid #0284c7;
}

.cc-harness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.cc-harness-form--wide {
  grid-column: 1 / -1;
}

.cc-harness-form label {
  display: block;
  margin-bottom: 0.35rem;
}

.cc-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  font-weight: 500;
}

.cc-harness-advanced {
  margin-top: 0.5rem;
}

.cc-harness-advanced summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* --- Custom development UX (FEAT-065.11) --- */

.cc-custom-dev-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.cc-custom-dev-stat__value {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.25rem 0 0;
}

.cc-custom-dev-empty {
  text-align: center;
  padding: 1.5rem 1rem;
}

.cc-custom-dev-form .card {
  margin-bottom: 1rem;
}

.cc-level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.cc-level-card {
  display: block;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem;
  cursor: pointer;
}

.cc-level-card:has(input:checked) {
  border-color: var(--bp-cmyk-magenta);
  background: rgba(230, 82, 151, 0.08);
}

.cc-level-card input {
  margin-right: 0.35rem;
}

.cc-level-card__title {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.cc-level-card__summary,
.cc-level-card__scope {
  display: block;
  font-size: 0.88rem;
  color: #475569;
}

.cc-level-card--attention:has(input:checked) {
  border-color: #d97706;
  background: #fffbeb;
}

.cc-level-card--critical:has(input:checked) {
  border-color: #dc2626;
  background: #fef2f2;
}

.status-pill--level-1 {
  background: #e2e8f0;
  color: #334155;
}

.status-pill--level-2 {
  background: #fef3c7;
  color: #92400e;
}

.status-pill--level-3 {
  background: #fee2e2;
  color: #991b1b;
}

.cc-cockpit-reject {
  margin-top: 0.75rem;
}

/* --- Knowledge + audit readers (FEAT-065.12) --- */

.cc-domain-boundary--platform {
  background: #faf5ff;
  border-left: 4px solid #7c3aed;
}

.cc-knowledge-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cc-knowledge-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.cc-knowledge-list li:last-child {
  border-bottom: none;
}

.cc-knowledge-content {
  line-height: 1.6;
  white-space: pre-wrap;
}

.cc-audit-table code {
  font-size: 0.85rem;
}

/* --- Responsive + accessibility (FEAT-065.13) --- */

.cc-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 2000;
  padding: 0.65rem 1rem;
  background: var(--bp-graphite);
  color: var(--bp-white);
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  box-shadow: var(--bp-shadow-floating);
}

.cc-skip-link:focus,
.cc-skip-link:focus-visible {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  overflow: visible;
}

.cc-shell--platform .cc-skip-link:focus,
.cc-shell--platform .cc-skip-link:focus-visible {
  background: var(--bp-graphite);
  color: var(--bp-white);
  outline: 2px solid var(--bp-brand-highlight);
  outline-offset: 2px;
}

.cc-shell--tenant .cc-skip-link:focus,
.cc-shell--tenant .cc-skip-link:focus-visible {
  background: var(--bp-graphite);
  color: var(--bp-white);
  outline: 2px solid var(--tenant-focus, var(--tenant-secondary, #3b82f6));
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cc-shell a:focus-visible,
.cc-shell button:focus-visible,
.cc-shell input:focus-visible,
.cc-shell select:focus-visible,
.cc-shell textarea:focus-visible,
.cc-shell summary:focus-visible {
  outline: 2px solid var(--bp-brand-highlight);
  outline-offset: 2px;
}

.cc-shell--platform a:focus-visible,
.cc-shell--platform button:focus-visible,
.cc-shell--platform input:focus-visible,
.cc-shell--platform select:focus-visible,
.cc-shell--platform textarea:focus-visible,
.cc-shell--platform summary:focus-visible {
  outline-color: var(--bp-brand-highlight);
}

.cc-shell--tenant a:focus-visible,
.cc-shell--tenant button:focus-visible,
.cc-shell--tenant input:focus-visible,
.cc-shell--tenant select:focus-visible,
.cc-shell--tenant textarea:focus-visible,
.cc-shell--tenant summary:focus-visible {
  outline-color: var(--tenant-focus, var(--tenant-secondary, #3b82f6));
}


.cc-shell--tenant .cc-nav a:focus-visible,
.cc-shell--tenant .bp-sidebar a:focus-visible {
  outline: 2px solid var(--tenant-focus, var(--tenant-secondary, #3b82f6));
  outline-offset: 2px;
  border-radius: 4px;
}

.cc-shell--platform .cc-nav a:focus-visible,
.cc-shell--platform .bp-sidebar a:focus-visible {
  outline: 2px solid var(--bp-brand-highlight);
  outline-offset: 2px;
  border-radius: 4px;
}

.cc-shell .btn-primary:focus-visible,
.cc-shell--platform .btn-primary:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bp-brand-secondary) 35%, transparent);
}

.cc-flash-region {
  margin-bottom: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .cc-shell *,
  .cc-shell *::before,
  .cc-shell *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 640px) {
  .cc-header {
    padding: 1rem;
  }

  .cc-main {
    padding: 1rem;
  }

  .cc-page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cc-nav--scroll {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
  }

  .cc-nav--scroll a {
    flex-shrink: 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .cc-nav-section__items a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .cc-shell .btn-primary,
  .cc-shell a.btn-primary {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .cc-widget-grid {
    grid-template-columns: 1fr;
  }

  .cc-mgmt-table {
    font-size: 0.85rem;
  }
}

/* Magro industrial remaps — remaining light/blue chrome on CC shells */

.cc-shell--platform .cc-help-text,
.cc-shell--tenant .cc-help-text,
.cc-shell--platform .cc-widget-empty,
.cc-shell--tenant .cc-widget-empty {
  color: var(--bp-platform-text-muted);
}

.cc-shell--platform .cc-inline-form select,
.cc-shell--tenant .cc-inline-form select,
.cc-shell--platform .cc-mgmt-form input,
.cc-shell--tenant .cc-mgmt-form input,
.cc-shell--platform .cc-mgmt-form select,
.cc-shell--tenant .cc-mgmt-form select {
  background: var(--bp-anthracite);
  border-color: var(--bp-border-strong);
  color: var(--bp-white);
}

.cc-shell .status-pill--on,
.cc-shell .status-pill--active,
.cc-shell .status-pill--health-ok,
.cc-shell .status-pill--sla-ok {
  background: var(--bp-color-success-bg);
  color: var(--bp-color-success);
}

.cc-shell .status-pill--off,
.cc-shell .status-pill--health-blocked,
.cc-shell .status-pill--sla-overdue,
.cc-shell .status-pill--priority-critical,
.cc-shell .status-pill--level-3,
.cc-shell .status-pill--permission-destructive {
  background: var(--bp-color-error-bg);
  color: #fca5a5;
}

.cc-shell .status-pill--staging,
.cc-shell .status-pill--health-attention,
.cc-shell .status-pill--attention,
.cc-shell .status-pill--priority-attention,
.cc-shell .status-pill--sla-due_soon,
.cc-shell .status-pill--level-2,
.cc-shell .status-pill--permission-write {
  background: var(--bp-color-warning-bg);
  color: var(--bp-cmyk-yellow);
}

.cc-shell .status-pill--future,
.cc-shell .status-pill--priority-normal,
.cc-shell .status-pill--sla-closed,
.cc-shell .status-pill--level-1,
.cc-shell .status-pill--permission-read {
  background: var(--bp-color-neutral-bg);
  color: var(--bp-gray-light);
}

.cc-shell .cc-flash--success {
  background: var(--bp-color-success-bg);
  color: var(--bp-color-success);
}

.cc-shell .cc-flash--error {
  background: var(--bp-color-error-bg);
  color: #fca5a5;
}

.cc-shell .cc-domain-boundary,
.cc-shell .cc-mcp-token-reveal,
.cc-shell .cc-cockpit-next-action--active {
  background: rgba(0, 188, 212, 0.08);
  border-left-color: var(--bp-cmyk-cyan);
  color: var(--bp-platform-text);
}

.cc-shell .cc-domain-boundary--ticket,
.cc-shell .cc-domain-boundary--approval,
.cc-shell .cc-approval-banner {
  background: var(--bp-color-warning-bg);
  border-left-color: var(--bp-cmyk-yellow);
}

.cc-shell .cc-approval-banner--destructive {
  background: var(--bp-color-error-bg);
  border-left-color: var(--bp-color-error);
}

.cc-shell .cc-domain-boundary--mcp,
.cc-shell .cc-domain-boundary--platform {
  background: rgba(230, 82, 151, 0.1);
  border-left-color: var(--bp-cmyk-magenta);
}

.cc-shell .cc-domain-boundary--harness {
  background: var(--bp-color-info-bg);
  border-left-color: var(--bp-cmyk-cyan);
}

.cc-shell .cc-workflow-step {
  background: var(--bp-color-neutral-bg);
  color: var(--bp-gray-light);
}

.cc-shell .cc-workflow-step--complete {
  background: var(--bp-color-success-bg);
  color: var(--bp-color-success);
}

.cc-shell .cc-workflow-step--current {
  background: var(--bp-gradient-cta);
  color: var(--bp-white);
}

.cc-shell .cc-activity-list li,
.cc-shell .cc-knowledge-list li {
  border-bottom-color: var(--bp-border);
}

.cc-shell .btn-secondary {
  background: transparent;
  color: var(--bp-cmyk-yellow);
  border: 1px solid var(--bp-border-strong);
}

.cc-shell .btn-secondary:hover {
  background: rgba(246, 215, 107, 0.08);
}

.cc-shell .cc-code-block {
  background: var(--bp-black);
  border-color: var(--bp-border);
  color: var(--bp-gray-light);
}

.cc-shell .cc-level-card {
  border-color: var(--bp-border);
  background: var(--bp-graphite);
}

.cc-shell .cc-level-card:has(input:checked) {
  border-color: var(--bp-cmyk-magenta);
  background: rgba(230, 82, 151, 0.1);
}

.cc-shell .cc-level-card__summary,
.cc-shell .cc-level-card__scope {
  color: var(--bp-platform-text-muted);
}

.cc-shell .cc-cockpit-next-action h3 {
  color: var(--bp-gray);
}

.iam-perm-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

@media (min-width: 960px) {
  .iam-perm-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* IAM — effective permissions matrix (read-only switches) */
.bp-perm-matrix__toolbar {
  margin: 0 0 0.75rem;
}

.bp-perm-matrix__module {
  margin-bottom: 0.75rem;
}

.bp-perm-matrix__summary {
  font-weight: 600;
  text-transform: capitalize;
}

.bp-perm-matrix__table {
  margin-top: 0.5rem;
}

.bp-perm-matrix__col-switch {
  width: 7.5rem;
  white-space: nowrap;
}

.bp-perm-matrix__label {
  display: block;
  font-weight: 500;
}

.bp-perm-matrix__code {
  font-size: 0.75rem;
  opacity: 0.85;
}

.bp-perm-matrix__row--denied .bp-perm-matrix__label {
  opacity: 0.75;
}

.bp-perm-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: default;
  margin: 0;
}

.bp-perm-switch__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bp-perm-switch__track {
  flex-shrink: 0;
  width: 2.5rem;
  height: 1.35rem;
  background: #cbd5e1;
  border-radius: 999px;
  position: relative;
  transition: background 0.15s ease;
}

.bp-perm-switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.35rem - 4px);
  height: calc(1.35rem - 4px);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease;
}

.bp-perm-switch__input:checked + .bp-perm-switch__track {
  background: var(--tenant-primary, var(--bp-cmyk-cyan, #0099cc));
}

.bp-perm-switch__input:checked + .bp-perm-switch__track::after {
  transform: translateX(1.15rem);
}

.bp-perm-switch__input:disabled + .bp-perm-switch__track {
  opacity: 0.95;
}

.bp-perm-switch__input:not(:disabled) {
  cursor: pointer;
}

.bp-perm-switch__input:not(:disabled) + .bp-perm-switch__track {
  cursor: pointer;
}

.bp-perm-switch__text {
  font-size: 0.8125rem;
  font-weight: 600;
  min-width: 1.25rem;
}

.bp-perm-matrix__row--denied .bp-perm-switch__text {
  color: var(--bp-platform-text-muted, #64748b);
}

.cc-shell .bp-perm-switch__track {
  background: var(--bp-border, #475569);
}

.cc-shell .bp-perm-switch__input:checked + .bp-perm-switch__track {
  background: var(--tenant-primary, var(--bp-cmyk-magenta, #e65297));
}

