/* ==========================================================================
   لوحة تحكم وتحليلات التطبيق - Smart Image Search AI Dashboard
   Dark Glassmorphism Design System (Arabic RTL & Responsive)
   ========================================================================== */

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.3);

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-cyan: #06b6d4;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-danger: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.15);

  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: #ffffff;
  --border-color: rgba(203, 213, 225, 0.85);
  --border-highlight: rgba(99, 102, 241, 0.4);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --shadow-sm: 0 4px 18px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Background Animated Gradient Mesh */
.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 45%),
              radial-gradient(circle at 85% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 45%),
              radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  position: relative;
  z-index: 1;
}

/* Top Navigation Bar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.brand-info h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-version {
  font-size: 0.72rem;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.brand-info p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Theme Toggle Button */
.btn-theme-toggle {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-highlight);
  transform: translateY(-1px);
}

[data-theme="light"] .btn-theme-toggle {
  background: #ffffff;
  border-color: rgba(203, 213, 225, 0.9);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .btn-theme-toggle:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* Tab Navigation */
.tabs-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  font-family: inherit;
  user-select: none;
}

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

[data-theme="light"] .tab-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.tab-btn.active {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  border-color: transparent;
}

/* Special Highlighting for AI QA Tab */
.tab-btn-highlight {
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.05);
}

.tab-btn-highlight:hover {
  border-color: rgba(168, 85, 247, 0.6);
  color: #c084fc;
}

.tab-btn-highlight.active {
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.45);
  border-color: transparent;
}

.tab-badge {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.tab-badge.purple {
  background: rgba(168, 85, 247, 0.25);
  color: #d8b4fe;
}

[data-theme="light"] .tab-badge.purple {
  background: rgba(168, 85, 247, 0.15);
  color: #7e22ce;
}

.tab-badge.cyan {
  background: rgba(6, 182, 212, 0.2);
  color: #67e8f9;
}

[data-theme="light"] .tab-badge.cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #0369a1;
}

.tab-badge.rose {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
}

[data-theme="light"] .tab-badge.rose {
  background: rgba(244, 63, 94, 0.15);
  color: #be123c;
}

.tab-btn.active .tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Tab Panes */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeInTab 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .btn-secondary {
  background: #ffffff;
  border-color: rgba(203, 213, 225, 0.85);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent-indigo));
}

.kpi-card.emerald { --card-accent: var(--accent-emerald); }
.kpi-card.cyan { --card-accent: var(--accent-cyan); }
.kpi-card.indigo { --card-accent: var(--accent-indigo); }
.kpi-card.purple { --card-accent: var(--accent-purple); }

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.kpi-title {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--card-accent, var(--accent-indigo));
}

.kpi-value {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.kpi-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.kpi-pill {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.kpi-pill.positive {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.kpi-pill.info {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
}

/* Charts Section */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.chart-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.chart-card.col-8 { grid-column: span 8; }
.chart-card.col-4 { grid-column: span 4; }
.chart-card.col-6 { grid-column: span 6; }
.chart-card.col-12 { grid-column: span 12; }

@media (max-width: 1024px) {
  .chart-card.col-8,
  .chart-card.col-4,
  .chart-card.col-6 {
    grid-column: span 12;
  }
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.chart-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-container {
  position: relative;
  height: 270px;
  width: 100%;
}

/* Stability Banner Card */
.stability-highlight-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.stability-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stability-score-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--gradient-success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

.stability-text h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.stability-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Tables Section */
.section-box {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.section-box-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.section-box-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  min-width: 220px;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--accent-indigo);
}

.select-filter {
  background: #1f2937;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.88rem;
}

.data-table th {
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges for status */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-status.stable {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-status.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-status.crash {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

/* Device Chip */
.device-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.device-chip-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.device-chip-text .model-name {
  font-weight: 600;
  color: var(--text-primary);
}

.device-chip-text .brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Modal Popup */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-content {
  background: #131b2e;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  color: var(--text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-body {
  padding: 20px 24px;
}

.code-box {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.8rem;
  color: #e2e8f0;
  overflow-x: auto;
  white-space: pre-wrap;
  max-height: 320px;
  margin-top: 10px;
}

/* Footer */
.footer {
  text-align: center;
  padding-top: 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer a {
  color: var(--accent-indigo);
  text-decoration: none;
}

/* ==========================================================================
   Light Theme Comprehensive Overrides
   ========================================================================== */
[data-theme="light"] .search-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .search-input:focus {
  border-color: var(--accent-indigo);
}

[data-theme="light"] .select-filter {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .data-table th {
  background: #f8fafc;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .data-table td {
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .data-table tr:hover {
  background: #f8fafc;
}

[data-theme="light"] .modal-content {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
}

[data-theme="light"] .code-box {
  background: #f8fafc;
  color: #1e293b;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .device-chip-icon {
  background: rgba(6, 182, 212, 0.1);
}

[data-theme="light"] .kpi-icon {
  background: rgba(99, 102, 241, 0.08);
}

[data-theme="light"] .bg-mesh {
  background: radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.07) 0%, transparent 45%),
              radial-gradient(circle at 85% 80%, rgba(6, 182, 212, 0.07) 0%, transparent 45%),
              radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.04) 0%, transparent 50%);
}

/* ==========================================================================
   Releases Management Styles
   ========================================================================== */

.active-release-hero {
  border: 1px solid rgba(16, 185, 129, 0.25);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.04) 0%, rgba(6, 182, 212, 0.04) 100%), var(--bg-card);
  position: relative;
  overflow: hidden;
}

.active-release-hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.active-release-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.release-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 8px;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.pulse-dot-emerald {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseEmerald 2s infinite;
}

@keyframes pulseEmerald {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.active-version-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.active-version-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 650px;
  line-height: 1.5;
}

.release-quick-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.release-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.release-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.meta-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.meta-val {
  font-size: 0.92rem;
  color: var(--text-primary);
}

.sha-code, .url-code {
  font-family: monospace;
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 8px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  color: #38bdf8;
}

.releases-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

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

.sync-tag-glow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 6px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.sync-tag-purple {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.12);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 6px;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.detected-build-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(6, 182, 212, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.detected-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detected-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.detected-details strong {
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detected-details span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.apk-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.apk-dropzone:hover, .apk-dropzone.dropzone-active {
  border-color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
}

.dropzone-icon {
  color: var(--accent-indigo);
}

.dropzone-title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.dropzone-sub {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.progress-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  transition: width 0.25s ease;
}

/* Light Theme Overrides for Releases */
[data-theme="light"] .active-release-hero {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(6, 182, 212, 0.04) 100%), #ffffff;
  border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="light"] .release-meta-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .sha-code,
[data-theme="light"] .url-code {
  background: #f1f5f9;
  color: #0284c7;
}

[data-theme="light"] .detected-build-box {
  background: rgba(6, 182, 212, 0.05);
  border-color: rgba(6, 182, 212, 0.25);
}

[data-theme="light"] .apk-dropzone {
  border-color: #cbd5e1;
  background: #f8fafc;
}

[data-theme="light"] .apk-dropzone:hover,
[data-theme="light"] .apk-dropzone.dropzone-active {
  background: rgba(99, 102, 241, 0.06);
  border-color: var(--accent-indigo);
}

/* ==========================================================================
   Unified Devices & AI Analysis Review (Master-Detail Drilldown)
   ========================================================================== */

.clickable-device-row {
  cursor: pointer;
  transition: all 0.2s ease;
}

.clickable-device-row:hover {
  background: rgba(99, 102, 241, 0.08) !important;
  transform: scale(1.002);
}

.badge-analyses-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.selected-device-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(6, 182, 212, 0.05) 100%), var(--bg-card);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.device-banner-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.device-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.bc-sep {
  color: var(--text-muted);
  opacity: 0.5;
}

.device-profile-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.device-profile-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.device-avatar-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.device-profile-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.device-profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-chip {
  display: inline-block;
  font-size: 0.76rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.code-chip {
  font-family: monospace;
  color: var(--accent-cyan);
}

.device-analysis-stats-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat-mini-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  min-width: 68px;
}

.pill-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.pill-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-mini-pill.positive .pill-val { color: #34d399; }
.stat-mini-pill.warning .pill-val { color: #fbbf24; }
.stat-mini-pill.danger .pill-val { color: #fb7185; }
.stat-mini-pill.purple .pill-val { color: #c084fc; }
.stat-mini-pill.cyan .pill-val { color: #38bdf8; }

.analysis-filters-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.filter-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-field-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Light Mode Overrides */
[data-theme="light"] .selected-device-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(6, 182, 212, 0.04) 100%), #ffffff;
  border-color: rgba(99, 102, 241, 0.25);
}

[data-theme="light"] .clickable-device-row:hover {
  background: #f1f5f9 !important;
}

[data-theme="light"] .stat-mini-pill {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .profile-chip {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}

/* ==========================================================================
   Secure Login Overlay & Authentication Modal
   ========================================================================== */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(145deg, rgba(26, 34, 52, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 35px rgba(99, 102, 241, 0.2);
  padding: 36px 32px;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo-glow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  border-radius: 18px;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
  margin-bottom: 16px;
}

.auth-brand h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.auth-brand p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.auth-error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  margin-bottom: 18px;
  text-align: center;
  animation: fadeIn 0.25s ease;
}

.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  display: block;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  right: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.auth-input-wrapper input {
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 42px 12px 14px;
  color: #ffffff;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}

.auth-input-wrapper input:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.btn-toggle-pwd {
  position: absolute;
  left: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.btn-toggle-pwd:hover {
  color: #ffffff;
}

.auth-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.remember-me-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.remember-me-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #6366f1;
  cursor: pointer;
}

.btn-login {
  width: 100%;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 25px rgba(79, 70, 229, 0.45);
}

.btn-login:active {
  transform: translateY(1px);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

.auth-shake {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(3px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
  40%, 60% { transform: translate3d(5px, 0, 0); }
}

.auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Light Mode Overrides for Auth */
[data-theme="light"] .auth-overlay {
  background: rgba(241, 245, 249, 0.85);
}

[data-theme="light"] .auth-card {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.12), 0 0 20px rgba(99, 102, 241, 0.08);
}

[data-theme="light"] .auth-brand h2 {
  color: #0f172a;
}

[data-theme="light"] .auth-input-wrapper input {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .auth-input-wrapper input:focus {
  background: #ffffff;
  border-color: #4f46e5;
}

[data-theme="light"] .btn-toggle-pwd:hover {
  color: #0f172a;
}

/* Release Upload Progress Bar Styling */
.progress-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4, #10b981);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

[data-theme="light"] .progress-bar-track {
  background: #e2e8f0;
}



