/* ═══════════════════════════════════════════════════════════
   UPI Gateway — Design System (Dark Theme)
   Converted from Tailwind CSS classes to vanilla CSS
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg-primary: #0B0F19;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --border-default: #1F2937;
  --border-glow: #374151;
  --accent-green: #10B981;
  --accent-cyan: #06B6D4;
  --accent-red: #EF4444;
  --accent-yellow: #F59E0B;
  --accent-blue: #6366F1;
  --accent-purple: #8B5CF6;
  --text-primary: #F9FAFB;
  --text-secondary: #D1D5DB;
  --text-muted: #6B7280;
  --text-dim: #374151;
  --radius: 12px;
  --radius-xl: 16px;
  color-scheme: dark;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; display: block; }
input, select, textarea { font-family: inherit; color-scheme: dark; }
select option { background: #111827; color: #F9FAFB; }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: #4B5563; }

/* ── Typography ────────────────────────────────────────── */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; line-height: 1.1; }
.text-6xl { font-size: 3.75rem; line-height: 1.05; }
.font-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.tabular-nums { font-variant-numeric: tabular-nums; }

/* ── Colors ────────────────────────────────────────────── */
.text-white { color: #fff; }
.text-gray-300 { color: #D1D5DB; }
.text-gray-400 { color: #9CA3AF; }
.text-gray-500 { color: #6B7280; }
.text-gray-600 { color: #4B5563; }
.text-emerald-400 { color: #34D399; }
.text-cyan-400 { color: #22D3EE; }
.text-red-400 { color: #F87171; }
.text-red-500 { color: #EF4444; }
.text-yellow-400 { color: #FBBF24; }
.text-violet-400 { color: #A78BFA; }

/* ── Gradients ─────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(to right, #34D399, #22D3EE);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-btn {
  background: linear-gradient(to right, #10B981, #06B6D4);
  color: white;
  border: none;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
}
.gradient-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.gradient-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Layout ────────────────────────────────────────────── */
.container { max-width: 1152px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 448px; margin: 0 auto; }
.container-md { max-width: 768px; margin: 0 auto; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.w-full { width: 100%; }
.min-h-screen { min-height: 100vh; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-7 { padding: 1.75rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-32 { padding-top: 8rem; }
.pb-20 { padding-bottom: 5rem; }
.hidden { display: none; }
.relative { position: relative; }
.overflow-x-auto { overflow-x: auto; }
.overflow-hidden { overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shrink-0 { flex-shrink: 0; }

/* ── Glass Card ────────────────────────────────────────── */
.glass-card {
  background: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.glass-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 4px 30px rgba(99, 102, 241, 0.06);
}

/* ── Inputs ────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder { color: #4B5563; }
.input:focus {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}
.label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-primary { background: linear-gradient(to right, #10B981, #06B6D4); color: white; box-shadow: 0 4px 15px rgba(16,185,129,0.25); }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }
.btn-secondary { background: rgba(255,255,255,0.1); border: 1px solid var(--border-glow); color: var(--text-secondary); }
.btn-secondary:hover { background: rgba(255,255,255,0.15); }
.btn-ghost { background: transparent; border: 1px solid var(--border-default); color: var(--text-secondary); }
.btn-ghost:hover { background: rgba(255,255,255,0.05); }
.btn-danger { color: var(--text-muted); background: transparent; border: none; padding: 0.5rem; }
.btn-danger:hover { color: var(--accent-red); background: rgba(239,68,68,0.1); border-radius: 0.5rem; }

/* ── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid;
}
.badge-success { background: rgba(16,185,129,0.1); color: #34D399; border-color: rgba(16,185,129,0.2); }
.badge-pending { background: rgba(245,158,11,0.1); color: #FBBF24; border-color: rgba(245,158,11,0.2); }
.badge-failed { background: rgba(239,68,68,0.1); color: #F87171; border-color: rgba(239,68,68,0.2); }
.badge-expired { background: rgba(107,114,128,0.1); color: #9CA3AF; border-color: rgba(107,114,128,0.2); }

/* ── Alert ─────────────────────────────────────────────── */
.alert-error {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #F87171;
  font-size: 0.875rem;
}

/* ── Navigation ────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-default);
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(16px);
}
.navbar-inner {
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(to bottom right, #10B981, #06B6D4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
}
.logo-text { font-size: 1.125rem; font-weight: 700; }
.nav-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  transition: color 0.2s;
}
.nav-link:hover { color: white; }

/* ── Sidebar Dashboard ─────────────────────────────────── */
.dashboard-wrap { display: flex; min-height: 100vh; }
.sidebar {
  width: 256px;
  background: #0d1117;
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 50;
  transition: transform 0.3s;
}
.sidebar-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border-default);
}
.sidebar-nav { flex: 1; padding: 1rem 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
  border: 1px solid transparent;
  text-decoration: none;
}
.sidebar-link:hover { color: white; background: rgba(255,255,255,0.05); }
.sidebar-link.active {
  background: rgba(16,185,129,0.1);
  color: #34D399;
  border-color: rgba(16,185,129,0.2);
}
.sidebar-footer { padding: 0.75rem; border-top: 1px solid var(--border-default); }
.main-content {
  flex: 1;
  margin-left: 256px;
  min-width: 0;
}
.main-inner { padding: 1.5rem 2rem; max-width: 1152px; }
.mobile-header {
  height: 56px;
  display: none;
  align-items: center;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border-default);
}
.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}
.sidebar-close { display: none; background: none; border: none; color: var(--text-muted); cursor: pointer; }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 40;
}

/* ── Table ─────────────────────────────────────────────── */
.data-table { width: 100%; font-size: 0.875rem; border-collapse: collapse; }
.data-table thead tr { border-bottom: 1px solid var(--border-default); }
.data-table th {
  text-align: left;
  padding: 0.75rem 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.data-table td { padding: 0.875rem 1.25rem; }
.data-table tbody tr { border-bottom: 1px solid rgba(31,41,55,0.5); transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.01); }

/* ── Stat Card ─────────────────────────────────────────── */
.stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon.green { background: linear-gradient(to bottom right, #10B981, #059669); }
.stat-icon.cyan { background: linear-gradient(to bottom right, #06B6D4, #0891B2); }
.stat-icon.yellow { background: linear-gradient(to bottom right, #F59E0B, #D97706); }
.stat-icon.red { background: linear-gradient(to bottom right, #EF4444, #DC2626); }
.stat-icon.violet { background: linear-gradient(to bottom right, #8B5CF6, #7C3AED); }

/* ── Feature Card ──────────────────────────────────────── */
.feature-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  transition: transform 0.2s;
}
.glass-card:hover .feature-icon { transform: scale(1.1); }

/* ── Code Block ────────────────────────────────────────── */
.code-block {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-default);
  overflow: hidden;
}
.code-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
}
.code-dot { width: 12px; height: 12px; border-radius: 50%; }
.code-dot.red { background: rgba(239,68,68,0.8); }
.code-dot.yellow { background: rgba(245,158,11,0.8); }
.code-dot.green { background: rgba(16,185,129,0.8); }
.code-pre {
  padding: 0 1.5rem 1.5rem;
  overflow-x: auto;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-family: 'JetBrains Mono', monospace;
}

/* ── QR Checkout ───────────────────────────────────────── */
.qr-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(99,102,241,0.15), transparent 70%);
  border-radius: 50%;
  animation: pulse-glow 3s ease-in-out infinite;
  pointer-events: none;
}
.qr-container {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 0.75rem;
  border: 1px solid var(--border-default);
}
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ── Animations ────────────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes success-pop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes ring-expand {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.animate-fade-in { animation: fade-in 0.5s ease-out both; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-success-pop { animation: success-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.animate-ring-expand { animation: ring-expand 1s ease-out 0.5s both; }

.skeleton {
  background: linear-gradient(90deg, #1F2937 25%, #374151 50%, #1F2937 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* ── Spinner ───────────────────────────────────────────── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
.spinner-lg { width: 40px; height: 40px; border-width: 3px; border-top-color: var(--accent-green); }

/* ── Password Toggle ───────────────────────────────────── */
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 2.75rem; }
.pw-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
}
.pw-toggle:hover { color: var(--text-secondary); }

/* ── Copy Button ───────────────────────────────────────── */
.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.375rem;
  cursor: pointer;
  transition: color 0.2s;
}
.copy-btn:hover { color: white; }
.copy-btn.copied { color: var(--accent-green); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-cols-2 { grid-template-columns: 1fr; }
  .grid-cols-3 { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .sidebar-overlay.active { display: block; }
  .main-content { margin-left: 0; }
  .mobile-header { display: flex; }
  .main-inner { padding: 1rem; }
  .text-5xl { font-size: 2.25rem; }
  .text-6xl { font-size: 2.75rem; }
  .hide-mobile { display: none !important; }
  .pt-32 { padding-top: 6rem; }
}

@media (min-width: 769px) {
  .show-mobile { display: none !important; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Utility ───────────────────────────────────────────── */
.border-b { border-bottom: 1px solid var(--border-default); }
.border-t { border-top: 1px solid var(--border-default); }
.rounded-xl { border-radius: var(--radius); }
.rounded-2xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }
.shadow-glow { box-shadow: 0 4px 15px rgba(16,185,129,0.2); }
.underline-dashed { text-decoration: underline; text-decoration-style: dashed; text-underline-offset: 4px; }
.inline-flex { display: inline-flex; }
