@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ── Variáveis ── */
:root {
  --m-primary:   #9b2335;
  --m-secondary: #c0392b;
  --m-accent:    #e8734a;
  --m-light:     rgba(155,35,53,0.12);
  --m-grad:      linear-gradient(135deg, #9b2335, #c0392b);
}

/* ── Reset & base ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  height: 100vh;
  background: linear-gradient(145deg, #f5e8e8 0%, #eddada 50%, #e4cccc 100%);
  display: flex; font-family: 'Nunito', sans-serif;
  overflow: hidden;
}
body::before, body::after {
  content: ''; position: fixed; border-radius: 50%; pointer-events: none; z-index: 0;
}
body::before {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(155,35,53,0.12) 0%, transparent 70%);
  top: -100px; right: -100px;
}
body::after {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(232,115,74,0.1) 0%, transparent 70%);
  bottom: -80px; left: 50px;
}

/* ── Sidebar ── */
.sidebar {
  width: 72px;
  background: rgba(255,255,255,0.38);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255,255,255,0.6);
  display: flex; flex-direction: column; align-items: center;
  padding: 28px 0 24px; gap: 8px; z-index: 10; position: relative;
}
.sidebar-logo { font-size: 22px; margin-bottom: 18px; filter: drop-shadow(0 2px 6px rgba(155,35,53,0.4)); }
.icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; cursor: pointer; text-decoration: none; color: inherit;
  transition: background 0.2s, transform 0.15s; position: relative;
}
.icon:hover { background: var(--m-light); transform: scale(1.08); }
.icon.active { background: var(--m-grad); box-shadow: 0 4px 14px rgba(155,35,53,0.4); color: white; }
.icon svg { width: 22px; height: 22px; fill: var(--m-primary); transition: fill 0.2s; }
.icon.active svg { fill: white; }
.icon.active::after {
  content: ''; position: absolute; right: -1px;
  width: 3px; height: 22px; border-radius: 2px 0 0 2px;
  background: var(--m-grad);
}

/* ── Página principal ── */
#paginaMangas {
  flex: 1; display: flex; flex-direction: column;
  overflow-y: auto; position: relative; z-index: 1;
}
#paginaMangas::-webkit-scrollbar { width: 6px; }
#paginaMangas::-webkit-scrollbar-thumb { background: rgba(155,35,53,0.2); border-radius: 10px; }

/* ── Header ── */
.manga-header {
  background: linear-gradient(135deg, #9b2335 0%, #c0392b 60%, #e8734a 100%);
  padding: 32px 24px 24px; flex-shrink: 0;
}
.manga-header-top { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.manga-logo {
  width: 48px; height: 48px; background: rgba(255,255,255,0.2);
  border-radius: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.manga-logo svg { width: 26px; height: 26px; fill: white; }
.manga-titulo { font-size: 22px; font-weight: 900; color: white; }
.manga-sub { font-size: 12px; color: rgba(255,255,255,0.75); margin-top: 2px; }
.manga-stats-row {
  display: flex; background: rgba(255,255,255,0.15); border-radius: 16px; overflow: hidden;
}
.manga-stat { flex: 1; text-align: center; padding: 12px 8px; border-right: 1px solid rgba(255,255,255,0.15); }
.manga-stat:last-child { border-right: none; }
.manga-stat-num { font-size: 22px; font-weight: 900; color: white; }
.manga-stat-lbl { font-size: 11px; color: rgba(255,255,255,0.75); font-weight: 700; margin-top: 1px; }

/* ── Busca local ── */
.busca-local-wrap { padding: 16px 16px 0; flex-shrink: 0; }
.busca-local-inner {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.7); backdrop-filter: blur(12px);
  border-radius: 14px; padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.85);
  box-shadow: 0 2px 12px rgba(155,35,53,0.08);
}
.busca-local-icon svg { width: 16px; height: 16px; fill: #c0392b; opacity: 0.6; }
.busca-local-inner input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 14px; font-family: 'Nunito', sans-serif; color: #333;
}
.busca-local-inner input::placeholder { color: #bbb; }
.busca-local-clear {
  background: none; border: none; color: #bbb; cursor: pointer;
  font-size: 14px; padding: 0 2px; display: none;
  align-items: center; justify-content: center;
}
.busca-local-clear:hover { color: var(--m-primary); }

/* ── Container listas ── */
.manga-container { padding: 16px 16px 80px; }

/* ── Categorias ── */
.categoria {
  background: rgba(255,255,255,0.52); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.85); padding: 22px 24px; border-radius: 24px;
  margin-bottom: 22px; box-shadow: 0 4px 20px rgba(155,35,53,0.08);
  animation: fadeSlideIn 0.4s ease both;
}
@keyframes fadeSlideIn { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }
.categoria:nth-child(2) { animation-delay: 0.05s; }
.categoria:nth-child(3) { animation-delay: 0.1s; }
.categoria-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.categoria-header-left { display: flex; align-items: center; gap: 10px; }
.categoria-dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-lendo { background: var(--m-grad); box-shadow: 0 0 8px rgba(155,35,53,0.5); }
.dot-lidos { background: linear-gradient(135deg,#e8734a,#c0392b); box-shadow: 0 0 8px rgba(232,115,74,0.5); }
.dot-para  { background: linear-gradient(135deg,#c0392b,#9b2335); box-shadow: 0 0 8px rgba(192,57,43,0.5); }
.categoria h3 { font-size: 15px; font-weight: 800; color: #2d2f4a; }
.categoria-actions { display: flex; align-items: center; gap: 8px; }
.categoria-count { font-size: 12px; font-weight: 700; color: var(--m-primary); background: var(--m-light); border-radius: 20px; padding: 3px 10px; }
.filter-btn {
  font-size: 11px; font-weight: 700; color: var(--m-primary);
  background: var(--m-light); border: none; border-radius: 20px;
  padding: 4px 10px; cursor: pointer; font-family: 'Nunito', sans-serif;
  transition: background 0.2s;
}
.filter-btn:hover { background: rgba(155,35,53,0.2); }

/* ── Lista / drag-scroll ── */
.lista { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; cursor: grab; user-select: none; scroll-behavior: smooth; }
.lista:active { cursor: grabbing; }
.lista::-webkit-scrollbar { height: 5px; }
.lista::-webkit-scrollbar-thumb { background: rgba(155,35,53,0.2); border-radius: 10px; }
.lista-empty {
  display: flex; align-items: center; padding: 14px 18px; border-radius: 16px;
  border: 2px dashed rgba(155,35,53,0.2); color: #c09090; font-size: 13px;
  font-weight: 600; width: 100%; cursor: pointer; transition: border-color 0.2s, color 0.2s;
}
.lista-empty:hover { border-color: rgba(155,35,53,0.4); color: var(--m-primary); }

/* ── Card ── */
.card {
  width: 130px; aspect-ratio: 2/3; border-radius: 18px; overflow: hidden;
  position: relative; cursor: pointer; flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12); transition: transform 0.22s, box-shadow 0.22s;
  border: 1.5px solid rgba(255,255,255,0.6); user-select: none;
}
.card img { background: #e0d0d0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.card:hover { transform: translateY(-5px) scale(1.03); box-shadow: 0 14px 30px rgba(155,35,53,0.22); }
.card-info { position: absolute; bottom: 0; left: 0; width: 100%; padding: 34px 10px 8px; background: linear-gradient(to top, rgba(40,5,10,0.95) 0%, transparent 100%); color: white; }
.card-title { font-size: 12px; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.card-badge { display: inline-block; font-size: 10px; font-weight: 800; background: rgba(155,35,53,0.85); color: white; border-radius: 6px; padding: 1px 6px; margin-bottom: 5px; }
.eps-bar-wrap { width: 100%; height: 3px; background: rgba(255,255,255,0.2); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.eps-bar { height: 100%; background: var(--m-grad); border-radius: 99px; transition: width 0.4s; }
.eps-label { font-size: 9px; color: rgba(255,255,255,0.7); margin-top: 2px; font-weight: 700; }

/* ── Botão flutuante ── */
.btn-add {
  position: fixed; bottom: 28px; right: 28px;
  width: 58px; height: 58px; border-radius: 50%; border: none;
  font-size: 28px; cursor: pointer; z-index: 100;
  background: var(--m-grad); box-shadow: 0 8px 24px rgba(155,35,53,0.45);
  color: white; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-add:hover { transform: scale(1.08) rotate(90deg); box-shadow: 0 12px 30px rgba(155,35,53,0.55); }

/* ── Modal add ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  backdrop-filter: blur(6px); display: none;
  justify-content: center; align-items: center; z-index: 200;
}
.modal {
  background: rgba(255,255,255,0.96); padding: 28px; border-radius: 24px;
  width: min(360px, 96vw); display: flex; flex-direction: column; gap: 0;
  box-shadow: 0 20px 60px rgba(155,35,53,0.2); animation: popIn 0.25s ease;
}
@keyframes popIn { from { opacity:0; transform:scale(0.92); } to { opacity:1; transform:scale(1); } }
.modal h2 { font-size: 20px; font-weight: 900; color: var(--m-primary); margin-bottom: 18px; }
.modal-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.modal-field label { font-size: 12px; font-weight: 700; color: #9095b8; text-transform: uppercase; letter-spacing: 0.5px; }
.modal-field input, .modal-field select {
  padding: 10px 12px; border-radius: 12px; border: 1.5px solid #e0d0d0;
  font-size: 14px; font-family: 'Nunito', sans-serif; background: #fdf8f8;
  transition: border-color 0.2s; outline: none; color: #333;
}
.modal-field input:focus, .modal-field select:focus { border-color: var(--m-primary); }
.campo-obrigatorio { color: var(--m-secondary); }
.modal-field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.modal-field-row .modal-field { flex: 1; min-width: 100px; }
.modal-botoes { display: flex; gap: 10px; margin-top: 8px; }
.modal-botoes button {
  flex: 1; padding: 13px; border-radius: 14px; border: none;
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: 'Nunito', sans-serif;
  transition: opacity 0.2s, transform 0.15s;
}
.modal-botoes button:first-child { background: #f0e8e8; color: #9095b8; }
.modal-botoes button:last-child { background: var(--m-grad); color: white; box-shadow: 0 4px 14px rgba(155,35,53,0.35); }
.modal-botoes button:hover { opacity: 0.88; transform: translateY(-1px); }

/* ── Modal detalhe ── */
.modal-detalhe-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px); display: none;
  justify-content: center; align-items: center; z-index: 200;
}
.modal-detalhe {
  background: white; border-radius: 28px; width: min(380px, 96vw);
  max-height: 90vh; overflow-y: auto; padding: 28px 24px 24px;
  box-shadow: 0 20px 60px rgba(155,35,53,0.25); position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: popIn 0.25s ease;
}
.fechar-detalhe {
  position: absolute; top: 14px; left: 14px; background: #f0e8e8;
  border: none; border-radius: 50%; width: 32px; height: 32px;
  font-size: 14px; cursor: pointer; color: #9095b8;
  display: flex; align-items: center; justify-content: center;
}
.detalhe-edit-btn {
  position: absolute; top: 14px; right: 14px;
  background: var(--m-light); border: none; border-radius: 50%;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.detalhe-edit-btn svg { width: 14px; height: 14px; fill: var(--m-primary); }
.detalhe-edit-btn.saving { background: rgba(52,211,153,0.15); }
.detalhe-edit-btn.saving svg { fill: #059669; }
.detalhe-capa { width: 130px; border-radius: 16px; box-shadow: 0 8px 24px rgba(155,35,53,0.2); object-fit: cover; background: #e0d0d0; min-height: 185px; }
.detalhe-nome { font-size: 18px; font-weight: 900; color: #2d2f4a; text-align: center; line-height: 1.3; }
.detalhe-nota { font-size: 15px; font-weight: 800; color: var(--m-primary); }
.detalhe-generos-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.genero-tag {
  background: var(--m-grad); color: white; font-size: 11px; font-weight: 700;
  padding: 4px 11px; border-radius: 20px; text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(155,35,53,0.25);
}
.genero-tag:nth-child(2) { background: linear-gradient(135deg,#7a1b28,#9b2335); }
.genero-tag:nth-child(3) { background: linear-gradient(135deg,#c0392b,#e8734a); }
.genero-tag:nth-child(n+4) { background: linear-gradient(135deg,#e8734a,#c0392b); }
.detalhe-episodios { width: 100%; }
.eps-detalhe-row { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 10px; }
.eps-detalhe-field { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.eps-detalhe-field label { font-size: 10px; font-weight: 700; color: #9095b8; text-transform: uppercase; letter-spacing: 0.5px; }
.eps-detalhe-field input {
  width: 80px; padding: 8px; border-radius: 10px; border: 1.5px solid #e0d0d0;
  font-size: 14px; font-weight: 700; text-align: center; outline: none;
  font-family: 'Nunito', sans-serif; background: #fdf8f8; color: #333;
  transition: border-color 0.2s;
}
.eps-detalhe-field input:focus { border-color: var(--m-primary); }
.eps-sep { font-size: 18px; color: #ccc; font-weight: 700; margin-top: 18px; }
.eps-detalhe-bar-wrap { width: 100%; height: 8px; background: rgba(155,35,53,0.1); border-radius: 99px; overflow: hidden; position: relative; margin-top: 10px; }
.eps-detalhe-bar { height: 100%; background: var(--m-grad); border-radius: 99px; transition: width 0.4s; }
.eps-detalhe-pct { position: absolute; right: 0; top: -18px; font-size: 11px; font-weight: 700; color: var(--m-primary); }
.detalhe-mover {
  width: 100%; padding: 11px 14px; border-radius: 14px;
  border: 1.5px solid rgba(155,35,53,0.25); background: var(--m-light);
  font-size: 14px; font-weight: 700; font-family: 'Nunito', sans-serif;
  color: #333; cursor: pointer; outline: none; transition: border-color 0.2s;
}
.detalhe-mover:focus { border-color: var(--m-primary); }
.detalhe-obs {
  width: 100%; min-height: 70px; padding: 12px; border-radius: 14px;
  border: 1.5px solid #e0d0d0; background: #fdf8f8;
  font-size: 13px; font-family: 'Nunito', sans-serif; color: #444;
  resize: vertical; outline: none; transition: border-color 0.2s;
}
.detalhe-obs:focus { border-color: var(--m-primary); }
.detalhe-delete {
  width: 100%; padding: 11px; border-radius: 14px;
  border: 1.5px solid rgba(155,35,53,0.2); background: transparent;
  color: var(--m-secondary); font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: 'Nunito', sans-serif; transition: background 0.2s;
}
.detalhe-delete:hover { background: rgba(155,35,53,0.06); }
.edit-capa-input {
  width: 100%; padding: 8px 12px; border-radius: 10px;
  border: 1.5px solid rgba(155,35,53,0.3); background: #fdf8f8;
  font-size: 13px; font-family: 'Nunito', sans-serif; outline: none; color: #333;
}

/* ── Busca overlay ── */
.search-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px); display: none;
  justify-content: center; align-items: flex-start;
  padding-top: 60px; z-index: 300;
}
.search-panel {
  background: white; border-radius: 24px; width: min(480px, 96vw);
  max-height: 80vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(155,35,53,0.25);
}
.search-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid #f0e0e0;
}
.search-input {
  flex: 1; border: none; outline: none; font-size: 15px;
  font-family: 'Nunito', sans-serif; color: #333; background: transparent;
}
.search-input::placeholder { color: #bbb; }
.search-close {
  background: none; border: none; font-size: 18px; color: #aaa; cursor: pointer;
}
.search-label { font-size: 12px; font-weight: 700; color: #9095b8; padding: 10px 20px 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.search-body { overflow-y: auto; padding: 8px 16px 16px; flex: 1; }
.search-result-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: 14px; cursor: pointer; transition: background 0.15s; margin-bottom: 4px;
}
.search-result-item:hover { background: #fdf0f0; }
.search-result-item img { width: 44px; height: 62px; object-fit: cover; border-radius: 8px; background: #e0d0d0; flex-shrink: 0; }
.r-title { font-size: 14px; font-weight: 700; color: #2d2f4a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-meta { font-size: 12px; color: #888; margin-top: 3px; }
.r-score { font-size: 12px; color: var(--m-primary); font-weight: 600; margin-top: 2px; }
.search-spinner { text-align: center; padding: 24px; color: #aaa; font-size: 14px; }
.dots::after { content: '...'; animation: dots 1.2s infinite; }
@keyframes dots { 0%,20%{content:'.'} 40%{content:'..'} 60%,100%{content:'...'} }

/* ── Detalhe busca ── */
.search-detail-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(10px);
  display: none; justify-content: center; align-items: center; z-index: 400;
}
.search-detail-panel {
  background: white; border-radius: 24px; width: min(420px,96vw);
  max-height: 90vh; overflow-y: auto; position: relative; padding: 30px 28px 28px;
  box-shadow: 0 20px 60px rgba(155,35,53,0.3); animation: popIn 0.25s ease;
  display: flex; flex-direction: column; gap: 8px;
}
.sd-close { position: absolute; top: 16px; right: 16px; background: none; border: none; font-size: 20px; cursor: pointer; color: #888; }
.sd-image { width: 130px; border-radius: 16px; box-shadow: 0 8px 24px rgba(155,35,53,0.2); object-fit: cover; background: #e0d0d0; min-height: 185px; align-self: center; }
.sd-title { font-size: 18px; font-weight: 900; color: #2d2f4a; text-align: center; line-height: 1.3; }
.sd-studio { text-align: center; font-size: 13px; color: var(--m-primary); font-weight: 600; }
.sd-desc { font-size: 13px; color: #555; line-height: 1.6; max-height: 120px; overflow-y: auto; padding: 10px; background: #fdf8f8; border-radius: 10px; }
.sd-field { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sd-field label { font-size: 11px; font-weight: 700; color: #9095b8; text-transform: uppercase; }
.sd-eps-row { display: flex; gap: 10px; }
.sd-field input, .sd-status {
  padding: 10px 12px; border-radius: 10px; border: 1.5px solid #e0d0d0;
  font-size: 14px; background: #fdf8f8; font-family: 'Nunito', sans-serif;
  outline: none; color: #333; width: 100%; transition: border-color 0.2s;
}
.sd-field input:focus, .sd-status:focus { border-color: var(--m-primary); }
#sdMangaAddBtn {
  padding: 13px; background: var(--m-grad); color: white; border: none;
  border-radius: 14px; font-size: 15px; font-weight: 800; cursor: pointer;
  font-family: 'Nunito', sans-serif; transition: opacity 0.2s; box-shadow: 0 4px 16px rgba(155,35,53,0.35);
}
#sdMangaAddBtn:hover { opacity: 0.88; }
#sdMangaAddBtn:disabled { background: #aaa; cursor: default; box-shadow: none; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: rgba(40,5,10,0.9); color: white; padding: 12px 22px;
  border-radius: 99px; font-size: 13px; font-weight: 700;
  z-index: 999; opacity: 0; pointer-events: none;
  transition: opacity 0.3s; white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ── Dark mode ── */
body.dark {
  background: linear-gradient(145deg, #1a0a0a 0%, #220f0f 50%, #1a0d0d 100%);
  color: #f0e8e8;
}
body.dark::before { background: radial-gradient(circle, rgba(155,35,53,0.15) 0%, transparent 70%); }
body.dark .sidebar { background: rgba(20,5,5,0.7); border-right-color: rgba(255,255,255,0.05); }
body.dark .icon:hover { background: var(--m-light); }
body.dark .categoria { background: rgba(30,10,10,0.7); border-color: rgba(255,255,255,0.06); }
body.dark .categoria h3 { color: #f0e0e0; }
body.dark .lista-empty { border-color: rgba(155,35,53,0.2); color: #7a4040; }
body.dark .lista-empty:hover { border-color: rgba(155,35,53,0.4); color: var(--m-primary); }
body.dark .card { border-color: rgba(255,255,255,0.08); }
body.dark .modal, body.dark .modal-detalhe, body.dark .search-panel, body.dark .search-detail-panel { background: rgba(25,8,8,0.97); color: #f0e8e8; }
body.dark .modal h2 { color: #e8b0b0; }
body.dark .modal-field input, body.dark .modal-field select, body.dark .detalhe-mover, body.dark .detalhe-obs, body.dark .eps-detalhe-field input, body.dark .sd-field input, body.dark .sd-status { background: #2a0f0f; color: #f0e8e8; border-color: #3a1a1a; }
body.dark .modal-field label { color: #c08080; }
body.dark .modal-botoes button:first-child { background: #2a0f0f; color: #aaa; }
body.dark .detalhe-nome { color: #f0e0e0; }
body.dark .fechar-detalhe { background: #2a0f0f; color: #aaa; }
body.dark .search-header { border-bottom-color: rgba(255,255,255,0.07); }
body.dark .search-header input { color: #f0e8e8; }
body.dark .search-result-item:hover { background: rgba(155,35,53,0.1); }
body.dark .r-title { color: #f0e0e0; }
body.dark .sd-desc { background: #2a0f0f; color: #ccc; }
body.dark .busca-local-inner { background: rgba(30,10,10,0.7); border-color: rgba(155,35,53,0.2); }
body.dark .busca-local-inner input { color: #f0e8e8; }

/* ── Mobile ── */
@media (max-width: 768px) {
  body { flex-direction: column; height: 100dvh; overflow: hidden; }
  .sidebar {
    width: 100%;
    height: calc(64px + max(env(safe-area-inset-bottom), 16px));
    flex-direction: row; order: 2;
    padding: 0 16px max(env(safe-area-inset-bottom), 16px); gap: 0; border-right: none;
    border-top: 1px solid rgba(255,255,255,0.6);
    justify-content: space-around; align-items: center;
  }
  .sidebar-logo { display: none; }
  .icon { width: 52px; height: 52px; border-radius: 16px; }
  .icon.active::after { right: auto; bottom: -1px; left: 50%; top: auto; transform: translateX(-50%); width: 22px; height: 3px; border-radius: 2px 2px 0 0; }
  #paginaMangas { flex: 1; order: 1; height: calc(100dvh - 64px - max(env(safe-area-inset-bottom), 16px)); overflow-y: auto; }
  .manga-container { padding: 16px 12px 80px; }
  .search-overlay { padding-top: 0; align-items: flex-end; }
  .search-panel { width: 100%; border-radius: 24px 24px 0 0; max-height: 88dvh; }
  .search-detail-overlay { align-items: flex-end; }
  .search-detail-panel { width: 100%; border-radius: 24px 24px 0 0; max-height: 92dvh; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { width: 100%; border-radius: 24px 24px 0 0; padding: 24px 20px 32px; max-height: 90dvh; overflow-y: auto; }
  .modal-detalhe-overlay { align-items: flex-end; }
  .modal-detalhe { width: 100%; border-radius: 24px 24px 0 0; max-height: 90dvh; }
  .btn-add { bottom: calc(80px + max(env(safe-area-inset-bottom), 16px)); right: 18px; }
  .modal-field-row { flex-direction: column; gap: 0; }
}

/* ══════════════════════════════════════════
   PÁGINA +18
══════════════════════════════════════════ */
:root {
  --a-primary:   #4a1a6e;
  --a-secondary: #6d28a0;
  --a-accent:    #9b59b6;
  --a-light:     rgba(74,26,110,0.12);
  --a-grad:      linear-gradient(135deg, #4a1a6e, #6d28a0);
}

.adulto-page {
  flex: 1; flex-direction: column; overflow-y: auto; position: relative; z-index: 1;
}
.adulto-page::-webkit-scrollbar { width: 6px; }
.adulto-page::-webkit-scrollbar-thumb { background: rgba(74,26,110,0.2); border-radius: 10px; }

/* Header */
.adulto-header {
  background: linear-gradient(135deg, #1a0a2e 0%, #4a1a6e 55%, #6d28a0 100%);
  padding: 32px 24px 24px; flex-shrink: 0;
}
.adulto-header-top { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.adulto-logo {
  width: 48px; height: 48px; background: rgba(255,255,255,0.15);
  border-radius: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.adulto-logo svg { width: 26px; height: 26px; fill: white; }
.adulto-titulo { font-size: 22px; font-weight: 900; color: white; }
.adulto-sub { font-size: 12px; color: rgba(255,255,255,0.65); margin-top: 2px; }
.adulto-badge {
  margin-left: auto; background: rgba(255,255,255,0.2);
  color: white; font-size: 11px; font-weight: 900;
  padding: 4px 10px; border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,0.35); letter-spacing: 0.5px;
}
.adulto-stats-row {
  display: flex; background: rgba(255,255,255,0.1); border-radius: 16px; overflow: hidden;
}
.adulto-stat { flex: 1; text-align: center; padding: 12px 8px; border-right: 1px solid rgba(255,255,255,0.12); }
.adulto-stat:last-child { border-right: none; }
.adulto-stat-num { font-size: 22px; font-weight: 900; color: white; }
.adulto-stat-lbl { font-size: 11px; color: rgba(255,255,255,0.65); font-weight: 700; margin-top: 1px; }

/* Busca */
.adulto-busca-inner { border-color: rgba(74,26,110,0.25) !important; }
.adulto-busca-inner .busca-local-icon svg { fill: var(--a-secondary) !important; }

/* Categorias */
.adulto-categoria { box-shadow: 0 4px 20px rgba(74,26,110,0.1) !important; }
.adulto-dot-lendo { background: var(--a-grad); box-shadow: 0 0 8px rgba(74,26,110,0.5); }
.adulto-dot-lidos { background: linear-gradient(135deg,#9b59b6,#6d28a0); box-shadow: 0 0 8px rgba(155,89,182,0.5); }
.adulto-dot-para  { background: linear-gradient(135deg,#6d28a0,#4a1a6e); box-shadow: 0 0 8px rgba(109,40,160,0.5); }
.adulto-filter { color: var(--a-primary) !important; background: var(--a-light) !important; }
.adulto-filter:hover { background: rgba(74,26,110,0.2) !important; }
.adulto-count  { color: var(--a-primary) !important; background: var(--a-light) !important; }

/* Cards */
.adulto-page .card:hover { box-shadow: 0 14px 30px rgba(74,26,110,0.22); }
.adulto-page .card-badge { background: rgba(74,26,110,0.85) !important; }
.adulto-page .eps-bar { background: var(--a-grad) !important; }
.adulto-page .lista-empty { border-color: rgba(74,26,110,0.2); color: #a090c0; }
.adulto-page .lista-empty:hover { border-color: rgba(74,26,110,0.4); color: var(--a-primary); }

/* Botão add */
.adulto-btn-add {
  background: var(--a-grad) !important;
  box-shadow: 0 8px 24px rgba(74,26,110,0.45) !important;
}

/* Modal */
.adulto-modal h2 { color: var(--a-primary); }
.adulto-modal .modal-botoes button:last-child { background: var(--a-grad) !important; box-shadow: 0 4px 14px rgba(74,26,110,0.35) !important; }
.adulto-modal .modal-field input:focus,
.adulto-modal .modal-field select:focus { border-color: var(--a-primary) !important; }

/* Detalhe */
.adulto-nota { color: var(--a-primary) !important; }
.adulto-detalhe-autor { font-size: 13px; font-weight: 600; color: var(--a-accent); }
.adulto-edit-btn { background: var(--a-light) !important; }
.adulto-edit-btn svg { fill: var(--a-primary) !important; }
.adulto-mover { border-color: rgba(74,26,110,0.25) !important; background: var(--a-light) !important; }
.adulto-mover:focus { border-color: var(--a-primary) !important; }
.adulto-delete-btn { color: var(--a-secondary) !important; border-color: rgba(74,26,110,0.2) !important; }
.adulto-delete-btn:hover { background: rgba(74,26,110,0.06) !important; }
.adulto-modal-detalhe .eps-detalhe-bar { background: var(--a-grad) !important; }
.adulto-modal-detalhe .eps-detalhe-field input:focus { border-color: var(--a-primary) !important; }

/* Ícone sidebar */
#btnAdulto svg { fill: var(--m-primary); }
#btnAdulto.active { background: var(--a-grad) !important; box-shadow: 0 4px 14px rgba(74,26,110,0.4) !important; }
#btnAdulto.active svg { fill: white; }
#btnAdulto.active::after { background: var(--a-grad) !important; }

/* Dark mode */
body.dark .adulto-header { background: linear-gradient(135deg, #0d0518 0%, #2d1045 55%, #4a1a6e 100%); }
body.dark .adulto-categoria { background: rgba(20,10,30,0.7) !important; }
body.dark .adulto-modal .modal-field input,
body.dark .adulto-modal .modal-field select { background: #1a0a2e; border-color: #2a1040; color: #f0e8ff; }
body.dark .adulto-modal-detalhe { background: rgba(15,5,25,0.97) !important; }
body.dark .adulto-modal-detalhe .eps-detalhe-field input { background: #1a0a2e; border-color: #2a1040; color: #f0e8ff; }
body.dark .adulto-modal-detalhe .detalhe-mover,
body.dark .adulto-modal-detalhe .detalhe-obs { background: #1a0a2e; border-color: #2a1040; color: #f0e8ff; }

/* ── Aviso +18 ── */
.adulto-aviso {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 14px 16px 0;
  background: rgba(74,26,110,0.08);
  border: 1.5px solid rgba(74,26,110,0.2);
  border-radius: 14px; padding: 12px 14px;
  font-size: 13px; color: #4a1a6e; font-weight: 600; line-height: 1.45;
}
.adulto-aviso strong { font-weight: 900; }
body.dark .adulto-aviso { background: rgba(74,26,110,0.15); border-color: rgba(74,26,110,0.3); color: #c09be0; }

/* ── Galeria no modal ── */
.modal-field-header {
  display: flex; align-items: center; justify-content: space-between;
}
.galeria-btn {
  font-size: 11px; font-weight: 700; font-family: "Nunito", sans-serif;
  padding: 4px 10px; border-radius: 20px;
  border: 1.5px solid rgba(155,35,53,0.4);
  background: rgba(155,35,53,0.08); color: var(--m-primary);
  cursor: pointer; transition: background 0.2s, transform 0.15s;
}
.galeria-btn:hover { background: rgba(155,35,53,0.18); transform: scale(1.04); }
.adulto-galeria-btn {
  border-color: rgba(74,26,110,0.4) !important;
  background: rgba(74,26,110,0.08) !important;
  color: var(--a-primary) !important;
}
.adulto-galeria-btn:hover { background: rgba(74,26,110,0.18) !important; }
body.dark .galeria-btn { border-color: rgba(232,115,74,0.4); background: rgba(232,115,74,0.1); color: #e8734a; }
body.dark .adulto-galeria-btn { border-color: rgba(155,89,182,0.4) !important; background: rgba(155,89,182,0.1) !important; color: #9b59b6 !important; }