/* ============================================================
   INDIGO NOCTURN — override layer (redesign 2026-08, approved reference)
   Loaded LAST. Purpose:
   1. Neutralize legacy dark/glass/gradient styling globally.
   2. Re-skin shared components to the indigo system:
      white surfaces, 1px indigo lines, teal accent, serif display,
      indigo sidebar/topbar.
   ============================================================ */

/* ---------- 1. Global neutralizers ---------- */

/* Kill glassmorphism everywhere */
[class] {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Legacy gradient buttons/cards → flat teal */
.btn-primary,
button.primary,
.cta-button,
[class*="btn"][style*="linear-gradient"] {
  background-image: none !important;
}

/* Text selection */
::selection { background: rgba(22, 163, 154, 0.20); }

/* Focus visibility (teal, not neon) */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- 2. Cards & surfaces ---------- */

.card,
.glass-card,
.stat-card,
.content-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(27, 26, 56, 0.04), 0 18px 40px -28px rgba(27, 26, 56, 0.20);
}

.card:hover,
.content-card:hover {
  background: var(--paper);
  border-color: rgba(27, 26, 56, 0.20);
  transform: none;
}

/* ---------- 3. Buttons ---------- */

.btn-primary,
button.primary {
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: none;
  transition: background var(--transition), transform var(--transition);
}

.btn-primary:hover,
button.primary:hover {
  background: var(--teal-deep);
  transform: translateY(-1px);
  box-shadow: none;
}

.btn-secondary,
button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(27, 26, 56, 0.28);
  border-radius: 8px;
  font-weight: 600;
}

.btn-secondary:hover,
button.secondary:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* ---------- 4. Forms ---------- */

input, textarea, select {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 163, 154, 0.20);
}

input::placeholder, textarea::placeholder { color: var(--ink-45); }

/* ---------- 5. Modals & overlays ---------- */

.modal, .modal-content, .drawer {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 40px 90px -40px rgba(27, 26, 56, 0.45);
}

.modal-backdrop, .overlay {
  background: rgba(27, 26, 56, 0.55);
}

/* ---------- 6. Badges, chips, pills ---------- */

.badge, .chip, .tag {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ISC pillar chips — quiet cool tints on white */
.badge-servire, .tag-servire { background: rgba(22, 163, 154, 0.12); color: var(--color-servire); }
.badge-autenticitate, .tag-autenticitate { background: rgba(91, 121, 199, 0.14); color: var(--color-autenticitate); }
.badge-transformare, .tag-transformare { background: rgba(75, 46, 142, 0.12); color: var(--color-transformare); }
.badge-invitatie, .tag-invitatie { background: rgba(194, 94, 138, 0.14); color: var(--color-invitatie); }

/* ---------- 6b. Desktop shell: indigo sidebar + topbar ---------- */

.desktop-sidebar {
  background: var(--indigo);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
}

.desktop-topbar, .desktop-header {
  background: var(--indigo);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.desktop-sidebar-item {
  color: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
}
.desktop-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.desktop-sidebar-item.active {
  background: rgba(22, 163, 154, 0.18);
  color: #fff;
  border: 1px solid rgba(22, 163, 154, 0.45);
  box-shadow: none;
}
.desktop-sidebar-item.active .material-icons { color: var(--teal-bright); }

.desktop-sidebar-logo-mark {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--teal-bright);
}
.desktop-sidebar-logo-text { color: #fff; font-family: var(--font-serif); }

.desktop-sidebar-tour { color: var(--lavender); }
.desktop-sidebar-tour:hover { background: rgba(22, 163, 154, 0.18); color: var(--teal-bright); }

.sidebar-module-label { letter-spacing: 0.02em; color: rgba(255, 255, 255, 0.5); }
.sidebar-module-items a { color: rgba(255, 255, 255, 0.72); }
.sidebar-module-items a:hover { color: #fff; }

/* Topbar text/icons legible on indigo */
.desktop-topbar a, .desktop-header a,
.desktop-topbar .material-icons, .desktop-header .material-icons { color: rgba(255, 255, 255, 0.82); }
.desktop-topbar a:hover, .desktop-header a:hover { color: #fff; }

/* ---------- 7. Scrollbars ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bone); }
::-webkit-scrollbar-thumb { background: rgba(27, 26, 56, 0.20); border-radius: 5px; border: 2px solid var(--bone); }
::-webkit-scrollbar-thumb:hover { background: rgba(27, 26, 56, 0.34); }

/* ---------- 8. Tables ---------- */

table { border-color: var(--line); }
th {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-45);
  border-bottom: 1px solid rgba(27, 26, 56, 0.24);
}
td { border-bottom: 1px solid var(--line); }
tr:hover td { background: var(--color-surface-hover); }

/* ---------- 9. Links ---------- */

a { color: inherit; }
.link, a.text-link { color: var(--teal); text-decoration: none; border-bottom: 1px solid rgba(22, 163, 154, 0.35); }
.link:hover, a.text-link:hover { border-bottom-color: var(--teal); }

/* ---------- 10. Toasts / notifications ---------- */

.toast {
  background: var(--indigo);
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 22px 50px -22px rgba(27, 26, 56, 0.55);
}
.toast.success { border-left: 3px solid var(--teal-bright); }
.toast.error { border-left: 3px solid var(--color-error); }
