/* ================================================================
   APP.CSS — EvaFunnels Premium Theme v4.0
   Light/Dark mode • Premium & Elegant • Client toggle
   ================================================================ */

/* ----------------------------------------------------------------
   1. CSS VARIABLES — LIGHT MODE (Default)
   ---------------------------------------------------------------- */
:root {
  /* Backgrounds */
  --bg:      #f3f5fb;
  --bg-grad: linear-gradient(150deg, #ffffff 0%, #eef2ff 45%, #f3f5fb 100%);
  --s1:      #ffffff;
  --s2:      #f7f9fe;
  --s3:      #edf0f9;
  --s4:      #e2e7f5;

  /* Borders */
  --b1: rgba(15,23,42,.08);
  --b2: rgba(15,23,42,.14);
  --b3: rgba(249,115,22,.25);

  /* Accent — Orange + Gold */
  --or:     #f97316;
  --or-l:   #fff7ed;
  --or-rgb: 249,115,22;
  --gold:   #eab308;
  --grn:    #22c55e;
  --grn-l:  #f0fdf4;
  --red:    #ef4444;
  --red-l:  #fef2f2;
  --blue:   #3b82f6;
  --blue-l: #eff6ff;
  --purple: #a855f7;
  --purple-l: #faf5ff;

  /* Text */
  --txt:  #0f172a;
  --txt2: #1e293b;
  --mut:  #64748b;
  --fnt:  #94a3b8;
  --inv:  #ffffff;

  /* Effects */
  --r:    14px;
  --r-sm: 10px;
  --r-lg: 20px;
  --r-xl: 26px;
  --sh:    0 1px 4px rgba(0,0,0,.04), 0 8px 28px rgba(15,23,42,.08);
  --sh-sm: 0 1px 3px rgba(0,0,0,.04), 0 3px 10px rgba(15,23,42,.05);
  --sh-lg: 0 4px 20px rgba(0,0,0,.07), 0 20px 60px rgba(15,23,42,.08);
  --sh-up: 0 -2px 16px rgba(0,0,0,.04);
  --sh-colored: 0 8px 32px rgba(249,115,22,.18);

  /* Transitions */
  --ease: cubic-bezier(.4, 0, .2, 1);

  /* Gradients */
  --grad:  linear-gradient(135deg, #f97316 0%, #eab308 100%);
  --grad2: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);

  /* Sidebar */
  --sidebar-w: 260px;
  --sidebar-bg: #ffffff;
  --sidebar-border: rgba(15,23,42,.08);

  /* Compat aliases */
  --accent:     #f97316;
  --accent-rgb: 249,115,22;

  /* Text aliases (used by gerador) */
  --t1: #0f172a;
  --t2: #1e293b;
  --t3: #64748b;
}

/* ----------------------------------------------------------------
   1b. DARK MODE VARIABLES
   ---------------------------------------------------------------- */
[data-theme="dark"] {
  --bg:      #070b16;
  --bg-grad: linear-gradient(150deg, #070b16 0%, #0c1428 55%, #080c18 100%);
  --s1:      #0e1628;
  --s2:      #131f38;
  --s3:      #192840;
  --s4:      #1f3050;

  --b1: rgba(100,140,210,.14);
  --b2: rgba(100,140,210,.22);
  --b3: rgba(249,115,22,.28);

  --or-l:     rgba(249,115,22,.1);
  --grn-l:    rgba(34,197,94,.09);
  --red-l:    rgba(239,68,68,.09);
  --blue-l:   rgba(59,130,246,.09);
  --purple-l: rgba(168,85,247,.09);

  --txt:  #e6edf8;
  --txt2: #c2d0e8;
  --mut:  #8899bb;
  --fnt:  #506888;
  --inv:  #070b16;

  --sh:    0 2px 8px rgba(0,0,0,.5), 0 8px 28px rgba(0,0,0,.35);
  --sh-sm: 0 1px 4px rgba(0,0,0,.4), 0 3px 10px rgba(0,0,0,.25);
  --sh-lg: 0 4px 24px rgba(0,0,0,.55), 0 20px 60px rgba(0,0,0,.35);
  --sh-up: 0 -2px 16px rgba(0,0,0,.3);
  --sh-colored: 0 8px 32px rgba(249,115,22,.22);

  --sidebar-bg: #0a1120;
  --sidebar-border: rgba(100,140,210,.14);

  /* Text aliases (used by gerador) */
  --t1: #e6edf8;
  --t2: #c2d0e8;
  --t3: #8899bb;
}

/* ----------------------------------------------------------------
   2. RESET & BASE
   ---------------------------------------------------------------- */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--txt);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
}

a { color: var(--or); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: #e05a2a; }

img { max-width: 100%; height: auto; display: block; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--fnt); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--mut); }

/* ----------------------------------------------------------------
   3. BACKGROUND — Subtle gradient orbs (light mode: invisible, dark mode: faint)
   ---------------------------------------------------------------- */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(120px); opacity: .03; }
[data-theme="dark"] .orb { opacity: .06; }
.o1 { width: 500px; height: 500px; background: #ff6b35; top: -150px; left: -100px; }
.o2 { width: 400px; height: 400px; background: #8b5cf6; bottom: -100px; right: -100px; }
.o3 { width: 300px; height: 300px; background: #f59e0b; top: 50%; left: 50%; }

@keyframes orbF {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.05); }
  66%      { transform: translate(-20px, 20px) scale(.95); }
}

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

.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 28px 32px 40px;
  position: relative; z-index: 1;
}

/* ----------------------------------------------------------------
   5. SIDEBAR STYLING
   ---------------------------------------------------------------- */
.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px;
}
.sidebar-logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; flex-shrink: 0;
}
.sidebar-logo-text { display: flex; flex-direction: column; }
.sidebar-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px; font-weight: 700; color: var(--txt); letter-spacing: -.3px;
}
.sidebar-brand em {
  font-style: normal; color: var(--or);
}
.sidebar-version {
  font-size: 10px; color: var(--fnt); font-weight: 500; letter-spacing: .5px; text-transform: uppercase;
}

/* User block */
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 14px 8px; padding: 10px 12px;
  background: var(--s2); border-radius: var(--r-sm);
}
.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: 11px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Dividers */
.sidebar-divider {
  height: 1px; background: var(--b1); margin: 6px 16px;
}

/* Section labels */
.sidebar-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: .8px;
  text-transform: uppercase; color: var(--fnt);
  padding: 12px 20px 4px; list-style: none;
}

/* Nav links */
.sidebar-nav { list-style: none; padding: 0; }
.sidebar-nav li { list-style: none; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; margin: 1px 10px;
  border-radius: var(--r-sm); color: var(--mut);
  font-size: 13px; font-weight: 500;
  transition: all .15s var(--ease);
  text-decoration: none; position: relative;
}
.nav-link i {
  width: 18px; text-align: center; font-size: 13px; flex-shrink: 0;
  transition: color .15s var(--ease);
}
.nav-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-link:hover {
  background: var(--or-l); color: var(--or);
  text-decoration: none;
}
.nav-link:hover i { color: var(--or); }

.nav-link.active {
  background: var(--or-l); color: var(--or); font-weight: 600;
}
.nav-link.active i { color: var(--or); }
.nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--or); border-radius: 0 3px 3px 0;
}

/* Nav badges */
.nav-badge {
  margin-left: auto; font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; letter-spacing: .3px;
  white-space: nowrap;
}
.badge-gold   { background: rgba(245,158,11,.1); color: var(--gold); }
.badge-or     { background: rgba(255,107,53,.1);  color: var(--or); }
.badge-purple { background: rgba(139,92,246,.1);  color: var(--purple); }
.badge-grn, .badge-green { background: rgba(16,185,129,.1); color: var(--grn); }
.badge-red    { background: rgba(239,68,68,.1);   color: var(--red); }
.badge-blue   { background: rgba(59,130,246,.1);  color: var(--blue); }
/* Lock badge */
.nav-badge-lock { background: rgba(100,116,139,.1); color: var(--fnt); }
.nav-link[data-locked] { opacity: .72; }
.nav-link[data-locked]:hover { opacity: 1 !important; background: var(--s3) !important; color: var(--mut) !important; cursor: not-allowed; }
.nav-link[data-locked]:hover i { color: var(--mut) !important; }

/* Sidebar bottom */
.sidebar-bottom { margin-top: auto; padding-bottom: 12px; }
.nav-logout { color: var(--red) !important; }
.nav-logout:hover { background: var(--red-l) !important; }

/* Theme toggle in sidebar */
.sidebar-theme-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px; margin-bottom: 4px;
}
.sidebar-theme-toggle span { font-size: 11px; color: var(--fnt); font-weight: 500; }

.theme-switch {
  position: relative; width: 44px; height: 24px; cursor: pointer;
}
.theme-switch input { opacity: 0; width: 0; height: 0; }
.theme-slider {
  position: absolute; inset: 0;
  background: var(--s3); border-radius: 12px;
  transition: .3s var(--ease);
}
.theme-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; top: 3px;
  background: var(--or); border-radius: 50%;
  transition: .3s var(--ease);
}
.theme-switch input:checked + .theme-slider { background: var(--s4); }
.theme-switch input:checked + .theme-slider::before { transform: translateX(20px); }

/* ----------------------------------------------------------------
   5b. SIDEBAR MINI (Collapse/Expand)
   ---------------------------------------------------------------- */
.sidebar-toggle-btn {
  width: 26px; height: 26px; border-radius: 7px;
  border: 1px solid var(--b1); background: var(--s2);
  color: var(--mut); cursor: pointer; font-size: 9px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s var(--ease); margin-left: auto; flex-shrink: 0;
}
.sidebar-toggle-btn:hover { border-color: var(--or); color: var(--or); background: var(--or-l); }

body.sidebar-mini { --sidebar-w: 68px; }
body.sidebar-mini .sidebar-logo-text,
body.sidebar-mini .sidebar-user-info,
body.sidebar-mini .sidebar-section-label,
body.sidebar-mini .nav-link > span,
body.sidebar-mini .nav-badge,
body.sidebar-mini .sidebar-version,
body.sidebar-mini .sidebar-theme-toggle span,
body.sidebar-mini .sidebar-theme-toggle label { display: none !important; }
body.sidebar-mini .sidebar-logo { justify-content: center; padding: 18px 0 14px; gap: 0; }
body.sidebar-mini .sidebar-toggle-btn { margin: 0; }
body.sidebar-mini .sidebar-user { justify-content: center; padding: 8px; }
body.sidebar-mini .sidebar-user-info { display: none !important; }
body.sidebar-mini .nav-link { justify-content: center; padding: 10px 0; margin: 2px 8px; }
body.sidebar-mini .nav-link i { width: auto; font-size: 15px; }
body.sidebar-mini .nav-link::before { display: none; }
body.sidebar-mini .sidebar-divider { margin: 5px 12px; }
body.sidebar-mini .sidebar-theme-toggle { justify-content: center; padding: 8px 0; }
body.sidebar-mini .sidebar-bottom { padding-bottom: 10px; }

/* ----------------------------------------------------------------
   6. HAMBURGER (Mobile)
   ---------------------------------------------------------------- */
.hamburger {
  display: none; position: fixed; top: 14px; left: 14px;
  z-index: 200; width: 40px; height: 40px;
  border-radius: var(--r-sm); border: 1px solid var(--b1);
  background: var(--s1); color: var(--txt);
  font-size: 16px; cursor: pointer;
  align-items: center; justify-content: center;
  box-shadow: var(--sh-sm); transition: all .2s var(--ease);
}
.hamburger:hover { border-color: var(--or); color: var(--or); }
.hamburger.active { background: var(--or); color: #fff; border-color: var(--or); }

.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.3);
  backdrop-filter: blur(4px); z-index: 99;
  opacity: 0; visibility: hidden;
  transition: all .3s var(--ease);
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* ----------------------------------------------------------------
   7. PAGE HEADER & TITLES
   ---------------------------------------------------------------- */
.page-header {
  margin-bottom: 24px;
}
.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 700; color: var(--txt);
  letter-spacing: -.3px; margin-bottom: 4px;
}
.page-subtitle {
  font-size: 13px; color: var(--mut); line-height: 1.5;
}
.page-badge {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; margin-bottom: 8px;
  background: var(--or-l); color: var(--or);
}

/* Section titles */
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px; font-weight: 700; color: var(--txt);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.section-title i { color: var(--or); font-size: 14px; }

/* ----------------------------------------------------------------
   8. CARDS
   ---------------------------------------------------------------- */
.card {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r); padding: 20px;
  box-shadow: var(--sh-sm);
  transition: all .2s var(--ease);
}
.card:hover {
  box-shadow: var(--sh);
  border-color: var(--b2);
}

/* Stat cards */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.stat-card {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r); padding: 16px 18px;
  box-shadow: var(--sh-sm);
  display: flex; align-items: center; gap: 14px;
  transition: all .2s var(--ease);
}
.stat-card:hover { border-color: var(--or); box-shadow: var(--sh); transform: translateY(-1px); }
.stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.stat-icon.orange { background: var(--or-l); color: var(--or); }
.stat-icon.green  { background: var(--grn-l); color: var(--grn); }
.stat-icon.blue   { background: var(--blue-l); color: var(--blue); }
.stat-icon.purple { background: var(--purple-l); color: var(--purple); }
.stat-icon.red    { background: var(--red-l); color: var(--red); }
.stat-label { font-size: 11px; color: var(--mut); font-weight: 500; margin-bottom: 2px; }
.stat-value { font-size: 20px; font-weight: 700; color: var(--txt); line-height: 1.2; }
.stat-info { display: flex; flex-direction: column; }

/* ----------------------------------------------------------------
   9. BUTTONS
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; font-family: inherit;
  border: 1px solid transparent; cursor: pointer;
  transition: all .2s var(--ease); text-decoration: none;
  white-space: nowrap; line-height: 1.4;
}
.btn i { font-size: 12px; }

.btn-primary {
  background: var(--or); color: #fff; border-color: var(--or);
}
.btn-primary:hover {
  background: #e05a2a; border-color: #e05a2a;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(var(--or-rgb),.25);
  color: #fff; text-decoration: none;
}

.btn-secondary {
  background: var(--s2); color: var(--txt2);
  border-color: var(--b1);
}
.btn-secondary:hover {
  background: var(--s3); border-color: var(--b2);
  text-decoration: none; color: var(--txt);
}

.btn-ghost {
  background: transparent; color: var(--mut);
  border-color: var(--b1);
}
.btn-ghost:hover {
  background: var(--s2); color: var(--txt);
  text-decoration: none;
}

.btn-danger {
  background: var(--red-l); color: var(--red);
  border-color: rgba(239,68,68,.15);
}
.btn-danger:hover {
  background: var(--red); color: #fff;
  text-decoration: none;
}

.btn-success {
  background: var(--grn-l); color: var(--grn);
  border-color: rgba(16,185,129,.15);
}
.btn-success:hover {
  background: var(--grn); color: #fff;
  text-decoration: none;
}

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 4px 8px; font-size: 11px; border-radius: 5px; }
.btn-lg { padding: 10px 22px; font-size: 14px; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 8px; }
.btn-block { width: 100%; }

/* ----------------------------------------------------------------
   10. FORM ELEMENTS
   ---------------------------------------------------------------- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--txt2); margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 14px;
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r-sm); color: var(--txt);
  font-size: 13px; font-family: inherit;
  transition: all .2s var(--ease);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--or);
  box-shadow: 0 0 0 3px rgba(var(--or-rgb),.08);
}
.form-input::placeholder { color: var(--fnt); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--fnt); margin-top: 4px; }

/* Input group */
.input-group {
  display: flex; gap: 0;
}
.input-group .form-input {
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.input-group .btn {
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* ----------------------------------------------------------------
   11. TABLES
   ---------------------------------------------------------------- */
.table-wrap {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r); overflow: hidden;
  box-shadow: var(--sh-sm);
}
table {
  width: 100%; border-collapse: collapse;
}
th {
  padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 600; color: var(--mut);
  text-transform: uppercase; letter-spacing: .5px;
  background: var(--s2); border-bottom: 1px solid var(--b1);
}
td {
  padding: 10px 14px; border-bottom: 1px solid var(--b1);
  font-size: 13px; color: var(--txt2); vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--s2); }

.td-email { font-weight: 600; color: var(--txt); }
.td-muted { color: var(--mut); font-size: 12px; }
.td-faint { color: var(--fnt); font-size: 12px; font-style: italic; }
.td-nowrap { white-space: nowrap; }
.td-actions { text-align: center; }

.domain-pill {
  display: inline-block; padding: 2px 8px;
  background: var(--or-l); border: 1px solid rgba(var(--or-rgb),.15);
  border-radius: 20px; font-size: 11px; font-weight: 600; color: var(--or);
}
.action-btns { display: flex; gap: 4px; justify-content: center; }

/* Status badges */
.status-active {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: var(--grn);
}
.status-active::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--grn); flex-shrink: 0;
}
.status-suspended {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: var(--red);
}
.status-suspended::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--red); flex-shrink: 0;
}

/* ----------------------------------------------------------------
   12. FILTER BAR
   ---------------------------------------------------------------- */
.filter-bar {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px;
}
.filter-bar .btn,
.filter-btn {
  padding: 6px 14px; font-size: 12px; font-weight: 500;
  border-radius: 20px; background: var(--s1); border: 1px solid var(--b1);
  color: var(--mut); cursor: pointer; transition: all .2s var(--ease);
  font-family: inherit;
}
.filter-bar .btn:hover, .filter-btn:hover {
  border-color: var(--or); color: var(--or); background: var(--or-l);
}
.filter-bar .btn.active, .filter-btn.active {
  background: var(--or); border-color: var(--or); color: #fff;
}

/* ----------------------------------------------------------------
   13. APPS GRID
   ---------------------------------------------------------------- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}

.app-card {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r); overflow: hidden;
  box-shadow: var(--sh-sm);
  display: flex; flex-direction: column;
  transition: all .25s var(--ease);
}
.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-lg);
  border-color: var(--or);
}

.app-cover {
  position: relative; width: 100%; padding-top: 100%;
  background: var(--s2); overflow: hidden;
  text-decoration: none; color: inherit; display: block;
}
.app-cover img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform .3s var(--ease);
}
.app-card:hover .app-cover img { transform: scale(1.04); }
.app-cover-label {
  display: none; position: absolute; inset: 0;
  color: #fff; font-weight: 700; font-size: 13px; text-align: center;
  padding: 8px; text-shadow: 0 1px 3px rgba(0,0,0,.3);
  align-items: center; justify-content: center;
}
.app-cover.no-img {
  background: linear-gradient(135deg, #ff6b35, #f59e0b);
}
.app-cover.no-img .app-cover-label { display: flex; }

.app-cover-eye {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.5); color: #fff;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; opacity: 0;
  transition: opacity .2s var(--ease);
}
.app-cover:hover .app-cover-eye { opacity: 1; }

.app-badge {
  position: absolute; top: 8px; left: 8px;
  padding: 2px 8px; border-radius: 5px;
  font-size: 10px; font-weight: 700; color: #fff;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  z-index: 2;
}
.app-type-badge {
  position: absolute; top: 8px; right: 8px;
  padding: 2px 8px; border-radius: 5px;
  font-size: 9px; font-weight: 700; letter-spacing: .3px;
  color: #fff; z-index: 2; text-transform: uppercase;
}
.app-type-badge.principal { background: var(--or); }
.app-type-badge.upsell { background: var(--purple); }
.app-type-badge.bonus { background: var(--grn); }

.app-info {
  padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1;
}
.app-name {
  font-size: 13px; font-weight: 700; color: var(--txt);
  line-height: 1.3; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.app-cat {
  font-size: 10px; font-weight: 600; color: var(--mut);
  text-transform: uppercase; letter-spacing: .3px;
}

.app-actions {
  display: flex; gap: 5px; padding: 0 14px 12px; flex-wrap: wrap;
}
.app-actions .btn { flex: 1; font-size: 11px; padding: 6px 8px; min-width: 0; white-space: nowrap; }
.btn-dl-prot {
  background: var(--grn-l) !important; color: var(--grn) !important;
  border: 1px solid rgba(16,185,129,.3) !important; font-weight: 600 !important;
}
.btn-dl-prot:hover { background: rgba(16,185,129,.15) !important; }
.btn-edit-app {
  background: var(--or-l) !important; color: var(--or) !important;
  border: 1px solid rgba(255,107,53,.3) !important; font-weight: 600 !important;
}

/* ----------------------------------------------------------------
   14. VIDEO AULAS
   ---------------------------------------------------------------- */
.videos-section {
  margin-bottom: 32px;
}
.videos-section .section-title {
  font-size: 15px; padding-bottom: 10px;
  border-bottom: 1px solid var(--b1); margin-bottom: 16px;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.video-card {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r); overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: all .2s var(--ease);
}
.video-card:hover {
  box-shadow: var(--sh); border-color: var(--b2);
  transform: translateY(-2px);
}

.video-thumb {
  position: relative; padding-top: 56.25%;
  background: var(--s3); overflow: hidden; cursor: pointer;
}
.video-thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform .3s var(--ease);
}
.video-card:hover .video-thumb img { transform: scale(1.04); }
.video-play-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25); opacity: 0;
  transition: opacity .2s var(--ease);
}
.video-card:hover .video-play-btn { opacity: 1; }
.video-play-btn i {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--or); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; box-shadow: 0 4px 12px rgba(var(--or-rgb),.4);
}

.video-info {
  padding: 12px 14px;
}
.video-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.video-category {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  color: var(--or); letter-spacing: .3px;
}
.video-duration {
  font-size: 10px; font-weight: 600; color: var(--fnt);
  background: var(--s2); padding: 2px 6px; border-radius: 4px;
}
.video-title {
  font-size: 13px; font-weight: 700; color: var(--txt);
  line-height: 1.3; margin-bottom: 4px;
}
.video-desc {
  font-size: 12px; color: var(--mut); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.video-actions { margin-top: 10px; }
.video-watch-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 6px;
  background: var(--or-l); color: var(--or);
  font-size: 12px; font-weight: 600; border: none;
  cursor: pointer; transition: all .2s var(--ease);
  font-family: inherit;
}
.video-watch-btn:hover { background: var(--or); color: #fff; }

/* Video Modal */
.video-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.75); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.video-modal-overlay.active { display: flex; }
.video-modal {
  background: var(--s1); border-radius: var(--r-lg);
  width: 100%; max-width: 900px; overflow: hidden;
  box-shadow: var(--sh-lg);
}
.video-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--b1);
}
.video-modal-header h3 { font-size: 14px; font-weight: 700; color: var(--txt); }
.video-modal-close {
  width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid var(--b1); background: var(--s2);
  color: var(--mut); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s var(--ease);
}
.video-modal-close:hover { background: var(--red-l); color: var(--red); border-color: rgba(239,68,68,.15); }
.video-modal-body { padding: 0; }
.video-modal-body iframe {
  width: 100%; aspect-ratio: 16/9; border: none; display: block;
}

/* ----------------------------------------------------------------
   15. ESTRUTURA (Funnels)
   ---------------------------------------------------------------- */
.funnel-section {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r); margin-bottom: 16px;
  box-shadow: var(--sh-sm); overflow: hidden;
}
.funnel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; gap: 12px; flex-wrap: wrap;
  border-bottom: 1px solid var(--b1);
}
.funnel-info h2 { font-size: 14px; font-weight: 700; color: var(--txt); }
.funnel-info .funnel-id { font-size: 10px; color: var(--fnt); font-weight: 600; letter-spacing: .3px; }

.pages-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px; padding: 14px 18px;
}
.page-card {
  padding: 14px; background: var(--s2);
  border: 1px solid var(--b1); border-radius: var(--r-sm);
  transition: all .2s var(--ease);
}
.page-card:hover { border-color: var(--or); }
.page-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 9px; font-weight: 700; letter-spacing: .3px;
  margin-bottom: 6px; text-transform: uppercase;
}
.badge-primary { background: var(--or-l); color: var(--or); }
.badge-quiz { background: var(--purple-l); color: var(--purple); }
.gerador-page-title { font-size: 13px; font-weight: 700; color: var(--txt); margin-bottom: 4px; }
.page-description { font-size: 12px; color: var(--mut); line-height: 1.4; margin-bottom: 10px; }
.preview-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 6px;
  background: var(--or-l); color: var(--or); border: none;
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all .2s var(--ease); font-family: inherit;
}
.preview-btn:hover { background: var(--or); color: #fff; }

.download-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--r-sm);
  background: var(--or); color: #fff; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .2s var(--ease); font-family: inherit;
  text-decoration: none; white-space: nowrap;
}
.download-btn:hover { background: #e05a2a; transform: translateY(-1px); text-decoration: none; color: #fff; }

/* ----------------------------------------------------------------
   16. MATERIAIS EXTRAS
   ---------------------------------------------------------------- */
.materiais-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; margin-bottom: 20px;
}
.mat-stat {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r-sm); padding: 12px 14px; text-align: center;
}
.mat-stat-num { font-size: 20px; font-weight: 700; color: var(--or); }
.mat-stat-label { font-size: 11px; color: var(--mut); font-weight: 500; }

.accordion-item {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r); margin-bottom: 8px;
  overflow: hidden; box-shadow: var(--sh-sm);
}
.accordion-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; cursor: pointer;
  transition: background .2s var(--ease);
}
.accordion-header:hover { background: var(--s2); }
.accordion-header h3 { font-size: 13px; font-weight: 700; color: var(--txt); }
.accordion-header .count { font-size: 11px; color: var(--mut); font-weight: 500; }
.accordion-header i {
  font-size: 12px; color: var(--fnt);
  transition: transform .2s var(--ease);
}
.accordion-item.active .accordion-header i { transform: rotate(180deg); }

.accordion-body {
  padding: 0 16px 14px;
  border-top: 1px solid var(--b1);
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
}
.accordion-item.active .accordion-body { max-height: 5000px; }

.mat-category { margin-top: 12px; }
.mat-category-title {
  font-size: 11px; font-weight: 700; color: var(--or);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px;
}

.mat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}
.mat-item {
  position: relative; border-radius: var(--r-sm);
  overflow: hidden; cursor: pointer;
  border: 1px solid var(--b1);
  transition: all .2s var(--ease);
}
.mat-item:hover { border-color: var(--or); transform: scale(1.02); }
.mat-item img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
}
.mat-item-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5); opacity: 0;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .2s var(--ease);
}
.mat-item:hover .mat-item-overlay { opacity: 1; }
.mat-item-overlay i { color: #fff; font-size: 18px; }

/* ----------------------------------------------------------------
   17. CRIATIVOS IA
   ---------------------------------------------------------------- */
.criativos-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.criativo-card {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r); overflow: hidden; cursor: pointer;
  box-shadow: var(--sh-sm); transition: all .2s var(--ease);
}
.criativo-card:hover { box-shadow: var(--sh); border-color: var(--b2); transform: translateY(-2px); }
.criativo-cover {
  position: relative; padding-top: 100%;
  background: var(--s2); overflow: hidden;
}
.criativo-cover img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.criativo-info { padding: 12px 14px; }
.criativo-name { font-size: 13px; font-weight: 700; color: var(--txt); margin-bottom: 4px; }
.criativo-desc { font-size: 12px; color: var(--mut); margin-bottom: 8px; line-height: 1.4; }
.criativo-count { font-size: 11px; font-weight: 600; color: var(--or); }

/* Creative items grid inside modal — vertical 9:16 videos */
.creative-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 600px) {
  .creative-grid { grid-template-columns: 1fr; max-width: 340px; margin: 0 auto; }
}
.creative-item {
  background: var(--s2); border: 1px solid var(--b1);
  border-radius: var(--r-sm); overflow: hidden;
}
.video-container { position: relative; background: #000; border-radius: var(--r-sm) var(--r-sm) 0 0; overflow: hidden; aspect-ratio: 9/16; }
.video-container video { width: 100%; height: 100%; display: block; object-fit: cover; background: #000; }
.creative-info { padding: 8px 10px; }
.creative-title {
  font-size: 11px; font-weight: 600; color: var(--txt);
  margin-bottom: 6px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.creative-badge {
  font-size: 9px; padding: 2px 5px; border-radius: 4px;
  background: var(--or-l); color: var(--or); font-weight: 700;
  display: inline-block; margin-bottom: 6px;
}
.creative-actions { display: flex; gap: 4px; }
.btn-play, .btn-download-single {
  padding: 4px 10px; border-radius: 5px;
  font-size: 10px; font-weight: 600; border: none;
  cursor: pointer; transition: all .2s var(--ease);
  display: inline-flex; align-items: center; gap: 3px;
  font-family: inherit; width: 100%;
  justify-content: center;
}
.btn-play { background: var(--or-l); color: var(--or); }
.btn-play:hover { background: var(--or); color: #fff; }
.btn-download-single { background: var(--s2); color: var(--txt2); }
.btn-download-single:hover { background: var(--s3); }

/* ----------------------------------------------------------------
   18. PAINEL (User Panel)
   ---------------------------------------------------------------- */
.panel-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.panel-card {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r); padding: 20px;
  box-shadow: var(--sh-sm);
}
.panel-card-title {
  font-size: 14px; font-weight: 700; color: var(--txt);
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.panel-card-title i { color: var(--or); font-size: 14px; }

.info-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--b1);
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 12px; color: var(--mut); font-weight: 500; }
.info-value { font-size: 13px; font-weight: 600; color: var(--txt); }

/* ----------------------------------------------------------------
   19. ADMIN PANEL
   ---------------------------------------------------------------- */
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 20px; flex-wrap: wrap;
}
.admin-search {
  display: flex; gap: 8px; flex: 1; max-width: 400px;
}
.admin-search .form-input {
  flex: 1; min-width: 0;
}
.admin-add {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r); padding: 16px;
  margin-bottom: 16px; box-shadow: var(--sh-sm);
}
.admin-add-title { font-size: 13px; font-weight: 700; color: var(--txt); margin-bottom: 12px; }
.admin-add-form {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: end;
}
.admin-add-form .form-input { flex: 1; min-width: 160px; }

/* ----------------------------------------------------------------
   20. COMUNIDADE
   ---------------------------------------------------------------- */
.community-card {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r); padding: 28px; text-align: center;
  box-shadow: var(--sh-sm);
}
.community-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--grn-l); color: var(--grn);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 auto 14px;
}
.community-title { font-size: 16px; font-weight: 700; color: var(--txt); margin-bottom: 6px; }
.community-desc { font-size: 13px; color: var(--mut); margin-bottom: 16px; line-height: 1.5; }

/* ----------------------------------------------------------------
   21. PROTEGER & EDITOR (keep existing patterns)
   ---------------------------------------------------------------- */
.result h3 { margin-bottom: 4px; font-size: 13px; font-weight: 700; color: var(--txt); }
.result p { font-size: 12px; color: var(--mut); }
.det {
  margin-top: 8px; padding: 10px 12px;
  background: var(--s2); border-radius: var(--r-sm);
  font-size: 12px; color: var(--mut); border: 1px solid var(--b1);
}

/* ----------------------------------------------------------------
   22. TOAST NOTIFICATIONS
   ---------------------------------------------------------------- */
#toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  padding: 10px 18px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600;
  transform: translateY(100px); opacity: 0;
  transition: all .3s var(--ease);
  box-shadow: var(--sh-lg);
  max-width: 380px;
}
#toast.show {
  transform: translateY(0); opacity: 1;
}
#toast.ok {
  background: var(--grn); color: #fff;
}
#toast.er {
  background: var(--red); color: #fff;
}
#toast:not(.ok):not(.er) {
  background: var(--s1); color: var(--txt);
  border: 1px solid var(--b1);
}

/* ----------------------------------------------------------------
   23. LOADING
   ---------------------------------------------------------------- */
.page-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 80px 20px; gap: 14px;
}
.page-loading p { font-size: 13px; color: var(--mut); }

.spin-lg {
  width: 32px; height: 32px;
  border: 3px solid var(--b1);
  border-top-color: var(--or);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,.4); backdrop-filter: blur(4px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
}
.loading-overlay p { font-size: 14px; color: #fff; font-weight: 600; }

/* ----------------------------------------------------------------
   24. ANIMATIONS
   ---------------------------------------------------------------- */
.fade-in {
  opacity: 0; transform: translateY(12px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.fade-in.visible {
  opacity: 1; transform: translateY(0);
}
.fade-in.delay-1 { transition-delay: .05s; }
.fade-in.delay-2 { transition-delay: .10s; }
.fade-in.delay-3 { transition-delay: .15s; }

@keyframes sIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* ----------------------------------------------------------------
   25. DASHBOARD SPECIFIC
   ---------------------------------------------------------------- */
.dash-welcome {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r-lg); padding: 24px 28px;
  margin-bottom: 20px; box-shadow: var(--sh-sm);
  position: relative; overflow: hidden;
}
.dash-welcome::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 200px; height: 100%; opacity: .06;
  background: var(--grad); border-radius: 0 var(--r-lg) var(--r-lg) 0;
}
.dash-welcome h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px; font-weight: 700; color: var(--txt);
  margin-bottom: 4px; position: relative;
}
.dash-welcome p {
  font-size: 13px; color: var(--mut); position: relative;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px; margin-bottom: 20px;
}

.quick-link {
  display: flex; align-items: center; gap: 14px;
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r); padding: 16px 18px;
  box-shadow: var(--sh-sm); transition: all .2s var(--ease);
  text-decoration: none; color: var(--txt);
}
.quick-link:hover {
  border-color: var(--or); box-shadow: var(--sh);
  transform: translateY(-2px); text-decoration: none; color: var(--txt);
}
.quick-link-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.quick-link-text { flex: 1; }
.quick-link-title { font-size: 13px; font-weight: 700; color: var(--txt); }
.quick-link-desc { font-size: 11px; color: var(--mut); }
.quick-link i.fa-chevron-right { color: var(--fnt); font-size: 12px; }

/* ----------------------------------------------------------------
   26. SEARCH BAR
   ---------------------------------------------------------------- */
.search-bar {
  position: relative; margin-bottom: 16px;
}
.search-bar .form-input {
  padding-left: 36px;
}
.search-bar i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--fnt); font-size: 13px;
}

/* ----------------------------------------------------------------
   27. EMPTY STATE
   ---------------------------------------------------------------- */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--fnt);
}
.empty-state i { font-size: 40px; margin-bottom: 14px; display: block; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--mut); margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--fnt); }

/* ----------------------------------------------------------------
   28. MODAL (Generic)
   ---------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.5); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--s1); border-radius: var(--r-lg);
  width: 100%; max-width: 720px;
  box-shadow: var(--sh-lg); overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 90vh;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--b1);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 14px; font-weight: 700; color: var(--txt); }
.modal-close {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--b1); background: var(--s2);
  color: var(--mut); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--red-l); color: var(--red); }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-footer {
  padding: 14px 18px; border-top: 1px solid var(--b1);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* Image modal for materiais */
.img-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.85);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.img-modal-overlay.active { display: flex; }
.img-modal-content {
  max-width: 90vw; max-height: 90vh;
  /* rola por dentro: o entregável ganhou o campo do link embaixo da arte
     e sem isso os botões saíam da tela em notebook/celular */
  display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
}
.img-modal-content img {
  max-width: 100%; max-height: 85vh;
  border-radius: var(--r); box-shadow: var(--sh-lg);
  object-fit: contain; flex: 0 0 auto;
}
.img-modal-actions {
  display: flex; gap: 8px; justify-content: center; margin-top: 12px;
  flex-wrap: wrap; flex: 0 0 auto; padding-bottom: 4px;
}

/* ----------------------------------------------------------------
   29. BANNER
   ---------------------------------------------------------------- */
.banner-section {
  margin: 24px 0; text-align: center;
}
.banner-section img {
  width: 100%; max-width: 900px; margin: 0 auto;
  border-radius: var(--r); box-shadow: var(--sh);
}

/* ----------------------------------------------------------------
   30. RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    background: var(--s1);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--sh-lg);
  }
  .main-content {
    margin-left: 0;
    padding: 20px 16px 32px;
  }
  .hamburger {
    display: flex;
  }
  .main-content { padding-top: 60px; }
}

@media (max-width: 768px) {
  .apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
  .videos-grid {
    grid-template-columns: 1fr;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .panel-grid {
    grid-template-columns: 1fr;
  }
  .pages-grid {
    grid-template-columns: 1fr;
  }
  .criativos-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  .page-title { font-size: 18px; }
  .dash-welcome h1 { font-size: 18px; }
  .filter-bar { gap: 4px; }
  .filter-btn { padding: 5px 10px; font-size: 11px; }
}

@media (max-width: 480px) {
  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .app-info { padding: 8px 10px; }
  .app-name { font-size: 12px; }
  .app-actions { padding: 0 8px 8px; gap: 3px; }
  .app-actions .btn { font-size: 9px; padding: 4px 5px; }
  .app-actions .btn i { margin-right: 1px; }
  .main-content { padding: 64px 12px 24px; } /* 21/11: o topo reserva o botão do menu (fixo, 14+40px) */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 18px; }
}

/* ----------------------------------------------------------------
   31. EDITOR & PROTEGER — Full Component Library
   ---------------------------------------------------------------- */

/* ---- Hero ---- */
.hero {
  text-align: center; padding: 32px 0 24px;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--or-l); border: 1px solid rgba(var(--or-rgb),.15);
  border-radius: 20px; padding: 4px 14px;
  font-size: 12px; color: var(--or); font-weight: 600; margin-bottom: 14px;
}
.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 800;
  line-height: 1.15; margin-bottom: 8px; color: var(--txt);
}
.hero p { color: var(--mut); font-size: 13px; max-width: 480px; margin: 0 auto; line-height: 1.6; }

/* ---- Gradient text ---- */
.g {
  background: linear-gradient(135deg, var(--or), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Card system (cd) ---- */
.cd {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r); overflow: hidden; margin-bottom: 16px;
  transition: border-color .2s var(--ease); box-shadow: var(--sh-sm);
}
.cd:hover { border-color: var(--b2); }
.cd.hl { border-color: rgba(var(--or-rgb),.2); box-shadow: 0 0 0 1px rgba(var(--or-rgb),.06), var(--sh); }
.cd-h {
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--b1); background: var(--s2); cursor: pointer; user-select: none;
}
.cd-hl { display: flex; align-items: center; gap: 10px; }
.cd-ic {
  width: 32px; height: 32px; background: var(--or-l);
  border: 1px solid rgba(var(--or-rgb),.12); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.cd-t { font-weight: 700; font-size: 13px; color: var(--txt); }
.cd-st { font-size: 11px; color: var(--mut); margin-top: 1px; }
.cd-b { padding: 18px; }

/* ---- Mode selector ---- */
.mode-sel {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 20px;
}
.mode-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--s1); border: 2px solid var(--b1);
  border-radius: var(--r); padding: 18px 14px;
  cursor: pointer; transition: all .2s var(--ease);
  font-family: inherit; color: var(--mut);
}
.mode-btn:hover { border-color: var(--b2); background: var(--s2); }
.mode-btn.active {
  border-color: var(--or); background: var(--or-l); color: var(--or);
  box-shadow: 0 0 0 3px rgba(var(--or-rgb),.08);
}
.mode-ic {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--s2); display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: all .2s var(--ease);
}
.mode-btn.active .mode-ic { background: var(--or); color: #fff; }
.mode-tx { font-size: 13px; font-weight: 700; }
.mode-desc { font-size: 11px; color: var(--fnt); }

/* ---- Collapsible sections ---- */
.coll { margin-bottom: 0; }
.coll .cd { margin-bottom: 16px; }
.coll .cd-b {
  max-height: 4000px; overflow: visible;
  transition: max-height .35s var(--ease), padding .35s var(--ease), opacity .25s;
  opacity: 1;
}
/* BUG A2 (05/08/2026) — "adicionei 20 apps e só aparecem 7; o botão de adicionar
   sumiu e as edições não salvam".
   Não era o salvamento: o teto de 4000px acima (que existe só pra animar o
   colapso) somado ao overflow:hidden do .cd recortava a lista da Loja Premium a
   partir do 8º item. E como o recorte é "hidden" e não "auto", não nascia barra
   de rolagem nenhuma — o conteúdo simplesmente sumia. Junto com ele iam os
   botões "＋ Adicionar manualmente" e "↻ Recarregar do template", que ficam
   DENTRO do mesmo .cd-b, logo abaixo da lista: por isso pareciam desativados.
   Com a seção aberta, não existe teto. Custo: o abre/fecha deixa de animar
   (não dá pra animar max-height a partir de "none") — troca justa por não
   esconder o trabalho do membro. */
.coll:not(.shut) .cd-b { max-height: none; }
.coll.shut .cd-b { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; overflow: hidden; }
.chev {
  font-size: 11px; color: var(--fnt); transition: transform .25s var(--ease);
  display: inline-block;
}
.coll.shut .chev { transform: rotate(-90deg); }

/* ---- Form grid ---- */
.fg { margin-bottom: 12px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .fgrid { grid-template-columns: 1fr; } }
.rq { color: var(--or); font-weight: 700; }

/* ---- Color picker ---- */
.crow {
  display: flex; align-items: center; gap: 8px;
}
.cswch {
  width: 36px; height: 36px; border-radius: 8px;
  overflow: hidden; border: 2px solid var(--b1);
  flex-shrink: 0; cursor: pointer;
}
.cswch input[type="color"] {
  width: 48px; height: 48px; border: none; cursor: pointer;
  margin: -6px; padding: 0;
}
.chex {
  width: 90px !important; font-family: 'SF Mono', monospace !important;
  font-size: 12px !important; text-transform: uppercase;
  padding: 8px 10px !important; letter-spacing: .5px;
}
.cprev {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: var(--r-sm); margin-top: 12px;
  color: #fff; font-size: 12px; font-weight: 700;
}
.cprev-l { opacity: .85; letter-spacing: 1px; }
.cprev-c { font-family: monospace; font-size: 11px; opacity: .9; }

/* ---- Upload zone ---- */
#uploadZone, .upload-zone-v {
  border: 2px dashed var(--b2); border-radius: var(--r);
  padding: 32px 20px; text-align: center;
  cursor: pointer; transition: all .2s var(--ease);
  background: var(--s2);
}
#uploadZone:hover, .upload-zone-v:hover,
#uploadZone.dg, .upload-zone-v.dg {
  border-color: var(--or); background: var(--or-l);
}
.u-ic { font-size: 2.2rem; margin-bottom: 10px; }
#uploadZone h3, .upload-zone-v h3 {
  font-size: 14px; font-weight: 700; color: var(--txt); margin-bottom: 6px;
}
#uploadZone p, .upload-zone-v p {
  font-size: 12px; color: var(--mut); margin-bottom: 10px;
}

/* ---- Tags ---- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tg {
  padding: 3px 10px; border-radius: 12px;
  background: var(--s1); border: 1px solid var(--b1);
  font-size: 11px; font-weight: 500; color: var(--mut);
}

/* ---- Progress bar ---- */
.prog {
  display: none; margin-top: 14px; text-align: center;
}
.prog-w {
  height: 6px; background: var(--s3); border-radius: 3px;
  overflow: hidden; margin-bottom: 6px;
}
.prog-b {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--or), var(--gold));
  border-radius: 3px; transition: width .3s var(--ease);
}
.prog-t { font-size: 11px; color: var(--mut); }

/* ---- File chip ---- */
.fchip {
  display: none; align-items: center; gap: 10px;
  padding: 10px 14px; margin-top: 12px;
  background: var(--grn-l); border: 1px solid rgba(16,185,129,.2);
  border-radius: var(--r-sm);
}
.fchip.sh { display: flex; }
.fchip-ic { font-size: 18px; flex-shrink: 0; }
.fchip-info { flex: 1; min-width: 0; }
.fchip-n {
  font-size: 13px; font-weight: 600; color: var(--txt);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fchip-s { font-size: 11px; color: var(--mut); }
.fchip-x {
  width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid var(--b1); background: var(--s1);
  color: var(--mut); cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.fchip-x:hover { background: var(--red-l); color: var(--red); border-color: var(--red); }

/* ---- Error box ---- */
.err-box {
  display: none; margin-top: 12px; padding: 10px 14px;
  background: var(--red-l); border: 1px solid rgba(239,68,68,.2);
  border-radius: var(--r-sm); font-size: 12px; color: var(--red);
  font-weight: 600;
}

/* ---- Empty placeholder ---- */
.empty-p {
  text-align: center; padding: 24px 16px;
  font-size: 12px; color: var(--fnt); font-style: italic;
}

/* ---- Info & Warning boxes ---- */
.info-b {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--blue-l); border: 1px solid rgba(59,130,246,.15);
  font-size: 12px; color: var(--txt2); line-height: 1.5;
}
.warn-b {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 14px; border-radius: var(--r-sm);
  background: #fffbeb; border: 1px solid rgba(245,158,11,.2);
  font-size: 12px; color: #92400e; line-height: 1.5;
  margin-bottom: 14px;
}
[data-theme="dark"] .warn-b { background: rgba(245,158,11,.06); border-color: rgba(245,158,11,.15); color: #fbbf24; }

/* ---- Small buttons (btn-s) ---- */
.btn-s {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--r-sm); border: 1px solid var(--b1);
  background: var(--s1); color: var(--txt); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all .2s var(--ease);
}
.btn-s:hover { border-color: var(--b2); background: var(--s2); }
.btn-s.pri {
  background: linear-gradient(135deg, var(--or), var(--gold));
  color: #fff; border: none; box-shadow: 0 2px 12px rgba(var(--or-rgb),.25);
}
.btn-s.pri:hover { box-shadow: 0 4px 20px rgba(var(--or-rgb),.35); transform: translateY(-1px); }
.btn-s:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---- Add button ---- */
.add-btn {
  display: block; width: 100%; padding: 10px; margin-top: 10px;
  border: 2px dashed var(--b2); border-radius: var(--r-sm);
  background: transparent; color: var(--or); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all .2s var(--ease);
}
.add-btn:hover { border-color: var(--or); background: var(--or-l); }

/* ---- Export button ---- */
.btn-exp {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--r); border: none;
  background: linear-gradient(135deg, var(--or), var(--gold));
  color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all .2s var(--ease);
  box-shadow: 0 4px 16px rgba(var(--or-rgb),.25);
}
.btn-exp:hover { box-shadow: 0 6px 24px rgba(var(--or-rgb),.35); transform: translateY(-2px); }
.btn-exp:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---- Export wrapper ---- */
.exp-w { text-align: center; }

/* ---- Checklist ---- */
.chk {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-bottom: 8px;
}
.chk-i {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-sm);
  background: var(--s2); border: 1px solid var(--b1);
  font-size: 12px; font-weight: 500; color: var(--mut);
  transition: all .2s;
}
.chk-i.ok { background: var(--grn-l); border-color: rgba(16,185,129,.2); color: var(--grn); }
.chk-i .c {
  display: inline-flex; width: 16px; height: 16px;
  align-items: center; justify-content: center;
  font-size: 11px;
}

/* ---- Phone preview mockup ---- */
.prev-phone {
  width: 220px; background: var(--txt); border-radius: 28px;
  padding: 8px; box-shadow: var(--sh-lg); position: relative;
}
.prev-bar {
  height: 18px; background: #111; border-radius: 20px 20px 0 0;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.prev-bar::after {
  content: ''; width: 60px; height: 6px;
  background: #222; border-radius: 4px;
}
.prev-scr {
  background: #fff; border-radius: 0 0 20px 20px; padding: 20px 14px;
  text-align: center; min-height: 260px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.prev-logo-ph {
  width: 64px; height: 64px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 12px; color: #fff;
}
.prev-logo {
  width: 64px; height: 64px; border-radius: 16px;
  object-fit: cover; margin-bottom: 12px;
}
.prev-nm {
  font-size: 15px; font-weight: 800; color: #1e293b; margin-bottom: 4px;
}
.prev-ds {
  font-size: 11px; color: #64748b; margin-bottom: 14px; line-height: 1.4;
}
.prev-bt {
  padding: 10px 24px; border-radius: 10px; border: none;
  font-size: 13px; font-weight: 700; cursor: default;
  letter-spacing: .3px;
}

/* ---- Logo upload ---- */
.logo-row {
  display: flex; gap: 16px; align-items: flex-start;
}
.logo-box {
  width: 80px; height: 80px; border-radius: 14px;
  border: 2px dashed var(--b2); background: var(--s2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--fnt); text-align: center;
  overflow: hidden; flex-shrink: 0;
}
.logo-box img { width: 100%; height: 100%; object-fit: cover; }
.logo-rgt { flex: 1; }
@media (max-width: 480px) { .logo-row { flex-direction: column; } .logo-box { width: 60px; height: 60px; } }

/* ---- Product / Reel / Bonus items ---- */
.pit, .reel-item, .bonus-item {
  padding: 12px 14px; margin-bottom: 10px;
  background: var(--s2); border: 1px solid var(--b1);
  border-radius: var(--r-sm); position: relative;
}
.pit:last-child, .reel-item:last-child, .bonus-item:last-child {
  margin-bottom: 4px;
}
.pit .fg, .reel-item .fg, .bonus-item .fg { margin-bottom: 8px; }

/* ---- Vendas type display ---- */
.vd-type { display: flex; gap: 8px; }
.vd-type-btn {
  flex: 1; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--s2); border: 2px solid var(--b1);
  text-align: center; font-size: 13px; font-weight: 600; color: var(--mut);
  transition: all .2s;
}
.vd-type-btn.active {
  border-color: var(--or); background: var(--or-l); color: var(--or);
}

/* ---- Log box (proteger) ---- */
.log-box {
  max-height: 200px; overflow-y: auto; margin-top: 12px;
  padding: 10px 12px; background: var(--s2); border: 1px solid var(--b1);
  border-radius: var(--r-sm); font-family: 'SF Mono', monospace;
  font-size: 11px; color: var(--mut); line-height: 1.7;
  display: none;
}
.log-box.sh { display: block; }

/* ---- Stats (proteger page) ---- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.stat {
  background: var(--s1); border: 1px solid var(--b1);
  border-radius: var(--r); padding: 16px; text-align: center;
  box-shadow: var(--sh-sm);
}
.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem; font-weight: 800;
  background: linear-gradient(135deg, var(--or), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ---- Scoped editor inputs (raw input/textarea/select inside cards) ---- */
.cd-b input[type="text"],
.cd-b input[type="url"],
.cd-b input[type="email"],
.cd-b input[type="password"],
.cd-b textarea,
.cd-b select {
  width: 100%; background: var(--s2); border: 1px solid var(--b1);
  border-radius: var(--r-sm); padding: 10px 12px;
  color: var(--txt); font-size: 13px; font-family: inherit;
  outline: none; transition: border-color .2s var(--ease), box-shadow .2s;
}
.cd-b input:focus, .cd-b textarea:focus, .cd-b select:focus {
  border-color: var(--or); box-shadow: 0 0 0 3px rgba(var(--or-rgb),.08);
}
.cd-b input::placeholder, .cd-b textarea::placeholder {
  color: var(--fnt);
}
.cd-b textarea { resize: vertical; min-height: 70px; }
.cd-b label {
  display: block; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--mut); margin-bottom: 4px;
}
#fileInput { display: none; }

/* ---- Show/hide modifiers ---- */
.sh { display: flex !important; }
.dg { border-color: var(--or) !important; background: var(--or-l) !important; }

/* ----------------------------------------------------------------
   32. LOGIN PAGE
   ---------------------------------------------------------------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  position: relative; z-index: 1;
  background: var(--bg-grad);
  background-attachment: fixed;
}

.login-box {
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r-xl);
  padding: 40px 36px;
  width: 100%; max-width: 400px;
  box-shadow: var(--sh-lg);
}

.login-logo {
  text-align: center; margin-bottom: 28px;
}
.login-logo .logo-ic {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin: 0 auto 14px;
  box-shadow: 0 4px 16px rgba(255,107,53,.25);
}
.login-logo h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 700; color: var(--txt);
  margin-bottom: 4px;
}
.login-logo p {
  font-size: 13px; color: var(--mut); margin: 0;
}

.login-err {
  display: none;
  background: var(--red-l);
  border: 1px solid rgba(239,68,68,.2);
  color: var(--red);
  font-size: 12px; font-weight: 500;
  padding: 10px 14px; border-radius: var(--r-sm);
  margin-bottom: 16px; text-align: center;
}
.login-err.show { display: block; }

.login-wrap .fg {
  margin-bottom: 14px;
}
.login-wrap .fg label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--txt2); margin-bottom: 5px;
}
.login-wrap .fg input {
  width: 100%;
  padding: 10px 14px;
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: var(--r-sm);
  color: var(--txt);
  font-size: 13px; font-family: inherit;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  outline: none;
}
.login-wrap .fg input:focus {
  border-color: var(--or);
  box-shadow: 0 0 0 3px rgba(var(--or-rgb), .1);
}
.login-wrap .fg input::placeholder { color: var(--fnt); }

.btn-full {
  width: 100%;
  padding: 12px 20px;
  background: var(--grad);
  color: #fff; border: none;
  border-radius: var(--r-sm);
  font-size: 14px; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s var(--ease);
  box-shadow: 0 4px 12px rgba(var(--or-rgb), .3);
}
.btn-full:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(var(--or-rgb), .4);
}

/* Login page background orbs — subtle on standalone page */
.login-wrap ~ .bg-orbs .orb,
body > .bg-orbs .orb { opacity: .04; }

@media (max-width: 480px) {
  .login-box { padding: 28px 22px; }
  .login-logo h2 { font-size: 19px; }
}

/* ----------------------------------------------------------------
   33. UTILITY CLASSES
   ---------------------------------------------------------------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--mut); }
.text-faint { color: var(--fnt); }
.text-or { color: var(--or); }
.text-grn { color: var(--grn); }
.text-red { color: var(--red); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-sm { font-size: 12px; }
.fs-xs { font-size: 11px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* ----------------------------------------------------------------
   33. GERADOR DE PAGINAS
   ---------------------------------------------------------------- */

/* Layout side-by-side */
.gerador-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  min-height: calc(100vh - 160px);
}
.gerador-panel-left {
  overflow-y: auto;
  max-height: calc(100vh - 160px);
  padding-right: 8px;
}
.gerador-panel-right {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Top bar */
.gerador-top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.gerador-back-btn {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--t2);
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
}
.gerador-back-btn:hover { background: var(--s3); color: var(--or); }
.gerador-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--t1);
  margin: 0;
}

/* Sections */
.gerador-section {
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.gerador-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--or);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gerador-hint {
  font-size: 12px;
  color: var(--t3);
  margin: 0 0 12px;
  line-height: 1.4;
}

/* Fields */
.gerador-field {
  margin-bottom: 10px;
}
.gerador-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
  margin-bottom: 4px;
}
.gerador-field label small {
  font-weight: 400;
  color: var(--t3);
}
.gerador-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--b1);
  border-radius: 8px;
  background: var(--s2);
  color: var(--t1);
  font-size: 13px;
  font-family: inherit;
  transition: border-color .2s;
  box-sizing: border-box;
}
.gerador-input:focus {
  border-color: var(--or);
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--or-rgb),.1);
}
.gerador-textarea {
  resize: vertical;
  min-height: 60px;
}
.gerador-row {
  display: flex;
  gap: 10px;
}

/* Color picker */
.gerador-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gerador-color-pick {
  width: 36px;
  height: 36px;
  border: 2px solid var(--b1);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  background: none;
}
.gerador-color-hex {
  width: 90px !important;
  font-family: 'Space Grotesk', monospace;
  font-size: 13px;
}

/* Toggle buttons */
.gerador-toggle-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gerador-toggle-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
  min-width: 50px;
}
.gerador-toggle-btns {
  display: flex;
  gap: 4px;
  background: var(--s2);
  border-radius: 8px;
  padding: 3px;
}
.gerador-toggle {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--t3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.gerador-toggle.active {
  background: var(--or);
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--or-rgb),.3);
}
.gerador-toggle:hover:not(.active) {
  color: var(--t1);
  background: var(--s3);
}

/* Buttons */
.gerador-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  width: 100%;
  justify-content: center;
}
.gerador-btn-primary {
  background: linear-gradient(135deg, var(--or), #ff8b55);
  color: #fff;
  box-shadow: 0 4px 16px rgba(var(--or-rgb),.3);
}
.gerador-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(var(--or-rgb),.4);
}
.gerador-btn-secondary {
  background: var(--s2);
  color: var(--t1);
  border: 1px solid var(--b1);
  margin-top: 8px;
}
.gerador-btn-secondary:hover { background: var(--s3); }

.gerador-btn-storm {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,.3);
  margin-top: 12px;
}
.gerador-btn-storm:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,.4);
}

.gerador-btn-sm {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--t2);
  cursor: pointer;
  font-size: 12px;
  transition: all .2s;
}
.gerador-btn-sm:hover { background: var(--s3); color: var(--or); }

.gerador-actions {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Preview device */
.gerador-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  color: var(--t2);
  padding: 0 4px;
}
.gerador-preview-device {
  width: 340px;
  height: 600px;
  background: #111;
  border-radius: 28px;
  border: 3px solid rgba(255,255,255,.1);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  position: relative;
}
.gerador-preview-notch {
  height: 24px;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gerador-preview-notch::after {
  content: '';
  width: 80px;
  height: 6px;
  background: rgba(255,255,255,.08);
  border-radius: 4px;
}
.gerador-preview-frame {
  width: 100%;
  height: calc(100% - 24px);
  border: none;
  background: #fff;
}
.gerador-preview-label {
  font-size: 11px;
  color: var(--t3);
  text-align: center;
}

/* Storm IA tone selector */
.storm-tones {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.storm-tone-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--b1);
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  background: var(--s2);
}
.storm-tone-option:hover {
  border-color: var(--or);
  background: var(--or-l);
}
.storm-tone-option.active {
  border-color: #6366f1;
  background: rgba(99,102,241,.08);
  box-shadow: 0 0 0 2px rgba(99,102,241,.15);
}
.storm-tone-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.storm-tone-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.storm-tone-info strong {
  font-size: 13px;
  color: var(--t1);
}
.storm-tone-info small {
  font-size: 11px;
  color: var(--t3);
}

/* Responsive */
@media (max-width: 1024px) {
  .gerador-layout {
    grid-template-columns: 1fr;
  }
  .gerador-panel-left {
    max-height: none;
    padding-right: 0;
  }
  .gerador-panel-right {
    position: relative;
    order: -1;
  }
  .gerador-preview-device {
    width: 280px;
    height: 480px;
  }
}
@media (max-width: 640px) {
  .gerador-preview-device {
    width: 240px;
    height: 420px;
  }
  .gerador-row {
    flex-direction: column;
    gap: 0;
  }
}

/* ----------------------------------------------------------------
   34. PRINT
   ---------------------------------------------------------------- */
@media print {
  .sidebar, .hamburger, .sidebar-overlay, .bg-orbs, #toast, .loading-overlay { display: none !important; }
  .main-content { margin: 0; padding: 20px; }
}

/* ----------------------------------------------------------------
   36. Skeleton Loaders
   ---------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--cd-bg) 25%, var(--brd) 50%, var(--cd-bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 8px;
}
.skeleton-card {
  height: 220px;
  border-radius: 12px;
}
.skeleton-stat {
  height: 80px;
  border-radius: 12px;
}
.skeleton-text {
  height: 16px;
  width: 60%;
  margin: 8px 0;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================================================================
   PREMIUM UPGRADE v4.0 — Enhanced Visual Components
   Deep navy dark · Premium glass effects · Gradient accents
   ================================================================ */

/* ── Background Orbs — more vivid & animated ── */
.orb { opacity: .05; animation: orbF 22s ease-in-out infinite; }
[data-theme="dark"] .orb { opacity: .15; }
.o1 {
  width: 800px; height: 800px;
  background: radial-gradient(circle at center, rgba(249,115,22,.8) 0%, transparent 65%);
  top: -300px; left: -200px; animation-duration: 28s;
}
.o2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle at center, rgba(168,85,247,.7) 0%, transparent 65%);
  bottom: -180px; right: -150px; animation-duration: 34s; animation-delay: -12s;
}
.o3 {
  width: 500px; height: 500px;
  background: radial-gradient(circle at center, rgba(59,130,246,.6) 0%, transparent 65%);
  top: 40%; left: 42%; animation-duration: 20s; animation-delay: -7s;
}

/* ── Sidebar — premium top accent bar ── */
.sidebar::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad); z-index: 2;
}

/* Sidebar logo icon glow */
.sidebar-logo-icon {
  background: var(--grad);
  box-shadow: 0 4px 14px rgba(249,115,22,.35);
  border-radius: 11px;
}
body.sidebar-mini .sidebar-logo-icon { box-shadow: 0 0 20px rgba(249,115,22,.3); }

/* Sidebar user block — premium */
.sidebar-user {
  background: linear-gradient(135deg, var(--s2) 0%, var(--s3) 100%);
  border: 1px solid var(--b1);
  border-radius: 12px;
  margin: 6px 12px 10px;
}
[data-theme="dark"] .sidebar-user {
  background: linear-gradient(135deg, rgba(249,115,22,.07) 0%, rgba(168,85,247,.04) 100%);
  border-color: rgba(249,115,22,.14);
}

/* Avatar gradient ring */
.sidebar-avatar {
  background: var(--grad);
  border-radius: 10px;
  box-shadow: 0 0 0 2px var(--s1), 0 0 0 4px rgba(249,115,22,.25);
}

/* Nav active — gradient pill */
.nav-link.active {
  background: linear-gradient(135deg, rgba(249,115,22,.13) 0%, rgba(234,179,8,.06) 100%);
  color: var(--or);
  font-weight: 600;
}
.nav-link.active::before {
  background: linear-gradient(180deg, var(--or), var(--gold));
  width: 3px; height: 20px;
}
[data-theme="dark"] .nav-link.active {
  background: linear-gradient(135deg, rgba(249,115,22,.18) 0%, rgba(168,85,247,.07) 100%);
}
[data-theme="dark"] .nav-link:hover:not(.active) {
  background: rgba(255,255,255,.04);
  color: var(--txt2);
}

/* Section labels — more refined */
.sidebar-section-label {
  font-size: 9.5px; letter-spacing: 1.1px;
  padding: 14px 20px 4px;
}

/* ── Theme toggle pill ── */
.sidebar-theme-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px 8px; margin-bottom: 2px;
}
.sidebar-theme-toggle > span {
  font-size: 11px; color: var(--fnt); font-weight: 600; letter-spacing: .3px;
  text-transform: uppercase;
}
.theme-toggle-pill {
  display: flex; align-items: center;
  background: var(--s3); border: 1px solid var(--b1);
  border-radius: 30px; padding: 3px; gap: 2px; cursor: pointer;
  transition: all .2s var(--ease);
}
.theme-toggle-pill:hover { border-color: var(--or); }
.theme-toggle-opt {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 26px; border-radius: 20px;
  font-size: 12px; color: var(--fnt); transition: all .2s var(--ease);
  user-select: none;
}
.theme-toggle-opt.active {
  background: var(--s1); color: var(--txt);
  box-shadow: 0 1px 6px rgba(0,0,0,.1);
}
[data-theme="dark"] .theme-toggle-opt.active {
  background: var(--s4); color: var(--txt);
  box-shadow: 0 1px 6px rgba(0,0,0,.3);
}
/* Hide old theme switch when new pill exists */
.theme-switch { display: none; }

/* ── Cards — premium glass & glow on hover ── */
.card, .stat-card, .panel-card {
  border-radius: var(--r);
  transition: all .25s var(--ease);
}
.card:hover {
  border-color: rgba(249,115,22,.18);
  box-shadow: var(--sh);
  transform: translateY(-2px);
}
.stat-card:hover {
  border-color: rgba(249,115,22,.2);
  box-shadow: var(--sh), 0 0 0 1px rgba(249,115,22,.06);
  transform: translateY(-2px);
}
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .panel-card {
  box-shadow: var(--sh-sm), inset 0 1px 0 rgba(255,255,255,.04);
}
[data-theme="dark"] .card:hover,
[data-theme="dark"] .stat-card:hover {
  border-color: rgba(249,115,22,.28);
  box-shadow: var(--sh), 0 0 24px rgba(249,115,22,.06), inset 0 1px 0 rgba(255,255,255,.06);
}

/* App cards — dark glass */
[data-theme="dark"] .app-card {
  box-shadow: var(--sh-sm), inset 0 1px 0 rgba(255,255,255,.04);
}
[data-theme="dark"] .app-card:hover {
  border-color: rgba(249,115,22,.32);
  box-shadow: var(--sh-lg), 0 0 28px rgba(249,115,22,.07);
}

/* ── Buttons — gradient primary ── */
.btn-primary {
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(249,115,22,.22);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #ea6b0c 0%, #ca8c06 100%);
  box-shadow: 0 4px 20px rgba(249,115,22,.38);
  transform: translateY(-1px);
  color: #fff;
}

/* ── Dashboard welcome — premium gradient ── */
.dash-welcome {
  border-radius: var(--r-lg);
}
[data-theme="dark"] .dash-welcome {
  background: linear-gradient(135deg,
    rgba(249,115,22,.1) 0%,
    rgba(168,85,247,.07) 50%,
    var(--s1) 100%);
  border-color: rgba(249,115,22,.18);
}

/* ── Form inputs — premium focus glow ── */
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--or);
  box-shadow: 0 0 0 3px rgba(249,115,22,.1), 0 1px 4px rgba(0,0,0,.05);
}

/* ── Stat icons — hover glow ── */
.stat-card:hover .stat-icon.orange { box-shadow: 0 4px 18px rgba(249,115,22,.22); }
.stat-card:hover .stat-icon.green  { box-shadow: 0 4px 18px rgba(34,197,94,.2); }
.stat-card:hover .stat-icon.blue   { box-shadow: 0 4px 18px rgba(59,130,246,.2); }
.stat-card:hover .stat-icon.purple { box-shadow: 0 4px 18px rgba(168,85,247,.2); }

/* ── Toast — premium pill ── */
#toast {
  border-radius: 12px; font-size: 13.5px;
  padding: 11px 20px;
}
#toast.ok  { background: var(--grn); box-shadow: 0 6px 28px rgba(34,197,94,.3); }
#toast.er  { background: var(--red); box-shadow: 0 6px 28px rgba(239,68,68,.3); }
#toast:not(.ok):not(.er) {
  background: var(--s1); color: var(--txt);
  border: 1px solid var(--b1);
  box-shadow: var(--sh-lg);
}

/* ── Scrollbar — ultra thin ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--b2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--mut); }

/* ── Table dark hover ── */
[data-theme="dark"] tr:hover td { background: rgba(255,255,255,.025); }

/* ── Page title — slightly bigger ── */
.page-title {
  font-size: 24px; letter-spacing: -.4px;
}

/* ── Quick links dashboard ── */
[data-theme="dark"] .quick-link:hover {
  border-color: rgba(249,115,22,.25);
  background: linear-gradient(135deg, rgba(249,115,22,.07) 0%, var(--s2) 100%);
}

/* ── Nav badge subtle improvements ── */
.nav-badge { font-size: 8.5px; padding: 2px 7px; border-radius: 5px; }

/* ── Sidebar bottom ── */
.sidebar-bottom { padding-bottom: 8px; }
