/*
 * Caye QR — Global Styles
 * Component classes used throughout EJS views.
 * Tailwind CDN handles utilities; this file handles reusable patterns.
 */

/* ── Base ────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: #2d3448; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3d4560; }

/* ── Card ────────────────────────────────────────────────────────────────────── */
.card {
  background: #1a1f2e;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 1rem;
  padding: 1.25rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  background: #0fb8a9;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.625rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary:hover  { background: #0d9e91; }
.btn-primary:active { background: #0a7d72; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  background: #232938;
  color: #d1d5db;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.625rem;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-secondary:hover { background: #2d3448; color: #fff; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  color: #9ca3af;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 0.625rem;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: #fff; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.875rem;
  background: transparent;
  color: #f87171;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.625rem;
  border: 1px solid rgba(248,113,113,0.3);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-danger:hover { background: rgba(248,113,113,0.12); }

/* ── Form fields ─────────────────────────────────────────────────────────────── */
.input-field {
  width: 100%;
  padding: 0.65rem 0.875rem;
  background: #232938;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.625rem;
  color: #f9fafb;
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}
.input-field::placeholder { color: #4b5563; }
.input-field:focus {
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(15,184,169,0.45);
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #9ca3af;
  margin-bottom: 0.375rem;
}

.form-hint {
  font-size: 0.7rem;
  color: #4b5563;
  margin-top: 0.375rem;
}

/* ── Nav links ───────────────────────────────────────────────────────────────── */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #9ca3af;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-link:hover { background: rgba(255,255,255,0.05); color: #f9fafb; }
.nav-active     { background: rgba(15,184,169,0.12) !important; color: #0fb8a9 !important; }

/* ── Status badges ───────────────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}
.status-active   { background: rgba(16,185,129,0.15); color: #34d399; }
.status-inactive { background: rgba(107,114,128,0.15); color: #6b7280; }
.status-badge:hover { opacity: 0.8; }

/* ── Toast animation ─────────────────────────────────────────────────────────── */
@keyframes slide-in {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.animate-slide-in { animation: slide-in 0.25s ease-out; }

/* ── Hover utilities ─────────────────────────────────────────────────────────── */
.hover\:bg-white\/2:hover { background: rgba(255,255,255,0.02); }

/* ── Mobile sidebar ──────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
}
