/* ============================================================
   SaaS Admin Modernization Layer
   - global layout alignment fixes
   - premium sidebar + topbar polish
   - reusable surface / metric / hero classes
   - dashboard stat-card normalization
   ============================================================ */

:root {
  --shell-sidebar-width: 250px;
  --premium-sidebar-expanded: 250px;
  --premium-sidebar-collapsed: 84px;
  --shell-header-height: 76px;
  --shell-content-padding: 24px;
  --shell-gap: 24px;
  --shell-radius: 12px;
  --shell-radius-lg: 16px;
  --shell-shadow-soft: 0 2px 8px rgba(15, 23, 42, 0.08);
  --shell-shadow-medium: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shell-border: #e5e7eb;
  --shell-border-strong: #d7dee7;
  --shell-surface: #ffffff;
  --shell-surface-soft: #f8fafc;
  --shell-bg: #f3f6fb;
  --shell-text: #0f172a;
  --shell-text-soft: #475569;
  --shell-text-muted: #64748b;
  --shell-primary: #2563eb;
  --shell-primary-soft: #eff6ff;
  --shell-accent: #14b8a6;
  --shell-danger: #dc2626;
  --shell-danger-soft: #fef2f2;
}

body.pw-admin-theme {
  background: linear-gradient(180deg, #f8fbff 0%, var(--shell-bg) 240px) !important;
  color: var(--shell-text) !important;
  line-height: 1.5;
}

body.pw-admin-theme * {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
}

body.pw-admin-theme *::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body.pw-admin-theme *::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

body.pw-admin-theme .sidebar,
body.pw-admin-theme .sidebar.main-sidebar,
body.pw-admin-theme .pw-sidebar-shell {
  position: fixed !important;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--premium-sidebar-current, var(--premium-sidebar-expanded)) !important;
  min-width: var(--premium-sidebar-current, var(--premium-sidebar-expanded)) !important;
  max-width: var(--premium-sidebar-current, var(--premium-sidebar-expanded)) !important;
  background: linear-gradient(180deg, #0f172a 0%, #111827 50%, #172033 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 12px 0 32px rgba(15, 23, 42, 0.16);
  z-index: 1040;
}

body.pw-admin-theme .main-content,
body.pw-admin-theme .main-content.content-wrapper {
  margin-left: var(--premium-sidebar-current, var(--premium-sidebar-expanded)) !important;
  width: calc(100% - var(--premium-sidebar-current, var(--premium-sidebar-expanded))) !important;
  min-height: 100vh;
  overflow-x: clip;
  background: transparent !important;
  transition: margin-left 0.24s ease, width 0.24s ease;
}

body.pw-admin-theme .page-content {
  padding: var(--shell-content-padding) !important;
}

body.pw-admin-theme .page-content.space-y-5 > * + *,
body.pw-admin-theme .page-content.space-y-4 > * + * {
  margin-top: 0 !important;
}

body.pw-admin-theme .topbar,
body.pw-admin-theme .topbar.main-header,
body.pw-admin-theme .pw-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: rgba(255, 255, 255, 0.86) !important;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.pw-admin-theme .topbar-shell {
  min-height: var(--shell-header-height);
  padding: 16px 24px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

body.pw-admin-theme .topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

body.pw-admin-theme .topbar-context {
  min-width: 0;
}

body.pw-admin-theme .topbar-context-title {
  margin: 0;
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.45rem);
  line-height: 1.15;
  font-weight: 800;
  color: var(--shell-text);
  letter-spacing: -0.02em;
}

body.pw-admin-theme .topbar-context-subtitle {
  margin: 4px 0 0;
  font-size: 0.875rem;
  color: var(--shell-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(52vw, 680px);
}

body.pw-admin-theme .topbar-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

body.pw-admin-theme .topbar-icon-btn,
body.pw-admin-theme .topbar-user-btn,
body.pw-admin-theme .sidebar-inline-toggle {
  min-width: 42px;
  height: 42px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 12px;
  background: #ffffff;
  color: var(--shell-text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: none;
  transition: all 0.2s ease;
}

body.pw-admin-theme .topbar-icon-btn:hover,
body.pw-admin-theme .topbar-user-btn:hover,
body.pw-admin-theme .sidebar-inline-toggle:hover {
  transform: translateY(-1px);
  border-color: #bfdbfe;
  box-shadow: var(--shell-shadow-soft);
  color: var(--shell-primary);
}

body.pw-admin-theme .topbar-trigger {
  flex: 0 0 auto;
}

body.pw-admin-theme .topbar-trigger::after {
  display: none;
}

body.pw-admin-theme .topbar-notify,
body.pw-admin-theme .topbar-megaphone {
  position: relative;
}

body.pw-admin-theme .topbar-badge {
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  background: var(--shell-primary);
  color: #fff;
  border: 2px solid #fff;
}

body.pw-admin-theme .topbar-badge.topbar-badge-warning {
  background: #f59e0b;
}

body.pw-admin-theme .topbar-role-pill {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #dbe3ee;
  background: #fff;
  color: var(--shell-text-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

body.pw-admin-theme .topbar-user-btn {
  padding: 0 10px 0 8px;
}

body.pw-admin-theme .topbar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--shell-primary), #7c3aed);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
}

body.pw-admin-theme .topbar-user-name {
  font-size: 0.875rem;
  color: var(--shell-text);
  font-weight: 600;
}

body.pw-admin-theme .topbar-menu {
  min-width: 220px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

body.pw-admin-theme .topbar-menu-item {
  border-radius: 10px;
  transition: all 0.2s ease;
}

body.pw-admin-theme .topbar-menu-item:hover {
  background: var(--shell-surface-soft);
}

body.pw-admin-theme .pw-sidebar-brand-wrap {
  padding: 14px 14px 10px;
}

body.pw-admin-theme .pw-brand-link {
  min-height: 56px !important;
  padding: 10px 12px !important;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

body.pw-admin-theme .pw-brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

body.pw-admin-theme .pw-brand-copy strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.pw-admin-theme .pw-brand-copy small {
  margin-top: 2px;
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.pw-admin-theme .pw-sidebar-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.pw-admin-theme .sidebar-inline-toggle {
  flex: 0 0 auto;
  width: 38px;
  min-width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
}

body.pw-admin-theme .sidebar-inline-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
}

body.pw-admin-theme .sidebar-search-wrap {
  margin: 8px 12px 14px !important;
}

body.pw-admin-theme .sidebar-search-group {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

body.pw-admin-theme .form-control-sidebar {
  color: rgba(255, 255, 255, 0.92) !important;
}

body.pw-admin-theme .form-control-sidebar::placeholder {
  color: rgba(226, 232, 240, 0.56);
}

body.pw-admin-theme .pw-sidebar-shell .nav-header,
body.pw-admin-theme .pw-sidebar-shell .nav-section-title {
  padding: 8px 16px 6px;
  margin: 10px 0 2px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(226, 232, 240, 0.4);
}

body.pw-admin-theme .pw-sidebar-shell .nav-link,
body.pw-admin-theme .pw-sidebar-shell .nav-link-button,
body.pw-admin-theme .pw-sidebar-shell .pw-submenu-link {
  min-height: 44px;
  margin: 0 10px 6px !important;
  border-radius: 12px !important;
}

body.pw-admin-theme .pw-sidebar-shell .nav-link.active,
body.pw-admin-theme .pw-sidebar-shell .nav-link-button.active,
body.pw-admin-theme .pw-sidebar-shell .pw-submenu-link.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(20, 184, 166, 0.18)) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 20px rgba(15, 23, 42, 0.2);
}

body.pw-admin-theme .pw-sidebar-shell .nav-link:hover,
body.pw-admin-theme .pw-sidebar-shell .nav-link-button:hover,
body.pw-admin-theme .pw-sidebar-shell .pw-submenu-link:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

body.pw-admin-theme .pw-sidebar-shell .nav-icon {
  width: 18px;
  min-width: 18px;
}

body.pw-admin-theme .pw-sidebar-shell .pw-submenu-link {
  min-height: 38px;
  padding-left: 18px !important;
}

body.pw-admin-theme .pw-sidebar-shell .pw-submenu-bullet {
  box-shadow: none;
}

body.pw-admin-theme.sidebar-collapsed .pw-sidebar-shell .pw-brand-copy,
body.pw-admin-theme.sidebar-collapsed .pw-sidebar-shell .sidebar-search-wrap,
body.pw-admin-theme.sidebar-collapsed .pw-sidebar-shell .nav-header,
body.pw-admin-theme.sidebar-collapsed .pw-sidebar-shell .nav-group-arrow,
body.pw-admin-theme.sidebar-collapsed .pw-sidebar-shell .nav-treeview,
body.pw-admin-theme.sidebar-collapsed .pw-sidebar-shell .pw-submenu-link,
body.pw-admin-theme.sidebar-collapsed .pw-sidebar-shell .pw-submenu-bullet {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.pw-admin-theme .card,
body.pw-admin-theme .ep-card,
body.pw-admin-theme .workspace-panel,
body.pw-admin-theme .settings-panel,
body.pw-admin-theme .settings-toolbar,
body.pw-admin-theme .workspace-note,
body.pw-admin-theme .document-sheet,
body.pw-admin-theme .professional-id-card,
body.pw-admin-theme .surface-card {
  background: var(--shell-surface) !important;
  border: 1px solid var(--shell-border) !important;
  border-radius: var(--shell-radius) !important;
  box-shadow: var(--shell-shadow-soft) !important;
}

body.pw-admin-theme .card,
body.pw-admin-theme .ep-card,
body.pw-admin-theme .surface-card {
  padding: 24px;
}

body.pw-admin-theme .card-header,
body.pw-admin-theme .surface-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

body.pw-admin-theme .card-title,
body.pw-admin-theme .ep-card-title,
body.pw-admin-theme .surface-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--shell-text) !important;
}

body.pw-admin-theme .card-subtitle,
body.pw-admin-theme .surface-card__subtitle,
body.pw-admin-theme .hero-text,
body.pw-admin-theme .text-slate-500,
body.pw-admin-theme .text-slate-400 {
  color: var(--shell-text-muted) !important;
}

body.pw-admin-theme .page-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dfe8f2;
  border-radius: 16px;
  box-shadow: var(--shell-shadow-soft);
}

body.pw-admin-theme .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--shell-primary-soft);
  color: var(--shell-primary);
  font-size: 0.78rem;
  font-weight: 700;
}

body.pw-admin-theme .hero-title {
  margin: 14px 0 0;
  font-size: clamp(1.35rem, 1.15rem + 0.7vw, 1.8rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--shell-text);
  font-weight: 800;
}

body.pw-admin-theme .hero-text {
  margin: 12px 0 0;
  max-width: 760px;
  font-size: 0.97rem;
}

body.pw-admin-theme .hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

body.pw-admin-theme .btn {
  min-height: 42px;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.2s ease;
}

body.pw-admin-theme .btn-primary {
  background: var(--shell-primary);
  color: #fff;
}

body.pw-admin-theme .btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

body.pw-admin-theme .btn-outline {
  background: #fff;
  color: var(--shell-text-soft);
  border: 1px solid #d6e0ea;
}

body.pw-admin-theme .btn-outline:hover {
  background: var(--shell-surface-soft);
  border-color: #bfd0e4;
}

body.pw-admin-theme .btn-danger {
  background: var(--shell-danger);
}

body.pw-admin-theme .badge {
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 700;
}

body.pw-admin-theme .form-control,
body.pw-admin-theme .form-select,
body.pw-admin-theme input,
body.pw-admin-theme select,
body.pw-admin-theme textarea {
  min-height: 44px;
  border-radius: 10px !important;
  border: 1px solid var(--shell-border-strong) !important;
  transition: all 0.2s ease;
}

body.pw-admin-theme textarea {
  min-height: 110px;
}

body.pw-admin-theme .form-control:focus,
body.pw-admin-theme .form-select:focus,
body.pw-admin-theme input:focus,
body.pw-admin-theme select:focus,
body.pw-admin-theme textarea:focus {
  border-color: #93c5fd !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1) !important;
}

body.pw-admin-theme .data-table thead th,
body.pw-admin-theme table thead th {
  font-size: 0.75rem;
  color: var(--shell-text-muted) !important;
  background: #f8fafc !important;
}

body.pw-admin-theme .data-table tbody td,
body.pw-admin-theme table tbody td {
  vertical-align: middle;
}

body.pw-admin-theme .metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

body.pw-admin-theme .metric-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 152px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--shell-border);
  border-radius: 12px;
  box-shadow: var(--shell-shadow-soft);
  text-decoration: none !important;
}

body.pw-admin-theme .metric-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
  background: var(--metric-accent, var(--shell-primary));
}

body.pw-admin-theme .metric-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.pw-admin-theme .metric-card__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--shell-text-muted);
}

body.pw-admin-theme .metric-card__value {
  font-size: clamp(1.45rem, 1.25rem + 0.5vw, 2rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--shell-text);
}

body.pw-admin-theme .metric-card__subtext {
  font-size: 0.9rem;
  color: var(--shell-text-soft);
}

body.pw-admin-theme .metric-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--metric-accent, var(--shell-primary));
  background: color-mix(in srgb, var(--metric-accent, var(--shell-primary)) 12%, white);
}

body.pw-admin-theme .metric-card--danger {
  --metric-accent: #dc2626;
}

body.pw-admin-theme .metric-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  width: fit-content;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #b91c1c;
  background: var(--shell-danger-soft);
}

body.pw-admin-theme.page-dashboard .ep-header-section,
body.pw-admin-theme.page-executive-pro-dashboard .ep-header-section {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 20px;
  align-items: stretch;
}

body.pw-admin-theme .ep-greeting,
body.pw-admin-theme .ep-header-actions {
  background: #fff;
  border: 1px solid #dfe8f2;
  border-radius: 16px;
  box-shadow: var(--shell-shadow-soft);
  padding: 24px;
}

body.pw-admin-theme .ep-title {
  font-size: clamp(1.5rem, 1.25rem + 0.8vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--shell-text);
}

body.pw-admin-theme .ep-subtitle {
  font-size: 0.95rem;
  color: var(--shell-text-muted);
}

body.pw-admin-theme .ep-theme-pill {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--shell-primary-soft);
  color: var(--shell-primary);
  border: 0;
}

body.pw-admin-theme .ep-header-actions {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

body.pw-admin-theme .ep-ticker-wrapper {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  box-shadow: none !important;
}

body.pw-admin-theme .ep-header-status {
  align-self: flex-start;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

body.pw-admin-theme .ep-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 20px !important;
}

body.pw-admin-theme .ep-kpi-grid-item {
  display: flex;
}

body.pw-admin-theme .ep-kpi-card {
  position: relative;
  width: 100%;
  min-height: 154px;
  padding: 22px !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: var(--shell-text) !important;
  border: 1px solid var(--shell-border) !important;
  box-shadow: var(--shell-shadow-soft) !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

body.pw-admin-theme .ep-kpi-card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
  background: var(--kpi-accent, var(--shell-primary));
}

body.pw-admin-theme .ep-kpi-card.bg-ds-navy { --kpi-accent: #2563eb; }
body.pw-admin-theme .ep-kpi-card.bg-ds-teal { --kpi-accent: #0f766e; }
body.pw-admin-theme .ep-kpi-card.bg-ds-peach { --kpi-accent: #ea580c; }
body.pw-admin-theme .ep-kpi-card.bg-ds-rose { --kpi-accent: #db2777; }
body.pw-admin-theme .ep-kpi-card.bg-ds-maroon { --kpi-accent: #dc2626; }
body.pw-admin-theme .ep-kpi-card.bg-ds-purple { --kpi-accent: #7c3aed; }
body.pw-admin-theme .ep-kpi-card.bg-ds-tan { --kpi-accent: #a16207; }
body.pw-admin-theme .ep-kpi-card.bg-ds-cyan { --kpi-accent: #0891b2; }

body.pw-admin-theme .ep-kpi-label {
  font-size: 0.78rem !important;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--shell-text-muted) !important;
}

body.pw-admin-theme .ep-kpi-value {
  font-size: clamp(1.45rem, 1.2rem + 0.6vw, 2rem) !important;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--shell-text) !important;
}

body.pw-admin-theme .ep-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--kpi-accent, var(--shell-primary)) 12%, white);
  color: var(--kpi-accent, var(--shell-primary));
  font-size: 1rem;
}

body.pw-admin-theme .ep-kpi-critical,
body.pw-admin-theme .ep-kpi-grid-item-critical .ep-kpi-card {
  background: #fff !important;
}

body.pw-admin-theme .ep-kpi-grid-item-critical .ep-kpi-label,
body.pw-admin-theme .ep-kpi-grid-item-critical .ep-kpi-value {
  color: var(--shell-text) !important;
}

body.pw-admin-theme .ep-kpi-alert-dot {
  position: static;
  font-size: 0.8rem;
}

body.pw-admin-theme .ds-critical-badge,
body.pw-admin-theme .ep-mini-live {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  width: fit-content;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--shell-danger-soft);
  color: #b91c1c;
}

body.pw-admin-theme .module-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

body.pw-admin-theme .module-overview-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}

body.pw-admin-theme .module-overview-card__meta {
  font-size: 0.9rem;
  color: var(--shell-text-soft);
}

body.pw-admin-theme .module-overview-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

body.pw-admin-theme .status-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-height: 34px;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--shell-text-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

body.pw-admin-theme .alert {
  border-radius: 12px;
  border-width: 1px;
  box-shadow: none;
}

body.pw-admin-theme .w-full {
  width: 100%;
}

body.pw-admin-theme .hidden-mobile {
  display: block;
}

@media (max-width: 1399.98px) {
  body.pw-admin-theme .ep-kpi-grid,
  body.pw-admin-theme .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1199.98px) {
  body.pw-admin-theme.page-dashboard .ep-header-section,
  body.pw-admin-theme.page-executive-pro-dashboard .ep-header-section,
  body.pw-admin-theme .module-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991.98px) {
  body.pw-admin-theme .sidebar,
  body.pw-admin-theme .sidebar.main-sidebar,
  body.pw-admin-theme .pw-sidebar-shell {
    width: min(86vw, 320px) !important;
    min-width: min(86vw, 320px) !important;
    max-width: min(86vw, 320px) !important;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
  }

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

  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-mobile-open {
    overflow: hidden;
  }

  body.pw-admin-theme .topbar-shell {
    padding: 14px 18px !important;
    min-height: 72px;
  }

  body.pw-admin-theme .topbar-context-subtitle,
  body.pw-admin-theme .topbar-role-pill {
    display: none !important;
  }

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

  body.pw-admin-theme .page-hero {
    padding: 20px;
  }
}

@media (max-width: 767.98px) {
  body.pw-admin-theme .ep-kpi-grid,
  body.pw-admin-theme .metric-grid,
  body.pw-admin-theme .module-overview-grid {
    grid-template-columns: 1fr !important;
  }

  body.pw-admin-theme .topbar-shell,
  body.pw-admin-theme .page-content,
  body.pw-admin-theme .page-hero,
  body.pw-admin-theme .card,
  body.pw-admin-theme .ep-card,
  body.pw-admin-theme .surface-card,
  body.pw-admin-theme .ep-greeting,
  body.pw-admin-theme .ep-header-actions {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  body.pw-admin-theme .topbar-tools {
    gap: 8px;
  }

  body.pw-admin-theme .topbar-user-name,
  body.pw-admin-theme .topbar-user-caret,
  body.pw-admin-theme .hidden-mobile {
    display: none !important;
  }

  body.pw-admin-theme .hero-actions,
  body.pw-admin-theme .card-header {
    width: 100%;
    justify-content: flex-start;
  }

  body.pw-admin-theme .page-hero,
  body.pw-admin-theme .card-header {
    flex-direction: column;
  }

  body.pw-admin-theme .btn,
  body.pw-admin-theme .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
