/* ============================================================
   Barbearia — Luxury Dark Minimalism
   Design system: dark premium, glass cards, bege #E7D3AE
   ============================================================ */

:root {
  --shell: #cfc5b0;                    /* fundo ao redor do "celular" no desktop */
  --bg: #1C1C1C;
  --bg-2: #232323;
  --card: #2A2A2A;
  --input: #303030;
  --sheet: #2B2B2B;
  --text: #FFFFFF;
  --muted: rgba(255, 255, 255, .55);
  --faint: rgba(255, 255, 255, .35);
  --gold: #E8D7B0;
  --btn: #E7D3AE;
  --btn-text: #222222;
  --border: rgba(255, 255, 255, .06);
  --glass: rgba(255, 255, 255, .04);
  --danger: #e26d5c;
  --success: #86c28b;

  --r-card: 28px;
  --r-btn: 18px;
  --r-input: 20px;
  --r-img: 22px;

  --shadow: 0 10px 35px rgba(0, 0, 0, .25);
  --pad: 24px;      /* padding geral */
  --sec-gap: 28px;  /* entre seções */
  --gap: 16px;      /* entre componentes */

  /* aliases usados pelo admin */
  --surface: #2A2A2A;
  --surface-2: #303030;
  --surface-3: #3A3A3A;
  --gold-2: #cbb287;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* mobile: sem flash azul no toque e sem inflar texto ao girar a tela */
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* toque responde na hora (sem atraso de duplo-toque) */
button, a, input, select, textarea, .pick-row, .day-pill, .time-chip { touch-action: manipulation; }

h1 { font-weight: 700; }
h2, h3, h4 { font-weight: 600; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font-family: inherit; }

.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ico-sm { width: 15px; height: 15px; }
.ico-fill { fill: currentColor; stroke: none; }

/* ---------- Shell tipo celular ---------- */
body.shell { background: var(--shell); }
.phone {
  width: 100%; max-width: 430px; margin: 0 auto;
  background: var(--bg); min-height: 100vh; min-height: 100dvh;
  position: relative; overflow-x: hidden;
}
.phone * { scrollbar-width: none; }
.phone *::-webkit-scrollbar { display: none; }
@media (min-width: 560px) {
  body.shell { padding: 32px 16px; }
  .phone {
    border-radius: 46px; overflow: hidden;
    box-shadow: 0 34px 90px rgba(30, 24, 12, .5), 0 0 0 11px #161616, 0 0 0 13px #39352c;
    min-height: calc(100vh - 64px);
  }
}

/* entrada das telas: fade + slide up 500ms ease-out */
.screen {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  animation: screenIn .5s ease-out;
}
@media (min-width: 560px) { .screen { min-height: calc(100vh - 64px); } }
@keyframes screenIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

/* re-render da mesma tela (seleções): sem animação para não "piscar" */
.no-anim .screen,
.no-anim .cascade > *,
.no-anim .sucesso .check { animation: none !important; }

/* cascata dos cards (delay 50ms incremental) */
.cascade > * { animation: screenIn .5s ease-out backwards; }
.cascade > *:nth-child(1)  { animation-delay: .05s; }
.cascade > *:nth-child(2)  { animation-delay: .10s; }
.cascade > *:nth-child(3)  { animation-delay: .15s; }
.cascade > *:nth-child(4)  { animation-delay: .20s; }
.cascade > *:nth-child(5)  { animation-delay: .25s; }
.cascade > *:nth-child(6)  { animation-delay: .30s; }
.cascade > *:nth-child(7)  { animation-delay: .35s; }
.cascade > *:nth-child(8)  { animation-delay: .40s; }
.cascade > *:nth-child(9)  { animation-delay: .45s; }
.cascade > *:nth-child(10) { animation-delay: .50s; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: none; border-radius: var(--r-btn);
  padding: 0 24px; height: 48px; font-size: 15px; font-weight: 600;
  background: var(--btn); color: var(--btn-text);
  box-shadow: var(--shadow);
  transition: all 250ms ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-2px); box-shadow: 0 14px 40px rgba(0, 0, 0, .32); }
.btn:active { transform: scale(.98); filter: brightness(.98); }
.btn-lg { height: 56px; border-radius: 999px; font-size: 16px; width: 100%; }
.btn-sm { height: 38px; padding: 0 18px; font-size: 13px; border-radius: 14px; }
.btn-ghost { background: transparent; color: var(--gold); border: 1px solid var(--border); box-shadow: none; }
.btn-dark { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); box-shadow: none; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .38; cursor: not-allowed; transform: none !important; filter: none !important; }

/* glass card base */
.glass {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  transition: transform 250ms ease, box-shadow 250ms ease;
}
.glass:hover { transform: translateY(-4px); box-shadow: 0 16px 45px rgba(0, 0, 0, .32); }

/* ============================================================
   TELA 1 — Splash
   ============================================================ */
.welcome {
  justify-content: space-between;
  background:
    linear-gradient(transparent 30%, rgba(0, 0, 0, .65) 75%, rgba(0, 0, 0, .92) 100%),
    var(--wl-img, var(--card)) center 18% / cover no-repeat;
  padding: var(--pad);
  padding-top: calc(28px + env(safe-area-inset-top));
  padding-bottom: calc(34px + env(safe-area-inset-bottom));
}
.welcome .brand {
  font-size: 20px; font-weight: 700; letter-spacing: .4px;
  display: flex; align-items: center; gap: 9px;
}
.welcome .brand .ico { color: var(--gold); }
.welcome-bottom h1 { font-size: 33px; line-height: 1.22; margin-bottom: 28px; letter-spacing: -.5px; }

/* ============================================================
   TELA 2 — Home
   ============================================================ */
.home { padding: var(--pad); padding-top: calc(22px + env(safe-area-inset-top)); padding-bottom: calc(48px + env(safe-area-inset-bottom)); }

.home-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sec-gap); }
.home-head .who { display: flex; align-items: center; gap: 12px; }
.avatar-sm {
  width: 44px; height: 44px; border-radius: 100%; overflow: hidden;
  background: var(--btn); display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--btn-text); box-shadow: var(--shadow);
}
.home-head small { display: block; color: var(--muted); font-size: 12px; font-weight: 300; line-height: 1.3; }
.home-head strong { font-size: 15px; font-weight: 600; }
.head-icons { display: flex; gap: 10px; }
.round-btn {
  width: 42px; height: 42px; border-radius: 100%;
  background: var(--glass); backdrop-filter: blur(20px);
  border: 1px solid var(--border); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: all 250ms ease; box-shadow: none;
}
.round-btn:hover { color: var(--text); transform: translateY(-2px); }
.round-btn:active { transform: scale(.98); }

.big-title { font-size: 29px; font-weight: 700; letter-spacing: -.5px; margin-bottom: 8px; }
.home .lead { color: var(--muted); font-size: 14px; font-weight: 300; margin-bottom: var(--sec-gap); }

/* search + filtro */
.search-row { display: flex; gap: 12px; margin-bottom: var(--sec-gap); }
.search-box {
  flex: 1; display: flex; align-items: center; gap: 12px;
  background: var(--input); border: 1px solid var(--border);
  border-radius: var(--r-input); padding: 0 18px; height: 54px;
  transition: border-color 250ms ease;
}
.search-box:focus-within { border-color: rgba(232, 215, 176, .4); }
.search-box .ico { color: var(--faint); }
.search-box input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 14.5px; min-width: 0;
}
.search-box input::placeholder { color: var(--faint); }
.filter-btn {
  width: 54px; height: 54px; border-radius: var(--r-input);
  background: var(--input); border: 1px solid var(--border); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: all 250ms ease;
}
.filter-btn:hover { color: var(--gold); transform: translateY(-2px); }

.sec-title { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 var(--gap); }
.sec-title h3 { font-size: 17px; font-weight: 600; }
.sec-title small { color: var(--faint); font-size: 12px; font-weight: 300; }
section.blk { margin-bottom: var(--sec-gap); }

/* último agendamento — card horizontal */
.last-appt {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--r-card);
}
.last-appt .ph {
  width: 52px; height: 52px; border-radius: 100%; flex-shrink: 0;
  background: var(--surface-3) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--gold);
}
.last-appt .inf { flex: 1; min-width: 0; }
.last-appt .inf strong { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.last-appt .inf small { color: var(--muted); font-size: 12.5px; font-weight: 300; display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.last-appt .inf .star { color: var(--gold); }

/* promoções — carrossel com deslize automático */
.promo-strip {
  display: flex; gap: var(--gap); overflow-x: auto;
  padding: 4px 4px 10px; margin: -4px -4px 0;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.promo-card { min-width: 265px; padding: 20px; position: relative; flex-shrink: 0; scroll-snap-align: start; }
.promo-dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.promo-dots i {
  width: 6px; height: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  transition: all 250ms ease;
}
.promo-dots i.on { background: var(--btn); width: 20px; }
.promo-card .tag {
  position: absolute; top: 16px; right: 16px;
  background: var(--btn); color: var(--btn-text);
  font-size: 10px; font-weight: 700; letter-spacing: .8px; padding: 4px 11px; border-radius: 999px;
}
.promo-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 8px; padding-right: 56px; }
.promo-card p { color: var(--muted); font-size: 12.5px; font-weight: 300; }
.promo-card .precos { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.promo-card .novo { color: var(--gold); font-size: 20px; font-weight: 700; }
.promo-card .antigo { color: var(--faint); text-decoration: line-through; font-size: 12px; }

/* serviços & preços — lista com separadores elegantes */
.svc-card { padding: 6px 20px; border-radius: var(--r-card); }
.svc-card:hover { transform: none; }
.svc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 0; border-bottom: 1px solid var(--border);
}
.svc-row:last-child { border-bottom: none; }
.svc-row .l { display: flex; align-items: center; gap: 13px; min-width: 0; }
.svc-thumb {
  width: 54px; height: 54px; border-radius: 16px; flex-shrink: 0;
  background: var(--surface-3) center / cover no-repeat;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-size: 20px;
  transition: transform 250ms ease;
}
.svc-row:hover .svc-thumb { transform: scale(1.04); }
.svc-thumb.sm { width: 46px; height: 46px; border-radius: 14px; }
.svc-row .nm { font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.svc-row .mut { color: var(--muted); font-size: 12px; font-weight: 300; display: flex; align-items: center; gap: 5px; }
.svc-row .pr { color: var(--gold); font-weight: 700; font-size: 15px; white-space: nowrap; }

/* cards de barbeiro — imagem ~65% */
.barber-strip { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.barber-card { overflow: hidden; display: flex; flex-direction: column; padding: 0; border-radius: var(--r-card); }
.barber-card .ph {
  height: 168px; position: relative;
  background: var(--surface-3) center / cover no-repeat;
  border-radius: var(--r-img) var(--r-img) 0 0;
}
.barber-card .ph .rate {
  position: absolute; top: 10px; left: 10px;
  display: flex; align-items: center; gap: 4px;
  background: rgba(20, 20, 20, .65); backdrop-filter: blur(10px);
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; color: var(--gold);
}
.barber-card .ph .fav {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px; border-radius: 100%;
  background: rgba(20, 20, 20, .55); backdrop-filter: blur(10px);
  border: none; color: rgba(255, 255, 255, .75);
  display: flex; align-items: center; justify-content: center;
  transition: all 250ms ease;
}
.barber-card .ph .fav:hover { color: #ff8f8f; }
.barber-card .inf { padding: 13px 14px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.barber-card .open { font-size: 11px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.barber-card .open .st-open { color: var(--success); }
.barber-card .open .st-closed { color: var(--danger); }
.barber-card .open span.hrs { color: var(--faint); font-weight: 300; }
.barber-card .inf strong { font-size: 14.5px; font-weight: 600; }
.barber-card .inf small { color: var(--muted); font-size: 11.5px; font-weight: 300; display: flex; align-items: center; gap: 5px; }
.barber-card .btn { margin-top: 11px; height: 40px; font-size: 12.5px; border-radius: 14px; box-shadow: none; }

/* rodapé */
.app-footer { text-align: center; color: var(--muted); font-size: 12.5px; font-weight: 300; padding-top: 6px; }
.app-footer .contatos { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.app-footer a { color: var(--gold); }
.app-footer .admin-link { opacity: .55; font-size: 11.5px; color: var(--muted); }

.aviso-vazio { color: var(--muted); text-align: center; padding: 18px; font-size: 13.5px; font-weight: 300; }

/* ============================================================
   TELA 3 — Agendamento (bottom sheet)
   ============================================================ */
.barber-screen { padding: 0; }
.bs-photo {
  height: 46vh; min-height: 300px; position: relative; flex-shrink: 0;
  background: var(--bs-img, var(--surface-3)) center 12% / cover no-repeat;
}
.bs-photo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(transparent 55%, rgba(0, 0, 0, .45) 100%);
}
.bs-photo .back {
  position: absolute; top: calc(20px + env(safe-area-inset-top)); left: 18px; z-index: 2;
  width: 40px; height: 40px; border-radius: 100%;
  background: rgba(20, 20, 20, .5); backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .1); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all 250ms ease;
}
.bs-photo .back:active { transform: scale(.98); }
.bs-photo .avatar-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 90px; font-weight: 700; color: rgba(232, 215, 176, .4);
}

/* bottom sheet */
.bs-panel {
  margin-top: -34px; position: relative; z-index: 2;
  background: var(--sheet); border-radius: 32px 32px 0 0;
  box-shadow: 0 -14px 40px rgba(0, 0, 0, .3);
  padding: 26px var(--pad) 130px; flex: 1;
  display: flex; flex-direction: column; gap: var(--sec-gap);
}
.bs-panel .grab { width: 42px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); margin: -8px auto 0; }

.badge-exp {
  display: inline-block; background: var(--btn); color: var(--btn-text);
  font-size: 11px; font-weight: 700; padding: 5px 13px; border-radius: 9px;
  width: fit-content; margin-bottom: 10px;
}
.bs-head h1 { font-size: 27px; letter-spacing: -.5px; margin-bottom: 6px; }
.bs-head .rate-line { color: var(--muted); font-size: 13px; font-weight: 300; display: flex; align-items: center; gap: 6px; }
.bs-head .rate-line b { color: var(--gold); font-weight: 700; }
.bs-head .rate-line .star { color: var(--gold); }

.bs-sec h4 { font-size: 15px; font-weight: 600; margin-bottom: var(--gap); }
.bs-sec h4 small { color: var(--faint); font-weight: 300; font-size: 12px; }

/* dias — círculos */
.day-row { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 6px; }
.day-pill {
  background: none; border: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 300; flex-shrink: 0;
  transition: color 250ms ease;
}
.day-pill b {
  width: 44px; height: 44px; border-radius: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border);
  font-size: 14.5px; font-weight: 600; color: var(--text);
  transition: all 250ms ease;
}
.day-pill:hover b { transform: translateY(-2px); }
.day-pill.sel { color: var(--gold); font-weight: 600; }
.day-pill.sel b { background: var(--btn); color: var(--btn-text); border-color: transparent; box-shadow: var(--shadow); }

/* horários — pills */
.time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.time-chip {
  height: 42px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border); color: var(--muted);
  font-size: 13px; font-weight: 400;
  transition: all 250ms ease;
}
.time-chip:hover { filter: brightness(1.15); transform: translateY(-2px); }
.time-chip.sel { background: var(--btn); border-color: transparent; color: var(--btn-text); font-weight: 700; box-shadow: var(--shadow); }
.time-empty { color: var(--muted); font-size: 13px; font-weight: 300; text-align: center; padding: 14px 0; }

/* serviços selecionáveis */
.pick-list { border-radius: var(--r-card); padding: 4px 20px; }
.pick-row {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: opacity 250ms ease;
}
.pick-row:last-child { border-bottom: none; }
.pick-row .ck {
  width: 22px; height: 22px; border-radius: 100%;
  border: 1.5px solid rgba(255, 255, 255, .2);
  display: flex; align-items: center; justify-content: center;
  color: transparent; transition: all 250ms ease; flex-shrink: 0;
}
.pick-row.sel .ck { background: var(--btn); border-color: transparent; color: var(--btn-text); }
.pick-row .nm { font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.pick-row .mut { color: var(--muted); font-size: 12px; font-weight: 300; }
.pick-row .pr { color: var(--gold); font-weight: 700; white-space: nowrap; margin-left: auto; }

/* barra fixa de total */
.total-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  max-width: 430px; margin: 0 auto;
  background: rgba(28, 28, 28, .88);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 15px var(--pad) calc(15px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: var(--gap);
}
@media (min-width: 560px) { .total-bar { bottom: 32px; border-radius: 0 0 46px 46px; } }
.total-bar .tt small { display: block; color: var(--muted); font-size: 11px; font-weight: 300; }
.total-bar .tt strong { color: var(--gold); font-size: 20px; font-weight: 700; }

/* ============================================================
   Checkout / sucesso
   ============================================================ */
.chk { padding: var(--pad); padding-top: calc(var(--pad) + env(safe-area-inset-top)); padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
.chk .top-row { display: flex; align-items: center; gap: 14px; margin-bottom: var(--sec-gap); }
.chk .top-row .back {
  width: 40px; height: 40px; border-radius: 100%;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  display: flex; align-items: center; justify-content: center; transition: all 250ms ease;
}
.chk .top-row .back:active { transform: scale(.98); }
.chk h1 { font-size: 22px; letter-spacing: -.3px; }

.resumo { padding: 20px 22px; margin-bottom: var(--sec-gap); font-size: 14px; border-radius: var(--r-card); }
.resumo:hover { transform: none; }
.resumo div { display: flex; justify-content: space-between; padding: 4px 0; gap: 12px; }
.resumo .mut { color: var(--muted); font-weight: 300; }
.resumo .total { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 12px; font-weight: 700; color: var(--gold); font-size: 16px; }

.field { margin-bottom: var(--gap); }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--input); border: 1px solid var(--border);
  border-radius: var(--r-input); padding: 15px 18px; color: var(--text); font-size: 15px;
  outline: none; transition: border-color 250ms ease;
}
.field input:focus, .field select:focus { border-color: rgba(232, 215, 176, .4); }

.sucesso { text-align: center; padding: 90px var(--pad) 48px; }
.sucesso .check {
  width: 80px; height: 80px; margin: 0 auto 24px; border-radius: 100%;
  background: rgba(134, 194, 139, .12); border: 1.5px solid var(--success);
  display: flex; align-items: center; justify-content: center; color: var(--success);
  animation: screenIn .5s ease-out .1s backwards;
}
.sucesso .check .ico { width: 34px; height: 34px; }
.sucesso h1 { font-size: 25px; margin-bottom: 12px; letter-spacing: -.4px; }
.sucesso p { color: var(--muted); font-size: 14px; font-weight: 300; margin-bottom: 10px; }
.sucesso .fid { color: var(--gold); }

/* ============================================================
   ADMIN
   ============================================================ */

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(232, 215, 176, .07), transparent 60%), var(--bg);
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 36px; box-shadow: var(--shadow);
}
.login-card h1 { font-size: 23px; text-align: center; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.login-err { color: var(--danger); font-size: 13px; text-align: center; margin-top: 12px; min-height: 18px; }

.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex-shrink: 0;
  background: var(--bg-2); border-right: 1px solid var(--border);
  padding: 24px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { font-size: 18px; font-weight: 700; padding: 0 10px 18px; }
.sidebar button.tab {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; color: var(--muted);
  padding: 11px 12px; border-radius: 14px; font-size: 14px; text-align: left;
  transition: all 250ms ease; width: 100%;
}
.sidebar button.tab:hover { color: var(--text); background: var(--glass); }
.sidebar button.tab.on { background: rgba(232, 215, 176, .1); color: var(--gold); font-weight: 600; }
.sidebar .spacer { flex: 1; }

.admin-main { flex: 1; padding: 30px; min-width: 0; }
.admin-main h2 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.admin-main .sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.admin-head-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 24px;
}

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 18px 20px;
}
.stat-card .num { font-size: 23px; font-weight: 700; color: var(--gold); }
.stat-card .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
th {
  text-align: left; padding: 13px 16px; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td .mut { color: var(--muted); font-size: 13px; }

.status-pill {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px;
  white-space: nowrap;
}
.st-pendente { background: rgba(232, 215, 176, .13); color: var(--gold); }
.st-confirmado { background: rgba(110, 168, 226, .14); color: #8db7e0; }
.st-concluido { background: rgba(134, 194, 139, .14); color: var(--success); }
.st-cancelado { background: rgba(226, 109, 92, .14); color: var(--danger); }

.acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.icon-btn {
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 6px 10px; font-size: 13px;
  transition: all 250ms ease;
}
.icon-btn:hover { border-color: var(--gold-2); transform: translateY(-1px); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

.fidelidade-bar { background: var(--surface-3); height: 8px; border-radius: 6px; overflow: hidden; min-width: 90px; }
.fidelidade-bar > div { height: 100%; background: var(--btn); border-radius: 6px; }

.chip-btn {
  background: var(--input); border: 1px solid var(--border); color: var(--text);
  border-radius: 14px; padding: 10px 6px; font-size: 14px; text-align: center;
  transition: all 250ms ease;
}
.chip-btn.sel { border-color: var(--gold); background: rgba(232, 215, 176, .12); color: var(--gold); font-weight: 700; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-card);
  width: 100%; max-width: 480px; padding: 28px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow); animation: screenIn .3s ease-out;
}
.modal h3 { font-size: 19px; margin-bottom: 20px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.hidden { display: none !important; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--bg-2); border: 1px solid rgba(232, 215, 176, .4); color: var(--text);
  padding: 13px 26px; border-radius: 999px; font-size: 14px; z-index: 200;
  box-shadow: var(--shadow); animation: toastIn 250ms ease; max-width: 90vw; text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.mobile-topbar { display: none; }

@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .admin-layout { flex-direction: column; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 90;
    transform: translateX(-100%); transition: transform 250ms ease;
    width: 240px; height: 100vh; height: 100dvh;
    padding-top: calc(24px + env(safe-area-inset-top));
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; padding-top: calc(14px + env(safe-area-inset-top));
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 60;
  }
  .mobile-topbar .brand { font-size: 17px; font-weight: 700; }
  .mobile-topbar button { background: none; border: none; color: var(--text); font-size: 24px; padding: 4px 10px; }
  .admin-main { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 85; }
}

/* ============================================================
   Otimizações mobile
   ============================================================ */

/* iOS dá zoom automático em campos com fonte < 16px — evita isso no celular */
@media (max-width: 559px) {
  .field input, .field select, .field textarea,
  .search-box input, .login-card input { font-size: 16px; }

  /* títulos fluidos: nunca estouram em telas estreitas (ex.: 320–360px) */
  .welcome-bottom h1 { font-size: clamp(26px, 8.5vw, 33px); }
  .big-title { font-size: clamp(24px, 7.5vw, 29px); }
  .bs-head h1 { font-size: clamp(22px, 7vw, 27px); }

  /* foto do barbeiro um pouco menor para sobrar mais espaço útil */
  .bs-photo { height: 40dvh; min-height: 260px; }
}

/* efeitos de hover só em aparelhos com mouse — no toque eles "grudam" */
@media (hover: none) {
  .btn:hover, .glass:hover, .round-btn:hover, .filter-btn:hover,
  .day-pill:hover b, .time-chip:hover, .svc-row:hover .svc-thumb,
  .icon-btn:hover { transform: none; filter: none; box-shadow: var(--shadow); }
  .glass:hover { box-shadow: var(--shadow); }
  .btn:active, .time-chip:active, .day-pill:active b { transform: scale(.97); }
}

/* rolagem confortável em listas horizontais (dias, promoções) */
.promo-strip, .day-row { overscroll-behavior-x: contain; scrollbar-width: none; }
.promo-strip::-webkit-scrollbar, .day-row::-webkit-scrollbar { display: none; }
