.renhel-operational-shell {
  --renhel-ui-primary: var(--rh-color-primary, var(--e-global-color-primary, var(--wp--preset--color--primary, #2563eb)));
  --renhel-ui-primary-strong: var(--rh-color-primary-light, var(--e-global-color-secondary, var(--wp--preset--color--secondary, #1d4ed8)));
  --renhel-ui-primary-contrast: var(--rh-color-bg-panel, var(--wp--preset--color--base, #ffffff));
  --renhel-ui-text: var(--rh-text-primary, var(--e-global-color-text, var(--wp--preset--color--contrast, #0f172a)));
  --renhel-ui-text-muted: var(--rh-text-secondary, var(--e-global-color-secondary, #64748b));
  --renhel-ui-text-soft: var(--rh-text-muted, #475569);
  --renhel-ui-surface: var(--rh-color-bg-panel, var(--wp--preset--color--base, #ffffff));
  --renhel-ui-surface-soft: var(--rh-color-surface-2, var(--wp--preset--color--base-2, #f8fafc));
  --renhel-ui-surface-hover: var(--rh-color-surface-3, #eff6ff);
  --renhel-ui-border: var(--rh-border-color, #dbe2ea);
  --renhel-ui-radius-sm: var(--rh-radius-sm, 8px);
  --renhel-ui-radius-md: var(--rh-radius-md, 12px);
  --renhel-ui-danger: var(--wp--preset--color--vivid-red, #dc2626);
  --renhel-ui-danger-strong: #b91c1c;
  --bs-primary: var(--renhel-ui-primary);
  --bs-link-color: var(--renhel-ui-primary);
  --bs-link-hover-color: var(--renhel-ui-primary-strong);
  --bs-border-color: var(--renhel-ui-border);
  --bs-body-color: var(--renhel-ui-text);
  --bs-body-bg: var(--renhel-ui-surface-soft);
  color-scheme: light;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  max-width: none;
  margin: 20px 0;
  box-sizing: border-box;
  color: var(--renhel-ui-text);
  font-family: var(--rh-font-sans, inherit);
}

.renhel-operational-shell[data-bs-theme="dark"],
.renhel-operational-shell .renhel-dashboard-section[data-bs-theme="dark"] {
  --bs-body-color: var(--renhel-ui-text);
  --bs-body-bg: var(--renhel-ui-surface-soft);
  --bs-emphasis-color: var(--renhel-ui-text);
  --bs-secondary-color: var(--renhel-ui-text-muted);
  --bs-secondary-bg: var(--renhel-ui-surface-soft);
  --bs-tertiary-bg: var(--renhel-ui-surface-soft);
  --bs-card-bg: var(--renhel-ui-surface);
  --bs-border-color: var(--renhel-ui-border);
  color-scheme: light;
}

.renhel-operational-shell .renhel-dashboard-section,
.renhel-operational-shell .renhel-dashboard-section [data-bs-theme] {
  --bs-body-color: var(--renhel-ui-text);
  --bs-body-bg: var(--renhel-ui-surface-soft);
  --bs-emphasis-color: var(--renhel-ui-text);
  --bs-secondary-color: var(--renhel-ui-text-muted);
  --bs-tertiary-color: var(--renhel-ui-text-muted);
  --bs-secondary-bg: var(--renhel-ui-surface-soft);
  --bs-tertiary-bg: var(--renhel-ui-surface-soft);
  --bs-card-bg: var(--renhel-ui-surface);
  --bs-card-color: var(--renhel-ui-text);
  --bs-card-cap-bg: var(--renhel-ui-surface);
  --bs-card-cap-color: var(--renhel-ui-text);
  --bs-border-color: var(--renhel-ui-border);
  color-scheme: light;
}

.renhel-operational-shell .renhel-dashboard-section .card:not(.bg-primary):not(.bg-secondary):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info):not(.bg-dark):not(.bg-black) {
  background-color: var(--renhel-ui-surface) !important;
  color: var(--renhel-ui-text);
  border-color: var(--renhel-ui-border) !important;
}

.renhel-operational-shell .renhel-dashboard-section .card-header,
.renhel-operational-shell .renhel-dashboard-section .card-footer {
  background-color: var(--renhel-ui-surface);
  color: var(--renhel-ui-text);
  border-color: var(--renhel-ui-border);
}

.renhel-operational-shell .renhel-dashboard-section .text-muted {
  color: var(--renhel-ui-text-muted) !important;
}

.renhel-operational-shell .renhel-dashboard-section .btn-primary {
  color: var(--renhel-ui-primary-contrast);
  background-color: var(--renhel-ui-primary);
  border-color: var(--renhel-ui-primary);
}

.renhel-operational-shell .renhel-dashboard-section .btn-primary:hover,
.renhel-operational-shell .renhel-dashboard-section .btn-primary:focus {
  color: var(--renhel-ui-primary-contrast);
  background-color: var(--renhel-ui-primary-strong);
  border-color: var(--renhel-ui-primary-strong);
}

.renhel-operational-shell .renhel-dashboard-section .btn-outline-primary {
  color: var(--renhel-ui-primary);
  border-color: var(--renhel-ui-primary);
}

.renhel-operational-shell .renhel-dashboard-section .btn-outline-primary:hover,
.renhel-operational-shell .renhel-dashboard-section .btn-outline-primary:focus {
  color: var(--renhel-ui-primary-strong);
  background-color: var(--renhel-ui-surface-hover);
  border-color: var(--renhel-ui-primary-strong);
}

.renhel-operational-shell .renhel-dashboard-section .table {
  --bs-table-color: var(--renhel-ui-text);
  --bs-table-bg: var(--renhel-ui-surface);
  --bs-table-border-color: var(--renhel-ui-border);
}

.renhel-operational-shell .renhel-dashboard-section .table-hover > tbody > tr:hover > * {
  --bs-table-accent-bg: var(--renhel-ui-surface-hover);
  color: var(--renhel-ui-text);
}

body.renhel-operational-active .modal-backdrop {
  --bs-backdrop-bg: #0f172a;
  --bs-backdrop-opacity: 0.62;
  position: fixed !important;
  inset: 0 !important;
  z-index: 1050 !important;
  display: block !important;
  background-color: var(--bs-backdrop-bg) !important;
  opacity: 0 !important;
}

body.renhel-operational-active .modal-backdrop.show {
  opacity: var(--bs-backdrop-opacity) !important;
}

body.renhel-operational-active .modal-backdrop.fade {
  opacity: 0 !important;
}

body.renhel-operational-active.modal-open::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(15, 23, 42, 0.62);
  pointer-events: none;
}

.renhel-sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--renhel-ui-border);
  border-radius: var(--renhel-ui-radius-md);
  background: var(--renhel-ui-surface);
}

.renhel-sidebar-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--renhel-ui-text);
  font-family: var(--rh-font-display, inherit);
}

.renhel-sidebar-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--renhel-ui-text-muted);
}

.renhel-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.renhel-sidebar-link {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--renhel-ui-border);
  border-radius: var(--renhel-ui-radius-sm);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--renhel-ui-text-soft);
  background: var(--renhel-ui-surface);
  transition: all 0.2s ease;
}

.renhel-sidebar-link:hover,
.renhel-sidebar-link:focus {
  color: var(--renhel-ui-primary);
  border-color: var(--renhel-ui-primary);
  background: var(--renhel-ui-surface-hover);
}

.renhel-sidebar-link.is-active {
  color: var(--renhel-ui-primary-contrast);
  border-color: var(--renhel-ui-primary);
  background: var(--renhel-ui-primary);
}

.renhel-sidebar-user {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.renhel-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--renhel-ui-border);
  border-radius: var(--renhel-ui-radius-sm);
  background: var(--renhel-ui-surface-soft);
}

.renhel-avatar-img {
  width: 40px !important;
  height: 40px !important;
  border-radius: 999px;
}

.renhel-user-info p {
  margin: 0;
  line-height: 1.35;
}

.renhel-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--renhel-ui-text);
}

.renhel-user-email {
  font-size: 11px;
  color: var(--renhel-ui-text-muted);
}

.renhel-content {
  padding: 18px;
  border: 1px solid var(--renhel-ui-border);
  border-radius: var(--renhel-ui-radius-md);
  background: var(--renhel-ui-surface-soft);
  box-sizing: border-box;
}

.renhel-dashboard-section {
  margin-top: 16px;
}

.renhel-dashboard-section h2 {
  margin: 0 0 14px;
  font-size: 24px;
  color: var(--renhel-ui-text);
  font-family: var(--rh-font-display, inherit);
}

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

.renhel-dashboard-card {
  display: flex;
  flex-direction: column;
  min-height: 150px;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--renhel-ui-border);
  border-radius: var(--renhel-ui-radius-sm);
  background: var(--renhel-ui-surface);
}

.renhel-card-icon {
  font-size: 20px;
}

.renhel-card-content h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--renhel-ui-text-soft);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.renhel-card-value {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: var(--renhel-ui-text);
}

.renhel-card-link {
  margin-top: auto;
  color: var(--renhel-ui-primary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.renhel-card-link:hover,
.renhel-card-link:focus {
  text-decoration: underline;
}

.renhel-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.renhel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--renhel-ui-radius-sm);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.renhel-btn-primary {
  color: var(--renhel-ui-primary-contrast);
  background: var(--renhel-ui-primary);
}

.renhel-btn-primary:hover,
.renhel-btn-primary:focus {
  color: var(--renhel-ui-primary-contrast);
  background: var(--renhel-ui-primary-strong);
}

.renhel-btn-secondary {
  color: var(--renhel-ui-primary);
  border-color: var(--renhel-ui-primary);
  background: var(--renhel-ui-surface);
}

.renhel-btn-secondary:hover,
.renhel-btn-secondary:focus {
  color: var(--renhel-ui-primary-strong);
  background: var(--renhel-ui-surface-hover);
}

.renhel-btn-danger {
  color: var(--renhel-ui-danger);
  border-color: var(--renhel-ui-danger);
  background: var(--renhel-ui-surface);
}

.renhel-btn-danger:hover,
.renhel-btn-danger:focus {
  color: var(--renhel-ui-danger-strong);
  background: var(--renhel-ui-surface-soft);
}

.renhel-empty-state,
.renhel-section-block {
  padding: 16px;
  border: 1px solid var(--renhel-ui-border);
  border-radius: var(--renhel-ui-radius-sm);
  background: var(--renhel-ui-surface);
}

.renhel-empty-state p {
  margin: 0;
  color: var(--renhel-ui-text-muted);
}

@media (max-width: 1200px) {
  .renhel-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .renhel-operational-shell {
    grid-template-columns: 1fr;
  }

  .renhel-sidebar {
    position: static;
  }

  .renhel-sidebar-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 782px) {
  .renhel-operational-shell {
    margin: 12px 0;
    gap: 12px;
  }

  .renhel-sidebar,
  .renhel-content {
    padding: 14px;
  }

  .renhel-cards-grid,
  .renhel-sidebar-nav {
    grid-template-columns: 1fr;
  }

  .renhel-quick-actions {
    flex-direction: column;
  }

  .renhel-btn {
    width: 100%;
  }
}
