:root {
  --brand: #FFD600;
  --brand-dark: #E6C200;
  --brand-light: #FFF8CC;
  --ink: #0F0F0F;
  --ink-secondary: #525252;
  --ink-muted: #8A8A8A;
  --surface: #FFFFFF;
  --surface-elevated: #FAFAFA;
  --surface-glass: rgba(255,255,255,0.72);
  --border: #E8E8E8;
  --border-light: #F0F0F0;
  --success: #16A34A;
  --success-light: #DCFCE7;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #DC2626;
  --danger-light: #FEE2E2;
  --info: #2563EB;
  --info-light: #DBEAFE;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.1);
  --shadow-brand: 0 8px 32px rgba(255,214,0,0.25);
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-width: 260px;
}

[data-theme="dark"] {
  --ink: #F5F5F5;
  --ink-secondary: #A3A3A3;
  --ink-muted: #737373;
  --surface: #141414;
  --surface-elevated: #1C1C1C;
  --surface-glass: rgba(20,20,20,0.85);
  --border: #2A2A2A;
  --border-light: #222222;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.5);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface-elevated);
  line-height: 1.6;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

/* ─── Typography ─── */
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
h2 { font-size: clamp(1.375rem, 3vw, 1.875rem); font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 1.125rem; font-weight: 600; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--ink-muted); }
.text-secondary { color: var(--ink-secondary); }

/* ─── Layout ─── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 720px; }
.container-wide { max-width: 1400px; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: var(--radius); font-weight: 600;
  font-size: 0.9375rem; transition: all var(--transition); white-space: nowrap;
  position: relative; overflow: hidden;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--brand); color: var(--ink);
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-secondary {
  background: var(--surface); color: var(--ink); border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--ink-muted); background: var(--surface-elevated); }
.btn-ghost { color: var(--ink-secondary); }
.btn-ghost:hover { color: var(--ink); background: var(--border-light); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-success { background: var(--success); color: white; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-icon { padding: 0.625rem; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ─── Cards ─── */
.card {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 1.5rem;
  box-shadow: var(--shadow-sm); transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-glass {
  background: var(--surface-glass); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.2);
}
.card-flat { box-shadow: none; }

/* ─── Forms ─── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block; font-size: 0.875rem; font-weight: 600;
  margin-bottom: 0.5rem; color: var(--ink);
}
.form-hint { font-size: 0.75rem; color: var(--ink-muted); margin-top: 0.375rem; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 0.75rem 1rem; border: 1.5px solid var(--border);
  border-radius: var(--radius); background: var(--surface); color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ─── Badges ─── */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.25rem 0.625rem; border-radius: 100px;
  font-size: 0.75rem; font-weight: 600;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-brand { background: var(--brand-light); color: #92700C; }
.badge-neutral { background: var(--border-light); color: var(--ink-secondary); }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-light); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead { background: var(--surface-elevated); }
th { text-align: left; padding: 0.875rem 1rem; font-weight: 600; color: var(--ink-secondary); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
td { padding: 0.875rem 1rem; border-top: 1px solid var(--border-light); }
tr:hover td { background: var(--surface-elevated); }

/* ─── KPI Cards ─── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 1.25rem;
  transition: all var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; }
.kpi-label { font-size: 0.8125rem; color: var(--ink-muted); margin-top: 0.25rem; }
.kpi-trend { font-size: 0.75rem; font-weight: 600; margin-top: 0.5rem; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; opacity: 0; visibility: hidden; transition: all 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--surface); border-radius: var(--radius-xl);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  padding: 2rem; transform: scale(0.95) translateY(10px);
  transition: transform 0.3s; box-shadow: var(--shadow-lg);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-close { padding: 0.5rem; border-radius: var(--radius-sm); color: var(--ink-muted); }
.modal-close:hover { background: var(--border-light); color: var(--ink); }

/* ─── Toast ─── */
.toast-container {
  position: fixed; top: 1.5rem; right: 1.5rem; z-index: 2000;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
  background: var(--ink); color: white; padding: 0.875rem 1.25rem;
  border-radius: var(--radius); font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease;
  display: flex; align-items: center; gap: 0.5rem;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Skeleton ─── */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── Empty State ─── */
.empty-state {
  text-align: center; padding: 3rem 1.5rem; color: var(--ink-muted);
}
.empty-state-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem;
  background: var(--border-light); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ─── Progress Steps ─── */
.steps { display: flex; gap: 0; margin-bottom: 2.5rem; overflow-x: auto; padding-bottom: 0.5rem; }
.step {
  flex: 1; min-width: 80px; text-align: center; position: relative;
}
.step::after {
  content: ''; position: absolute; top: 16px; left: 50%; width: 100%; height: 2px;
  background: var(--border); z-index: 0;
}
.step:last-child::after { display: none; }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 0.5rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8125rem; font-weight: 700; position: relative; z-index: 1;
  background: var(--surface); border: 2px solid var(--border); color: var(--ink-muted);
  transition: all var(--transition);
}
.step.active .step-circle { background: var(--brand); border-color: var(--brand); color: var(--ink); }
.step.done .step-circle { background: var(--success); border-color: var(--success); color: white; }
.step.done::after { background: var(--success); }
.step-label { font-size: 0.6875rem; font-weight: 600; color: var(--ink-muted); }
.step.active .step-label { color: var(--ink); }

/* ─── Upload Zone ─── */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 2rem; text-align: center; cursor: pointer;
  transition: all var(--transition); background: var(--surface-elevated);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--brand); background: var(--brand-light);
}
.upload-preview {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem; margin-top: 1rem;
}
.upload-preview-item {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 1; border: 1px solid var(--border-light);
}
.upload-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview-remove {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px;
  background: rgba(0,0,0,0.6); color: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0.75rem;
}

/* ─── Dashboard Layout ─── */
.dashboard-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width); background: var(--surface);
  border-right: 1px solid var(--border-light); padding: 1.5rem 1rem;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  display: flex; flex-direction: column; transition: transform 0.3s;
}
.sidebar-logo { display: flex; align-items: center; gap: 0.625rem; padding: 0 0.75rem; margin-bottom: 2rem; }
.sidebar-logo-mark {
  width: 36px; height: 36px; background: var(--brand); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.875rem;
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem;
  border-radius: var(--radius); font-size: 0.875rem; font-weight: 500;
  color: var(--ink-secondary); transition: all var(--transition);
}
.nav-item:hover { background: var(--surface-elevated); color: var(--ink); }
.nav-item.active { background: var(--brand-light); color: var(--ink); font-weight: 600; }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.dashboard-main { flex: 1; margin-left: var(--sidebar-width); padding: 2rem; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }

.mobile-header { display: none; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .dashboard-main { margin-left: 0; }
  .mobile-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 110;
    background: var(--surface); border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: space-between;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 105;
  }
  .sidebar-backdrop.active { display: block; }
  .sidebar {
    z-index: 106;
    top: 44px;
    height: calc(100vh - 44px);
    bottom: auto;
  }
}

/* ─── Animations ─── */
.fade-in { animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.scale-in { animation: scaleIn 0.4s ease; }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* ─── Verified Badge ─── */
.verified-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: var(--info-light); color: var(--info);
  padding: 0.25rem 0.625rem; border-radius: 100px;
  font-size: 0.75rem; font-weight: 600;
}

/* ─── Sticky Mobile Actions ─── */
.sticky-actions {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: var(--surface-glass); backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light); padding: 0.75rem 1.25rem;
  display: none; gap: 0.75rem;
}
@media (max-width: 768px) { .sticky-actions { display: flex; } .sticky-actions .btn { flex: 1; } }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── Page polish (vendor / admin / hub) ─── */
body {
  background: linear-gradient(180deg, var(--surface-elevated) 0%, #f3f3f1 100%);
}

.card, .onboard-card, .kpi-card {
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 30px rgba(15, 15, 15, 0.06);
}

.btn-primary {
  background: linear-gradient(180deg, #ffe033 0%, var(--brand) 100%);
}

.form-input, .form-select, .form-textarea {
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.sidebar {
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.04);
}

.dashboard-main {
  animation: fadeIn 0.45s ease;
}

[data-theme="dark"] body {
  background: linear-gradient(180deg, #0f0f0f 0%, #141414 100%);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
  background: var(--surface-elevated);
}
