/* ============================================================
   RESET
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, sans-serif; }
html, body { max-width: 100%; overflow-x: hidden; }
body { background: #f4f6fb; color: #1e2430; -webkit-font-smoothing: antialiased; }
input, textarea, select, button { font: inherit; }
a { color: inherit; }
img { max-width: 100%; display: block; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 20% 20%, #ffe0d0 0%, transparent 40%), radial-gradient(circle at 80% 80%, #d9e7ff 0%, transparent 40%), #f4f6fb; }
.login { width: 100%; max-width: 380px; background: #fff; padding: 36px 30px; border-radius: 18px; box-shadow: 0 20px 50px rgba(30,36,48,.12); text-align: center; }
.login .lock { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 16px; background: linear-gradient(135deg, #ff5722, #ff9057); color: #fff; display: grid; place-items: center; font-size: 24px; box-shadow: 0 8px 20px rgba(255,87,34,.3); }
.login h1 { font-size: 22px; margin-bottom: 6px; letter-spacing: -.5px; }
.login p.sub { color: #6b7280; font-size: 14px; margin-bottom: 24px; }
.login input { width: 100%; padding: 14px; border: 1.5px solid #e4e8ef; border-radius: 10px; margin-bottom: 14px; transition: .2s; font-size: 15px; }
.login input:focus { outline: none; border-color: #ff5722; box-shadow: 0 0 0 3px rgba(255,87,34,.15); }
.btn-login { width: 100%; padding: 14px; background: linear-gradient(135deg, #ff5722, #ff7b3d); color: #fff; border: 0; border-radius: 10px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 12px rgba(255,87,34,.3); transition: .2s; font-size: 15px; }
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255,87,34,.4); }
.err { color: #e53935; font-size: 13px; margin-top: 10px; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app { display: none; min-height: 100vh; }
.app.on { display: block; }

.mobile-bar { display: none; position: fixed; top: 0; left: 0; right: 0; height: 60px; background: #fff; border-bottom: 1px solid #e8ecf3; align-items: center; padding: 0 16px; z-index: 1000; box-shadow: 0 2px 8px rgba(30,36,48,.04); }
.mobile-bar .toggle { background: transparent; border: 0; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; color: #4a5260; cursor: pointer; transition: .15s; }
.mobile-bar .toggle:hover { background: #f4f6fb; }
.mobile-bar .title { flex: 1; text-align: center; font-weight: 800; font-size: 15px; color: #1e2430; }
.mobile-bar .brand-mini { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #ff5722, #ff9057); display: grid; place-items: center; color: #fff; font-size: 16px; }

.overlay { display: none; position: fixed; inset: 0; background: rgba(20,15,12,.55); z-index: 999; backdrop-filter: blur(2px); opacity: 0; transition: opacity .25s; }
.overlay.show { display: block; opacity: 1; }

.sidebar { background: #fff; border-right: 1px solid #e8ecf3; padding: 24px 16px; display: flex; flex-direction: column; gap: 20px; position: fixed; top: 0; left: 0; width: 260px; height: 100vh; z-index: 1001; transition: transform .28s cubic-bezier(.4,0,.2,1); overflow-y: auto; }
.sidebar .side-close { display: none; position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 10px; border: 0; background: #f4f6fb; color: #4a5260; font-size: 16px; cursor: pointer; transition: .15s; }
.sidebar .side-close:hover { background: #e2e6ee; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 16px; border-bottom: 1px solid #eef1f6; }
.brand .dot { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #ff5722, #ff9057); display: grid; place-items: center; color: #fff; font-size: 18px; box-shadow: 0 6px 14px rgba(255,87,34,.25); flex-shrink: 0; }
.brand b { font-size: 16px; }
.brand small { display: block; color: #9aa3b2; font-size: 12px; font-weight: 500; }
.menu { display: flex; flex-direction: column; gap: 4px; }
.menu button { display: flex; align-items: center; gap: 12px; background: transparent; border: 0; padding: 12px; border-radius: 10px; cursor: pointer; color: #4a5260; font-weight: 600; font-size: 14px; text-align: left; transition: .15s; width: 100%; }
.menu button i { width: 18px; text-align: center; flex-shrink: 0; }
.menu button:hover { background: #f4f6fb; color: #1e2430; }
.menu button.active { background: linear-gradient(135deg, #fff1eb, #ffe4d5); color: #ff5722; }
.menu button .badge-n { margin-left: auto; background: #ff5722; color: #fff; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 20px; min-width: 22px; text-align: center; }
.menu button.active .badge-n { background: #fff; color: #ff5722; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px solid #eef1f6; }
.side-foot a, .side-foot button { padding: 12px; border-radius: 10px; text-align: center; font-size: 13px; font-weight: 600; text-decoration: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.side-foot a { background: #eef4ff; color: #2d5cff; }
.side-foot button { background: #fdecea; color: #c62828; }

.main { margin-left: 260px; padding: 28px 32px 60px; min-height: 100vh; }
.main h1 { font-size: 24px; margin-bottom: 4px; }
.main .lead { color: #7a8496; font-size: 14px; margin-bottom: 24px; }
.panel { display: none; }
.panel.on { display: block; animation: fadeUp .25s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card { background: #fff; border-radius: 16px; padding: 22px; box-shadow: 0 1px 2px rgba(30,36,48,.04), 0 8px 24px rgba(30,36,48,.05); margin-bottom: 20px; }
.card h3 { font-size: 15px; margin-bottom: 14px; color: #1e2430; display: flex; align-items: center; gap: 8px; }
.card h3 i { color: #ff5722; }

label { font-size: 12.5px; font-weight: 600; color: #4a5260; display: block; margin: 10px 0 6px; }
input, textarea, select { width: 100%; padding: 11px 12px; border: 1.5px solid #e4e8ef; border-radius: 10px; background: #fbfcfe; transition: .18s; font-size: 14px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #ff5722; background: #fff; box-shadow: 0 0 0 3px rgba(255,87,34,.12); }
textarea { resize: vertical; font-family: inherit; }
button { cursor: pointer; font-weight: 600; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: 10px; font-size: 14px; transition: .18s; }
.btn.primary { background: linear-gradient(135deg, #ff5722, #ff7b3d); color: #fff; box-shadow: 0 4px 12px rgba(255,87,34,.28); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255,87,34,.4); }
.btn.ghost { background: #eef1f6; color: #4a5260; }
.btn.ghost:hover { background: #e2e6ee; }
.btn.danger { background: #fdecea; color: #c62828; }
.btn.danger:hover { background: #f9d7d3; }
.btn.sm { padding: 8px 12px; font-size: 13px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.color-field { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1.5px solid #e4e8ef; border-radius: 10px; background: #fbfcfe; }
.color-field input[type=color] { width: 40px; height: 34px; padding: 0; border: 0; background: none; cursor: pointer; flex-shrink: 0; }
.color-field .val { font-size: 12px; color: #7a8496; font-family: ui-monospace, monospace; }

.upload-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px; background: #f8fafd; border: 1.5px dashed #d8dee9; border-radius: 12px; }
.upload-box img { max-height: 60px; max-width: 180px; border-radius: 8px; }
.upload-box .info { flex: 1; min-width: 180px; color: #6b7280; font-size: 13px; }
.upload-box .thumb-fake { width: 64px; height: 64px; background: #eef1f6; border-radius: 12px; display: grid; place-items: center; font-size: 22px; color: #9aa3b2; }
.upload-box.favicon img { max-height: 48px; max-width: 48px; border-radius: 8px; }
.upload-box.favicon .thumb-fake { width: 48px; height: 48px; font-size: 20px; }
.upload-box.og img { max-height: 90px; max-width: 200px; border-radius: 8px; }
.upload-box.og .thumb-fake { width: 120px; height: 64px; font-size: 22px; }

.banner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.banner-item { position: relative; padding-top: 56.25%; border-radius: 12px; overflow: hidden; background: #eef1f6; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.banner-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-item .rm { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.72); color: #fff; border: 0; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 13px; display: grid; place-items: center; }
.banner-item .tag { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,.72); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px; }
.banner-item .tag.new { background: #2e7d32; }

/* ============================================================
   ICON PICKER
   ============================================================ */
.icon-picker { position: relative; }
.icon-picker .trigger { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px solid #e4e8ef; border-radius: 10px; background: #fbfcfe; cursor: pointer; transition: .18s; user-select: none; }
.icon-picker .trigger:hover { border-color: #d8dee9; }
.icon-picker .trigger.open { border-color: #ff5722; background: #fff; box-shadow: 0 0 0 3px rgba(255,87,34,.12); }
.icon-picker .trigger .preview { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #fff1eb, #ffe4d5); color: #ff5722; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.icon-picker .trigger .text { flex: 1; min-width: 0; }
.icon-picker .trigger .text .lbl { font-size: 11.5px; color: #9aa3b2; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.icon-picker .trigger .text .val { font-size: 14px; color: #1e2430; font-weight: 600; font-family: ui-monospace, monospace; }
.icon-picker .trigger .caret { color: #9aa3b2; font-size: 14px; }

.icon-picker-panel { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border-radius: 14px; box-shadow: 0 20px 50px rgba(30,36,48,.18); border: 1px solid #eef1f6; z-index: 100; overflow: hidden; display: none; }
.icon-picker-panel.open { display: block; animation: fadeUp .18s; }
.icon-picker-panel .head { padding: 12px; border-bottom: 1px solid #eef1f6; display: flex; gap: 10px; align-items: center; background: #f8fafd; }
.icon-picker-panel .head .search-wrap { position: relative; flex: 1; }
.icon-picker-panel .head .search-wrap i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9aa3b2; font-size: 13px; }
.icon-picker-panel .head input { padding: 10px 12px 10px 36px; border-radius: 10px; background: #fff; }
.icon-picker-panel .head .close-btn { background: #eef1f6; border: 0; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; color: #4a5260; transition: .15s; display: grid; place-items: center; }
.icon-picker-panel .head .close-btn:hover { background: #e2e6ee; }
.icon-picker-panel .cats-bar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid #eef1f6; overflow-x: auto; background: #fff; }
.icon-picker-panel .cats-bar button { padding: 6px 12px; border-radius: 20px; background: #f4f6fb; color: #4a5260; border: 0; font-size: 12.5px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; transition: .15s; }
.icon-picker-panel .cats-bar button:hover { background: #e2e6ee; }
.icon-picker-panel .cats-bar button.active { background: linear-gradient(135deg, #ff5722, #ff7b3d); color: #fff; }
.icon-picker-panel .list { max-height: 340px; overflow-y: auto; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.icon-item { aspect-ratio: 1; border-radius: 10px; background: #f8fafd; border: 1.5px solid transparent; color: #4a5260; font-size: 20px; cursor: pointer; display: grid; place-items: center; transition: .15s; position: relative; }
.icon-item:hover { background: #fff1eb; color: #ff5722; border-color: #ff5722; transform: translateY(-2px); }
.icon-item.on { background: linear-gradient(135deg, #ff5722, #ff7b3d); color: #fff; }
.icon-item .tip { position: absolute; bottom: -26px; left: 50%; transform: translateX(-50%); background: #1e2430; color: #fff; font-size: 10.5px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: .15s; z-index: 5; }
.icon-item:hover .tip { opacity: 1; bottom: -30px; }
.icon-picker-panel .empty { grid-column: 1/-1; padding: 40px 20px; text-align: center; color: #9aa3b2; font-size: 13.5px; }
.icon-picker-panel .empty i { font-size: 28px; display: block; margin-bottom: 8px; opacity: .5; }

/* ============================================================
   PLATAFORMAS
   ============================================================ */
.plat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.plat-item { background: #fff; border: 1.5px solid #eef1f6; border-radius: 12px; padding: 14px; transition: .15s; }
.plat-item:hover { border-color: #d8dee9; }
.plat-item .top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.plat-item .icone-preview { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: #f4f6fb; }
.plat-item .nome { font-weight: 700; font-size: 14.5px; }
.plat-item .id-slug { font-size: 11.5px; color: #9aa3b2; font-family: ui-monospace, monospace; }
.plat-item .cores-mini { display: flex; gap: 6px; margin-top: 6px; }
.plat-item .cor-chip { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid rgba(0,0,0,.08); }
.plat-item .actions { margin-top: 10px; display: flex; gap: 6px; }

/* ============================================================
   SUBTABS / UPLOAD DE IMAGEM
   ============================================================ */
.subtabs { display: inline-flex; background: #eef1f6; padding: 4px; border-radius: 10px; gap: 2px; margin-bottom: 12px; }
.subtabs button { background: transparent; border: 0; padding: 8px 14px; border-radius: 8px; font-size: 13px; color: #4a5260; transition: .18s; display: inline-flex; align-items: center; gap: 6px; }
.subtabs button.active { background: #fff; color: #ff5722; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.upload-tab, .link-tab { display: none; }
.upload-tab.active, .link-tab.active { display: block; }
.drop-zone { border: 2px dashed #d8dee9; border-radius: 12px; padding: 22px; text-align: center; color: #7a8496; cursor: pointer; transition: .2s; background: #fbfcfe; }
.drop-zone:hover, .drop-zone.drag { border-color: #ff5722; background: #fff6f2; color: #ff5722; }
.drop-zone input { display: none; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 12px; }
.img-item { position: relative; padding-top: 100%; border-radius: 12px; overflow: hidden; background: #eef1f6; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.img-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.img-item .rm { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.72); color: #fff; border: 0; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 12px; display: grid; place-items: center; }
.img-item .tag { position: absolute; bottom: 6px; left: 6px; background: rgba(0,0,0,.72); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px; }
.img-item .tag.new { background: #2e7d32; }
.img-item .pos { position: absolute; top: 6px; left: 6px; background: #ff5722; color: #fff; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; }

.video-preview { border: 1.5px solid #eef1f6; border-radius: 12px; padding: 12px; background: #f8fafd; display: flex; align-items: center; gap: 12px; font-size: 13px; color: #4a5260; }
.video-preview video { width: 120px; height: 70px; border-radius: 8px; background: #000; object-fit: cover; }
.video-preview .info-v { flex: 1; min-width: 0; }
.video-preview .info-v b { display: block; color: #1e2430; margin-bottom: 2px; }
.video-preview .info-v small { color: #7a8496; word-break: break-all; }

/* ============================================================
   LISTA DE PRODUTOS EM CARDS (thumb + info)
   ============================================================ */
.prods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 14px;
}
@media (max-width: 900px) {
  .prods-grid { grid-template-columns: 1fr; }
}

.prod-card-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  background: #fff;
  border: 1.5px solid #eef1f6;
  border-radius: 14px;
  padding: 12px;
  transition: .18s;
  position: relative;
}
.prod-card-item:hover {
  border-color: #d8dee9;
  box-shadow: 0 8px 22px rgba(30,36,48,.06);
  transform: translateY(-2px);
}

.prod-card-item .thumb-col {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #f4f6fb, #eef1f6);
  flex-shrink: 0;
  border: 1px solid #eef1f6;
}
.prod-card-item .thumb-col img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-card-item .thumb-col .no-img { width: 100%; height: 100%; display: grid; place-items: center; color: #b0b8c4; font-size: 32px; }
.prod-card-item .thumb-col .badge-video {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0,0,0,.75); color: #fff;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px;
}
.prod-card-item .thumb-col .badge-destaque {
  position: absolute; top: 6px; left: 6px;
  background: linear-gradient(135deg, #ffb300, #ff8f00);
  color: #fff; padding: 3px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; gap: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.prod-card-item .thumb-col .badge-desc {
  position: absolute; top: 6px; right: 6px;
  background: #d63384; color: #fff;
  padding: 3px 7px; border-radius: 20px;
  font-size: 10px; font-weight: 800; letter-spacing: .3px;
}

.prod-card-item .info-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.prod-card-item .info-col .titulo {
  font-size: 14px;
  font-weight: 700;
  color: #1e2430;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 2px;
}
.prod-card-item .info-col .pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.prod-card-item .info-col .acoes {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}
.prod-card-item .info-col .acoes .btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 12.5px;
}
.prod-card-item .info-col .acoes .btn.icon-only {
  flex: 0 0 auto;
  padding: 8px 12px;
}

@media (max-width: 480px) {
  .prod-card-item {
    grid-template-columns: 90px 1fr;
    gap: 10px;
    padding: 10px;
  }
  .prod-card-item .info-col .titulo { font-size: 13px; }
}

/* ============================================================
   PILLS / LIST-ITEM
   ============================================================ */
.list-item { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; transition: .15s; border: 1px solid transparent; }
.list-item:hover { background: #f8fafd; border-color: #eef1f6; }
.list-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.list-item .meta { flex: 1; min-width: 0; }
.list-item .meta b { display: block; font-size: 14px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .meta small { color: #8a93a5; font-size: 12.5px; display: flex; gap: 6px; flex-wrap: wrap; }
.pill { background: #eef1f6; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.pill.green { background: #e7f6ea; color: #2e7d32; }
.pill.pink { background: #fde9ee; color: #c2185b; }
.pill.gold { background: #fff4d6; color: #b26a00; }
.pill.blue { background: #eef4ff; color: #2d5cff; }
.pill.purple { background: #f3e9ff; color: #7b2ff7; }
.pill.dark { background: #1e2430; color: #fff; }
.actions { display: flex; gap: 6px; flex-shrink: 0; }
.empty { text-align: center; padding: 40px 20px; color: #9aa3b2; font-size: 14px; }
.empty i { font-size: 34px; display: block; margin-bottom: 10px; opacity: .5; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; padding: 11px 14px; border-radius: 10px; background: #fbfcfe; border: 1.5px solid #e4e8ef; transition: .18s; }
.switch:hover { border-color: #d8dee9; }
.switch input { display: none; }
.switch .track { width: 44px; height: 24px; background: #cbd3e0; border-radius: 20px; position: relative; transition: .2s; flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .track { background: linear-gradient(135deg, #ffb300, #ff8f00); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch .lbl { font-size: 13.5px; font-weight: 600; color: #4a5260; }
.switch input:checked ~ .lbl { color: #b26a00; }

.toggles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}
.toggles-row .switch {
  flex: 1;
  min-width: 240px;
  max-width: 320px;
}

.desc-preview { display: inline-flex; align-items: center; gap: 8px; background: #e7f6ea; color: #2e7d32; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 13px; margin-top: 8px; }
.desc-preview.none { background: #eef1f6; color: #7a8496; }

.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 32px); }
.toast { background: #fff; padding: 14px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(30,36,48,.15); border-left: 4px solid #2e7d32; min-width: 260px; animation: slideIn .25s; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.toast i { font-size: 16px; }
.toast.ok { border-left-color: #2e7d32; } .toast.ok i { color: #2e7d32; }
.toast.err { border-left-color: #e53935; } .toast.err i { color: #e53935; }
.toast.warn { border-left-color: #f9a825; } .toast.warn i { color: #f9a825; }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ============================================================
   STATS
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; padding: 18px; border-radius: 14px; box-shadow: 0 1px 2px rgba(30,36,48,.04), 0 8px 24px rgba(30,36,48,.05); display: flex; align-items: center; gap: 14px; }
.stat .icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.stat.a .icon { background: #fff1eb; color: #ff5722; }
.stat.b .icon { background: #eef4ff; color: #2d5cff; }
.stat.c .icon { background: #e7f6ea; color: #2e7d32; }
.stat.d .icon { background: #fff4d6; color: #b26a00; }
.stat.e .icon { background: #f3e9ff; color: #7b2ff7; }
.stat.f .icon { background: #fde9ee; color: #c2185b; }
.stat .n { font-size: 22px; font-weight: 800; line-height: 1; }
.stat .l { color: #7a8496; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }

/* ============================================================
   FILTROS / RANKING / TABELA
   ============================================================ */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters button { background: #eef1f6; color: #4a5260; border: 0; padding: 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; transition: .15s; display: inline-flex; align-items: center; gap: 6px; }
.filters button:hover { background: #e2e6ee; }
.filters button.active { background: linear-gradient(135deg, #ff5722, #ff7b3d); color: #fff; }

.rank-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; transition: .15s; }
.rank-row:hover { background: #f8fafd; }
.rank-pos { width: 32px; height: 32px; border-radius: 10px; background: #eef1f6; color: #4a5260; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.rank-pos.p1 { background: linear-gradient(135deg, #ffd54f, #ffb300); color: #fff; }
.rank-pos.p2 { background: linear-gradient(135deg, #e0e0e0, #bdbdbd); color: #fff; }
.rank-pos.p3 { background: linear-gradient(135deg, #ffb27a, #e08a4a); color: #fff; }
.rank-row img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.rank-row .meta { flex: 1; min-width: 0; }
.rank-row .meta b { display: block; font-size: 13.5px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row .meta small { color: #8a93a5; font-size: 12px; display:flex; gap:8px; flex-wrap:wrap; }
.rank-row .count { font-size: 22px; font-weight: 800; color: #ff5722; text-align: right; flex-shrink: 0; }
.rank-row .count small { display: block; font-size: 10.5px; color: #9aa3b2; font-weight: 700; text-transform: uppercase; }
.bar { height: 6px; background: #eef1f6; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar > div { height: 100%; background: linear-gradient(90deg, #ff5722, #ff9057); border-radius: 4px; transition: width .4s; }

.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid #eef1f6; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
thead { background: #f8fafd; }
thead th { text-align: left; padding: 11px 14px; font-size: 11.5px; font-weight: 800; color: #7a8496; text-transform: uppercase; border-bottom: 1px solid #eef1f6; white-space: nowrap; }
tbody td { padding: 11px 14px; border-bottom: 1px solid #f4f6fb; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfe; }
tbody td.mono { font-family: ui-monospace, monospace; font-size: 12px; color: #7a8496; }
.tag-origem { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.tag-origem.card { background: #eef4ff; color: #2d5cff; }
.tag-origem.modal { background: #f3e9ff; color: #7b2ff7; }
.tag-origem.galeria { background: #e7f6ea; color: #2e7d32; }
.tag-tipo { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.tag-tipo.visualizacao { background: #e7f6ea; color: #2e7d32; }
.tag-tipo.compra { background: #fde9ee; color: #c2185b; }

/* ============================================================
   IMPORTAR
   ============================================================ */
.import-help { background: linear-gradient(135deg, #eef4ff, #e6efff); border-radius: 14px; padding: 16px 18px; border-left: 4px solid #2d5cff; font-size: 13.5px; color: #2a3c66; line-height: 1.6; margin-bottom: 16px; }
.import-help b { color: #1a2640; }
.import-help code { background: rgba(45, 92, 255, .1); padding: 2px 6px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 12.5px; color: #1a3a8e; }
.import-drop { border: 2.5px dashed #d8dee9; border-radius: 14px; padding: 34px 20px; text-align: center; color: #7a8496; cursor: pointer; transition: .22s; background: #fbfcfe; }
.import-drop:hover, .import-drop.drag { border-color: #ff5722; background: #fff6f2; color: #ff5722; }
.import-drop .ic { width: 70px; height: 70px; margin: 0 auto 12px; border-radius: 18px; background: linear-gradient(135deg, #fff1eb, #ffe4d5); display: grid; place-items: center; font-size: 30px; color: #ff5722; }
.import-drop b { display: block; font-size: 16px; margin-bottom: 4px; color: #1e2430; }
.import-drop small { font-size: 12.5px; }
.import-drop input { display: none; }
.import-drop .file-name { margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; background: #e7f6ea; color: #2e7d32; border-radius: 10px; font-weight: 700; font-size: 13px; }
.import-preview-table { overflow-x: auto; border: 1px solid #eef1f6; border-radius: 12px; margin-top: 14px; -webkit-overflow-scrolling: touch; }
.import-preview-table table { min-width: 900px; font-size: 12.5px; }
.import-preview-table tbody td { padding: 9px 12px; }
.import-preview-table img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; background: #eef1f6; }
.import-preview-table .row-ok { background: #f5fbf6; }
.import-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 18px; border-top: 1px solid #eef1f6; }
.import-resumo { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding: 14px 16px; background: #f8fafd; border-radius: 12px; font-size: 13px; }
.import-resumo .it { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.import-resumo .it i { color: #ff5722; }

/* ============================================================
   PÁGINAS
   ============================================================ */
.pagina-item { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1.5px solid #eef1f6; border-radius: 12px; transition: .15s; margin-bottom: 10px; }
.pagina-item:hover { border-color: #d8dee9; background: #f8fafd; }
.pagina-item .icone { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, #fff1eb, #ffe4d5); color: #ff5722; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.pagina-item .meta { flex: 1; min-width: 0; }
.pagina-item .meta b { display: block; font-size: 14.5px; margin-bottom: 3px; color: #1e2430; }
.pagina-item .meta small { color: #8a93a5; font-size: 12.5px; font-family: ui-monospace, monospace; }
.pagina-item .acoes { display: flex; gap: 6px; flex-shrink: 0; }
.pagina-item .flag {
  background: #e7f6ea; color: #2e7d32;
  font-size: 11px; font-weight: 800;
  padding: 3px 9px; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 6px;
}
.pagina-item .flag.flag-rodape {
  background: #eef4ff; color: #2d5cff;
}

/* ============================================================
   WYSIWYG EDITOR
   ============================================================ */
.wysiwyg-wrap { border: 1.5px solid #e4e8ef; border-radius: 12px; overflow: hidden; background: #fff; transition: .18s; }
.wysiwyg-wrap:focus-within { border-color: #ff5722; box-shadow: 0 0 0 3px rgba(255,87,34,.12); }
.wysiwyg-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px; background: #f8fafd; border-bottom: 1px solid #eef1f6; }
.wysiwyg-toolbar button { background: transparent; border: 0; width: 34px; height: 34px; border-radius: 8px; color: #4a5260; cursor: pointer; transition: .15s; display: grid; place-items: center; font-size: 14px; }
.wysiwyg-toolbar button:hover { background: #eef1f6; color: #1e2430; }
.wysiwyg-toolbar button.active { background: #fff1eb; color: #ff5722; }
.wysiwyg-toolbar .sep { width: 1px; background: #e4e8ef; margin: 6px 4px; }
.wysiwyg-editor { min-height: 260px; max-height: 520px; overflow-y: auto; padding: 16px 18px; font-size: 14.5px; line-height: 1.7; color: #1e2430; outline: none; }
.wysiwyg-editor:empty::before { content: attr(data-placeholder); color: #9aa3b2; }
.wysiwyg-editor h1 { font-size: 26px; margin: 16px 0 10px; }
.wysiwyg-editor h2 { font-size: 22px; margin: 14px 0 8px; }
.wysiwyg-editor h3 { font-size: 18px; margin: 12px 0 6px; }
.wysiwyg-editor p { margin: 10px 0; }
.wysiwyg-editor ul, .wysiwyg-editor ol { padding-left: 22px; margin: 10px 0; }
.wysiwyg-editor li { margin: 5px 0; }
.wysiwyg-editor a { color: #ff5722; text-decoration: underline; }
.wysiwyg-editor img { max-width: 100%; height: auto; border-radius: 10px; margin: 10px 0; display: block; cursor: pointer; transition: outline .15s; }
.wysiwyg-editor img:hover { outline: 2px dashed rgba(255,87,34,.4); outline-offset: 2px; }
.wysiwyg-editor img.img-selecionada { outline: 3px solid #ff5722; outline-offset: 3px; }
.wysiwyg-editor blockquote { border-left: 4px solid #ff5722; padding-left: 14px; margin: 12px 0; color: #6b625a; font-style: italic; }
.wysiwyg-editor code { background: #f4f6fb; padding: 2px 6px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 13.5px; }
.wysiwyg-editor hr { border: 0; height: 1px; background: #eee; margin: 18px 0; }
.wysiwyg-editor table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13.5px; }
.wysiwyg-editor table th, .wysiwyg-editor table td { padding: 8px 10px; border: 1px solid #eee; text-align: left; }
.wysiwyg-editor table th { background: #f8fafd; font-weight: 700; }

.slug-preview { font-size: 12px; color: #9aa3b2; margin-top: 6px; }
.slug-preview code { background: #f4f6fb; padding: 3px 8px; border-radius: 6px; color: #ff5722; font-family: ui-monospace, monospace; font-weight: 700; }

/* ============================================================
   AÇÕES DA IMAGEM (WYSIWYG)
   ============================================================ */
.img-actions { position: absolute; display: none; background: #1e2430; border-radius: 12px; padding: 8px; gap: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.25); z-index: 9999; align-items: center; }
.img-actions.show { display: flex; }
.img-actions button { background: rgba(255,255,255,.08); border: 0; width: 36px; height: 36px; border-radius: 8px; color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 14px; transition: .15s; }
.img-actions button:hover { background: rgba(255,255,255,.2); }
.img-actions button.danger:hover { background: #e53935; }
.img-actions .divider { width: 1px; height: 24px; background: rgba(255,255,255,.15); margin: 0 4px; }
.img-actions .size-display { color: #fff; font-size: 12px; font-weight: 700; padding: 0 8px; font-family: ui-monospace, monospace; }

/* ============================================================
   MODAL DE IMAGEM (editor)
   ============================================================ */
.modal-img-bg { display: none; position: fixed; inset: 0; background: rgba(20,15,12,.6); z-index: 10000; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(4px); }
.modal-img-bg.open { display: flex; }
.modal-img { background: #fff; border-radius: 16px; padding: 22px; max-width: 480px; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: fadeUp .2s; }
.modal-img h4 { font-size: 16px; margin-bottom: 14px; color: #1e2430; display: flex; align-items: center; gap: 8px; }
.modal-img h4 i { color: #ff5722; }
.modal-img .tabs-mini { display: inline-flex; background: #eef1f6; padding: 4px; border-radius: 10px; gap: 2px; margin-bottom: 12px; }
.modal-img .tabs-mini button { background: transparent; border: 0; padding: 8px 14px; border-radius: 8px; font-size: 13px; color: #4a5260; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: .15s; }
.modal-img .tabs-mini button.active { background: #fff; color: #ff5722; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.modal-img .tab-content { display: none; }
.modal-img .tab-content.active { display: block; }
.modal-img .drop-mini { border: 2px dashed #d8dee9; border-radius: 12px; padding: 22px; text-align: center; color: #7a8496; cursor: pointer; transition: .18s; background: #fbfcfe; }
.modal-img .drop-mini:hover { border-color: #ff5722; background: #fff6f2; color: #ff5722; }
.modal-img .drop-mini .ic { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 14px; background: linear-gradient(135deg, #fff1eb, #ffe4d5); color: #ff5722; display: grid; place-items: center; font-size: 22px; }
.modal-img .drop-mini input { display: none; }
.modal-img .preview-img { margin-top: 12px; border-radius: 10px; overflow: hidden; display: none; max-height: 200px; }
.modal-img .preview-img.show { display: block; }
.modal-img .preview-img img { width: 100%; height: auto; display: block; }
.modal-img .actions-modal { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal-img input[type="text"] { padding: 11px 12px; border: 1.5px solid #e4e8ef; border-radius: 10px; font-size: 14px; }

/* ============================================================
   FORMULÁRIO DE PRODUTO EM 2 COLUNAS
   ============================================================ */
.prod-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 24px;
  align-items: start;
}
.prod-col-img { position: sticky; top: 20px; }
.prod-col-info { min-width: 0; }

.prod-col-img .imgs-area {
  background: #f8fafd;
  border: 1.5px dashed #d8dee9;
  border-radius: 14px;
  padding: 16px;
}
.prod-col-img .imgs-area .titulo-secao {
  font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; color: #7a8496; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.prod-col-img .imgs-area .titulo-secao i { color: #ff5722; }
.prod-col-img .img-grid { margin-top: 0; }

.prod-col-img .video-area {
  margin-top: 20px; padding-top: 20px;
  border-top: 1px solid #eef1f6;
}

.prod-col-info .bloco {
  padding-bottom: 16px; margin-bottom: 16px;
  border-bottom: 1px solid #eef1f6;
}
.prod-col-info .bloco:last-child {
  border-bottom: 0; padding-bottom: 0; margin-bottom: 0;
}
.prod-col-info .bloco .titulo-bloco {
  font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; color: #7a8496; margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.prod-col-info .bloco .titulo-bloco i { color: #ff5722; }

@media (max-width: 900px) {
  .prod-grid { grid-template-columns: 1fr; gap: 18px; }
  .prod-col-img { position: static; }
}

/* ============================================================
   RESPONSIVO GERAL — MOBILE FIRST
   ============================================================ */
@media (max-width: 1100px) {
  .main { padding: 24px 22px 60px; }
  .row-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .mobile-bar { display: flex; }
  .sidebar { transform: translateX(-100%); box-shadow: 6px 0 30px rgba(30,36,48,.15); }
  .sidebar.open { transform: translateX(0); }
  .sidebar .side-close { display: grid; place-items: center; }
  .main { margin-left: 0; padding: 84px 18px 60px; }
  .row, .row-3 { grid-template-columns: 1fr; }
  .banner-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .plat-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .main h1 { font-size: 20px; }
  .card { padding: 16px; border-radius: 14px; margin-bottom: 14px; }
  .stat { padding: 14px; gap: 10px; }
  .stat .icon { width: 40px; height: 40px; font-size: 16px; }
  .stat .n { font-size: 18px; }
  .btn { padding: 11px 14px; font-size: 13.5px; }
  .toast-wrap { top: 72px; right: 12px; left: 12px; }
  .list-item { flex-wrap: wrap; padding: 10px; }
  .list-item .meta { flex-basis: 100%; }
  .rank-row { padding: 10px; gap: 10px; }
  .rank-row img { width: 40px; height: 40px; }
  .rank-row .count { font-size: 18px; }
  .img-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .import-drop { padding: 24px 14px; }
  .import-actions { flex-direction: column; }
  .import-actions .btn { width: 100%; }
  .wysiwyg-toolbar button { width: 30px; height: 30px; font-size: 13px; }
  .wysiwyg-editor { padding: 12px; min-height: 200px; }
  .toggles-row { flex-direction: column; }
  .toggles-row .switch { max-width: 100%; }
}
@media (max-width: 400px) {
  .main { padding: 80px 14px 60px; }
  .main h1 { font-size: 18px; }
  .card { padding: 14px; }
  .stat .n { font-size: 16px; }
  .img-grid { grid-template-columns: repeat(2, 1fr); }
}

.to-top { position: fixed; bottom: 20px; right: 20px; width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, #ff5722, #ff7b3d); color: #fff; border: 0; font-size: 16px; box-shadow: 0 6px 20px rgba(255,87,34,.4); cursor: pointer; display: none; z-index: 900; place-items: center; }
.to-top.show { display: grid; }

/* ============================================================
   LOGIN — BLOCO DE ERRO
   ============================================================ */
.login-erro {
  background: #fdecea;
  color: #c62828;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 3px solid #c62828;
}
.login-erro i { flex-shrink: 0; }

/* Botão de sair como link */
.side-foot a[href*="logout"] {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ============================================================
   AJUSTE RESPONSIVO — LISTA DE CATEGORIAS
   ============================================================ */
@media (max-width: 600px) {
  #catsList .list-item {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 10px;
  }
  #catsList .list-item > div:first-child {
    width: 44px !important;
    height: 44px !important;
    font-size: 18px !important;
  }
  #catsList .list-item .meta {
    flex: 1;
    min-width: 0;
  }
  #catsList .list-item .actions {
    flex-shrink: 0;
    margin-left: auto;
  }
  #catsList .list-item .actions .btn {
    padding: 8px 10px;
    font-size: 12px;
  }
}

@media (max-width: 400px) {
  #catsList .list-item .actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #f4f6fb;
  }
  #catsList .list-item .actions .btn {
    width: auto;
    padding: 8px 14px;
  }
}