/* ─── Variables — Preto + Roxo ───────────────────── */
:root {
  /* Backgrounds */
  --bg:          #0a0a0a;
  --bg-card:     #111111;
  --bg-sidebar:  #080808;
  --bg-input:    #0e0e0e;
  --border:      rgba(255,255,255,0.09);

  /* Primary — roxo */
  --primary:     #7c3aed;
  --primary-h:   #6d28d9;
  --primary-bg:  rgba(124,58,237,0.13);
  --primary-glow: rgba(124,58,237,0.35);

  /* Accent — roxo claro */
  --violet:      #a855f7;
  --violet-bg:   rgba(168,85,247,0.12);

  /* Semânticos */
  --green:       #22c55e;
  --green-bg:    rgba(34,197,94,0.12);
  --amber:       #f59e0b;
  --amber-bg:    rgba(245,158,11,0.12);
  --danger:      #ef4444;
  --danger-bg:   rgba(239,68,68,0.12);

  /* Texto */
  --text:   #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #4b5563;

  --sidebar-w:  255px;
  --topbar-h:   62px;
  --r:          12px;
  --r-sm:       8px;
  --ease:       0.18s ease;
}

/* ─── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* ─── Login ──────────────────────────────────────── */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px; background: var(--bg);
}
.login-wrap  { width: 100%; max-width: 420px; }
.login-card  {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 44px 40px; text-align: center;
}
.login-logo  {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, #7c3aed 0%, #3b0a8c 100%);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 6px 28px rgba(124,58,237,0.5);
}
.login-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.login-sub   { font-size: 13px; color: var(--text-2); margin-bottom: 28px; }

/* ─── Layout ─────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ─── Mobile overlay ─────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 99;
  backdrop-filter: blur(4px);
}
.sidebar-overlay.active { display: block; }

/* ─── Sidebar ────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto;
  transition: transform var(--ease);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 22px 20px; border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed 0%, #3b0a8c 100%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 4px 16px rgba(124,58,237,0.45);
}
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.brand-sub  { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 14px 10px; }
.nav-section-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3);
  padding: 0 8px; margin: 8px 0 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 14px; font-weight: 500;
  transition: all var(--ease); margin-bottom: 2px;
}
.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-link:hover { background: rgba(124,58,237,0.08); color: var(--text); }
.nav-link.active { background: var(--primary-bg); color: var(--violet); }

.sidebar-footer { padding: 14px 16px; border-top: 1px solid var(--border); }
.sidebar-user   { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sidebar-user-icon {
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(124,58,237,0.15);
  display: flex; align-items: center; justify-content: center;
  color: var(--violet); flex-shrink: 0;
}
.sidebar-user-name { font-size: 13px; font-weight: 500; color: var(--text-2); }
.btn-logout {
  width: 100%; text-align: center;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12px; padding: 7px 12px;
  border-radius: var(--r-sm); cursor: pointer; font-family: inherit;
  transition: all var(--ease);
}
.btn-logout:hover { background: var(--danger-bg); color: var(--danger); border-color: rgba(239,68,68,0.2); }

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

/* ─── Topbar ─────────────────────────────────────── */
.topbar {
  height: var(--topbar-h); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 32px; gap: 14px;
  background: rgba(10,10,10,0.92); position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
}
.topbar-title { font-size: 17px; font-weight: 600; flex: 1; }
.topbar-date  { font-size: 12px; color: var(--text-3); }
.hamburger {
  display: none; background: none; border: none; cursor: pointer;
  padding: 6px; color: var(--text); border-radius: 6px;
  transition: background var(--ease);
}
.hamburger:hover { background: rgba(124,58,237,0.12); }

/* ─── Content ────────────────────────────────────── */
.content { padding: 28px 32px; flex: 1; }

/* ─── Page header ────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-title  { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.page-sub    { font-size: 13px; color: var(--text-2); margin-top: 3px; }

/* ─── Stats grid ─────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
/* blue class → primary purple */
.stat-card.blue::before   { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.stat-card.green::before  { background: linear-gradient(90deg, #22c55e, #4ade80); }
.stat-card.purple::before { background: linear-gradient(90deg, #4c1d95, #7c3aed); }
.stat-card.amber::before  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stat-label  { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); }
.stat-icon   { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.stat-icon.blue   { background: var(--primary-bg);  color: var(--primary); }
.stat-icon.green  { background: var(--green-bg);    color: var(--green);   }
.stat-icon.purple { background: var(--violet-bg);   color: var(--violet);  }
.stat-icon.amber  { background: var(--amber-bg);    color: var(--amber);   }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--text-2); margin-top: 5px; }

/* ─── Renewal alert ──────────────────────────────── */
.renewal-alert {
  background: rgba(124,58,237,0.07); border: 1px solid rgba(124,58,237,0.25);
  border-radius: var(--r); padding: 16px 20px; margin-bottom: 20px;
}
.renewal-header { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--violet); margin-bottom: 12px; }
.renewal-link   { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--violet); opacity: 0.7; }
.renewal-link:hover { opacity: 1; }
.renewal-list   { display: flex; flex-direction: column; gap: 4px; }
.renewal-row    { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 13px; }
.renewal-row:last-child { border-bottom: none; }
.renewal-row .strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Meta progress ──────────────────────────────── */
.meta-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.meta-card   { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; }
.meta-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.meta-label  { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); }
.meta-pct    { font-size: 14px; font-weight: 700; }
.progress-track { height: 6px; background: rgba(255,255,255,0.06); border-radius: 100px; overflow: hidden; }
.progress-fill  { height: 100%; border-radius: 100px; background: var(--primary); transition: width 0.6s ease; }
.meta-vals   { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.meta-cur    { font-weight: 600; color: var(--text); }

/* ─── Charts grid ────────────────────────────────── */
.charts-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; margin-bottom: 20px; }

/* ─── Seller ranking ─────────────────────────────── */
.rank-row  { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rank-row:last-child { border-bottom: none; }
.rank-num  { width: 26px; height: 26px; border-radius: 6px; background: var(--primary-bg); color: var(--violet); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.rank-name { flex: 1; font-size: 14px; font-weight: 500; }
.rank-stats { text-align: right; }
.rank-count { font-size: 15px; font-weight: 700; }

/* ─── Card ───────────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r); padding: 22px; margin-bottom: 20px; }
.card-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; margin-bottom: 18px; color: var(--text-2); }

/* ─── Table ──────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--ease); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(124,58,237,0.04); }
tbody td { padding: 14px 18px; font-size: 14px; color: var(--text-2); }
td.strong  { color: var(--text); font-weight: 500; }
td.muted   { color: var(--text-3); font-size: 13px; }
td.revenue { color: var(--green); font-weight: 600; }
td.td-action { text-align: right; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); font-size: 14px; }

/* ─── Badges ─────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-blue   { background: var(--primary-bg); color: var(--violet); }
.badge-green  { background: var(--green-bg);   color: var(--green);  }
.badge-purple { background: var(--violet-bg);  color: var(--violet); }
.badge-amber  { background: var(--amber-bg);   color: var(--amber);  }
.badge-red    { background: var(--danger-bg);  color: var(--danger); }
.chip-inuse   { font-size: 12px; color: var(--text-3); padding: 5px 10px; display: inline-block; }

/* ─── Buttons ────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500; cursor: pointer; border: none; font-family: inherit; transition: all var(--ease); white-space: nowrap; line-height: 1; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 0 0 0 var(--primary-glow); }
.btn-primary:hover { background: var(--primary-h); box-shadow: 0 4px 20px var(--primary-glow); }
.btn-ghost   { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(124,58,237,0.08); color: var(--text); border-color: rgba(124,58,237,0.3); }
.btn-danger  { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,0.22); }
.btn-sm   { padding: 6px 14px; font-size: 12px; }
.btn-icon { padding: 0; width: 32px; height: 32px; justify-content: center; border-radius: 6px; }

/* ─── Search bar ─────────────────────────────────── */
.search-bar   { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search-input { flex: 1; max-width: 340px; }

/* ─── Filter tabs ────────────────────────────────── */
.filter-bar  { margin-bottom: 10px; }
.filter-tabs { display: inline-flex; align-items: center; gap: 3px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 4px; flex-wrap: wrap; }
.ftab { padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; border: none; background: none; font-family: inherit; transition: all var(--ease); }
.ftab:hover  { color: var(--text); background: rgba(124,58,237,0.08); }
.ftab.active { background: var(--primary); color: #fff; }

/* ─── Date range ─────────────────────────────────── */
.range-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px 16px; margin-bottom: 10px; }
.range-box.hidden { display: none; }
.range-form  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.range-label { font-size: 13px; color: var(--text-2); white-space: nowrap; }

/* ─── Summary bar ────────────────────────────────── */
.summary-bar { display: flex; align-items: center; gap: 24px; padding: 16px 20px; margin-bottom: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-sm); }
.sum-item  { display: flex; flex-direction: column; }
.sum-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.sum-value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.sum-value.blue  { color: var(--violet); }
.sum-value.green { color: var(--green);  }
.sum-divider { width: 1px; height: 38px; background: var(--border); }

/* ─── Pagination ─────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; padding: 16px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.page-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-2); transition: all var(--ease); }
.page-btn:hover  { background: rgba(124,58,237,0.1); color: var(--text); }
.page-btn.active { background: var(--primary); color: white; }
.page-btn.disabled { opacity: 0.25; pointer-events: none; }

/* ─── Forms ──────────────────────────────────────── */
.form-page  { max-width: 600px; }
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.04em; }
.req { color: var(--danger); margin-left: 3px; }
.form-control {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 11px 13px; font-size: 14px;
  color: var(--text); font-family: inherit; outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.form-control::placeholder { color: var(--text-3); }
select.form-control option { background: #111111; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }

/* ─── Price tag ──────────────────────────────────── */
.price-tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; background: var(--green-bg); color: var(--green); border-radius: var(--r-sm); font-size: 13px; font-weight: 600; margin-top: 8px; }
.price-tag.hidden { display: none; }

/* ─── Alerts ─────────────────────────────────────── */
.alert { display: flex; align-items: center; gap: 9px; padding: 12px 15px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 18px; }
.alert-danger  { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.alert-success { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(34,197,94,0.2);  }

/* ─── PWA install banner ─────────────────────────── */
#pwa-banner {
  display: none; position: fixed; bottom: 24px; right: 24px; z-index: 200;
  background: var(--bg-card); border: 1px solid rgba(124,58,237,0.4);
  border-radius: var(--r); padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(124,58,237,0.2);
  max-width: 300px; animation: slideUp 0.3s ease;
}
#pwa-banner.show { display: flex; flex-direction: column; gap: 12px; }
#pwa-banner p { font-size: 13px; color: var(--text-2); }
#pwa-banner strong { color: var(--text); font-size: 14px; display: block; margin-bottom: 4px; }
#pwa-banner .pwa-actions { display: flex; gap: 8px; }
@keyframes slideUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }

/* ─── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.3); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124,58,237,0.5); }

/* ─── Selection ──────────────────────────────────── */
::selection { background: rgba(124,58,237,0.3); color: var(--text); }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 1024px) { .charts-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px)  { .content { padding: 20px; } .topbar { padding: 0 20px; } .stats-grid { grid-template-columns: repeat(2,1fr); } .meta-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main-wrapper { margin-left: 0; }
  .hamburger { display: flex; }
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .topbar-date { display: none; }
  #pwa-banner { bottom: 16px; right: 16px; left: 16px; max-width: none; }
}
