:root {
  --bg: #0a1630;
  --surface: #0f1f40;
  --surface-2: #14274f;
  --line: #2a4380;
  --text: #f3f1ea;
  --muted: #aebbd8;
  --accent: #e3b341;
  --accent-ink: #1a1403;
  --gold-card: rgba(227, 179, 65, .5);
  --danger: #b4322a;
  --danger-soft: #3a1714;
  --danger-text: #ff8d84;
  --ok: #2f8f5b;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  padding-bottom: 44px; min-height: 100vh;
}
h1 { font-size: 1.35rem; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { margin: 0 0 .75rem; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* rodapé obrigatório */
.sc-footer { position: fixed; right: 10px; bottom: 6px; font-size: .68rem; color: var(--muted); z-index: 5; pointer-events: none; letter-spacing: .03em; text-shadow: 0 0 6px var(--bg), 0 0 6px var(--bg); }

/* menu lateral (gaveta no celular) */
.sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 250px; z-index: 30; display: flex; flex-direction: column; gap: 6px; padding: 14px 10px; overflow-y: auto; background: rgba(8, 18, 40, .95); border-right: 1px solid var(--line); transform: translateX(-105%); transition: transform .2s ease; }
body.drawer-open .sidebar { transform: none; }
.scrim { display: none; position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .6); }
body.drawer-open .scrim { display: block; }
.side-brand { font-weight: 700; font-size: 1.15rem; color: var(--accent); padding: 0 6px; }
.side-footer { padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.side-user { font-size: .9rem; font-weight: 600; padding: 0 6px; overflow-wrap: anywhere; }
.side-bio { padding: 0 2px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-link { color: var(--text); text-decoration: none; padding: 10px 12px; border-radius: 8px; min-height: 44px; display: flex; align-items: center; }
.side-link:hover { background: var(--surface-2); }
.side-link.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.side-sub { display: flex; flex-direction: column; margin: 2px 0 6px 14px; border-left: 2px solid var(--line); }
.side-sub a { color: var(--muted); text-decoration: none; padding: 9px 12px; min-height: 40px; display: flex; align-items: center; font-size: .92rem; }
.side-sub a.active { color: var(--accent); font-weight: 600; }
.side-actions { display: flex; gap: 8px; }
.mobilebar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(8, 18, 40, .95); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
main { max-width: 1100px; margin: 0 auto; padding: 14px 12px; }
@media (min-width: 900px) {
  .sidebar { transform: none; }
  .content { margin-left: 250px; }
  .mobilebar, .scrim, body.drawer-open .scrim { display: none; }
}

/* componentes */
.card { background: rgba(15, 31, 64, .92); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field-label { font-size: .85rem; color: var(--muted); }
.hint { color: var(--muted); font-size: .78rem; }
input, select, textarea {
  width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; font: inherit; min-height: 44px;
}
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }
input[type=file] { padding: 8px; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; min-height: 110px; }
.check { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; background: var(--accent); color: var(--accent-ink); border: 1px solid #f0c85a; border-radius: 8px; padding: 10px 14px; min-height: 44px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover:not(:disabled) { background: #f0c85a; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-wrap .eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 40px; background: transparent; border: 0; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.btn.small { min-height: 36px; padding: 6px 10px; font-size: .85rem; }
.btn.block { width: 100%; }

.tag { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.tag.DEV { color: #8bb4ff; border-color: #2a4a86; }
.tag.ADM { color: var(--accent); border-color: #7a5f17; }
.tag.USE { color: #7fd6a2; border-color: #1f6b43; }
.tag.off { color: var(--danger-text); border-color: var(--danger); }

.list-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list-row:last-child { border-bottom: 0; }
.list-row .name { flex: 1; min-width: 140px; }
.scroll-y { max-height: 60vh; overflow-y: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; position: sticky; top: 0; background: var(--surface); }

.stat { background: rgba(20, 39, 79, .92); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat .v { font-size: 1.5rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .8rem; }

/* modais e toasts */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; padding: 12px; z-index: 50; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; width: min(440px, 100%); max-height: 92vh; overflow-y: auto; }
.modal.wide { width: min(760px, 100%); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
#toasts { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 80; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: var(--ok); color: #fff; padding: 10px 14px; border-radius: 8px; max-width: 420px; }
.toast.err { background: var(--danger); }
.error { color: var(--danger-text); min-height: 1.2em; font-size: .9rem; }

/* login */
.login { max-width: 380px; margin: 12vh auto 0; padding: 0 14px; }

/* agenda */
.week { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; scroll-snap-type: x proximity; }
.day-col { flex: 0 0 min(78vw, 230px); scroll-snap-align: start; }
.day-col.slim { flex-basis: min(78vw, 270px); }
.day-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 600; padding: 6px 8px; background: var(--surface-2); border-radius: 8px; margin-bottom: 8px; }
.day-cards { display: flex; flex-direction: column; gap: 6px; max-height: 62vh; overflow-y: auto; padding-right: 2px; }
.slot { border-radius: 10px; padding: 8px 10px; border: 1px solid var(--line); text-align: left; width: 100%; color: var(--text); font: inherit; background: transparent; }
.slot .t { font-weight: 600; font-size: .9rem; }
.slot.free { opacity: .55; background: rgba(15, 31, 64, .7); cursor: pointer; min-height: 52px; }
.slot.free:hover { opacity: .9; }
.slot.free.past { opacity: .3; }
.slot.booked, .slot.mine { background: rgba(227, 179, 65, .28); border-color: rgba(227, 179, 65, .7); cursor: pointer; }
.slot.unavailable { opacity: .4; background: rgba(15, 31, 64, .7); cursor: default; }
.slot.dur60 { min-height: 104px; }
.slot .who { font-size: .88rem; word-break: break-word; }
.slot .btn { margin-top: 6px; }
.btn.cancel, .btn.cancel:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-text); }
.seg { display: flex; gap: 8px; margin-bottom: 10px; }
.seg .btn { flex: 1; }
.seg .btn { opacity: .55; }
.seg .btn.sel { opacity: 1; outline: 2px solid #fff; outline-offset: 1px; }

/* perfil */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .btn { position: absolute; right: 4px; top: 4px; }
.thumb .cap { position: absolute; left: 0; bottom: 0; right: 0; font-size: .7rem; background: rgba(0,0,0,.65); padding: 2px 6px; }
.upload-slot { display: flex; flex-direction: column; gap: 6px; }
.upload-slot .thumb { aspect-ratio: 1; }

/* gráficos */
.chart-box { position: relative; height: 260px; }

/* área pública */
.protected img { -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; pointer-events: none; }
.protected .thumb, .protected .shield { position: relative; }
.shield { position: absolute; inset: 0; z-index: 2; }
body.public { background: var(--bg); }
.hero { position: fixed; inset: 0; z-index: -1; background-size: cover; background-position: center; opacity: .35; }
.center-col { max-width: 420px; margin: 0 auto; padding: 14vh 16px 16px; display: flex; flex-direction: column; gap: 14px; }
button.big-btn { width: 100%; font-family: inherit; cursor: pointer; }
.big-btn { display: block; text-align: center; padding: 18px; font-size: 1.15rem; background: var(--accent); border: 1px solid #f0c85a; color: var(--accent-ink); font-weight: 700; border-radius: 14px; text-decoration: none; }
.models { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.model { text-decoration: none; color: var(--text); text-align: center; }
.model .thumb { aspect-ratio: 3/4; margin-bottom: 6px; }
.learn-more { margin: 12px 0; }
.learn-more h2 { margin-bottom: 6px; }
.learn-more p { margin: 0 0 6px; word-break: break-all; }
.slot.blocked { background: repeating-linear-gradient(45deg, rgba(15, 31, 64, .8), rgba(15, 31, 64, .8) 8px, rgba(42, 67, 128, .35) 8px, rgba(42, 67, 128, .35) 16px); border-color: var(--line); color: var(--muted); }
/* botão Bloquear/Desbloquear à direita do card */
.slot.free, .slot.blocked { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.day-title { flex: 1; text-align: center; min-width: 0; }
.day-head .btn { flex: none; }
.slot-text { min-width: 0; }
.slot.free .btn, .slot.blocked .btn { margin-top: 0; flex: none; }
.pending-tag { color: var(--accent); font-size: .8rem; font-weight: 600; }
.reply { margin: 8px 0 0 18px; padding-left: 10px; border-left: 2px solid rgba(227, 179, 65, .7); }
.reply strong { color: var(--accent); }
.flames { display: flex; gap: 6px; margin-bottom: 10px; }
.flame { font-size: 1.5rem; line-height: 1; background: transparent; border: 1px solid var(--line); border-radius: 10px; width: 48px; height: 48px; cursor: pointer; filter: grayscale(1); opacity: .5; }
.flame.on { filter: none; opacity: 1; border-color: var(--accent); }
.flame:disabled { cursor: not-allowed; }
.testimonials { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.testimonial { background: rgba(227, 179, 65, .28); border: 1px solid rgba(227, 179, 65, .7); border-radius: 10px; padding: 10px 12px; }
.testimonial p { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 0; }
.faq-q { width: 100%; text-align: left; background: transparent; border: 0; color: var(--text); font: inherit; font-weight: 600; padding: 12px 4px; min-height: 44px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.faq-q::after { content: '+'; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq-q[aria-expanded=true]::after { content: '−'; }
.faq-answer { margin: 0 4px 12px; color: var(--muted); white-space: pre-wrap; }
.bubble { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; max-width: 90%; }
.bubble p { margin: 4px 0 0; white-space: pre-wrap; word-break: break-word; }
.bubble.reply { margin-left: auto; background: rgba(227, 179, 65, .22); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 60; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.lightbox .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); font-size: 2rem; background: rgba(0,0,0,.5); color: #fff; border: 1px solid var(--line); border-radius: 50%; width: 48px; height: 48px; cursor: pointer; z-index: 3; }
.lightbox .prev { left: 8px; }
.lightbox .next { right: 8px; }
.lightbox .x { position: absolute; top: 8px; right: 8px; z-index: 3; }
.blur-on-hide .protected { filter: blur(24px); }

@media (min-width: 720px) {
  .day-col { flex-basis: 210px; }
  .brand { font-size: 1.1rem; }
}
@media print { body * { display: none !important; } }

/* concordância com Termos/Políticas e visualização dos PDFs */
.agree { margin: 4px 0 10px; }
.agree .check { align-items: flex-start; font-size: .88rem; line-height: 1.35; }
.agree input[type=checkbox] { margin-top: 2px; flex: none; }
.doc-link { color: var(--accent); font-weight: 700; text-decoration: underline; }
.doc-frame { width: 100%; height: 62vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.btn.compact { font-size: .8rem; padding: 8px 10px; }

/* botões do alto da página não encostam nos cards abaixo */
main > div > .row.between, main > div > .row:first-child { margin-bottom: 14px; }
main > div > h1 { margin-bottom: 14px; }

/* relações em colunas (usuários, clientes) com botões à direita */
.grid-table td.actions, .grid-table th.actions { text-align: right; white-space: nowrap; }
.grid-table td.actions .row { justify-content: flex-end; flex-wrap: nowrap; }
.grid-table td { vertical-align: middle; }

/* agenda: 6 colunas visíveis em tela larga */
@media (min-width: 900px) {
  .week .day-col { flex: 0 0 calc((100% - 5 * 10px) / 6); min-width: 150px; }
  .week .day-col.slim { flex: 0 0 calc((100% - 3 * 10px) / 4); }
}

/* Disponíveis Agora: fotos empilhadas com o próximo horário ao lado */
.now-list { display: flex; flex-direction: column; gap: 14px; }
.now-item { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); background: rgba(15, 31, 64, .88); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.now-item .thumb { flex: 0 0 120px; width: 120px; aspect-ratio: 3/4; }
.now-info { display: flex; flex-direction: column; gap: 4px; }
.now-time { font-size: 1.8rem; font-weight: 700; color: var(--accent); }

/* botões do topo afastados dos textos (internas e área de clientes) */
main > .btn:first-child, main > a.btn:first-child { margin-bottom: 18px; }
main > div > .row { margin-bottom: 14px; }
main > div > h1 + p, main > h1 + p { margin-top: 0; }
.now-btn { margin: 28px 0 8px; }
.now-btn .btn { display: inline-flex; }
