:root {
  --bg: #0c0c0b;
  --bg-elevated: #121211;
  --bg-card: #161614;
  --bg-card-hover: #1c1c1a;
  --bg-input: #141412;
  --primary: #c29f60;
  --primary-bright: #d4b27a;
  --primary-dim: rgba(194, 159, 97, 0.12);
  --text: #f2f0e9;
  --text-secondary: #c8c5bc;
  --text-muted: #8a8780;
  --border: #252522;
  --border-subtle: #1e1e1c;
  --success: #34d399;
  --danger: #f87171;
  --radius: 12px;
  --radius-lg: 16px;
  --font-display: 'Barlow Condensed', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --app-max: 720px;
  --topbar-h: 72px;
  --tabs-h: 64px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scrollbar-width: thin; scrollbar-color: #333 transparent; }
html::-webkit-scrollbar { width: 8px; }
html::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }
.hidden { display: none !important; }

/* Sessão ativa: não mostra login no primeiro paint (evita flash) */
html.has-session #loginScreen {
  display: none !important;
}
html.has-session #app.hidden {
  display: flex !important;
}

/* ========== LOGIN ========== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(700px 420px at 80% 0%, rgba(194,159,96,.18), transparent 70%),
    radial-gradient(500px 360px at 0% 40%, rgba(194,159,96,.07), transparent 70%),
    var(--bg);
}
/* Listras diagonais estilo poste de barbeiro */
.login-screen::before {
  content: "";
  position: absolute;
  inset: -14% 0;
  z-index: -2;
  background: repeating-linear-gradient(
    -55deg,
    rgba(194,159,96,.07) 0 2px,
    transparent 2px 30px
  );
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 75% 30%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 75% 30%, #000, transparent 75%);
  pointer-events: none;
}
/* Máquina de cortar cabelo flutuando (igual à do site de agendamento) */
.hero-mark {
  position: absolute;
  z-index: -1;
  right: -18%;
  top: 55%;
  width: min(78vw, 340px);
  transform: translateY(-50%) rotate(-8deg);
  --mark-opacity: 0.22;
  --mark-filter: drop-shadow(0 0 36px rgba(194,159,96,.4));
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
  will-change: transform;
  /* Esfumaçado suave de baixo pra cima: a própria máquina some aos poucos, sem faixa nem borda */
  -webkit-mask-image: linear-gradient(to bottom,
    #000 28%, rgba(0,0,0,.97) 33%, rgba(0,0,0,.9) 38%, rgba(0,0,0,.78) 43%,
    rgba(0,0,0,.63) 48%, rgba(0,0,0,.47) 53%, rgba(0,0,0,.32) 58%,
    rgba(0,0,0,.19) 63%, rgba(0,0,0,.09) 68%, rgba(0,0,0,.03) 73%, transparent 78%);
  mask-image: linear-gradient(to bottom,
    #000 28%, rgba(0,0,0,.97) 33%, rgba(0,0,0,.9) 38%, rgba(0,0,0,.78) 43%,
    rgba(0,0,0,.63) 48%, rgba(0,0,0,.47) 53%, rgba(0,0,0,.32) 58%,
    rgba(0,0,0,.19) 63%, rgba(0,0,0,.09) 68%, rgba(0,0,0,.03) 73%, transparent 78%);
}
.hero-mark-img {
  display: block;
  width: 100%;
  height: auto;
  opacity: var(--mark-opacity);
  filter: var(--mark-filter);
}
.hero-mark-shine {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
@keyframes float {
  0%, 100% { transform: translateY(-50%) rotate(-8deg); }
  50% { transform: translateY(-54%) rotate(-4deg); }
}
@media (min-width: 900px) {
  .hero-mark {
    right: 2%;
    top: 75%;
    width: min(40vw, 480px);
    --mark-opacity: 0.34;
    --mark-filter: drop-shadow(0 0 50px rgba(194,159,96,.45));
    transform: translateY(-50%) rotate(-9deg);
  }
  @keyframes float {
    0%, 100% { transform: translateY(-50%) rotate(-9deg); }
    50% { transform: translateY(-54%) rotate(-5deg); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-mark { animation: none !important; }
  .hero-mark-shine { display: none; }
}
.login-card {
  position: relative;
  z-index: 2;
  width: min(400px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.login-brand { display: flex; justify-content: center; margin-bottom: 1.75rem; }
.login-brand .logo-group {
  display: flex; align-items: center; gap: 0.35rem;
}
.login-brand .logo-img {
  width: 56px; height: 56px; object-fit: contain; border-radius: 50%; flex-shrink: 0;
}
.login-brand .logo-text p:first-child {
  font-size: 1.45rem; font-weight: 800; line-height: 1.15; margin: 0;
}
.logo-next { color: var(--text); }
.logo-barber { color: var(--primary); }
.login-brand .logo-text p:last-child {
  font-size: 0.8rem; color: var(--text-muted); margin: 0.15rem 0 0;
}
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > .ic {
  position: absolute; left: 0.95rem; color: var(--text-muted); pointer-events: none;
  transition: color 0.2s;
}
.input-icon:focus-within > .ic { color: var(--primary); }
.input-icon .input { padding-left: 2.8rem; padding-right: 2.8rem; }
.input-icon .toggle-pass {
  position: absolute; right: 0.9rem; width: 28px; height: 28px;
  display: grid; place-items: center; color: var(--text-muted);
  background: none; border: 0; border-radius: 0; box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s;
}
.input-icon .toggle-pass:hover,
.input-icon .toggle-pass:focus,
.input-icon .toggle-pass:active { color: var(--text); background: none; outline: none; }
.input-icon .toggle-pass:focus-visible { color: var(--primary); }
.btn-primary .ic { flex: none; }
.login-error {
  background: rgba(248,113,113,0.12);
  border: 1px solid rgba(248,113,113,0.3);
  color: var(--danger);
  font-size: 0.85rem; padding: 0.65rem 0.85rem; border-radius: 8px;
  margin-bottom: 1rem; text-align: center;
}
.login-hint { margin-top: 1.25rem; font-size: 0.8rem; color: var(--text-muted); text-align: center; }
.login-hint strong { color: var(--primary); }
.login-back {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  text-align: center; margin-top: 1rem;
  font-size: 0.88rem; color: var(--text-muted);
}
.login-back { transition: color 0.2s; text-decoration: none; }
.login-back-txt {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1.5px;
  padding-bottom: 2px;
  transition: background-size 0.3s var(--ease);
}
.login-back:hover { color: var(--primary); }
.login-back:hover .login-back-txt,
.login-back:focus-visible .login-back-txt { background-size: 100% 1.5px; }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(12,12,11,0.25);
  border-top-color: #0c0c0b;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.6s linear infinite;
  vertical-align: middle; margin-right: 0.35rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== TOAST DO LOGIN ========== */
.login-toasts {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(340px, calc(100vw - 2rem));
  pointer-events: none;
}
.login-toast {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 0.9rem 1.15rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(0,0,0,0.55);
  pointer-events: auto;
  animation: loginToastIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.login-toast.leaving {
  animation: loginToastOut 0.4s cubic-bezier(0.5, 0, 0.75, 0) both;
  pointer-events: none;
}
.login-toast-icon {
  flex: none;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(248,113,113,0.14);
  color: var(--danger);
  font-size: 1.15rem;
}
.login-toast-body { min-width: 0; flex: 1; }
.login-toast-close {
  flex: none;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: background 0.2s, color 0.2s;
}
.login-toast-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.login-toast-body b {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.login-toast-body span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.login-toast-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--danger);
  transform-origin: left center;
  animation: loginToastBar var(--toast-duration, 4500ms) linear both;
}
/* entra deslizando da direita, de fora da tela; sai pelo mesmo caminho */
@keyframes loginToastIn {
  from { opacity: 0; transform: translateX(calc(100% + 1.5rem)); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes loginToastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(calc(100% + 1.5rem)); }
}
@keyframes loginToastBar {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
/* celular: entra e sai pelo topo */
@media (max-width: 520px) {
  .login-toasts { top: 0.75rem; right: 0.75rem; left: 0.75rem; width: auto; }
  @keyframes loginToastIn {
    from { opacity: 0; transform: translateY(calc(-100% - 1rem)); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes loginToastOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(calc(-100% - 1rem)); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .login-toast { animation: loginToastFade 0.2s both; }
  .login-toast.leaving { animation: loginToastFadeOut 0.2s both; }
  .login-toast-bar { animation: none; }
  @keyframes loginToastFade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes loginToastFadeOut { from { opacity: 1; } to { opacity: 0; } }
}

/* ========== APP SHELL ========== */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: var(--app-max);
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 0 1px var(--border);
}

/* Desktop: centraliza o app como um painel sólido */
@media (min-width: 768px) {
  body {
    background:
      radial-gradient(ellipse 70% 50% at 50% 0%, rgba(194,159,97,0.05), transparent 55%),
      #090908;
  }
  .app {
    min-height: 100vh;
    max-width: var(--app-max);
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: 0 0 80px rgba(0,0,0,0.5);
  }
}

/* Topbar — fixo no topo do app */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: rgba(12,12,11,0.95);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #0c0c0b;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.topbar-left strong {
  display: block;
  font-size: 1rem;
  line-height: 1.25;
}
.topbar-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Tabs — grudadas logo abaixo do topbar */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  top: var(--topbar-h);
  z-index: 40;
  flex-shrink: 0;
  height: var(--tabs-h);
}
.tab {
  flex: 1;
  height: 100%;
  padding: 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.tab i { font-size: 1.15rem; }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab:hover:not(.active) {
  color: var(--text-secondary);
}

/* Conteúdo */
.content {
  padding: 1.35rem 1.25rem 2.5rem;
  flex: 1;
}
.tab-panel { display: none; }
.tab-panel.active {
  display: block;
  animation: fadeIn 0.25s var(--ease);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.day-header { margin-bottom: 1.15rem; }
.day-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}
.day-count {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.2rem;
}
.text-muted {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.35rem;
}
.mini-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 0.5rem;
  text-align: center;
}
.mini-stat span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.mini-stat strong {
  font-size: 1.15rem;
  font-family: var(--font-display);
  font-weight: 700;
}

/* Booking cards */
.booking-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.booking-card {
  background: linear-gradient(165deg, var(--bg-card) 0%, #131311 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.15rem 1.2rem 1.05rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.booking-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--border);
  border-radius: 3px 0 0 3px;
}
.booking-card.confirmed {
  border-color: rgba(194,159,97,0.28);
  box-shadow: 0 0 0 1px rgba(194,159,97,0.06);
}
.booking-card.confirmed::before {
  background: linear-gradient(180deg, var(--primary), rgba(194,159,97,0.35));
}
.booking-card.done {
  opacity: 0.72;
}
.booking-card.done::before {
  background: var(--success);
}
.booking-card.noshow {
  opacity: 0.58;
  border-color: rgba(248,113,113,0.22);
}
.booking-card.noshow::before {
  background: var(--danger);
}

.booking-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  gap: 0.75rem;
}
.booking-time-block {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}
.booking-time {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
  line-height: 1;
}
.booking-duration {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.32rem 0.55rem;
  border-radius: 6px;
  flex-shrink: 0;
}
.badge.confirmed {
  background: var(--primary-dim);
  color: var(--primary);
  border: 1px solid rgba(194,159,97,0.25);
}
.badge.done {
  background: rgba(52,211,153,0.12);
  color: var(--success);
  border: 1px solid rgba(52,211,153,0.25);
}
.badge.noshow {
  background: rgba(248,113,113,0.1);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.22);
}
.badge.cancelled {
  background: rgba(138,135,128,0.12);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.booking-info {
  margin-bottom: 0.7rem;
  min-width: 0;
}
.booking-info strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.booking-service {
  display: block;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.35;
}
.booking-service em {
  font-style: normal;
  color: var(--text-secondary);
  opacity: 0.85;
}
.booking-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}
.booking-meta .price {
  color: var(--primary);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.booking-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.84rem;
}
.booking-phone i {
  color: #25d366;
  font-size: 0.95rem;
}

.booking-card .booking-actions {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}
.booking-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.6rem 0.95rem;
  border-radius: 9px;
  transition: all 0.15s;
  flex: 1;
  min-width: 0;
}
.btn-sm.success {
  background: rgba(52,211,153,0.12);
  color: var(--success);
  border: 1px solid rgba(52,211,153,0.28);
}
.btn-sm.success:hover { background: rgba(52,211,153,0.22); }
.btn-sm.danger {
  background: rgba(248,113,113,0.08);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.28);
}
.btn-sm.danger:hover { background: rgba(248,113,113,0.16); }
.btn-sm.ghost {
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-sm.ghost:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.day-group {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}
.day-group-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.15rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

/* Profile */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin-bottom: 1.5rem;
}
.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  color: #0c0c0b;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.8rem;
  font-family: var(--font-display);
  flex-shrink: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.profile-avatar.has-photo {
  color: transparent;
  font-size: 0;
}
.profile-photo-btn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #0c0c0b;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  transition: background 0.15s, transform 0.15s;
}
.profile-photo-btn:hover {
  background: var(--primary-bright);
  transform: scale(1.06);
}
.avatar.has-photo {
  background-size: cover;
  background-position: center;
  color: transparent;
  font-size: 0;
}
.profile-header h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.2;
}
.profile-header .text-muted {
  margin-top: 0.15rem;
  font-size: 0.9rem;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.profile-card .section-title {
  margin-bottom: 1rem;
}
.profile-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.profile-stat-card span {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}
.profile-stat-card strong {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

/* Crop modal 1:1 */
.crop-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.crop-backdrop.visible {
  opacity: 1;
  visibility: visible;
}
.crop-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  z-index: 401;
  width: min(420px, calc(100vw - 24px));
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.15rem 1.25rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s var(--ease);
}
.crop-modal.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}
.crop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.crop-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}
.crop-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
.crop-close:hover {
  background: var(--bg-card);
  color: var(--text);
}
.crop-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}
.crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: min(360px, 55vh);
  background: #0a0a09;
  border-radius: 12px;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  border: 1px solid var(--border);
  user-select: none;
}
.crop-stage:active {
  cursor: grabbing;
}
.crop-stage img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  will-change: transform;
  pointer-events: none;
}
.crop-frame {
  position: absolute;
  inset: 9%;
  border: 2px solid var(--primary);
  border-radius: 50%;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(194, 159, 97, 0.35);
  pointer-events: none;
  z-index: 2;
}
.crop-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 1rem;
}
.crop-actions .btn-outline,
.crop-actions .btn-primary {
  flex: 1;
  justify-content: center;
}

/* Confirm modal (logout etc.) */
.confirm-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  z-index: 401;
  width: min(360px, calc(100vw - 28px));
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.35rem 1.35rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s var(--ease);
  text-align: center;
}
.confirm-modal.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}
.confirm-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--primary-dim);
  border: 1px solid rgba(194, 159, 97, 0.3);
  display: grid;
  place-items: center;
  color: var(--primary);
  font-size: 1.35rem;
}
.confirm-modal h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.confirm-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  line-height: 1.45;
}
.confirm-modal .crop-actions {
  margin-top: 1.25rem;
}

/* Form */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.input {
  width: 100%;
  padding: 0.75rem 0.95rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
select.input { cursor: pointer; }
.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: var(--primary);
  color: #0c0c0b;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.3rem;
  border-radius: 10px;
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
  box-shadow: 0 2px 12px rgba(194,159,97,0.25);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-bright);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
.btn-primary.full { width: 100%; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  transition: all 0.2s;
}
.btn-outline:hover {
  border-color: #3a3a36;
  background: var(--bg-elevated);
  color: var(--text);
}
.btn-outline.small {
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
}

/* ========== GANHOS ========== */
.earnings-card .earnings-agreement {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.45;
  padding: 0.75rem 0.9rem;
  background: var(--bg-elevated);
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}
.earnings-card .earnings-hint {
  margin-top: 0.65rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.period-toggle {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem 0 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.35rem;
}

.period-btn {
  flex: 1;
  padding: 0.7rem 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 9px;
  transition: all 0.2s;
}

.period-btn.active {
  background: var(--primary);
  color: #0c0c0b;
  box-shadow: 0 2px 10px rgba(194, 159, 97, 0.3);
}

.period-btn:not(.active):hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.earnings-summary {
  background: linear-gradient(165deg, var(--bg-card) 0%, #131311 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.earnings-main {
  padding: 1.5rem 1.35rem 1.25rem;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(194, 159, 97, 0.08) 0%, transparent 100%);
}

.earnings-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.earnings-value {
  display: block;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.earnings-sub {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.earnings-breakdown {
  padding: 0.85rem 1.25rem 1.1rem;
}

.earnings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}

.earnings-row:last-child {
  border-bottom: none;
}

.earnings-row span {
  color: var(--text-muted);
}

.earnings-row strong {
  font-weight: 700;
  color: var(--text);
}

/* Histórico de ganhos */
.earnings-history {
  margin-top: 1.75rem;
}
.earnings-history .section-title {
  margin-bottom: 0.25rem;
}
.earnings-history-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}
.earnings-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.history-row-left {
  min-width: 0;
}
.history-row-left strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.history-row-left span {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.history-amount {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Tabs com 4 itens — ajuste de fonte no mobile */
@media (max-width: 480px) {
  .tab {
    font-size: 0.72rem;
    padding: 0 0.25rem;
  }
  .tab i {
    font-size: 1.05rem;
  }
  .earnings-value {
    font-size: 1.85rem;
  }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 300;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100% - 2rem);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
  .content { padding: 1.1rem 1rem 2rem; }
  .stats-row { gap: 0.45rem; }
  .mini-stat { padding: 0.7rem 0.35rem; }
  .mini-stat strong { font-size: 1rem; }
  .profile-header { gap: 0.9rem; }
  .profile-avatar { width: 60px; height: 60px; font-size: 1.5rem; }
  .login-card { padding: 1.75rem 1.35rem; }
  .topbar { padding: 0 1rem; }
}

/* Desktop refinements */
@media (min-width: 768px) {
  .content {
    padding: 1.6rem 1.75rem 3rem;
  }
  .booking-card {
    padding: 1.2rem 1.35rem;
  }
  .stats-row {
    gap: 0.85rem;
  }
  .mini-stat {
    padding: 1rem 0.75rem;
  }
  .mini-stat strong {
    font-size: 1.25rem;
  }
}


/* =====================================================================
   DESKTOP — layout do painel admin (barra lateral + conteúdo em grade)
   No celular nada muda: sidebar e ícones dos cards ficam escondidos.
   ===================================================================== */
.side { display: none; }
.stat-icon-sq { display: none; }

@media (min-width: 901px) {
  :root { --side-w: 240px; --side: #0f0f0e; }

  body { background: var(--bg); }

  /* Shell em grade: sidebar | conteúdo */
  .app {
    display: grid;
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    grid-template-rows: 1fr;
    max-width: none;
    width: 100%;
    margin: 0;
    border: none;
    box-shadow: none;
    background: var(--bg);
  }
  html.has-session #app.hidden { display: grid !important; }

  /* Topbar e abas do celular saem; o menu passa a ser a sidebar */
  .topbar, .tabs { display: none; }

  .content {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    width: 100%;
    padding: 1.5rem 1.5rem 3rem;
  }

  /* ---------- Sidebar ---------- */
  .side {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 1.35rem 1rem 1.25rem;
    background: var(--side);
    border-right: 1px solid var(--border);
    z-index: 80;
  }
  .side .logo {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.5rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.1rem;
  }
  .side .logo-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .side .logo-txt b {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.2;
  }
  .side .logo-txt small {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    margin-top: 0.2rem;
  }

  .nv {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    overflow-y: auto;
  }
  .nv-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    transition: background 0.2s, color 0.2s;
  }
  .nv-item i { font-size: 1.1rem; width: 1.25rem; text-align: center; }
  .nv-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
  .nv-item.active {
    color: #0c0c0b;
    background: var(--primary);
    box-shadow: 0 2px 12px rgba(194, 159, 97, 0.28);
  }

  .side-foot {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }
  .side-user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.25rem 0.5rem 0.75rem;
    min-width: 0;
  }
  .side-user .avatar { width: 38px; height: 38px; font-size: 0.95rem; }
  .side-user-txt { min-width: 0; }
  .side-user-txt strong {
    display: block;
    font-size: 0.9rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .side-user-txt span { font-size: 0.74rem; color: var(--text-muted); }
  .shop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
  }
  .shop:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
  }
  .side-logout {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s, background 0.2s;
  }
  .side-logout:hover { color: var(--danger); background: rgba(248, 113, 113, 0.08); }

  /* ---------- Cabeçalho de página ---------- */
  .day-header { margin-bottom: 1.5rem; }
  .day-header h2 { font-size: 1.85rem; font-weight: 600; line-height: 1.15; }
  .day-count { font-size: 0.9rem; margin-top: 0.25rem; }

  /* ---------- Cards de estatística (igual ao admin) ---------- */
  .stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
  }
  .mini-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 12px;
    text-align: left;
  }
  .mini-stat span { font-size: 0.8rem; margin-bottom: 0.2rem; }
  .mini-stat strong { font-family: var(--font-body); font-size: 1.4rem; font-weight: 700; }
  .stat-icon-sq {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    font-size: 1.4rem;
  }
  .stat-icon-sq.green { background: rgba(52, 211, 153, 0.15); color: var(--success); }
  .stat-icon-sq.orange { background: rgba(138, 135, 128, 0.15); color: var(--text-muted); }
  .stat-icon-sq.gold { background: var(--primary-dim); color: var(--primary); }

  /* ---------- Agendamentos em grade ---------- */
  .booking-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    align-items: stretch;
  }
  #weekList { display: flex; flex-direction: column; gap: 0; }
  .day-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
  }
  .day-group-title { grid-column: 1 / -1; margin-bottom: 0; }
  .booking-card { display: flex; flex-direction: column; }
  .booking-card .booking-info { flex: 1; }
  .empty-state { grid-column: 1 / -1; }

  /* ---------- Ganhos: 2 colunas ---------- */
  #tab-ganhos.active {
    display: grid;
    grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto 1fr;
    grid-template-areas:
      "head    head"
      "agree   hist"
      "period  hist"
      "summary hist"
      ".       hist";
    column-gap: 1.5rem;
    row-gap: 1rem;
    align-items: start;
  }
  #tab-ganhos .day-header { grid-area: head; margin-bottom: 0.5rem; }
  #tab-ganhos .earnings-card { grid-area: agree; margin: 0; }
  #tab-ganhos .period-toggle { grid-area: period; margin: 0; }
  #tab-ganhos .earnings-summary { grid-area: summary; }
  #tab-ganhos .earnings-history { grid-area: hist; margin-top: 0; }
  .earnings-history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
  }
  .earnings-history .section-title { font-size: 1.2rem; }

  /* ---------- Perfil: 2 colunas ---------- */
  #tab-perfil.active {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-areas:
      "head head"
      "card stat";
    column-gap: 1.5rem;
    row-gap: 1rem;
    align-items: start;
  }
  #tab-perfil .profile-header { grid-area: head; margin-bottom: 0.5rem; }
  #tab-perfil .profile-card { grid-area: card; margin: 0; }
  #tab-perfil .profile-stat-card { grid-area: stat; }

  /* Toast mais alinhado ao conteúdo */
  .toast { left: calc(50% + var(--side-w) / 2); }
}


/* =====================================================================
   AGENDAMENTOS — grade semanal (1 coluna por dia)
   Mesmo visual da agenda do painel do administrador.
   ===================================================================== */
:root { --primary-deep: #8a6a30; }

.stats-row.stats-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- Calendário (seletor de data) ---------- */
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.custom-date-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  width: 280px;
  background: var(--bg-card);
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(194, 159, 97, 0.15);
  z-index: 60;
  animation: dropdownIn 0.18s var(--ease);
}
.custom-date-dropdown[hidden] { display: none !important; }
.custom-date-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.65rem; gap: 0.35rem; }
.custom-date-month { font-size: 0.88rem; font-weight: 700; color: var(--text); text-transform: lowercase; }
.custom-date-nav {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px;
  color: var(--text-muted); border: 1px solid var(--border);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.custom-date-nav:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-dim); }
.custom-date-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 0.35rem; text-align: center; }
.custom-date-weekdays span { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); padding: 0.25rem 0; }
.custom-date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.custom-date-day {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px;
  font-size: 0.82rem; font-weight: 500; color: var(--text-secondary);
  background: transparent; border: none; cursor: pointer; transition: background 0.12s, color 0.12s;
}
.custom-date-day:hover:not(.empty):not(.selected):not(:disabled) { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.custom-date-day.empty { cursor: default; visibility: hidden; }
.custom-date-day.today { border: 1px solid rgba(194, 159, 97, 0.45); color: var(--primary); }
.custom-date-day.selected { background: var(--primary); color: #0c0c0b; font-weight: 800; box-shadow: 0 2px 8px rgba(194, 159, 97, 0.35); }
.custom-date-day.disabled, .custom-date-day:disabled { opacity: 0.3; cursor: not-allowed; }
.custom-date-footer { display: flex; justify-content: space-between; margin-top: 0.65rem; padding-top: 0.55rem; border-top: 1px solid var(--border-subtle); }
.custom-date-action { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); padding: 0.35rem 0.55rem; border-radius: 6px; transition: color 0.15s, background 0.15s; }
.custom-date-action:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.custom-date-action.primary { color: var(--primary); }
.custom-date-action.primary:hover { background: var(--primary-dim); color: var(--primary-bright); }

/* ---------- Barra: título, navegação, legenda ---------- */
.agenda-wrap { width: 100%; }
.agenda-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 0.85rem;
}
.agenda-bar-left { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; }
.agenda-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: 0.01em; }
.agenda-nav { display: flex; gap: 0.35rem; }
.agenda-nav-btn {
  height: 34px; padding: 0 0.8rem; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg-card);
  font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
  transition: border-color 0.2s, color 0.2s;
}
.agenda-nav-btn.icon { width: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.agenda-nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.agenda-legend { display: flex; gap: 0.9rem; flex-wrap: wrap; font-size: 0.74rem; color: var(--text-muted); }
.agenda-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.agenda-legend .lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.agenda-legend .lg.confirmed { background: #f6c98a; }
.agenda-legend .lg.done { background: #9fe3b0; }
.agenda-legend .lg.noshow { background: #ef7f7f; }
.agenda-legend .lg.cancelled { background: #a9a9a4; }
.agenda-note {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.7rem;
  padding: 0.55rem 0.8rem; border-radius: 10px; font-size: 0.82rem;
  background: var(--primary-dim); color: var(--primary-bright);
}

/* ---------- Busca por nome ---------- */
.agenda-search {
  position: sticky; top: 0; z-index: 30;
  margin: 0 0 0.85rem; padding: 0.6rem 0;
  background: var(--bg);
  box-shadow: 0 10px 14px -10px rgba(0, 0, 0, 0.7);
}
@media (max-width: 900px) {
  .agenda-search { top: calc(var(--topbar-h) + var(--tabs-h)); }
}
.agenda-search-field { position: relative; flex: 1; width: 100%; min-width: 0; }
.agenda-search-field > i.bi-search {
  position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.agenda-search-field input {
  width: 100%; height: 42px;
  background: var(--bg-input); border: 1.5px solid var(--border); border-radius: 10px;
  padding: 0 11rem 0 2.5rem; color: var(--text); font-size: 0.88rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.agenda-search-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
.agenda-search-field input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.agenda-search-field.no-hit input { border-color: #ef7f7f; }
.agenda-search-tools {
  position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%);
  display: none; align-items: center; gap: 0.15rem;
}
.agenda-search-field.has-term .agenda-search-tools { display: inline-flex; }
.agenda-search-count { font-size: 0.76rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; padding: 0 0.5rem; }
.agenda-search-btn {
  width: 30px; height: 30px; border: none; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-muted); transition: background 0.15s, color 0.15s;
}
.agenda-search-btn:hover:not(:disabled) { background: var(--primary-dim); color: var(--primary-bright); }
.agenda-search-btn:disabled { opacity: 0.35; cursor: default; }

/* ---------- Grade ---------- */
.agenda-scroll {
  position: relative; overflow-x: auto; overflow-y: visible; min-height: 0;
  background: transparent; border: none; border-radius: 0;
}
.agenda-grid { display: grid; min-width: min-content; }

.agenda-corner, .agenda-colhead { position: sticky; top: 0; z-index: 6; background: var(--bg); }
.agenda-corner {
  left: 0; z-index: 8;
  background: var(--bg-card); background-clip: padding-box;
  border-right: 7px solid var(--bg); border-radius: 14px 14px 0 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
}
.agenda-corner::after { content: 'Hora'; }

/* cabeçalho de cada dia */
.agenda-colhead {
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.55rem 0; min-width: 0;
  border-left: 7px solid var(--bg); border-right: 7px solid var(--bg); border-bottom: none;
  border-radius: 14px 14px 0 0;
}
.agenda-colhead::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: var(--bg-card); border-radius: 14px 14px 0 0;
}
.agenda-colhead > * { position: relative; z-index: 1; }
.agenda-colhead strong { font-size: 0.86rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-dim); color: var(--primary); font-weight: 700;
  border: 1.5px solid rgba(194, 159, 97, 0.45);
}
.agenda-daynum { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; line-height: 1; }
.agenda-colhead.today .agenda-daynum { background: var(--primary); color: #0c0c0b; border-color: var(--primary); }
.agenda-colhead.today strong { color: var(--primary); }

/* coluna das horas */
.agenda-hours {
  position: sticky; left: 0; z-index: 5;
  background: var(--bg-card); background-clip: padding-box;
  border-right: 7px solid var(--bg); border-radius: 0 0 14px 14px;
}
.agenda-hour {
  display: flex; align-items: center; justify-content: center; padding: 0 4px 0 0;
  font-size: 0.7rem; color: var(--text-muted); font-variant-numeric: tabular-nums;
  transition: background 0.12s, color 0.12s;
}
.agenda-hour.full { color: var(--text-secondary); font-weight: 600; }
.agenda-hour span { line-height: 1; }

/* coluna de um dia */
.agenda-col {
  position: relative; min-width: 0; overflow: hidden;
  background: var(--bg-card); background-clip: padding-box;
  border-left: 7px solid var(--bg); border-right: 7px solid var(--bg);
  border-radius: 0 0 14px 14px;
}
.agenda-cell {
  border-top: 1px solid rgba(255, 255, 255, 0.035);
  transition: background 0.12s, color 0.12s;
}
.agenda-cell.past { background: rgba(0, 0, 0, 0.18); }
.agenda-cell.row-hover { background: rgba(255, 255, 255, 0.05); }
.agenda-hour.row-hover { background: var(--primary-dim); color: var(--primary-bright); }
.agenda-hour.row-hover span { color: var(--primary-bright); font-weight: 700; }

.agenda-block {
  position: absolute; left: 0; right: 0; z-index: 1; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg, #1c1c1a 0 8px, #222220 8px 16px);
  color: var(--text-muted); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  pointer-events: none;
}

/* ---------- Cards coloridos ---------- */
.agenda-card {
  position: absolute; z-index: 3; overflow: hidden; border-radius: 0;
  padding: 8px 12px; color: #1f160c; cursor: pointer; border-left: none; outline: none;
  box-shadow: inset 0 1px 0 var(--bg-card), inset 0 -1px 0 var(--bg-card);
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), filter .3s, opacity .3s, background-color .25s;
}
.agenda-card:active { transform: scale(.985); }
.agenda-card.confirmed { background: #f6c98a; color: #1f160c; }
.agenda-card.done { background: #9fe3b0; color: #0b2514; }
.agenda-card.noshow { background: #ef7f7f; color: #2b0808; }
.agenda-card.cancelled { background: #a9a9a4; color: #262623; opacity: 0.8; }
.agenda-card.confirmed:hover, .agenda-card.confirmed:focus-visible { background: #efb86b; }
.agenda-card.done:hover, .agenda-card.done:focus-visible { background: #84d79a; }
.agenda-card.noshow:hover, .agenda-card.noshow:focus-visible { background: #e46a6a; }
.agenda-card.cancelled:hover, .agenda-card.cancelled:focus-visible { background: #97978f; }
.agenda-card .ac-name { font-size: 1rem; font-weight: 800; letter-spacing: .01em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-card .ac-service { font-size: .86rem; font-weight: 600; line-height: 1.25; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-card .ac-time { font-size: .82rem; font-weight: 700; margin-top: 4px; white-space: nowrap; }
.agenda-card .ac-price { font-weight: 800; }
.agenda-card.ag-xs { padding: 3px 8px; display: flex; align-items: center; gap: 0.4rem; }
.agenda-card.ag-xs .ac-service, .agenda-card.ag-xs .ac-time { display: none; }
.agenda-card.cancelled .ac-name { text-decoration: line-through; }

/* resultados da busca */
.agenda-card.search-dim { opacity: 0.18; filter: grayscale(0.6); }
.agenda-card.search-hit { z-index: 5; }
.agenda-card.search-active,
.agenda-card.search-active:hover,
.agenda-card.search-active:focus-visible {
  z-index: 7;
  box-shadow: inset 0 0 0 3px var(--primary-deep), inset 0 0 0 7px var(--bg-card);
  padding: 9px 13px;
}
.agenda-card.search-pop { animation: agendaSearchPop .38s var(--ease); }
@keyframes agendaSearchPop {
  0%   { transform: scale(.97); }
  50%  { transform: scale(1.025); }
  100% { transform: scale(1); }
}

/* ao trocar de semana, só os cards entram, um depois do outro */
.agenda-grid.agenda-anim-next .agenda-card { --dx: 16px; }
.agenda-grid.agenda-anim-prev .agenda-card { --dx: -16px; }
.agenda-grid.agenda-anim .agenda-card {
  animation: agendaCardIn .45s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 35ms);
}
@keyframes agendaCardIn {
  from { opacity: 0; transform: translate(var(--dx, 0), 8px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Popover do agendamento ---------- */
.agenda-pop {
  position: fixed; z-index: 1000; width: 260px; padding: 0.9rem; border-radius: 14px;
  background: var(--bg-elevated); border: 1px solid var(--border); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  display: flex; flex-direction: column; gap: 0.4rem;
  transform-origin: var(--pop-ox, left) var(--pop-oy, top);
  animation: agendaPopIn .26s var(--ease) both;
}
.agenda-pop.closing { animation: agendaPopOut .16s ease-in both; pointer-events: none; }
@keyframes agendaPopIn {
  from { opacity: 0; transform: translateY(8px) scale(.94); }
  to   { opacity: 1; transform: none; }
}
@keyframes agendaPopOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(6px) scale(.95); }
}
.agenda-pop .ap-head { display: flex; align-items: center; justify-content: space-between; }
.agenda-pop .ap-close { width: 26px; height: 26px; border-radius: 7px; color: var(--text-muted); }
.agenda-pop .ap-close:hover { background: var(--bg-card-hover); color: var(--text); }
.agenda-pop .ap-name { font-size: 1.05rem; margin-top: 0.15rem; }
.agenda-pop .ap-line { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--text-secondary); }
.agenda-pop .ap-line i { color: var(--primary); width: 16px; text-align: center; }
.agenda-pop .ap-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-top: 0.5rem; padding-top: 0.7rem; border-top: 1px solid var(--border-subtle); }
.agenda-pop .ap-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; height: 34px;
  border-radius: 9px; font-size: 0.76rem; font-weight: 600; border: 1px solid var(--border); color: var(--text-secondary);
  transition: background-color .18s, border-color .18s, color .18s, filter .18s;
}
.agenda-pop .ap-btn:hover { filter: brightness(1.12); }
.agenda-pop .ap-btn.ok { background: var(--success); border-color: var(--success); color: #0c0c0b; }
.agenda-pop .ap-btn.bad { background: var(--danger); border-color: var(--danger); color: #0c0c0b; }

/* ---------- Celular ---------- */
@media (max-width: 640px) {
  .agenda-title { font-size: 1.2rem; }
  .agenda-search-field input { padding-right: 9.5rem; }
  .agenda-search-count { padding: 0 0.25rem; font-size: 0.7rem; }
  .agenda-card { padding: 6px 8px; }
  .agenda-card .ac-name { font-size: .88rem; }
  .agenda-card .ac-service { font-size: .76rem; }
  .agenda-card .ac-time { font-size: .72rem; margin-top: 2px; }
  .agenda-card.search-active,
  .agenda-card.search-active:hover,
  .agenda-card.search-active:focus-visible { padding: 7px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .agenda-grid.agenda-anim .agenda-card,
  .agenda-card.search-pop,
  .agenda-pop, .agenda-pop.closing { animation: none; }
  .agenda-pop .ap-btn { transition: none; }
}

/* cards curtos (30 min) no PC: sem a linha do horário, que ficaria cortada */
@media (min-width: 641px) {
  .agenda-card.ag-sm .ac-time { display: none; }
}

/* largura mínima de cada dia (rolagem horizontal quando há muitos dias) */
:root { --agenda-col-min: 150px; }
@media (min-width: 901px) { :root { --agenda-col-min: 225px; } }
.agenda-scroll { scrollbar-width: thin; scrollbar-color: #333 transparent; padding-bottom: 6px; }
.agenda-scroll::-webkit-scrollbar { height: 8px; }
.agenda-scroll::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

/* horários sem agendamento */
.agenda-cell { display: flex; align-items: center; justify-content: center; }
.agenda-cell .empty-label {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  color: rgba(138, 135, 128, 0.5); white-space: nowrap; pointer-events: none;
}
.agenda-cell.row-hover .empty-label { color: rgba(212, 178, 122, 0.85); }

/* aviso de horário vazio: bem discreto, sem mudar de cor no hover */
.agenda-cell .empty-label {
  font-size: 0.66rem; font-weight: 500; letter-spacing: 0.02em;
  color: rgba(138, 135, 128, 0.26);
}
.agenda-cell.row-hover .empty-label { color: rgba(138, 135, 128, 0.26); }

/* arrastar para rolar */
.agenda-scroll { cursor: grab; user-select: none; -webkit-user-select: none; }
.agenda-scroll.dragging, .agenda-scroll.dragging * { cursor: grabbing !important; }

/* sem barra de rolagem lateral (rola arrastando ou com o touchpad) e menos espaço embaixo */
.agenda-scroll { scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 0; }
.agenda-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }
.content:has(#tab-agendamentos.active) { padding-bottom: 0.75rem; }

/* círculo do dia: sem fundo dourado e com borda um pouco mais grossa */
.agenda-daynum { background: transparent; border: 2.5px solid rgba(194, 159, 97, 0.5); }
.agenda-colhead.today .agenda-daynum { background: var(--primary); border-color: var(--primary); color: #0c0c0b; }


/* =====================================================================
   CELULAR — um dia por vez (layout mobile do admin)
   ===================================================================== */
@media (max-width: 900px) {
  /* cabeçalho: título em cima e legenda em grade 2x2 */
  .agenda-bar { flex-direction: column; align-items: stretch; gap: 0.75rem; margin-bottom: 0.85rem; }
  .agenda-bar-left { flex-direction: column; align-items: stretch; gap: 0.7rem; }
  .agenda-title { font-size: 1.35rem; line-height: 1.15; text-align: left; }
  .agenda-legend {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 0.75rem;
    padding: 0.7rem 0.85rem; border-radius: 12px; background: var(--bg-card); border: 1px solid var(--border-subtle);
    font-size: 0.78rem;
  }
  .agenda-legend .lg { width: 12px; height: 12px; border-radius: 4px; }

  /* cada dia ocupa toda a largura (menos a coluna das horas) e encaixa ao deslizar */
  .agenda-scroll {
    container-type: inline-size;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 64px;
    overscroll-behavior-x: contain;
  }
  .agenda-grid { --agenda-col: calc(100cqw - 64px); }
  .agenda-colhead, .agenda-col { scroll-snap-align: start; scroll-snap-stop: always; }

  /* cards de tamanho normal */
  .agenda-card { padding: 8px 12px; }
  .agenda-card .ac-name { font-size: 1rem; }
  .agenda-card .ac-service { font-size: .86rem; }
  .agenda-card .ac-time { font-size: .82rem; margin-top: 4px; }

  /* cards de 30 min sem corte (igual ao admin) */
  .agenda-card.ag-sm, .agenda-card.ag-xs {
    padding: 4px 10px; display: flex; flex-direction: column; justify-content: center;
  }
  .agenda-card.ag-sm .ac-name, .agenda-card.ag-xs .ac-name { font-size: 0.92rem; line-height: 1.2; }
  .agenda-card.ag-sm .ac-service { font-size: 0.8rem; line-height: 1.2; margin-top: 0; }
  .agenda-card.ag-sm .ac-time { display: none; }

  /* resultado da busca selecionado: mais respiro por causa do anel */
  .agenda-card.search-active, .agenda-card.search-active:hover, .agenda-card.search-active:focus-visible { padding: 9px 13px; }
  .agenda-card.ag-sm.search-active, .agenda-card.ag-xs.search-active { padding: 6px 13px; }
}


/* =====================================================================
   MOBILE — mesmo layout do painel admin
   (card de boas-vindas no topo + barra de abas embaixo + cards de resumo)
   O conteúdo das telas não muda; só a "casca" fica igual à do admin.
   ===================================================================== */

/* No PC estes dois elementos não existem */
.hero-card, .bottom-nav { display: none; }

@media (max-width: 900px) {
  html, body { overflow-x: hidden; max-width: 100%; }

  /* App ocupa a tela toda, sem moldura */
  .app {
    max-width: none; width: 100%; margin: 0;
    border: none; box-shadow: none;
  }

  /* Barra do topo e abas antigas saem (a navegação é a barra de baixo) */
  .topbar, .tabs { display: none !important; }

  .content,
  .content:has(#tab-agendamentos.active) {
    min-width: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 0.75rem) 1rem calc(96px + env(safe-area-inset-bottom, 0px));
  }
  .tab-panel, .tab-panel.active { min-width: 0; max-width: 100%; }

  /* ---- Card de boas-vindas ---- */
  .hero-card {
    display: block;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    margin: 0.5rem 0 1.25rem;
    padding: 1.35rem 1.25rem 1.6rem;
    min-height: 168px;
    border-radius: 24px;
    color: #0c0c0b;
    background: linear-gradient(135deg, #e0c28d 0%, var(--primary) 48%, #8f6f36 100%);
    box-shadow: 0 14px 34px rgba(194, 159, 97, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  }
  .hero-stripes {
    position: absolute; inset: 0; z-index: -2;
    background: repeating-linear-gradient(-55deg, rgba(12, 12, 11, 0.07) 0 2px, transparent 2px 22px);
  }
  .hero-art {
    position: absolute; z-index: -1; right: -22px; top: 22px; bottom: auto;
    width: 160px; max-width: none; height: auto;
    opacity: 0.28; transform: rotate(-10deg);
    filter: brightness(0) drop-shadow(0 0 0 transparent);
    pointer-events: none;
  }
  /* Foto do barbeiro: ocupa o lado direito do card e se mistura ao dourado.
     Duas camadas, cada uma com UM degradê de máscara (sem emenda no meio):
     o botão esfumaça pela esquerda; a foto (::before) esfumaça por baixo. */
  .hero-avatar {
    /* passa 3px para fora do card (que corta o excesso): sem fresta dourada nas bordas */
    position: absolute; z-index: 0; top: -3px; right: -3px; bottom: -3px;
    width: calc(58% + 3px); height: auto; border: none; border-radius: 0; padding: 0;
    background: none !important; box-shadow: none; overflow: hidden;
    color: transparent; font-size: 0;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 6%, rgba(0,0,0,.55) 38%, #000 72%);
    mask-image: linear-gradient(to right, transparent 0%, transparent 6%, rgba(0,0,0,.55) 38%, #000 72%);
  }
  .hero-avatar::before {
    content: ''; position: absolute; inset: 0;
    background-image: var(--hero-photo, none);
    background-size: cover; background-position: center 20%; background-repeat: no-repeat;
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  }
  /* sem foto: fica só a silhueta da máquina */
  .hero-avatar:not(.has-photo) { display: none; }
  /* com foto: a silhueta sai */
  .hero-card:has(.hero-avatar.has-photo) .hero-art { display: none; }
  .hero-body { position: relative; z-index: 2; }
  .hero-body { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; min-width: 0; }
  .hero-kicker { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; opacity: 0.72; }
  .hero-title { font-family: var(--font-body); font-size: 1.2rem; font-weight: 600; line-height: 1.15; margin-top: 0.1rem; max-width: 100%; }
  .hero-title b {
    display: block; max-width: 100%; overflow-wrap: anywhere;
    font-family: var(--font-display); font-size: 2.15rem; font-weight: 700; line-height: 1.05; letter-spacing: 0.01em;
  }
  .hero-sub { font-size: 0.85rem; font-weight: 500; opacity: 0.78; margin-top: 0.1rem; }
  .hero-chip {
    display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.7rem;
    padding: 0.35rem 0.75rem; border-radius: 999px;
    background: #0c0c0b; color: var(--primary-bright); font-size: 0.78rem; font-weight: 700;
  }
  .hero-dots { position: absolute; left: 1.25rem; bottom: 0.6rem; display: flex; gap: 5px; }
  .hero-dots span { width: 14px; height: 4px; border-radius: 4px; background: rgba(12, 12, 11, 0.28); transition: width 0.25s var(--ease), background 0.25s; }
  .hero-dots span.on { width: 28px; background: #0c0c0b; }

  /* ---- Barra de abas inferior: aba ativa vira pílula com rótulo ---- */
  .bottom-nav {
    display: flex; align-items: center; gap: 4px;
    position: fixed; z-index: 90;
    left: 0; right: 0; bottom: 0;
    --nav-h: 82px;
    box-sizing: border-box; min-height: var(--nav-h);
    padding: 12px 16px max(12px, env(safe-area-inset-bottom, 0px));
    border-radius: 30px 30px 0 0;
    background: rgba(24, 24, 22, 0.97);
    -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
  }
  .bottom-nav .nv-item {
    position: relative;
    display: flex;
    flex: 1 1 0; min-width: 0; height: 45px;
    flex-direction: row; justify-content: center; align-items: center;
    gap: 0; padding: 0;
    border-radius: 999px; background: none; box-shadow: none;
    font-family: var(--font-body);
    color: var(--text-secondary); font-size: 0.88rem; font-weight: 700; letter-spacing: 0.01em;
    -webkit-tap-highlight-color: transparent;
    transition: flex-grow 0.45s var(--ease), background-color 0.3s var(--ease), color 0.25s var(--ease);
  }
  .bottom-nav .nv-item i { font-size: 1.45rem; width: auto; line-height: 1; flex: none; transition: none; }
  .bottom-nav .nv-item span {
    max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap;
    transition: max-width 0.45s var(--ease), opacity 0.25s var(--ease), margin 0.45s var(--ease);
  }
  .bottom-nav .nv-item:hover { background: none; color: var(--text-secondary); }
  .bottom-nav .nv-item.active {
    flex-grow: 2.4;
    background: linear-gradient(135deg, var(--primary-bright), var(--primary));
    color: #14130f; font-weight: 800;
    box-shadow: 0 6px 16px rgba(194, 159, 97, 0.2);
  }
  .bottom-nav .nv-item.active span { max-width: 96px; opacity: 1; margin-left: 0.5rem; }

  /* Esconde a barra quando uma janela está aberta */
  body.modal-open .bottom-nav { visibility: hidden; }
  /* trava a rolagem do fundo sem encurtar a página (senão ela pula para o topo) */
  body.modal-open { overflow: hidden; }
  .crop-backdrop { touch-action: none; overscroll-behavior: contain; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }

  /* ---- Cabeçalho da página ---- */
  .day-header { margin-bottom: 1rem; }
  .day-header h2 { font-size: 1.55rem; line-height: 1.15; }
  .day-count { font-size: 0.9rem; margin-top: 0.25rem; }

  /* ---- Cards de resumo (um embaixo do outro, com ícone) ---- */
  .stats-row, .stats-row.stats-row-2 {
    display: flex; flex-direction: column; gap: 0.65rem;
    margin: 0 0 1.25rem; padding: 0;
  }
  .mini-stat {
    display: flex; align-items: center; gap: 0.8rem;
    width: 100%; min-width: 0;
    padding: 0.8rem 1rem; border-radius: 18px; text-align: left;
    background: linear-gradient(145deg, #1a1a18, #131312);
  }
  .stat-icon-sq {
    display: grid; place-items: center; flex: none;
    width: 44px; height: 44px; border-radius: 14px; font-size: 1.25rem;
  }
  .stat-icon-sq.green { background: rgba(52, 211, 153, 0.15); color: var(--success); }
  .stat-icon-sq.orange { background: rgba(138, 135, 128, 0.15); color: var(--text-muted); }
  .stat-icon-sq.gold { background: var(--primary-dim); color: var(--primary); }
  .stat-txt { min-width: 0; }
  .mini-stat span { font-size: 0.74rem; white-space: nowrap; margin-bottom: 0.15rem; }
  .mini-stat strong {
    display: block; font-family: var(--font-body);
    font-size: 1.1rem; font-weight: 700; line-height: 1.2; white-space: nowrap; color: var(--text);
  }

  /* ---- Agenda: busca gruda no topo; legenda como no admin ---- */
  .agenda-search { top: env(safe-area-inset-top, 0px); }
  .agenda-bar { gap: 0.6rem; }
  .agenda-legend { gap: 0.6rem; }

  /* Campos com 16px: evita o zoom automático do iOS */
  .input, .agenda-search-field input { font-size: 16px; }

  /* Toque com resposta visual, como em app */
  button, .btn-primary, .btn-outline { -webkit-tap-highlight-color: transparent; }
  .btn-primary:active, .btn-outline:active, .btn-sm:active, .period-btn:active { transform: scale(0.97); }

  /* ---- Janela de recorte de foto: sobe de baixo (bottom sheet) ---- */
  .crop-modal {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; max-width: none;
    border-radius: 22px 22px 0 0;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    max-height: 92dvh; overflow-y: auto;
    opacity: 1;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.4s;
  }
  .crop-modal.open {
    transform: translateY(0);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0s;
  }

  /* ---- Confirmar saída: centralizada, sobe suave ---- */
  .confirm-modal {
    opacity: 0;
    width: calc(100% - 2rem);
    border-radius: 22px;
    transform: translate(-50%, calc(-50% + 28px)) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.22s ease, visibility 0s linear 0.3s;
  }
  .confirm-modal.open {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.22s ease, visibility 0s linear 0s;
  }
}

@media (max-width: 380px) {
  .bottom-nav { padding-left: 8px; padding-right: 8px; }
  .bottom-nav .nv-item { font-size: 0.74rem; }
  .bottom-nav .nv-item.active span { margin-left: 0.35rem; }
  .hero-title b { font-size: 1.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-dots span, .bottom-nav .nv-item i, .bottom-nav .nv-item,
  .crop-modal, .confirm-modal { transition: none; }
}


/* =====================================================================
   RECORTE DE FOTO — área quadrada, círculo certo, zoom (PC e celular)
   ===================================================================== */
.crop-modal { width: min(400px, calc(100vw - 24px)); }
.crop-header { margin-bottom: 0.25rem; }
.crop-hint { margin-bottom: 0.85rem; line-height: 1.35; }
.crop-stage {
  width: min(100%, 340px, 46vh);
  max-height: none;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 16px;
  background: #0a0a09;
}
.crop-frame {
  inset: auto;               /* tamanho e posição vêm do JS (sempre quadrado) */
  width: 84%; aspect-ratio: 1; left: 8%; top: 8%;
  border: 2px solid var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(8, 8, 7, 0.68), 0 0 0 1px rgba(194, 159, 97, 0.25);
}
/* guias discretas dentro do círculo */
.crop-frame::before, .crop-frame::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
}
.crop-frame::before {
  background:
    linear-gradient(to right, transparent calc(33.3% - .5px), rgba(255,255,255,.16) calc(33.3% - .5px), rgba(255,255,255,.16) calc(33.3% + .5px), transparent calc(33.3% + .5px),
                              transparent calc(66.6% - .5px), rgba(255,255,255,.16) calc(66.6% - .5px), rgba(255,255,255,.16) calc(66.6% + .5px), transparent calc(66.6% + .5px)),
    linear-gradient(to bottom, transparent calc(33.3% - .5px), rgba(255,255,255,.16) calc(33.3% - .5px), rgba(255,255,255,.16) calc(33.3% + .5px), transparent calc(33.3% + .5px),
                               transparent calc(66.6% - .5px), rgba(255,255,255,.16) calc(66.6% - .5px), rgba(255,255,255,.16) calc(66.6% + .5px), transparent calc(66.6% + .5px));
}

/* controle de zoom */
.crop-zoom {
  display: flex; align-items: center; gap: 0.75rem;
  width: min(100%, 340px); margin: 1rem auto 0;
  color: var(--text-muted);
}
.crop-zoom .bi-image { font-size: 0.95rem; }
.crop-zoom .bi-image-fill { font-size: 1.25rem; }
.crop-zoom input[type="range"] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 6px; border-radius: 6px; outline: none; cursor: pointer;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--zoom-fill, 0%), #2a2a27 var(--zoom-fill, 0%), #2a2a27 100%);
}
.crop-zoom input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-bright); border: 3px solid #0c0c0b;
  box-shadow: 0 0 0 1px var(--primary), 0 2px 8px rgba(0,0,0,.5);
}
.crop-zoom input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary-bright); border: 3px solid #0c0c0b;
  box-shadow: 0 0 0 1px var(--primary);
}
.crop-zoom input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: #2a2a27; }
.crop-zoom input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--primary); }

/* botões: mesma altura, texto numa linha só */
.crop-actions { gap: 0.6rem; margin-top: 1.1rem; }
.crop-actions .btn-outline,
.crop-actions .btn-primary {
  height: 48px; padding: 0 0.75rem; justify-content: center;
  font-size: 0.9rem; white-space: nowrap; border-radius: 12px;
}
.crop-actions .btn-outline { border-width: 1.5px; }

@media (max-width: 900px) {
  .crop-modal { width: 100%; }
  .crop-stage { width: min(100%, 360px, 46vh); }
}


/* Botão "Sair da conta" no Perfil — só no celular (no PC o Sair fica na barra lateral) */
.profile-logout { display: none; }
@media (max-width: 900px) {
  .profile-logout {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    width: 100%; height: 48px; margin-top: 1.25rem;
    border-radius: 12px; border: 1.5px solid rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.08); color: var(--danger);
    font-size: 0.95rem; font-weight: 700;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s, transform 0.15s;
  }
  .profile-logout i { font-size: 1.15rem; }
  .profile-logout:active { transform: scale(0.97); background: rgba(248, 113, 113, 0.16); }
}


/* ========== LOGIN MOBILE — tela cheia estilo app ========== */
.login-hero { display: none; }

@media (max-width: 900px) {
  .login-screen {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background:
      radial-gradient(520px 340px at 100% 0%, rgba(255,236,190,.35), transparent 70%),
      linear-gradient(155deg, #d4b27a 0%, #a8803f 42%, #3a2c14 78%, #14100a 100%);
  }
  /* listras e círculos decorativos no topo */
  .login-screen::before {
    inset: 0 0 auto 0;
    height: 52%;
    background: repeating-linear-gradient(-55deg, rgba(12,12,11,.10) 0 2px, transparent 2px 26px);
    -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
  }
  .login-screen::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 220px; height: 220px;
    top: -70px; left: -80px;
    border-radius: 50%;
    background: rgba(255,255,255,.10);
    pointer-events: none;
  }

  /* máquina aparece no cabeçalho, à direita */
  .hero-mark {
    right: -12%;
    top: 20%;
    width: min(62vw, 300px);
    --mark-opacity: 0.55;
    --mark-filter: drop-shadow(0 8px 24px rgba(0,0,0,.35));
    -webkit-mask-image: none;
    mask-image: none;
  }

  .login-hero {
    display: block;
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    padding: calc(env(safe-area-inset-top, 0px) + 1.75rem) 1.75rem 3.75rem;
    color: #0c0c0b;
  }
  .login-hero-brand {
    display: flex; align-items: center; gap: .5rem;
    font-weight: 800; font-size: 1.05rem; margin-bottom: 2.25rem;
  }
  .login-hero-brand .logo-next { color: #0c0c0b; }
  .login-hero-brand .logo-barber { color: #fff; }
  .login-hero-logo { width: 36px; height: 36px; border-radius: 50%; object-fit: contain; }
  .login-hero-title {
    font-family: var(--font-display);
    font-size: 2.9rem; font-weight: 600; line-height: 1;
    letter-spacing: .01em;
  }
  .login-hero-title b { font-weight: 700; }
  .login-hero-sub { margin-top: .7rem; font-size: .95rem; font-weight: 600; opacity: .75; }

  /* o "card" vira a folha inferior ocupando o resto da tela */
  .login-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: -1.75rem;
    background: var(--bg);
    border: 0;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -10px 40px rgba(0,0,0,.35);
    padding: 2rem max(1.5rem, calc((100% - 420px) / 2)) calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
  .login-card::before {
    content: "";
    align-self: center;
    width: 40px; height: 4px; border-radius: 4px;
    background: var(--border);
    margin: -.9rem 0 1.4rem;
  }
  .login-brand { display: none; }
  .login-card form { margin-top: .25rem; }
  .login-card .input { padding-top: .9rem; padding-bottom: .9rem; font-size: 1rem; }
  .login-card .btn-primary.full { padding: 1rem; border-radius: 999px; font-size: 1rem; margin-top: .5rem; }
  .login-hint { margin-top: 1.5rem; }
  .login-back { margin-top: auto; padding-top: 1.5rem; }
}


/* ========== LOGIN MOBILE — tela de boas-vindas (antes do formulário) ========== */
.login-welcome { display: none; }

@media (max-width: 900px) {
  /* estado inicial: boas-vindas. Formulário só depois de tocar em "Entrar" */
  .login-screen:not(.show-form) {
    background:
      radial-gradient(420px 320px at 50% 18%, rgba(194,159,96,.22), transparent 70%),
      var(--bg);
  }
  .login-screen:not(.show-form)::before,
  .login-screen:not(.show-form)::after { display: none; }
  .login-screen:not(.show-form) .login-hero,
  .login-screen:not(.show-form) .login-card { display: none; }
  .login-screen:not(.show-form) .hero-mark { opacity: 0; visibility: hidden; }

  .login-screen.show-form .login-welcome { display: none; }
  .login-screen.show-form .login-hero { animation: loginFormIn .45s var(--ease) both; }
  .login-screen.show-form .login-card { animation: loginSheetIn .5s var(--ease) both; }

  .login-welcome {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: calc(env(safe-area-inset-top, 0px) + 1.5rem) 1.75rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    animation: loginFormIn .5s var(--ease) both;
  }
  .welcome-art {
    position: relative;
    flex: 1 1 auto;
    min-height: 260px;
    display: grid;
    place-items: center;
  }
  .welcome-blob {
    position: absolute;
    width: min(78vw, 320px);
    aspect-ratio: 1;
    border-radius: 46% 54% 52% 48% / 52% 46% 54% 48%;
    background: linear-gradient(155deg, #d4b27a 0%, #a8803f 55%, #3a2c14 100%);
    box-shadow: 0 24px 60px rgba(194,159,96,.25);
    overflow: hidden;
  }
  .welcome-blob::after {
    content: "";
    position: absolute; inset: 0;
    background: repeating-linear-gradient(-55deg, rgba(12,12,11,.12) 0 2px, transparent 2px 24px);
  }
  .welcome-dot { position: absolute; border-radius: 50%; background: var(--primary); opacity: .35; }
  .welcome-dot.d1 { width: 26px; height: 26px; top: 12%; right: 8%; }
  .welcome-dot.d2 { width: 14px; height: 14px; bottom: 14%; left: 8%; opacity: .5; }
  .welcome-img {
    position: relative;
    width: min(64vw, 250px);
    height: auto;
    transform: rotate(-8deg);
    filter: drop-shadow(0 14px 24px rgba(0,0,0,.4));
    animation: float-welcome 6s ease-in-out infinite;
  }
  .welcome-body { text-align: center; padding: 1.25rem 0 1.5rem; }
  .welcome-title {
    font-family: var(--font-display);
    font-size: 2.5rem; font-weight: 600; line-height: 1.05;
    color: var(--text);
  }
  .welcome-text {
    margin-top: .85rem;
    font-size: .92rem; line-height: 1.55;
    color: var(--text-muted);
  }
  .welcome-actions { display: flex; flex-direction: column; gap: .75rem; }
  .welcome-actions .btn-primary { padding: 1rem; border-radius: 999px; font-size: 1rem; }
  .btn-welcome-alt {
    display: flex; align-items: center; justify-content: center;
    padding: 1rem; border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-weight: 700; font-size: 1rem; text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform .2s, border-color .2s;
  }
  .btn-welcome-alt:active { transform: scale(.97); border-color: var(--primary); }

  /* botão de voltar no cabeçalho do login */
  .login-hero-brand { position: relative; }
  .login-hero-back {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(12,12,11,.14);
    color: #0c0c0b; font-size: 1.05rem;
    margin-right: .15rem;
    -webkit-tap-highlight-color: transparent;
  }
  .login-hero-back:active { background: rgba(12,12,11,.28); }
}
@media (min-width: 901px) { .login-hero-back { display: none; } }

@keyframes float-welcome {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50% { transform: rotate(-4deg) translateY(-8px); }
}
@keyframes loginFormIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes loginSheetIn { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .welcome-img { animation: none; }
  .login-welcome, .login-screen.show-form .login-hero, .login-screen.show-form .login-card { animation: none !important; }
}


/* ========== AJUSTES: sem rolagem + animação de entrada do login ========== */
@media (max-width: 900px) {
  .login-screen {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  /* --- boas-vindas: tudo se encaixa na altura da tela --- */
  .login-welcome {
    min-height: 0;
    height: 100%;
    padding-top: calc(env(safe-area-inset-top, 0px) + 1rem);
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
  .welcome-art {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .welcome-blob {
    height: 78%;
    width: auto;
    max-height: 300px;
    max-width: 78vw;
    aspect-ratio: 1;
  }
  .welcome-img {
    width: auto;
    height: 92%;
    max-width: 62vw;
    object-fit: contain;
  }
  .welcome-body { flex: 0 0 auto; padding: .9rem 0 1.1rem; }
  .welcome-title { font-size: clamp(1.9rem, 5.4vh, 2.5rem); }
  .welcome-text { margin-top: .6rem; font-size: clamp(.8rem, 1.9vh, .92rem); line-height: 1.5; }
  .welcome-actions { flex: 0 0 auto; gap: .6rem; }
  .welcome-actions .btn-primary,
  .btn-welcome-alt { padding: clamp(.8rem, 2vh, 1rem); }

  /* saída da boas-vindas */
  .login-welcome.leaving { animation: welcomeOut .28s cubic-bezier(.5,0,.75,0) both !important; }

  /* --- login: não rola; cabeçalho desce do topo, folha sobe de baixo --- */
  .login-screen.show-form .login-hero { animation: none; }
  .login-screen.show-form .login-hero-brand { animation: heroDown .6s var(--ease) both; }
  .login-screen.show-form .login-hero-title { animation: heroDown .6s var(--ease) .08s both; }
  .login-screen.show-form .login-hero-sub   { animation: heroDown .6s var(--ease) .16s both; }
  .login-screen.show-form .login-card {
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    animation: sheetUp .65s var(--ease) both;
  }
  .login-card::-webkit-scrollbar { display: none; }
  .login-screen.show-form .login-card .form-group,
  .login-screen.show-form .login-card .btn-primary,
  .login-screen.show-form .login-hint,
  .login-screen.show-form .login-back { animation: itemUp .5s var(--ease) both; }
  .login-screen.show-form .login-card .form-group:nth-of-type(1) { animation-delay: .30s; }
  .login-screen.show-form .login-card .form-group:nth-of-type(2) { animation-delay: .38s; }
  .login-screen.show-form .login-card .btn-primary { animation-delay: .46s; }
  .login-screen.show-form .login-hint { animation-delay: .54s; }
  .login-screen.show-form .login-back { animation-delay: .60s; }
  .login-card .btn-primary:hover:not(:disabled) { transform: none; }
}

/* telas baixas: compacta o login para não rolar */
@media (max-width: 900px) and (max-height: 740px) {
  .login-hero { padding-top: calc(env(safe-area-inset-top, 0px) + 1.1rem); padding-bottom: 3rem; }
  .login-hero-brand { margin-bottom: 1.1rem; }
  .login-hero-title { font-size: 2.35rem; }
  .login-hero-sub { margin-top: .4rem; font-size: .88rem; }
  .login-card { padding-top: 1.4rem; }
  .login-card::before { margin-bottom: 1rem; }
  .login-card .form-group { margin-bottom: .75rem; }
  .login-hint { margin-top: 1rem; }
  .login-back { padding-top: .9rem; }
}

@keyframes welcomeOut { to { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes heroDown { from { opacity: 0; transform: translateY(-36px); } to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes itemUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .login-screen.show-form * { animation: none !important; }
}


/* ========== CABEÇALHO DO LOGIN v2 — escuro, igual às boas-vindas ========== */
@media (max-width: 900px) {
  .login-screen.show-form {
    background:
      radial-gradient(460px 340px at 85% 8%, rgba(194,159,96,.26), transparent 70%),
      var(--bg);
  }
  .login-screen.show-form::before,
  .login-screen.show-form::after { display: none; }
  .login-screen .hero-mark { opacity: 0 !important; visibility: hidden; }

  .login-hero { color: var(--text); padding-bottom: 4rem; }
  .login-hero-brand { margin-bottom: 2rem; font-size: 1.05rem; }
  .login-hero-brand .logo-next { color: var(--text); }
  .login-hero-brand .logo-barber { color: var(--primary); }
  .login-hero-back {
    background: rgba(242,240,233,.06);
    border: 1px solid var(--border);
    color: var(--text);
    margin-right: .35rem;
  }
  .login-hero-back:active { background: rgba(242,240,233,.14); }
  .login-hero-title { color: var(--text); }
  .login-hero-title b { color: var(--primary); }
  .login-hero-sub { color: var(--text-muted); opacity: 1; }
  .login-hero-title, .login-hero-sub, .login-hero-brand { position: relative; z-index: 2; }

  /* arte: círculo dourado + máquina nítida, "escondida" atrás da folha */
  .login-hero-art {
    position: absolute;
    z-index: 0;
    right: 1.1rem;
    top: calc(env(safe-area-inset-top, 0px) + 3.6rem);
    width: 150px;
    height: 170px;
    pointer-events: none;
  }
  .lha-blob {
    position: absolute;
    inset: 0 0 auto 0;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(155deg, #d4b27a 0%, #a8803f 55%, #3a2c14 100%);
    box-shadow: 0 18px 44px rgba(194,159,96,.28);
    overflow: hidden;
  }
  .lha-blob::after {
    content: "";
    position: absolute; inset: 0;
    background: repeating-linear-gradient(-55deg, rgba(12,12,11,.14) 0 2px, transparent 2px 20px);
  }
  .lha-img {
    position: absolute;
    left: 50%; top: -14%;
    height: 135%;
    width: auto;
    margin-left: -34px;
    transform-origin: 50% 70%;
    filter: drop-shadow(0 10px 16px rgba(0,0,0,.45));
  }

  /* a folha precisa se destacar do fundo escuro */
  .login-card {
    background: #151513;
    border-top: 1px solid rgba(194,159,96,.28);
    box-shadow: 0 -14px 40px rgba(0,0,0,.5);
  }
  .login-card .input { background: #0e0e0d; }
  .login-card::before { background: #2c2c28; }

  /* animações combinando: círculo "estoura", máquina gira entrando do canto */
  .login-screen.show-form .lha-blob { animation: blobIn .8s var(--ease) .12s both; }
  .login-screen.show-form .lha-img {
    animation:
      machineIn 1s var(--ease) .2s both,
      machineFloat 6s ease-in-out 1.2s infinite;
  }
  .login-screen.show-form .login-hero-back { animation: backIn .5s var(--ease) both; }
}

@media (max-width: 900px) and (max-height: 740px) {
  .login-hero { padding-bottom: 3.4rem; }
  .login-hero-brand { margin-bottom: 1.1rem; }
  .login-hero-art { width: 120px; height: 140px; top: calc(env(safe-area-inset-top, 0px) + 3rem); }
  .lha-blob { height: 120px; }
  .lha-img { margin-left: -27px; }
}

@keyframes blobIn {
  from { opacity: 0; transform: scale(.4) translate(30px,-30px); }
  to   { opacity: 1; transform: none; }
}
@keyframes machineIn {
  from { opacity: 0; transform: translate(70px,-90px) rotate(-40deg) scale(.85); }
  to   { opacity: 1; transform: rotate(-10deg); }
}
@keyframes machineFloat {
  0%, 100% { transform: rotate(-10deg) translateY(0); }
  50%      { transform: rotate(-6deg) translateY(-7px); }
}
@keyframes backIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }


/* ========== MÁQUINA — movimento refinado (somente celular) ========== */
@media (max-width: 900px) {
  /* boas-vindas: inclinação fixa, entrada suave e flutuação mínima */
  .welcome-img {
    transform: rotate(-8deg);
    animation:
      machineSoftIn .9s var(--ease) .1s both,
      machineSoftFloat 7s ease-in-out 1.1s infinite;
  }
  .welcome-blob { animation: blobSoftIn .9s var(--ease) both; }

  /* login: mesma linguagem, sem giro */
  .login-screen.show-form .lha-blob { animation: blobSoftIn .8s var(--ease) .1s both; }
  .login-screen.show-form .lha-img {
    animation:
      machineSoftIn .9s var(--ease) .2s both,
      machineSoftFloat 7s ease-in-out 1.2s infinite;
  }
}

@keyframes machineSoftIn {
  from { opacity: 0; transform: translateY(-14px) rotate(-8deg); }
  to   { opacity: 1; transform: translateY(0) rotate(-8deg); }
}
@keyframes machineSoftFloat {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50%      { transform: translateY(-4px) rotate(-8deg); }
}
@keyframes blobSoftIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .welcome-img, .welcome-blob { animation: none !important; }
}


/* ========== SEM BOLA — só a máquina com brilho suave (celular) ========== */
@media (max-width: 900px) {
  .welcome-dot { display: none; }

  .welcome-blob {
    height: 92%;
    max-height: 400px;
    max-width: 100vw;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(212,178,122,.30) 0%, rgba(194,159,96,.12) 45%, transparent 100%);
    box-shadow: none;
    overflow: visible;
  }
  .welcome-blob::after { display: none; }

  .lha-blob {
    inset: auto;
    left: -45px; right: -45px; top: -30px;
    height: 230px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(212,178,122,.34) 0%, rgba(194,159,96,.13) 48%, transparent 100%);
    box-shadow: none;
    overflow: visible;
  }
  .lha-blob::after { display: none; }
}
@media (max-width: 900px) and (max-height: 740px) {
  .lha-blob { height: 190px; left: -35px; right: -35px; top: -25px; }
}


/* ========== AJUSTE FINO — máquina encaixada + detalhes atrás (celular) ========== */
@media (max-width: 900px) {

  /* ---------- BOAS-VINDAS: anéis finos + listras suaves atrás da máquina ---------- */
  .welcome-art::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(-55deg, rgba(194,159,96,.10) 0 1.5px, transparent 1.5px 26px);
    -webkit-mask-image: radial-gradient(closest-side at 50% 50%, #000 0%, transparent 85%);
    mask-image: radial-gradient(closest-side at 50% 50%, #000 0%, transparent 85%);
    pointer-events: none;
  }
  .welcome-blob::before,
  .welcome-blob::after {
    content: "";
    display: block;
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(194,159,96,.28);
    background: none;
  }
  .welcome-blob::before { inset: 16%; }
  .welcome-blob::after  { inset: 33%; border-color: rgba(194,159,96,.18); }

  /* ---------- LOGIN: máquina menor, inteira e alinhada ao texto ---------- */
  .login-hero-art {
    right: 1.5rem;
    top: calc(env(safe-area-inset-top, 0px) + 4.6rem);
    width: 120px;
    height: 150px;
  }
  .lha-img {
    left: 0; right: 0; top: 0;
    margin: 0 auto;
    height: 100%;
    width: auto;
  }
  .lha-blob {
    left: -60px; right: -60px; top: -40px;
    height: 230px;
  }
  .lha-blob::before,
  .lha-blob::after {
    content: "";
    display: block;
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(194,159,96,.28);
    background: none;
  }
  .lha-blob::before { inset: 30px 35px; }
  .lha-blob::after  { inset: 55px 60px; border-color: rgba(194,159,96,.18); }
}

@media (max-width: 900px) and (max-height: 740px) {
  .login-hero-art { width: 96px; height: 120px; top: calc(env(safe-area-inset-top, 0px) + 3.6rem); }
  .lha-blob { left: -52px; right: -52px; top: -35px; height: 190px; }
  .lha-blob::before { inset: 25px 30px; }
  .lha-blob::after  { inset: 45px 50px; }
}


/* ========== VERSÃO LIMPA — sem anéis/listras; máquina maior no login (celular) ========== */
@media (max-width: 900px) {
  .welcome-art::before,
  .welcome-blob::before,
  .welcome-blob::after,
  .lha-blob::before,
  .lha-blob::after { display: none !important; content: none; }

  /* boas-vindas: brilho um pouco mais presente, para não ficar "seco" */
  .welcome-blob {
    background: radial-gradient(closest-side, rgba(212,178,122,.38) 0%, rgba(194,159,96,.16) 50%, transparent 100%);
  }

  /* login: máquina maior, ainda inteira acima da folha */
  .login-hero-art {
    right: 1.25rem;
    top: calc(env(safe-area-inset-top, 0px) + 3.9rem);
    width: 150px;
    height: 190px;
  }
  .lha-blob {
    left: -70px; right: -70px; top: -45px;
    height: 280px;
    background: radial-gradient(closest-side, rgba(212,178,122,.34) 0%, rgba(194,159,96,.13) 50%, transparent 100%);
  }
}
@media (max-width: 900px) and (max-height: 740px) {
  .login-hero-art { width: 120px; height: 150px; top: calc(env(safe-area-inset-top, 0px) + 3.2rem); }
  .lha-blob { left: -55px; right: -55px; top: -35px; height: 220px; }
}


/* ========== Posição da máquina no login: mais à direita e mais acima (celular) ========== */
@media (max-width: 900px) {
  .login-hero-art {
    right: .1rem;
    top: calc(env(safe-area-inset-top, 0px) + 2.9rem);
  }
}
@media (max-width: 900px) and (max-height: 740px) {
  .login-hero-art {
    right: 0;
    top: calc(env(safe-area-inset-top, 0px) + 2.4rem);
  }
}



/* ========== LOGIN MOBILE — sem "Voltar ao site", entrada unificada e alça arrastável ========== */
.sheet-handle { display: none; }

@media (max-width: 900px) {
  .login-back { display: none !important; }

  /* nada aparece depois: os itens do formulário sobem junto com a folha */
  .login-screen.show-form .login-card .form-group,
  .login-screen.show-form .login-card .btn-primary,
  .login-screen.show-form .login-hint { animation: none !important; }

  /* sem "fill forwards": depois de animar, o JS pode mover a folha ao arrastar */
  .login-screen.show-form .login-card { animation: sheetUp .65s var(--ease) backwards; will-change: transform; }
  .login-screen.show-form .login-hero-brand { animation: heroDown .6s var(--ease) backwards; }
  .login-screen.show-form .login-hero-title { animation: heroDown .6s var(--ease) .08s backwards; }
  .login-screen.show-form .login-hero-sub   { animation: heroDown .6s var(--ease) .16s backwards; }
  .login-screen.show-form .login-hero-back  { animation: backIn .5s var(--ease) backwards; }

  /* alça */
  .login-card::before { display: none !important; }
  .sheet-handle {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 52px;
    cursor: grab;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    z-index: 3;
  }
  .sheet-handle::after {
    content: "";
    position: absolute;
    top: 14px; left: 50%;
    width: 40px; height: 4px;
    margin-left: -20px;
    border-radius: 4px;
    background: #2c2c28;
    transition: background-color .2s, width .2s var(--ease), margin-left .2s var(--ease);
  }
  .sheet-handle:active::after,
  .login-screen.handle-active .sheet-handle::after {
    background: var(--primary);
    width: 52px;
    margin-left: -26px;
  }

  /* enquanto arrasta/volta: boas-vindas aparece por trás da folha */
  .login-screen.dragging .login-welcome {
    display: flex !important;
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
  }
  .login-screen.dragging .login-hero { position: relative; z-index: 1; }
  .login-screen.dragging .login-card { cursor: grabbing; }

  /* sem repetir a introdução da boas-vindas ao voltar */
  .login-screen.skip-intro .login-welcome { animation: none; }
  .login-screen.skip-intro .welcome-blob { animation: none; }
  .login-screen.skip-intro .welcome-img { animation: machineSoftFloat 7s ease-in-out infinite; }
}


/* ========== MÁQUINA no estilo da apresentação (só a máquina, layout intacto) ========== */
@keyframes nbSway {
  0%, 100% { transform: rotate(-1.6deg) translateY(0); }
  50%      { transform: rotate(1.6deg) translateY(-12px); }
}
@media (max-width: 900px) {
  .login-screen .login-welcome .welcome-img,
  .login-screen.skip-intro .login-welcome .welcome-img,
  .login-screen.show-form .login-hero-art .lha-img {
    opacity: 1;
    transform-origin: 50% 60%;
    filter: drop-shadow(0 0 46px rgba(194,159,96,.5)) drop-shadow(0 24px 30px rgba(0,0,0,.6));
    animation: nbSway 9s ease-in-out infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .login-screen .login-welcome .welcome-img,
  .login-screen.show-form .login-hero-art .lha-img { animation: none !important; }
}


/* ========== LOGIN (celular, após "Entrar") — máquina parada, brilho suave e letras do login de PC ========== */
@media (max-width: 900px) {
  /* máquina totalmente parada: sem entrada, sem balanço, sem flutuação */
  .login-screen.show-form .login-hero-art .lha-img,
  .login-screen.show-form .lha-img {
    animation: none !important;
    transform: none !important;
    opacity: 1;
    /* brilho bem mais discreto */
    filter: drop-shadow(0 0 10px rgba(194,159,96,.16)) drop-shadow(0 10px 14px rgba(0,0,0,.5));
  }
  .login-screen.show-form .lha-blob { animation: none !important; }

  /* halo dourado atrás da máquina bem mais fraco */
  .login-screen.show-form .lha-blob {
    background: radial-gradient(closest-side, rgba(212,178,122,.09) 0%, rgba(194,159,96,.03) 50%, transparent 100%);
  }

  /* letras no estilo do login de PC, no canto superior esquerdo */
  .login-hero-brandtxt { display: block; line-height: 1; }
  .login-hero-brandtxt p { margin: 0; }
  .login-hero-brandtxt .lhb-name {
    font-size: 1.45rem; font-weight: 800; line-height: 1.15;
  }
  .login-hero-brandtxt .lhb-sub {
    font-size: .8rem; font-weight: 500; color: var(--text-muted); margin-top: .15rem;
  }
  .login-screen.show-form .login-hero-brand { font-size: inherit; }
}


/* ========== LOGIN (celular) — listras de fundo só ao redor da máquina, máquina reta ========== */
@media (max-width: 900px) {
  .login-screen.show-form .login-hero-art::before {
    content: "";
    position: absolute;
    inset: -34px -44px -4px -44px;
    background: repeating-linear-gradient(-55deg, rgba(194,159,96,.16) 0 2px, transparent 2px 20px);
    -webkit-mask-image: radial-gradient(closest-side at 50% 52%, #000 0%, rgba(0,0,0,.55) 55%, transparent 100%);
    mask-image: radial-gradient(closest-side at 50% 52%, #000 0%, rgba(0,0,0,.55) 55%, transparent 100%);
    pointer-events: none;
  }
}


/* ========== LOGIN (celular) — listras iguais às do login de PC, só no canto da máquina ========== */
@media (max-width: 900px) {
  .login-screen.show-form .login-hero-art::before {
    inset: -60px -30px -50px -170px;
    background: repeating-linear-gradient(-55deg, rgba(194,159,96,.09) 0 2px, transparent 2px 30px);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 75% 30%, #000, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 70% at 75% 30%, #000, transparent 75%);
  }
}


/* ========== LOGIN (celular) — máquina entra no mesmo estilo das letras (desce e aparece), depois fica parada ========== */
@media (max-width: 900px) {
  .login-screen.show-form .login-hero-art {
    animation: heroDown .6s var(--ease) .16s backwards;
  }
}


/* ========== LOGIN (celular) — botão de voltar também desce de cima, junto com as letras ========== */
@media (max-width: 900px) {
  .login-screen.show-form .login-hero-back {
    animation: heroDown .6s var(--ease) backwards;
  }
}


/* ========== LOGIN (celular) — sincronia: botão, letras e máquina descem juntos ========== */
@media (max-width: 900px) {
  /* o botão está dentro do bloco das letras, que já desce; animar os dois somava o movimento */
  .login-screen.show-form .login-hero-back { animation: none !important; }
  .login-screen.show-form .login-hero-art { animation: heroDown .6s var(--ease) backwards; }
}


/* ========== LOGIN (celular) — rodapé discreto no fim da folha ========== */
.login-foot { display: none; }
@media (max-width: 900px) {
  .login-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    margin-top: auto;
    padding-top: 2rem;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + .25rem);
    font-size: .72rem;
    color: var(--text-muted);
    opacity: .55;
    text-align: center;
  }
  .login-foot-line i { color: var(--primary); margin-right: .25rem; }
  .login-foot-copy { font-size: .68rem; letter-spacing: .04em; }
}
