/**
 * OLFEI Olfei.TERMINAL Theme Override
 * Brand:  Olfei.TERMINAL / <OLFEI.TERMINAL/>
 * App:    Olfei.TERMINAL (React + Vite + Tailwind + Shadcn UI)
 * Version: 1.1.0
 *
 * This file overrides Shadcn UI CSS variables (HSL channel format)
 * and Olfei.TERMINAL-specific custom properties to apply the OLFEI brand identity.
 * Loaded via startup script into /app/html/ and injected into index.html.
 *
 * v1.1.0 - Fixed variable scoping to work without .dark class;
 *           rewrote login page selectors to match actual DOM.
 */

/* ================================================================
   FONT FACES
   ================================================================ */

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ================================================================
   SHADCN UI CSS VARIABLES (HSL channel format)
   Applied to :root and html so they work regardless of .dark class.
   ================================================================ */

:root,
html,
.dark {
  --background: 0 0% 5% !important;
  --foreground: 0 0% 100% !important;

  --card: 0 0% 7% !important;
  --card-foreground: 0 0% 100% !important;

  --popover: 0 0% 7% !important;
  --popover-foreground: 0 0% 100% !important;

  --primary: 142 71% 45% !important;
  --primary-foreground: 0 0% 5% !important;

  --secondary: 0 0% 12% !important;
  --secondary-foreground: 0 0% 100% !important;

  --muted: 0 0% 10% !important;
  --muted-foreground: 220 9% 65% !important;

  --accent: 0 0% 12% !important;
  --accent-foreground: 0 0% 100% !important;

  --destructive: 0 84% 60% !important;
  --destructive-foreground: 0 0% 100% !important;

  --border: 0 0% 18% !important;
  --input: 0 0% 18% !important;
  --ring: 142 71% 45% !important;

  --chart-1: 142 71% 45% !important;
  --chart-2: 38 92% 50% !important;
  --chart-3: 217 91% 60% !important;
  --chart-4: 48 89% 78% !important;
  --chart-5: 60 56% 91% !important;

  --radius: 0.5rem !important;

  --sidebar-background: 0 0% 5% !important;
  --sidebar-foreground: 0 0% 90% !important;
  --sidebar-primary: 142 71% 45% !important;
  --sidebar-primary-foreground: 0 0% 5% !important;
  --sidebar-accent: 0 0% 10% !important;
  --sidebar-accent-foreground: 0 0% 100% !important;
  --sidebar-border: 0 0% 18% !important;
  --sidebar-ring: 142 71% 45% !important;
}

/* ================================================================
   TERMIx-SPECIFIC CUSTOM VARIABLES (full color values)
   ================================================================ */

:root,
html,
.dark {
  --bg-base: #0D0D0D !important;
  --bg-elevated: #121212 !important;
  --bg-surface: #1A1A1A !important;
  --bg-header: #1E1E1E !important;
  --bg-button: #252525 !important;
  --bg-active: #2A2A2A !important;

  --border-base: #333333 !important;
  --border-panel: #2D2D2D !important;
  --border-subtle: #2A2A2A !important;

  --scrollbar-thumb: #333333 !important;
  --scrollbar-track: #1A1A1A !important;

  --shell-backdrop: linear-gradient(180deg, #0D0D0D 0%, #121212 100%) !important;
  --shell-surface: rgba(26, 26, 26, 0.92) !important;
  --shell-surface-elevated: rgba(30, 30, 30, 0.96) !important;
  --shell-surface-soft: rgba(37, 37, 37, 0.78) !important;
  --shell-surface-muted: rgba(23, 23, 23, 0.78) !important;
  --shell-border: rgba(255, 255, 255, 0.08) !important;
  --shell-border-strong: rgba(255, 255, 255, 0.12) !important;
  --shell-border-faint: rgba(255, 255, 255, 0.04) !important;
  --shell-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.85) !important;
  --shell-shadow-soft: 0 12px 30px -24px rgba(0, 0, 0, 0.72) !important;
  --shell-shadow-panel: 0 24px 54px -34px rgba(0, 0, 0, 0.82) !important;
  --shell-focus-ring: 0 0 0 2px #0D0D0D, 0 0 0 4px rgba(74, 222, 128, 0.24) !important;
  --shell-accent-soft: rgba(74, 222, 128, 0.12) !important;
  --shell-accent-line: rgba(74, 222, 128, 0.24) !important;
  --shell-accent-glow: rgba(74, 222, 128, 0.18) !important;
  --shell-cream-soft: rgba(245, 245, 220, 0.12) !important;
  --shell-cream-line: rgba(240, 230, 140, 0.32) !important;

  --olfei-chart-1: #4ADE80 !important;
  --olfei-chart-2: #F59E0B !important;
  --olfei-chart-3: #3B82F6 !important;
  --olfei-chart-4: #F0E68C !important;
  --olfei-chart-5: #F5F5DC !important;
}

/* ================================================================
   ELEMENT-LEVEL OVERRIDES
   ================================================================ */

::selection {
  background: rgba(240, 230, 140, 0.42) !important;
  color: #0D0D0D !important;
}

::-moz-selection {
  background: rgba(240, 230, 140, 0.42) !important;
  color: #0D0D0D !important;
}

:focus-visible {
  outline: none !important;
  box-shadow: var(--shell-focus-ring) !important;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #1A1A1A !important;
}

::-webkit-scrollbar-thumb {
  background: #333333 !important;
  border-radius: 9999px !important;
}

::-webkit-scrollbar-thumb:hover {
  background: #404040 !important;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #333333 #1A1A1A;
}

/* ================================================================
   GLOBAL TEXT CONTRAST & BODY BASE
   ================================================================ */

body {
  color: hsl(var(--foreground)) !important;
  background-color: hsl(var(--background)) !important;
  background-image: radial-gradient(circle at top, rgba(74, 222, 128, 0.06), transparent 36%), linear-gradient(180deg, #0D0D0D 0%, #121212 100%) !important;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

*:not(.terminal):not(.xterm):not(.xterm-screen):not(.ace_editor):not(.cm-editor):not(.cm-line):not(.xterm-rows):not(.xterm-viewport) {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

*:not(.terminal):not(.xterm):not(.ace_editor):not(.cm-editor) {
  color-scheme: dark;
}

p, span, div, label, h1, h2, h3, h4, h5, h6, li, ul, ol {
  color: hsl(var(--foreground));
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

.text-muted,
[class*="muted"],
[class*="secondary"] {
  color: #B0B0B0 !important;
}

input, textarea, select {
  color: #FFFFFF !important;
  background-color: rgba(26, 26, 26, 0.92) !important;
  border: 1px solid var(--shell-border) !important;
  border-radius: 0.45rem !important;
  min-height: 2.5rem;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease !important;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

input:hover, textarea:hover, select:hover {
  border-color: var(--shell-border-strong) !important;
}

input:focus-visible, textarea:focus-visible, select:focus-visible {
  border-color: #4ADE80 !important;
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.18) !important;
}

button, [role="button"] {
  color: inherit;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

::placeholder {
  color: #707070 !important;
}

label,
[class*="label"] {
  color: #FFFFFF !important;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

code:not([class*="terminal"]):not([class*="xterm"]),
pre:not([class*="terminal"]):not([class*="xterm"]) {
  color: #4ADE80 !important;
  background-color: #252525 !important;
}

/* ================================================================
   LINKS
   ================================================================ */

a, [class*="link"] {
  color: #4ADE80 !important;
  transition: color 0.2s ease-in-out !important;
}

a:hover, [class*="link"]:hover {
  color: #F0E68C !important;
}

/* ================================================================
   TABLES
   ================================================================ */

table, [class*="table"] {
  color: #FFFFFF !important;
}

th, [class*="th"] {
  color: #FFFFFF !important;
}

td, [class*="td"] {
  color: #E0E0E0 !important;
  border-color: #333333 !important;
}

/* ================================================================
   CARDS, PANELS, AND CONTAINERS
   ================================================================ */

[class*="card"]:not(.terminal):not(.xterm) {
  color: #FFFFFF !important;
  background: linear-gradient(180deg, rgba(24, 24, 24, 0.94) 0%, rgba(19, 19, 19, 0.96) 100%) !important;
  border: 1px solid var(--shell-border-faint) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), var(--shell-shadow-panel) !important;
  border-radius: 0.65rem !important;
}

[class*="panel"] {
  color: #FFFFFF !important;
  background: linear-gradient(180deg, rgba(24, 24, 24, 0.94) 0%, rgba(19, 19, 19, 0.96) 100%) !important;
  border: 1px solid var(--shell-border-faint) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), var(--shell-shadow-soft) !important;
  border-radius: 0.65rem !important;
}

/* ================================================================
   TOOLTIPS, DROPDOWNS, MODALS, TABS, BADGES
   ================================================================ */

[class*="tooltip"], [role="tooltip"] {
  color: #FFFFFF !important;
  background-color: #252525 !important;
}

[class*="dropdown"], [role="menu"] {
  color: #FFFFFF !important;
  background: linear-gradient(180deg, rgba(28, 28, 28, 0.97) 0%, rgba(20, 20, 20, 0.98) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 26px 48px -28px rgba(0, 0, 0, 0.9) !important;
  border-radius: 0.55rem !important;
  backdrop-filter: blur(14px) !important;
}

[class*="dropdown-item"], [role="menuitem"] {
  color: #FFFFFF !important;
}

[class*="dropdown-item"]:hover, [role="menuitem"]:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

[class*="modal"], [role="dialog"] {
  color: #FFFFFF !important;
  background-color: rgba(13, 13, 13, 0.88) !important;
  backdrop-filter: blur(10px) !important;
}

[class*="modal-content"] {
  background: linear-gradient(180deg, rgba(28, 28, 28, 0.96) 0%, rgba(19, 19, 19, 0.98) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 30px 64px -34px rgba(0, 0, 0, 0.92) !important;
  border-radius: 0.7rem !important;
  backdrop-filter: blur(14px) !important;
}

[class*="tab"] {
  color: #B0B0B0 !important;
}

[class*="tab-active"],
[class*="tab"][aria-selected="true"] {
  color: #FFFFFF !important;
  background-color: #2A2A2A !important;
}

[class*="badge"] {
  color: #FFFFFF !important;
}

/* ================================================================
   SIDEBAR LOGO REPLACEMENT - Hide Olfei.TERMINAL, show OLFEI
   ================================================================ */

/* The sidebar group label containing "Olfei.TERMINAL" */
[data-slot="sidebar-group-label"],
[data-sidebar="group-label"],
.sidebar-header [class*="text-lg"],
[class*="sidebar"] [class*="text-lg font-bold"] {
  font-size: 0 !important;
  position: relative !important;
}

/* Insert OLFEI branding */
[data-slot="sidebar-group-label"]::after,
[data-sidebar="group-label"]::after {
  content: "OLFEI.TERMINAL" !important;
  font-size: 1.1rem !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 700 !important;
  color: #4ADE80 !important;
  letter-spacing: 0.05em !important;
  position: absolute !important;
  left: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

/* Sidebar styling */
[data-slot="sidebar-inner"],
[data-sidebar="sidebar"],
.bg-sidebar {
  background: linear-gradient(180deg, #0D0D0D 0%, #141414 55%, #1A1A1A 100%) !important;
  border-color: var(--shell-border) !important;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.02), 18px 0 36px -34px rgba(0, 0, 0, 0.95) !important;
}

[data-slot="sidebar"],
[data-sidebar="sidebar"] {
  border-right: 1px solid var(--shell-border) !important;
}

[data-slot="sidebar-header"],
[data-sidebar="header"] {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  padding-bottom: 0.85rem !important;
  margin-bottom: 0.65rem !important;
}

[data-slot="sidebar-content"],
[data-sidebar="content"] {
  padding-top: 0.3rem !important;
}

[data-slot="sidebar-menu-button"],
[data-sidebar="menu-button"] {
  min-height: 2.5rem !important;
  border: 1px solid transparent !important;
  border-radius: 0.45rem !important;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.72) !important;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease !important;
}

[data-slot="sidebar-menu-button"]:hover,
[data-sidebar="menu-button"]:hover {
  background: rgba(255, 255, 255, 0.035) !important;
  border-color: transparent !important;
  color: #FFFFFF !important;
}

[data-slot="sidebar-menu-button"][data-active="true"],
[data-sidebar="menu-button"][data-active="true"],
[data-slot="sidebar-menu-button"][aria-current="page"],
[data-sidebar="menu-button"][aria-current="page"] {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.16) 0%, rgba(74, 222, 128, 0.08) 100%) !important;
  border-color: rgba(74, 222, 128, 0.12) !important;
  color: #FFFFFF !important;
  box-shadow: inset 2px 0 0 rgba(74, 222, 128, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 24px -22px rgba(74, 222, 128, 0.45) !important;
}

/* ================================================================
   MAIN APP STYLING - Dashboard and content areas
   ================================================================ */

/* Canvas and elevated backgrounds */
.bg-canvas,
[data-slot="sidebar-inset"],
[class*="bg-canvas"] {
  background-color: #0D0D0D !important;
  background-image: radial-gradient(circle at top right, rgba(74, 222, 128, 0.04), transparent 32%) !important;
}

[class*="!bg-elevated"],
.bg-elevated,
[data-slot="command"],
.bg-hover\/50 {
  background-color: #1A1A1A !important;
  border-color: var(--shell-border) !important;
}

/* Border colors */
.border-edge,
[data-slot="separator"],
[class*="border-edge"] {
  border-color: var(--shell-border) !important;
}

[data-slot="sidebar-inset"] > header,
main header.sticky,
header[class*="top"] {
  background: linear-gradient(180deg, rgba(16, 16, 16, 0.96) 0%, rgba(18, 18, 18, 0.88) 72%, rgba(15, 15, 15, 0.82) 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025) !important;
  backdrop-filter: blur(14px) !important;
}

[data-slot="sidebar-inset"] > div:first-child {
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.96) 0%, rgba(15, 15, 15, 0.92) 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), 0 18px 34px -32px rgba(0, 0, 0, 0.9) !important;
  backdrop-filter: blur(14px) !important;
}

[data-slot="sidebar-inset"] > div:first-child > div:first-child {
  gap: 0.55rem !important;
}

[data-slot="sidebar-inset"] > div:first-child [draggable="true"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028) 0%, rgba(255, 255, 255, 0.015) 100%) !important;
  border: 1px solid transparent !important;
  border-radius: 0.45rem !important;
  color: rgba(255, 255, 255, 0.7) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02) !important;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease !important;
}

[data-slot="sidebar-inset"] > div:first-child [draggable="true"]:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #FFFFFF !important;
}

[data-slot="sidebar-inset"] > div:first-child [draggable="true"][data-state="active"],
[data-slot="sidebar-inset"] > div:first-child [draggable="true"][aria-selected="true"],
[data-slot="sidebar-inset"] > div:first-child [draggable="true"].bg-accent,
[data-slot="sidebar-inset"] > div:first-child [draggable="true"].border-border {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.1) 0%, rgba(255, 255, 255, 0.025) 100%) !important;
  border-color: rgba(74, 222, 128, 0.14) !important;
  color: #FFFFFF !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), inset 0 -1px 0 rgba(74, 222, 128, 0.42) !important;
}

[data-slot="sidebar-inset"] > div:first-child button {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

[data-slot="sidebar-inset"] > div:first-child > div:last-child {
  gap: 0.15rem !important;
  padding: 0.15rem !important;
  background: rgba(255, 255, 255, 0.025) !important;
  border: 1px solid rgba(255, 255, 255, 0.04) !important;
  border-radius: 0.45rem !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025) !important;
}

[data-slot="sidebar-inset"] > div:first-child > div:last-child button,
[data-slot="sidebar-inset"] > div:first-child > div:last-child [role="button"] {
  min-height: 2.15rem !important;
  min-width: 2.15rem !important;
  border-radius: 0.35rem !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: rgba(255, 255, 255, 0.72) !important;
}

[data-slot="sidebar-inset"] > div:first-child > div:last-child button:hover,
[data-slot="sidebar-inset"] > div:first-child > div:last-child [role="button"]:hover {
  background: rgba(255, 255, 255, 0.045) !important;
  color: #FFFFFF !important;
}

[data-slot="sidebar-inset"] main,
[data-slot="sidebar-inset"] section,
[data-slot="sidebar-inset"] [class*="grid"] {
  gap: 1rem !important;
}

[data-slot="button"],
button[data-slot="button"],
button[class*="inline-flex"] {
  min-height: 2.5rem !important;
  border-radius: 0.45rem !important;
  border: 1px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease !important;
}

[data-slot="button"][data-variant="outline"],
button[data-slot="button"][data-variant="outline"] {
  background: rgba(255, 255, 255, 0.025) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  color: #E0E0E0 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025) !important;
}

[data-slot="button"][data-variant="outline"]:hover,
button[data-slot="button"][data-variant="outline"]:hover {
  background: rgba(255, 255, 255, 0.045) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
}

[data-slot="button"][data-variant="ghost"],
button[data-slot="button"][data-variant="ghost"] {
  background: transparent !important;
  border-color: transparent !important;
  color: #D0D0D0 !important;
}

[data-slot="button"][data-variant="ghost"]:hover,
button[data-slot="button"][data-variant="ghost"]:hover {
  background: rgba(255, 255, 255, 0.035) !important;
  color: #FFFFFF !important;
}

[role="tablist"],
[data-slot="tabs-list"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028) 0%, rgba(255, 255, 255, 0.015) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.04) !important;
  border-radius: 0.5rem !important;
  padding: 0.2rem !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025) !important;
}

[data-slot="tabs-trigger"],
[role="tab"] {
  min-height: 2.25rem !important;
  border-radius: 0.4rem !important;
  color: rgba(255, 255, 255, 0.68) !important;
  background-color: transparent !important;
}

[data-slot="tabs-trigger"][data-state="active"],
[role="tab"][aria-selected="true"] {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.14) 0%, rgba(74, 222, 128, 0.08) 100%) !important;
  color: #FFFFFF !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 -1px 0 rgba(74, 222, 128, 0.65), 0 10px 20px -22px rgba(74, 222, 128, 0.5) !important;
}

[data-slot="tabs-trigger"]:hover:not([data-state="active"]),
[role="tab"]:hover:not([aria-selected="true"]) {
  background: rgba(255, 255, 255, 0.035) !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

[data-slot="badge"],
[class*="badge"] {
  border-radius: 0.35rem !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  color: rgba(255, 255, 255, 0.78) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025) !important;
}

[data-slot="dialog-content"],
[role="dialog"] > div {
  background: linear-gradient(180deg, rgba(28, 28, 28, 0.96) 0%, rgba(19, 19, 19, 0.98) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 30px 64px -34px rgba(0, 0, 0, 0.92) !important;
  backdrop-filter: blur(14px) !important;
}

[data-slot="card-header"],
[data-slot="card-content"],
[data-slot="card-footer"] {
  gap: 0.75rem !important;
}

h1, h2, h3 {
  letter-spacing: -0.02em;
}

h1,
[data-slot="sidebar-group-label"]::after {
  color: #F5F5DC !important;
}

h2,
h3, h4, h5, h6 {
  color: #FFFFFF !important;
}

[data-slot="sidebar-inset"] > * > [class*="card"],
[data-slot="sidebar-inset"] > * > [class*="panel"],
[data-slot="sidebar-inset"] [class*="grid"] > [class*="card"],
[data-slot="sidebar-inset"] [class*="grid"] > [class*="panel"] {
  background: linear-gradient(180deg, rgba(25, 25, 25, 0.95) 0%, rgba(18, 18, 18, 0.98) 100%) !important;
  border-color: rgba(255, 255, 255, 0.04) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 24px 54px -34px rgba(0, 0, 0, 0.85) !important;
}

[data-slot="sidebar-inset"] main > div[class*="border"],
[data-slot="sidebar-inset"] main > section[class*="border"],
[data-slot="sidebar-inset"] main > div > div[class*="border"] {
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.94) 0%, rgba(17, 17, 17, 0.98) 100%) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  border-radius: 0.6rem !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.028), 0 22px 42px -34px rgba(0, 0, 0, 0.88) !important;
}

[data-slot="sidebar-inset"] main div[class*="grid"] > div[class*="border"] {
  background: linear-gradient(180deg, rgba(24, 24, 24, 0.9) 0%, rgba(18, 18, 18, 0.94) 100%) !important;
  border-color: rgba(255, 255, 255, 0.045) !important;
  border-radius: 0.55rem !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025) !important;
}

[data-slot="sidebar-inset"] main div[class*="grid"] > div[class*="border"] div[class*="border"],
[data-slot="sidebar-inset"] main div[class*="grid"] > div[class*="border"] button[data-slot="button"][data-variant="outline"],
[data-slot="sidebar-inset"] main div[class*="grid"] > div[class*="border"] a[class*="border"] {
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(255, 255, 255, 0.035) !important;
  border-radius: 0.45rem !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018) !important;
}

[data-slot="sidebar-inset"] main div[class*="grid"] > div[class*="border"] div[class*="border"]:hover,
[data-slot="sidebar-inset"] main div[class*="grid"] > div[class*="border"] a[class*="border"]:hover {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(74, 222, 128, 0.08) !important;
}

[data-slot="sidebar-inset"] [class*="card"] [class*="card"],
[data-slot="sidebar-inset"] [class*="card"] [class*="panel"],
[data-slot="sidebar-inset"] [class*="panel"] [class*="card"],
[data-slot="sidebar-inset"] [class*="panel"] [class*="panel"],
[data-slot="sidebar-inset"] [class*="card"] [data-slot="button"][data-variant="outline"],
[data-slot="sidebar-inset"] [class*="panel"] [data-slot="button"][data-variant="outline"] {
  background: var(--shell-surface-muted) !important;
  border-color: rgba(255, 255, 255, 0.035) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02) !important;
}

[data-slot="badge"][data-variant="secondary"],
[data-slot="badge"][data-variant="outline"],
[class*="badge"][data-variant="secondary"],
[class*="badge"][data-variant="outline"] {
  background: rgba(255, 255, 255, 0.026) !important;
  color: rgba(255, 255, 255, 0.72) !important;
}

[data-slot="badge"][data-variant="default"],
[class*="badge"][data-variant="default"],
[data-slot="badge"][data-status="success"],
[data-slot="badge"][data-status="online"],
[class*="badge"][data-status="success"],
[class*="badge"][data-status="online"] {
  background: rgba(74, 222, 128, 0.14) !important;
  border-color: rgba(74, 222, 128, 0.16) !important;
  color: #D7FBE3 !important;
}

[data-slot="badge"][data-status="warning"],
[data-slot="badge"][data-status="pending"],
[class*="badge"][data-status="warning"],
[class*="badge"][data-status="pending"] {
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.16) !important;
  color: #F6D38A !important;
}

[data-slot="badge"][data-status="error"],
[data-slot="badge"][data-status="offline"],
[class*="badge"][data-status="error"],
[class*="badge"][data-status="offline"] {
  background: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(239, 68, 68, 0.16) !important;
  color: #FFC3C3 !important;
}

/* Status badges - use brand colors */
.group.online [class*="bg-emerald"],
[class*="group-[.online]"]:is([class*="bg-emerald"]) {
  background-color: #4ADE80 !important;
}

.group.offline [class*="bg-red"],
[class*="group-[.offline]"]:is([class*="bg-red"]) {
  background-color: #EF4444 !important;
}

/* Primary hover borders */
.hover\:border-primary\/20:hover {
  border-color: rgba(74, 222, 128, 0.2) !important;
}

/* ================================================================
   LOGIN PAGE STYLING
   Selectors match the actual Olfei.TERMINAL DOM structure.
   Text replacement is handled by sed in the startup script,
   so no pseudo-element content overrides are needed here.
   ================================================================ */

/* Login overlay background */
.fixed.inset-0.bg-background {
  background: linear-gradient(135deg, #0D0D0D 0%, #141414 52%, #1A1A1A 100%) !important;
}

/* Left branding panel - reduce oversized text-7xl title */
.fixed.inset-0 [class*="md:w-2/5"] .text-7xl {
  font-size: 2.5rem !important;
  line-height: 1.5 !important;
}

/* Left branding panel subtitle */
.fixed.inset-0 [class*="md:w-2/5"] .text-muted-foreground {
  color: #B0B0B0 !important;
  letter-spacing: 0.15em !important;
}

/* Login form card */
.fixed.inset-0 .bg-card\/50,
.fixed.inset-0 [class*="bg-card"] {
  background: rgba(26, 26, 26, 0.74) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 24px 56px -30px rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(8px) !important;
}

/* Login page heading */
.fixed.inset-0 h2.text-2xl {
  color: #F5F5DC !important;
  font-family: 'JetBrains Mono', monospace !important;
  letter-spacing: -0.02em !important;
}

/* Login form description text */
.fixed.inset-0 .text-muted-foreground p,
.fixed.inset-0 .flex.flex-col.gap-5 .text-muted-foreground {
  color: #B0B0B0 !important;
}

/* ================================================================
   LOGIN BUTTON - direct fallback + brand styling
   ================================================================ */

button[data-slot="button"].bg-primary,
button.bg-primary.text-primary-foreground {
  background-color: hsl(142 71% 45%) !important;
  color: hsl(0 0% 5%) !important;
  font-weight: 600 !important;
  border: 1px solid rgba(74, 222, 128, 0.22) !important;
  transition: all 0.2s ease-in-out !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}

button[data-slot="button"].bg-primary:hover,
button.bg-primary.text-primary-foreground:hover {
  background-color: #6BE090 !important;
  box-shadow: 0 10px 22px -16px rgba(74, 222, 128, 0.7) !important;
  transform: translateY(-1px) !important;
}

button[data-slot="button"].bg-primary:active,
button.bg-primary.text-primary-foreground:active {
  background-color: #3BCF73 !important;
  transform: translateY(0) !important;
  box-shadow: 0 6px 14px -12px rgba(74, 222, 128, 0.55) !important;
}

button[data-slot="button"].bg-primary:focus-visible,
button.bg-primary.text-primary-foreground:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px #0D0D0D, 0 0 0 4px rgba(74, 222, 128, 0.3) !important;
}

/* ================================================================
   LOGIN PAGE TABS
   ================================================================ */

.fixed.inset-0 [data-slot="tabs-trigger"],
.fixed.inset-0 [role="tab"] {
  background-color: transparent !important;
  color: #B0B0B0 !important;
  transition: all 0.2s ease-in-out !important;
  border: none !important;
}

.fixed.inset-0 [data-slot="tabs-trigger"][data-state="active"],
.fixed.inset-0 [role="tab"][aria-selected="true"] {
  background-color: rgba(74, 222, 128, 0.12) !important;
  color: #FFFFFF !important;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.2) !important;
}

.fixed.inset-0 [data-slot="tabs-trigger"]:hover:not([data-state="active"]),
.fixed.inset-0 [role="tab"]:hover:not([aria-selected="true"]) {
  background-color: rgba(74, 222, 128, 0.08) !important;
  color: #E0E0E0 !important;
}

/* ================================================================
   LOGIN PAGE INPUTS
   ================================================================ */

.fixed.inset-0 input:focus,
.fixed.inset-0 textarea:focus {
  border-color: #4ADE80 !important;
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.3) !important;
}

/* ================================================================
   SONNER TOAST NOTIFICATIONS
   ================================================================ */

/* Toast container */
[data-sonner-toaster] {
  --normal-bg: #1A1A1A !important;
  --normal-text: #FFFFFF !important;
  --normal-border: #333333 !important;
}

/* Individual toast */
[data-sonner-toast] {
  background: rgba(26, 26, 26, 0.94) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 16px 36px -24px rgba(0, 0, 0, 0.85) !important;
  overflow: hidden !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  backdrop-filter: blur(8px) !important;
}

/* Toast content - prevent text overflow */
[data-sonner-toast] [data-content] {
  overflow: hidden !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}

[data-sonner-toast] [data-title] {
  color: #FFFFFF !important;
  font-size: 0.875rem !important;
  line-height: 1.4 !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}

/* Toast close button */
[data-sonner-toast] [data-close-button] {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #B0B0B0 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 0.25rem !important;
  left: 7px !important;
  top: 7px !important;
}

[data-sonner-toast] [data-close-button]:hover {
  background: #2A2A2A !important;
  color: #FFFFFF !important;
}

/* Warning type toast */
[data-sonner-toast][data-type="warning"] {
  border-left: 3px solid #F59E0B !important;
}

[data-sonner-toast][data-type="warning"] [data-icon] {
  color: #F59E0B !important;
}

/* Error type toast */
[data-sonner-toast][data-type="error"] {
  border-left: 3px solid #EF4444 !important;
}

[data-sonner-toast][data-type="error"] [data-icon] {
  color: #EF4444 !important;
}

/* Success type toast */
[data-sonner-toast][data-type="success"] {
  border-left: 3px solid #4ADE80 !important;
}

[data-sonner-toast][data-type="success"] [data-icon] {
  color: #4ADE80 !important;
}

/* Info type toast */
[data-sonner-toast][data-type="info"] {
  border-left: 3px solid #3B82F6 !important;
}

[data-sonner-toast][data-type="info"] [data-icon] {
  color: #3B82F6 !important;
}
