/* ══════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════ */
.app-shell {
  min-height: 100vh;
}

/* ══════════════════════════════════════════
   GLOBAL NAV (Top bar)
══════════════════════════════════════════ */
.global-nav {
  position: sticky;
  top: 0;
  z-index: 120;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-subtle);
}

.global-nav-inner {
  max-width: calc(var(--content-max) + (var(--content-padding) * 2));
  margin: 0 auto;
  min-height: var(--nav-height);
  padding: 0 var(--content-padding);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-4);
}

/* ── Brand ── */
.global-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
  text-decoration: none;
}

.global-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.global-brand-mark svg {
  width: 17px;
  height: 17px;
}

.global-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.global-brand-copy strong {
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.global-brand-copy span {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-brand-secondary);
  line-height: 1;
}

/* ── Nav Links ── */
.global-nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.global-nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
}

.global-nav-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.global-nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-surface-2);
}

.global-nav-link.is-active {
  color: var(--text-primary);
  background: var(--bg-surface-2);
  border-color: var(--border-default);
}

/* Colorful icons per nav item — color set via inline style --nav-icon-color */
.global-nav-link svg {
  color: var(--nav-icon-color, var(--text-muted));
}

.global-nav-link:hover svg,
.global-nav-link.is-active svg {
  color: var(--nav-icon-color, var(--text-primary));
}

/* ── Nav Side (User + logout) ── */
.global-nav-side {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  justify-content: flex-end;
}

.global-user-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 5px 10px 5px 5px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
}

.global-user-avatar {
  width: 20px;
  height: 20px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: hidden;
  flex-shrink: 0;
}

.global-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.global-user-role {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.global-logout {
  color: var(--text-muted);
  border-radius: var(--r-md);
  padding: 7px 10px;
  font-size: var(--text-sm);
  border: 1px solid transparent;
  transition: all var(--t-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.global-logout:hover {
  color: var(--color-danger);
  background: var(--color-danger-dim);
  border-color: rgba(248, 113, 113, 0.2);
}
.global-logout svg { width: 14px; height: 14px; }

/* ══════════════════════════════════════════
   MAIN WRAPPER
══════════════════════════════════════════ */
.main-wrapper {
  width: 100%;
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
}

.main-wrapper .page-content {
  flex: 1;
}

/* ══════════════════════════════════════════
   TOPBAR (action bar — só no perfil do influenciador)
══════════════════════════════════════════ */
.topbar--actions {
  position: sticky;
  top: var(--nav-height);
  z-index: 80;
  background: var(--bg-topbar-alt);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-faint);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  min-height: 52px;
  padding: 0 var(--content-padding);
  width: 100%;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.theme-toggle {
  min-width: 88px;
}

/* ══════════════════════════════════════════
   PAGE CONTENT
══════════════════════════════════════════ */
.page-content {
  width: 100%;
  max-width: calc(var(--content-max) + (var(--content-padding) * 2));
  margin: 0 auto;
  padding: var(--sp-8) var(--content-padding) var(--sp-16);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-5);
  margin-bottom: var(--sp-8);
}

.page-title {
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.page-subtitle {
  margin-top: var(--sp-1);
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 600px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   GRID
══════════════════════════════════════════ */
.grid           { display: grid; gap: var(--sp-5); }
.grid-2         { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3         { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4         { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto      { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ══════════════════════════════════════════
   CARD
══════════════════════════════════════════ */
.card {
  position: relative;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  transition: border-color var(--t-base);
}

.card:hover {
  border-color: var(--border-default);
}

.card-sm {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.card-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-title svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Colorful card title icons */
.card-title [data-lucide="pie-chart"]      { color: var(--color-violet); }
.card-title [data-lucide="sparkles"]       { color: var(--color-amber); }
.card-title [data-lucide="bot"]            { color: var(--color-emerald); }
.card-title [data-lucide="hard-drive"]     { color: var(--color-orange); }
.card-title [data-lucide="sticky-note"]    { color: var(--color-sky); }
.card-title [data-lucide="activity"]       { color: var(--color-rose); }
.card-title [data-lucide="users"]          { color: var(--color-sky); }
.card-title [data-lucide="settings"]       { color: var(--color-cyan); }
.card-title [data-lucide="settings-2"]     { color: var(--color-cyan); }
.card-title [data-lucide="layout-dashboard"] { color: var(--color-violet); }

/* ── Section Divider ── */
.section-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--sp-8) 0;
}

/* ── Sidebar Overlay ── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
  z-index: 110;
}

.sidebar-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.app-footer {
  background: var(--bg-canvas);
  padding: var(--sp-6) var(--content-padding);
}

.app-footer-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-8);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-6);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  flex-wrap: wrap;
}

.app-footer-brand {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.app-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  flex-wrap: wrap;
}

.app-footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-sm);
  color: var(--text-disabled);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}

.app-footer-links a i,
.app-footer-links a svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.app-footer-links a:hover {
  color: var(--text-secondary);
  background: var(--bg-surface-2);
}

.app-footer-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-default);
  flex-shrink: 0;
}

.app-footer-sep {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,.28);
  flex-shrink: 0;
}

.app-footer-copy {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  flex-shrink: 0;
  white-space: nowrap;
}
