@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Layout */
  --sidebar-width: 220px;
  --topbar-height: 72px;

  /* Transitions */
  --transition-fast: 140ms ease;
  --transition-base: 220ms ease;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.12);

  /* Light Base */
  --bg-main: #f6f7fb;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-overlay: rgba(10, 10, 15, 0.75);
  --bg-ghost: rgba(10, 10, 15, 0.65);

  /* Borders */
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-medium: rgba(15, 23, 42, 0.14);

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  /* Accents (bleiben!) */
  --accent-primary: #f97316; /* Orange */
  --accent-good: #16a34a;
  --accent-warn: #f59e0b;
  --accent-error: #e11d48;
  --accent-info: #2563eb;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-main);
  color: var(--text-primary);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  height: 100%;
  overflow-x: hidden;
}

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

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(245, 158, 11, 0.55);
  outline-offset: 2px;
}

/* ==================== APP / FOUC ==================== */
.app {
  min-height: 100vh;
  opacity: 0;
  transition: opacity 180ms ease-in;
}

.app.is-ready {
  opacity: 1;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: #0b0f19 !important;
  color: #e5e7eb !important;
  border-right: 1px solid rgba(255,255,255,0.08) !important;
  display: flex;
  flex-direction: column;
  z-index: 120;
}

.sidebar-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo {
  max-width: 140px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.logo-text {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
}

/* FIX: HTML nutzt .navbar (nicht #navbar) */
.navbar {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.nav-item .nav-link {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255,255,255,0.78) !important;
  padding: 12px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  font-weight: 700;
  font-size: 15px;
}

.nav-item.is-active .nav-link {
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.28) !important;
  color: #ffffff !important;
}

.nav-link:hover {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.10) !important;
  color: #ffffff !important;
}

.nav-link:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: transparent;
  border-color: transparent;
}

/* ==================== SIDEBAR FOOTER - FIX ==================== */

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  height: 30px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.04);
}

.status-card span {
  flex: 1;
  color: rgba(255,255,255,0.75);
}

/* ==================== TOOLTIP SYSTEM ==================== */
.status-card[data-tooltip],
.topbar-icon-button[data-tooltip],
.nav-link[data-tooltip],
button[data-tooltip] {
  position: relative;
}

.status-card[data-tooltip]:hover::after,
.topbar-icon-button[data-tooltip]:hover::after,
.nav-link[data-tooltip]:hover::after,
button[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 18, 26, 0.98);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  z-index: 3000;
  pointer-events: none;
  animation: tooltipFadeIn 140ms ease-out;
  backdrop-filter: blur(8px);
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.status-label {
  order: 2;
  font-size: 9px;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.1em;
  font-weight: 800;
  text-transform: uppercase;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
  flex-shrink: 0;
}

.status-dot-green {
  background: var(--accent-good);
  color: var(--accent-good);
}

.status-dot-yellow {
  background: var(--accent-warn);
  color: var(--accent-warn);
}

.status-dot-red {
  background: var(--accent-error);
  color: var(--accent-error);
}

.sidebar-settings-button {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12) !important;
  color: rgba(255,255,255,0.82) !important;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  font-weight: 700;
  font-size: 14px;
}

.sidebar-settings-button:hover {
  background: rgba(255,255,255,0.06) !important;
  color: #ffffff !important;
}

/* ==================== TOPBAR ==================== */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 110;
}

.topbar-date {
  display: grid;
  gap: 2px;
}

.topbar-date-greeting {
  font-weight: 800;
  font-size: 16px;
}

.topbar-date-value {
  color: var(--text-muted);
  font-size: 12px;
}

.topbar-center {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.topbar-select-group {
  display: grid;
  gap: 6px;
}

.topbar-select-group label {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 800;
}

.topbar-select {
  min-width: 160px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  padding: 10px 10px;
  border-radius: 14px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.topbar-select:hover {
  border-color: var(--border-medium);
  background: #f8fafc;
}

.topbar-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==================== VERBINDEN-BUTTON STATE ==================== */
.topbar-connect-button {
  background: var(--accent-primary);
  border: none;
  color: #06060a;
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  transition: transform var(--transition-fast), filter var(--transition-fast),
    background var(--transition-base), color var(--transition-base);
  position: relative;
  overflow: hidden;
  min-width: 120px;
}

.topbar-connect-button:hover {
  filter: brightness(1.05);
}

.topbar-connect-button:active {
  transform: translateY(1px);
}

.topbar-connect-button.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

.topbar-connect-button.is-connected {
  background: var(--accent-error);
  color: #fff;
  border: 1px solid rgba(225, 29, 72, 0.35);
}

/* PHASE 1 FIX: app.js nutzt zusätzlich .is-danger (Verbinden->Trennen) */
.topbar-connect-button.is-danger {
  background: var(--accent-error);
  color: #fff;
  border: 1px solid rgba(225, 29, 72, 0.35);
}

.topbar-connect-button.is-connected:hover {
  background: #c11841;
  filter: brightness(1.1);
}

.topbar-connect-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.topbar-icon-button {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast);
  font-size: 16px;
  position: relative;
}

.topbar-icon-button:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.topbar-icon-button.has-notification::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  background: var(--accent-error);
  border-radius: 50%;
  box-shadow: 0 0 4px var(--accent-error);
}

/* ==================== VIEWS ==================== */
.views {
  margin-top: var(--topbar-height);
  width: calc(100% - var(--sidebar-width));
  margin-left: auto;
}

/* Bereinigt: EIN System (display + opacity/transform). */
.view {
  display: none;
  padding: 22px;
  min-height: calc(100vh - var(--topbar-height));
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 160ms ease-in, transform 240ms ease-out;
}

.view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.view.loading {
  opacity: 0.35;
  filter: blur(1px);
  pointer-events: none;
  transition: opacity var(--transition-base), filter var(--transition-base);
}

.view-ghost-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-ghost);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.view-ghost-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.view-ghost-content {
  text-align: center;
  max-width: 480px;
  padding: 24px;
  background: rgba(18, 18, 26, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  color: rgba(255,255,255,0.92);
}

.view-ghost-title {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 8px;
  color: #ffffff;
}

.view-ghost-text {
  color: rgba(255,255,255,0.72);
  margin-bottom: 16px;
  font-size: 14px;
}

/* ==================== GLOBAL LOADER ==================== */
.global-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 220ms ease-in-out;
}

.global-loader.active {
  display: flex;
  opacity: 1;
}

.global-loader-inner {
  text-align: center;
  max-width: 420px;
  padding: 24px;
  background: rgba(18, 18, 26, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: rgba(255,255,255,0.92);
}

.loader-dots > div {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: loaderPulse 1.4s infinite ease-in-out both;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.loader-dots > div:nth-child(2) {
  animation-delay: 0.18s;
}

.loader-dots > div:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes loaderPulse {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: scale(0.9) translateY(0);
  }
  40% {
    opacity: 1;
    transform: scale(1.1) translateY(-4px);
  }
}

.loader-message {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.loader-submessage {
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  line-height: 1.5;
}

.global-loader.sensei-loading .loader-dots .loader-dot {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.7);
}

.global-loader.sensei-loading .loader-message {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.global-loader.meta-loading .loader-dots .loader-dot {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.7);
}

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1600;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  width: min(560px, 92vw);
  background: rgba(18, 18, 26, 0.96);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  max-height: 85vh;
  overflow-y: auto;
  color: rgba(255,255,255,0.92);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
}

.modal-close-button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.72);
  cursor: pointer;
  font-size: 16px;
  transition: color var(--transition-fast);
}

.modal-close-button:hover {
  color: #ffffff;
}

.modal-body {
  padding: 16px;
}

/* ==================== NOTIFICATION PANEL ==================== */
.notification-panel {
  position: fixed;
  top: var(--topbar-height);
  right: -420px;
  width: min(420px, 100vw);
  height: calc(100vh - var(--topbar-height));
  z-index: 200;
  transition: right var(--transition-base);
}

.notification-panel.active {
  right: 0;
}

.notification-panel-card {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.notification-panel-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

.notification-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  transition: color var(--transition-fast);
}

.notification-close:hover {
  color: var(--text-primary);
}

.notification-panel-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.notification-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 24px;
}

/* ==================== ACCOUNT PANEL ==================== */
.account-panel {
  position: fixed;
  top: calc(var(--topbar-height) + 8px);
  right: -360px;
  width: min(360px, 100vw);
  z-index: 200;
  transition: right var(--transition-base);
}

.account-panel.active {
  right: 16px;
}

.account-panel-card {
  background: rgba(18, 18, 26, 0.96);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  color: rgba(255,255,255,0.92);
}

.account-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.account-panel-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
}

.account-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.72);
  cursor: pointer;
  font-size: 16px;
  transition: color var(--transition-fast);
}

.account-close:hover {
  color: #ffffff;
}

.account-panel-body {
  padding: 16px;
}

.account-quick-info {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.account-quick-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.account-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.account-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
}

.account-goto-settings {
  width: 100%;
}

/* ==================== BUTTONS ==================== */
.btn {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast),
    border-color var(--transition-fast), opacity var(--transition-fast);
  font-weight: 800;
  font-size: 14px;
  text-align: center;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-primary);
  border-color: rgba(245, 158, 11, 0.35);
  color: #05050a;
}

.btn-primary:hover {
  background: #ffb020;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
}

.btn-danger {
  background: rgba(225, 29, 72, 0.12);
  border-color: rgba(225, 29, 72, 0.25);
  color: #fff;
}

.btn-danger:hover {
  background: rgba(225, 29, 72, 0.18);
}

/* ==================== CORE EMPTY STATE ==================== */
.core-empty {
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  max-width: 720px;
}

.core-empty-title {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 6px;
}

.core-empty-text {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.core-empty-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 12px;
}

/* ==================== TIMERANGE TOGGLE ==================== */
.range-toggle {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
}

.range-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.range-btn.active {
  background: rgba(245, 158, 11, 0.14);
  color: var(--text-primary);
}

/* ==================== TOAST ==================== */
#toastContainer {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 12px;
  z-index: 1500;
  max-width: 380px;
}

.toast {
  border: 1px solid var(--border-medium);
  background: rgba(18, 18, 26, 0.98);
  backdrop-filter: blur(14px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  padding: 14px 16px;
  min-width: 300px;
  max-width: 380px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: toastSlideIn 280ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  color: rgba(255,255,255,0.92);
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-info);
  transition: background var(--transition-fast);
}

.toast.toast-success::before {
  background: var(--accent-good);
}

.toast.toast-warn::before {
  background: var(--accent-warn);
}

.toast.toast-error::before {
  background: var(--accent-error);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 800;
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  line-height: 1.5;
}

.toast-close {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255,255,255,0.72);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 13px;
  border-radius: 8px;
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
  font-weight: 700;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* ==================== LOADING BUTTON STATE ==================== */
.btn.is-loading {
  position: relative;
  pointer-events: none;
  color: transparent;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
  color: var(--text-primary);
}

@keyframes btnSpin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ==================== DASHBOARD MODULE STYLES ==================== */
.dashboard-hero {
  margin-bottom: 28px;
}

.dashboard-hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr; /* ← FIX: war repeat(auto-fit, minmax(220px, 1fr)) */
  gap: 16px;
}

.hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: transform var(--transition-fast), border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.hero-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.hero-card-sensei {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.02) 100%);
  border-color: rgba(245, 158, 11, 0.25);
}

.hero-card-sensei:hover {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.2);
}

.hero-card-primary {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.06) 0%, rgba(225, 29, 72, 0.01) 100%);
  border-color: rgba(225, 29, 72, 0.2);
}

.hero-card-primary:hover {
  border-color: rgba(225, 29, 72, 0.35);
  box-shadow: 0 8px 32px rgba(225, 29, 72, 0.15);
}

.hero-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.hero-card-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.hero-card-info-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  transition: color var(--transition-fast);
}

.hero-card-info-btn:hover {
  color: var(--text-primary);
}

.hero-card-value {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.hero-card-value-gold {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-card-value-red {
  color: var(--accent-error);
}

.hero-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.hero-meta-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
  letter-spacing: 0.05em;
}

.hero-meta-badge-good {
  background: rgba(22, 163, 74, 0.12);
  color: var(--accent-good);
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.hero-meta-badge-neutral {
  background: rgba(161, 161, 170, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(161, 161, 170, 0.2);
}

.hero-card-sparkline {
  opacity: 0.6;
  color: var(--accent-primary);
}

.dashboard-section {
  margin-bottom: 24px;
}

.dashboard-section-title {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.dashboard-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    transform var(--transition-fast);
  font-weight: 700;
  font-size: 14px;
}

.quick-action-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.quick-action-icon {
  font-size: 20px;
}

.dashboard-table {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.dashboard-perf-table {
  width: 100%;
  border-collapse: collapse;
}

.dashboard-perf-table thead {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
}

.dashboard-perf-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.dashboard-perf-table td {
  padding: 14px 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.dashboard-perf-row {
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.dashboard-perf-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.dashboard-perf-row:last-child {
  border-bottom: none;
}

.dashboard-perf-name {
  color: var(--text-primary);
  font-weight: 700;
}

.perf-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.perf-badge-good {
  background: rgba(22, 163, 74, 0.12);
  color: var(--accent-good);
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.dashboard-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-alerts {
  display: grid;
  gap: 12px;
}

.dashboard-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  border-left-width: 3px;
}

.dashboard-alert-warn {
  border-left-color: var(--accent-warn);
  background: rgba(245, 158, 11, 0.04);
}

.dashboard-alert-error {
  border-left-color: var(--accent-error);
  background: rgba(225, 29, 72, 0.04);
}

.alert-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.alert-message {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.alert-action-btn {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.alert-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dashboard-critical-actions {
  display: grid;
  gap: 12px;
}

.critical-action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  font-weight: 700;
  font-size: 14px;
}

.critical-action-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-medium);
}

.critical-action-btn-warn {
  border-left-width: 3px;
  border-left-color: var(--accent-warn);
}

.critical-action-btn-info {
  border-left-width: 3px;
  border-left-color: var(--accent-info);
}

.critical-action-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--accent-primary);
  color: #06060a;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

/* ==================== RESPONSIVE TWEAKS ==================== */
@media (max-width: 1400px) {
  .dashboard-hero-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .topbar-center {
    gap: 10px;
  }

  .topbar-select {
    min-width: 140px;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 80px;
  }

  .sidebar {
    width: 80px;
  }

  .sidebar-logo {
    width: 40px;
  }

  .sidebar-nav .nav-link {
    font-size: 0;
  }

  .sidebar-nav .nav-link::before {
    content: attr(data-icon);
    font-size: 18px;
  }

  .topbar {
    left: 80px;
  }

  .views {
    margin-left: 80px;
    width: calc(100% - 80px);
  }

  .dashboard-hero-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-section-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== TOPBAR IDs FIX ==================== */
#topbarGreeting {
  font-weight: 800;
  font-size: 16px;
}

#topbarDate {
  color: var(--text-muted);
  font-size: 12px;
}

/* ==================== DARK OVERLAYS COLOR FIX ==================== */
.view-ghost-content,
.global-loader-inner,
.modal,
.account-panel-card,
.toast {
  color: rgba(255,255,255,0.92);
  border-color: rgba(255,255,255,0.12);
}

.view-ghost-title,
.loader-message,
.modal-title,
.toast-title,
.account-panel-header h3 {
  color: #ffffff;
}

.view-ghost-text,
.loader-submessage,
.toast-message,
.notification-empty,
.core-empty-text {
  color: rgba(255,255,255,0.72);
}

.modal-close-button,
.notification-close,
.account-close,
.toast-close {
  color: rgba(255,255,255,0.72);
}

.modal-close-button:hover,
.notification-close:hover,
.account-close:hover,
.toast-close:hover {
  color: #ffffff;
}


/* ============================================================
   SignalOne V1 – ADDITIVE FIXES (Phase 1 Polish)
   Original file above remains unchanged.
   ============================================================ */

.topbar-connect-button.is-danger {
  background: var(--accent-error);
  color: #ffffff;
  border: 1px solid rgba(225, 29, 72, 0.35);
}

.view.loading {
  opacity: 0.35;
  filter: blur(1px);
  pointer-events: none;
}

.global-loader.active {
  opacity: 1;
}

[data-tooltip] {
  position: relative;
}
