/* GemTopup — Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

:root[data-theme="dark"] {
  --bg: #080807; --bg2: #0f0f0d; --bg3: #161612;
  --card: #121210; --card2: #1c1c18;
  --border: rgba(212,175,55,0.1); --border2: rgba(212,175,55,0.25);
  --text: #f0ece0; --text2: #9a9278; --text3: #5a5442;
  --gold: #D4AF37; --gold2: #F0C93A;
  --glow: rgba(212,175,55,0.06); --glow2: rgba(212,175,55,0.15);
  --nav-bg: rgba(8,8,7,0.9);
  --red: #e05555; --green: #5cb85c; --blue: #5b9bd5;
  --sidebar-w: 260px;
}
:root[data-theme="light"] {
  --bg: #faf8f2; --bg2: #f2ede0; --bg3: #e8e2d0;
  --card: #ffffff; --card2: #f7f3e8;
  --border: rgba(139,105,20,0.12); --border2: rgba(139,105,20,0.28);
  --text: #18160e; --text2: #6b6040; --text3: #9a8e6a;
  --gold: #9a7a08; --gold2: #b89010;
  --glow: rgba(180,140,20,0.06); --glow2: rgba(180,140,20,0.12);
  --nav-bg: rgba(250,248,242,0.92);
  --red: #c0392b; --green: #27ae60; --blue: #2980b9;
  --sidebar-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); transition: background 0.3s, color 0.3s; overflow-x: hidden; }

/* ─── BUTTONS ─── */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1.3rem; border-radius: 7px; font-family: 'DM Sans', sans-serif; font-size: 0.875rem; font-weight: 600; cursor: pointer; text-decoration: none; border: none; transition: all 0.25s; letter-spacing: 0.01em; }
.btn-gold { background: var(--gold); color: #0a0900; }
.btn-gold:hover { background: var(--gold2); transform: translateY(-1px); box-shadow: 0 6px 20px var(--glow2); }
.btn-ghost { background: transparent; border: 1px solid var(--border2); color: var(--text); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { background: var(--red); color: #fff; }
.btn-full { width: 100%; justify-content: center; padding: 0.8rem; font-size: 0.95rem; }

/* ─── ALERTS ─── */
.alert { padding: 0.9rem 1.2rem; border-radius: 8px; font-size: 0.9rem; margin-bottom: 1.2rem; border-left: 3px solid; line-height: 1.5; }
.alert a { color: inherit; font-weight: 600; }
.alert-success { background: rgba(92,184,92,0.12); border-color: var(--green); color: var(--green); }
.alert-error   { background: rgba(224,85,85,0.12); border-color: var(--red); color: var(--red); }
.alert-info    { background: rgba(91,155,213,0.12); border-color: var(--blue); color: var(--blue); }
.alert-warning { background: rgba(212,175,55,0.12); border-color: var(--gold); color: var(--gold); }

/* ─── AUTH PAGES ─── */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-left { background: var(--bg2); border-right: 1px solid var(--border); display: flex; align-items: center; justify-content: center; padding: 3rem; position: relative; overflow: hidden; }
.auth-left::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 60% at 50% 50%, var(--glow2), transparent 70%); }
.auth-brand { position: relative; z-index: 1; max-width: 400px; }
.logo-link { font-family: 'Syne', sans-serif; font-size: 1.8rem; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: -0.02em; display: block; margin-bottom: 2rem; }
.logo-link span { color: var(--gold); }
.auth-brand h2 { font-family: 'Syne', sans-serif; font-size: 2rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: -0.02em; }
.auth-brand p { color: var(--text2); line-height: 1.7; margin-bottom: 2rem; }
.auth-features { display: flex; flex-direction: column; gap: 0.8rem; }
.auth-feat { display: flex; align-items: center; gap: 0.8rem; color: var(--text2); font-size: 0.9rem; }
.auth-feat span { font-size: 1.2rem; }

.auth-right { display: flex; align-items: center; justify-content: center; padding: 3rem; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box h1 { font-family: 'Syne', sans-serif; font-size: 1.8rem; font-weight: 800; margin-bottom: 0.3rem; }
.auth-sub { color: var(--text2); font-size: 0.9rem; margin-bottom: 2rem; }
.auth-sub a { color: var(--gold); text-decoration: none; font-weight: 600; }

/* ─── FORMS ─── */
.auth-form, .service-form, .settings-form { display: flex; flex-direction: column; gap: 1.1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text2); display: flex; justify-content: space-between; }
.form-group input, .form-group select, .form-group textarea { background: var(--card2); border: 1px solid var(--border2); color: var(--text); padding: 0.7rem 0.9rem; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 0.9rem; transition: border-color 0.2s; width: 100%; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--gold); }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 2.8rem; }
.toggle-pw { position: absolute; right: 0.7rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--text2); }
.forgot-link { color: var(--gold); text-decoration: none; font-size: 0.8rem; }
.form-check { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.85rem; color: var(--text2); }
.form-check a { color: var(--gold); }
.form-check input { width: auto; margin-top: 2px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ─── QUICK AMOUNTS ─── */
.quick-amounts { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.qa-btn { background: var(--card2); border: 1px solid var(--border); color: var(--text2); padding: 0.3rem 0.7rem; border-radius: 6px; font-size: 0.78rem; cursor: pointer; transition: all 0.2s; }
.qa-btn:hover { border-color: var(--gold); color: var(--gold); }
.wallet-info { background: var(--glow); border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem 1rem; font-size: 0.85rem; color: var(--text2); }
.wallet-info strong { color: var(--text); }

/* ─── NETWORK PICKER ─── */
.network-picker { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.network-option input { display: none; }
.network-btn { display: block; padding: 0.5rem 1.1rem; border-radius: 8px; border: 1px solid var(--border2); color: var(--text2); cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: all 0.2s; }
.network-option input:checked + .network-btn { border-color: var(--gold); color: var(--gold); background: var(--glow2); }

/* ─── PLAN GRID ─── */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.plan-option input { display: none; }
.plan-card { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.9rem 0.6rem; border: 1px solid var(--border2); border-radius: 10px; cursor: pointer; transition: all 0.2s; text-align: center; }
.plan-option input:checked + .plan-card { border-color: var(--gold); background: var(--glow2); }
.plan-size { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.95rem; }
.plan-duration { font-size: 0.72rem; color: var(--text2); }
.plan-price { font-size: 0.85rem; font-weight: 600; color: var(--gold); }

/* ─── NETWORK TABS ─── */
.network-tabs { display: flex; gap: 0.3rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.ntab { padding: 0.5rem 1rem; font-size: 0.85rem; font-weight: 600; color: var(--text2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.2s; }
.ntab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ─── DASHBOARD LAYOUT ─── */
.dashboard-layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 100; transition: transform 0.3s; overflow-y: auto; }
.sidebar-logo { padding: 1.3rem 1.4rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.sidebar-logo a { font-family: 'Syne', sans-serif; font-size: 1.3rem; font-weight: 800; color: var(--text); text-decoration: none; }
.sidebar-logo a span { color: var(--gold); }
.sidebar-close { display: none; background: none; border: none; color: var(--text2); font-size: 1.2rem; cursor: pointer; }

.wallet-card { margin: 1rem; background: var(--glow2); border: 1px solid var(--border2); border-radius: 12px; padding: 1rem; }
.wallet-label { font-size: 0.75rem; color: var(--text2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.wallet-amount { font-family: 'Syne', sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--gold); margin: 0.2rem 0 0.6rem; }
.wallet-btn { display: block; text-align: center; background: var(--gold); color: #0a0900; text-decoration: none; padding: 0.4rem 0.8rem; border-radius: 6px; font-size: 0.8rem; font-weight: 700; }

.sidebar-nav { padding: 0.8rem 0; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.75rem 1.4rem; color: var(--text2); text-decoration: none; font-size: 0.875rem; font-weight: 500; transition: all 0.2s; position: relative; }
.nav-item:hover { color: var(--text); background: var(--glow); }
.nav-item.active { color: var(--gold); background: var(--glow2); border-right: 2px solid var(--gold); }
.nav-icon { font-size: 1.1rem; width: 1.4rem; text-align: center; }
.nav-badge { margin-left: auto; background: var(--gold); color: #0a0900; font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 100px; }
.nav-logout:hover { color: var(--red); }
.sidebar-footer { border-top: 1px solid var(--border); padding: 0.5rem 0; }

.dashboard-main { flex: 1; margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.dash-topbar { position: sticky; top: 0; z-index: 50; background: var(--nav-bg); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); padding: 0 1.5rem; height: 58px; display: flex; align-items: center; gap: 1rem; }
.menu-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.3rem; cursor: pointer; }
.dash-greeting { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1rem; flex: 1; }
.dash-topbar-right { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.notif-btn { color: var(--text2); text-decoration: none; font-size: 1.1rem; position: relative; }
.notif-dot { position: absolute; top: -4px; right: -6px; background: var(--gold); color: #0a0900; font-size: 0.6rem; font-weight: 700; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.dash-content { padding: 1.8rem; flex: 1; }

/* ─── STATS CARDS ─── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.2rem; display: flex; align-items: center; gap: 1rem; position: relative; }
.stat-icon { font-size: 1.8rem; }
.stat-value { font-family: 'Syne', sans-serif; font-size: 1.3rem; font-weight: 800; }
.stat-label { font-size: 0.78rem; color: var(--text2); margin-top: 0.1rem; }
.stat-action { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--gold); text-decoration: none; font-size: 0.8rem; font-weight: 700; }

/* ─── QUICK SERVICES ─── */
.quick-services { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.8rem; margin-bottom: 2rem; }
.qs-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.2rem 0.8rem; text-align: center; text-decoration: none; color: var(--text); transition: all 0.25s; }
.qs-card:hover { border-color: var(--border2); transform: translateY(-3px); box-shadow: 0 8px 24px var(--glow); }
.qs-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.qs-label { font-size: 0.78rem; font-weight: 600; color: var(--text2); }

/* ─── SECTION HEADERS ─── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-header h2 { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 700; }
.view-all { color: var(--gold); text-decoration: none; font-size: 0.85rem; font-weight: 600; }

/* ─── TRANSACTION LIST ─── */
.tx-list { display: flex; flex-direction: column; gap: 0.6rem; }
.tx-item { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.2rem; display: flex; align-items: center; gap: 1rem; }
.tx-icon { font-size: 1.4rem; flex-shrink: 0; }
.tx-info { flex: 1; min-width: 0; }
.tx-title { font-weight: 600; font-size: 0.9rem; }
.tx-ref { font-size: 0.75rem; color: var(--text2); margin-top: 0.1rem; }
.tx-right { text-align: right; flex-shrink: 0; }
.tx-amount { font-weight: 700; font-size: 0.95rem; }
.tx-status { font-size: 0.72rem; margin-top: 0.2rem; font-weight: 600; }

/* ─── BADGES & STATUS ─── */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 100px; font-size: 0.72rem; font-weight: 700; text-transform: capitalize; }
.status-success { color: var(--green); }
.status-pending { color: var(--gold); }
.status-failed  { color: var(--red); }
.badge.status-success { background: rgba(92,184,92,0.15); }
.badge.status-pending { background: rgba(212,175,55,0.15); }
.badge.status-failed  { background: rgba(224,85,85,0.15); }
.badge.status-vendor  { background: rgba(91,155,213,0.15); color: var(--blue); }

/* ─── TX TABLE ─── */
.tx-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
.tx-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.tx-table th { background: var(--card2); padding: 0.8rem 1rem; text-align: left; font-size: 0.78rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); }
.tx-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tx-table tr:last-child td { border-bottom: none; }
.tx-table tr:hover td { background: var(--glow); }
.tx-ref-cell { font-family: monospace; font-size: 0.78rem; color: var(--text2); }
.profit { color: var(--green); font-weight: 700; }

/* ─── PAGINATION ─── */
.pagination { display: flex; gap: 0.4rem; justify-content: center; margin-top: 1.5rem; }
.page-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text2); text-decoration: none; font-size: 0.85rem; font-weight: 600; transition: all 0.2s; }
.page-btn.active { background: var(--gold); color: #0a0900; border-color: var(--gold); }

/* ─── SERVICE FORM ─── */
.service-form-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
.service-form-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.8rem; }
.sfc-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.8rem; }
.sfc-icon { font-size: 2rem; }
.sfc-header h2 { font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 700; }
.sfc-header p { font-size: 0.82rem; color: var(--text2); }
.service-note { background: var(--card2); border: 1px solid var(--border); border-radius: 14px; padding: 1.4rem; }
.service-note h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.8rem; }
.service-note ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.service-note ul li { font-size: 0.83rem; color: var(--text2); padding-left: 1rem; position: relative; line-height: 1.5; }
.service-note ul li::before { content: '•'; color: var(--gold); position: absolute; left: 0; }

/* ─── FILTER BAR ─── */
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.filter-form { display: flex; gap: 0.6rem; }
.filter-form select { background: var(--card); border: 1px solid var(--border2); color: var(--text); padding: 0.5rem 0.8rem; border-radius: 7px; font-size: 0.85rem; }
.filter-info { font-size: 0.82rem; color: var(--text2); }

/* ─── EMPTY STATE ─── */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { color: var(--text2); }
.empty-state a { color: var(--gold); }

/* ─── API KEYS ─── */
.api-keys-card, .api-docs-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.8rem; margin-bottom: 1.5rem; }
.api-keys-header { margin-bottom: 1.5rem; }
.api-keys-header h2 { font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 0.3rem; }
.api-keys-header p { color: var(--text2); font-size: 0.85rem; }
.cred-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 0.8rem; }
.cred-label { font-size: 0.8rem; font-weight: 700; color: var(--text2); width: 100px; flex-shrink: 0; }
.cred-value { display: flex; align-items: center; gap: 0.8rem; flex: 1; min-width: 0; }
.cred-value code { font-family: monospace; font-size: 0.82rem; color: var(--gold); word-break: break-all; }
.masked { color: var(--text2) !important; letter-spacing: 0.1em; }
.copy-btn { background: var(--glow2); border: 1px solid var(--border2); color: var(--text2); padding: 0.3rem 0.7rem; border-radius: 6px; font-size: 0.75rem; cursor: pointer; white-space: nowrap; }
.api-endpoint { display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.endpoint-method { background: var(--glow2); color: var(--gold); font-size: 0.72rem; font-weight: 800; padding: 0.2rem 0.5rem; border-radius: 4px; font-family: monospace; }
.endpoint-path { font-family: monospace; font-size: 0.85rem; color: var(--text); }
.endpoint-desc { font-size: 0.8rem; color: var(--text2); margin-left: auto; }
.code-block { background: #0a0a08; border: 1px solid var(--border2); border-radius: 10px; padding: 1rem 1.2rem; font-family: monospace; font-size: 0.8rem; color: #90EE90; line-height: 1.7; margin: 0.6rem 0 1rem; }

/* ─── SETTINGS ─── */
.settings-section { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; margin-bottom: 1.2rem; }
.settings-section h3 { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 1.2rem; }

/* ─── MOBILE ─── */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .quick-services { grid-template-columns: repeat(3, 1fr); }
  .service-form-wrap { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .menu-toggle { display: block; }
  .dashboard-main { margin-left: 0; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .dash-content { padding: 1.2rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .quick-services { grid-template-columns: repeat(3, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .quick-services { grid-template-columns: repeat(3, 1fr); }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .plan-grid { grid-template-columns: 1fr 1fr; }
}
