/* =========================================================
   CryptoGateway — Global SaaS Dark Glassmorphism CSS
   ========================================================= */

:root {
    --bg-primary:     #0a0a0f;
    --bg-secondary:   #111118;
    --bg-tertiary:    #161622;
    --glass-bg:       rgba(255, 255, 255, 0.035);
    --glass-border:   rgba(255, 255, 255, 0.075);
    --glass-hover:    rgba(255, 255, 255, 0.065);
    --glass-blur:     20px;
    --accent-primary: #6c47ff;
    --accent-primary-hover: #7d5cff;
    --accent-primary-glow: rgba(108, 71, 255, 0.25);
    --accent-success: #00d4aa;
    --accent-warning: #f59e0b;
    --accent-danger:  #ef4444;
    --accent-info:    #38bdf8;
    --text-primary:   #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;
    --font-sans:      'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono-font:      'JetBrains Mono', 'Fira Code', Consolas, monospace;
    --radius-sm:      6px;
    --radius-md:      10px;
    --radius-lg:      16px;
    --radius-xl:      24px;
    --transition:     all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(108, 71, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 90%, rgba(0, 212, 170, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-primary-hover);
}

.mono, .mono-text, code, pre {
    font-family: var(--mono-font);
}

/* ── LAYOUT ── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px 8px;
    border-bottom: 1px solid var(--glass-border);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent-primary), #4322c4);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 14px var(--accent-primary-glow);
}

.brand-title, .brand-name {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    color: #fff;
}

.sidebar-nav {
    flex: 1;
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 8px 12px 6px;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--glass-hover);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.nav-link.active svg {
    color: var(--accent-primary);
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d3748, #1a202c);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 13px;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-logout {
    color: var(--text-muted);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-logout:hover {
    color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ── MAIN CONTENT ── */
.app-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-header {
    height: 64px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator-dot.online {
    background: var(--accent-success);
    box-shadow: 0 0 8px rgba(0, 212, 170, 0.5);
}

.content-container {
    padding: 32px;
    max-width: 1200px;
    width: 100%;
}

/* ── GLASS CARD ── */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--radius-lg);
    padding: 24px;
}

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
}

.card-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header-title svg {
    color: var(--accent-primary);
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-header-link {
    font-size: 13px;
    font-weight: 500;
}

/* ── PAGE HEADER ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
}

.page-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.page-actions {
    display: flex;
    gap: 12px;
}

/* ── STATS GRID ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    padding: 20px;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-purple { background: rgba(108, 71, 255, 0.15); color: var(--accent-primary); }
.icon-teal   { background: rgba(0, 212, 170, 0.15);  color: var(--accent-success); }
.icon-amber  { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }
.icon-blue   { background: rgba(56, 189, 248, 0.15); color: var(--accent-info); }

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.stat-footer {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.text-success { color: var(--accent-success) !important; }
.text-warning { color: var(--accent-warning) !important; }
.text-danger  { color: var(--accent-danger) !important; }

/* ── BANNER NOTICE ── */
.banner-notice {
    background: rgba(108, 71, 255, 0.08);
    border: 1px solid rgba(108, 71, 255, 0.25);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.banner-icon {
    color: var(--accent-primary);
}

.banner-content {
    flex: 1;
}

.banner-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.banner-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    outline: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 2px 10px var(--accent-primary-glow);
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    color: #fff;
    box-shadow: 0 4px 16px rgba(108, 71, 255, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.btn-reveal.revealed {
    color: var(--accent-primary);
    background: rgba(0, 212, 170, 0.12);
    border-color: rgba(0, 212, 170, 0.35);
}

.btn-table-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-primary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: rgba(108, 71, 255, 0.1);
}

.btn-table-action:hover {
    background: var(--accent-primary);
    color: #fff;
}

.btn-copy-small {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-copy-small:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

/* ── FORMS ── */
.form-group {
    margin-bottom: 18px;
}

.form-label, .field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.field-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.45;
}

.field-warning {
    font-size: 12px;
    color: var(--accent-warning);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-input, .form-select, .form-textarea, textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
    box-sizing: border-box;
}

.form-input:focus, .form-select:focus, .form-textarea:focus, textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
    background: rgba(0, 0, 0, 0.4);
}

.form-textarea, textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.form-input::placeholder,
.form-textarea::placeholder,
textarea::placeholder {
    color: #64748b;
    opacity: 0.85;
}

.form-input[readonly] {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    cursor: default;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.input-copy-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.form-row {
    display: flex;
    gap: 16px;
}

.flex-1 {
    flex: 1;
}

.mb-4 {
    margin-bottom: 24px;
}

/* ── BADGES & PILLS ── */
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.badge-public     { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.badge-secret     { background: rgba(239, 68, 68, 0.15);  color: #ef4444; }
.badge-fixed      { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.badge-encryption { background: rgba(108, 71, 255, 0.15); color: #a78bfa; }
.badge-success    { background: rgba(0, 212, 170, 0.15);  color: #00d4aa; }
.badge-warning    { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-chain      { background: rgba(255, 255, 255, 0.08); color: #e2e8f0; font-family: var(--mono-font); font-size: 10px; }
.badge-token      { background: rgba(108, 71, 255, 0.15); color: #c4b5fd; font-weight: 700; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending    { background: rgba(245, 158, 11, 0.12); color: var(--accent-warning); }
.status-underpaid  { background: rgba(249, 115, 22, 0.12); color: #f97316; }
.status-confirming { background: rgba(56, 189, 248, 0.12); color: var(--accent-info); }
.status-paid       { background: rgba(0, 212, 170, 0.12);  color: var(--accent-success); }
.status-expired    { background: rgba(148, 163, 184, 0.12); color: var(--text-muted); }
.status-suspicious { background: rgba(239, 68, 68, 0.12);  color: var(--accent-danger); }

/* ── TABLES ── */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
}

.data-table td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.data-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.address-copy-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.table-empty {
    text-align: center;
    padding: 48px !important;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

/* ── ALERTS ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.alert-success {
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.25);
    color: #2dd4bf;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

/* ── AUTH PAGES ── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-wrapper {
    width: 100%;
    max-width: 440px;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}

.auth-card {
    padding: 36px;
}

.auth-card-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

.auth-card-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-link {
    font-weight: 600;
}

/* ── API SETTINGS SPECIAL ── */
.field-group {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.field-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.field-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.key-id-form {
    display: flex;
    gap: 10px;
}

.key-id-notice {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.config-guide {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}

.config-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.config-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
}

.config-value-note {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.webhook-info-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 20px 0;
}

.webhook-info-box h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}

.webhook-info-box p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.code-block {
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 12px;
    color: #a78bfa;
    overflow-x: auto;
    line-height: 1.5;
}

.test-webhook-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.test-result-indicator {
    font-size: 13px;
    font-weight: 500;
}

/* ── MODALS ── */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop.active,
.modal-backdrop.show {
    display: flex;
}

.modal-container {
    width: 100%;
    max-width: 520px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    padding: 28px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* ── TOASTS ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.25s ease forwards;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── MOBILE SIDEBAR TOGGLE & BACKDROP ── */
.btn-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.btn-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-primary);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

body.sidebar-locked {
    overflow: hidden;
}

/* ── TABLE RESPONSIVE WRAPPER ── */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── RESPONSIVE MEDIA QUERIES ── */

/* Laptops and Mid-Size Screens (max-width: 1080px) */
@media (max-width: 1080px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .content-container {
        padding: 24px 20px;
    }
}

/* Tablets & Mobile Navigation (max-width: 900px) */
@media (max-width: 900px) {
    .btn-sidebar-toggle {
        display: flex;
    }

    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 270px;
        height: 100vh;
        z-index: 99;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 28px rgba(0, 0, 0, 0.6);
        overflow-y: auto;
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .brand-title, .nav-link span, .nav-section-label, .user-details {
        display: block !important;
    }

    .nav-link {
        justify-content: flex-start !important;
        padding: 10px 14px !important;
    }

    .app-main {
        margin-left: 0 !important;
        width: 100%;
        max-width: 100vw;
    }

    .app-header {
        padding: 0 16px;
        height: 60px;
    }

    .content-container {
        padding: 20px 16px;
    }

    .settings-grid {
        grid-template-columns: 1fr !important;
        max-width: 100% !important;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .config-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .page-header .page-actions {
        width: 100%;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }
}

/* Smartphones & Small Tablets (max-width: 640px) */
@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .glass-card {
        padding: 18px 14px;
        border-radius: var(--radius-md);
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .page-title {
        font-size: 1.45rem;
    }

    .page-subtitle {
        font-size: 12px;
    }

    .content-container {
        padding: 16px 12px;
    }

    .data-table th, .data-table td {
        padding: 10px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    .modal-container {
        width: 95% !important;
        max-width: 95vw !important;
        padding: 18px 14px;
        margin: 16px auto;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .auth-card {
        padding: 24px 18px;
        max-width: 100%;
        border-radius: var(--radius-md);
    }

    .checkout-card {
        padding: 20px 14px;
        width: 100%;
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    /* Set 16px font size on mobile inputs to prevent iOS automatic zoom */
    .form-input, .form-select, .form-textarea {
        font-size: 16px;
        padding: 10px 12px;
    }

    .qr-container {
        width: 100% !important;
        max-width: 220px !important;
        margin: 0 auto;
    }

    .qr-container canvas, .qr-container img {
        width: 100% !important;
        height: auto !important;
    }

    .header-status .status-text {
        display: none;
    }
}

/* Extra Small Screens (max-width: 380px) */
@media (max-width: 380px) {
    .content-container {
        padding: 12px 8px;
    }
    .glass-card {
        padding: 14px 10px;
    }
    .page-title {
        font-size: 1.25rem;
    }
}

/* ── WEB3 CHAIN & TOKEN SELECTORS ── */
.chain-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chain-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.chain-chip.active {
    background: rgba(0, 212, 170, 0.15);
    border-color: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 212, 170, 0.25);
}

.chain-option-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.token-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.token-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
}

.token-pill.active {
    background: linear-gradient(135deg, rgba(108, 71, 255, 0.35), rgba(0, 212, 170, 0.2));
    border-color: var(--accent-secondary);
    color: #fff;
    box-shadow: 0 0 12px rgba(108, 71, 255, 0.35);
}

