/* Shared design system for the admin dashboard and shop onboarding form.
   Deliberately its own palette (indigo/blue accent, not the green used by the
   payment-intelligence sandbox) so the two internal tools read as distinct products. */

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

:root {
  --bg: #0a0e16;
  --surface: #121620;
  --surface2: #1a1f2c;
  --border: #232838;
  --border2: #2c3244;
  --text1: #eef1f6;
  --text2: #8b93a8;
  --text3: #4a5168;
  --accent: #4f8cff;
  --accent-mid: #2f6fe0;
  --accent-dim: #0d2350;
  --amber: #ffca28;
  --amber-dim: #2a1f00;
  --red: #ef5350;
  --grad-hero: linear-gradient(90deg, #4f8cff, #7b5cf0);
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-mid); }

/* === Auth-card layout (login page) === */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }

.login-card {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 36px 32px;
  box-shadow: 0 0 60px rgba(79, 140, 255, 0.08);
}
.login-logo {
  width: 56px; height: 56px; display: block; margin: 0 auto 20px;
  object-fit: contain; border-radius: 12px;
}
.brand-logo { width: 30px; height: 30px; flex-shrink: 0; object-fit: contain; border-radius: 7px; }
.login-title { font-size: 17px; font-weight: 700; text-align: center; margin-bottom: 10px; }
.login-tenant-wrap { display: flex; justify-content: center; margin-bottom: 20px; }
.login-tenant {
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent); background: rgba(79, 140, 255, 0.12);
  border: 1px solid rgba(79, 140, 255, 0.3); padding: 3px 11px; border-radius: 20px;
}
.login-sub { font-size: 12px; color: var(--text3); text-align: center; margin-bottom: 28px; }

/* === App shell: persistent left sidebar + main content area === */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px; border-bottom: 1px solid var(--border);
}
.sidebar-brand svg { width: 30px; height: 30px; flex-shrink: 0; }
.sidebar-brand .name { font-size: 13px; font-weight: 700; line-height: 1.3; }
.sidebar-brand .tenant { font-size: 10.5px; color: var(--text3); }

.nav-section { padding: 16px 12px 4px; }
.nav-section-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text3); padding: 0 10px; margin-bottom: 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text2);
  margin-bottom: 2px;
}
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.8; }
.nav-item:hover { background: var(--surface2); color: var(--text1); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-item.active svg { opacity: 1; }
.nav-item .count {
  margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--text3);
  background: var(--surface2); border-radius: 10px; padding: 1px 7px;
}
.nav-item.active .count { color: var(--accent); background: rgba(79, 140, 255, 0.15); }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-header {
  height: 56px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
  font-size: 13px; color: var(--text2);
}
.main-header .crumb { display: flex; align-items: center; gap: 6px; }
.main-header .crumb-current { color: var(--text1); font-weight: 600; }
.main-content { flex: 1; padding: 28px; max-width: 1080px; }

/* === User avatar menu (top-right of main-header) === */
.user-menu { position: relative; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #7b5cf0);
  color: #fff; font-size: 14px; font-weight: 700; font-family: inherit;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.user-avatar:hover { opacity: 0.9; }
.user-dropdown {
  display: none;
  position: absolute; top: 46px; right: 0; z-index: 30;
  width: 200px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.user-dropdown.open { display: block; }
.user-avatar-lg {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--accent), #7b5cf0);
  color: #fff; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-greeting { font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.user-dropdown .btn.full { width: 100%; }

.page-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.page-sub { font-size: 13px; color: var(--text2); margin-bottom: 28px; }

/* === Data table === */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.data-table th {
  text-align: left; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text3); background: var(--surface2); padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.data-table td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface2); }
.data-table .status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; }
.status-dot.pending { background: var(--amber); }
.status-dot.approved { background: var(--accent); }
.status-dot.rejected { background: var(--red); }
.data-table .row-key { font-weight: 600; }
.data-table .row-action { text-align: right; white-space: nowrap; }

/* === Flash messages === */
.flash {
  border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 20px;
}
.flash.error { background: #2a0a0a; color: var(--red); border: 1px solid rgba(239, 83, 80, 0.4); }
.flash.success { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(79, 140, 255, 0.35); }

/* === Cards === */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px 22px; margin-bottom: 16px;
}
.card h3 {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text2); margin-bottom: 14px;
}

/* === Definition-list rows (detail view) === */
dl.rows { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; }
dl.rows dt { font-size: 12.5px; color: var(--text2); }
dl.rows dd { font-size: 13.5px; color: var(--text1); font-weight: 500; }

/* === List rows (pending list) === */
.list-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 20px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.list-row .key { font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; }
.list-row .meta { font-size: 12px; color: var(--text2); margin-top: 3px; }
.empty-state {
  color: var(--text3); font-size: 13.5px; text-align: center;
  padding: 60px 20px; border: 1px dashed var(--border); border-radius: 12px;
}

/* === Badges === */
.badge {
  display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 3px 10px; border-radius: 20px;
}
.badge.pending { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(255, 202, 40, 0.35); }
.badge.approved { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(79, 140, 255, 0.35); }
.badge.rejected { background: #2a0a0a; color: var(--red); border: 1px solid rgba(239, 83, 80, 0.35); }

/* === Forms === */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 11px; color: var(--text2); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.field .hint { font-size: 11.5px; color: var(--text3); margin-top: 5px; }
.field input {
  width: 100%; padding: 11px 14px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text1); font-size: 14px; font-family: inherit;
}
.field input:focus { outline: none; border-color: rgba(79, 140, 255, 0.55); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 560px) { .field-row, .field-row.cols-3 { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px 4px; margin-bottom: 20px; }
legend { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text2); padding: 0 6px; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border-radius: 8px; border: none;
  font-size: 13.5px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: background 0.15s, opacity 0.15s;
}
.btn.full { width: 100%; }
.btn.primary { background: var(--accent); color: #051022; }
.btn.primary:hover { background: var(--accent-mid); }
.btn.approve { background: var(--accent); color: #051022; }
.btn.approve:hover { background: var(--accent-mid); }
.btn.reject { background: transparent; color: var(--red); border: 1px solid rgba(239, 83, 80, 0.4); }
.btn.reject:hover { background: #2a0a0a; }
.btn.secondary { background: var(--surface2); color: var(--text1); border: 1px solid var(--border2); }
.btn.secondary:hover { border-color: var(--border); }
.btn:disabled { opacity: 0.7; cursor: not-allowed; }
form.inline { display: inline-block; margin-right: 10px; }
.actions { display: flex; gap: 10px; margin-top: 8px; }

/* === Spinner (shown on the submit button while a live check is in flight) === */
.spinner {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid rgba(5, 16, 34, 0.3); border-top-color: #051022;
  border-radius: 50%; margin-right: 8px; vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.back-link { display: inline-block; font-size: 12.5px; color: var(--text2); margin-bottom: 20px; }
.back-link:hover { color: var(--accent); }

/* === Onboarding form: gradient accents, numbered icon sections, icon-prefixed fields === */
.onboard-page { min-height: 100vh; }

.onboard-card {
  background: var(--surface); border: 1px solid rgba(79, 140, 255, 0.22);
  border-radius: 20px; padding: 40px 36px 36px;
}

.grad-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: #fff; background: var(--grad-hero);
  padding: 7px 18px; border-radius: 20px;
}

.grad-icon-ring {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(79, 140, 255, 0.16), transparent 70%);
  border: 1.5px solid rgba(79, 140, 255, 0.4);
  margin: 0 auto 22px;
}
.grad-icon-ring svg { width: 34px; height: 34px; color: var(--accent); }
.grad-icon-ring img { width: 42px; height: 42px; object-fit: contain; border-radius: 9px; }

.form-section {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 22px 24px; margin-bottom: 18px;
}
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.step-badge {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #7b5cf0);
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.section-icon {
  width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
  background: var(--surface2); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.section-icon svg { width: 14px; height: 14px; }
.section-title { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.field-icon { position: relative; }
.field-icon svg.leading {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text3); pointer-events: none;
}
.field-icon input { padding-left: 40px; }
.field-icon.has-toggle input { padding-right: 40px; }
.field-icon .toggle-visibility {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text3); cursor: pointer; padding: 4px; line-height: 0;
}
.field-icon .toggle-visibility:hover { color: var(--text1); }
.field-icon .toggle-visibility svg { width: 16px; height: 16px; }

.btn.grad { background: var(--grad-hero); color: #fff; }
.btn.grad:hover { opacity: 0.9; }
.btn.grad svg { width: 15px; height: 15px; margin-right: 8px; }

.security-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11.5px; color: var(--text3); margin-top: 14px;
}
.security-note svg { width: 12px; height: 12px; }

/* === Submission success popup (onboarding form) === */
.toast-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 8, 14, 0.6);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
  padding: 20px;
}
.toast-overlay.visible { opacity: 1; pointer-events: auto; }
.toast-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px 28px; max-width: 360px; width: 100%;
  text-align: center;
  transform: scale(0.94); transition: transform 0.25s ease;
}
.toast-overlay.visible .toast-card { transform: scale(1); }
.toast-logo { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; margin: 0 auto 18px; display: block; }
.toast-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.toast-pill {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--accent); background: var(--accent-dim);
  border: 1px solid rgba(79, 140, 255, 0.35); padding: 4px 14px; border-radius: 20px;
  margin-bottom: 18px;
}
.toast-message {
  font-size: 13px; line-height: 1.55; color: var(--accent);
  background: var(--accent-dim); border: 1px solid rgba(79, 140, 255, 0.3);
  border-radius: 10px; padding: 14px 16px; text-align: left;
}
