/* ApiSell - White Light UI */
html { color-scheme: light; }
:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0284c7;
    --bg: #ffffff;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-input: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 40px -10px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: #ffffff !important; color: #1e293b !important; }
body { font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif; background: #ffffff !important; color: #0f172a !important; min-height: 100vh; line-height: 1.6; }
.text-muted { color: #64748b; }
code { background: #fafafa; padding: 2px 8px; border-radius: 6px; font-size: 0.88em; color: #4f46e5; border: 1px solid #e5e7eb; }

/* Auth */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; background: #ffffff; }
.auth-card { background: #ffffff; border-radius: 20px; padding: 48px; width: 100%; max-width: 440px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); border: 1px solid #e5e7eb; }
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-header h1 { font-size: 2rem; font-weight: 700; color: #4f46e5; margin-bottom: 8px; }
.auth-header p { color: #64748b; font-size: 0.95rem; }
.auth-form input { width: 100%; padding: 14px 18px; margin-bottom: 14px; border: 1px solid #e5e7eb; border-radius: 10px; background: #ffffff; color: #1e293b; font-size: 1rem; }
.auth-form input:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,0.15); }
.auth-footer { text-align: center; margin-top: 24px; }
.auth-footer a { color: #4f46e5; text-decoration: none; font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

/* Layout - Light trustworthy portal */
.layout { display: flex; min-height: 100vh; background: #f1f5f9 !important; }
.sidebar { width: 260px; flex-shrink: 0; background: #ffffff !important; border-right: 1px solid #e2e8f0; padding: 0; box-shadow: 1px 0 0 rgba(0,0,0,0.04); }
.sidebar-brand { padding: 20px 20px 18px; border-bottom: 1px solid #e2e8f0; }
.sidebar-brand h2 { font-size: 1.25rem; color: #4f46e5; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 2px; }
.sidebar-tagline { font-size: 0.75rem; color: #94a3b8; font-weight: 500; margin: 0; }
.sidebar-nav { padding: 12px 0; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; margin: 0 8px; color: #475569; text-decoration: none; transition: all 0.15s; font-weight: 500; font-size: 0.95rem; border-radius: 8px; }
.sidebar-nav a:hover { color: #4f46e5; background: #f1f5f9; }
.sidebar-nav a.active { color: #4f46e5; background: #eef2ff; font-weight: 600; }
.sidebar-nav .nav-icon { width: 22px; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.sidebar-nav .nav-icon i { font-size: 1rem; opacity: 0.9; }
.stat-card .stat-icon { align-items: center; justify-content: center; }
.stat-card .stat-icon i { font-size: 1.25rem; }
.main { flex: 1; padding: 28px; overflow-x: auto; background: #f1f5f9 !important; min-height: 100vh; }
.main.main-dashboard { padding: 0; }
.main.main-dashboard .dashboard-content { padding: 28px; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding: 20px 28px; background: #ffffff; border-bottom: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.dashboard-header h1 { font-size: 1.35rem; font-weight: 600; color: #0f172a; letter-spacing: -0.02em; margin: 0; }
.dashboard-content { padding: 28px; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.header h1 { font-size: 1.5rem; font-weight: 600; color: #0f172a; }

/* Cards */
.card { background: #ffffff !important; border-radius: 12px; padding: 24px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #e2e8f0; }
.card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; color: #0f172a; }
.card-body { }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: 8px; font-size: 0.95rem; font-weight: 500; cursor: pointer; border: none; transition: all 0.2s; text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,0.35); }
.btn-secondary { background: #f9fafb; color: #1e293b; border: 1px solid #e5e7eb; }
.btn-secondary:hover { background: #f3f4f6; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid #e5e7eb; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid #e5e7eb; color: #1e293b; }
th { background: #fafafa; color: #64748b; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
tr:last-child td { border-bottom: none; }
tr:hover { background: #fafafa; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 500; }
.badge-success { background: #d1fae5; color: #059669; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-warning { background: #fef3c7; color: #d97706; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 16px; }
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }

/* Stats - light cards with icons */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card { background: #ffffff; border-radius: 12px; padding: 22px; border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.06); transition: box-shadow 0.2s; display: flex; align-items: flex-start; gap: 16px; }
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.stat-card .stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.stat-card .stat-icon.wallet { background: #d1fae5; }
.stat-card .stat-icon.hits { background: #dbeafe; }
.stat-card .stat-icon.users { background: #e0e7ff; }
.stat-card .stat-icon.pending { background: #fef3c7; }
.stat-card .stat-icon.revenue { background: #d1fae5; }
.stat-card .stat-icon.today { background: #e0e7ff; }
.stat-card .value { font-size: 1.6rem; font-weight: 700; color: #0f172a; line-height: 1.2; }
.stat-card .label { color: #64748b; font-size: 0.875rem; margin-top: 4px; }

/* Form */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: #0f172a; font-size: 0.9rem; font-weight: 500; }
.form-group input, .form-group select { width: 100%; padding: 12px 16px; border: 1px solid #e5e7eb; border-radius: 8px; background: #ffffff; color: #1e293b; font-size: 1rem; }
.form-group input:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }

/* API Key box */
.api-key-box { background: #fafafa; padding: 16px; border-radius: 10px; font-family: monospace; font-size: 0.9rem; word-break: break-all; margin: 12px 0; border: 1px solid #e5e7eb; color: #1e293b; }
.wallet-balance { font-size: 2rem; font-weight: 700; color: #059669; }

/* User menu */
.user-menu { display: flex; align-items: center; gap: 20px; }
.user-menu span { color: #64748b; font-size: 0.9rem; }
.user-menu a { color: #4f46e5; text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.user-menu a:hover { text-decoration: underline; }

/* Sidebar icons (emoji) */
.nav-icon { font-size: 1.2rem; width: 24px; text-align: center; }
.pending-badge { background: #d97706; color: white; font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; margin-left: auto; }

/* Services grid - user panel */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.service-card { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; }
.service-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.service-card-header h3 { font-size: 1.1rem; color: #0f172a; margin: 0; }
.service-disabled { opacity: 0.7; background: #fafafa; }
.service-result { white-space: pre-wrap; word-break: break-all; font-family: monospace; font-size: 0.85rem; }
.api-endpoints-list { display: flex; flex-direction: column; gap: 8px; }
.api-endpoint-item { padding: 8px 0; }
.code-block { background: #fafafa; padding: 16px; border-radius: 8px; font-size: 0.85rem; overflow-x: auto; border: 1px solid #e5e7eb; margin: 8px 0; color: #1e293b; }
.btn-regenerate { background: #fef3c7 !important; color: #b45309 !important; border: 1px solid #fcd34d !important; }
.btn-regenerate:hover { background: #fde68a !important; }
