/* ═══════ Stripe DNA — Dashboard Edition ═══════ */
:root {
  --bg: #0A2540; --bg-elevated: #0D2D4F;
  --surface: #113355; --surface-hover: #153D63; --surface2: #1A4470;
  --border: #1E4D7A; --border-light: #255A8C; --border-hover: #2E6A9E;
  --accent: #635BFF; --accent-light: #7C73FF; --accent-dark: #5247E5;
  --accent-glow: rgba(99,91,255,0.25); --accent-soft: rgba(99,91,255,0.1);
  --primary: #635BFF; --primary-light: #7C73FF; --primary-dark: #5247E5;
  --primary-glow: rgba(99,91,255,0.2); --primary-soft: rgba(99,91,255,0.08);
  --primary-hover: #5247E5;
  --text: #E8EBF0; --text-secondary: #8899AA; --text-muted: #5C6F82; --text-dim: #3D5066;
  --success: #0E9F6E; --error: #E5484D; --warning: #E5A815;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-xs: 0.75rem; --text-sm: 0.8125rem; --text-base: 0.875rem; --text-lg: 1rem; --text-xl: 1.125rem;
  --fw-regular: 400; --fw-medium: 500; --fw-semi: 550; --fw-bold: 600; --fw-heavy: 700;
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 24px; --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2); --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
  --transition-fast: 150ms ease; --transition-base: 200ms ease;
  --sidebar-width: 220px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font-sans); background: var(--bg); color: var(--text); font-size: var(--text-sm); line-height: 1.55; letter-spacing: -0.004em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #255A8C; border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: #2E6A9E; }

/* ─── Auth Page ──────────────────────────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px; width: 100%; max-width: 400px; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo h1 { font-size: var(--text-xl); font-weight: var(--fw-heavy); color: var(--text); margin-bottom: 4px; letter-spacing: -0.02em; }
.auth-logo .subtitle { font-size: var(--text-sm); color: var(--text-muted); }
.auth-logo .icon { font-size: 32px; display: block; margin-bottom: 12px; }

/* ─── Forms ──────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.05em; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: var(--text-sm); padding: 9px 12px; outline: none;
  transition: border-color var(--transition-fast); font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(99,91,255,0.15); }
textarea { resize: vertical; min-height: 100px; }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235C6F82' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.input-with-toggle { position: relative; }
.input-with-toggle input { padding-right: 40px; }
.toggle-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 15px; padding: 4px; display: flex; align-items: center; }
.toggle-btn:hover { color: var(--text); }

/* ─── Buttons ────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 18px; border-radius: var(--radius-xl); font-size: var(--text-sm); font-weight: var(--fw-medium); border: none; cursor: pointer; transition: all var(--transition-base); text-decoration: none; font-family: inherit; white-space: nowrap; letter-spacing: -0.004em; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,91,255,0.3); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--border-hover); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface); }
.btn-paypal { background: #0070ba; color: #fff; }
.btn-paypal:hover { opacity: 0.9; }
.btn-sm { padding: 5px 10px; font-size: var(--text-xs); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #c93a40; }

/* ─── Alerts ─────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: var(--fw-medium); margin-bottom: 14px; display: none; }
.alert.show { display: block; }
.alert-error { background: rgba(229,72,77,0.08); border: 1px solid rgba(229,72,77,0.2); color: #f08d90; }
.alert-success { background: rgba(14,159,110,0.08); border: 1px solid rgba(14,159,110,0.2); color: #6dd48b; }

/* ─── Auth utils ─────────────────────────── */
.auth-footer { text-align: center; margin-top: 16px; font-size: var(--text-xs); color: var(--text-muted); }
.auth-footer a { color: var(--accent); text-decoration: none; font-weight: var(--fw-medium); }
.auth-footer a:hover { text-decoration: underline; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; background: var(--bg); border-radius: var(--radius-xl); padding: 3px; }
.auth-tab { flex: 1; padding: 8px 14px; background: transparent; border: none; color: var(--text-muted); font-size: var(--text-sm); font-weight: var(--fw-medium); cursor: pointer; border-radius: var(--radius-xl); transition: all var(--transition-base); font-family: inherit; }
.auth-tab:hover { color: var(--text-secondary); }
.auth-tab.active { background: var(--surface2); color: var(--text); }
.auth-section { display: none; }
.auth-section.active { display: block; }

/* ─── App Layout ─────────────────────────── */
.app-layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: var(--sidebar-width); background: var(--bg-elevated); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; }
.sidebar-header { padding: 20px 18px 16px; border-bottom: 1px solid var(--border); }
.sidebar-logo { display: flex; align-items: center; gap: 8px; }
.sidebar-logo .logo-icon { font-size: 20px; line-height: 1; }
.sidebar-logo h2 { font-size: var(--text-sm); font-weight: var(--fw-bold); color: var(--text); line-height: 1.2; letter-spacing: -0.01em; }
.sidebar-logo .logo-sub { font-size: 10px; color: var(--text-muted); font-weight: var(--fw-regular); }
.sidebar-nav { padding: 8px 0; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 18px; cursor: pointer; color: var(--text-muted); font-size: var(--text-sm); font-weight: var(--fw-medium); transition: all var(--transition-fast); user-select: none; border-left: 2px solid transparent; }
.nav-item:hover { background: var(--surface); color: var(--text-secondary); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-light); border-left-color: var(--accent); }
.nav-item .nav-icon { font-size: 15px; width: 18px; text-align: center; }
.sidebar-footer { padding: 14px 18px; border-top: 1px solid var(--border); }
.user-info { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.user-avatar { width: 28px; height: 28px; background: var(--accent); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: var(--text-xs); font-weight: var(--fw-bold); color: #fff; flex-shrink: 0; }
.user-name { font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Main Content ───────────────────────── */
.main-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.content-area { padding: 28px; flex: 1; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: var(--text-xl); font-weight: var(--fw-heavy); color: var(--text); margin-bottom: 4px; letter-spacing: -0.02em; }
.page-header p { font-size: var(--text-sm); color: var(--text-muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; margin-bottom: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: var(--text-base); font-weight: var(--fw-bold); color: var(--text); letter-spacing: -0.01em; }
.card-subtitle { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.search-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.search-form .full-width { grid-column: 1 / -1; }
.location-custom { display: none; grid-template-columns: 1fr 1fr; gap: 10px; grid-column: 1 / -1; }
.location-custom.show { display: grid; }
.progress-section { display: none; margin-top: 16px; }
.progress-section.show { display: block; }
.progress-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.progress-status { font-size: var(--text-sm); color: var(--text-muted); }
.progress-counter { font-size: var(--text-sm); color: var(--accent-light); font-weight: var(--fw-medium); }
.progress-bar-wrap { background: var(--bg); border-radius: 100px; height: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: 100px; transition: width 0.3s ease; width: 0%; }
.results-section { display: none; margin-top: 20px; }
.results-section.show { display: block; }
.results-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.results-count { font-size: var(--text-sm); color: var(--text-muted); }
.results-count strong { color: var(--text); font-size: var(--text-base); }
.table-wrap { overflow: auto; max-height: 480px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
thead { position: sticky; top: 0; z-index: 1; }
thead th { background: var(--surface2); color: var(--text-muted); font-weight: var(--fw-medium); padding: 8px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition-fast); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-hover); }
tbody td { padding: 9px 12px; color: var(--text); vertical-align: middle; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tbody td a { color: var(--accent-light); text-decoration: none; }
tbody td a:hover { text-decoration: underline; }
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: var(--radius-sm); font-size: 10px; font-weight: var(--fw-medium); text-transform: uppercase; letter-spacing: 0.03em; }
.badge-success { background: rgba(14,159,110,0.12); color: var(--success); }
.badge-error { background: rgba(229,72,77,0.1); color: var(--error); }
.badge-warning { background: rgba(229,168,21,0.1); color: var(--warning); }
.badge-pending { background: rgba(92,111,130,0.15); color: var(--text-muted); }
.rating { display: inline-flex; align-items: center; gap: 2px; color: var(--warning); font-size: var(--text-xs); }
.settings-section { margin-bottom: 20px; }
.settings-section:last-child { margin-bottom: 0; }
.settings-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; display: block; }
.settings-value { font-size: var(--text-sm); color: var(--text); padding: 8px 0; }
.api-key-instructions { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; margin-top: 14px; }
.api-key-instructions h4 { font-size: var(--text-sm); font-weight: var(--fw-bold); color: var(--text); margin-bottom: 8px; }
.api-key-instructions ol { font-size: var(--text-sm); color: var(--text-muted); padding-left: 16px; line-height: 1.9; }
.api-key-instructions a { color: var(--accent-light); text-decoration: none; }
.api-key-instructions a:hover { text-decoration: underline; }
.video-guide { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.video-guide h4 { font-size: var(--text-sm); font-weight: var(--fw-bold); color: var(--text); margin-bottom: 8px; }
.video-guide iframe { display: block; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 32px; margin-bottom: 10px; display: block; }
.empty-state p { font-size: var(--text-sm); }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.row { display: flex; align-items: center; gap: 10px; }

@media (max-width: 768px) {
  :root { --sidebar-width: 56px; }
  .sidebar-logo h2, .sidebar-logo .logo-sub, .nav-item span:not(.nav-icon), .user-name, .sidebar-header .sidebar-logo h2 { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-item .nav-icon { width: auto; }
  .user-info { justify-content: center; }
  .user-avatar { margin: 0; }
  .content-area { padding: 18px 14px; }
  .search-form { grid-template-columns: 1fr; }
  .search-form .full-width { grid-column: 1; }
}
@media (max-width: 480px) {
  .auth-card { padding: 24px 18px; }
  .results-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}
