html, body { height: 100%; }
* { -webkit-tap-highlight-color: transparent; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #2a3444; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }
.safe-top { padding-top: env(safe-area-inset-top); }

.card {
  background: #121821;
  border: 1px solid #232c3a;
  border-radius: 14px;
}

.card-hover:active { background: #171f2b; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-weight: 600;
  padding: 10px 16px;
  transition: transform .05s ease, opacity .15s ease;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: #3b82f6; color: white; }
.btn-secondary { background: #1c2534; color: #e5e7eb; border: 1px solid #2a3444; }
.btn-danger { background: #ef4444; color: white; }
.btn-ghost { background: transparent; color: #9ca3af; }
.btn:disabled { opacity: .5; pointer-events: none; }

.input {
  width: 100%;
  background: #0e141d;
  border: 1px solid #232c3a;
  border-radius: 12px;
  padding: 12px 14px;
  color: #f3f4f6;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
}
.input:focus { outline: none; border-color: #3b82f6; }
.input::placeholder { color: #5b6676; }

label.field-label {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 6px;
  display: block;
  font-weight: 600;
}

.skeleton {
  background: linear-gradient(90deg, #171f2b 25%, #1e2733 37%, #171f2b 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
  border-radius: 10px;
}
@keyframes skeleton {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.fade-in { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.toast {
  pointer-events: auto;
  background: #1c2534;
  border: 1px solid #2a3444;
  color: #f3f4f6;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  max-width: 92vw;
}
.toast.error { border-color: #ef4444; }
.toast.success { border-color: #22c55e; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
}
.modal-sheet {
  background: #0f151e;
  border: 1px solid #232c3a;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 20px;
}
@media (min-width: 640px) {
  .modal-sheet { border-radius: 20px; }
}

.bottom-nav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 30;
  background: #0f151e;
  border-top: 1px solid #232c3a;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 0 6px; color: #6b7688; font-size: 11px; font-weight: 600;
}
.nav-item.active { color: #3b82f6; }
.nav-item i { font-size: 18px; }

.fab {
  width: 52px; height: 52px; border-radius: 50%;
  background: #3b82f6; color: white; display: flex; align-items: center; justify-content: center;
  font-size: 20px; box-shadow: 0 6px 18px rgba(59,130,246,.5);
  margin-top: -22px;
}

.priority-glow {
  box-shadow: 0 0 0 1px rgba(239,68,68,.4);
}

.desktop-only { display: none; }
@media (min-width: 900px) {
  .desktop-only { display: block; }
  .mobile-only { display: none; }
  .bottom-nav { display: none; }
}

.spinner {
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  width: 18px; height: 18px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.offline-banner {
  background: #f59e0b; color: #111827; text-align: center; font-size: 13px; font-weight: 700;
  padding: 6px 10px;
}
