/* MetaPulse AI - Premium Glassmorphism Design System v3.0 */

/* =============================================
   1. CSS CUSTOM PROPERTIES (Light + Dark)
   ============================================= */
:root {
  --primary: #6C63FF;
  --primary-hover: #5A52D5;
  --primary-light: rgba(108, 99, 255, 0.12);
  --primary-subtle: #EEF2FF;
  --secondary: #00B4D8;
  --secondary-light: rgba(0, 180, 216, 0.12);
  --accent-dark: #2D3748;
  --success: #10B981;
  --success-light: rgba(16, 185, 129, 0.12);
  --warning: #F59E0B;
  --warning-light: rgba(245, 158, 11, 0.12);
  --danger: #EF4444;
  --danger-light: rgba(239, 68, 68, 0.12);
  --info: #6C63FF;

  --bg-body: #F8FAFC;
  --bg-card: #ffffff;
  --bg-secondary: #F1F5F9;
  --bg-tertiary: #E2E8F0;

  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  --border-color: #E2E8F0;
  --border-light: #F1F5F9;

  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.45);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
  --glass-hover-shadow: 0 12px 40px 0 rgba(108, 99, 255, 0.18);

  --sidebar-bg: #ffffff;
  --sidebar-border: #E2E8F0;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 80px;

  --header-bg: rgba(255, 255, 255, 0.88);
  --header-border: rgba(226, 232, 240, 0.8);

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-pill: 50rem;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 40px -5px rgba(0, 0, 0, 0.1);

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.35s ease;
}

[data-theme="dark"] {
  --primary: #8B83FF;
  --primary-hover: #7A72F0;
  --primary-light: rgba(139, 131, 255, 0.15);
  --primary-subtle: rgba(139, 131, 255, 0.1);
  --secondary: #00D4FF;
  --secondary-light: rgba(0, 212, 255, 0.15);
  --success: #34D399;
  --success-light: rgba(52, 211, 153, 0.15);
  --warning: #FBBF24;
  --warning-light: rgba(251, 191, 36, 0.15);
  --danger: #F87171;
  --danger-light: rgba(248, 113, 113, 0.15);

  --bg-body: #0B1121;
  --bg-card: #131C31;
  --bg-secondary: #1A2540;
  --bg-tertiary: #1E2A45;

  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --border-color: #1E2A45;
  --border-light: #1A2540;

  --glass-bg: rgba(19, 28, 49, 0.88);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
  --glass-hover-shadow: 0 12px 40px 0 rgba(108, 99, 255, 0.25);

  --sidebar-bg: #0B1121;
  --sidebar-border: #1E2A45;

  --header-bg: rgba(11, 17, 33, 0.92);
  --header-border: rgba(30, 42, 69, 0.9);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
}

/* =============================================
   2. BASE & TYPOGRAPHY
   ============================================= */
body {
  background-color: var(--bg-body);
  font-family: var(--font-sans);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background-color: var(--primary-light);
  color: var(--primary);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

a {
  color: var(--primary);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

code {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
}

kbd {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-width: 2px;
  padding: 0.1em 0.45em;
  border-radius: var(--radius-sm);
  font-size: 0.78em;
  font-family: var(--font-sans);
}

hr {
  border-color: var(--border-color);
  opacity: 0.6;
}

img {
  max-width: 100%;
  height: auto;
}

/* =============================================
   3. APP LAYOUT SHELL
   ============================================= */
.app-container {
  display: flex;
  min-height: 100vh;
  transition: padding-left var(--transition-base);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-base);
}

.app-container.sidebar-collapsed .app-main {
  margin-left: var(--sidebar-collapsed-width);
}

.content-wrapper {
  flex: 1;
  padding: 1.5rem 2rem;
  max-width: 1400px;
  width: 100%;
}

.offline-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--warning);
  color: #1E293B;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  transform: translateY(-100%);
  transition: transform var(--transition-base);
}

.offline-banner.show {
  display: block;
  transform: translateY(0);
}

/* =============================================
   4. SIDEBAR
   ============================================= */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 1050;
  transition: width var(--transition-base), transform var(--transition-base);
  overflow: hidden;
}

.app-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border-color);
  min-height: 70px;
}

.sidebar-logo img.logo-full-img {
  display: block;
  max-width: 100%;
  height: auto;
}

.sidebar-logo img.logo-icon-img {
  display: none;
  max-width: 100%;
  height: auto;
}

.app-sidebar.collapsed .sidebar-logo img.logo-full-img {
  display: none;
}

.app-sidebar.collapsed .sidebar-logo img.logo-icon-img {
  display: block;
}

.nav-menu {
  list-style: none;
  padding: 0.75rem 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-menu li {
  padding: 0;
  margin: 0;
}

.nav-link-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1.25rem;
  margin: 0.15rem 0.65rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
}

.nav-link-item i {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.nav-link-item span {
  opacity: 1;
  transition: opacity var(--transition-fast);
}

.nav-link-item .badge {
  margin-left: auto;
  flex-shrink: 0;
}

.app-sidebar.collapsed .nav-link-item span {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.nav-link-item:hover {
  background-color: var(--bg-secondary);
  color: var(--primary);
}

.nav-link-item:hover i {
  color: var(--primary);
}

.nav-link-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-link-item.active i {
  color: var(--primary);
}

.user-profile-widget {
  display: flex;
  align-items: center;
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
  gap: 0.65rem;
}

.user-profile-widget .avatar-circle {
  width: 38px;
  height: 38px;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.app-sidebar.collapsed .user-profile-widget {
  justify-content: center;
  padding: 1rem 0.5rem;
}

.app-sidebar.collapsed .user-profile-widget .overflow-hidden {
  display: none;
}

.app-sidebar.collapsed .user-profile-widget .avatar-circle {
  width: 36px;
  height: 36px;
  font-size: 0.75rem;
}

/* Dark mode sidebar brand logo: swap to light variant, keep brand colors */
[data-theme="dark"] .sidebar-logo img.logo-dark-img {
  display: none;
}

[data-theme="dark"] .sidebar-logo img.logo-light-img {
  display: block;
}

[data-theme="dark"] .app-sidebar.collapsed .sidebar-logo img.logo-light-img {
  display: none;
}

/* Global dark/light logo variant swap (sidebar + top header) */
img.logo-full-img.logo-light-img,
img.logo-light-img {
  display: none;
}

[data-theme="dark"] img.logo-dark-img {
  display: none;
}

[data-theme="dark"] img.logo-light-img {
  display: block;
}

/* =============================================
   5. TOP HEADER
   ============================================= */
.top-header-navbar {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--header-border);
  min-height: 60px;
}

.top-header-navbar .brand-logo {
  height: 40px;
}

.header-logo-img {
  max-width: 100%;
  height: 100%;
  width: auto;
}

.min-w-0 {
  min-width: 0;
}

.header-center-wrap {
  overflow: hidden;
}

.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  background: var(--primary);
  user-select: none;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
}

.connection-status.connected {
  background: var(--success-light);
  color: var(--success);
}

.connection-status.disconnected {
  background: var(--danger-light);
  color: var(--danger);
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: pulse-dot 2s infinite;
}

.pulse-dot.green {
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
}

.pulse-dot.red {
  background: var(--danger);
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50% { opacity: 0.7; }
  100% { box-shadow: 0 0 0 4px transparent; opacity: 1; }
}

/* =============================================
   6. MOBILE BOTTOM NAVIGATION
   ============================================= */
.mobile-bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  padding: 0.4rem 0 calc(0.4rem + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0.65rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.62rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mobile-nav-item i {
  font-size: 1.15rem;
  transition: color var(--transition-fast);
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--primary);
}

.mobile-nav-item.active i {
  color: var(--primary);
}

/* =============================================
   7. GLASS CARDS & BANNERS
   ============================================= */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.glass-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--glass-hover-shadow);
}

.glass-card.no-hover:hover {
  transform: none;
  box-shadow: var(--glass-shadow);
}

.welcome-banner {
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  color: #ffffff;
  box-shadow: var(--shadow-lg);
}

.super-admin-banner {
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 100%);
}

.admin-banner {
  background: linear-gradient(135deg, #6C63FF 0%, #00B4D8 100%);
}

.creator-banner {
  background: var(--primary-light);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.stat-widget {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.1rem;
}

.metric-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* =============================================
   8. CUSTOM BUTTONS & STATUS BADGES
   ============================================= */
.btn-primary-custom {
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
  border-radius: var(--radius-pill);
}

.btn-primary-custom:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.btn-primary-custom:active {
  transform: translateY(0);
}

.btn-primary-custom:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.btn-success-custom {
  background-color: var(--success);
  color: #ffffff;
  border: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-success-custom:hover {
  background-color: #059669;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-emergency-kill {
  background: var(--danger);
  color: #ffffff;
  font-weight: 700;
  border: none;
  animation: pulse-kill-switch 2s infinite;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-emergency-kill:hover {
  background: #DC2626;
  color: #ffffff;
  transform: translateY(-1px);
}

@keyframes pulse-kill-switch {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.toggle-secret-btn {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.toggle-secret-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.test-connection-btn,
.copy-uri-btn {
  transition: all var(--transition-fast);
}

.test-result-area {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  display: none;
}

.test-result-area.success {
  display: block;
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.test-result-area.error {
  display: block;
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Status Badges */
.badge-pending {
  background-color: var(--warning-light);
  color: var(--warning);
  font-weight: 600;
}

.badge-approved {
  background-color: var(--success-light);
  color: var(--success);
  font-weight: 600;
}

.badge-rejected {
  background-color: var(--danger-light);
  color: var(--danger);
  font-weight: 600;
}

.badge-revision {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.badge-role-superadmin {
  background-color: var(--danger-light);
  color: var(--danger);
  font-weight: 700;
}

.badge-role-admin {
  background-color: #EDE9FE;
  color: #6D28D9;
  font-weight: 700;
}

[data-theme="dark"] .badge-role-admin {
  background-color: rgba(109, 40, 217, 0.2);
  color: #A78BFA;
}

.badge-role-creator {
  background-color: rgba(0, 180, 216, 0.12);
  color: var(--secondary);
  font-weight: 700;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
}

.status-badge.active {
  background: var(--success-light);
  color: var(--success);
}

.status-badge.paused {
  background: var(--warning-light);
  color: var(--warning);
}

.status-badge.stopped {
  background: var(--danger-light);
  color: var(--danger);
}

/* =============================================
   9. TABLES & DATA DISPLAY
   ============================================= */
.table-sticky-header thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.table-sticky-header thead th {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
}

.table {
  color: var(--text-primary);
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  border-bottom-color: var(--border-color);
  padding: 0.85rem 0.75rem;
  vertical-align: middle;
}

.table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom-width: 1px;
}

.table-hover tbody tr:hover {
  background-color: var(--bg-secondary);
}

.table-bordered {
  border-color: var(--border-color);
}

.table-bordered th,
.table-bordered td {
  border-color: var(--border-color);
}

/* =============================================
   10. FORMS & INPUTS
   ============================================= */
.form-control,
.form-select {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background-color: var(--bg-card);
  color: var(--text-primary);
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.form-control-sm {
  font-size: 0.82rem;
}

.form-select {
  cursor: pointer;
}

.form-control[readonly] {
  background-color: var(--bg-secondary);
  opacity: 0.7;
}

.input-group-text {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-muted);
}

.form-check-input {
  border-color: var(--border-color);
  background-color: var(--bg-card);
  cursor: pointer;
}

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

.form-check-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.form-range::-webkit-slider-thumb {
  background: var(--primary);
}

.form-range::-moz-range-thumb {
  background: var(--primary);
}

.form-range::-webkit-slider-runnable-track {
  background: var(--bg-tertiary);
}

.settings-field {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
}

.provider-radio-card {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.provider-radio-card.active,
.provider-radio-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

input.visually-hidden:focus-visible + label {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* =============================================
   11. MODALS & DROPDOWNS
   ============================================= */
.modal-content.glass-card {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.modal-header {
  border-bottom-color: var(--border-color);
}

.modal-footer {
  border-top-color: var(--border-color);
}

.modal-backdrop.show {
  opacity: 0.6;
}

.btn-close {
  filter: none;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.btn-close:hover {
  opacity: 1;
}

[data-theme="dark"] .btn-close {
  filter: invert(1);
}

.dropdown-menu.glass-card {
  border: 1px solid var(--glass-border);
}

.dropdown-item {
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  font-size: 0.88rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.dropdown-item.text-danger:hover {
  background-color: var(--danger-light);
}

.dropdown-header {
  color: var(--text-muted);
  font-size: 0.78rem;
}

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

/* =============================================
   12. TABS & SETTINGS NAVIGATION
   ============================================= */
.settings-tab-nav {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  background: var(--bg-secondary);
  padding: 0.4rem;
  border-radius: var(--radius-lg);
}

.settings-tab-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .settings-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.settings-tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.settings-tab-panel {
  display: none;
}

.settings-tab-panel.active {
  display: block;
}

.notification-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-light);
}

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

/* =============================================
   13. INBOX / CHAT LAYOUT
   ============================================= */
.chat-container {
  display: flex;
  gap: 1.5rem;
  min-height: 65vh;
}

.chat-list-panel {
  width: 340px;
  flex-shrink: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-list-header {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
}

.chat-list-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.chat-rule-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  margin-bottom: 0.3rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.chat-rule-item:hover {
  background: var(--bg-secondary);
}

.swipe-delete-bg {
  display: none;
}

.chat-detail-panel {
  flex: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 60vh;
}

.chat-detail-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.chat-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.chat-detail-footer {
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.5rem 0;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.quick-reply-btn {
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border-color);
  background: transparent;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-reply-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* =============================================
   14. COMPONENTS
   ============================================= */
/* Top Progress Bar */
#top-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  z-index: 99999;
  transition: width 0.15s ease, opacity 0.4s ease;
  border-radius: 0 2px 2px 0;
}

/* Date Range Picker */
.date-range-bar {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-secondary);
  padding: 0.25rem;
  border-radius: var(--radius-pill);
}

.date-range-btn {
  padding: 0.35rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.date-range-btn:hover {
  color: var(--text-primary);
}

.date-range-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Comparison Metrics */
.comparison-metric {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.delta-up {
  color: var(--success);
}

.delta-down {
  color: var(--danger);
}

.delta-neutral {
  color: var(--text-muted);
}

/* Budget Estimator */
.budget-estimate-display {
  background: var(--bg-secondary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.reach-range {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}

.reach-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Keyboard Shortcuts */
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}

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

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Floating Bulk Action Bar */
.floating-bulk-bar {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xl);
  z-index: 1050;
}

.floating-bulk-bar.show {
  display: flex;
}

/* Mobile Page Cards */
.mobile-page-cards {
  display: none;
}

.page-card-mobile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.page-card-mobile:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 8px;
}

/* FC Event Tooltip */
.fc-event-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  padding: 0.75rem 1rem;
  max-width: 280px;
}

/* Spend Graph Card */
.spend-graph-card {
  position: relative;
}

.spend-graph-card canvas {
  max-height: 250px;
}

/* Page Search Highlight */
.desktop-page-table {
  position: relative;
}

/* Test Result Area */
.test-result-area {
  transition: all var(--transition-fast);
}

/* =============================================
   15. ANIMATIONS
   ============================================= */
.fade-in-up {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays for grid children */
.fade-in-up:nth-child(1) { transition-delay: 0.03s; }
.fade-in-up:nth-child(2) { transition-delay: 0.06s; }
.fade-in-up:nth-child(3) { transition-delay: 0.09s; }
.fade-in-up:nth-child(4) { transition-delay: 0.12s; }

/* Count up animation base */
[data-count-target] {
  transition: color var(--transition-base);
}

/* =============================================
   16. UTILITY CLASSES
   ============================================= */
.max-w-md {
  max-width: 480px;
}

.font-semibold {
  font-weight: 600;
}

.bg-primary-subtle {
  background-color: var(--primary-light) !important;
}

.bg-secondary-subtle {
  background-color: var(--bg-secondary) !important;
}

.bg-success-subtle {
  background-color: var(--success-light) !important;
}

.bg-warning-subtle {
  background-color: var(--warning-light) !important;
}

.bg-danger-subtle {
  background-color: var(--danger-light) !important;
}

.bg-info-subtle {
  background-color: var(--secondary-light) !important;
}

.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }

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

.bg-body-tertiary {
  background-color: var(--bg-secondary) !important;
}

.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-90 { opacity: 0.9; }

/* =============================================
   17. DARK MODE OVERRIDES
   ============================================= */
[data-theme="dark"] body {
  background-color: var(--bg-body);
}

[data-theme="dark"] .glass-card {
  background: var(--glass-bg);
  border-color: var(--glass-border);
}

[data-theme="dark"] .glass-card:hover {
  box-shadow: var(--glass-hover-shadow);
}

[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: var(--bg-secondary);
  color: var(--text-primary);
}

[data-theme="dark"] .table > :not(caption) > * > * {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .table thead th {
  color: var(--text-muted);
}

[data-theme="dark"] .table-hover tbody tr:hover {
  background-color: var(--bg-secondary);
}

/* =============================================
   DARK MODE — GLOBAL TEXT ENFORCEMENT
   ============================================= */
[data-theme="dark"],
[data-theme="dark"] body,
[data-theme="dark"] .app-container,
[data-theme="dark"] .main-content,
.dark-theme,
.dark-theme body,
.dark-theme .app-container,
.dark-theme .main-content {
  --text-primary: #F8FAFC;   /* Bright White for Main Headings */
  --text-secondary: #CBD5E1; /* Soft Silver for body text */
  --text-muted: #94A3B8;     /* Solid Gray for metadata/icons */
}

[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6,
.dark-theme h1, .dark-theme h2, .dark-theme h3, .dark-theme h4, .dark-theme h5, .dark-theme h6 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] p, [data-theme="dark"] span, [data-theme="dark"] div, [data-theme="dark"] td, [data-theme="dark"] th, [data-theme="dark"] li, [data-theme="dark"] label,
.dark-theme p, .dark-theme span, .dark-theme div, .dark-theme td, .dark-theme th, .dark-theme li, .dark-theme label {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-muted, [data-theme="dark"] .small, [data-theme="dark"] .fa, [data-theme="dark"] i,
.dark-theme .text-muted, .dark-theme .small, .dark-theme .fa, .dark-theme i {
  color: var(--text-muted) !important;
}

/* SPECIFIC FIX FOR THE ADMIN SUBSCRIPTION TABLE (seen in screenshot) */
[data-theme="dark"] .table thead th,
.dark-theme .table thead th {
  color: var(--text-secondary) !important;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .table tbody td,
.dark-theme .table tbody td {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .table tbody td i,
[data-theme="dark"] .table tbody td .fa,
.dark-theme .table tbody td i,
.dark-theme .table tbody td .fa {
  color: var(--text-muted) !important;
}

[data-theme="dark"] .plan-name,
.dark-theme .plan-name {
  color: #FFFFFF !important;
}

[data-theme="dark"] .plan-price,
.dark-theme .plan-price {
  color: #6C63FF !important;
}

[data-theme="dark"] .dropdown-menu .dropdown-item,
.dark-theme .dropdown-menu .dropdown-item {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .dropdown-menu .dropdown-item:hover,
[data-theme="dark"] .dropdown-menu .dropdown-item:focus,
.dark-theme .dropdown-menu .dropdown-item:hover,
.dark-theme .dropdown-menu .dropdown-item:focus {
  color: var(--text-primary) !important;
  background-color: var(--bg-secondary);
}

[data-theme="dark"] .modal-content {
  background: var(--glass-bg);
}

[data-theme="dark"] .btn-light {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .btn-light:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
}

[data-theme="dark"] .btn-outline-primary:hover {
  background: var(--primary);
  color: #ffffff;
}

[data-theme="dark"] .btn-outline-secondary {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

[data-theme="dark"] .btn-outline-secondary:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

[data-theme="dark"] .btn-outline-danger {
  border-color: var(--danger);
  color: var(--danger);
}

[data-theme="dark"] .btn-outline-danger:hover {
  background: var(--danger);
  color: #ffffff;
}

[data-theme="dark"] .dropdown-menu {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border-color: var(--glass-border);
}

[data-theme="dark"] .dropdown-item {
  color: var(--text-secondary);
}

[data-theme="dark"] .dropdown-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

[data-theme="dark"] .dropdown-header {
  color: var(--text-muted);
}

[data-theme="dark"] .bg-white {
  background-color: var(--bg-card) !important;
}

[data-theme="dark"] .text-dark {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .bg-light {
  background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .card {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .list-group-item {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .page-link {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

[data-theme="dark"] .popover {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .toast {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .accordion-button {
  background: var(--bg-card);
  color: var(--text-primary);
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
  background: var(--primary-light);
  color: var(--primary);
}

[data-theme="dark"] .accordion-item {
  border-color: var(--border-color);
}

[data-theme="dark"] .nav-tabs .nav-link {
  color: var(--text-secondary);
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
  border-color: var(--border-color);
}

[data-theme="dark"] .nav-tabs .nav-link.active {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--primary);
}

[data-theme="dark"] .spinner-border {
  color: var(--primary);
}

[data-theme="dark"] .alert {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .alert-danger {
  background: var(--danger-light);
  border-color: transparent;
  color: var(--danger);
}

[data-theme="dark"] .alert-warning {
  background: var(--warning-light);
  border-color: transparent;
  color: var(--warning);
}

[data-theme="dark"] .alert-success {
  background: var(--success-light);
  border-color: transparent;
  color: var(--success);
}

[data-theme="dark"] .alert-info {
  background: var(--primary-light);
  border-color: transparent;
  color: var(--primary);
}

[data-theme="dark"] .progress {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .progress-bar {
  background: var(--primary);
}

[data-theme="dark"] .top-header-navbar {
  background: var(--header-bg);
  border-bottom-color: var(--header-border);
}

[data-theme="dark"] .app-sidebar {
  background: var(--sidebar-bg);
  border-right-color: var(--sidebar-border);
}

[data-theme="dark"] .mobile-bottom-nav {
  background: var(--header-bg);
  border-top-color: var(--border-color);
}

[data-theme="dark"] .nav-link-item {
  color: var(--text-secondary);
}

[data-theme="dark"] .nav-link-item i {
  color: var(--text-muted);
}

[data-theme="dark"] .nav-link-item:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

[data-theme="dark"] .nav-link-item:hover i {
  color: var(--primary);
}

[data-theme="dark"] .nav-link-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

[data-theme="dark"] .nav-link-item.active i {
  color: var(--primary);
}

[data-theme="dark"] .welcome-banner .badge.bg-white {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .user-profile-widget {
  border-top-color: var(--border-color);
}

[data-theme="dark"] .badge.bg-primary-subtle {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
}

[data-theme="dark"] .badge.bg-info-subtle {
  background: var(--secondary-light) !important;
  color: var(--secondary) !important;
}

[data-theme="dark"] .badge.bg-success-subtle {
  background: var(--success-light) !important;
  color: var(--success) !important;
}

[data-theme="dark"] .badge.bg-warning-subtle {
  background: var(--warning-light) !important;
  color: var(--warning) !important;
}

[data-theme="dark"] .badge.bg-danger-subtle {
  background: var(--danger-light) !important;
  color: var(--danger) !important;
}

[data-theme="dark"] .badge.bg-secondary-subtle {
  background: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .settings-tab-nav {
  background: var(--bg-secondary);
}

[data-theme="dark"] .settings-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .settings-tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
}

[data-theme="dark"] .chat-list-panel,
[data-theme="dark"] .chat-detail-panel {
  background: var(--glass-bg);
}

[data-theme="dark"] .chat-rule-item:hover {
  background: var(--bg-secondary);
}

[data-theme="dark"] .button-close {
  filter: invert(1);
}

[data-theme="dark"] .form-check-input {
  background-color: var(--bg-secondary);
}

[data-theme="dark"] .form-check-input:checked {
  background-color: var(--primary);
}

[data-theme="dark"] .modal-content.glass-card {
  background: var(--glass-bg);
}

[data-theme="dark"] .floating-bulk-bar {
  background: var(--glass-bg);
}

[data-theme="dark"] .metric-card {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .page-card-mobile {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .budget-estimate-display {
  background: var(--bg-secondary);
}

[data-theme="dark"] .quick-reply-btn {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

[data-theme="dark"] .quick-reply-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

[data-theme="dark"] .fc {
  --fc-border-color: var(--border-color);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: var(--bg-secondary);
  --fc-today-bg-color: var(--primary-light);
  --fc-event-bg-color: var(--primary);
  --fc-event-border-color: var(--primary-hover);
  --fc-event-text-color: #ffffff;
  --fc-button-bg-color: var(--primary);
  --fc-button-border-color: var(--primary);
  --fc-button-hover-bg-color: var(--primary-hover);
  --fc-button-hover-border-color: var(--primary-hover);
  --fc-button-active-bg-color: var(--primary-hover);
}

[data-theme="dark"] .fc .fc-toolbar-title {
  color: var(--text-primary);
}

[data-theme="dark"] .fc .fc-col-header-cell-cushion {
  color: var(--text-muted);
}

[data-theme="dark"] .fc .fc-daygrid-day-number {
  color: var(--text-secondary);
}

/* =============================================
   18. RESPONSIVE BREAKPOINTS
   ============================================= */
/* Tablet - below 992px */
@media (max-width: 991.98px) {
  .app-main {
    margin-left: 0 !important;
  }

  .content-wrapper {
    padding: 1.25rem 1rem;
  }

  .chat-container {
    flex-direction: column;
  }

  .chat-list-panel {
    width: 100%;
    max-height: 300px;
  }

  .chat-detail-panel {
    min-height: 50vh;
  }

  .settings-tab-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .settings-tab-btn {
    white-space: nowrap;
  }

  .desktop-page-table {
    display: none;
  }

  .mobile-page-cards {
    display: block;
  }

  .welcome-banner {
    padding: 1.25rem;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .stat-icon-wrapper {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .top-header-navbar .btn-emergency-kill span {
    display: none;
  }
}

/* Mobile - below 768px */
@media (max-width: 767.98px) {
  /* Prevent bottom nav from covering the last content item */
  .app-main .content-wrapper {
    padding-bottom: 80px;
  }

  .top-header-navbar {
    min-height: 56px;
  }

  .top-header-navbar .badge {
    font-size: 0.6rem;
    padding: 0.3rem 0.55rem;
  }
}

/* Mobile - below 576px */
@media (max-width: 575.98px) {
  .content-wrapper {
    padding: 1rem 0.85rem;
    padding-bottom: 80px;
  }

  .d-flex.justify-content-between.align-items-center {
    flex-wrap: wrap;
    row-gap: 1rem;
  }

  .welcome-banner {
    padding: 1rem;
  }

  .glass-card {
    padding: 1rem;
  }

  .table > :not(caption) > * > * {
    padding: 0.55rem 0.5rem;
    font-size: 0.82rem;
  }

  .settings-tab-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
  }

  .date-range-bar {
    flex-wrap: wrap;
  }

  .date-range-btn {
    font-size: 0.72rem;
    padding: 0.25rem 0.55rem;
  }

  .chat-list-panel {
    max-height: 250px;
  }

  .stat-widget {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .stat-icon-wrapper {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }

  .floating-bulk-bar {
    bottom: 5rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
  }
}

/* Desktop large - above 1400px */
@media (min-width: 1400px) {
  .content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
  }
}

/* =============================================
   99. GLOBAL ALERT MODAL — GLASSMORPHISM
   Replaces native alert()/confirm()/prompt()
   ============================================= */
.modal-glass {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-glass.show {
  opacity: 1;
  visibility: visible;
}

.modal-glass-backdrop {
  position: absolute;
  inset: 0;
  cursor: default;
}

.modal-glass .modal-content {
  position: relative;
  width: 100%;
  max-width: 430px;
  margin: 0;
  padding: 2rem 1.75rem 1.75rem;
  text-align: center;
  background: rgba(30, 41, 59, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  transform: scale(0.92) translateY(14px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-glass.show .modal-content {
  transform: scale(1) translateY(0);
}

body.modal-glass-open {
  overflow: hidden;
}

.modal-glass-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #E2E8F0;
  font-size: 0.9rem;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.modal-glass-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  transform: rotate(90deg);
}

.alert-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.1rem;
}

.alert-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  color: #FFFFFF;
}

.alert-icon-success {
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.alert-icon-danger {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
}

.alert-icon-warning {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
}

.alert-icon-info {
  background: linear-gradient(135deg, #6C63FF, #5A52E0);
  box-shadow: 0 8px 24px rgba(108, 99, 255, 0.35);
}

.modal-glass-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.01em;
  margin-bottom: 0.55rem;
}

.modal-glass-message {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #94A3B8;
  margin-bottom: 1.4rem;
}

.modal-glass-input-wrap {
  margin-bottom: 1.25rem;
  text-align: left;
}

.modal-glass-input-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: #CBD5E1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.modal-glass-input {
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #FFFFFF !important;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.modal-glass-input::placeholder {
  color: #64748B;
}

.modal-glass-input:focus {
  border-color: rgba(108, 99, 255, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.18) !important;
}

.modal-glass-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.btn-modal-cancel {
  flex: 1;
  padding: 0.65rem 1.25rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.9rem;
  color: #E2E8F0;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.6);
  color: #FFFFFF;
}

.btn-modal-confirm {
  flex: 1;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 0.9rem;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.9rem;
  background: linear-gradient(135deg, #6C63FF, #5A52E0);
  box-shadow: 0 8px 20px rgba(108, 99, 255, 0.3);
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.btn-modal-confirm:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn-modal-confirm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: none;
  box-shadow: none;
}

.btn-modal-danger {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.btn-modal-success {
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.btn-modal-warning {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

/* =============================================
   100. CUSTOM TOASTS (Toastify wrapper)
   ============================================= */
.toastify.alert-toastify {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 14px;
  min-width: 300px;
  max-width: 380px;
}

.alert-toast {
  --toast-accent: #6C63FF;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem 0.95rem;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--toast-accent);
  border-radius: 14px;
  color: #F1F5F9;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.alert-toast-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--toast-accent);
  font-size: 0.95rem;
}

.alert-toast-msg {
  flex: 1 1 auto;
  line-height: 1.45;
}

.alert-toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--toast-accent);
  transform-origin: left;
  animation: toastProgress linear forwards;
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

.alert-toast.fallback-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  transform: translateX(120%);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.alert-toast.fallback-toast.show {
  transform: translateX(0);
}
