/* =====================================================================
   Gráfica Plus — Design tokens e componentes (fiel aos prints)
   ===================================================================== */

:root {
  --brand: #22c55e;
  --brand-600: #16a34a;
  --brand-700: #15803d;
  --brand-050: #ecfdf3;
  --brand-100: #d1fadf;

  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e5e7eb;
  --line-2: #eef1f5;

  --bg: #f3f5f8;
  --bg-soft: #f8fafc;
  --card: #ffffff;
  --field: #eef1f6;
  --field-border: #e2e8f0;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow: 0 4px 16px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.12);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1,h2,h3,h4 { margin: 0; color: var(--ink); font-weight: 700; letter-spacing: -.01em; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; cursor: pointer;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; line-height: 1;
  transition: .15s ease; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-700); }
.btn-ghost { background: #fff; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-soft { background: var(--brand-050); color: var(--brand-700); border-color: var(--brand-100); }
.btn-outline { background: transparent; color: var(--brand-700); border: 1px solid var(--brand-100); }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-pill { border-radius: var(--radius-pill); }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-lg { border-radius: var(--radius-xl); }

/* ---------- Campos ---------- */
label.field-label, .field-label {
  display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 500;
}
.input, .select, textarea.input {
  width: 100%; border: 1px solid var(--field-border); background: var(--field);
  border-radius: var(--radius); padding: 11px 14px; font-size: 14px; color: var(--ink);
  font-family: inherit; outline: none; transition: .15s;
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(34,197,94,.12);
}
.input::placeholder { color: var(--muted-2); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.help { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- Badges / pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 600; }
.badge-green { background: var(--brand-050); color: var(--brand-700); }
.badge-beta { background: #dcfce7; color: #15803d; }
.badge-trial { background: #d1fae5; color: #047857; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-red { background: #fee2e2; color: #b91c1c; }

/* ---------- Layout util ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.row { display: flex; gap: 16px; }
.col { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.between { display: flex; align-items: center; justify-content: space-between; }
.center { display: flex; align-items: center; justify-content: center; }
.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-6{margin-top:24px}
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 700; }
.text-brand { color: var(--brand-700); }

/* =====================================================================
   ADMIN — sidebar + topbar (tema claro, fiel aos prints)
   ===================================================================== */
.admin { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 8px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.brand-badge { width: 26px; height: 26px; border-radius: 7px; background: #0f172a; color: #fff; font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.sidebar-store { padding: 12px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: var(--radius-pill); background: var(--brand-050); color: var(--brand-700); font-weight: 700; display: grid; place-items: center; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.nav-group-label { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); padding: 14px 10px 6px; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--ink-soft); font-weight: 500; font-size: 13.5px; cursor: pointer; }
.nav-item:hover { background: var(--bg-soft); }
.nav-item.active { background: var(--brand-050); color: var(--brand-700); font-weight: 600; }
.nav-item .ico { width: 18px; height: 18px; opacity: .85; }
.nav-item.pink { background: #fdecef; color: #be123c; }
.nav-item.crown { background: var(--brand-050); color: var(--brand-700); }
.sidebar-foot { border-top: 1px solid var(--line-2); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
.sidebar-foot .logout { color: #e11d48; font-weight: 600; display: flex; gap: 8px; align-items: center; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 22px; }
.topbar .icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--ink-soft); }
.topbar .ver-catalogo { border: 1px solid #fed7aa; color: #c2410c; background: #fff7ed; border-radius: 9px; padding: 7px 12px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.admin-body { padding: 4px 22px 40px; }

.trial-bar { background: #d1fae5; border: 1px solid #a7f3d0; color: #047857; border-radius: var(--radius); padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin-bottom: 18px; }
.trial-bar .btn { padding: 6px 16px; }

.page-title { font-size: 22px; font-weight: 800; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* métricas (cards coloridos suaves) */
.metric { border-radius: var(--radius-lg); padding: 16px; border: 1px solid transparent; }
.metric .m-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 12px; }
.metric .m-label { font-size: 12.5px; color: var(--muted); }
.metric .m-value { font-size: 22px; font-weight: 800; margin-top: 2px; }
.metric.green { background: #ecfdf5; } .metric.green .m-ico { background: #d1fae5; color: #059669; }
.metric.amber { background: #fffbeb; } .metric.amber .m-ico { background: #fef3c7; color: #d97706; }
.metric.purple { background: #f5f3ff; } .metric.purple .m-ico { background: #ede9fe; color: #7c3aed; }
.metric.blue { background: #eff6ff; } .metric.blue .m-ico { background: #dbeafe; color: #2563eb; }
.metric.red { background: #fef2f2; } .metric.red .m-ico { background: #fee2e2; color: #dc2626; }

/* tabelas */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-2); padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-weight: 700; }
.table td { padding: 14px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.table tr:last-child td { border-bottom: 0; }

.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty .ico { color: var(--muted-2); margin-bottom: 12px; }

/* =====================================================================
   ONBOARDING — stepper
   ===================================================================== */
.onb { min-height: 100vh; background: linear-gradient(180deg,#f6faf7,#eef4f0); }
.onb-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 26px; font-size: 13px; }
.onb-top a { color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 6px; max-width: 640px; margin: 10px auto 0; }
.step-dot { width: 30px; height: 30px; border-radius: var(--radius-pill); display: grid; place-items: center; background: #e2e8f0; color: #94a3b8; flex-shrink: 0; }
.step-dot.done { background: var(--brand-600); color: #fff; }
.step-dot.current { background: #fff; color: var(--brand-700); border: 2px solid var(--brand); box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
.step-line { flex: 1; height: 3px; border-radius: 3px; background: #e2e8f0; }
.step-line.done { background: var(--brand-600); }
.onb-progress { max-width: 640px; margin: 12px auto 0; height: 4px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.onb-progress > i { display: block; height: 100%; background: var(--brand-600); }
.onb-card { max-width: 400px; margin: 30px auto; background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 34px 30px; }
.onb-card h2 { text-align: center; font-size: 20px; }
.onb-card .sub { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 4px; margin-bottom: 22px; }
.opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: #eef1f6; border: 1px solid transparent; border-radius: var(--radius); padding: 13px 16px; margin-bottom: 10px; cursor: pointer; font-size: 14px; color: var(--ink-soft); }
.opt:hover { background: #e8edf3; }
.opt.selected { background: var(--brand-050); border-color: var(--brand-100); color: var(--brand-700); font-weight: 600; }
.opt .radio { width: 16px; height: 16px; border-radius: var(--radius-pill); border: 1.5px solid #cbd5e1; }
.opt.selected .radio { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px #fff; }
.onb-foot { display: flex; align-items: center; justify-content: space-between; padding: 18px 40px 30px; }

/* =====================================================================
   TEMA ESCURO — landing + catálogo público
   ===================================================================== */
.dark { background: #0a0f0d; color: #e5e7eb; }
.dark h1,.dark h2,.dark h3 { color: #fff; }

/* =====================================================================
   Modais
   ===================================================================== */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto; }
.modal-overlay.is-open { display: flex; }
.modal { background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); width: 100%; max-width: 860px; }
.modal-sm { max-width: 560px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 24px 0; }
.modal-head h3 { font-size: 17px; }
.modal-head .sub { color: var(--muted); font-size: 13px; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px; }
.modal-body { padding: 20px 24px 24px; }
.modal-cols { display: grid; grid-template-columns: 1fr 1.2fr; gap: 22px; }
.item-card { border: 1px dashed var(--field-border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.item-num { width: 26px; height: 26px; border-radius: var(--radius-pill); background: var(--brand-050); color: var(--brand-700); font-weight: 700; display: grid; place-items: center; font-size: 12px; }
.sum-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 5px 0; }
.sum-total { font-size: 18px; font-weight: 800; color: var(--brand-700); }
.seg-toggle { display: inline-flex; background: #eef1f6; border-radius: var(--radius); padding: 4px; gap: 4px; }
.seg-toggle button { border: none; background: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg-toggle button.on { background: var(--brand-050); color: var(--brand-700); }

/* =====================================================================
   Kanban
   ===================================================================== */
.kanban { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-top: 16px; }
.kb-col { border-radius: var(--radius-lg); padding: 12px; min-height: 220px; }
.kb-col.c0 { background: #f5f3ff; } .kb-col.c1 { background: #faf5ff; } .kb-col.c2 { background: #fefce8; }
.kb-col.c3 { background: #fff7ed; } .kb-col.c4 { background: #ecfeff; } .kb-col.c5 { background: #ecfdf5; }
.kb-col.c6 { background: #f1f5f9; }
.kb-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.kb-count { background: rgba(0,0,0,.06); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.kb-card { background: #fff; border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm); margin-bottom: 10px; }
.kb-empty { text-align: center; color: var(--muted-2); font-size: 12.5px; padding: 20px 0; }

/* funil */
.funnel { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.funnel .fstep { text-align: center; color: #334155; font-size: 13px; padding: 12px; border-radius: 6px; font-weight: 600; }
.funnel .f0 { width: 100%; background: #dbeafe; }
.funnel .f1 { width: 84%; background: #d1fae5; }
.funnel .f2 { width: 68%; background: #fef9c3; }
.funnel .f3 { width: 52%; background: #ede9fe; }
.funnel .f4 { width: 38%; background: #fecdd3; }

/* toast */
.toast { position: fixed; right: 20px; bottom: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 12px 16px; display: flex; gap: 10px; align-items: center; z-index: 200; }
.toast .ic { color: var(--brand-600); }

/* tabs */
.tabs { display: inline-flex; background: #eef1f6; border-radius: var(--radius); padding: 4px; gap: 4px; margin-bottom: 16px; }
.tabs a { padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); }
.tabs a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* toolbar de filtros */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .input, .toolbar .select { max-width: 220px; }
.search-wrap { position: relative; flex: 1; min-width: 220px; }
.search-wrap .search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.search-wrap input { padding-left: 40px; }

/* =====================================================================
   Submenu, collapse, theme toggle, e componentes novos
   ===================================================================== */
.nav-sub { margin: 2px 0 6px 14px; padding-left: 8px; border-left: 1px solid var(--line-2); }
.nav-sub .nav-item { padding: 6px 8px; font-size: 12.5px; color: var(--muted); }
.nav-sub .nav-item .ico { width: 14px; height: 14px; opacity: .5; }

.sidebar-brand { position: relative; }
.collapse-btn { margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 7px; width: 24px; height: 24px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }

/* colapsada */
.admin.collapsed .sidebar { width: 64px; }
.admin.collapsed .sidebar .brand-text,
.admin.collapsed .sidebar .nav-item span:not(.ico):not(.badge),
.admin.collapsed .sidebar .nav-group-label,
.admin.collapsed .sidebar .sidebar-store > div,
.admin.collapsed .sidebar .nav-sub,
.admin.collapsed .sidebar .sidebar-foot .small,
.admin.collapsed .sidebar .logout span { display: none; }
.admin.collapsed .sidebar .collapse-btn { transform: rotate(180deg); }

.theme-toggle { width: 38px; height: 20px; border-radius: 999px; background: var(--brand-600); border: none; position: relative; cursor: pointer; }
.theme-toggle .knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
body.theme-dark .theme-toggle { background: #334155; }
body.theme-dark .theme-toggle .knob { left: 20px; }

/* tabs no topo de páginas (Estoque, Precificação) */
.subtabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line-2); margin: 16px 0; }
.subtabs a { padding: 10px 16px; font-weight: 600; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; }
.subtabs a.on { color: var(--ink); border-bottom-color: var(--brand-600); }

/* toggle switch (preferências / integrações) */
.switch { width: 44px; height: 24px; border-radius: 999px; background: #cbd5e1; border: none; position: relative; cursor: pointer; flex-shrink: 0; }
.switch.on { background: var(--brand-600); }
.switch .k { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on .k { left: 22px; }
.pref-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.pref-row:last-child { border-bottom: 0; }

/* preview do catálogo (Loja Virtual) */
.builder { display: grid; grid-template-columns: 340px 1fr; gap: 16px; }
.builder-col { max-height: calc(100vh - 160px); overflow-y: auto; padding-right: 6px; }
.preview-frame { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #0d1012; min-height: 480px; }
.preview-top { background: #22c55e; height: 8px; }
.preview-head { background: #14181a; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; color: #fff; }
.preview-body { padding: 20px; }
.preview-banner { background: #191d1f; border-radius: 12px; height: 200px; display: grid; place-items: center; color: #3a4149; }

/* estúdio IA - chips de aplicar em */
.chip-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 10px; padding: 12px 6px; text-align: center; font-size: 12px; cursor: pointer; }
.chip.on { border-color: var(--brand); background: var(--brand-050); color: var(--brand-700); }

/* cards de arquivos */
.file-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.file-thumb { height: 130px; background: linear-gradient(135deg,#0f172a,#1e293b); }
.file-body { padding: 12px; }

/* =====================================================================
   Carrossel de banners do dashboard
   ===================================================================== */
.banner-carousel { position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 118px; }
.banner-slide { display: none; padding: 20px 56px; color: #fff; min-height: 118px; }
.banner-slide.is-active { display: block; }
.banner-slide h3 { color: #fff; }
.banner-btn { position: absolute; top: 50%; right: 56px; transform: translateY(-50%); background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.banner-btn:hover { background: rgba(255,255,255,.25); }
.carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(255,255,255,.2); color: #fff; display: grid; place-items: center; cursor: pointer; }
.carousel-arrow.left { left: 12px; }
.carousel-arrow.right { right: 12px; }
.carousel-arrow.right svg { transform: rotate(180deg); }
.carousel-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 3; }
.carousel-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.4); cursor: pointer; }
.carousel-dots i.on { background: #fff; width: 18px; border-radius: 4px; }
