:root {
  --preto: #0b0b0d; --preto-2: #121216; --preto-3: #1a1a20;
  --dourado: #c9a15c; --dourado-claro: #e6c98a;
  --texto: #ece7dd; --muted: #a39a8a; --branco: #fff;
  --verde: #34d17b; --vermelho: #ff6b6b; --raio: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Manrope", -apple-system, "Segoe UI", sans-serif;
  background: var(--preto); color: var(--texto);
  min-height: 100vh; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  width: 100%; padding: 0.7rem 0.9rem; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12); background: var(--preto-2);
  color: var(--branco); font-family: inherit; font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--dourado); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.65rem 1.3rem; border-radius: 999px; font-weight: 700; font-size: 0.9rem;
  border: 2px solid transparent; transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: linear-gradient(135deg, var(--dourado-claro), var(--dourado)); color: var(--preto); }
.btn-ghost { border-color: rgba(255,255,255,.25); color: var(--branco); background: transparent; }
.btn-danger { background: transparent; border-color: rgba(255,107,107,.4); color: var(--vermelho); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: radial-gradient(ellipse at top, #1a1710 0%, var(--preto) 60%); }
.login-card { width: min(400px, 100%); background: var(--preto-3); border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px; padding: 2.2rem; box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.login-card .logo { text-align: center; margin-bottom: 0.5rem; }
.login-card .logo img { width: 72px; height: 72px; object-fit: contain; display: block; margin: 0 auto; }
.login-card h1 { font-size: 1.4rem; text-align: center; margin-bottom: 0.3rem; }
.login-card .sub { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.login-voltar {
  display: block;
  text-align: center;
  margin-top: 1.1rem;
  font-size: .88rem;
  font-weight: 700;
  color: var(--dourado-claro);
  text-decoration: none;
}
.login-voltar:hover { text-decoration: underline; }
.login-card label { display: grid; gap: .35rem; margin-bottom: 1rem; font-size: .85rem; font-weight: 700; color: var(--muted); }
.msg { font-size: .88rem; min-height: 1.2em; margin-top: .8rem; text-align: center; }
.msg.ok { color: var(--verde); } .msg.erro { color: var(--vermelho); }

/* Layout admin */
.admin { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { background: var(--preto-2); border-right: 1px solid rgba(255,255,255,.06); padding: 1.3rem 1rem; display: flex; flex-direction: column; gap: .3rem; position: sticky; top: 0; height: 100vh; overflow: hidden; }
.sidebar .logo { font-size: 1.15rem; font-weight: 800; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.sidebar .logo img { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; }
.sidebar .logo b { color: var(--dourado); }
/* Abas roláveis (o meio da barra) */
.sidebar-nav { display: flex; flex-direction: column; gap: .3rem; overflow-y: auto; flex: 1; min-height: 0; padding-right: 2px; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
/* Rodapé fixo: "ver o site" + "Sair" sempre visíveis */
.sidebar-bottom { display: flex; flex-direction: column; gap: .4rem; flex-shrink: 0; border-top: 1px solid rgba(255,255,255,.06); padding-top: .7rem; margin-top: .3rem; }
.nav-item { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .92rem; cursor: pointer; border: none; background: none; text-align: left; transition: .15s; flex-shrink: 0; }
.nav-item:hover { color: var(--branco); background: rgba(255,255,255,.04); }
.nav-item.ativo { color: var(--preto); background: linear-gradient(135deg, var(--dourado-claro), var(--dourado)); }
.nav-item .ico { width: 18px; text-align: center; }
.sidebar .sair { color: var(--vermelho); width: 100%; }
.sidebar .link-site { font-size: .8rem; color: var(--muted); text-align: center; }

.main { padding: 1.8rem 2rem; overflow-x: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.topbar h2 { font-size: 1.5rem; }
.topbar .hoje { color: var(--muted); font-size: .9rem; }

.card { background: var(--preto-3); border: 1px solid rgba(255,255,255,.07); border-radius: var(--raio); padding: 1.4rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.stat { background: var(--preto-3); border: 1px solid rgba(255,255,255,.07); border-radius: var(--raio); padding: 1.2rem 1.4rem; }
.stat .label { color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.stat .valor { font-size: 1.7rem; font-weight: 800; margin-top: .3rem; color: var(--branco); }
.stat .valor.gold { color: var(--dourado-claro); }
.stat .valor.green { color: var(--verde); }
.stat .valor.red { color: var(--vermelho); }

.tabela { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabela th { text-align: left; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; padding: .6rem .7rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.tabela td { padding: .6rem .7rem; border-bottom: 1px solid rgba(255,255,255,.05); }
.tabela tr:hover td { background: rgba(255,255,255,.02); }
.tabela .acoes { display: flex; gap: .4rem; justify-content: flex-end; }

.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge-entrada { background: rgba(52,209,123,.15); color: var(--verde); }
.badge-saida { background: rgba(255,107,107,.15); color: var(--vermelho); }
.badge-ok { background: rgba(52,209,123,.15); color: var(--verde); }
.badge-alerta { background: rgba(201,161,92,.18); color: var(--dourado-claro); }
.badge-baixo { background: rgba(255,107,107,.15); color: var(--vermelho); }

.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.slot { background: var(--preto-2); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: .7rem; min-height: 74px; display: flex; flex-direction: column; }
.slot .hora { font-weight: 800; color: var(--dourado-claro); font-size: .85rem; }
.slot.livre { opacity: .7; }
.slot.ocupado { border-color: rgba(201,161,92,.4); }
.slot.bloqueado { border-color: rgba(255,107,107,.35); background: rgba(255,107,107,.05); opacity: .75; }
.slot.bloqueado .hora { color: var(--muted); }
.slot.bloqueado .svc { color: var(--vermelho); font-weight: 700; }
.slot.ocupado.pago { border-color: rgba(52,209,123,.5); background: rgba(52,209,123,.06); }
.slot .nome { font-size: .88rem; font-weight: 600; margin-top: .15rem; }
.slot .svc { font-size: .74rem; color: var(--muted); }
.slot .mini-acoes { display: flex; gap: .35rem; margin-top: auto; padding-top: .4rem; flex-wrap: wrap; }
.slot .mini-acoes button { flex: 1; font-size: .72rem; padding: .25rem; white-space: nowrap; }
.valor-line { display: flex; gap: .3rem; align-items: center; }
.valor-input { padding: .25rem .45rem; font-size: .82rem; width: 100%; border-radius: 6px; }
.valor-pendente { font-size: .8rem; color: var(--dourado-claro); font-weight: 700; }

.form-grid { display: grid; gap: .8rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
label.field { display: grid; gap: .35rem; font-size: .82rem; font-weight: 700; color: var(--muted); }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 100; }
.modal-bg[hidden] { display: none; }
.modal { background: var(--preto-3); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 1.6rem; width: min(440px, 100%); max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-bottom: 1rem; font-size: 1.15rem; }
.modal .modal-acoes { display: flex; gap: .6rem; margin-top: 1.2rem; justify-content: flex-end; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--dourado); color: var(--preto); font-weight: 700; padding: .8rem 1.5rem; border-radius: 999px; box-shadow: 0 12px 40px rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: .3s; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.vazio { text-align: center; color: var(--muted); padding: 2rem 0; font-size: .95rem; }

.foto-grupo { margin-bottom: 1.6rem; }
.foto-grupo h3 { margin-bottom: .7rem; font-size: 1.05rem; }
.foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; }
.foto-item { position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden; }
.foto-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-del {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff; border: none;
  font-size: .8rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.foto-del:hover { background: var(--vermelho); }

.svc-chip {
  display: inline-block;
  background: rgba(201,161,92,.12);
  border: 1px solid rgba(201,161,92,.3);
  color: var(--dourado-claro);
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  margin: .1rem .15rem;
  white-space: nowrap;
}
.green { color: var(--verde) !important; }
.red { color: var(--vermelho) !important; }

@media (max-width: 820px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; overflow: visible; }
  .sidebar .logo { margin-bottom: 0; margin-right: auto; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; overflow: visible; width: 100%; }
  .sidebar-bottom { flex-direction: row; align-items: center; width: 100%; border-top: none; padding-top: .3rem; }
  .sidebar .sair { width: auto; margin-left: auto; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .main { padding: 1.2rem 1rem; }
}

.foto-video-wrap { position: relative; width: 100%; height: 100%; }
.foto-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-video-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: 1px solid rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
  pointer-events: none;
}
