/* ══════════════════════════════════════════════════════════════
 * TEMPLO COVA DOS OSSOS — Estilos compartilhados do Admin
 * Versao: profissional v2 — melhor legibilidade, contraste, hierarquia
 * Importado por: admin.html, galeria-admin.html, estudos-admin.html
 * ══════════════════════════════════════════════════════════════ */

:root {
  --vm: #8B1A1A;
  --vv: #C0392B;
  --ou: #C9A227;
  --oc: #E8C84A;
  --pr: #0A0706;
  --fu: #110E0C;
  --os: #E8DCC8;
  --oe: #C4B49A;
  --sb: 255px;
  /* Tokens para estados */
  --verde: #7ade8a;
  --verde-bg: rgba(45, 106, 45, .12);
  --verde-border: rgba(109, 191, 109, .35);
  --vermelho: #ff8a8a;
  --vermelho-bg: rgba(139, 26, 26, .15);
  --amarelo: #e8c84a;
  --azul: #7aaeff;
}

/* ── Reset ────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--pr);
  color: var(--os);
  font-family: 'Montserrat', sans-serif;
  font-size: 15px; /* base acessível */
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: .22;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sb);
  min-height: 100vh;
  background: linear-gradient(180deg, #0d0a08, #110e0c);
  border-right: 1px solid rgba(201, 162, 39, .15);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s;
  overflow-y: auto;
  box-shadow: 2px 0 20px rgba(0, 0, 0, .4);
}
.sb-logo {
  padding: 1.6rem 1.3rem 1.3rem;
  border-bottom: 1px solid rgba(201, 162, 39, .1);
  text-align: center;
  background: radial-gradient(ellipse at top, rgba(201, 162, 39, .04), transparent 70%);
}
.sb-logo svg {
  filter: drop-shadow(0 0 12px rgba(201, 162, 39, .45));
  margin-bottom: .6rem;
}
.sb-t {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  color: var(--ou);
  line-height: 1.3;
  letter-spacing: -.01em;
  font-weight: 700;
}
.sb-s {
  font-family: 'Montserrat', sans-serif;
  font-size: .68rem;
  color: var(--vv);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-top: .3rem;
  opacity: .85;
  font-weight: 500;
}
.sb-nav { flex: 1; padding: 1rem 0; }
.nav-sec {
  font-family: 'Montserrat', sans-serif;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(196, 180, 154, .42);
  padding: 1.1rem 1.3rem .4rem;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .68rem 1.3rem;
  cursor: pointer;
  transition: all .18s ease;
  border-left: 3px solid transparent;
  font-family: 'Montserrat', sans-serif;
  font-size: .88rem;
  letter-spacing: 0;
  color: var(--oe);
  opacity: .82;
  text-decoration: none;
  position: relative;
  font-weight: 500;
}
.nav-item:hover {
  background: rgba(201, 162, 39, .06);
  color: var(--os);
  opacity: 1;
  border-left-color: rgba(201, 162, 39, .3);
  padding-left: 1.5rem;
}
.nav-item.ativo {
  background: linear-gradient(90deg, rgba(139, 26, 26, .22), rgba(139, 26, 26, .05));
  color: var(--ou);
  opacity: 1;
  border-left-color: var(--vv);
  font-weight: 600;
}
.ni { font-size: 1rem; width: 20px; text-align: center; }
.nb {
  margin-left: auto;
  background: var(--vv);
  border: 1px solid rgba(192, 57, 43, .6);
  color: #fff;
  font-size: .62rem;
  padding: .08rem .44rem;
  font-family: 'Cinzel', serif;
  display: none;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(192, 57, 43, .4);
}
.sb-ft { padding: 1rem 1.3rem; border-top: 1px solid rgba(201, 162, 39, .1); }
.btn-sair, .btn-sair-sb {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(139, 26, 26, .35);
  color: rgba(232, 138, 138, .9);
  font-family: 'Montserrat', sans-serif;
  font-size: .82rem;
  letter-spacing: 0;
  text-transform: none;
  padding: .65rem;
  cursor: pointer;
  transition: all .2s;
  font-weight: 500;
  border-radius: 4px;
}
.btn-sair:hover, .btn-sair-sb:hover {
  border-color: var(--vv);
  color: #fff;
  background: rgba(139, 26, 26, .3);
  box-shadow: 0 0 18px rgba(192, 57, 43, .3);
}

/* ── Wrapper principal ──────────────────────────────────── */
.main, .main-wrap {
  margin-left: var(--sb);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100vw - var(--sb));
}

/* ── Toggle mobile ──────────────────────────────────────── */
.mtog {
  display: none;
  position: fixed;
  top: .82rem;
  left: .82rem;
  z-index: 200;
  background: rgba(10, 7, 6, .98);
  border: 1px solid rgba(201, 162, 39, .35);
  color: var(--ou);
  font-size: 1.2rem;
  padding: .55rem .8rem;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  background: rgba(10, 7, 6, .96);
  border-bottom: 1px solid rgba(201, 162, 39, .12);
  padding: 1.1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, .3);
}
.tb-t, .tb-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  letter-spacing: -.005em;
  color: var(--ou);
  font-weight: 600;
}
.tb-h {
  font-family: 'Cinzel', serif;
  font-size: .72rem;
  color: var(--oe);
  opacity: .55;
  letter-spacing: .1em;
}

/* ── Botões (limpos, profissionais) ─────────────────────── */
.bp {
  background: linear-gradient(135deg, #5a1010, #8B1A1A);
  border: 1px solid rgba(139, 26, 26, .8);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: .85rem;
  letter-spacing: .01em;
  text-transform: none;
  padding: .68rem 1.2rem;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
  font-weight: 600;
  border-radius: 4px;
}
.bp:hover {
  border-color: var(--ou);
  box-shadow: 0 4px 14px rgba(139, 26, 26, .35);
  transform: translateY(-1px);
}
.bp:active { transform: translateY(0); }
.bp:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.bs {
  background: rgba(201, 162, 39, .05);
  border: 1px solid rgba(201, 162, 39, .25);
  color: var(--os);
  font-family: 'Montserrat', sans-serif;
  font-size: .82rem;
  letter-spacing: 0;
  text-transform: none;
  padding: .58rem 1rem;
  cursor: pointer;
  transition: all .18s ease;
  font-weight: 500;
  border-radius: 4px;
}
.bs:hover {
  border-color: rgba(201, 162, 39, .5);
  color: var(--oc);
  background: rgba(201, 162, 39, .1);
}

.bd {
  background: transparent;
  border: 1px solid rgba(139, 26, 26, .4);
  color: rgba(232, 138, 138, .9);
  font-family: 'Montserrat', sans-serif;
  font-size: .8rem;
  letter-spacing: 0;
  text-transform: none;
  padding: .5rem .85rem;
  cursor: pointer;
  transition: all .18s ease;
  font-weight: 500;
  border-radius: 4px;
}
.bd:hover {
  border-color: var(--vv);
  color: #fff;
  background: rgba(139, 26, 26, .25);
}

.bok {
  background: linear-gradient(135deg, #1a3a10, #2d6a2d);
  border: 1px solid rgba(45, 106, 45, .55);
  color: #c8f5c8;
  font-family: 'Cinzel', serif;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .5rem .85rem;
  cursor: pointer;
  transition: all .22s;
  font-weight: 600;
  border-radius: 2px;
}
.bok:hover { background: linear-gradient(135deg, #2d5a20, #3d8a3d); color: #fff; }

/* ── Modal ──────────────────────────────────────────────── */
.mbg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 3, 2, .95);
  z-index: 500;
  backdrop-filter: blur(6px);
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1rem;
  overflow-y: auto;
}
.mbg.open {
  display: flex;
  animation: mfi .25s cubic-bezier(.4, 0, .2, 1);
}
@keyframes mfi {
  from { opacity: 0; transform: translateY(-12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal {
  background: linear-gradient(135deg, #0d0a08, #120f0d);
  border: 1px solid rgba(201, 162, 39, .18);
  border-top: 3px solid var(--vm);
  width: 100%;
  max-width: 680px;
  margin: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
  border-radius: 2px;
}
.mhd, .mh {
  padding: 1.4rem 1.6rem 1.1rem;
  border-bottom: 1px solid rgba(201, 162, 39, .1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #0d0a08;
  z-index: 10;
}
.mtt, .mt {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.15rem;
  color: var(--ou);
  letter-spacing: -.01em;
  font-weight: 600;
}
.mx {
  background: transparent;
  border: none;
  color: var(--oe);
  font-size: 1.3rem;
  cursor: pointer;
  opacity: .55;
  padding: .2rem .55rem;
  transition: all .2s;
  border-radius: 3px;
}
.mx:hover { opacity: 1; background: rgba(201, 162, 39, .08); color: var(--ou); }
.mbd, .mb { padding: 1.5rem 1.6rem; max-height: 72vh; overflow-y: auto; }
.mft, .mf {
  padding: 1rem 1.6rem;
  border-top: 1px solid rgba(201, 162, 39, .1);
  display: flex;
  gap: .85rem;
  justify-content: flex-end;
  background: #0d0a08;
}

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9000;
  background: rgba(14, 10, 8, .98);
  border: 1px solid rgba(201, 162, 39, .3);
  border-left: 4px solid var(--ou);
  padding: 1rem 1.5rem;
  font-family: 'Cinzel', serif;
  font-size: .82rem;
  letter-spacing: .05em;
  color: var(--os);
  display: none;
  max-width: 340px;
  animation: tsi .35s cubic-bezier(.4, 0, .2, 1);
  line-height: 1.55;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .6);
  border-radius: 2px;
  font-weight: 500;
}
.toast.erro { border-left-color: var(--vv); background: rgba(30, 10, 10, .98); }
.toast.vis { display: block; }
@keyframes tsi {
  from { transform: translateX(18px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Forms ──────────────────────────────────────────────── */
.fr { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.fr3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.fg { margin-bottom: 1.1rem; }
.fl {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: .82rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--oe);
  margin-bottom: .4rem;
  opacity: .9;
  font-weight: 500;
}
.fq { color: var(--vv); font-weight: 700; }
.fi, .fsel, .fta {
  width: 100%;
  background: rgba(10, 7, 6, .85);
  border: 1px solid rgba(201, 162, 39, .18);
  border-bottom: 2px solid rgba(201, 162, 39, .3);
  color: var(--os);
  font-family: 'Montserrat', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
  font-size: .95rem;
  padding: .75rem 1rem;
  outline: none;
  transition: all .22s;
  border-radius: 2px;
}
.fi:focus, .fsel:focus, .fta:focus {
  border-color: rgba(201, 162, 39, .55);
  border-bottom-color: var(--ou);
  background: rgba(17, 14, 12, .95);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .08);
}
.fi::placeholder { color: rgba(196, 180, 154, .3); }
.fta { min-height: 90px; resize: vertical; line-height: 1.6; }
.fdv {
  border-top: 1px solid rgba(201, 162, 39, .12);
  margin: 1.3rem 0;
  padding-top: 1.1rem;
}
.fdt {
  font-family: 'Montserrat', sans-serif;
  font-size: .92rem;
  letter-spacing: -.005em;
  text-transform: none;
  color: var(--ou);
  opacity: .95;
  margin-bottom: .9rem;
  font-weight: 600;
}
.fm {
  padding: .75rem 1rem;
  font-family: 'Cinzel', serif;
  font-size: .78rem;
  letter-spacing: .05em;
  border: 1px solid;
  display: none;
  border-radius: 2px;
  font-weight: 500;
}
.fm.erro {
  background: rgba(60, 16, 16, .45);
  border-color: rgba(139, 26, 26, .5);
  color: var(--vermelho);
  display: block;
}
.fm.ok {
  background: rgba(16, 40, 16, .45);
  border-color: rgba(45, 106, 45, .5);
  color: var(--verde);
  display: block;
}

/* ── Cards e Grids (estilo limpo profissional) ──────────── */
.sg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.sc {
  background: rgba(20, 16, 14, .65);
  border: 1px solid rgba(201, 162, 39, .1);
  padding: 1.2rem 1.3rem;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, background .2s;
  border-radius: 4px;
}
.sc:hover {
  border-color: rgba(201, 162, 39, .25);
  background: rgba(20, 16, 14, .85);
}
.sn {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.85rem;
  color: var(--ou);
  margin-bottom: .25rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -.01em;
}
.sl {
  font-family: 'Montserrat', sans-serif;
  font-size: .78rem;
  letter-spacing: .02em;
  color: var(--oe);
  opacity: .75;
  font-weight: 500;
}
.si {
  position: absolute;
  top: .8rem;
  right: .9rem;
  font-size: 1.15rem;
  opacity: .35;
}

/* ── Section Header ─────────────────────────────────────── */
.sh {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(201, 162, 39, .1);
}
.st {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.4rem;
  color: var(--ou);
  letter-spacing: -.01em;
  font-weight: 600;
}
.ss {
  font-family: 'Montserrat', sans-serif;
  font-size: .82rem;
  letter-spacing: .02em;
  color: var(--oe);
  opacity: .65;
  margin-top: .25rem;
  font-style: italic;
  font-weight: 400;
  text-transform: none;
}

/* ── Responsivo ─────────────────────────────────────────── */
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 30px rgba(0, 0, 0, .8); }
  .main, .main-wrap { margin-left: 0; width: 100%; }
  .mtog { display: block; }
  .topbar { padding: 1rem 1rem 1rem 3.8rem; }
  .fr, .fr3 { grid-template-columns: 1fr; }
  .sg { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
  .sc { padding: 1.1rem 1rem; }
  .sn { font-size: 1.6rem; }
  .bp, .bs, .bd { font-size: .68rem; padding: .6rem .9rem; }
  .mbd, .mb { padding: 1.2rem 1.1rem; }
  .mhd, .mh { padding: 1.1rem 1.2rem .9rem; }
  .mft, .mf { padding: .9rem 1.2rem; }
}

@media (max-width: 480px) {
  .sg { grid-template-columns: 1fr; }
  body { font-size: 14px; }
}

/* ── Scrollbar custom ───────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(10, 7, 6, .5); }
::-webkit-scrollbar-thumb { background: rgba(201, 162, 39, .25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201, 162, 39, .45); }

/* ── Loading spinner ────────────────────────────────────── */
.spinner-sm {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(201, 162, 39, .2);
  border-top-color: var(--ou);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: middle;
  margin-right: .5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Animações sutis de entrada ─────────────────────────── */
.aba {
  display: none;
}
.aba.ativo {
  display: block;
  animation: fadeInUp .4s cubic-bezier(.4, 0, .2, 1);
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══ Painel Acordeão (seções colapsáveis) ════════════════ */
.acc-secao {
  background: linear-gradient(135deg, rgba(20, 16, 14, .95), rgba(28, 22, 20, .85));
  border: 1px solid rgba(201, 162, 39, .12);
  border-top: 2px solid var(--vm);
  border-radius: 3px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: border-color .25s;
}
.acc-secao:hover { border-color: rgba(201, 162, 39, .22); }
.acc-secao.aberto { border-color: rgba(201, 162, 39, .35); }
.acc-head {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1.1rem 1.4rem;
  cursor: pointer;
  user-select: none;
  background: rgba(17, 14, 12, .55);
  border-bottom: 1px solid transparent;
  transition: all .22s;
}
.acc-head:hover { background: rgba(201, 162, 39, .04); }
.acc-secao.aberto .acc-head {
  background: linear-gradient(90deg, rgba(139, 26, 26, .12), rgba(17, 14, 12, .55));
  border-bottom-color: rgba(201, 162, 39, .12);
}
.acc-icon {
  font-size: 1.4rem;
  opacity: .8;
  flex-shrink: 0;
}
.acc-info {
  flex: 1;
  min-width: 0;
}
.acc-titulo {
  font-family: 'Cinzel', serif;
  font-size: .92rem;
  letter-spacing: .12em;
  color: var(--ou);
  text-transform: uppercase;
  font-weight: 600;
  line-height: 1.3;
}
.acc-desc {
  font-size: .78rem;
  color: var(--oe);
  opacity: .65;
  margin-top: .25rem;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
.acc-seta {
  font-size: 1.1rem;
  color: var(--ou);
  opacity: .65;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  flex-shrink: 0;
}
.acc-secao.aberto .acc-seta { transform: rotate(180deg); opacity: 1; }
.acc-corpo {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.4, 0, .2, 1);
}
.acc-secao.aberto .acc-corpo { max-height: 4000px; }
.acc-corpo-inner {
  padding: 1.4rem;
}

/* ══ Barra de Ação Fixa no Rodapé (para forms longos) ═══ */
.acoes-rodape {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, rgba(10, 7, 6, .98) 30%);
  padding: 1.2rem 0 .4rem;
  display: flex;
  justify-content: flex-end;
  gap: .8rem;
  margin-top: 1.5rem;
  z-index: 10;
}
.acoes-rodape::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 7, 6, .85);
  backdrop-filter: blur(8px);
  z-index: -1;
  border-top: 1px solid rgba(201, 162, 39, .15);
}

/* ══ Linha auxiliar de info acima de seções ════════════ */
.info-strip {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .85rem 1.1rem;
  background: rgba(201, 162, 39, .04);
  border: 1px solid rgba(201, 162, 39, .15);
  border-left: 3px solid var(--ou);
  margin-bottom: 1.5rem;
  border-radius: 2px;
}
.info-strip .info-icon { font-size: 1.1rem; opacity: .8; flex-shrink: 0; }
.info-strip .info-txt {
  font-size: .85rem;
  color: var(--oe);
  line-height: 1.55;
}
.info-strip .info-txt strong { color: var(--ou); }
