/* Last-loaded platform skin: refined dark Apple-glass with ThreatHaven blue accents. */
:root {
  --glass-surface: rgba(18, 27, 42, 0.78);
  --glass-surface-strong: rgba(18, 27, 42, 0.9);
  --glass-surface-soft: rgba(255, 255, 255, 0.045);
  --glass-border: rgba(125, 211, 252, 0.16);
  --glass-border-strong: rgba(100, 200, 255, 0.32);
  --glass-highlight: linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 62%);
  --glass-shadow: 0 22px 48px rgba(4, 9, 18, 0.34);
  --control-bg: rgba(255, 255, 255, 0.05);
  --control-border: rgba(255, 255, 255, 0.1);
  --control-focus: rgba(100, 200, 255, 0.38);
  --blue-glow: 0 12px 30px rgba(78, 168, 222, 0.18);
  --text-muted: var(--muted);
  --text-soft: rgba(238, 242, 248, 0.82);
  --text-faint: rgba(238, 242, 248, 0.62);
}

body {
  background:
    radial-gradient(1000px 760px at 14% -10%, rgba(78, 168, 222, 0.22), transparent 58%),
    radial-gradient(820px 620px at 86% 4%, rgba(45, 212, 191, 0.13), transparent 58%),
    linear-gradient(135deg, #090e17, #101824 58%, #0a111d);
}

.sidebar,
.topbar,
.panel,
.metric-card,
.mini-card,
.setting-card,
.note-card,
.file-card,
.output-card,
.vault-item,
.vault-block,
.auth-card,
.otp-card,
.master-card,
.action-card,
.notification-dropdown,
.glass-toast-card,
.glass-prompt-card,
.modal-card,
.ad-login-card,
.ad-login-info,
.rotation-card,
.panel-solo,
.scan-progress,
.help-glass-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--glass-highlight), var(--glass-surface);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px);
}

.sidebar::before,
.topbar::before,
.panel::before,
.metric-card::before,
.mini-card::before,
.setting-card::before,
.note-card::before,
.file-card::before,
.output-card::before,
.vault-item::before,
.vault-block::before,
.auth-card::before,
.otp-card::before,
.master-card::before,
.action-card::before,
.notification-dropdown::before,
.glass-toast-card::before,
.glass-prompt-card::before,
.modal-card::before,
.ad-login-card::before,
.ad-login-info::before,
.rotation-card::before,
.panel-solo::before,
.scan-progress::before,
.help-glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(circle at 10% 0%, rgba(100, 200, 255, 0.1), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 55%);
}

.sidebar > *,
.topbar > *,
.panel > *,
.metric-card > *,
.mini-card > *,
.setting-card > *,
.note-card > *,
.file-card > *,
.output-card > *,
.vault-item > *,
.vault-block > *,
.auth-card > *,
.otp-card > *,
.master-card > *,
.action-card > *,
.notification-dropdown > *,
.glass-toast-card > *,
.glass-prompt-card > *,
.modal-card > *,
.ad-login-card > *,
.ad-login-info > *,
.rotation-card > *,
.panel-solo > *,
.scan-progress > *,
.help-glass-card > * {
  position: relative;
  z-index: 1;
}

.topbar {
  padding: 18px 20px;
  overflow: visible;
}

.sidebar {
  overflow-y: auto;
  overflow-x: hidden;
}

.notification-menu {
  position: relative;
  overflow: visible;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: min(520px, calc(100vh - 120px));
  overflow: hidden;
  z-index: 1000;
  background: #172233;
  border-color: rgba(125, 211, 252, 0.32);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.72);
  backdrop-filter: none !important;
  opacity: 1;
}

.notification-dropdown::before {
  display: none;
}

.notification-dropdown::after {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  border-left: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border);
  background: #172233;
}

.notification-dropdown-list {
  max-height: min(380px, calc(100vh - 240px));
  overflow: auto;
  background: #172233;
}

.notification-dropdown-header,
.notification-view-all {
  background: #172233 !important;
}

.notification-dropdown-empty {
  background: #202b3d !important;
}

.notification-dropdown-item {
  background: #202b3d !important;
  border-color: rgba(148, 163, 184, 0.22);
  opacity: 1;
}

.notification-dropdown-item:hover,
.notification-dropdown-item:focus-visible {
  background: #253349 !important;
}

.panel-header,
.notification-dropdown-header,
.notification-view-all,
.table th,
.table td {
  border-color: rgba(255, 255, 255, 0.08);
}

.ghost,
.button,
.solid,
.primary,
.btn-primary,
.auth-submit,
.otp-submit,
.master-submit,
.rotation-submit,
.glass-prompt-confirm,
.glass-prompt-cancel,
.glass-toast-close,
.select,
.tag,
.toggle,
.pill,
.profile,
.icon-button,
.notification-bell,
.sidebar-toggle,
.brand-mark,
.nav-badge,
.topbar-search,
.callout,
.chart,
.chart.compact,
.mini-bar,
.legend-item,
.code-block,
.form-status,
.auth-status,
.score-card,
.notification-dropdown-item,
.settings-grant-row,
.recovery-flow-item,
.recovery-summary-card,
.recovery-request-item,
.login-detail-card,
.detail-cell,
.login-activity-row,
.weak-password-list-shell,
.weak-password-row,
.breach-status-card,
.favorite-tile,
.login-bar-button,
.help-topic,
.help-topic-detail,
.assistant-message-bot,
.assistant-form,
.assistant-tags span,
.help-reference-grid > div {
  border-color: var(--control-border);
  background: var(--control-bg);
  color: var(--text);
}

.ghost,
.button,
.solid,
.primary,
.btn-primary,
.auth-submit,
.otp-submit,
.master-submit,
.rotation-submit,
.glass-prompt-confirm {
  border-radius: 999px;
}

.solid,
.primary,
.btn-primary,
.auth-submit,
.otp-submit,
.master-submit,
.rotation-submit,
.glass-prompt-confirm {
  border: 1px solid rgba(100, 200, 255, 0.34);
  background: linear-gradient(135deg, rgba(78, 168, 222, 0.95), rgba(45, 212, 191, 0.82));
  color: #061320;
  box-shadow: var(--blue-glow);
}

.ghost:hover,
.ghost:focus-visible,
.button:hover,
.button:focus-visible,
.solid:hover,
.solid:focus-visible,
.primary:hover,
.primary:focus-visible,
.btn-primary:hover,
.btn-primary:focus-visible,
.icon-button:hover,
.icon-button:focus-visible,
.profile:hover,
.profile:focus-visible,
.notification-dropdown-item:hover,
.notification-dropdown-item:focus-visible,
.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active,
.favorite-tile:hover,
.login-bar-button:hover,
.login-bar-button.is-active {
  border-color: var(--glass-border-strong);
  background: rgba(100, 200, 255, 0.13);
  box-shadow: var(--blue-glow);
}

.field input,
.field select,
.field textarea,
.auth-field input,
.ad-login-form .field input,
.rotation-form .field input,
.settings-session-policy input[type="number"],
.glass-prompt-fields input,
.glass-prompt-fields select,
.glass-prompt-fields textarea,
.topbar-search input {
  border-radius: 14px;
  border: 1px solid var(--control-border);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.auth-field input:focus,
.ad-login-form .field input:focus,
.rotation-form .field input:focus,
.settings-session-policy input[type="number"]:focus,
.glass-prompt-fields input:focus,
.glass-prompt-fields select:focus,
.glass-prompt-fields textarea:focus {
  outline: none;
  border-color: var(--control-focus);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 0 0 3px rgba(78, 168, 222, 0.12);
}

.field input::placeholder,
.field textarea::placeholder,
.auth-field input::placeholder,
.topbar-search input::placeholder {
  color: rgba(238, 242, 248, 0.36);
}

.modal-overlay,
.glass-toast-overlay,
.glass-prompt-overlay,
.master-overlay {
  backdrop-filter: blur(18px);
  background:
    radial-gradient(900px 700px at 15% 20%, rgba(78, 168, 222, 0.2), transparent 60%),
    radial-gradient(700px 600px at 85% 70%, rgba(45, 212, 191, 0.14), transparent 65%),
    rgba(7, 10, 20, 0.68);
}

body[data-theme="alt"] {
  --glass-surface: rgba(248, 251, 255, 0.84);
  --glass-surface-strong: rgba(248, 251, 255, 0.94);
  --glass-surface-soft: rgba(241, 246, 253, 0.82);
  --glass-border: rgba(47, 120, 196, 0.2);
  --glass-border-strong: rgba(47, 120, 196, 0.38);
  --glass-highlight: linear-gradient(135deg, rgba(255, 255, 255, 0.78), transparent 62%);
  --glass-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
  --control-bg: rgba(241, 246, 253, 0.82);
  --control-border: rgba(148, 163, 184, 0.36);
  --control-focus: rgba(47, 120, 196, 0.42);
  --blue-glow: 0 12px 26px rgba(47, 120, 196, 0.14);
  --text-muted: var(--muted);
  --text-soft: #1f2a44;
  --text-faint: #5c6c86;
}

body[data-theme="alt"] .field input,
body[data-theme="alt"] .field select,
body[data-theme="alt"] .field textarea,
body[data-theme="alt"] .auth-field input,
body[data-theme="alt"] .ad-login-form .field input,
body[data-theme="alt"] .rotation-form .field input,
body[data-theme="alt"] .settings-session-policy input[type="number"] {
  background: rgba(248, 251, 255, 0.86);
  color: #0f172a;
}

/* Contrast guardrails: keep text, icons, and form controls readable after page overrides. */
.topbar,
.panel,
.metric-card,
.mini-card,
.setting-card,
.note-card,
.file-card,
.output-card,
.vault-item,
.vault-block,
.auth-card,
.otp-card,
.master-card,
.action-card,
.modal-card,
.glass-toast-card,
.glass-prompt-card,
.notification-dropdown,
.sidebar {
  color: var(--text);
}

h1,
h2,
h3,
h4,
.panel h2,
.metric-value,
.setting-title,
.list-title,
.favorite-title,
.favorite-label,
.alert-title,
.data-value,
.breach-title,
.login-detail-date,
.detail-cell strong,
.profile-name,
.brand-name,
.nav-link.active,
.assistant-title-wrap h2 {
  color: var(--text);
}

p,
label,
.field label,
.auth-field label,
.metric-header,
.metric-meta,
.page-subtitle,
.muted,
.profile-sub,
.list-meta,
.favorite-sub,
.alert-meta,
.breach-meta,
.breach-status-label,
.breach-status-meta,
.breach-last-scan,
.weak-password-heading,
.weak-password-sub,
.bar-note,
.bar-group-label,
.login-bar-value,
.login-detail-meta,
.login-activity-meta,
.help-reference-grid p,
.assistant-tags span,
.notification-dropdown-meta,
.setting-desc,
.code-label,
.mini-label,
.risk-band-label,
.risk-y-axis,
.risk-x-axis,
.chart-labels,
.donut-label {
  color: var(--text-muted);
}

.eyebrow,
.nav-section-toggle,
.nav-badge,
.assistant-message-bot,
.callout,
.form-status,
.auth-status {
  color: var(--text-soft);
}

a,
button,
input,
select,
textarea {
  font-family: inherit;
}

a:not(.nav-link):not(.brand):not(.profile):not(.notification-dropdown-item) {
  color: #7dd3fc;
}

button,
.ghost,
.button,
.icon-button,
.notification-bell,
.sidebar-toggle,
.glass-toast-close,
.glass-prompt-cancel,
.select,
.tag,
.toggle,
.pill {
  color: var(--text);
}

.solid,
.primary,
.btn-primary,
.auth-submit,
.otp-submit,
.master-submit,
.rotation-submit,
.glass-prompt-confirm {
  color: #061320;
}

.solid svg,
.primary svg,
.btn-primary svg,
.auth-submit svg,
.otp-submit svg,
.master-submit svg,
.rotation-submit svg,
.glass-prompt-confirm svg {
  color: #061320;
  stroke: currentColor;
}

svg {
  color: currentColor;
}

button svg,
.icon-button svg,
.notification-bell svg,
.nav-icon svg,
.metric-icon svg,
.list-icon svg,
.action-icon svg,
.dashboard-icon svg,
.assistant-send svg,
.assistant-orb svg {
  stroke: currentColor;
}

.icon-button,
.notification-bell,
.sidebar-toggle,
.brand-mark,
.metric-icon,
.list-icon,
.action-icon,
.dashboard-icon,
.assistant-orb {
  color: #7dd3fc;
}

.metric-icon.warning,
.list-icon.warning,
.pill.warning {
  color: var(--warning);
}

.metric-icon.danger,
.pill.danger,
.alert-badge.critical,
.alert-badge.high {
  color: var(--danger);
}

.metric-icon.info,
.list-icon.info,
.pill.info {
  color: var(--accent);
}

.pill.success,
.nav-badge.success {
  color: var(--success);
}

.field input,
.field select,
.field textarea,
.auth-field input,
.ad-login-form .field input,
.rotation-form .field input,
.settings-session-policy input[type="number"],
.glass-prompt-fields input,
.glass-prompt-fields select,
.glass-prompt-fields textarea,
.assistant-form .field-input,
.topbar-search input {
  color: var(--text);
  caret-color: #7dd3fc;
}

.field input::placeholder,
.field textarea::placeholder,
.auth-field input::placeholder,
.ad-login-form .field input::placeholder,
.rotation-form .field input::placeholder,
.assistant-form .field-input::placeholder,
.topbar-search input::placeholder {
  color: var(--text-faint);
  opacity: 1;
}

select,
.field select,
option {
  color: var(--text);
  background: #101824;
}

input[type="checkbox"],
input[type="radio"],
.checklist input {
  accent-color: var(--accent);
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled,
.is-disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.table th {
  color: var(--text-muted);
}

.table td {
  color: var(--text-soft);
}

.pie-label,
.mini-bar-value,
.login-bar-button.is-active .login-bar-value {
  color: #f8fbff;
  fill: #f8fbff;
}

.favorite-icon,
.profile-avatar,
.vault-item-icon {
  color: #061320;
}

body[data-theme="alt"] .topbar,
body[data-theme="alt"] .panel,
body[data-theme="alt"] .metric-card,
body[data-theme="alt"] .mini-card,
body[data-theme="alt"] .setting-card,
body[data-theme="alt"] .note-card,
body[data-theme="alt"] .file-card,
body[data-theme="alt"] .output-card,
body[data-theme="alt"] .vault-item,
body[data-theme="alt"] .vault-block,
body[data-theme="alt"] .auth-card,
body[data-theme="alt"] .otp-card,
body[data-theme="alt"] .master-card,
body[data-theme="alt"] .action-card,
body[data-theme="alt"] .modal-card,
body[data-theme="alt"] .glass-toast-card,
body[data-theme="alt"] .glass-prompt-card,
body[data-theme="alt"] .notification-dropdown,
body[data-theme="alt"] .sidebar,
body[data-theme="alt"] h1,
body[data-theme="alt"] h2,
body[data-theme="alt"] h3,
body[data-theme="alt"] h4,
body[data-theme="alt"] .metric-value,
body[data-theme="alt"] .setting-title,
body[data-theme="alt"] .list-title,
body[data-theme="alt"] .favorite-title,
body[data-theme="alt"] .favorite-label,
body[data-theme="alt"] .alert-title,
body[data-theme="alt"] .data-value,
body[data-theme="alt"] .breach-title,
body[data-theme="alt"] .login-detail-date,
body[data-theme="alt"] .detail-cell strong,
body[data-theme="alt"] .profile-name,
body[data-theme="alt"] .brand-name {
  color: #0f172a;
}

body[data-theme="alt"] p,
body[data-theme="alt"] label,
body[data-theme="alt"] .field label,
body[data-theme="alt"] .auth-field label,
body[data-theme="alt"] .metric-header,
body[data-theme="alt"] .metric-meta,
body[data-theme="alt"] .page-subtitle,
body[data-theme="alt"] .muted,
body[data-theme="alt"] .profile-sub,
body[data-theme="alt"] .list-meta,
body[data-theme="alt"] .favorite-sub,
body[data-theme="alt"] .alert-meta,
body[data-theme="alt"] .breach-meta,
body[data-theme="alt"] .breach-status-label,
body[data-theme="alt"] .breach-status-meta,
body[data-theme="alt"] .breach-last-scan,
body[data-theme="alt"] .weak-password-heading,
body[data-theme="alt"] .weak-password-sub,
body[data-theme="alt"] .bar-note,
body[data-theme="alt"] .bar-group-label,
body[data-theme="alt"] .login-bar-value,
body[data-theme="alt"] .login-detail-meta,
body[data-theme="alt"] .login-activity-meta,
body[data-theme="alt"] .help-reference-grid p,
body[data-theme="alt"] .assistant-tags span,
body[data-theme="alt"] .notification-dropdown-meta,
body[data-theme="alt"] .setting-desc,
body[data-theme="alt"] .code-label,
body[data-theme="alt"] .mini-label,
body[data-theme="alt"] .risk-band-label,
body[data-theme="alt"] .risk-y-axis,
body[data-theme="alt"] .risk-x-axis,
body[data-theme="alt"] .chart-labels,
body[data-theme="alt"] .donut-label {
  color: #4b5b75;
}

body[data-theme="alt"] .ghost,
body[data-theme="alt"] .button,
body[data-theme="alt"] .icon-button,
body[data-theme="alt"] .notification-bell,
body[data-theme="alt"] .sidebar-toggle,
body[data-theme="alt"] .glass-toast-close,
body[data-theme="alt"] .glass-prompt-cancel,
body[data-theme="alt"] .select,
body[data-theme="alt"] .tag,
body[data-theme="alt"] .toggle,
body[data-theme="alt"] .pill {
  color: #1f2a44;
}

body[data-theme="alt"] .field input,
body[data-theme="alt"] .field select,
body[data-theme="alt"] .field textarea,
body[data-theme="alt"] .auth-field input,
body[data-theme="alt"] .ad-login-form .field input,
body[data-theme="alt"] .rotation-form .field input,
body[data-theme="alt"] .settings-session-policy input[type="number"],
body[data-theme="alt"] .glass-prompt-fields input,
body[data-theme="alt"] .glass-prompt-fields select,
body[data-theme="alt"] .glass-prompt-fields textarea,
body[data-theme="alt"] .assistant-form .field-input,
body[data-theme="alt"] .topbar-search input {
  color: #0f172a;
  caret-color: var(--accent);
}

body[data-theme="alt"] .field input::placeholder,
body[data-theme="alt"] .field textarea::placeholder,
body[data-theme="alt"] .auth-field input::placeholder,
body[data-theme="alt"] .assistant-form .field-input::placeholder,
body[data-theme="alt"] .topbar-search input::placeholder {
  color: #64748b;
}

body[data-theme="alt"] select,
body[data-theme="alt"] .field select,
body[data-theme="alt"] option {
  color: #0f172a;
  background: #f8fbff;
}

body[data-theme="alt"] .notification-dropdown {
  background: #f8fbff;
  border-color: rgba(47, 120, 196, 0.24);
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.18);
}

body[data-theme="alt"] .notification-dropdown::after {
  background: #f8fbff;
}

body[data-theme="alt"] .notification-dropdown-item {
  background: #eef3fb !important;
  border-color: rgba(148, 163, 184, 0.32);
}

body[data-theme="alt"] .notification-dropdown-item:hover,
body[data-theme="alt"] .notification-dropdown-item:focus-visible {
  background: #e4ecf8 !important;
}

body[data-theme="alt"] .notification-dropdown-list,
body[data-theme="alt"] .notification-dropdown-header,
body[data-theme="alt"] .notification-view-all {
  background: #f8fbff !important;
}

body[data-theme="alt"] .notification-dropdown-empty {
  background: #eef3fb !important;
}

@media (max-width: 980px) {
  .sidebar {
    overflow-y: auto;
  }

  .notification-dropdown {
    left: auto;
    right: 0;
    transform: none;
  }

  .notification-dropdown::after {
    left: auto;
    right: 14px;
    transform: rotate(45deg);
  }
}
