/* ============================================
   SubPedia Project — Shopee Seller Edition
   Shared Design System
   ============================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* --- CSS Custom Properties --- */
:root {
  --primary: #f97316;
  --primary-dark: #ea580c;
  --primary-light: #fed7aa;
  --primary-bg: #fff7ed;
  --secondary: #64748b;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --info: #3b82f6;
  --info-bg: #eff6ff;

  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

  --sidebar-w: 260px;
  --header-h: 60px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base Reset & Typography --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* --- Selection --- */
::selection { background: var(--primary-light); color: var(--primary-dark); }

/* --- Focus States --- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Links --- */
a { color: inherit; text-decoration: none; }

/* --- Multi-Marketplace Upload Center --- */
.upload-brand-icon, .mobile-upload-icon {
  background: #2563eb;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-upload-icon { width: 32px; height: 32px; border-radius: 9px; }
.upload-page { max-width: 1180px; margin: 0 auto; }
.upload-hero {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: #fff;
  border-radius: 20px;
  padding: 28px 32px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.upload-eyebrow { font-size: 10px; font-weight: 800; letter-spacing: 1.6px; color: #93c5fd; }
.upload-hero h2 { margin-top: 4px; font-size: 25px; letter-spacing: -0.6px; }
.upload-hero p { margin-top: 4px; color: #bfdbfe; font-size: 13px; }
.upload-hero-icon { font-size: 72px; color: #60a5fa; opacity: .35; transform: rotate(-5deg); }
.upload-alert { margin-bottom: 18px; }
.tiktok-setup-card { margin-bottom: 18px; border-left: 4px solid #f59e0b; }
.tiktok-setup-card .card-body { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.tiktok-setup-card h3 { margin: 7px 0 3px; font-size: 16px; }
.tiktok-setup-card p { color: var(--text-muted); font-size: 12px; }
.tiktok-account-form { display: flex; gap: 8px; min-width: min(100%, 430px); }
.tiktok-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 20px; }
.tiktok-flow > i { color: #94a3b8; }
.tiktok-step { display: flex; align-items: center; gap: 12px; min-height: 86px; padding: 15px; border-radius: 14px; border: 1px solid #cbd5e1; background: #fff; }
.tiktok-step > span { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #dbeafe; color: #1d4ed8; font-weight: 800; }
.tiktok-step strong, .tiktok-step small { display: block; }
.tiktok-step small { color: var(--text-muted); font-size: 11px; margin-top: 3px; line-height: 1.4; }
.tiktok-step.active { border-color: #60a5fa; background: #eff6ff; }
.tiktok-step.result { border-color: #6ee7b7; background: #ecfdf5; }
.tiktok-step.result > span { background: #10b981; color: #fff; }
.upload-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.upload-form-card { overflow: visible; }
.upload-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.upload-full { grid-column: 1 / -1; }
.form-hint { color: var(--text-light); font-weight: 400; font-size: 11px; }
.source-options { display: grid; grid-template-columns: 1fr; gap: 8px; }
.source-option { border: 1px solid var(--border); border-radius: 10px; min-height: 44px; display: flex; align-items: center; padding: 0 11px; cursor: pointer; background: #fff; }
.source-option input { margin-right: 8px; }
.source-option span { font-size: 12px; font-weight: 600; }
.source-option small { display: block; color: var(--text-light); font-size: 9px; }
.source-option.active { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.source-option.disabled { cursor: not-allowed; opacity: .65; background: #f8fafc; }
.file-drop { border: 2px dashed #cbd5e1; background: #f8fafc; border-radius: 16px; min-height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; padding: 24px; text-align: center; transition: var(--transition); }
.file-drop:hover, .file-drop.dragging { border-color: #3b82f6; background: #eff6ff; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop-icon { width: 52px; height: 52px; border-radius: 15px; background: #dbeafe; color: #2563eb; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 10px; }
.file-drop strong { font-size: 14px; max-width: 100%; overflow-wrap: anywhere; }
.file-drop small { color: var(--text-muted); margin-top: 3px; }
.preview-submit { width: 100%; margin-top: 18px; justify-content: center; min-height: 46px; }
.preview-submit:disabled { opacity: .55; cursor: not-allowed; }
.privacy-note { text-align: center; color: var(--text-muted); font-size: 11px; margin-top: 10px; }
.privacy-note i { color: #10b981; }
.upload-info-card { padding: 20px; border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 16px; position: sticky; top: 20px; }
.upload-info-card h3 { color: #1e3a8a; font-size: 14px; margin-bottom: 12px; }
.upload-info-card h3 i { margin-right: 5px; }
.upload-info-card ul { padding-left: 18px; color: #475569; font-size: 12px; }
.upload-info-card li { margin-bottom: 7px; }
.preview-section { margin-top: 28px; scroll-margin-top: 20px; }
.preview-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.preview-heading h2 { font-size: 22px; margin-top: 6px; }
.preview-heading p { color: var(--text-muted); font-size: 12px; }
.preview-format { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #ecfdf5; color: #047857; border-radius: 12px; font-weight: 700; }
.preview-format i { font-size: 20px; }
.preview-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.preview-kpi { background: #fff; border: 1px solid var(--border); border-left: 3px solid #3b82f6; border-radius: 12px; padding: 15px; }
.preview-kpi.success { border-left-color: #10b981; }
.preview-kpi.muted { border-left-color: #94a3b8; }
.preview-kpi span { display: block; color: var(--text-muted); font-size: 11px; }
.preview-kpi strong { display: block; font-size: 21px; margin-top: 3px; }
.preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.preview-detail-list > div, .channel-list > div { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid var(--border-light); }
.preview-detail-list > div:last-child, .channel-list > div:last-child { border-bottom: 0; }
.preview-detail-list span, .channel-list span { color: var(--text-muted); font-size: 12px; }
.preview-detail-list strong { text-align: right; overflow-wrap: anywhere; font-size: 12px; }
.channel-card, .headers-card { margin-bottom: 16px; }
.channel-list strong { color: #1d4ed8; }
.header-count { color: var(--text-muted); font-size: 11px; }
.header-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.header-chips span { padding: 5px 8px; border-radius: 7px; background: #f1f5f9; color: #475569; font-size: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.commit-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.commit-card div { display: flex; flex-direction: column; }
.commit-card strong { color: #065f46; }
.commit-card span { color: #047857; font-size: 11px; }
.import-result-kpis { margin-top: 2px; }

@media (max-width: 900px) {
  .upload-layout { grid-template-columns: 1fr; }
  .upload-info-card { position: static; }
  .preview-kpis { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .upload-hero { padding: 22px 20px; border-radius: 15px; }
  .upload-hero h2 { font-size: 20px; }
  .upload-hero-icon { display: none; }
  .tiktok-setup-card .card-body, .tiktok-account-form { align-items: stretch; flex-direction: column; }
  .tiktok-flow { grid-template-columns: 1fr; }
  .tiktok-flow > i { transform: rotate(90deg); justify-self: center; }
  .upload-form-grid, .preview-grid { grid-template-columns: 1fr; }
  .upload-full { grid-column: auto; }
  .source-options { grid-template-columns: 1fr; }
  .preview-heading { align-items: flex-start; gap: 12px; flex-direction: column; }
  .preview-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .preview-kpi { padding: 12px; }
  .preview-kpi strong { font-size: 18px; }
  .preview-format { width: 100%; }
  .commit-card { align-items: stretch; flex-direction: column; }
}

/* --- Layout Shell --- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 40;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.sidebar-brand-text h1 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.sidebar-brand-text p {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.sidebar-nav { padding: 12px 12px; flex: 1; }

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 12px 4px;
  margin-top: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.sidebar-link:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.sidebar-link.active {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 600;
  border: 1px solid var(--primary-light);
  border-left: 3px solid var(--primary);
  padding-left: 9px;
}

.sidebar-link .icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f97316;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; }
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.logout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  width: 100%;
}

.logout-link:hover {
  background: var(--danger-bg);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header (Mobile) --- */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.mobile-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  color: var(--text);
}

.menu-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 22px;
}

.menu-btn:hover { background: var(--primary-bg); color: var(--primary); }

/* --- Mobile Backdrop --- */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 39;
  pointer-events: none;
}
.sidebar-backdrop.active {
  display: block;
  pointer-events: auto;
  z-index: 39;
}

/* Sidebar always above backdrop on mobile */
@media (max-width: 768px) {
  .sidebar { z-index: 40; }
  .sidebar-backdrop.active ~ .sidebar,
  .sidebar.open { z-index: 40; }
}

/* Auto-close sidebar on mobile when clicking sidebar links */
@media (max-width: 768px) {
  .sidebar.open .sidebar-link {
    cursor: pointer;
  }
}

/* --- Page Content --- */
.page-content {
  flex: 1;
  padding: 24px 28px;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 20px; }
.card-body.no-pad { padding: 0; }

/* --- Stat Cards --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-card-primary { background: linear-gradient(135deg, #f97316, #ea580c); color: white; border: none; }
.stat-card-success { background: linear-gradient(135deg, #10b981, #059669); color: white; border: none; }
.stat-card-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; border: none; }
.stat-card-info { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; border: none; }

.stat-card .stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.stat-card .stat-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 24px;
  opacity: 0.2;
}

.stat-card .stat-sub {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(249,115,22,0.3); }

.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary-light); }
.btn-outline:hover { background: var(--primary-bg); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--border-light); color: var(--text); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 14px; }
.btn-xl { padding: 16px 32px; font-size: 16px; border-radius: 16px; }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- Forms --- */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: all var(--transition);
}

.form-input:hover { border-color: #cbd5e1; }
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
  background: white;
}

.form-input::placeholder { color: var(--text-light); }

.form-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: all var(--transition);
  cursor: pointer;
  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'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

.input-group {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 18px;
  pointer-events: none;
}

.input-group .form-input { padding-left: 40px; }

.input-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
}

.input-group .form-input.has-prefix { padding-left: 36px; }

/* --- Tables --- */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table thead th.sticky-col {
  position: sticky;
  left: 0;
  background: var(--bg);
  z-index: 2;
}

.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

.table tbody td.sticky-col {
  position: sticky;
  left: 0;
  background: white;
}

.table tbody tr:hover td { background: #fff7ed; }
.table tbody tr:last-child td { border-bottom: none; }

.table .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: #ecfdf5; color: #059669; }
.badge-danger  { background: #fef2f2; color: #dc2626; }
.badge-warning { background: #fffbeb; color: #d97706; }
.badge-info    { background: #eff6ff; color: #2563eb; }
.badge-gray    { background: #f1f5f9; color: #475569; }
.badge-primary { background: #fff7ed; color: #c2410c; }
.badge-orange  { background: #fff7ed; color: #c2410c; }
.badge-purple  { background: #f5f3ff; color: #6d28d9; }
.badge-yellow  { background: #fefce8; color: #a16207; }
.badge-teal   { background: #f0fdfa; color: #0f766e; }
.badge-slate  { background: #f8fafc; color: #475569; }
.badge-red    { background: #fef2f2; color: #dc2626; }
.badge-blue   { background: #eff6ff; color: #2563eb; }

.badge-green  { background: #ecfdf5; color: #059669; }

/* --- Alerts / Toast --- */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid;
}

.alert-success { background: var(--success-bg); color: #065f46; border-color: #a7f3d0; }
.alert-danger { background: var(--danger-bg); color: #991b1b; border-color: #fecaca; }
.alert-warning { background: var(--warning-bg); color: #92400e; border-color: #fde68a; }
.alert-info { background: var(--info-bg); color: #1e40af; border-color: #bfdbfe; }
.alert .alert-icon { font-size: 20px; flex-shrink: 0; margin-top: -1px; }

/* --- Modals --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active { display: flex; }

.modal {
  position: relative;
}

/* --- Modal Box --- */
.modal-box {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow-y: auto;
  z-index: 2;
}

.modal-box .modal-header {
  padding: 20px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.modal-box .modal-header .modal-title { font-size: 17px; font-weight: 700; }
.modal-box .modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.modal-box .modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-box .modal-body { padding: 20px 24px; }

/* --- File Upload Dropzone --- */
.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: all var(--transition);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.dropzone-icon { font-size: 36px; color: var(--text-light); margin-bottom: 8px; }
.dropzone-text { font-size: 14px; font-weight: 600; color: var(--text); }
.dropzone-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* --- Progress Bar --- */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.empty-state-desc { font-size: 13px; }

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px;
}

.pagination a, .pagination span {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}

.pagination a { color: var(--text-muted); }
.pagination a:hover { background: var(--primary-bg); color: var(--primary); }
.pagination .active, .pagination-btn.pagination-active { background: var(--primary); color: white; }
.pagination-disabled { color: #cbd5e1; cursor: not-allowed; }
.pagination-ellipsis { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 13px; }

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.animate-fade { animation: fadeIn 0.4s ease forwards; }
.animate-slide { animation: slideIn 0.3s ease forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* Staggered animations */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }

/* --- Search Bar --- */
.search-bar {
  position: relative;
  flex: 1;
}

.search-bar .form-input { padding-left: 40px; }
.search-bar .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 18px;
  pointer-events: none;
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* --- Responsive Breakpoints --- */

/* Tablet */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 20px; }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 280px;
  }

  .mobile-header { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { display: none; }
  .sidebar-backdrop.active { display: block; }
  .main-content { margin-left: 0; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-card .stat-value { font-size: 18px; }

  .page-content { padding: 16px; }

  .card-header { padding: 12px 16px; }
  .card-body { padding: 16px; }

  .table thead th,
  .table tbody td { padding: 10px 12px; font-size: 12.5px; }

  .filter-bar { padding: 12px 16px; }

  .modal { max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; margin-top: auto; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}

/* Small Mobile */
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .btn-lg, .btn-xl { padding: 12px 20px; font-size: 14px; }
}

/* Print */
@media print {
  .sidebar, .mobile-header, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body { background: white; }
  .card { box-shadow: none; border: 1px solid #e2e8f0; }
}

.text-profit-positif { color: #10b981; font-weight: 700; }
.text-profit-negatif { color: #ef4444; font-weight: 700; }

/* --- Page Banner --- */
.page-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.page-banner-icon {
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 100px;
  color: rgba(255,255,255,0.12);
  pointer-events: none;
}
.page-banner-title {
  font-size: 20px;
  font-weight: 800;
  color: white;
  margin: 0 0 4px;
}
.page-banner-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  margin: 0;
}
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-sm { font-size: 12px !important; }
.text-xs { font-size: 11px !important; }
.font-bold { font-weight: 700 !important; }
.font-semibold { font-weight: 600 !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mb-6 { margin-bottom: 24px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-4 { margin-top: 16px !important; }
.p-0 { padding: 0 !important; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Number input spinner hide */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] { -moz-appearance: textfield; }

/* --- Multi-Marketplace Dashboard --- */
.dashboard-page { max-width: 1600px; width: 100%; margin: 0 auto; }
.dashboard-logo { background: #2563eb; color: #fff; }
.sidebar-collapse { margin-left: auto; width: 30px; height: 30px; border: 0; border-radius: 8px; background: #f1f5f9; color: var(--text-muted); cursor: pointer; }
.sidebar-collapsed .dashboard-sidebar { width: 76px; }
.sidebar-collapsed .dashboard-main { margin-left: 76px; }
.sidebar-collapsed .dashboard-sidebar .sidebar-brand-text,
.sidebar-collapsed .dashboard-sidebar .sidebar-section-label,
.sidebar-collapsed .dashboard-sidebar .sidebar-link span,
.sidebar-collapsed .dashboard-sidebar .logout-link span,
.sidebar-collapsed .dashboard-sidebar .sidebar-user-info { display: none; }
.sidebar-collapsed .dashboard-sidebar .sidebar-brand { padding-inline: 18px; }
.sidebar-collapsed .dashboard-sidebar .sidebar-collapse { display: none; }
.sidebar-collapsed .dashboard-sidebar .sidebar-link,
.sidebar-collapsed .dashboard-sidebar .logout-link { justify-content: center; }
.dashboard-main { transition: margin-left var(--transition); min-width: 0; }
.dashboard-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.dashboard-top h2 { font-size: clamp(22px, 3vw, 30px); line-height: 1.2; letter-spacing: -.7px; }
.dashboard-top p { color: var(--text-muted); margin-top: 4px; }
.dashboard-kicker { color: #2563eb; font-size: 10px; font-weight: 800; letter-spacing: 1.6px; }
.dashboard-filters { display: grid; grid-template-columns: repeat(7, minmax(125px, 1fr)) auto auto; gap: 10px; padding: 14px; margin-bottom: 18px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.dashboard-filters .form-input, .dashboard-filters .form-select { min-width: 0; background-color: #fff; font-size: 12px; }
.custom-date { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; grid-column: span 2; }
.dashboard-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.dashboard-kpi { min-width: 0; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); transition: transform var(--transition), box-shadow var(--transition); }
.dashboard-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .35px; }
.kpi-head i { color: var(--text-light); }
.dashboard-kpi > strong { display: block; margin: 8px 0 5px; font-size: clamp(16px, 1.45vw, 22px); line-height: 1.2; overflow-wrap: anywhere; }
.dashboard-kpi small { font-size: 10px; font-weight: 600; }
.dashboard-loading .dashboard-kpi > strong { color: transparent; border-radius: 7px; background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 50%, #e2e8f0 75%); background-size: 200% 100%; animation: dashboardShimmer 1.2s infinite; }
@keyframes dashboardShimmer { to { background-position: -200% 0; } }
.dashboard-kpi .up { color: var(--success); }
.dashboard-kpi .down { color: var(--danger); }
.dashboard-kpi .flat { color: var(--text-muted); }
.dashboard-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.dashboard-highlights article { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 16px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 13px; }
.dashboard-highlights span { color: #1d4ed8; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.dashboard-highlights strong { grid-row: span 2; align-self: center; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-highlights small { color: var(--text-muted); }
.chart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.chart-grid .card { min-width: 0; }
.chart-wide { grid-column: span 2; }
.chart-box { position: relative; height: 310px; padding: 16px; overflow: hidden; }
.chart-box.small { height: 270px; }
.chart-box.tall { height: 380px; }
.chart-box canvas { display: none; max-width: 100%; }
.chart-fallback { position: absolute; inset: 16px; display: flex; align-items: center; justify-content: center; padding: 18px; color: var(--text-muted); background: #f8fafc; border: 1px dashed var(--border); border-radius: 12px; text-align: center; }
.charts-ready .chart-box canvas { display: block; }
.charts-ready .chart-fallback { display: none; }
.charts-failed .chart-fallback { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.card-note { color: var(--text-muted); font-size: 10px; }
.dashboard-bottom { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(220px, 1fr)); gap: 16px; }
.quality-list { padding: 8px 18px; }
.quality-list > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border-light); }
.quality-list > div:last-child { border-bottom: 0; }
.quality-list span { color: var(--text-muted); font-size: 12px; }
.quality-list small { display: block; color: var(--text-light); }
.quality-list strong { font-size: 12px; }
.market-pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.market-shopee { color: #c2410c; background: #fff7ed; }
.market-tiktok { color: #0f172a; background: #cffafe; box-shadow: inset 3px 0 #ec4899; }
.market-tokopedia { color: #047857; background: #ecfdf5; }
.market-lazada { color: #6d28d9; background: #f5f3ff; }
.market-offline, .market-lainnya { color: #475569; background: #f1f5f9; }

@media (max-width: 1280px) {
  .dashboard-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-bottom { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-bottom > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-wide { grid-column: span 2; }
}
@media (max-width: 768px) {
  .sidebar-collapse { display: none; }
  .sidebar-collapsed .dashboard-main { margin-left: 0; }
  .sidebar-collapsed .dashboard-sidebar { width: var(--sidebar-w); }
  .sidebar-collapsed .dashboard-sidebar .sidebar-brand-text,
  .sidebar-collapsed .dashboard-sidebar .sidebar-section-label,
  .sidebar-collapsed .dashboard-sidebar .sidebar-link span,
  .sidebar-collapsed .dashboard-sidebar .logout-link span,
  .sidebar-collapsed .dashboard-sidebar .sidebar-user-info { display: block; }
  .dashboard-top { align-items: flex-start; }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-highlights, .chart-grid, .dashboard-bottom { grid-template-columns: 1fr; }
  .chart-wide, .dashboard-bottom > :first-child { grid-column: auto; }
  .chart-box, .chart-box.small { height: 290px; }
  .chart-box.tall { height: 360px; }
}
@media (max-width: 540px) {
  .dashboard-top { flex-direction: column; }
  .dashboard-top .btn { width: 100%; }
  .dashboard-filters { grid-template-columns: 1fr; }
  .dashboard-filters .btn { width: 100%; }
  .custom-date { grid-column: auto; grid-template-columns: 1fr; }
  .dashboard-kpi { padding: 13px; }
  .dashboard-kpi > strong { font-size: 16px; }
  .dashboard-highlights article { grid-template-columns: 1fr; }
  .dashboard-highlights strong { grid-row: auto; }
  .chart-box { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* --- Multi-Marketplace Reports --- */
.report-page { max-width: 1500px; width: 100%; margin: 0 auto; }
.report-filters { display: grid; grid-template-columns: repeat(5,minmax(150px,1fr)); gap: 10px; padding: 14px; margin-bottom: 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.report-filters .form-input,.report-filters .form-select { background-color: #fff; font-size: 12px; }
.report-summary { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.report-summary article { padding: 13px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
.report-summary span { display: block; color: var(--text-muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.report-summary strong { display: block; margin-top: 5px; font-size: 15px; overflow-wrap: anywhere; }
.report-sub { display: block; max-width: 280px; margin-top: 3px; color: var(--text-muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-pagination { display: flex; justify-content: center; margin-top: 16px; }
.income-statement { max-width: 760px; margin: 0 auto; padding: 22px; }
.income-statement h3 { margin: 16px 0 8px; padding-bottom: 7px; border-bottom: 1px solid var(--border); font-size: 12px; text-transform: uppercase; }
.income-statement > div { display: flex; justify-content: space-between; gap: 20px; padding: 8px 0; }
.statement-total { margin-top: 8px; border-top: 1px dashed var(--border); font-weight: 700; }
.statement-net { margin-top: 12px; padding: 14px !important; border-radius: 12px; background: #eff6ff; color: #1d4ed8; font-size: 18px; font-weight: 800; }
@media(max-width:1100px){.report-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.report-summary{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){.report-filters{grid-template-columns:1fr 1fr}.report-summary{grid-template-columns:1fr 1fr}}
@media(max-width:480px){.report-filters{grid-template-columns:1fr}.report-summary strong{font-size:13px}}

/* ================================================================
   SubPedia 2026 — Professional UI Refresh
   Shared visual layer for every authenticated page
   ================================================================ */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #bfdbfe;
  --primary-bg: #eff6ff;
  --bg: #f6f8fc;
  --bg-card: #ffffff;
  --text: #172033;
  --text-muted: #667085;
  --text-light: #98a2b3;
  --border: #e4e7ec;
  --border-light: #f0f2f5;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.035);
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-md: 0 8px 20px rgba(16,24,40,.07);
  --shadow-lg: 0 16px 32px rgba(16,24,40,.09);
  --shadow-xl: 0 24px 48px rgba(16,24,40,.14);
  --sidebar-w: 272px;
}

body {
  background:
    radial-gradient(circle at 86% -10%, rgba(37,99,235,.07), transparent 28rem),
    var(--bg);
  color: var(--text);
  letter-spacing: -.01em;
}

/* Navigation */
.sidebar {
  background: #101828;
  border-right: 0;
  box-shadow: 8px 0 30px rgba(16,24,40,.08);
}
.sidebar-brand {
  min-height: 78px;
  padding: 17px 18px;
  background: #101828;
  border-color: rgba(255,255,255,.08);
}
.sidebar-brand-icon,
.dashboard-logo,
.upload-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #2563eb);
  box-shadow: 0 8px 20px rgba(37,99,235,.28);
}
.sidebar-brand-text h1 { color: #fff; font-size: 15px; letter-spacing: -.2px; }
.sidebar-brand-text p { color: #98a2b3; letter-spacing: .3px; }
.sidebar-nav { padding: 12px 10px 18px; }
.sidebar-section-label {
  margin-top: 10px;
  padding: 7px 12px 5px;
  color: #667085;
  font-size: 9px;
  letter-spacing: 1.15px;
}
.sidebar-link {
  min-height: 42px;
  margin-bottom: 3px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #98a2b3;
  font-size: 12.5px;
  font-weight: 550;
}
.sidebar-link .icon { width: 20px; font-size: 15px; color: #667085; }
.sidebar-link:hover {
  color: #f9fafb;
  background: rgba(255,255,255,.06);
}
.sidebar-link:hover .icon { color: #bfdbfe; }
.sidebar-link.active {
  padding-left: 12px;
  color: #fff;
  background: linear-gradient(90deg, rgba(37,99,235,.30), rgba(37,99,235,.16));
  border: 1px solid rgba(96,165,250,.18);
  box-shadow: inset 3px 0 #60a5fa;
  font-weight: 650;
}
.sidebar-link.active .icon { color: #93c5fd; }
.sidebar-footer {
  padding: 10px;
  background: #101828;
  border-color: rgba(255,255,255,.08);
}
.sidebar-user { margin: 0 0 5px; padding: 9px 10px; background: rgba(255,255,255,.035); }
.sidebar-user-avatar {
  background: linear-gradient(145deg, #3b82f6, #2563eb);
  box-shadow: 0 5px 14px rgba(37,99,235,.22);
}
.sidebar-user-name { color: #f2f4f7; }
.sidebar-user-role { color: #667085; }
.logout-link { color: #fda4af; font-size: 12.5px; }
.logout-link:hover { color: #fecdd3; background: rgba(244,63,94,.10); }
.sidebar-collapse { background: rgba(255,255,255,.07); color: #98a2b3; }
.sidebar-collapse:hover { color: #fff; background: rgba(255,255,255,.12); }

/* Page shell */
.main-content { min-width: 0; }
.page-content { width: 100%; padding: 28px 32px 40px; }
.mobile-header {
  background: rgba(255,255,255,.92);
  border-color: var(--border);
  box-shadow: 0 1px 6px rgba(16,24,40,.04);
  backdrop-filter: blur(14px);
}
.mobile-upload-icon { background: #2563eb; }
.menu-btn { border: 1px solid var(--border); background: #fff; font-size: 18px; }
.sidebar-backdrop { background: rgba(16,24,40,.62); backdrop-filter: blur(3px); }

/* Page headers */
.page-banner {
  min-height: 126px;
  padding: 28px 30px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 20%, rgba(255,255,255,.23), transparent 13rem),
    linear-gradient(120deg, #1d4ed8, #2563eb 58%, #3b82f6);
  box-shadow: 0 12px 28px rgba(37,99,235,.15);
}
.page-banner-title { font-size: clamp(21px,2.3vw,27px); letter-spacing: -.6px; }
.page-banner-sub { max-width: 680px; color: #dbeafe; font-size: 12.5px; }
.page-banner-icon { right: 22px; top: 8px; font-size: 92px; opacity: .7; }
.dashboard-top { margin-bottom: 22px; }
.dashboard-top h2 { color: #172033; font-weight: 750; }
.dashboard-kicker { color: #2563eb; }

/* Surfaces */
.card,
.dashboard-kpi,
.report-summary article,
.preview-kpi,
.filter-bar,
.dashboard-filters,
.report-filters {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-sm);
}
.card { border-radius: var(--radius); }
.card:hover { border-color: #d0d5dd; }
.card-header { min-height: 55px; padding: 15px 19px; }
.card-title { font-size: 14px; font-weight: 700; letter-spacing: -.15px; }
.card-title i { color: #2563eb; }
.card-body { padding: 20px; }
.dashboard-kpi { border-radius: 12px; padding: 17px; }
.dashboard-kpi:hover { transform: translateY(-2px); border-color: #bfdbfe; box-shadow: var(--shadow-md); }
.kpi-head i { color: #3b82f6; }
.dashboard-kpi > strong { color: #101828; }
.dashboard-highlights article { background: #f8faff; border-color: #dbeafe; }
.chart-fallback { background: #fafbfc; }
.upload-info-card { border-color: #dbeafe; background: #f8faff; }

/* Buttons and controls */
.btn {
  min-height: 38px;
  padding: 9px 15px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 650;
  box-shadow: none;
}
.btn-primary {
  color: #fff;
  background: #2563eb;
  box-shadow: 0 1px 2px rgba(16,24,40,.06);
}
.btn-primary:hover { background: #1d4ed8; box-shadow: 0 6px 14px rgba(37,99,235,.18); transform: translateY(-1px); }
.btn-success { background: #059669; }
.btn-danger { background: #dc2626; }
.btn-outline { color: #2563eb; border-color: #bfdbfe; background: #fff; }
.btn-outline:hover { border-color: #93c5fd; background: #eff6ff; }
.btn-ghost:hover { background: #f2f4f7; }
.form-label { color: #475467; font-size: 10.5px; font-weight: 700; letter-spacing: .55px; }
.form-input,
.form-select {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background-color: #fff;
  color: #101828;
  font-size: 13px;
  box-shadow: 0 1px 2px rgba(16,24,40,.025);
}
.form-input:hover,
.form-select:hover { border-color: #98a2b3; }
.form-input:focus,
.form-select:focus {
  border-color: #3b82f6;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.10);
}
.input-icon { color: #98a2b3; font-size: 15px; }
.filter-bar,
.dashboard-filters,
.report-filters { padding: 14px; border-radius: 12px; }

/* Tables */
.table { font-size: 12.5px; }
.table thead th {
  padding: 11px 15px;
  color: #667085;
  background: #f8fafc;
  border-color: #eaecf0;
  font-size: 9.5px;
  letter-spacing: .65px;
}
.table tbody td { padding: 13px 15px; border-color: #f0f2f5; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover td { background: #f8faff; }
.table tbody td.sticky-col { background: #fff; }
.table tbody tr:hover td.sticky-col { background: #f8faff; }
.badge,
.table .badge,
.market-pill { border-radius: 999px; font-weight: 700; }

/* Upload flow */
.upload-hero {
  min-height: 150px;
  padding: 30px 34px;
  border: 1px solid #dbeafe;
  background:
    radial-gradient(circle at 86% 20%, rgba(255,255,255,.18), transparent 12rem),
    linear-gradient(120deg, #172554, #1d4ed8 62%, #2563eb);
  box-shadow: 0 14px 30px rgba(37,99,235,.16);
}
.upload-eyebrow { color: #bfdbfe; }
.upload-hero h2 { font-size: clamp(23px,3vw,30px); }
.tiktok-step { border-color: var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
.tiktok-step.active { border-color: #93c5fd; background: #f5f9ff; }
.tiktok-step.result { border-color: #a7f3d0; background: #f5fffb; }
.file-drop { border-width: 1.5px; border-color: #cbd5e1; background: #fafbfc; }
.file-drop:hover,
.file-drop.dragging { border-color: #3b82f6; background: #f5f9ff; }
.file-drop-icon { color: #2563eb; background: #eff6ff; }

/* Feedback and overlays */
.alert { border-radius: 10px; box-shadow: var(--shadow-sm); }
.modal-overlay { background: rgba(16,24,40,.66); backdrop-filter: blur(4px); }
.modal-box { border: 1px solid rgba(255,255,255,.5); border-radius: 18px; }
.pagination a:hover { color: #2563eb; background: #eff6ff; }
.pagination .active,
.pagination-btn.pagination-active { background: #2563eb; }
.statement-net { color: #1d4ed8; background: #eff6ff; }

/* Remove old orange accent leakage */
.stat-card-primary { background: linear-gradient(135deg,#2563eb,#1d4ed8); }
.badge-primary,
.badge-orange { color: #1d4ed8; background: #eff6ff; }
.text-profit-positif { color: #059669; }
.text-profit-negatif { color: #dc2626; }
::selection { color: #1e3a8a; background: #dbeafe; }
:focus-visible { outline-color: #2563eb; }

@media (max-width: 1024px) {
  .page-content { padding: 22px; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 286px; }
  .sidebar { box-shadow: 18px 0 45px rgba(16,24,40,.24); }
  .page-content { padding: 18px 15px 28px; }
  .page-banner { min-height: 112px; padding: 23px 20px; border-radius: 14px; }
  .page-banner-icon { font-size: 70px; opacity: .45; }
  .card-header { min-height: 50px; }
}
@media (max-width: 480px) {
  .page-content { padding-inline: 12px; }
  .card { border-radius: 12px; }
  .card-body { padding: 15px; }
  .upload-hero { padding: 24px 20px; }
  .stat-grid { grid-template-columns: 1fr; }
}
