/* Enterprise growth and modernization layer */
:root {
  --enterprise-accent: var(--brand-accent, #2563eb);
  --enterprise-accent-dark: #1d4ed8;
  --enterprise-surface-soft: #f8fbff;
  --enterprise-gradient: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(14,165,233,0.08));
}

body.pw-admin-theme {
  --shell-bg: linear-gradient(180deg, #f3f7ff 0%, #f7f9fc 40%, #eef4fb 100%);
}

body.pw-admin-theme .page-hero,
body.pw-admin-theme .enterprise-hero {
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(244,248,255,0.96));
  border: 1px solid rgba(148,163,184,0.22);
  border-radius: 24px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 20px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
}

body.pw-admin-theme .enterprise-hero.as-single {
  grid-template-columns: 1fr;
}

body.pw-admin-theme .enterprise-stat-strip,
body.pw-admin-theme .workspace-stat-grid.enterprise-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

body.pw-admin-theme .enterprise-card,
body.pw-admin-theme .social-card,
body.pw-admin-theme .studio-card,
body.pw-admin-theme .board-card,
body.pw-admin-theme .module-card {
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

body.pw-admin-theme .social-grid,
body.pw-admin-theme .module-grid,
body.pw-admin-theme .board-grid,
body.pw-admin-theme .insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

body.pw-admin-theme .social-card {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

body.pw-admin-theme .social-card::after {
  content: '';
  position: absolute;
  inset: auto -10% -45% auto;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(37,99,235,0.18), transparent 70%);
}

body.pw-admin-theme .social-card-head,
body.pw-admin-theme .module-card-head,
body.pw-admin-theme .studio-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

body.pw-admin-theme .social-card-icon,
body.pw-admin-theme .module-card-icon,
body.pw-admin-theme .studio-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--enterprise-gradient);
  color: var(--enterprise-accent-dark);
  font-size: 1.15rem;
}

body.pw-admin-theme .link-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.pw-admin-theme .link-pill,
body.pw-admin-theme .mini-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1e3a8a;
  border: 1px solid rgba(59,130,246,0.14);
  font-size: 0.92rem;
  font-weight: 700;
}

body.pw-admin-theme .studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
}

body.pw-admin-theme .studio-card {
  padding: 20px;
}

body.pw-admin-theme .studio-preview {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(148,163,184,0.16);
}

body.pw-admin-theme .ad-preview-box {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(59,130,246,0.35);
  background: linear-gradient(180deg, #fdfefe, #eff6ff);
}

body.pw-admin-theme .ad-preview-box h3 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 1.15rem;
  font-weight: 800;
}

body.pw-admin-theme .ad-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 14px;
}

body.pw-admin-theme .ad-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.pw-admin-theme .progress-track {
  height: 10px;
  width: 100%;
  border-radius: 999px;
  background: #e5eefc;
  overflow: hidden;
}

body.pw-admin-theme .progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
}

body.pw-admin-theme .board-card {
  padding: 18px;
}

body.pw-admin-theme .board-card .board-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

body.pw-admin-theme .board-card .board-meta {
  color: #64748b;
  font-size: 0.88rem;
  margin-top: 6px;
}

body.pw-admin-theme .metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

body.pw-admin-theme .metric-tile {
  padding: 14px 16px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid rgba(148,163,184,0.14);
}

body.pw-admin-theme .metric-tile strong {
  display: block;
  font-size: 1.1rem;
  color: #0f172a;
}

body.pw-admin-theme .feature-timeline {
  display: grid;
  gap: 12px;
}

body.pw-admin-theme .feature-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(148,163,184,0.22);
}

body.pw-admin-theme .feature-timeline-item:last-child {
  border-bottom: none;
}

body.pw-admin-theme .feature-timeline-bullet {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--enterprise-gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--enterprise-accent-dark);
  flex: 0 0 34px;
}

body.pw-admin-theme .settings-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

body.pw-admin-theme .settings-link-card {
  display: block;
  text-decoration: none;
  padding: 16px;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid rgba(148,163,184,0.16);
  color: inherit;
}

body.pw-admin-theme .settings-link-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15,23,42,0.08);
}

body.pw-admin-theme .document-tab-row {
  overflow-x: auto;
  scrollbar-width: thin;
}

body.pw-admin-theme .document-sheet,
body.pw-admin-theme .report-sheet-pro,
body.pw-admin-theme .portal-result-sheet {
  box-shadow: 0 20px 52px rgba(15, 23, 42, 0.1);
}

body.pw-admin-theme.page-documents-center .card.no-print form,
body.pw-admin-theme.page-documents-center .document-tab-row {
  position: relative;
}

body.pw-admin-theme .external-link-note {
  font-size: 0.82rem;
  color: #64748b;
}

body.pw-admin-theme .hero-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

body.pw-admin-theme .hero-list-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

body.pw-admin-theme .hero-list-item i {
  margin-top: 3px;
  color: var(--enterprise-accent-dark);
}

@media (max-width: 1200px) {
  body.pw-admin-theme .page-hero,
  body.pw-admin-theme .enterprise-hero,
  body.pw-admin-theme .studio-layout {
    grid-template-columns: 1fr;
  }

  body.pw-admin-theme .enterprise-stat-strip,
  body.pw-admin-theme .workspace-stat-grid.enterprise-stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  body.pw-admin-theme .main-content,
  body.pw-admin-theme .main-content.content-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }

  body.pw-admin-theme .sidebar.main-sidebar,
  body.pw-admin-theme .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0;
    width: min(88vw, 340px) !important;
    max-width: 340px;
    transform: translateX(-104%);
    transition: transform .24s ease;
    z-index: 1050;
  }

  body.pw-admin-theme .sidebar.open {
    transform: translateX(0);
  }

  body.pw-admin-theme .pw-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .24s ease;
    z-index: 1040;
  }

  body.pw-admin-theme.sidebar-open .pw-sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  body.pw-admin-theme .page-content {
    padding: 16px 14px 28px !important;
  }

  body.pw-admin-theme .enterprise-stat-strip,
  body.pw-admin-theme .workspace-stat-grid.enterprise-stat-strip,
  body.pw-admin-theme .workspace-stat-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  body.pw-admin-theme .page-hero,
  body.pw-admin-theme .enterprise-hero,
  body.pw-admin-theme .studio-card,
  body.pw-admin-theme .board-card,
  body.pw-admin-theme .social-card,
  body.pw-admin-theme .card,
  body.pw-admin-theme .document-sheet {
    border-radius: 18px;
    padding: 16px;
  }

  body.pw-admin-theme .ad-preview-actions,
  body.pw-admin-theme .report-toolbar,
  body.pw-admin-theme .link-pills {
    flex-direction: column;
    align-items: stretch;
  }

  body.pw-admin-theme .document-tab {
    flex: 1 0 auto;
    min-width: 180px;
  }
}
