/*
 * Red KetoVital · Professional epilepsy awareness theme
 *
 * This is the final visual layer for the application. Module styles keep their
 * layout and clinical status colors; this file owns brand, chrome and surfaces.
 */

body.se-epilepsy-app-theme {
  --ep-bg: #f8f7fc;
  --ep-surface: #ffffff;
  --ep-surface-soft: #f5f3ff;
  --ep-surface-raised: #faf8ff;
  --ep-text: #211334;
  --ep-muted: #5b4b78;
  --ep-primary: #6d28d9;
  --ep-primary-hover: #5b21b6;
  --ep-primary-deep: #2e1065;
  --ep-secondary: #7c3aed;
  --ep-accent: #a21caf;
  --ep-border: #e3dcf1;
  --ep-border-strong: #cfc2e8;
  --ep-focus: rgba(109, 40, 217, 0.22);
  --ep-shadow-sm: 0 8px 22px rgba(46, 16, 101, 0.07);
  --ep-shadow-md: 0 18px 44px rgba(46, 16, 101, 0.11);
  --ep-gradient: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
  --cenpi-bg: var(--ep-bg);
  --cenpi-surface: var(--ep-surface);
  --cenpi-surface-soft: var(--ep-surface-soft);
  --cenpi-text: var(--ep-text);
  --cenpi-text-muted: var(--ep-muted);
  --cenpi-primary: var(--ep-primary);
  --cenpi-primary-2: var(--ep-secondary);
  --cenpi-accent: var(--ep-accent);
  --cenpi-border: var(--ep-border);
  --cenpi-shadow: var(--ep-shadow-sm);
  min-height: 100vh;
  color: var(--ep-text);
  color-scheme: light;
  background:
    radial-gradient(circle at 8% -8%, rgba(109, 40, 217, 0.12), transparent 30rem),
    radial-gradient(circle at 96% 4%, rgba(162, 28, 175, 0.07), transparent 26rem),
    var(--ep-bg) !important;
}

body.se-epilepsy-app-theme,
body.se-epilepsy-app-theme button,
body.se-epilepsy-app-theme input,
body.se-epilepsy-app-theme select,
body.se-epilepsy-app-theme textarea {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.se-epilepsy-app-theme :is(h1, h2, h3, h4, h5, h6) {
  font-weight: 800;
  letter-spacing: -0.025em;
}

body.se-epilepsy-app-theme :is(label, th) {
  font-weight: 700;
}

body.se-epilepsy-app-theme :is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--ep-secondary) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--ep-focus) !important;
}

body.se-epilepsy-app-theme #mainContent:focus {
  outline: 0 !important;
  box-shadow: none !important;
}

body.se-epilepsy-app-theme .skip-link {
  position: fixed !important;
  z-index: 10050;
  top: 12px;
  left: 12px;
  width: auto !important;
  height: auto !important;
  padding: 10px 14px !important;
  overflow: visible !important;
  clip: auto !important;
  border: 2px solid #ffffff;
  border-radius: 10px;
  background: var(--ep-primary-deep);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform 0.18s ease;
}

body.se-epilepsy-app-theme .skip-link:focus {
  transform: translateY(0);
}

/* Application chrome */
body.app-shell.se-epilepsy-app-theme,
body.app-shell.se-epilepsy-app-theme .main-panel,
body.app-shell.se-epilepsy-app-theme .main-panel > .card,
body.app-shell.se-epilepsy-app-theme .main-panel .card.mb-12,
body.app-shell.se-epilepsy-app-theme main.content {
  color: var(--ep-text) !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(109, 40, 217, 0.08), transparent 28rem),
    var(--ep-bg) !important;
}

body.app-shell.se-epilepsy-app-theme .sidebar {
  border-right: 1px solid rgba(221, 214, 254, 0.22) !important;
  background: linear-gradient(180deg, #2e1065 0%, #4c1d95 54%, #3b0764 100%) !important;
  box-shadow: 14px 0 36px rgba(46, 16, 101, 0.18) !important;
}

body.app-shell.se-epilepsy-app-theme .sidebar .sidebar-background::after,
body.app-shell.se-epilepsy-app-theme .sidebar[data-image]::after,
body.app-shell.se-epilepsy-app-theme .sidebar.has-image::after {
  opacity: 0.98 !important;
  background:
    radial-gradient(circle at 18% 10%, rgba(167, 139, 250, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(46, 16, 101, 0.98), rgba(76, 29, 149, 0.98) 56%, rgba(59, 7, 100, 0.98)) !important;
}

body.app-shell.se-epilepsy-app-theme .sidebar .logo {
  margin: 12px 12px 8px !important;
  padding: 8px 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 12px 28px rgba(20, 4, 44, 0.18) !important;
  backdrop-filter: blur(10px);
}

body.app-shell.se-epilepsy-app-theme .sidebar .logo .navbar-brand {
  min-height: 112px !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.app-shell.se-epilepsy-app-theme .sidebar .logo img.sidebar-logo-img-neuroinfancia {
  width: 176px !important;
  max-width: 100% !important;
  filter: drop-shadow(0 8px 16px rgba(17, 5, 37, 0.24)) !important;
}

body.app-shell.se-epilepsy-app-theme .sidebar-program-label {
  display: grid;
  gap: 1px;
  margin: 0 2px;
  padding: 9px 6px 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  text-align: center;
}

body.app-shell.se-epilepsy-app-theme .sidebar-program-label strong {
  font-size: 0.78rem;
  font-weight: 800;
}

body.app-shell.se-epilepsy-app-theme .sidebar-program-label small {
  color: rgba(237, 233, 254, 0.78);
  font-size: 0.64rem;
  font-weight: 650;
}

body.sidebar-mini.app-shell.se-epilepsy-app-theme .sidebar-program-label,
.sidebar-mini body.app-shell.se-epilepsy-app-theme .sidebar-program-label {
  display: none;
}

body.app-shell.se-epilepsy-app-theme .sidebar .sidebar-wrapper {
  padding: 2px 10px 24px;
}

body.app-shell.se-epilepsy-app-theme .sidebar .nav-item .nav-link {
  min-height: 44px;
  margin: 4px 0 !important;
  border: 1px solid transparent !important;
  border-radius: 11px !important;
  color: rgba(245, 243, 255, 0.88) !important;
  font-weight: 650;
}

body.app-shell.se-epilepsy-app-theme .sidebar .nav i,
body.app-shell.se-epilepsy-app-theme .sidebar .nav i.material-icons,
body.app-shell.se-epilepsy-app-theme .sidebar .nav .material-symbols-outlined,
body.app-shell.se-epilepsy-app-theme .sidebar .nav p,
body.app-shell.se-epilepsy-app-theme .sidebar .sidebar-mini,
body.app-shell.se-epilepsy-app-theme .sidebar .sidebar-normal {
  color: inherit !important;
}

body.app-shell.se-epilepsy-app-theme .sidebar .nav-item .nav-link:hover,
body.app-shell.se-epilepsy-app-theme .sidebar .nav-item .nav-link:focus {
  border-color: rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

body.app-shell.se-epilepsy-app-theme .sidebar .nav-item.active > .nav-link,
body.app-shell.se-epilepsy-app-theme .sidebar .nav-item .nav .nav-item.active > .nav-link {
  border-color: rgba(255, 255, 255, 0.24) !important;
  background: linear-gradient(135deg, #6d28d9, #7c3aed) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(17, 5, 37, 0.28) !important;
}

body.app-shell.se-epilepsy-app-theme .navbar.navbar-transparent.navbar-absolute {
  border-bottom: 1px solid rgba(221, 214, 254, 0.22) !important;
  background: linear-gradient(100deg, rgba(46, 16, 101, 0.98), rgba(76, 29, 149, 0.96)) !important;
  box-shadow: 0 10px 26px rgba(46, 16, 101, 0.2) !important;
  backdrop-filter: blur(14px);
}

body.app-shell.se-epilepsy-app-theme .navbar .navbar-brand,
body.app-shell.se-epilepsy-app-theme .navbar .navbar-brand strong,
body.app-shell.se-epilepsy-app-theme .navbar .navbar-brand small,
body.app-shell.se-epilepsy-app-theme .navbar .app-screen-description,
body.app-shell.se-epilepsy-app-theme .navbar .nav-link,
body.app-shell.se-epilepsy-app-theme .navbar .dropdown-toggle {
  color: #ffffff !important;
}

body.app-shell.se-epilepsy-app-theme .navbar .app-screen-description {
  color: rgba(245, 243, 255, 0.76) !important;
}

body.app-shell.se-epilepsy-app-theme #minimizeSidebar.btn.btn-white,
body.app-shell.se-epilepsy-app-theme .app-mobile-nav-toggle,
body.app-shell.se-epilepsy-app-theme .app-user-menu-toggle {
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  background: rgba(255, 255, 255, 0.11) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

body.app-shell.se-epilepsy-app-theme #minimizeSidebar.btn.btn-white:hover,
body.app-shell.se-epilepsy-app-theme #minimizeSidebar.btn.btn-white:focus,
body.app-shell.se-epilepsy-app-theme .app-mobile-nav-toggle:hover,
body.app-shell.se-epilepsy-app-theme .app-user-menu-toggle:hover {
  border-color: rgba(255, 255, 255, 0.4) !important;
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

body.app-shell.se-epilepsy-app-theme .app-user-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  margin: 0;
  padding: 7px 10px !important;
  border-radius: 11px;
  cursor: pointer;
}

body.app-shell.se-epilepsy-app-theme .navbar .dropdown-menu {
  padding: 7px;
  border: 1px solid var(--ep-border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--ep-shadow-md);
}

body.app-shell.se-epilepsy-app-theme .navbar .dropdown-item {
  border-radius: 8px;
  color: var(--ep-text);
  font-weight: 700;
}

body.app-shell.se-epilepsy-app-theme .navbar .dropdown-item:hover,
body.app-shell.se-epilepsy-app-theme .navbar .dropdown-item:focus {
  background: var(--ep-surface-soft);
  color: var(--ep-primary-hover);
}

/* Shared controls, surfaces and content hierarchy */
body.se-epilepsy-app-theme .btn {
  border-radius: 10px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

body.app-shell.se-epilepsy-app-theme .btn:not(.btn-sm):not(.btn-just-icon),
body.public-standalone.se-epilepsy-app-theme .btn:not(.btn-sm) {
  min-height: 40px;
}

body.se-epilepsy-app-theme .btn.btn-primary,
body.se-epilepsy-app-theme .btn-primary,
body.se-epilepsy-app-theme button.btn-primary {
  border-color: var(--ep-primary) !important;
  background: var(--ep-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(109, 40, 217, 0.2) !important;
}

body.se-epilepsy-app-theme .btn.btn-primary:hover,
body.se-epilepsy-app-theme .btn.btn-primary:focus,
body.se-epilepsy-app-theme .btn-primary:hover,
body.se-epilepsy-app-theme .btn-primary:focus {
  border-color: var(--ep-primary-hover) !important;
  background: linear-gradient(135deg, #4c1d95, #6d28d9) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 26px rgba(91, 33, 182, 0.26) !important;
}

body.se-epilepsy-app-theme .btn.btn-outline-primary,
body.se-epilepsy-app-theme .btn-outline-primary {
  border-color: rgba(109, 40, 217, 0.44) !important;
  background: #ffffff !important;
  color: var(--ep-primary-hover) !important;
}

body.se-epilepsy-app-theme .btn.btn-outline-primary:hover,
body.se-epilepsy-app-theme .btn.btn-outline-primary:focus,
body.se-epilepsy-app-theme .btn-outline-primary:hover,
body.se-epilepsy-app-theme .btn-outline-primary:focus {
  border-color: var(--ep-primary) !important;
  background: var(--ep-surface-soft) !important;
  color: var(--ep-primary-deep) !important;
}

body.app-shell.se-epilepsy-app-theme :is(.form-control, input.form-control, select.form-control, textarea.form-control),
body.public-standalone.se-epilepsy-app-theme :is(.form-control, input.form-control, select.form-control, textarea.form-control) {
  border: 1px solid var(--ep-border-strong) !important;
  border-radius: 10px !important;
  background-color: #ffffff !important;
  background-image: none !important;
  color: var(--ep-text) !important;
  -webkit-text-fill-color: var(--ep-text) !important;
  box-shadow: none !important;
}

body.se-epilepsy-app-theme :is(.form-control, input.form-control, select.form-control, textarea.form-control)::placeholder {
  color: #8b7d9e !important;
  -webkit-text-fill-color: #8b7d9e !important;
  opacity: 1;
}

body.se-epilepsy-app-theme :is(.form-control, input.form-control, select.form-control, textarea.form-control):focus {
  border-color: var(--ep-primary) !important;
  background-color: #ffffff !important;
  color: var(--ep-text) !important;
  -webkit-text-fill-color: var(--ep-text) !important;
  box-shadow: 0 0 0 4px var(--ep-focus) !important;
}

body.se-epilepsy-app-theme select,
body.se-epilepsy-app-theme select.form-control,
body.se-epilepsy-app-theme select option {
  color-scheme: light;
}

body.se-epilepsy-app-theme select option {
  background: #ffffff !important;
  color: var(--ep-text) !important;
  -webkit-text-fill-color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme .card,
body.app-shell.se-epilepsy-app-theme .app-content-panel {
  border-color: var(--ep-border);
  border-radius: 14px;
  box-shadow: var(--ep-shadow-sm);
}

body.app-shell.se-epilepsy-app-theme .card .card-header.card-header-primary {
  border-radius: 12px !important;
  background: linear-gradient(120deg, #4c1d95, #6d28d9) !important;
  box-shadow: 0 10px 24px rgba(76, 29, 149, 0.2) !important;
}

body.app-shell.se-epilepsy-app-theme .modal-content {
  overflow: hidden;
  border: 1px solid var(--ep-border) !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  color: var(--ep-text) !important;
  box-shadow: 0 28px 70px rgba(32, 8, 64, 0.24) !important;
}

body.app-shell.se-epilepsy-app-theme .modal-header {
  border-top: 4px solid var(--ep-primary) !important;
  border-bottom: 1px solid var(--ep-border) !important;
  background: linear-gradient(135deg, #ffffff, var(--ep-surface-soft)) !important;
}

body.app-shell.se-epilepsy-app-theme .modal-footer {
  border-top: 1px solid var(--ep-border) !important;
  background: var(--ep-surface-raised) !important;
}

body.app-shell.se-epilepsy-app-theme .modal-title,
body.app-shell.se-epilepsy-app-theme .modal .close {
  color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme :is(
  #followupCaseModal,
  #followupVisitModal,
  #followupCloseModal,
  #followupPrintModal
) .se-modal-content .modal-header :is(.modal-title, .close) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
}

body.app-shell.se-epilepsy-app-theme table thead th {
  border-color: var(--ep-border) !important;
  color: var(--ep-primary-deep);
}

body.app-shell.se-epilepsy-app-theme table tbody td {
  border-color: #eee9f5 !important;
}

body.app-shell.se-epilepsy-app-theme input[type="checkbox"],
body.app-shell.se-epilepsy-app-theme input[type="radio"],
body.public-standalone.se-epilepsy-app-theme input[type="checkbox"],
body.public-standalone.se-epilepsy-app-theme input[type="radio"] {
  accent-color: var(--ep-primary);
}

/* Login and account recovery */
body.app-login.se-epilepsy-app-theme {
  background:
    radial-gradient(circle at 14% 12%, rgba(167, 139, 250, 0.42), transparent 29rem),
    radial-gradient(circle at 88% 82%, rgba(162, 28, 175, 0.18), transparent 27rem),
    linear-gradient(135deg, #f8f7fc 0%, #eee8fa 100%) !important;
}

body.app-login.se-epilepsy-app-theme .login-screen {
  min-height: 100vh;
  padding: 32px 20px;
}

body.app-login.se-epilepsy-app-theme .login-card {
  position: relative;
  overflow: hidden;
  max-width: 480px;
  padding: 34px 38px 32px;
  border: 1px solid rgba(109, 40, 217, 0.16) !important;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 28px 70px rgba(46, 16, 101, 0.16) !important;
  backdrop-filter: blur(16px);
  animation: none !important;
}

body.app-login.se-epilepsy-app-theme .login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, #4c1d95, #7c3aed 62%, #a21caf);
}

body.app-login.se-epilepsy-app-theme .login-brand-redketovital {
  margin-bottom: 24px;
}

body.app-login.se-epilepsy-app-theme .login-brand-project,
body.app-login.se-epilepsy-app-theme .login-brand-foundation {
  color: var(--ep-muted);
}

body.app-login.se-epilepsy-app-theme .login-brand-name {
  color: var(--ep-primary-deep);
}

body.app-login.se-epilepsy-app-theme .login-program-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 12px;
  padding: 5px 10px;
  border: 1px solid #ddd6fe;
  border-radius: 999px;
  background: var(--ep-surface-soft);
  color: var(--ep-primary-hover);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

body.app-login.se-epilepsy-app-theme .login-title {
  margin-bottom: 22px;
  color: var(--ep-primary-deep) !important;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
}

body.app-login.se-epilepsy-app-theme .login-help,
body.app-login.se-epilepsy-app-theme .login-version {
  color: var(--ep-muted);
}

body.app-login.se-epilepsy-app-theme .login-field label {
  color: #443357;
  font-weight: 700;
}

body.app-login.se-epilepsy-app-theme .login-field input {
  height: 48px;
  border: 1px solid var(--ep-border-strong) !important;
  border-radius: 11px;
  background: #ffffff !important;
  color: var(--ep-text) !important;
}

body.app-login.se-epilepsy-app-theme .login-field input:focus {
  border-color: var(--ep-primary) !important;
  box-shadow: 0 0 0 4px var(--ep-focus) !important;
}

body.app-login.se-epilepsy-app-theme .login-btn {
  height: 48px;
  border: 1px solid var(--ep-primary) !important;
  border-radius: 11px;
  background: var(--ep-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 26px rgba(109, 40, 217, 0.22) !important;
}

body.app-login.se-epilepsy-app-theme .login-btn:hover,
body.app-login.se-epilepsy-app-theme .login-btn:focus {
  background: linear-gradient(135deg, #4c1d95, #6d28d9) !important;
}

body.app-login.se-epilepsy-app-theme .login-extra a {
  color: var(--ep-primary-hover) !important;
  font-weight: 700;
}

body.app-login.se-epilepsy-app-theme .login-feedback .alert {
  border-radius: 10px;
  font-weight: 650;
}

/* Patient intake and clinical follow-up */
body.app-shell.se-epilepsy-app-theme .se-shell {
  --se-bg: var(--ep-bg);
  --se-surface: var(--ep-surface);
  --se-surface-soft: var(--ep-surface-soft);
  --se-text: var(--ep-text);
  --se-muted: var(--ep-muted);
  --se-primary: var(--ep-primary);
  --se-primary-strong: var(--ep-primary-hover);
  --se-border: var(--ep-border);
  color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme .se-shell::before {
  opacity: 0.72;
  background:
    radial-gradient(circle at 14% 4%, rgba(124, 58, 237, 0.12), transparent 30%),
    radial-gradient(circle at 88% 4%, rgba(162, 28, 175, 0.06), transparent 25%) !important;
}

body.app-shell.se-epilepsy-app-theme .se-hero {
  border: 1px solid var(--ep-border) !important;
  border-left: 6px solid var(--ep-primary) !important;
  border-radius: 16px !important;
  background:
    radial-gradient(circle at 94% 8%, rgba(196, 181, 253, 0.28), transparent 34%),
    linear-gradient(135deg, #ffffff, #faf7ff) !important;
  box-shadow: var(--ep-shadow-sm) !important;
}

body.app-shell.se-epilepsy-app-theme .se-hero h2,
body.app-shell.se-epilepsy-app-theme .se-hero h3,
body.app-shell.se-epilepsy-app-theme .se-hero strong {
  color: var(--ep-primary-deep) !important;
  text-shadow: none !important;
}

body.app-shell.se-epilepsy-app-theme .se-hero p,
body.app-shell.se-epilepsy-app-theme .se-hero .text-muted {
  color: var(--ep-muted) !important;
}

body.app-shell.se-epilepsy-app-theme .se-kicker,
body.app-shell.se-epilepsy-app-theme .se-followup-kicker,
body.app-shell.se-epilepsy-app-theme .se-form-section-title,
body.app-shell.se-epilepsy-app-theme .se-public-panel-title {
  color: var(--ep-primary) !important;
}

body.app-shell.se-epilepsy-app-theme :is(
  .se-card,
  .se-card .card-body,
  .se-cases-card,
  .se-cases-card .card-body,
  .se-summary-card,
  .se-summary-card .card-body,
  .se-data-table-wrap,
  .se-detail-card,
  .se-detail-card .card-body,
  .se-detail-panel,
  .se-detail-grid,
  .se-timeline-item,
  .se-timeline-detail-card,
  .se-visit-item,
  .se-workflow-card,
  .se-scale-card,
  .se-followup-context,
  .se-modal-content,
  .se-form-section,
  .se-anticonvulsant-card,
  .se-paraclinic-item,
  .se-side-effect-group,
  .se-check-list-item,
  .se-print-option
) {
  border-color: var(--ep-border) !important;
  background: #ffffff !important;
  color: var(--ep-text) !important;
  text-shadow: none !important;
  box-shadow: var(--ep-shadow-sm) !important;
}

body.app-shell.se-epilepsy-app-theme :is(
  .se-detail-grid,
  .se-timeline-detail-card,
  .se-followup-context,
  .se-form-section,
  .se-anticonvulsant-card,
  .se-paraclinic-item,
  .se-side-effect-group,
  .se-check-list-item,
  .se-print-option
) {
  background: var(--ep-surface-raised) !important;
  box-shadow: none !important;
}

body.app-shell.se-epilepsy-app-theme :is(
  .se-detail-top h4,
  #followupDetailTitle,
  .se-detail-grid strong,
  .se-detail-panel-head strong,
  .se-diagnosis-summary strong,
  .se-timeline-title strong,
  .se-timeline-summary,
  .se-timeline-detail-field strong,
  .se-visit-head strong,
  .se-workflow-card strong,
  .se-summary-card strong
) {
  color: var(--ep-text) !important;
  text-shadow: none !important;
  -webkit-text-fill-color: currentColor !important;
}

body.app-shell.se-epilepsy-app-theme :is(
  .se-detail-top .text-muted,
  #followupDetailSubtitle,
  .se-detail-card .text-muted,
  .se-detail-grid > [class*="col-"],
  .se-detail-grid > [class*="col-"] > div,
  .se-diagnosis-summary span,
  .se-diagnosis-summary li,
  .se-timeline-title small,
  .se-timeline-head time,
  .se-timeline-detail-field span,
  .se-visit-meta,
  .se-workflow-card p,
  .se-summary-label
) {
  color: var(--ep-muted) !important;
  text-shadow: none !important;
  -webkit-text-fill-color: currentColor !important;
}

body.app-shell.se-epilepsy-app-theme .se-module-nav,
body.app-shell.se-epilepsy-app-theme .se-filters-bar .form-group,
body.app-shell.se-epilepsy-app-theme .se-pagination-bar,
body.app-shell.se-epilepsy-app-theme .se-stepper {
  border-color: var(--ep-border) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: var(--ep-muted) !important;
  box-shadow: var(--ep-shadow-sm) !important;
}

body.app-shell.se-epilepsy-app-theme .se-module-tab,
body.app-shell.se-epilepsy-app-theme .se-stepper-item {
  border-color: transparent !important;
  background: transparent !important;
  color: var(--ep-muted) !important;
}

body.app-shell.se-epilepsy-app-theme .se-module-tab small {
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
}

body.app-shell.se-epilepsy-app-theme .se-module-tab:hover,
body.app-shell.se-epilepsy-app-theme .se-module-tab:focus,
body.app-shell.se-epilepsy-app-theme .se-module-tab.is-active,
body.app-shell.se-epilepsy-app-theme .se-stepper-item:hover,
body.app-shell.se-epilepsy-app-theme .se-stepper-item.is-active {
  border-color: #ddd6fe !important;
  background: var(--ep-surface-soft) !important;
  color: var(--ep-primary-hover) !important;
}

body.app-shell.se-epilepsy-app-theme .se-filters-bar label {
  color: #49385e !important;
}

body.app-shell.se-epilepsy-app-theme .se-filters-bar :is(.form-control, select.form-control, input.form-control),
body.app-shell.se-epilepsy-app-theme .se-modal-content :is(.form-control, select.form-control, textarea.form-control),
body.app-shell.se-epilepsy-app-theme .se-detail-card :is(.form-control, select.form-control, textarea.form-control) {
  border-color: var(--ep-border-strong) !important;
  background: #ffffff !important;
  color: var(--ep-text) !important;
  -webkit-text-fill-color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme .se-table-wrap,
body.app-shell.se-epilepsy-app-theme .se-table-wrap .table,
body.app-shell.se-epilepsy-app-theme .se-table-wrap .table thead,
body.app-shell.se-epilepsy-app-theme .se-table-wrap .table tbody {
  background: #ffffff !important;
}

body.app-shell.se-epilepsy-app-theme .se-table-wrap .table > thead > tr > th,
body.app-shell.se-epilepsy-app-theme .se-table-wrap .table thead tr th,
body.app-shell.se-epilepsy-app-theme .se-table-wrap .table thead th {
  border-color: var(--ep-border) !important;
  background: var(--ep-surface-soft) !important;
  color: var(--ep-primary-deep) !important;
}

body.app-shell.se-epilepsy-app-theme .se-table-wrap .table > tbody > tr,
body.app-shell.se-epilepsy-app-theme .se-table-wrap .table > tbody > tr > td,
body.app-shell.se-epilepsy-app-theme .se-table-wrap .table tbody tr,
body.app-shell.se-epilepsy-app-theme .se-table-wrap .table tbody td {
  border-color: #eee9f5 !important;
  background: #ffffff !important;
  color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme .se-table-wrap .table > tbody > tr:hover > td,
body.app-shell.se-epilepsy-app-theme .se-table-wrap .table tbody tr:hover td {
  background: #faf7ff !important;
}

body.app-shell.se-epilepsy-app-theme .se-detail-top,
body.app-shell.se-epilepsy-app-theme .se-detail-panel-head {
  border-color: var(--ep-border) !important;
}

body.app-shell.se-epilepsy-app-theme .se-detail-panel-close,
body.app-shell.se-epilepsy-app-theme .se-detail-card .btn-link {
  color: var(--ep-primary-hover) !important;
}

body.app-shell.se-epilepsy-app-theme .se-detail-toggle-btn,
body.app-shell.se-epilepsy-app-theme .se-detail-actions .btn-outline-primary,
body.app-shell.se-epilepsy-app-theme .se-detail-card .btn-outline-primary {
  border-color: rgba(109, 40, 217, 0.38) !important;
  background: #ffffff !important;
  color: var(--ep-primary-hover) !important;
}

body.app-shell.se-epilepsy-app-theme .se-detail-toggle-btn:hover,
body.app-shell.se-epilepsy-app-theme .se-detail-toggle-btn:focus,
body.app-shell.se-epilepsy-app-theme .se-detail-toggle-btn.is-active {
  border-color: var(--ep-primary) !important;
  background: var(--ep-surface-soft) !important;
  color: var(--ep-primary-deep) !important;
}

body.app-shell.se-epilepsy-app-theme .se-timeline-item::before,
body.app-shell.se-epilepsy-app-theme .se-timeline-item-patient::before {
  background: linear-gradient(180deg, var(--ep-primary), var(--ep-accent)) !important;
  opacity: 0.88;
}

body.app-shell.se-epilepsy-app-theme .se-timeline-dot,
body.app-shell.se-epilepsy-app-theme .se-timeline-detail-section::before {
  background: var(--ep-primary) !important;
  box-shadow: 0 0 0 4px var(--ep-focus) !important;
}

body.app-shell.se-epilepsy-app-theme .se-timeline-detail-section {
  color: var(--ep-muted) !important;
}

body.app-shell.se-epilepsy-app-theme .se-timeline-detail-field,
body.app-shell.se-epilepsy-app-theme .se-timeline-detail-note {
  border-color: var(--ep-border) !important;
  background: #ffffff !important;
  color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme .se-timeline-detail-field span {
  color: var(--ep-muted) !important;
  -webkit-text-fill-color: currentColor !important;
}

body.app-shell.se-epilepsy-app-theme .se-detail-actions .btn-outline-secondary {
  border-color: #6b5c85 !important;
  background: #ffffff !important;
  color: #49385e !important;
}

body.app-shell.se-epilepsy-app-theme .se-detail-actions .btn-outline-secondary:hover,
body.app-shell.se-epilepsy-app-theme .se-detail-actions .btn-outline-secondary:focus {
  border-color: #49385e !important;
  background: #49385e !important;
  color: #ffffff !important;
}

body.app-shell.se-epilepsy-app-theme .se-detail-actions .btn-outline-danger {
  border-color: #b42318 !important;
  background: #ffffff !important;
  color: #b42318 !important;
}

body.app-shell.se-epilepsy-app-theme .se-detail-actions .btn-outline-danger:hover,
body.app-shell.se-epilepsy-app-theme .se-detail-actions .btn-outline-danger:focus {
  border-color: #b42318 !important;
  background: #b42318 !important;
  color: #ffffff !important;
}

/* Scheduling */
body.app-shell.se-epilepsy-app-theme .rkv-scheduling-page {
  --rkv-primary: var(--ep-primary);
  --rkv-primary-2: var(--ep-secondary);
  --rkv-accent: var(--ep-accent);
  --rkv-surface: var(--ep-surface);
  --rkv-surface-soft: var(--ep-surface-soft);
  --rkv-border: var(--ep-border);
  --rkv-text: var(--ep-text);
  --rkv-muted: var(--ep-muted);
  --rkv-shadow: var(--ep-shadow-sm);
  color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme :is(
  .rkv-scheduling-hero,
  .rkv-scheduling-kpi,
  .rkv-scheduling-panel,
  .rkv-scheduling-filters,
  .rkv-scheduling-modal
) {
  border-color: var(--ep-border) !important;
  background: #ffffff !important;
  color: var(--ep-text) !important;
  box-shadow: var(--ep-shadow-sm) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-scheduling-hero {
  border-left: 6px solid var(--ep-primary) !important;
  border-radius: 16px !important;
  background:
    radial-gradient(circle at 94% 8%, rgba(196, 181, 253, 0.26), transparent 34%),
    linear-gradient(135deg, #ffffff, #faf7ff) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-scheduling-kpi-primary {
  border-color: transparent !important;
  background: var(--ep-gradient) !important;
  box-shadow: 0 14px 30px rgba(109, 40, 217, 0.2) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-scheduling-eyebrow,
body.app-shell.se-epilepsy-app-theme .rkv-scheduling-panel-head span {
  color: var(--ep-primary) !important;
}

body.app-shell.se-epilepsy-app-theme :is(
  .rkv-scheduling-hero h2,
  .rkv-scheduling-panel-head h3,
  .rkv-scheduling-kpi strong,
  .rkv-scheduling-table td strong,
  .rkv-scheduling-list-item strong,
  .rkv-scheduling-bar-label strong,
  .rkv-scheduling-modal .modal-title
) {
  color: var(--ep-text) !important;
  text-shadow: none !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-scheduling-kpi-primary :is(span, strong, small) {
  color: #ffffff !important;
}

body.app-shell.se-epilepsy-app-theme :is(
  .rkv-scheduling-hero p,
  .rkv-scheduling-kpi span,
  .rkv-scheduling-kpi small,
  .rkv-scheduling-panel-head small,
  .rkv-scheduling-table td,
  .rkv-scheduling-table td small,
  .rkv-scheduling-list-item small,
  .rkv-scheduling-list-item span,
  .rkv-scheduling-bar-label,
  .rkv-scheduling-empty
) {
  color: var(--ep-muted) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-scheduling-filters label,
body.app-shell.se-epilepsy-app-theme .rkv-scheduling-form-grid label {
  color: #49385e !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-scheduling-filters .form-control,
body.app-shell.se-epilepsy-app-theme .rkv-scheduling-form-grid .form-control,
body.app-shell.se-epilepsy-app-theme .rkv-scheduling-panel-head .form-control,
body.app-shell.se-epilepsy-app-theme .rkv-scheduling-modal .form-control {
  border-color: var(--ep-border-strong) !important;
  background: #ffffff !important;
  color: var(--ep-text) !important;
  -webkit-text-fill-color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-scheduling-filters .form-control option,
body.app-shell.se-epilepsy-app-theme .rkv-scheduling-form-grid .form-control option,
body.app-shell.se-epilepsy-app-theme .rkv-scheduling-panel-head .form-control option,
body.app-shell.se-epilepsy-app-theme .rkv-scheduling-modal .form-control option {
  background: #ffffff !important;
  color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme :is(
  .rkv-scheduling-list-item,
  .rkv-scheduling-empty,
  .rkv-suggest-box
) {
  border-color: var(--ep-border) !important;
  background: var(--ep-surface-raised) !important;
  color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-scheduling-table th {
  border-color: var(--ep-border) !important;
  background: var(--ep-surface-soft) !important;
  color: var(--ep-primary-deep) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-scheduling-table td {
  border-color: #eee9f5 !important;
  background: #ffffff !important;
  color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-scheduling-table tr:hover td,
body.app-shell.se-epilepsy-app-theme .rkv-suggest-item:hover,
body.app-shell.se-epilepsy-app-theme .rkv-suggest-item:focus {
  background: #faf7ff !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-suggest-item {
  border-color: var(--ep-border) !important;
  color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-suggest-item small {
  color: var(--ep-muted) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-scheduling-bar-track {
  background: #ece7f6 !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-scheduling-bar-track span {
  background: linear-gradient(90deg, var(--ep-primary), var(--ep-accent)) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-scheduling-modal .modal-header,
body.app-shell.se-epilepsy-app-theme .rkv-scheduling-modal .modal-footer {
  border-color: var(--ep-border) !important;
  background: linear-gradient(135deg, #ffffff, var(--ep-surface-soft)) !important;
}

/* Clinical indicators and reporting */
body.app-shell.se-epilepsy-app-theme .rkv-indicators-page {
  --rkv-primary: var(--ep-primary);
  --rkv-primary-strong: var(--ep-primary-hover);
  --rkv-accent: var(--ep-accent);
  --rkv-surface: var(--ep-surface);
  --rkv-surface-soft: var(--ep-surface-soft);
  --rkv-border: var(--ep-border);
  --rkv-text: var(--ep-text);
  --rkv-muted: var(--ep-muted);
  color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme :is(
  .rkv-dashboard-hero,
  .rkv-kpi-card,
  .rkv-panel,
  .rkv-executive-summary
) {
  border-color: var(--ep-border) !important;
  background: #ffffff !important;
  box-shadow: var(--ep-shadow-sm) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-dashboard-hero {
  border-left: 6px solid var(--ep-primary) !important;
  border-radius: 16px !important;
  background:
    radial-gradient(circle at 94% 8%, rgba(196, 181, 253, 0.28), transparent 34%),
    linear-gradient(135deg, #ffffff, #faf7ff) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-kpi-card-primary {
  border-color: transparent !important;
  background: var(--ep-gradient) !important;
  box-shadow: 0 14px 30px rgba(109, 40, 217, 0.2) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-dashboard-eyebrow,
body.app-shell.se-epilepsy-app-theme .rkv-panel-head span,
body.app-shell.se-epilepsy-app-theme .rkv-auto-refresh-status span,
body.app-shell.se-epilepsy-app-theme .rkv-executive-head > div > span {
  color: var(--ep-primary) !important;
}

body.app-shell.se-epilepsy-app-theme :is(
  .rkv-dashboard-hero h2,
  .rkv-panel-head h3,
  .rkv-kpi-card strong,
  .rkv-mini-section-title,
  .rkv-bar-label strong,
  .rkv-dashboard-table td strong,
  .rkv-signal strong,
  .rkv-list-item strong,
  .rkv-auto-refresh-status strong,
  .rkv-executive-head h3
) {
  color: var(--ep-text) !important;
  text-shadow: none !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-kpi-card-primary :is(span, strong, small) {
  color: #ffffff !important;
}

body.app-shell.se-epilepsy-app-theme :is(
  .rkv-dashboard-hero p,
  .rkv-kpi-card span,
  .rkv-kpi-card small,
  .rkv-panel-head small,
  .rkv-bar-label,
  .rkv-dashboard-table td,
  .rkv-dashboard-table td small,
  .rkv-list-item small,
  .rkv-list-item span,
  .rkv-signal span,
  .rkv-empty,
  .rkv-executive-head small
) {
  color: var(--ep-muted) !important;
}

body.app-shell.se-epilepsy-app-theme
  .rkv-kpi-card.rkv-kpi-card-primary
  > :is(span, strong, small) {
  color: #ffffff !important;
}

body.app-shell.se-epilepsy-app-theme :is(
  .rkv-mini-chart,
  .rkv-list-item,
  .rkv-signal,
  .rkv-auto-refresh-status,
  .rkv-empty
) {
  border-color: var(--ep-border) !important;
  background: var(--ep-surface-raised) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-dashboard-table th {
  border-color: var(--ep-border) !important;
  background: var(--ep-surface-soft) !important;
  color: var(--ep-primary-deep) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-dashboard-table td {
  border-color: #eee9f5 !important;
  background: #ffffff !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-bar-track {
  background: #ece7f6 !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-bar-track span,
body.app-shell.se-epilepsy-app-theme .rkv-mini-chart span {
  background: linear-gradient(180deg, var(--ep-secondary), var(--ep-primary-hover)) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-divider {
  background: var(--ep-border) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-report-nav {
  border-color: var(--ep-border) !important;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: var(--ep-shadow-sm);
}

body.app-shell.se-epilepsy-app-theme .rkv-report-nav a {
  color: var(--ep-muted) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-report-nav a:hover,
body.app-shell.se-epilepsy-app-theme .rkv-report-nav a:focus {
  background: var(--ep-surface-soft) !important;
  color: var(--ep-primary-hover) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-table-action {
  border-color: rgba(109, 40, 217, 0.32) !important;
  color: var(--ep-primary-hover) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-table-action:hover {
  background: var(--ep-surface-soft) !important;
  color: var(--ep-primary-deep) !important;
}

/* KDT calculator */
body.app-shell.se-epilepsy-app-theme .rkv-calc-page {
  --rkv-accent: var(--ep-primary);
  --rkv-accent-strong: var(--ep-primary-hover);
  --rkv-accent-soft: rgba(109, 40, 217, 0.1);
  --rkv-accent-border: rgba(109, 40, 217, 0.24);
  --rkv-accent-shadow: rgba(109, 40, 217, 0.2);
  --rkv-accent-gradient-end: var(--ep-secondary);
  --rkv-product: var(--ep-accent);
  --rkv-product-soft: rgba(162, 28, 175, 0.1);
  --rkv-product-border: rgba(162, 28, 175, 0.28);
  --rkv-field-bg: #ffffff;
  color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-calc-toolbar {
  border-color: var(--ep-border) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-calc-toolbar h2,
body.app-shell.se-epilepsy-app-theme .rkv-calc-summary-row strong,
body.app-shell.se-epilepsy-app-theme .rkv-metric strong,
body.app-shell.se-epilepsy-app-theme .rkv-breakdown dd {
  color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-calc-eyebrow,
body.app-shell.se-epilepsy-app-theme .rkv-calc-form legend,
body.app-shell.se-epilepsy-app-theme .rkv-breakdown h3 {
  color: var(--ep-primary-hover) !important;
}

body.app-shell.se-epilepsy-app-theme :is(
  .rkv-calc-toolbar p,
  .rkv-calc-summary-row span,
  .rkv-metric span,
  .rkv-metric small,
  .rkv-breakdown dt,
  .rkv-calc-field span,
  .rkv-calc-field small
) {
  color: var(--ep-muted) !important;
}

body.app-shell.se-epilepsy-app-theme :is(
  .rkv-calc-form,
  .rkv-calc-summary,
  .rkv-breakdown,
  .rkv-metric
) {
  border-color: var(--ep-border) !important;
  background: #ffffff !important;
  color: var(--ep-text) !important;
  box-shadow: var(--ep-shadow-sm) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-calc-field .form-control,
body.app-shell.se-epilepsy-app-theme .rkv-ratio-control button,
body.app-shell.se-epilepsy-app-theme .rkv-calc-summary-row,
body.app-shell.se-epilepsy-app-theme .rkv-breakdown dl > div,
body.app-shell.se-epilepsy-app-theme .rkv-summary-text {
  border-color: var(--ep-border-strong) !important;
  background: var(--ep-surface-raised) !important;
  color: var(--ep-text) !important;
  -webkit-text-fill-color: var(--ep-text) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-calc-field-readonly .form-control {
  border-color: #ddd6fe !important;
  background: var(--ep-surface-soft) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-calc-field .form-control:focus,
body.app-shell.se-epilepsy-app-theme .rkv-summary-text:focus {
  border-color: var(--ep-primary) !important;
  border-bottom-color: var(--ep-primary) !important;
  background: #ffffff !important;
  color: var(--ep-text) !important;
  -webkit-text-fill-color: var(--ep-text) !important;
  box-shadow: 0 0 0 3px var(--ep-focus) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-calc-field .form-control::placeholder,
body.app-shell.se-epilepsy-app-theme .rkv-summary-text::placeholder {
  color: var(--ep-muted) !important;
  -webkit-text-fill-color: var(--ep-muted) !important;
  opacity: 1;
}

body.app-shell.se-epilepsy-app-theme .rkv-calc-actions .btn.btn-outline-primary {
  border-color: var(--ep-primary) !important;
  background: #ffffff !important;
  color: var(--ep-primary-hover) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-calc-actions .btn.btn-outline-primary:hover,
body.app-shell.se-epilepsy-app-theme .rkv-calc-actions .btn.btn-outline-primary:focus {
  border-color: var(--ep-primary-hover) !important;
  background: var(--ep-primary-hover) !important;
  color: #ffffff !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-ratio-control button {
  color: var(--ep-muted) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-ratio-control button:hover,
body.app-shell.se-epilepsy-app-theme .rkv-ratio-control button:focus {
  border-color: var(--ep-primary) !important;
  background: var(--ep-surface-soft) !important;
  color: var(--ep-primary-hover) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-ratio-control button.is-active {
  border-color: var(--ep-primary) !important;
  background: var(--ep-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(109, 40, 217, 0.2) !important;
}

body.app-shell.se-epilepsy-app-theme .rkv-metric-total,
body.app-shell.se-epilepsy-app-theme .rkv-metric-product {
  border-color: #ddd6fe !important;
  background: linear-gradient(135deg, #ffffff, #faf7ff) !important;
}

/* Public surveys, registration and consent */
body.public-standalone.se-epilepsy-app-theme {
  background:
    radial-gradient(circle at 8% 0%, rgba(109, 40, 217, 0.12), transparent 28rem),
    radial-gradient(circle at 96% 18%, rgba(162, 28, 175, 0.07), transparent 24rem),
    var(--ep-bg) !important;
}

body.public-standalone.se-epilepsy-app-theme .se-public-shell,
body.public-standalone.se-epilepsy-app-theme .se-public-app-shell {
  --se-bg: var(--ep-bg);
  --se-surface: var(--ep-surface);
  --se-surface-soft: var(--ep-surface-soft);
  --se-text: var(--ep-text);
  --se-muted: var(--ep-muted);
  --se-primary: var(--ep-primary);
  --se-primary-strong: var(--ep-primary-hover);
  --se-border: var(--ep-border);
  color: var(--ep-text);
}

body.public-standalone.se-epilepsy-app-theme .se-public-hero,
body.public-standalone.se-epilepsy-app-theme .se-pre-registration-hero {
  border: 1px solid rgba(221, 214, 254, 0.28) !important;
  border-radius: 20px !important;
  background:
    radial-gradient(circle at 86% 12%, rgba(216, 180, 254, 0.22), transparent 30%),
    linear-gradient(135deg, #2e1065 0%, #5b21b6 62%, #7e22ce 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 20px 48px rgba(76, 29, 149, 0.22) !important;
}

body.public-standalone.se-epilepsy-app-theme .se-public-hero :is(h1, h2, h3, strong, .se-public-kicker),
body.public-standalone.se-epilepsy-app-theme .se-pre-registration-hero :is(h1, h2, h3, strong, .se-public-kicker) {
  color: #ffffff !important;
}

body.public-standalone.se-epilepsy-app-theme .se-public-hero :is(p, span, small),
body.public-standalone.se-epilepsy-app-theme .se-pre-registration-hero :is(p, span, small) {
  color: rgba(245, 243, 255, 0.86) !important;
}

body.public-standalone.se-epilepsy-app-theme .se-public-hero-chip,
body.public-standalone.se-epilepsy-app-theme .se-public-hero .se-public-case-item {
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

body.public-standalone.se-epilepsy-app-theme :is(
  .se-public-form-card,
  .se-public-form-card .card-body,
  .se-public-info-card,
  .se-public-tip-card,
  .se-public-panel,
  .se-public-consent-copy
) {
  border-color: var(--ep-border) !important;
  background: #ffffff !important;
  color: var(--ep-text) !important;
  box-shadow: var(--ep-shadow-sm) !important;
}

body.public-standalone.se-epilepsy-app-theme .se-public-tip-card {
  background:
    radial-gradient(circle at 94% 8%, rgba(196, 181, 253, 0.22), transparent 34%),
    linear-gradient(135deg, #ffffff, #faf7ff) !important;
}

body.public-standalone.se-epilepsy-app-theme .se-public-tip-title,
body.public-standalone.se-epilepsy-app-theme .se-public-panel-title,
body.public-standalone.se-epilepsy-app-theme .se-form-section-title {
  color: var(--ep-primary) !important;
}

body.public-standalone.se-epilepsy-app-theme .se-choice-group {
  border-color: var(--ep-border-strong) !important;
  background: var(--ep-surface-raised) !important;
}

body.public-standalone.se-epilepsy-app-theme .se-choice-btn {
  color: var(--ep-muted) !important;
}

body.public-standalone.se-epilepsy-app-theme .se-choice-btn + .se-choice-btn {
  border-color: var(--ep-border) !important;
}

body.public-standalone.se-epilepsy-app-theme .se-choice-btn:hover {
  background: var(--ep-surface-soft) !important;
  color: var(--ep-primary-hover) !important;
}

body.public-standalone.se-epilepsy-app-theme .se-choice-btn.is-active,
body.public-standalone.se-epilepsy-app-theme .se-choice-btn[aria-pressed="true"] {
  background: #e9ddff !important;
  color: var(--ep-primary-deep) !important;
  box-shadow: inset 0 0 0 1px rgba(109, 40, 217, 0.28) !important;
}

body.public-standalone.se-epilepsy-app-theme .se-public-check {
  border-color: var(--ep-border) !important;
  background: var(--ep-surface-raised) !important;
  color: var(--ep-text) !important;
}

body.public-standalone.se-epilepsy-app-theme .se-signature-pad {
  border-color: rgba(109, 40, 217, 0.5) !important;
  background: #ffffff !important;
}

body.public-standalone.se-epilepsy-app-theme .se-public-submit,
body.public-standalone.se-epilepsy-app-theme .se-public-submit-bar {
  border-color: var(--ep-border) !important;
  background: rgba(255, 255, 255, 0.96) !important;
}

body.public-standalone.se-epilepsy-app-theme .se-public-submit-bar {
  padding: 10px 14px !important;
  box-shadow: 0 -10px 28px rgba(46, 16, 101, 0.08);
}

body.public-standalone.se-epilepsy-app-theme .se-public-submit-bar .se-public-submit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 0;
  padding-top: 0;
  border-top: 0 !important;
}

body.public-standalone.se-epilepsy-app-theme .se-public-submit-bar .btn {
  width: auto;
  min-width: 156px;
  margin: 0;
}

body.public-standalone.se-epilepsy-app-theme .se-public-submit-copy strong {
  color: var(--ep-text) !important;
}

body.public-standalone.se-epilepsy-app-theme .se-public-submit-copy span,
body.public-standalone.se-epilepsy-app-theme .se-choice-help,
body.public-standalone.se-epilepsy-app-theme .form-text {
  color: var(--ep-muted) !important;
}

/* Responsive refinements */
@media (max-width: 991.98px) {
  body.app-shell.se-epilepsy-app-theme .navbar.navbar-transparent.navbar-absolute {
    min-height: 62px;
    background: linear-gradient(100deg, #2e1065, #4c1d95) !important;
  }

  body.app-shell.se-epilepsy-app-theme .app-user-menu {
    display: block !important;
    margin-left: auto !important;
  }

  body.app-shell.se-epilepsy-app-theme .app-user-menu-toggle {
    min-width: 42px;
    justify-content: center;
  }

  body.app-shell.se-epilepsy-app-theme main.content,
  body.app-shell.se-epilepsy-app-theme .main-panel > .content {
    padding: 22px 14px 30px !important;
  }

  body.app-shell.se-epilepsy-app-theme .sidebar {
    box-shadow: 18px 0 48px rgba(32, 8, 64, 0.34) !important;
  }

  body.app-shell.se-epilepsy-app-theme .rkv-report-nav {
    top: 74px;
  }
}

@media (max-width: 767.98px) {
  body.app-shell.se-epilepsy-app-theme :is(input, select, textarea, .form-control),
  body.public-standalone.se-epilepsy-app-theme :is(input, select, textarea, .form-control) {
    font-size: 16px !important;
  }

  body.app-login.se-epilepsy-app-theme .login-card {
    padding: 30px 22px 26px;
    border-radius: 18px;
  }

  body.public-standalone.se-epilepsy-app-theme .se-public-hero,
  body.public-standalone.se-epilepsy-app-theme .se-pre-registration-hero {
    border-radius: 16px !important;
  }
}

@media (max-width: 575.98px) {
  body.app-shell.se-epilepsy-app-theme .navbar .navbar-wrapper {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  body.app-shell.se-epilepsy-app-theme .navbar .navbar-brand {
    min-width: 0;
    max-width: 100%;
    margin-right: 4px !important;
    margin-left: 4px !important;
    overflow: hidden;
  }

  body.app-shell.se-epilepsy-app-theme .navbar .navbar-brand strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.app-shell.se-epilepsy-app-theme .rkv-report-nav {
    top: 70px;
  }

  body.public-standalone.se-epilepsy-app-theme .se-public-submit-bar {
    padding: 9px 11px !important;
  }

  body.public-standalone.se-epilepsy-app-theme .se-public-submit-bar .se-public-submit {
    grid-template-columns: minmax(0, 1fr) minmax(132px, 42%);
    gap: 9px;
  }

  body.public-standalone.se-epilepsy-app-theme .se-public-submit-bar .se-public-submit-copy {
    gap: 2px;
  }

  body.public-standalone.se-epilepsy-app-theme .se-public-submit-bar .se-public-submit-copy strong {
    font-size: 0.78rem;
  }

  body.public-standalone.se-epilepsy-app-theme .se-public-submit-bar .se-public-submit-copy span {
    font-size: 0.68rem;
    line-height: 1.3;
  }

  body.public-standalone.se-epilepsy-app-theme .se-public-submit-bar .btn {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
    font-size: 0.72rem;
  }
}

@media (max-width: 350px) {
  body.public-standalone.se-epilepsy-app-theme .se-public-submit-bar .se-public-submit {
    grid-template-columns: 1fr;
  }
}

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

@media print {
  body.se-epilepsy-app-theme,
  body.app-shell.se-epilepsy-app-theme .main-panel,
  body.app-shell.se-epilepsy-app-theme main.content {
    background: #ffffff !important;
    color: #111827 !important;
  }

  body.app-shell.se-epilepsy-app-theme :is(.card, .se-card, .rkv-panel, .rkv-kpi-card, .rkv-scheduling-panel) {
    border-color: #d1d5db !important;
    box-shadow: none !important;
  }
}
