/* ================= DESIGN SYSTEM TOKENS ================= */
:root {
  /* Fonts */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-circle: 50%;
}

/* Dark Theme Variables (Default) */
[data-theme="dark"] {
  --bg-primary: #070913;
  --bg-secondary: #0c0f21;
  --bg-glass: rgba(13, 17, 39, 0.65);
  --bg-glass-hover: rgba(22, 28, 61, 0.8);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(79, 172, 254, 0.5);
  
  --text-primary: #f1f3f9;
  --text-muted: #8c98b2;
  --text-dimmed: #525f7a;

  --primary: #4facfe;
  --primary-hover: #00f2fe;
  --accent: #f093fb;
  --accent-hover: #f5576c;

  --success: #00e676;
  --warning: #ffb300;
  --danger: #ff1744;
  --info: #00b0ff;

  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glass-blur: blur(16px);
  --card-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f3f5fa;
  --bg-secondary: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-glass-hover: rgba(255, 255, 255, 0.85);
  --border-glass: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(79, 172, 254, 0.6);
  
  --text-primary: #1e2538;
  --text-muted: #5e6b85;
  --text-dimmed: #8b99b5;

  --primary: #0076ff;
  --primary-hover: #0056cc;
  --accent: #d84315;
  --accent-hover: #bf360c;

  --success: #2e7d32;
  --warning: #ef6c00;
  --danger: #c62828;
  --info: #0277bd;

  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
  --glass-blur: blur(12px);
  --card-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.1) 100%);
}

/* ================= BASIC RESET ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-glass) transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

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

/* Scrollbar customizations */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dimmed);
}

/* ================= GLASS UI LAYOUT UTILITIES ================= */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glass);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.glass-card-hover:hover {
  background: var(--bg-glass-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.25);
}

/* ================= AUTH MODULE VIEW ================= */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(79, 172, 254, 0.15), transparent 40%),
              radial-gradient(circle at bottom left, rgba(240, 147, 251, 0.1), transparent 40%),
              var(--bg-primary);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  overflow-y: auto;
  padding: 40px 20px;
}

.auth-wrapper .glass-card {
  margin: auto;
}

.auth-wrapper.active {
  opacity: 1;
  pointer-events: all;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 40px;
  text-align: center;
}

.auth-header {
  margin-bottom: 30px;
}

.logo-box {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: rgba(13, 17, 39, 0.4);
  border: 1px solid rgba(79, 172, 254, 0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 8px 32px 0 rgba(79, 172, 254, 0.15);
}

.logo-box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    transparent, 
    rgba(79, 172, 254, 0.4), 
    transparent 30%, 
    rgba(240, 147, 251, 0.4), 
    transparent 60%
  );
  animation: logo-rotate 6s linear infinite;
}

.logo-box::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: var(--bg-secondary);
  border-radius: 15px;
  z-index: 1;
}

@keyframes logo-rotate {
  100% {
    transform: rotate(360deg);
  }
}

.logo-icon {
  position: relative;
  z-index: 2;
  width: 32px;
  height: 32px;
  color: var(--primary);
  filter: drop-shadow(0 0 8px rgba(79, 172, 254, 0.5));
  animation: logo-pulse 3s ease-in-out infinite alternate;
}

@keyframes logo-pulse {
  0% {
    transform: scale(0.92);
    filter: drop-shadow(0 0 4px rgba(79, 172, 254, 0.3));
  }
  100% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 12px rgba(79, 172, 254, 0.8));
  }
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 36px;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-bottom: 4px;
}

.brand-x {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
  font-weight: 900;
}

.sidebar-brand-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.auth-stage {
  display: none;
  text-align: left;
}

.auth-stage.active {
  display: block;
  animation: fadeIn var(--transition-normal);
}

/* ================= INPUT & CONTROL STYLING ================= */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-group label i {
  width: 16px;
  height: 16px;
}

.input-group input, .input-group select, .input-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: border var(--transition-fast), box-shadow var(--transition-fast);
}

.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--border-focus);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #00c6ff 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(79, 172, 254, 0.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #00f2fe 100%);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: white;
}

.btn-block {
  width: 100%;
}

.btn-link {
  background: transparent;
  color: var(--text-muted);
  text-decoration: underline;
}
.btn-link:hover {
  color: var(--text-primary);
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
}

.alert-danger {
  background: rgba(255, 23, 68, 0.15);
  border: 1px solid var(--danger);
  color: #ff5252;
}

.hidden {
  display: none !important;
}

/* ================= CENTRAL COMMAND WINDOWS ================= */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: radial-gradient(circle at top right, rgba(79, 172, 254, 0.08), transparent 45%),
              var(--bg-primary);
}

/* Sidebar HUD Panel */
.sidebar-hud {
  width: 260px;
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  z-index: 10;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 30px;
  padding-left: 8px;
}

.brand-icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
  animation: pulse-glow 2s infinite;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  position: relative;
  flex-shrink: 0;
}

.avatar-premium {
  background: var(--avatar-gradient, linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%));
  box-shadow:
    0 0 0 2px var(--bg-secondary),
    0 0 0 4px rgba(79, 172, 254, 0.35),
    0 8px 24px rgba(79, 172, 254, 0.25);
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.avatar-premium.avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 18px;
}

.avatar-status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-secondary);
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.6);
}

.avatar-premium.avatar-lg .avatar-status-dot {
  width: 12px;
  height: 12px;
  bottom: 2px;
  right: 2px;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-item i {
  width: 18px;
  height: 18px;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(79, 172, 254, 0.15) 0%, transparent 100%);
  border-left: 3px solid var(--primary);
  padding-left: 9px;
}

.logout-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  width: 100%;
  text-align: left;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.logout-link:hover {
  color: var(--danger);
  background: rgba(255, 23, 68, 0.05);
}

/* Main Command Screen Workspace */
.main-frame {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top-bar {
  height: 70px;
  padding: 0 40px;
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.1);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  width: 320px;
  border: 1px solid var(--border-glass);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ================= USER PROFILE MENU ================= */
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.user-menu:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-glass);
}

.user-menu.open {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-glass);
}

.user-menu:hover .avatar-premium,
.user-menu.open .avatar-premium {
  transform: scale(1.04);
  box-shadow:
    0 0 0 2px var(--bg-secondary),
    0 0 0 4px rgba(79, 172, 254, 0.5),
    0 10px 28px rgba(240, 147, 251, 0.3);
}

.user-menu-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.user-menu-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.user-menu-role {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.user-menu-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-dimmed);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.user-menu.open .user-menu-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.user-menu-dropdown {
  width: 280px;
  padding: 0;
  overflow: hidden;
  right: 0;
  top: calc(100% + 10px);
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.12) 0%, rgba(240, 147, 251, 0.08) 100%);
  border-bottom: 1px solid var(--border-glass);
}

.user-menu-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.user-menu-identity strong {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(79, 172, 254, 0.15);
  color: var(--primary);
  border: 1px solid rgba(79, 172, 254, 0.25);
  width: fit-content;
}

.user-menu-section {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-menu-section-muted {
  border-top: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.08);
}

.user-menu-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dimmed);
  padding: 6px 10px 4px;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.user-menu-item i {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.user-menu-item:hover i {
  color: var(--primary);
}

.user-menu-item.danger {
  color: var(--danger);
}

.user-menu-item.danger i {
  color: var(--danger);
}

.user-menu-item.danger:hover {
  background: rgba(255, 23, 68, 0.08);
}

@media (max-width: 900px) {
  .user-menu-label,
  .user-menu-chevron {
    display: none;
  }

  .user-menu {
    padding: 4px;
  }
}

.notifications-pill {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.notifications-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-glass);
}

.notifications-pill.has-unread #bell-icon {
  color: var(--primary);
}

.notifications-pill.bell-pulse {
  animation: bell-shake 0.5s ease;
}

@keyframes bell-shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(12deg); }
  40% { transform: rotate(-10deg); }
  60% { transform: rotate(8deg); }
  80% { transform: rotate(-6deg); }
}

.notifications-pill .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: white;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 10px;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(255, 23, 68, 0.4);
}

.btn-theme {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sun-icon { display: none; }
.moon-icon { display: block; }
[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }

.content-panel {
  flex-grow: 1;
  padding: 40px;
  overflow-y: auto;
}

/* ================= FLOATING AI ASSISTANT SYSTEM ================= */
.ai-dock {
  width: 380px;
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 100;
  transition: transform var(--transition-normal);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.25);
}

.ai-dock.collapsed {
  transform: translateX(100%);
}

.ai-header {
  height: 70px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-icon-logo {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.ai-title {
  flex-grow: 1;
}

.ai-title h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
}

.ai-title span {
  font-size: 10px;
  color: var(--success);
}

#ai-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-normal);
}

.ai-dock.collapsed #ai-toggle-btn {
  transform: rotate(180deg);
}

.ai-messages-stream {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
}

.msg-assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-bottom-left-radius: 2px;
}

.msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.25) 0%, rgba(0, 198, 255, 0.25) 100%);
  border: 1px solid var(--primary);
  border-bottom-right-radius: 2px;
}

.ai-input-form {
  padding: 16px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  gap: 10px;
}

.ai-input-form input {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  outline: none;
}

.btn-send-ai {
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================= KEYFRAME ANIMATIONS ================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px var(--primary)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 8px var(--primary)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 2px var(--primary)); }
}

.animate-pulse {
  animation: pulse-glow 2s infinite;
}

/* ================= FLOATING AI BUTTON TRIGGER ================= */
.ai-float-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(79, 172, 254, 0.4);
  z-index: 99;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, box-shadow 0.2s ease;
}

.ai-float-btn i {
  width: 24px;
  height: 24px;
  color: white;
}

.ai-float-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(79, 172, 254, 0.6);
}

.ai-float-btn:active {
  transform: scale(0.92);
}

.ai-float-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8) translateY(20px);
}

/* Bell notification dropdown — wider so alert text is readable */
.notifications-dropdown {
  width: min(420px, calc(100vw - 32px));
  min-width: 360px;
  padding: 0;
  overflow: hidden;
  background: rgba(10, 14, 30, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .notifications-dropdown {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 48px rgba(31, 38, 135, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.notifications-dropdown .dropdown-header {
  padding: 16px 18px 12px;
  margin-bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .notifications-dropdown .dropdown-header {
  background: rgba(0, 0, 0, 0.03);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.notifications-dropdown .dropdown-content {
  max-height: 400px;
  padding: 8px 12px 12px;
  background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .notifications-dropdown .dropdown-content {
  background: rgba(0, 0, 0, 0.02);
}

.notifications-dropdown .notification-item {
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .notifications-dropdown .notification-item {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.08);
}

.notifications-dropdown .notification-item.unread {
  background: rgba(79, 172, 254, 0.18);
  border-left-color: var(--primary);
}

[data-theme="light"] .notifications-dropdown .notification-item.unread {
  background: rgba(0, 118, 255, 0.1);
}

.notifications-dropdown .notification-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .notifications-dropdown .notification-item:hover {
  background: rgba(255, 255, 255, 1);
}

.notifications-dropdown .notification-body h5 {
  font-size: 13px;
}

.notifications-dropdown .notification-body p {
  font-size: 12px;
  line-height: 1.5;
}

/* ================= SYSTEM ALERTS DROPDOWN PANE ================= */
.dropdown-pane {
  position: absolute;
  top: 50px;
  right: 0;
  width: 320px;
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glass);
  padding: 16px;
  display: none;
  z-index: 1000;
  animation: fadeIn var(--transition-fast);
}

.dropdown-pane.active {
  display: block !important;
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 8px;
}

.dropdown-header h4 {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-link-tiny.btn {
  padding: 4px 10px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--primary) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  border-radius: 4px !important;
  height: auto !important;
  box-shadow: none !important;
  border: 1px solid var(--border-glass) !important;
}

.btn-link-tiny.btn:hover {
  background: rgba(255, 23, 68, 0.1) !important;
  color: var(--danger) !important;
  border-color: var(--danger) !important;
}

.dropdown-content {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.no-alerts {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  color: var(--text-dimmed);
  font-size: 12px;
  text-align: center;
}

.no-alerts i {
  width: 28px;
  height: 28px;
  opacity: 0.5;
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  transition: background var(--transition-fast);
}

.notification-item.unread {
  background: rgba(79, 172, 254, 0.08);
  border-left: 3px solid var(--primary);
}

.notification-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.notification-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
}

.notification-icon i {
  width: 16px;
  height: 16px;
}

.notification-body {
  flex: 1;
  min-width: 0;
}

.notification-body h5 {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 2px;
  line-height: 1.3;
}

.notification-body p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
}

.notification-time {
  display: block;
  font-size: 10px;
  color: var(--text-dimmed);
  margin-top: 4px;
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= SETTINGS PAGE LAYOUT ================= */
.settings-page {
  max-width: 1200px;
}

.settings-header {
  margin-bottom: 28px;
}

.settings-header h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  margin-bottom: 6px;
}

.settings-header p {
  font-size: 14px;
  color: var(--text-muted);
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dimmed);
  padding: 4px 10px 10px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.settings-nav-item i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.settings-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.settings-nav-item.active {
  background: linear-gradient(90deg, rgba(79, 172, 254, 0.18) 0%, transparent 100%);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  padding-left: 9px;
}

.settings-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.settings-section {
  padding: 24px;
  scroll-margin-top: 16px;
}

.settings-section-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-glass);
}

.settings-section-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-section-icon i {
  width: 22px;
  height: 22px;
}

.settings-section-icon.security {
  background: rgba(0, 230, 118, 0.12);
  color: var(--success);
  border: 1px solid rgba(0, 230, 118, 0.25);
}

.settings-section-icon.integrations {
  background: rgba(79, 172, 254, 0.12);
  color: var(--primary);
  border: 1px solid rgba(79, 172, 254, 0.25);
}

.settings-section-icon.notifications {
  background: rgba(240, 147, 251, 0.12);
  color: var(--accent);
  border: 1px solid rgba(240, 147, 251, 0.25);
}

.settings-section-icon.email {
  background: rgba(255, 179, 0, 0.12);
  color: var(--warning);
  border: 1px solid rgba(255, 179, 0, 0.25);
}

.settings-section-head h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.settings-section-head p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.settings-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.settings-section-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.settings-subcard {
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
}

.settings-subcard h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.settings-subcard h4 i {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.settings-form-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.settings-form-row:last-of-type {
  margin-bottom: 4px;
}

.settings-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.settings-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.settings-check-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.settings-check-item input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}

.settings-check-item span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-check-item strong {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
}

.settings-check-item small {
  font-size: 12px;
  color: var(--text-muted);
}

.settings-mfa-setup {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-glass);
}

.settings-mfa-qr-row {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

.settings-mfa-qr {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.settings-mfa-key span {
  font-size: 12px;
  color: var(--text-muted);
}

.settings-mfa-key p {
  font-family: monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  word-break: break-all;
}

.settings-mfa-code {
  max-width: 240px;
}

.settings-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.settings-add-email {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.settings-add-email .input-group {
  flex: 1;
  margin-bottom: 0;
}

.settings-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
}

.settings-table th,
.settings-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-glass);
}

.settings-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.15);
  text-align: center;
  white-space: nowrap;
}

.settings-table th:first-child,
.settings-table td:first-child {
  text-align: left;
  min-width: 160px;
}

.settings-table-group-row th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 8px 6px;
}

.settings-table-subhead th {
  font-size: 10px;
  font-weight: 600;
  padding: 6px 4px 10px;
  background: rgba(0, 0, 0, 0.08);
}

.settings-table th.warn {
  color: var(--warning);
}

.settings-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.settings-table td:first-child {
  font-weight: 500;
  font-size: 12px;
}

.settings-table input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .settings-nav-label {
    width: 100%;
    padding-bottom: 4px;
  }

  .settings-nav-item.active {
    border-left: none;
    padding-left: 12px;
    border-bottom: 2px solid var(--primary);
  }

  .settings-form-row {
    grid-template-columns: 1fr;
  }

  .settings-add-email {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==========================================================================
   PREMIUM CUSTOM DESIGN CLASSES (GLOWING BALLS & DROPDOWNS)
   ========================================================================== */

/* Glassmorphism select customization */
.input-group select, select.premium-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(10, 14, 28, 0.6) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23a4b0be' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' class='feather feather-chevron-down' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center !important;
  background-size: 14px !important;
  padding: 12px 40px 12px 16px !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-primary) !important;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast) !important;
  font-family: inherit;
  cursor: pointer;
}

.input-group select:hover, select.premium-select:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

.input-group select:focus, select.premium-select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--border-focus) !important;
  background-color: rgba(5, 7, 16, 0.95) !important;
}

.input-group select option {
  background-color: #0c0f1d;
  color: #f1f2f6;
  padding: 12px;
}

/* Glowing Indicator Badges and Balls */
.status-indicator-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-muted);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.status-indicator-badge:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
}

.status-ball {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.status-ball.success-ball {
  background: var(--success);
  box-shadow: 0 0 10px var(--success), 0 0 4px var(--success);
  animation: pulse-green 1.8s infinite ease-in-out;
}

.status-ball.danger-ball {
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger), 0 0 4px var(--danger);
  animation: pulse-red 1.8s infinite ease-in-out;
}

.status-ball.info-ball {
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary), 0 0 4px var(--primary);
  animation: pulse-blue 1.8s infinite ease-in-out;
}

@keyframes pulse-green {
  0%, 100% { opacity: 0.9; transform: scale(1); box-shadow: 0 0 6px var(--success); }
  50% { opacity: 0.4; transform: scale(0.95); box-shadow: 0 0 12px var(--success); }
}

@keyframes pulse-red {
  0%, 100% { opacity: 0.9; transform: scale(1); box-shadow: 0 0 6px var(--danger); }
  50% { opacity: 0.4; transform: scale(0.95); box-shadow: 0 0 12px var(--danger); }
}

@keyframes pulse-blue {
  0%, 100% { opacity: 0.9; transform: scale(1); box-shadow: 0 0 6px var(--primary); }
  50% { opacity: 0.4; transform: scale(0.95); box-shadow: 0 0 12px var(--primary); }
}

/* Pulsating Alert badge animations */
.notifications-pill .badge {
  animation: pulse-glow-badge 2s infinite ease-in-out;
}

@keyframes pulse-glow-badge {
  0%, 100% { transform: scale(1); box-shadow: 0 2px 6px rgba(255, 23, 68, 0.4); }
  50% { transform: scale(1.15); box-shadow: 0 2px 14px rgba(255, 23, 68, 0.85); }
}

/* ================= RTL ARABIC MODE OVERRIDES ================= */
body.rtl-mode {
  text-align: right;
  direction: rtl;
}

body.rtl-mode .sidebar-hud {
  border-right: none;
  border-left: 1px solid var(--border-glass);
}

body.rtl-mode .sidebar-nav a i {
  margin-right: 0;
  margin-left: 12px;
}

body.rtl-mode .top-bar .search-box i {
  left: auto;
  right: 16px;
}

body.rtl-mode .top-bar .search-box input {
  padding-left: 16px;
  padding-right: 48px;
}

body.rtl-mode .header-actions {
  margin-left: 0;
  margin-right: auto;
  flex-direction: row-reverse;
  gap: 16px;
}

body.rtl-mode .user-menu-chevron {
  margin-left: 0;
  margin-right: 8px;
}

body.rtl-mode .dropdown-pane {
  right: auto;
  left: 0;
}

body.rtl-mode .notifications-dropdown {
  right: auto;
  left: 20px;
}

body.rtl-mode .user-menu-dropdown {
  right: auto;
  left: 20px;
}

body.rtl-mode .user-pill {
  flex-direction: row-reverse;
  text-align: right;
}

body.rtl-mode .user-meta {
  margin-left: 0;
  margin-right: 12px;
}

body.rtl-mode .user-menu-label {
  text-align: right;
}

body.rtl-mode .btn i, 
body.rtl-mode .tab-nav-btn i {
  margin-right: 0 !important;
  margin-left: 6px !important;
}

body.rtl-mode .ai-dock {
  right: auto;
  left: 0;
  transform: translateX(0);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.25);
  border-left: none;
  border-right: 1px solid var(--border-glass);
}

body.rtl-mode .ai-dock.collapsed {
  transform: translateX(-100%);
}

body.rtl-mode .ai-float-btn {
  right: auto;
  left: 24px;
}

body.rtl-mode .alert {
  text-align: right;
}

body.rtl-mode .settings-nav {
  border-right: none;
  border-left: 1px solid var(--border-glass);
}

body.rtl-mode .settings-nav-item i {
  margin-right: 0;
  margin-left: 12px;
}

body.rtl-mode .settings-section-head {
  flex-direction: row-reverse;
  text-align: right;
}

body.rtl-mode .settings-section-icon {
  margin-right: 0;
  margin-left: 20px;
}

body.rtl-mode .input-group label i {
  margin-right: 0;
  margin-left: 8px;
}

body.rtl-mode .mfa-info {
  text-align: center;
}

body.rtl-mode #ai-toggle-btn {
  transform: rotate(180deg);
}

body.rtl-mode .ai-dock.collapsed #ai-toggle-btn {
  transform: rotate(0deg);
}

body.rtl-mode #timeline-events-feed {
  border-left: none !important;
  border-right: 2px solid var(--border-glass) !important;
  padding-left: 0 !important;
  padding-right: 20px !important;
  margin-left: 0 !important;
  margin-right: 10px !important;
}

body.rtl-mode #timeline-events-feed > div > div:first-child {
  left: auto !important;
  right: -30px !important;
}

/* AI Chat alignment and send icon flips in RTL */
body.rtl-mode .msg-assistant {
  align-self: flex-end !important;
}

body.rtl-mode .msg-user {
  align-self: flex-start !important;
}

body.rtl-mode .btn-send-ai i {
  transform: scaleX(-1);
}

/* Custom Permissions Grid & Toggle Switches */
.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.25);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.permission-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.permission-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.permission-card-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}

.permission-card-info i {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.permission-card:hover .permission-card-info i {
  color: var(--primary);
}

/* Custom Checkbox toggle switch */
.permission-toggle {
  width: 38px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  position: relative;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.permission-toggle::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #a4b0be;
  top: 3px;
  left: 3px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

/* Hide the default checkbox input completely */
.permission-card input[type="checkbox"] {
  display: none !important;
}

/* Checked state styles */
.permission-card:has(input[type="checkbox"]:checked) {
  background: rgba(0, 198, 255, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(0, 198, 255, 0.1);
}

.permission-card:has(input[type="checkbox"]:checked) .permission-card-info i {
  color: var(--primary);
}

.permission-card:has(input[type="checkbox"]:checked) .permission-toggle {
  background: linear-gradient(135deg, var(--primary) 0%, #00c6ff 100%);
}

.permission-card:has(input[type="checkbox"]:checked) .permission-toggle::after {
  transform: translateX(18px);
  background: #fff;
}

/* RTL Mode adjustment for layout and sliding */
body.rtl-mode .permission-card {
  flex-direction: row-reverse;
}

body.rtl-mode .permission-card-info {
  flex-direction: row-reverse;
  gap: 10px;
}

body.rtl-mode .permission-toggle::after {
  left: auto;
  right: 3px;
}

body.rtl-mode .permission-card:has(input[type="checkbox"]:checked) .permission-toggle::after {
  transform: translateX(-18px);
  background: #fff;
}

/* Sidebar Nav Groups & Dropdowns */
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text-dimmed);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  width: 100%;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  outline: none;
  font-family: inherit;
  margin-top: 4px;
}

.nav-group-header:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.nav-group-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.nav-group-title-wrapper i.group-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.group-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.25s ease;
  color: var(--text-muted);
  pointer-events: none;
}

.nav-group.expanded .group-chevron {
  transform: rotate(180deg);
}

.nav-group-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 14px;
}

/* RTL Layout adjustments for group indent */
body.rtl-mode .nav-group-items {
  padding-left: 0;
  padding-right: 14px;
}

.nav-group.expanded .nav-group-items {
  max-height: 500px;
}

.nav-group-items .nav-item {
  padding: 8px 12px;
  font-size: 13px;
}

body.rtl-mode .nav-group-header {
  flex-direction: row-reverse;
  text-align: right;
}

body.rtl-mode .nav-group-title-wrapper {
  flex-direction: row-reverse;
}

body.rtl-mode .nav-group-title-wrapper i.group-icon {
  margin-right: 0;
  margin-left: 8px;
}

/* RTL Active Nav Indicator Mirroring */
body.rtl-mode .nav-item.active {
  border-left: none;
  border-right: 3px solid var(--primary);
  padding-left: 12px;
  padding-right: 9px;
  background: linear-gradient(-90deg, rgba(79, 172, 254, 0.15) 0%, transparent 100%);
}

/* User Menu Redesign (Premium & Modern) */
.user-menu-dropdown.dropdown-pane {
  display: block !important;
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  width: 290px;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 21, 30, 0.88); /* premium deep slate translucent */
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 
    0 24px 50px rgba(0, 0, 0, 0.5), 
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 20px rgba(79, 172, 254, 0.15); /* glowing glass effect */
  right: 0;
  top: calc(100% + 10px);
}

.user-menu-dropdown.dropdown-pane.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 18px;
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.08) 0%, rgba(240, 147, 251, 0.04) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.user-menu-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 172, 254, 0.3), transparent);
}

/* Custom Role Badges */
.user-role-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(79, 172, 254, 0.12);
  border: 1px solid rgba(79, 172, 254, 0.2);
  color: #00d2ff;
  width: fit-content;
  box-shadow: 0 0 8px rgba(79, 172, 254, 0.1);
}

.user-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast) ease;
}

.user-menu-item i {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
  transition: color var(--transition-fast) ease, transform var(--transition-fast) ease;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.user-menu-item:hover i {
  color: var(--primary);
  transform: scale(1.1);
}

.menu-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.menu-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.menu-item-desc {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

.user-menu-item.danger {
  color: #ff4757;
}

.user-menu-item.danger i {
  color: rgba(255, 71, 87, 0.7);
}

.user-menu-item.danger:hover {
  background: rgba(255, 71, 87, 0.08);
}

.user-menu-item.danger:hover i {
  color: #ff4757;
  transform: rotate(9deg) scale(1.1);
}

/* User Menu storage progress bar widget (gorgeous design!) */
.user-menu-widget {
  margin: 8px 12px 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 11px;
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  font-weight: 600;
}

.widget-title i {
  width: 12px;
  height: 12px;
  color: var(--primary);
}

.widget-percent {
  color: var(--text-muted);
  font-weight: 500;
}

.widget-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.widget-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #00c6ff 100%);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(79, 172, 254, 0.5);
}

/* RTL Override for text orientations inside menu-item-info */
body.rtl-mode .menu-item-info {
  text-align: right;
}

body.rtl-mode .user-menu-item {
  text-align: right;
  flex-direction: row-reverse;
}

body.rtl-mode .user-menu-item i {
  margin-right: 0;
}

body.rtl-mode .widget-header {
  flex-direction: row-reverse;
}

body.rtl-mode .widget-title {
  flex-direction: row-reverse;
}

/* Dashboard KPI Lock Rules & Badges */
.dashboard-kpi-card.locked {
  border-left-color: var(--text-muted) !important;
  opacity: 0.65;
}
.dashboard-kpi-card.locked i {
  color: var(--text-dimmed) !important;
}
.dashboard-kpi-card .lock-badge {
  font-size: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.dashboard-kpi-card.locked p {
  color: var(--text-muted) !important;
}

/* Activity Feed & Icon Containers */
.activity-feed-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: background var(--transition-fast) ease;
}
.activity-feed-item:hover {
  background: rgba(255, 255, 255, 0.03);
}
.activity-icon-box {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.activity-text-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}
.activity-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12.5px;
}
.activity-msg {
  color: var(--text-muted);
  font-size: 11.5px;
}
.activity-time {
  font-size: 10px;
  color: var(--text-dimmed);
  margin-top: 2px;
}

/* Chart Restricted Placeholders */
.chart-locked-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dimmed);
  font-size: 13px;
  gap: 8px;
  background: rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
}
.chart-locked-placeholder i {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
}

/* RTL Dashboard Alignments */
body.rtl-mode .dashboard-kpi-card {
  border-left: none !important;
  border-right: 4px solid var(--success);
}
body.rtl-mode #dash-card-finance { border-right-color: var(--success) !important; }
body.rtl-mode #dash-card-tasks { border-right-color: var(--primary) !important; }
body.rtl-mode #dash-card-expirations { border-right-color: var(--warning) !important; }
body.rtl-mode #dash-card-inventory { border-right-color: var(--danger) !important; }

body.rtl-mode .dashboard-kpi-card.locked {
  border-right-color: var(--text-muted) !important;
  border-left: none !important;
}

body.rtl-mode .activity-text-box {
  text-align: right;
}

/* Premium tab navigation buttons */
.tab-nav-btn {
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border-glass) !important;
  padding: 8px 16px !important;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast) ease;
}

.tab-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.tab-nav-btn.active {
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.18) 0%, rgba(0, 198, 255, 0.1) 100%) !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 12px rgba(79, 172, 254, 0.15);
}

[data-theme="light"] .tab-nav-btn {
  background: rgba(0, 0, 0, 0.03) !important;
  color: #57606f !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .tab-nav-btn:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #2f3542 !important;
}

[data-theme="light"] .tab-nav-btn.active {
  background: rgba(0, 118, 255, 0.08) !important;
  color: #0076ff !important;
  border-color: #0076ff !important;
}

/* Success & Danger button presets */
.btn-success {
  background: var(--success) !important;
  color: white !important;
}
.btn-success:hover {
  background: var(--success-hover, #00c853) !important;
}

.btn-danger {
  background: var(--danger) !important;
  color: white !important;
}
.btn-danger:hover {
  background: var(--danger-hover, #d50000) !important;
}

/* Application Initial Loader Styles */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 50%, rgba(79, 172, 254, 0.12), transparent 50%),
              radial-gradient(circle at top left, rgba(240, 147, 251, 0.08), transparent 45%),
              #070913;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modern-loader-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

/* Background animated glow */
.loader-bg-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(79, 172, 254, 0.15) 0%, rgba(240, 147, 251, 0.05) 50%, transparent 70%);
  filter: blur(40px);
  animation: float-glow 8s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
}

@keyframes float-glow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.8; }
  100% { transform: scale(1.2) translate(10px, -20px); opacity: 1; }
}

/* Glassmorphic Loader Card */
.loader-card {
  position: relative;
  z-index: 2;
  background: rgba(13, 17, 39, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg, 24px);
  padding: 40px 48px;
  width: 100%;
  max-width: 400px;
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 0 30px rgba(79, 172, 254, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Loader visual (orbital track + icon) */
.loader-visual-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}

.orbit-outer {
  width: 100px;
  height: 100px;
  border-top-color: var(--primary, #4facfe);
  border-bottom-color: rgba(79, 172, 254, 0.1);
  animation: spin-clockwise 2.5s cubic-bezier(0.53, 0.21, 0.29, 0.67) infinite;
}

.orbit-inner {
  width: 76px;
  height: 76px;
  border-left-color: var(--accent, #f093fb);
  border-right-color: rgba(240, 147, 251, 0.1);
  animation: spin-counter-clockwise 1.8s cubic-bezier(0.53, 0.21, 0.29, 0.67) infinite;
}

.loader-core {
  width: 52px;
  height: 52px;
  background: rgba(13, 17, 39, 0.7);
  border: 1px solid rgba(79, 172, 254, 0.2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary, #4facfe);
  box-shadow: 
    0 0 20px rgba(79, 172, 254, 0.2),
    0 0 10px rgba(79, 172, 254, 0.1) inset;
  z-index: 3;
  animation: pulse-core 2s ease-in-out infinite alternate;
}

.loader-icon-svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 6px rgba(79, 172, 254, 0.6));
}

/* Scanning bar effect */
.scanline {
  position: absolute;
  width: 110px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary, #4facfe), transparent);
  box-shadow: 0 0 8px var(--primary, #4facfe);
  opacity: 0.8;
  z-index: 4;
  animation: scan-sweep 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes spin-clockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes spin-counter-clockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

@keyframes pulse-core {
  0% { transform: scale(0.95); box-shadow: 0 0 15px rgba(79, 172, 254, 0.15); border-color: rgba(79, 172, 254, 0.15); }
  100% { transform: scale(1.05); box-shadow: 0 0 25px rgba(79, 172, 254, 0.4); border-color: rgba(79, 172, 254, 0.4); }
}

@keyframes scan-sweep {
  0% { top: 10px; opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { top: 110px; opacity: 0; }
}

/* Brand styling inside loader */
.loader-brand-section {
  margin-bottom: 24px;
}

.loader-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary, #f1f3f9) 30%, var(--primary, #4facfe) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.loader-subtitle {
  color: var(--text-muted, #8c98b2);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* Loading bar tracking */
.loader-progress-section {
  width: 100%;
  max-width: 280px;
}

.loader-bar-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
}

.loader-bar-fill {
  height: 100%;
  width: 35%; /* Start with a nice initial width or simulate progress */
  background: linear-gradient(90deg, var(--primary, #4facfe) 0%, var(--accent, #f093fb) 100%);
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(79, 172, 254, 0.4);
  animation: load-simulate 3s ease-in-out infinite alternate;
}

@keyframes load-simulate {
  0% { width: 15%; }
  50% { width: 65%; }
  100% { width: 92%; }
}

/* Status dots */
.loader-status-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.status-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary, #4facfe);
  box-shadow: 0 0 8px var(--primary, #4facfe);
  animation: status-pulse-glow 1.5s ease-in-out infinite alternate;
}

.loader-status-text {
  color: var(--text-dimmed, #525f7a);
  font-size: 12px;
  font-family: var(--font-body, 'Inter', sans-serif);
  letter-spacing: 0.5px;
}

@keyframes status-pulse-glow {
  0% { transform: scale(0.8); opacity: 0.4; }
  100% { transform: scale(1.2); opacity: 1; }
}

/* ================= GLOBAL DIAGNOSTICS DRAWER STYLES ================= */
.diagnostics-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: rgba(10, 14, 26, 0.94);
  backdrop-filter: var(--glass-blur, blur(20px));
  -webkit-backdrop-filter: var(--glass-blur, blur(20px));
  border-left: 1px solid var(--border-glass, rgba(255, 255, 255, 0.08));
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 10200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.diagnostics-drawer.active {
  transform: translateX(0);
}

.rtl-mode .diagnostics-drawer {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--border-glass, rgba(255, 255, 255, 0.08));
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  transform: translateX(-100%);
}

.rtl-mode .diagnostics-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-glass, rgba(255, 255, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-title-box h4 {
  font-family: var(--font-heading, 'Inter', sans-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  margin: 0;
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-drawer-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #8c98b2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.btn-drawer-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #ffffff);
}

.drawer-filters {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-glass, rgba(255, 255, 255, 0.08));
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
}

.drawer-filters .filter-group {
  position: relative;
  display: flex;
  align-items: center;
}

.drawer-filters .filter-icon {
  position: absolute;
  left: 12px;
  width: 14px;
  height: 14px;
  color: var(--text-muted, #8c98b2);
  pointer-events: none;
}

.rtl-mode .drawer-filters .filter-icon {
  left: auto;
  right: 12px;
}

.drawer-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 8px);
  padding: 10px 12px 10px 36px;
  color: var(--text-primary, #ffffff);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.rtl-mode .drawer-input {
  padding: 10px 36px 10px 12px;
}

.drawer-input:focus {
  border-color: var(--primary, #4facfe);
}

.drawer-filters .filter-row {
  display: flex;
  gap: 12px;
}

.drawer-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: monospace;
  font-size: 11.5px;
}

.drawer-content::-webkit-scrollbar {
  width: 6px;
}

.drawer-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

.drawer-log-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 8px;
  margin-bottom: 4px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.rtl-mode .drawer-log-item {
  text-align: right;
}

.drawer-log-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.rtl-mode .drawer-log-meta {
  flex-direction: row-reverse;
}

.drawer-log-time {
  color: var(--text-muted, #8c98b2);
  font-size: 10.5px;
}

.drawer-log-category {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
}

.drawer-log-message {
  color: var(--text-primary, #ffffff);
  word-break: break-all;
  flex-grow: 1;
}

.btn-drawer-toggle-details {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--primary, #4facfe);
  font-size: 10.5px;
  text-decoration: underline;
  padding: 0;
  margin-left: 8px;
  outline: none;
}

.rtl-mode .btn-drawer-toggle-details {
  margin-left: 0;
  margin-right: 8px;
}

.drawer-log-details-pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.08));
  padding: 8px;
  border-radius: 4px;
  margin-top: 6px;
  white-space: pre-wrap;
  font-size: 10.5px;
  color: var(--text-dimmed, #525f7a);
  text-align: left;
  max-width: 100%;
  overflow-x: auto;
  font-family: monospace;
}

.rtl-mode .drawer-log-details-pre {
  text-align: left;
  direction: ltr;
}






