:root {
  /* Default theme (Tokyo Night) */
  --theme-bg: #1a1b26;
  --theme-bg-dark: #16161e;
  --theme-bg-mid: #2a2a37;
  --theme-card-bg: #16161e;
  --theme-fg: #c0caf5;
  --theme-blue: #7dcfff;
  --theme-purple: #bb9af7;
  --theme-green: #9ece6a;
  --theme-yellow: #e0af68;
  --theme-orange: #e0af68;
  --theme-red: #f7768e;
  --theme-cyan: #7dcfff;
  --theme-comment: #565f89;
  --theme-muted: #888;
  --theme-logo-white: #ffffff;
  --theme-selection: #283457;
  --theme-cursor: #7aa2f7;

  /* Default Gradients (Dark Mode) */
  --theme-gradient-1: rgba(122, 162, 247, 0.08); /* Tokyo Night Blue */
  --theme-gradient-2: rgba(187, 154, 247, 0.08); /* Tokyo Night Purple */
}

/* Global Font Enforcement */
:root,
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
div,
input,
button,
select,
textarea,
label,
.btn,
.navbar-brand {
  font-family: "JetBrains Mono", monospace !important;
}

body {
  background: var(--theme-bg);
  color: var(--theme-fg);
  font-family: "JetBrains Mono", monospace;
  overflow-x: hidden;
  background-image:
    radial-gradient(
      circle at 25% 25%,
      var(--theme-gradient-1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 75% 75%,
      var(--theme-gradient-2) 0%,
      transparent 50%
    );
  background-attachment: fixed;
}

#app {
  min-height: 100vh; /* Ensure full height */
}

#app:has(.landing-page) {
  padding: 0 !important;
}

#app:not(:has(.landing-page)) {
  padding: 20px; /* Standard gap for dashboard */
}

/* Utility Class for FAB Clearance */
.fab-clearance {
  padding-bottom: 120px !important; /* Extra space for the + button */
}

/* Floating Island Navbar */
.navbar {
  margin: 16px;
  border-radius: 12px;
  background: color-mix(
    in srgb,
    var(--theme-bg-dark),
    transparent 20%
  ) !important; /* Glass effect base */
  backdrop-filter: blur(12px);
  border: 1px solid var(--theme-bg-mid);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.navbar-brand {
  font-weight: 700;
  --bs-navbar-brand-color: #7dcfff !important;
  --bs-navbar-brand-hover-color: #7dcfff !important;
  color: #7dcfff !important;
  text-shadow: 0 0 12px rgba(125, 207, 255, 0.3);
  transition: text-shadow 0.3s ease;
}

.navbar-brand:hover {
  text-shadow: 0 0 20px rgba(125, 207, 255, 0.6), 0 0 40px rgba(125, 207, 255, 0.3);
}

.nav-link {
  color: var(--theme-fg) !important;
}

.card {
  background: var(--theme-bg-dark) !important;
  border: 1px solid var(--theme-bg-mid) !important;
  border-radius: 2px !important;
  color: var(--theme-fg);
  box-shadow: none;
}

.d-flex > .card {
  background: color-mix(
    in srgb,
    var(--theme-card-bg),
    transparent 15%
  ) !important;
  backdrop-filter: blur(10px);
  border: 1px solid var(--theme-blue) !important;
  box-shadow: 0 0 30px rgba(125, 207, 255, 0.15);
  border-radius: 4px !important;
}

.card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--theme-blue);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--theme-bg-mid);
  color: var(--theme-blue);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: bold;
}

.d-flex > .card .card-header {
  border-bottom: 1px solid var(--theme-blue) !important;
  background: transparent !important;
  color: var(--theme-blue) !important;
  text-shadow: 0 0 10px rgba(125, 207, 255, 0.5);
}

.card-footer {
  background: var(--theme-bg-dark);
  border-top: 1px solid var(--theme-bg-mid);
}

.card a {
  color: var(--theme-comment);
  text-decoration: none;
  font-size: 0.8rem;
}

.card a:hover {
  color: var(--theme-blue);
  text-decoration: underline;
}

.d-flex > .card a {
  color: var(--theme-comment) !important;
  opacity: 0.8;
  text-decoration: none;
  font-size: 0.8rem;
}

.d-flex > .card a:hover {
  color: var(--theme-blue) !important;
  text-decoration: underline;
}

.btn {
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Primary Action Button (Hero - Solid) --- */
.btn-primary {
  background: var(--theme-blue) !important; /* Solid Fill */
  border: none !important;
  color: var(--theme-bg-dark) !important; /* Dark Text */
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  box-shadow: none;
  transition: all 0.2s ease;
  border-radius: 2px; /* Sharper corners */
}

/* Hover State: Brighten */
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 8px rgba(125, 207, 255, 0.2); /* Reduced glow */
  transform: translateY(-1px);
  color: var(--theme-bg-dark) !important;
}

/* Active/Click State */
.btn-primary:active {
  background: rgba(125, 207, 255, 0.2) !important;
  transform: translateY(0);
}

.btn-success {
  background: var(--theme-green);
  color: var(--theme-bg);
  border: 1px solid var(--theme-green);
}

.btn-success:hover {
  background: var(--theme-green);
  box-shadow: 0 0 15px var(--theme-green);
}

.btn-danger {
  background: var(--theme-red);
  color: var(--theme-bg);
}

.btn-danger:hover {
  background: var(--theme-red);
  box-shadow: 0 0 15px var(--theme-red);
}

.btn-warning {
  background: var(--theme-orange);
  color: var(--theme-bg);
}

.btn-warning:hover {
  background: var(--theme-orange);
  box-shadow: 0 0 15px var(--theme-orange);
}

.btn-secondary {
  background: var(--theme-comment);
  color: var(--theme-fg);
}

.btn-secondary:hover {
  background: var(--theme-comment);
  box-shadow: 0 0 15px var(--theme-comment);
}

.btn-outline-primary {
  border-color: var(--theme-blue);
  color: var(--theme-blue);
  background: transparent;
}

.btn-outline-primary:hover {
  background: color-mix(in srgb, var(--theme-blue), transparent 90%);
  color: var(--theme-blue);
  box-shadow: 0 0 10px color-mix(in srgb, var(--theme-blue), transparent 60%);
}

.btn-outline-primary:active,
.btn-outline-primary:focus,
.btn-outline-primary.active {
  background-color: color-mix(
    in srgb,
    var(--theme-blue),
    transparent 85%
  ) !important;
  color: var(--theme-blue) !important;
  border-color: var(--theme-blue) !important;
  box-shadow: 0 0 15px var(--theme-blue) !important;
  outline: none !important;
}

.btn-outline-danger {
  border-color: var(--theme-red);
  color: var(--theme-red);
  background: transparent;
}

.btn-outline-danger:hover,
.btn-outline-danger:active,
.btn-outline-danger:focus {
  background-color: color-mix(
    in srgb,
    var(--theme-red),
    transparent 85%
  ) !important;
  color: var(--theme-red) !important;
  border-color: var(--theme-red) !important;
  box-shadow: 0 0 15px var(--theme-red) !important;
  outline: none !important;
}

.btn-outline-info {
  border-color: var(--theme-purple);
  color: var(--theme-purple);
}

.btn-outline-info:hover,
.btn-outline-info:active,
.btn-outline-info:focus,
.btn-outline-info.active {
  background-color: color-mix(
    in srgb,
    var(--theme-purple),
    transparent 85%
  ) !important;
  color: var(--theme-purple) !important;
  border-color: var(--theme-purple) !important;
  box-shadow: 0 0 15px var(--theme-purple) !important;
  outline: none !important;
}

.btn-outline-secondary {
  border-color: var(--theme-comment);
  color: var(--theme-comment);
}

.btn-outline-secondary:hover {
  background: var(--theme-fg);
  color: var(--theme-bg);
  box-shadow: 0 0 10px var(--theme-fg);
}

.btn-outline-secondary:active,
.btn-outline-secondary:focus,
.btn-outline-secondary.active {
  background-color: color-mix(
    in srgb,
    var(--theme-comment),
    transparent 85%
  ) !important; /* faint var(--theme-comment) */
  color: var(--theme-comment) !important;
  border-color: var(--theme-comment) !important;
  box-shadow: 0 0 15px var(--theme-comment) !important;
  outline: none !important;
}

/* Global Ghost Button Polish for Wireframe */
.btn-outline-primary,
.btn-outline-danger,
.btn-outline-secondary {
  background-color: transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: "JetBrains Mono", monospace;
  border-width: 1px;
  border-radius: 4px;
}

/* --- Global Ghost Success Button (Fixes Upload/Inject & Save) --- */
.btn-outline-success {
  background: transparent !important;
  border: 1px solid var(--theme-green) !important;
  color: var(--theme-green) !important;
  transition: all 0.2s ease;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Hover State (Glowing Neon) */
.btn-outline-success:hover:not(:disabled),
.btn-outline-success:focus:not(:disabled),
.btn-outline-success:active:not(:disabled) {
  background: color-mix(
    in srgb,
    var(--theme-green),
    transparent 90%
  ) !important; /* 10% Tint */
  color: var(--theme-green) !important;
  box-shadow: 0 0 8px color-mix(in srgb, var(--theme-green), transparent 80%) !important; /* Reduced glow */
  text-shadow: none;
  transform: translateY(-1px);
  border-color: var(--theme-green) !important;
  outline: none !important;
}

/* Disabled State (Dimmed but visible) */
.btn-outline-success:disabled {
  opacity: 0.3 !important;
  background: transparent !important;
  border-color: var(--theme-green) !important;
  color: var(--theme-green) !important;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
}

/* --- Global Ghost Info Button (Fixes Download Button) --- */
.btn-outline-info {
  background: transparent !important;
  border: 1px solid var(--theme-purple) !important;
  color: var(--theme-purple) !important;
  transition: all 0.2s ease;
  font-weight: 700; /* Match the others */
  letter-spacing: 1px;
}

.btn-outline-info:hover,
.btn-outline-info:focus,
.btn-outline-info:active {
  background: color-mix(
    in srgb,
    var(--theme-purple),
    transparent 90%
  ) !important; /* 10% Tint only */
  color: var(--theme-purple) !important;
  box-shadow: 0 0 8px color-mix(in srgb, var(--theme-purple), transparent 80%) !important; /* Reduced Glow */
  text-shadow: none;
  transform: translateY(-1px);
  border-color: var(--theme-purple) !important;
  outline: none !important;
}

/* --- Global Ghost Danger Button (Fixes Reset/Purge) --- */
.btn-outline-danger {
  background: transparent !important;
  border: 1px solid var(--theme-red) !important;
  color: var(--theme-red) !important;
  transition: all 0.2s ease;
  font-weight: 700;
  letter-spacing: 1px;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger:active {
  background: color-mix(
    in srgb,
    var(--theme-red),
    transparent 90%
  ) !important; /* 10% Tint */
  color: var(--theme-red) !important;
  box-shadow: 0 0 8px color-mix(in srgb, var(--theme-red), transparent 80%) !important; /* Reduced Glow */
  text-shadow: none;
  transform: translateY(-1px);
  border-color: var(--theme-red) !important;
  outline: none !important;
}

.form-control,
.form-select {
  background: var(--theme-bg-dark) !important;
  border: 1px solid var(--theme-bg-mid) !important;
  color: var(--theme-fg) !important;
  border-radius: 2px !important;
  text-transform: none !important;
  letter-spacing: 1px;
  font-size: 0.8rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--theme-blue) !important;
  box-shadow: 0 0 10px rgba(125, 207, 255, 0.1) !important;
}

.form-control::placeholder,
.form-select::placeholder {
  color: var(--theme-comment) !important;
  opacity: 0.6;
  text-transform: uppercase !important;
  letter-spacing: 1px;
  font-size: 0.8rem;
}

option {
  text-transform: none;
}

.form-check-input {
  background-color: var(--theme-bg-dark);
  border: 2px solid var(--theme-fg);
  border-radius: 1px;
}

.form-check-input {
  border-color: var(--theme-bg-mid) !important;
}

.form-check-input:checked {
  background-color: var(--theme-green);
  border-color: var(--theme-green);
}

.form-check-label {
  color: var(--theme-fg) !important;
  text-transform: uppercase !important;
  font-size: 0.8rem;
}

.form-label {
  text-transform: uppercase !important;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--theme-purple);
}

/* Glass Terminal Modals */
.modal-content {
  background: color-mix(
    in srgb,
    var(--theme-bg-dark),
    transparent 5%
  ) !important; /* Glass Terminal */
  backdrop-filter: blur(16px);
  border: 1px solid var(--theme-blue) !important; /* Blue Border */
  border-radius: 8px !important;
  color: var(--theme-fg);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
  background: transparent;
  border-bottom: none !important;
  color: var(--theme-blue);
  padding: 1.5rem 1.5rem 0 1.5rem;
}

.modal-title {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--theme-blue) !important;
}

.modal-body {
  background: transparent;
  padding: 1.5rem;
}

.modal-footer {
  background: transparent;
  border-top: none !important;
  padding: 0 1.5rem 1.5rem 1.5rem;
}

.mb-3.border.p-2.rounded {
  background-color: var(--theme-bg-dark) !important;
  border-color: var(--theme-orange) !important;
  transition: all 0.3s ease;
}

.mb-3.border.p-2.rounded label,
.mb-3.border.p-2.rounded .form-label {
  text-transform: uppercase !important;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--theme-orange) !important;
}

/* Force checkbox labels to use standard text color, not the container's orange */
.mb-3.border.p-2.rounded .form-check-label {
  color: var(--theme-fg) !important;
  opacity: 0.9; /* Optional: slight dim to distinguish from input text */
}

.badge.bg-secondary {
  background: transparent !important;
  border: 1px solid var(--theme-blue);
  color: var(--theme-purple);
  font-family: "JetBrains Mono", monospace;
  border-radius: 4px;
  box-shadow: 0 0 4px color-mix(in srgb, var(--theme-blue), transparent 70%);
}

.pagination .page-link {
  border-radius: 2px;
  margin-right: 4px;
  border: none;
  background: var(--theme-bg-mid) !important;
  color: var(--theme-fg) !important;
}

.pagination .page-link:hover {
  background: var(--theme-blue) !important;
  color: var(--theme-bg) !important;
  font-weight: bold;
}

.pagination .page-item.active .page-link {
  background: var(--theme-blue) !important;
  color: var(--theme-bg) !important;
  font-weight: bold;
}

.text-muted {
  color: var(--theme-muted) !important;
}

.text-success {
  color: var(--theme-green) !important;
}

.text-warning {
  color: var(--theme-orange) !important;
}

.text-danger {
  color: var(--theme-red) !important;
}

.text-blue {
  color: var(--theme-blue) !important;
}

.text-red {
  color: var(--theme-red) !important;
}

/* --- Hyprland Card Design (Refactored) --- */
.client-card {
  background: var(--theme-card-bg) !important;
  border: 1px solid var(--theme-bg-mid) !important;
  border-radius: 8px !important; /* Hyprland Standard */
  box-shadow: none;
  overflow: hidden;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.client-card .card-body {
  background: transparent;
  padding: 1.25rem; /* More breathing room */
}

/* Active/Hover State (Hyprland Focus) */
.client-card:hover,
.client-card.focused {
  border-color: var(--theme-blue-bright) !important;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 0 0 1px var(--theme-blue-bright) !important; /* Crisp highlight */
  transform: translateY(-2px);
}

.client-card.selected-card {
  border-color: var(--theme-blue) !important;
  box-shadow: 0 0 0 2px var(--theme-blue) !important; /* Stronger highlight */
  background: color-mix(
    in srgb,
    var(--theme-blue),
    transparent 95%
  ) !important; /* Very subtle tint */
}

/* Header: No Border, just spacing */
.client-card .card-header {
  background: transparent;
  border-bottom: none !important; /* Remove divider */
  padding: 1.25rem 1.25rem 0 1.25rem; /* Top padding only */
}

.client-card .card-header .card-title {
  color: var(--theme-purple) !important; /* Client Name - Purple */
  font-weight: 800; /* Extra Bold */
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  text-shadow: none;
}

/* Footer: No Border */
.client-card .card-footer {
  background: transparent;
  border-top: none !important; /* Remove divider */
  padding: 0 1.25rem 1.25rem 1.25rem; /* Bottom padding only */
}

.modal-title,
.card-title {
  /* Removed text-transform: uppercase to allow proper casing */
  letter-spacing: 1px;
}

/* --- Spec List (Icon Based) --- */

.spec-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.spec-icon {
  color: var(--theme-comment) !important; /* Force icons to stay dim */
  font-size: 1.2rem;
  width: 20px;
  text-align: center;
  transition: color 0.2s;
  opacity: 0.7; /* Extra layer of subtlety */
}

/* On hover, light the icon up too */
.spec-row:hover .spec-icon {
  color: var(--theme-blue) !important;
  opacity: 1;
}

.spec-value {
  color: var(--theme-fg) !important; /* Standard Text - White/Black */
  font-size: 1.1rem; /* Increased size */
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tech Font Utility (Phone Numbers) */
.tech-font {
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 1px;
  font-weight: 700;
}

.spec-sub {
  color: var(--theme-comment);
  font-size: 0.75em;
  text-transform: uppercase;
  margin-left: 6px;
  letter-spacing: 0.5px;
}

/* Color overrides for specific icons */
.text-blue {
  color: var(--theme-blue) !important;
}
.text-purple {
  color: var(--theme-purple) !important;
}
.text-fg {
  color: var(--theme-fg) !important;
}

/* Refined Badges (Pills) */
.model-badge,
.voice-badge,
.sst-badge {
  background: color-mix(in srgb, var(--theme-blue), transparent 85%);
  color: var(--theme-blue);
  border: none !important;
  padding: 6px 14px; /* Increased padding */
  border-radius: 50px; /* Pill Shape */
  font-size: 0.85rem; /* Increased font size */
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* --- Tool Badges (Chip Style) --- */
.tool-badge {
  background: color-mix(
    in srgb,
    var(--theme-yellow),
    transparent 85%
  ); /* Soft Fill */
  color: var(--theme-yellow);
  border: none !important; /* No Border */

  /* Pill Shape */
  border-radius: 50px;
  padding: 6px 14px; /* Increased padding */

  /* Typography */
  font-size: 0.85rem; /* Increased font size */
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;

  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

/* Optional: Dimmed state for disabled tools */
.tool-badge.disabled {
  background: transparent;
  color: var(--theme-comment);
  border: 1px dashed var(--theme-comment);
  opacity: 0.5;
}

.client-card .text-muted {
  color: var(--theme-comment) !important;
}

/* --- Edit Button (Icon Only Stealth) --- */
.btn-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: all 0.2s ease;
  border-radius: 4px;
  padding: 0.25rem; /* Compact */

  /* Stealth Default */
  background: transparent !important;
  border: none !important;
  color: var(--theme-comment) !important;
  box-shadow: none;
}

.btn-edit:hover {
  background: color-mix(in srgb, var(--theme-blue), transparent 90%) !important;
  color: var(--theme-blue) !important;
  box-shadow: 0 0 8px color-mix(in srgb, var(--theme-blue), transparent 90%); /* Reduced glow */
  text-shadow: none;
}

.client-card .card-footer .form-check-input {
  margin-left: 0 !important; /* Overrides Bootstrap's -1.5em ghost margin */
  margin-top: 0;
}

/* --- Client Status Toggle Buttons (Soft Fill) --- */
.status-toggle-btn {
  font-weight: 700;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  min-width: 40px;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: none !important; /* No Border */
}

/* Online State (Green) */
.client-card .btn-outline-success {
  background: color-mix(
    in srgb,
    var(--theme-green),
    transparent 85%
  ) !important;
  color: var(--theme-green) !important;
  border: none !important;
}

.client-card .btn-outline-success:hover {
  background: color-mix(
    in srgb,
    var(--theme-green),
    transparent 75%
  ) !important;
  box-shadow: 0 0 8px color-mix(in srgb, var(--theme-green), transparent 80%); /* Reduced glow */
  text-shadow: none;
}

/* Offline State (Red) */
.client-card .btn-outline-danger {
  background: color-mix(in srgb, var(--theme-red), transparent 85%) !important;
  color: var(--theme-red) !important;
  border: none !important;
}

.client-card .btn-outline-danger:hover {
  background: color-mix(in srgb, var(--theme-red), transparent 75%) !important;
  box-shadow: 0 0 8px color-mix(in srgb, var(--theme-red), transparent 80%); /* Reduced glow */
  text-shadow: none;
}

/* Blinking dot */
.status-icon {
  font-size: 1.2em;
  line-height: 0;
  padding-bottom: 2px;
}

.btn-outline-success .status-icon {
  animation: blink 2s infinite;
  text-shadow: 0 0 5px currentColor;
}

@keyframes blink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* --- Pulse Icon Animation for Live Transmissions --- */
.pulse-icon {
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% {
    text-shadow: 0 0 0 rgba(247, 118, 142, 0.7);
  }
  70% {
    text-shadow: 0 0 10px rgba(247, 118, 142, 0);
  }
  100% {
    text-shadow: 0 0 0 rgba(247, 118, 142, 0);
  }
}

.audit-log {
  max-height: 300px;
  overflow-y: auto;
  background: var(--theme-bg-dark) !important;
  border: 1px solid var(--theme-bg-mid);
  border-radius: 6px;
  font-size: 0.65rem;
  font-family: "JetBrains Mono", monospace;
}

.audit-log ::-webkit-scrollbar {
  width: 8px;
}

.audit-log ::-webkit-scrollbar-track {
  background: var(--theme-bg-dark);
}

.audit-log ::-webkit-scrollbar-thumb {
  background: var(--theme-bg-mid);
  border-radius: 4px;
}

.audit-log ::-webkit-scrollbar-thumb:hover {
  background: var(--theme-comment);
}

.template-selector {
  max-width: 200px;
}

h2,
h5,
h6 {
  color: var(--theme-purple);
  font-weight: 700;
}

.position-fixed .card {
  background: var(--theme-bg-mid);
  border: 1px solid var(--theme-bg-dark);
}

.btn-close {
  /* Universal mid-grey (#808080) for visibility on both light and dark themes */
  filter: invert(0.5) !important;
  opacity: 0.8; /* Slight transparency to blend better */
}

.btn-close:hover {
  /* Brighten slightly on hover for feedback */
  filter: invert(0.8) !important;
  opacity: 1;
}

/* Dropdown Theming */
.dropdown-menu {
  background: var(--theme-bg-dark);
  border: 1px solid var(--theme-bg-mid);
  color: var(--theme-fg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  padding: 0.5rem;
}

.dropdown-item {
  color: var(--theme-fg);
  background: transparent;
  font-family: "JetBrains Mono", monospace;
}

.dropdown-item:hover {
  background-color: transparent !important;
  color: var(--theme-blue);
}

.dropdown-item.active {
  background: var(--theme-blue);
  color: var(--theme-bg);
}

.dropdown-header {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: var(--theme-comment);
  font-weight: 600;
}

.dropdown-divider {
  border-color: var(--theme-bg-mid);
}

.dropdown-item.logout-item {
  color: var(--theme-red);
  cursor: pointer;
}

.dropdown-item.logout-item:hover {
  background-color: transparent !important;
  color: var(--theme-red);
  text-shadow: 0 0 8px var(--theme-red);
}

/* Tabs Styling */
.nav-tabs {
  border: none;
  margin-bottom: 0;
}

.nav-tabs .nav-link {
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  border: none !important; /* Remove box borders */
  background: transparent !important;
  color: var(--theme-comment) !important;
  padding: 0.75rem 1.5rem;
  margin-right: 4px;
  border-bottom: 2px solid transparent !important; /* Prep for active state */
  transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
  color: var(--theme-fg) !important;
}

.nav-tabs .nav-link.active {
  border-bottom: 2px solid var(--theme-blue) !important; /* Bottom Glow */
  color: var(--theme-blue) !important;
  text-shadow: 0 0 10px var(--theme-blue);
  background: transparent !important;
  box-shadow: none;
}

/* Top Right Action Buttons */
.nav-tabs .btn.btn-sm {
  background: transparent !important;
  border: 1px solid currentColor !important;
  padding: 4px 12px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: none !important;
}

.nav-tabs .btn.btn-sm:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 0 10px currentColor !important;
  transform: translateY(-1px);
}

.nav-tabs .btn-outline-secondary {
  color: var(--theme-fg) !important;
  border-color: var(--theme-fg) !important;
  opacity: 0.8;
}

.nav-tabs .btn-outline-secondary:hover {
  opacity: 1;
  box-shadow: 0 0 10px var(--theme-fg) !important;
  background: rgba(125, 125, 125, 0.1) !important;
}

.btn-fab {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 1000;
  width: 50px;
  height: 50px;
  border-radius: 2px;
  background: var(--theme-bg-dark) !important;
  border: 2px solid var(--theme-green) !important;
  color: var(--theme-green) !important;
  font-size: 1.5rem;
  font-weight: bold;
  box-shadow: 0 0 15px rgba(158, 206, 106, 0.3);
  transition: all 0.2s ease;
}

.btn-fab:hover {
  box-shadow: 0 0 25px var(--theme-green);
  transform: translateY(-2px);
  text-shadow: 0 0 10px var(--theme-green);
}

/* Table Styling (Floating Rows) */
.table-custom {
  --bs-table-bg: transparent;
  --bs-table-color: var(--theme-fg);
  --bs-table-hover-bg: transparent;
  --bs-table-hover-color: var(--theme-fg);
  --bs-table-active-bg: transparent;
  --bs-table-active-color: var(--theme-fg);
  background-color: transparent;
  color: var(--theme-fg) !important;
  border-collapse: separate !important;
  border-spacing: 0 6px !important; /* Vertical Gap */
}

.table-custom thead th {
  background: transparent !important;
  border-bottom: 1px solid var(--theme-bg-mid) !important;
  text-transform: uppercase;
  color: var(--theme-comment) !important;
  letter-spacing: 2px;
  font-size: 0.8rem;
  padding-bottom: 12px;
}

/* Reset default striping and backgrounds */
.table-custom tbody tr {
  background-color: var(--theme-bg-dark) !important;
  transition: none !important; /* Disable transition to prevent artifacts */
}

/* Floating Row Appearance */
.table-custom tbody td {
  border: none !important; /* Remove internal borders */
  border-top: 1px solid var(--theme-bg-mid) !important;
  border-bottom: 1px solid var(--theme-bg-mid) !important;
  vertical-align: middle;
  padding: 12px;
  box-shadow: none !important; /* Prevent Bootstrap hover artifacts */
  transition: none !important; /* Ensure no delay on cells either */
}

.table-custom tbody td:first-child {
  border-left: 1px solid var(--theme-bg-mid) !important;
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.table-custom tbody td:last-child {
  border-right: 1px solid var(--theme-bg-mid) !important;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

/* Active Row Hover */
.table-custom tbody tr:hover {
  background-color: transparent !important; /* Moved to td */
  box-shadow: none; /* Moved to td */
}

/* Apply background to cells to respect border-radius */
.table-custom tbody tr:hover td {
  background-color: var(--theme-bg-mid) !important;
  border-color: transparent !important;
  box-shadow: none !important; /* Kill any leakage */
}

/* Apply indicator to first cell */
.table-custom tbody tr:hover td:first-child {
  box-shadow: inset 4px 0 0 var(--theme-purple) !important;
}

.table-custom tbody tr.selected {
  background: transparent !important;
  box-shadow: none;
}

.table-custom tbody tr.selected td {
  background: var(--theme-bg-mid) !important;
  border-color: transparent !important;
}

.table-custom tbody tr.selected td:first-child {
  box-shadow: inset 4px 0 0 var(--theme-blue) !important;
}

/* Conversation Transcript */
.conversation-transcript {
  height: 100%;
  overflow-y: auto;
}

.conversation-transcript.expanded {
  height: 100% !important;
  max-height: unset !important;
}

/* Logs View Split-Pane Layout */
.logs-view .table-responsive,
.contacts-tab .table-responsive {
  border: none !important;
  background: transparent !important;
  height: calc(100vh - 260px);
  overflow-y: auto;
  display: block;
  transition: border 0.2s ease;
}

.logs-view .table-responsive::-webkit-scrollbar-track,
.contacts-tab .table-responsive::-webkit-scrollbar-track {
  margin-top: 48px !important;
  background-color: transparent !important;
}

.logs-view .table-custom thead th {
  position: sticky;
  top: 0;
  border-top: none !important;
  border-bottom: 1px solid var(--theme-bg-mid) !important;
}

/* Uppercase System Status in Call Logs */
.logs-view .table-custom tbody td:last-child {
  text-transform: uppercase !important;
  letter-spacing: 1px;
  font-size: 0.75rem;
  font-weight: 600;
}

.logs-view .table-custom thead th,
.contacts-tab .table-custom thead th {
  position: sticky;
  top: 0;
  border-bottom: none !important;
  box-shadow: inset 0 -1px 0 var(--theme-bg-mid) !important;
  background: var(--theme-bg-dark) !important;
}

.logs-view .card {
  height: calc(100vh - 260px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--theme-bg-mid) !important;
  background: var(--theme-bg-dark) !important;
  transition: border 0.2s ease;
}

.logs-view .table-responsive.focused,
.contacts-tab .table-responsive.focused {
  border: var(--theme-border-active) solid var(--theme-blue) !important;
}

/* Keep Contacts container static on hover */
.logs-view .card.focused {
  border: var(--theme-border-active) solid var(--theme-blue) !important;
}

.logs-view .card-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
}

.conversation-transcript {
  height: 100%;
  max-height: none !important;
  overflow-y: auto;
  padding: 1rem;
}

.message {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
}

.message.assistant {
  background: var(--theme-bg-dark);
  border-left: 3px solid var(--theme-blue);
}

.message.user {
  background: var(--theme-bg-dark);
  border-left: 3px solid var(--theme-purple);
}

.message.tool {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--theme-comment);
}

/* System Action: Subtle Orange Background + Orange Border */
.message.msg-action {
  background: color-mix(
    in srgb,
    var(--theme-orange),
    transparent 92%
  ) !important; /* faint var(--theme-orange) */
  border-left: 3px solid var(--theme-orange) !important;
  color: var(--theme-fg);
}

/* Tool Result: Subtle Green Background + Green Border */
.message.msg-result {
  background: color-mix(
    in srgb,
    var(--theme-green),
    transparent 92%
  ) !important; /* faint var(--theme-green) */
  border-left: 3px solid var(--theme-green) !important;
  color: var(--theme-fg);
}

/* Update: Make transcript labels neutral, letting the border do the work */
.message strong {
  color: var(--theme-comment) !important; /* Was Blue/Purple, now Grey */
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.message p {
  margin: 0;
  color: var(--theme-fg);
}

/* Expanded Transcript View (Full Screen Overlay) */
.expanded-transcript {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999; /* Sit on top of the navbar and everything else */
  background: var(--theme-bg); /* Opaque background to hide the app behind it */
  padding: 1.5rem; /* Breathing room from the screen edge */
  box-sizing: border-box;
  animation: fadeIn 0.3s ease;
}

.logs-view {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ASCII Art Logo Styling */
.ascii-logo {
  color: var(--theme-blue) !important;
  font-family: "SF Mono", Monaco, "Liberation Mono", Consolas, Menlo, monospace;
  font-weight: 700;
  font-size: 0.72em;
  text-shadow:
    0 0 0 var(--theme-blue),
    0 0 0 var(--theme-blue),
    0 0 0 var(--theme-blue);
  line-height: 1;
}

/* Fix Pre tag in navbar */
.navbar-brand pre {
  font-family: "JetBrains Mono", monospace;
  background-color: transparent !important; /* Force remove white box */
  border: none !important;
  margin-bottom: 0 !important; /* Remove default bottom margin */
  overflow: hidden; /* Prevent scrollbars */
}

/* Global selection */
::selection {
  background: var(--theme-selection);
  color: var(--theme-fg);
}

/* Theme-aware scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent !important;
}

::-webkit-scrollbar-thumb {
  background: var(--theme-bg-mid);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--theme-blue);
}

::-webkit-scrollbar-corner {
  background: transparent !important;
}

/* Fullscreen System Prompt Editor */
.system-prompt-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  background: var(--theme-bg);
  padding: 1.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

.system-prompt-fullscreen-textarea {
  flex: 1;
  min-height: 0 !important;
  height: 100% !important;
  resize: vertical;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  border: 1px solid var(--theme-bg-mid);
  background: var(--theme-bg-dark);
  color: var(--theme-fg);
  padding: 1rem;
  border-radius: 4px;
}

.system-prompt-fullscreen-textarea:focus {
  border-color: var(--theme-blue);
  box-shadow: 0 0 0 0.2rem rgba(125, 207, 255, 0.25);
  outline: none;
}

.system-prompt-fullscreen-textarea::placeholder {
  color: var(--theme-comment);
}

/* Navbar User Dropdown - Force Wireframe */
.navbar .nav-item .btn-outline-secondary,
.navbar #userDropdown {
  background: transparent !important;
  border: 1px solid var(--theme-bg-mid) !important;
  color: var(--theme-comment) !important;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.8rem;
  box-shadow: none !important;
}

/* Hover/Active/Focus - Glass & Neon Only */
.navbar .nav-item .btn-outline-secondary:hover,
.navbar .nav-item .btn-outline-secondary:focus,
.navbar .nav-item .btn-outline-secondary:active,
.navbar .nav-item.show .btn-outline-secondary,
.navbar #userDropdown:hover,
.navbar #userDropdown:focus,
.navbar .show > #userDropdown {
  background-color: color-mix(
    in srgb,
    var(--theme-blue),
    transparent 90%
  ) !important; /* Transparent Blue Tint */
  color: var(--theme-blue) !important;
  border-color: var(--theme-blue) !important;
  box-shadow: 0 0 15px color-mix(in srgb, var(--theme-blue), transparent 70%) !important; /* Neon Glow */
  transform: none !important;
}

/* Dropdown Menu - Wireframe Terminal Overhaul */
.dropdown-menu {
  background: var(--theme-bg-dark) !important;
  border: 1px solid var(--theme-blue) !important;
  border-radius: 2px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
}

.dropdown-item {
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.75rem;
  color: var(--theme-fg) !important;
}

.dropdown-item:hover {
  background: transparent !important;
  color: var(--theme-blue) !important;
  text-shadow: 0 0 8px var(--theme-blue);
}

.dropdown-item-text {
  color: var(--theme-comment) !important;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
}

.dropdown-header {
  color: var(--theme-orange) !important;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-left: 1rem;
}

.dropdown-item.logout-item {
  color: var(--theme-red) !important;
}

.dropdown-item.logout-item:hover {
  color: var(--theme-red) !important;
  text-shadow: 0 0 8px var(--theme-red);
}

/* System Log Terminal */
.terminal-console {
  background-color: var(--theme-bg-dark) !important; /* Pure black */
  border: 1px solid var(--theme-bg-mid);
  padding: 15px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--theme-green); /* Matrix green text */
  height: 400px;
  overflow-y: auto;
  border-radius: 2px;
}
.terminal-console .log-entry {
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.terminal-console .log-timestamp {
  color: var(--theme-comment);
  margin-right: 10px;
}

/* Global Wireframe for Secondary Buttons (Cancel, Select All, etc) */
.btn-outline-secondary {
  background: transparent !important;
  color: var(--theme-comment) !important;
  border: 1px solid var(--theme-comment) !important;
  box-shadow: none !important;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
  background-color: rgba(86, 95, 137, 0.15) !important; /* Transparent tint */
  color: var(--theme-fg) !important; /* Brighten text */
  border-color: var(--theme-fg) !important; /* Brighten border */
  box-shadow: 0 0 10px var(--theme-fg) !important; /* White/Grey Glow */
  transform: translateY(-1px);
}

/* Inline table input styling */
.table-inline-input {
  background: var(--theme-bg-mid) !important; /* Darker background */
  border: 1px solid var(--theme-blue) !important;
  border-radius: 4px;
  color: var(--theme-fg) !important;
  font-family: "JetBrains Mono", monospace;
  padding: 4px 8px;
  height: 28px; /* Compact height */
  width: 100%;
  max-width: 250px; /* Restrict width */
  outline: none;
  transition: all 0.2s ease;
}

.table-inline-input:focus {
  border-color: var(--theme-green) !important;
  box-shadow: 0 0 10px rgba(158, 206, 106, 0.2) !important;
}

/* Delete button styling for contacts table */
.contacts-tab .table-custom .btn-action-delete {
  border: none !important;
  background: transparent !important;
  color: var(--theme-comment) !important;
  font-size: 0.75rem;
  text-transform: uppercase;
  padding: 0;
  margin-left: 15px; /* Spacing from View History */
}
.contacts-tab .table-custom .btn-action-delete:hover {
  color: var(--theme-red) !important;
  text-shadow: 0 0 8px var(--theme-red);
  text-decoration: underline;
}

/* Fix File Input Alignment */
.form-control[type="file"] {
  padding: 0.2rem !important;
  background: var(--theme-bg-dark) !important;
  border: 1px solid var(--theme-bg-mid) !important;
  height: 31px; /* Match btn-sm height */
}

/* Custom Wireframe File Input */
input[type="file"] {
  background: transparent !important;
  border: 1px solid var(--theme-bg-mid) !important;
  color: var(--theme-comment) !important;
  padding: 0.3rem !important;
  height: auto !important;
  cursor: pointer !important;
}

/* --- Table Color Overrides --- */
/* Ensure utility classes win over the global table text color */
.table-custom td.text-success {
  color: var(--theme-green) !important;
}

.table-custom td.text-muted {
  color: var(--theme-comment) !important;
}

.table-custom td.text-blue {
  color: var(--theme-blue) !important;
}

.table-custom td.text-purple {
  color: var(--theme-purple) !important;
}

/* --- Utility Override: Force Border Removal --- */
/* This allows us to have "Icon Only" buttons by adding class="border-0" */
.btn.border-0 {
  border: none !important;
}

/* Optional: When hovering a borderless icon, just glow the text/icon, don't show the box */
.btn.border-0:hover {
  box-shadow: none !important;
  background: transparent !important;
  transform: scale(1.2); /* Slight zoom for feedback */
}

/* Specific Glows for the borderless icons */
.btn-outline-primary.border-0:hover {
  text-shadow: 0 0 10px var(--theme-blue);
}
.btn-outline-info.border-0:hover {
  text-shadow: 0 0 10px var(--theme-purple);
}
.btn-outline-danger.border-0:hover {
  text-shadow: 0 0 10px var(--theme-red);
}
/* Target the internal button */
input[type="file"]::file-selector-button {
  background: transparent !important;
  border: 1px solid var(--theme-blue) !important;
  color: var(--theme-blue) !important;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 16px;
  margin-right: 15px;
  min-width: 120px;
  text-align: center;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}
input[type="file"]::file-selector-button:hover {
  background: color-mix(in srgb, var(--theme-blue), transparent 85%) !important;
  box-shadow: 0 0 10px var(--theme-blue);
}

/* --- Pulse Icon Animation for Live Transmissions --- */
.pulse-icon {
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% {
    text-shadow: 0 0 0 rgba(247, 118, 142, 0.7);
  }
  70% {
    text-shadow: 0 0 10px rgba(247, 118, 142, 0);
  }
  100% {
    text-shadow: 0 0 0 rgba(247, 118, 142, 0);
  }
}

/* --- Stripe Billing Styles --- */
.clickable-fuel {
  transition: all 0.2s ease;
}

.clickable-fuel:hover {
  transform: translateY(-1px);
  filter: none !important; /* Remove brightness bloom */
  /* Subtle shadow using theme color */
  box-shadow: 0 4px 12px color-mix(in srgb, var(--theme-cyan), transparent 80%) !important;
  cursor: pointer;
}

/* Top Up Modal Tweaks */
.modal-content {
  border: 1px solid var(--theme-bg-mid);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Refuel Modal - Brighter Text */
.modal-content .text-muted {
  color: #a9b1d6 !important;
}

.modal-content .table-custom th {
  color: var(--theme-cyan) !important;
  font-weight: 600;
}

.modal-content .table-custom td {
  color: var(--theme-fg) !important;
}

.modal-content .text-fg {
  color: #c0caf5 !important;
}

.display-6 {
  font-family: "JetBrains Mono", monospace;
  letter-spacing: -1px;
}

.badge.bg-dark {
  background-color: var(--theme-bg-dark) !important;
  color: var(--theme-fg) !important;
  font-weight: 500;
}

/* --- Unified Fuel Gauge (Stealth) --- */
.fuel-gauge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 0.75rem;
  font-family: "JetBrains Mono", monospace !important;
  padding: 0.25rem 0.75rem;
  border-radius: 4px !important;
  transition: all 0.2s ease;
  min-width: 80px;
  white-space: nowrap;
  border: none !important;
}

/* Cyan State (Active) */
.fuel-cyan {
  background: color-mix(in srgb, var(--theme-cyan), transparent 85%) !important;
  color: var(--theme-cyan) !important;
}
.fuel-cyan:hover {
  background: color-mix(in srgb, var(--theme-cyan), transparent 75%) !important;
  box-shadow: 0 0 8px color-mix(in srgb, var(--theme-cyan), transparent 80%) !important;
  transform: translateY(-1px);
}

/* Low State (Warning) */
.fuel-low {
  background: color-mix(in srgb, var(--theme-red), transparent 85%) !important;
  color: var(--theme-red) !important;
}
.fuel-low:hover {
  background: color-mix(in srgb, var(--theme-red), transparent 75%) !important;
  box-shadow: 0 0 8px color-mix(in srgb, var(--theme-red), transparent 80%) !important;
  transform: translateY(-1px);
}

/* --- SUPER FORCE MODAL BACKDROP --- */
/* Target every possible state of the backdrop */
.modal-backdrop,
.modal-backdrop.fade,
.modal-backdrop.show,
div.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.85) !important; /* Heavy Dark Dim */
  /* Vendor Prefixes for Safari/Chrome/Firefox */
  -webkit-backdrop-filter: blur(8px) !important;
  backdrop-filter: blur(8px) !important;
  opacity: 1 !important;
  z-index: 1050 !important; /* Ensure it sits on top of navbar */
}

/* --- Fix for Bootstrap Switches --- */
.form-switch .form-check-input {
  border-radius: 2em !important; /* Fix square corners */
  width: 2.5em !important;
  background-color: var(--theme-bg-mid) !important; /* Track color */
  border-color: var(--theme-bg-mid) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23888'/%3e%3c/svg%3e") !important; /* Grey Knob */
}

.form-switch .form-check-input:checked {
  background-color: var(--theme-green) !important; /* Green Track */
  border-color: var(--theme-green) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important; /* White Knob */
}

/* --- Additional Utility Classes --- */
.border-blue {
  border-color: var(--theme-blue) !important;
}

.border-purple {
  border-color: var(--theme-purple) !important;
}

.text-comment {
  color: var(--theme-comment) !important;
}

/* Disable hover effects for static tables */
.table-no-hover tbody tr:hover {
  background-color: transparent !important;
}

.table-no-hover tbody tr:hover td {
  background-color: transparent !important;
  border-color: inherit !important;
  box-shadow: none !important;
}

/* === Landing Page Styles === */
.landing-page {
  padding: 0;
}

.landing-page .card {
  background: var(--theme-bg-dark) !important;
  border: 1px solid var(--theme-bg-mid) !important;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-page .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(125, 207, 255, 0.1);
}

.landing-page .card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--theme-bg-mid) !important;
  padding: 1rem 1.5rem;
}

.landing-page .card-body {
  padding: 1.5rem;
}

.landing-page .card-title {
  color: var(--theme-fg);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.landing-page .card-text {
  color: var(--theme-muted);
  line-height: 1.6;
}

.landing-page .btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.landing-page .form-control {
  background: var(--theme-bg-mid) !important;
  border: 1px solid var(--theme-bg-mid) !important;
  color: var(--theme-fg) !important;
  padding: 0.75rem 1rem;
}

.landing-page .form-control:focus {
  background: var(--theme-bg-mid) !important;
  border-color: var(--theme-cyan) !important;
  box-shadow: 0 0 0 0.2rem rgba(125, 207, 255, 0.15) !important;
}

.landing-page .form-label {
  color: var(--theme-fg);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.landing-page .lead {
  font-size: 1.1rem;
  line-height: 1.7;
}

/* ── Landing Page Tokyo Night Style ── */
.landing-page {
  padding: 0;
}

.landing-page .card {
  background: rgba(22, 22, 30, 0.6) !important;
  border: 1px solid var(--theme-bg-mid) !important;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.landing-page .card:hover {
  border-color: rgba(125, 207, 255, 0.3) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.landing-page h1,
.landing-page h2,
.landing-page h3,
.landing-page h5,
.landing-page h6 {
  font-family: "JetBrains Mono", monospace;
}

.landing-page .btn-primary {
  background: var(--theme-cyan) !important;
  border-color: var(--theme-cyan) !important;
  color: var(--theme-bg-dark) !important;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 12px 32px;
  transition: all 0.2s ease;
}

.landing-page .btn-primary:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 25px rgba(125, 207, 255, 0.4);
  transform: translateY(-2px);
}

.landing-page .btn-outline-primary {
  border: 2px solid var(--theme-purple) !important;
  color: var(--theme-purple) !important;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 12px 32px;
}

.landing-page .btn-outline-primary:hover {
  background: var(--theme-purple) !important;
  color: var(--theme-bg-dark) !important;
  box-shadow: 0 0 20px rgba(187, 154, 247, 0.3);
}

.landing-page .btn-outline-secondary {
  border: 1px solid var(--theme-comment) !important;
  color: var(--theme-muted) !important;
}

.landing-page .btn-outline-secondary:hover {
  border-color: var(--theme-fg) !important;
  color: var(--theme-fg) !important;
  background: transparent !important;
}

.landing-page a.text-muted:hover {
  color: var(--theme-cyan) !important;
  text-decoration: underline !important;
}

/* ASCII Logo Styling */
.ascii-logo {
  color: var(--theme-cyan);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  text-shadow: 0 0 20px rgba(125, 207, 255, 0.3);
  white-space: pre;
  display: inline-block;
}

/* Navbar Tab Navigation */
.navbar .navbar-nav .nav-link {
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--theme-comment) !important;
  background: transparent !important;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.navbar .navbar-nav .nav-link:hover {
  color: var(--theme-fg) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.navbar .navbar-nav .nav-link.active {
  color: var(--theme-cyan) !important;
  background: rgba(125, 207, 255, 0.08) !important;
  border: none !important;
  font-weight: bold;
  border-radius: 6px;
}

.navbar .navbar-nav .btn-outline-secondary {
  color: var(--theme-cyan) !important;
  background: rgba(125, 207, 255, 0.08) !important;
  border: none !important;
  font-weight: 600;
  border-radius: 6px;
}

.navbar .navbar-nav .btn-outline-secondary:hover {
  background: rgba(125, 207, 255, 0.15) !important;
}

.btn-select-all {
  color: #c0caf5 !important;
  background: rgba(125, 207, 255, 0.08) !important;
  border: none !important;
  font-weight: 600;
  border-radius: 6px;
}

.btn-select-all:hover {
  background: rgba(125, 207, 255, 0.15) !important;
}

.btn-subtle-purple {
  color: var(--theme-purple) !important;
  background: rgba(187, 154, 247, 0.08) !important;
  border: none !important;
  font-weight: 600;
  border-radius: 6px;
}

.btn-subtle-purple:hover {
  background: rgba(187, 154, 247, 0.15) !important;
}

.btn-subtle-danger {
  color: var(--theme-red) !important;
  background: rgba(247, 118, 142, 0.08) !important;
  border: none !important;
  font-weight: 600;
  border-radius: 6px;
}

.btn-subtle-danger:hover {
  background: rgba(247, 118, 142, 0.15) !important;
}

.btn-subtle-blue {
  color: var(--theme-blue) !important;
  background: rgba(122, 162, 247, 0.08) !important;
  border: none !important;
  font-weight: 600;
  border-radius: 6px;
}

.btn-subtle-blue:hover {
  background: rgba(122, 162, 247, 0.15) !important;
}

.alert-success {
  background: rgba(158, 206, 106, 0.08) !important;
  border: 1px solid rgba(158, 206, 106, 0.25) !important;
  color: var(--theme-fg) !important;
}

.alert-info {
  background: rgba(125, 207, 255, 0.08) !important;
  border: 1px solid rgba(125, 207, 255, 0.25) !important;
  color: var(--theme-fg) !important;
}
/* Client card scales all text and elements */


/* Message card styles for inbox */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.message-card {
  background: var(--theme-card-bg);
  border: 1px solid var(--theme-bg-mid);
  border-radius: 8px;
  padding: 16px;
  transition: all 0.15s ease;
  cursor: pointer;
}
.message-card:hover {
  border-color: var(--theme-cyan);
}
.message-card.unread {
  border-left: 3px solid var(--theme-cyan);
  background: rgba(125, 207, 255, 0.05);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile Responsive - Client Cards
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 500px) {
  /* Scale all text inside client cards */
  .client-card {
    font-size: 0.7rem;
  }

  /* Card title (client name) */
  .client-card .card-title {
    font-size: 0.85rem;
  }

  /* All badges - model, voice, STT, tools */
  .client-card .model-badge,
  .client-card .voice-badge,
  .client-card .sst-badge,
  .client-card .tool-badge {
    font-size: 0.5rem;
    padding: 1px 4px;
  }

  /* Spec values (phone, OAuth, etc) */
  .client-card .spec-value,
  .client-card .spec-icon,
  .client-card .fuel-gauge {
    font-size: 0.65rem;
  }

  /* Edit button and other small buttons */
  .client-card .btn-sm {
    font-size: 0.6rem;
    padding: 2px 6px;
  }

  /* Nav bar: hide non-essential items on mobile */
  .navbar .navbar-nav.ms-auto {
    display: none !important;
  }
  
  /* Truncate long username - more aggressive */
  .navbar [title="Settings"] {
    max-width: 60px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  
  /* Hide username icon on mobile to save space */
  .navbar [title="Settings"] i {
    display: none !important;
  }
  
  /* Hide client count text on mobile */
  .navbar .text-muted {
    font-size: 0.5rem !important;
  }
  
  .navbar-brand {
    font-size: 0.7rem !important;
    letter-spacing: 1px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Tablet Responsive - Nav Bar (800px - 1000px)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1000px) {
  /* Hide client count on medium screens */
  .client-count-badge {
    display: none !important;
  }
  
  /* Truncate settings button text */
  .navbar-settings-btn {
    max-width: 60px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  
  /* Prevent tab text from wrapping */
  .navbar .nav-link {
    white-space: nowrap !important;
    font-size: 0.7rem !important;
    padding: 4px 8px !important;
  }
}
