@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  color-scheme: dark;
  --page: #030303;
  --surface: #12151da3;
  --surface-raised: #101114;
  --stroke: #87b1ff30;
  --stroke-strong: #87b1ff66;
  --text: #f5f7ff;
  --muted: #a0a6b3;
  --blue: #4b8dff;
  --blue-bright: #6aa3ff;
  --blue-glow: #4185ff3d;
}

html { background: var(--page); }
body {
  font-family: 'Cairo', sans-serif;
  background: radial-gradient(50% 50% at 80% 18%, #102344 0%, #080e1b 32%, var(--page) 74%) !important;
  color: var(--text) !important;
  direction: rtl;
}

.font-mono-code { font-family: 'JetBrains Mono', monospace; }

/* Translucent surfaces and blue edge light, matching Swift Operator in Framer. */
.glass-card {
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--stroke);
  box-shadow: 0 24px 80px -44px rgba(0, 0, 0, .72), inset 0 1px 0 rgba(255, 255, 255, .025);
}
.glass-card-hover { transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.glass-card-hover:hover {
  transform: translateY(-2px);
  border-color: var(--stroke-strong);
  box-shadow: 0 16px 40px -27px var(--blue-glow), inset 0 1px 0 rgba(135, 177, 255, .08);
}

/* Match the published dashboard's glass hierarchy and card radii. */
#appRoot main > .grid.grid-cols-2 > .glass-card { border-radius: 14px !important; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
#appRoot .glass-card.rounded-2xl { border-radius: 24px !important; }
#appRoot .glass-card.rounded-xl { border-radius: 14px !important; }
#appRoot .glass-card > .bg-gray-950\/60 { background: #070a119e !important; backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); }
#appRoot .glass-card > .relative.bg-gray-950\/90 { background: #02060e7a !important; }
#appRoot .glass-card > .bg-black\/60 { background: rgba(2, 6, 14, .48) !important; }
#appRoot .border-gray-800, #appRoot .border-gray-800\/80, #appRoot .border-gray-800\/60 { border-color: var(--stroke) !important; }
#appRoot .bg-gray-950\/70, #appRoot .bg-gray-950\/60, #appRoot .bg-gray-950\/40 { background-color: #070a119e !important; }
#appRoot .bg-gray-900 { background-color: #020c1c6b !important; }
#appRoot .bg-gray-800, #appRoot .bg-gray-800\/80 { background-color: #20232b !important; }
#appRoot #pulseIndicator { color: #dae8ff !important; box-shadow: 0 0 32px -12px #4185ff80 !important; }
#appRoot #wsBadge { background-color: #87b1ff0d !important; border-color: #87b1ff30 !important; }
#appRoot #kpiProgressBar, #appRoot #modulesContainer .bg-gradient-to-r { background-image: linear-gradient(90deg, #4b8dff, #87b1ff) !important; }
#appRoot .border-emerald-500\/40 { border-color: #87b1ff66 !important; }

/* Convert the legacy emerald Tailwind utilities to the Framer electric-blue palette. */
#appRoot .text-emerald-300, #appRoot .text-emerald-400,
#appRoot .text-cyan-300, #appRoot .text-cyan-400 { color: var(--blue-bright) !important; }
#appRoot .text-amber-400, #appRoot .text-violet-400 { color: #91baff !important; }
#appRoot .text-gray-400 { color: #a0a6b3 !important; }
#appRoot .text-gray-500 { color: #8b95a8 !important; }
#appRoot .text-gray-300 { color: #dae8ff !important; }
#appRoot .text-white { color: #f5f7ff !important; }
#appRoot .text-emerald-500, #appRoot .text-cyan-500 { color: var(--blue) !important; }
#appRoot .bg-emerald-400, #appRoot .bg-emerald-500, #appRoot .bg-cyan-400,
#appRoot .bg-cyan-500 { background-color: var(--blue) !important; }
#appRoot .bg-emerald-950\/60, #appRoot .bg-gray-950\/70 {
  background-color: rgba(7, 10, 18, .83) !important;
}
#appRoot .bg-emerald-500\/10, #appRoot .bg-cyan-500\/10,
#appRoot .bg-emerald-950\/60 { background-color: rgba(48, 102, 208, .12) !important; }
#appRoot .bg-emerald-900\/60, #appRoot .bg-emerald-950\/20 { background-color: rgba(48, 102, 208, .18) !important; }
#appRoot .border-emerald-500\/30 { border-color: rgba(83, 139, 255, .32) !important; }
#appRoot .focus\:border-emerald-500:focus { border-color: var(--blue-bright) !important; }
#appRoot .from-emerald-400, #appRoot .from-emerald-500,
#appRoot .to-cyan-400, #appRoot .to-cyan-500 {
  --tw-gradient-from: #347aff var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgb(52 122 255 / 0) var(--tw-gradient-to-position) !important;
  --tw-gradient-stops: var(--tw-gradient-from), #67a5ff var(--tw-gradient-to-position) !important;
}
#appRoot .shadow-emerald-500\/20, #appRoot .shadow-emerald-500\/25 { --tw-shadow-color: rgba(55, 118, 255, .28) !important; }
#appRoot .selection\:bg-emerald-500::selection { background: var(--blue) !important; }

#appRoot input, #appRoot select {
  background-color: #020c1c6b !important;
  border-color: #9ab4e238 !important;
  border-radius: 14px !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text) !important;
}
#appRoot input { min-height: 50px; }
#appRoot select { min-height: 44px; }
#appRoot input:focus, #appRoot select:focus {
  background-color: #142b52a6 !important;
  border-color: #6aa3ff !important;
  box-shadow: 0 0 0 3px #4185ff1a;
}
#appRoot button { transition: filter .18s ease, transform .18s ease, border-color .18s ease; }
#appRoot button:hover:not(:disabled) { filter: brightness(1.13); }
#appRoot #btnStart {
  background: linear-gradient(110deg, #4185ff3d, #4185ff1a) !important;
  color: #f5f7ff !important;
  border: 1px solid #87b1ff6b;
  border-radius: 14px;
  backdrop-filter: blur(16px);
  box-shadow: 0 0 28px -12px #4185ff66;
}
#appRoot #btnStart:hover:not(:disabled) { background: linear-gradient(110deg, #4185ff47, #4185ff1f) !important; }
#appRoot .live-badge-dot { box-shadow: 0 0 10px currentColor; }

.glow-emerald, .glow-cyan { box-shadow: 0 0 25px -3px var(--blue-glow); }
.glow-pulse { animation: pulse-glow 2s infinite alternate; }
@keyframes pulse-glow {
  from { box-shadow: 0 0 15px rgba(59, 125, 255, .18); }
  to { box-shadow: 0 0 30px rgba(59, 125, 255, .42); }
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(8, 12, 21, .8); }
::-webkit-scrollbar-thumb { background: rgba(113, 136, 184, .36); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(76, 135, 255, .7); }
.live-badge-dot { animation: blink 1.2s cubic-bezier(.4, 0, .6, 1) infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.gradient-title {
  background: none;
  color: #dae8ff;
  -webkit-text-fill-color: currentColor;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
