/* Workspace settings shell - ClickUp-style rail + sidebar + layered header */

body.mc-ws-shell-active .mc-chrome {
  display: none !important;
}

body.mc-ws-shell-active .mc-main {
  max-width: none;
  padding: 0;
  min-height: 100vh;
}

body.mc-ws-shell-active.mc-section-workspace-settings {
  background: var(--mc-ws-canvas-bg, #f4f5f7);
}

.mc-ws-shell {
  display: grid;
  grid-template-columns: 64px 248px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
}

.mc-ws-shell.mc-ws-shell--sidebar-collapsed {
  grid-template-columns: 64px 0 minmax(0, 1fr);
}

.mc-ws-shell__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 0;
  background: #202020;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 3;
}

html.mc-theme-night .mc-ws-shell__rail {
  background: #0c101c;
}

.mc-ws-shell__rail-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.mc-ws-shell__rail-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.mc-ws-shell__rail-btn.is-active {
  background: rgba(0, 48, 222, 0.22);
  color: #fff;
  box-shadow: inset 3px 0 0 #4d7cff;
}

.mc-ws-shell__rail-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
}

.mc-ws-shell__sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--mc-ws-sidebar-bg, #fff);
  border-right: 1px solid var(--mc-ws-border-subtle, rgba(20, 24, 36, 0.08));
  overflow: hidden;
  transition: width 0.2s ease, opacity 0.2s ease;
}

.mc-ws-shell__sidebar.is-collapsed {
  width: 0;
  opacity: 0;
  pointer-events: none;
  border: 0;
}

html.mc-theme-night .mc-ws-shell__sidebar {
  background: rgba(12, 16, 28, 0.96);
}

.mc-ws-shell__sidebar-head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(20, 24, 36, 0.06);
}

.mc-ws-shell__sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.mc-ws-shell__sidebar-title-text {
  font-size: 0.95rem;
  font-weight: 650;
}

.mc-ws-shell__sidebar-collapse {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.mc-ws-shell__sidebar-collapse:hover {
  background: rgba(0, 48, 222, 0.08);
}

.mc-ws-shell__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  color: var(--mc-ink-muted, rgba(20, 24, 36, 0.68));
  text-decoration: none;
  font-size: 0.82rem;
}

.mc-ws-shell__back:hover {
  background: rgba(0, 48, 222, 0.06);
  color: inherit;
}

.mc-ws-shell__sidebar-nav {
  flex: 1;
  overflow: auto;
  padding: 10px 10px 16px;
}

.mc-ws-shell__nav-label {
  margin: 10px 8px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mc-ink-muted, rgba(20, 24, 36, 0.55));
}

.mc-ws-shell__nav-group {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
}

.mc-ws-shell__nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.25;
}

.mc-ws-shell__nav-item:hover {
  background: rgba(20, 24, 36, 0.04);
}

.mc-ws-shell__nav-item.is-active {
  background: rgba(0, 48, 222, 0.08);
  color: #0030de;
  font-weight: 650;
}

.mc-ws-shell__nav-item-label {
  flex: 1;
  min-width: 0;
}

.mc-ws-shell__sidebar-foot {
  padding: 12px 14px;
  border-top: 1px solid rgba(20, 24, 36, 0.06);
}

.mc-ws-shell__user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mc-ws-shell__avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(0, 48, 222, 0.1);
  color: #0030de;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.mc-ws-shell__avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 0.68rem;
}

.mc-ws-shell__user-email {
  font-size: 0.78rem;
  color: var(--mc-ink-muted, rgba(20, 24, 36, 0.68));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-ws-shell__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background: var(--mc-ws-canvas-bg, #f4f5f7);
}

html.mc-theme-night .mc-ws-shell__main {
  background: rgba(8, 10, 18, 0.98);
}

.mc-ws-shell__header {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #fff;
  border-bottom: 1px solid rgba(20, 24, 36, 0.08);
}

html.mc-theme-night .mc-ws-shell__header {
  background: rgba(12, 16, 28, 0.98);
}

.mc-ws-shell__header-t1,
.mc-ws-shell__header-t2,
.mc-ws-shell__header-t3 {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  min-height: 38px;
}

.mc-ws-shell__header-t1 {
  border-bottom: 1px solid rgba(20, 24, 36, 0.05);
}

.mc-ws-shell__header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.mc-ws-shell__brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(0, 48, 222, 0.08);
}

.mc-ws-shell__workspace-name {
  font-size: 0.88rem;
  font-weight: 650;
}

.mc-ws-shell__header-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(20, 24, 36, 0.04);
  border: 1px solid rgba(20, 24, 36, 0.06);
  color: var(--mc-ink-muted, rgba(20, 24, 36, 0.55));
}

.mc-ws-shell__search-input {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  color: inherit;
  outline: none;
}

.mc-ws-shell__search-kbd {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(20, 24, 36, 0.06);
  color: var(--mc-ink-muted, rgba(20, 24, 36, 0.55));
}

.mc-ws-shell__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.mc-ws-shell__header-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.mc-ws-shell__header-btn:hover {
  background: rgba(20, 24, 36, 0.05);
}

.mc-ws-shell__header-user {
  text-decoration: none;
}

.mc-ws-shell__header-t2 {
  border-bottom: 1px solid rgba(20, 24, 36, 0.05);
}

.mc-ws-shell__header-t2-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.mc-ws-shell__breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.mc-ws-shell__crumb {
  color: var(--mc-ink-muted, rgba(20, 24, 36, 0.62));
  text-decoration: none;
}

.mc-ws-shell__crumb.is-current {
  color: inherit;
  font-weight: 650;
}

.mc-ws-shell__crumb-sep {
  color: var(--mc-ink-muted, rgba(20, 24, 36, 0.35));
}

.mc-ws-shell__view-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.mc-ws-shell__view-tab {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mc-ink-muted, rgba(20, 24, 36, 0.62));
  cursor: pointer;
}

.mc-ws-shell__view-tab.is-active {
  background: rgba(0, 48, 222, 0.08);
  color: #0030de;
}

.mc-ws-shell__header-t2-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mc-ws-shell__header-t3 {
  background: rgba(20, 24, 36, 0.02);
  min-height: 40px;
}

.mc-ws-shell__header-t3-left,
.mc-ws-shell__header-t3-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mc-ws-shell__header-t3-left {
  flex: 1;
  min-width: 0;
}

.mc-ws-shell__header-t3-right {
  margin-left: auto;
}

.mc-ws-shell__save-status {
  font-size: 0.78rem;
  color: #1a7f4b;
}

.mc-ws-shell__canvas {
  flex: 1;
  padding: 20px 24px 32px;
  overflow: auto;
}

.mc-ws-shell__page-intro {
  margin-bottom: 16px;
}

.mc-ws-shell__page-title {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  line-height: 1.2;
}

.mc-ws-shell__page-lead {
  margin: 8px 0 0;
  color: var(--mc-ink-muted, rgba(20, 24, 36, 0.68));
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 62ch;
}

.mc-ws-shell__content {
  min-width: 0;
}

/* Overview dashboard */
.mc-ws-overview {
  display: grid;
  gap: 16px;
}

.mc-ws-overview__kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mc-ws-overview__kpi {
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(20, 24, 36, 0.08);
}

.mc-ws-overview__kpi-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mc-ink-muted, rgba(20, 24, 36, 0.58));
}

.mc-ws-overview__kpi-value {
  margin: 8px 0 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.mc-ws-overview__modules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mc-ws-overview__module {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(20, 24, 36, 0.08);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mc-ws-overview__module:hover {
  border-color: rgba(0, 48, 222, 0.25);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.mc-ws-overview__module-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(0, 48, 222, 0.08);
  color: #0030de;
}

.mc-ws-overview__module-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.mc-ws-overview__module-lead {
  margin: 0;
  font-size: 0.82rem;
  color: var(--mc-ink-muted, rgba(20, 24, 36, 0.68));
  line-height: 1.45;
}

/* Demo inbox embedded in settings shell */
.mc-ws-shell .mc-demo-panel__tabs {
  display: none;
}

@media (max-width: 1100px) {
  .mc-ws-overview__kpis,
  .mc-ws-overview__modules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .mc-ws-shell {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .mc-ws-shell__sidebar {
    position: fixed;
    left: 56px;
    top: 0;
    bottom: 0;
    width: min(280px, calc(100vw - 56px));
    z-index: 5;
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.12);
  }

  .mc-ws-shell.mc-ws-shell--sidebar-collapsed .mc-ws-shell__sidebar {
    transform: translateX(-110%);
  }

  .mc-ws-overview__kpis,
  .mc-ws-overview__modules {
    grid-template-columns: 1fr;
  }

  .mc-ws-shell__header-search {
    display: none;
  }
}
