:root {
  --bg: #0c0c0b;
  --bg-elevated: #121211;
  --bg-card: #161614;
  --bg-card-hover: #1c1c1a;
  --bg-input: #141412;
  --side: #0f0f0e;
  --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);
  --side-w: 240px;
  --top-h: 64px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scrollbar-width: thin; scrollbar-color: #333 transparent; }
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; }
a { color: inherit; text-decoration: none; }

html.has-session #loginScreen { display: none !important; }
html.has-session #app.hidden { display: grid !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); } }

/* ========== SHELL (sidebar layout) ========== */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "side top"
    "side main";
}

/* Sidebar */
.side {
  grid-area: side;
  background: var(--side);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1rem 1.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
  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;
}
.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);
  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);
}

/* Top bar (mobile / secondary) */
.top {
  grid-area: top;
  display: none;
  align-items: center;
  gap: 0.65rem;
  height: var(--top-h);
  padding: 0 1rem;
  background: rgba(12,12,11,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 70;
}
.top-logo {
  width: 40px; height: 40px; object-fit: contain; border-radius: 50%;
}
.top-txt b {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.15;
}
.top-txt small {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.top-line {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.5rem;
}
.top-menu {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.25rem;
}
.top-menu:hover { background: var(--bg-card); }

/* Main */
.main {
  grid-area: main;
  padding: 1.5rem 1.5rem 3rem;
  max-width: none;
  width: 100%;
}
.panel { display: none; }
.panel.active {
  display: block;
  animation: fadeIn 0.25s var(--ease);
  width: 100%;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  margin-bottom: 1.5rem;
}
.page-head.row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-head h1 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.15;
}
.page-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.block { margin-top: 0.5rem; }
.block-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.9rem;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}
.stats-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 720px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .stats-grid.three { grid-template-columns: repeat(3, 1fr); }
  .stats-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1rem;
  text-align: left;
}
.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
}
.stat-value.gold { color: var(--primary); }
.stat-value.success { color: var(--success); }

/* Filters */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
  align-items: flex-end;
}
.filter-group { flex: 1; min-width: 130px; }
.filter-group label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  font-weight: 500;
}

/* Booking cards */
/* Booking cards — 1 por linha: info à esquerda, ações à direita */
.booking-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
}
.booking-list.booking-list-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
}

.booking-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.15rem 1rem 1.25rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  min-width: 0;
}
.booking-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), rgba(194, 159, 97, 0.35));
  border-radius: 14px 0 0 14px;
}
.booking-card:hover {
  border-color: rgba(194, 159, 97, 0.28);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.booking-card.done { opacity: 0.9; }
.booking-card.noshow { opacity: 0.75; }
.booking-card.cancelled { opacity: 0.55; }

.booking-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.booking-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.booking-time-block {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.booking-time {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.booking-date, .booking-duration {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.booking-time-meta {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}
.badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  border: none;
  flex-shrink: 0;
  white-space: nowrap;
}
.badge.confirmed {
  background: var(--primary);
  color: #0c0c0b;
}
.badge.done {
  background: var(--success);
  color: #0c0c0b;
}
.badge.noshow {
  background: var(--danger);
  color: #0c0c0b;
}
.badge.cancelled {
  background: #3a3a36;
  color: var(--text-secondary);
}
.booking-info { min-width: 0; }
.booking-info strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.booking-service {
  display: block;
  color: var(--text-muted);
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.booking-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.86rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.booking-meta .price {
  color: var(--primary);
  font-weight: 800;
  white-space: nowrap;
}
.booking-meta .barber-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.booking-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-shrink: 0;
  width: 44px;
}
.booking-actions .btn-sm {
  flex: none;
  width: 44px;
  min-width: 0;
  height: 40px;
  padding: 0;
  font-size: 1.05rem;
  border: 1.5px solid transparent;
  box-sizing: border-box;
}
@media (max-width: 640px) {
  .booking-card {
    flex-direction: column;
    align-items: stretch;
  }
  .booking-actions {
    flex-direction: row;
    width: 100%;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-subtle);
  }
  .booking-actions .btn-sm {
    flex: 1;
    width: auto;
  }
}
.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.55rem 0.85rem;
  border-radius: 9px;
  transition: background 0.15s, transform 0.15s, opacity 0.15s;
  flex: 1;
  min-width: 0;
  border: none;
}
.btn-sm.success {
  background: var(--success);
  color: #0c0c0b;
}
.btn-sm.success:hover {
  background: #2bb87f;
  transform: translateY(-1px);
}
.btn-sm.danger {
  background: var(--danger);
  color: #0c0c0b;
}
.btn-sm.danger:hover {
  background: #e85a5a;
  transform: translateY(-1px);
}
.btn-sm.ghost {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.booking-actions .btn-sm.ghost {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border);
}
.booking-actions .btn-sm.ghost.cancel {
  color: var(--danger);
  border-color: rgba(239, 98, 98, 0.4);
}
.booking-actions .btn-sm.ghost.cancel:hover {
  background: rgba(239, 98, 98, 0.12);
  border-color: var(--danger);
}
.btn-sm.ghost:hover {
  background: #1c1c1a;
  color: var(--text);
  border-color: #3a3a36;
}

.empty-state {
  text-align: center;
  padding: 3.5rem 1.25rem;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.45;
  color: var(--text-muted);
}
.empty-state .empty-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.45rem;
}
.empty-state .empty-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto 1.35rem;
  line-height: 1.5;
}
.empty-state-search .btn-primary {
  margin-top: 0.5rem;
  height: 42px;
  padding: 0 1.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 999px;
  gap: 0.4rem;
  box-shadow: 0 4px 14px rgba(194, 159, 97, 0.3);
  line-height: 1;
}
.empty-state-search .btn-primary i {
  font-size: 1rem;
  margin: 0;
  opacity: 1;
  color: inherit;
  display: inline;
}
.empty-state-search > i.bi-search {
  font-size: 2.75rem;
  opacity: 0.35;
  margin-bottom: 0.85rem;
}

/* Barbers (base — festou-grid overrides layout) */
.barbers-grid {
  display: grid;
  gap: 1rem;
}
.barber-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.barber-card-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.barber-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #0c0c0b;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}
.barber-avatar.has-photo { color: transparent; font-size: 0; }
.barber-card-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
}
.barber-card-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.barber-card-meta {
  font-size: 0.84rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.barber-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.barber-card-meta i { color: var(--primary); font-size: 0.9rem; }
.barber-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  margin-left: auto;
}
.barber-status.active {
  background: rgba(52,211,153,0.12);
  color: var(--success);
}
.barber-status.inactive {
  background: rgba(138,135,128,0.12);
  color: var(--text-muted);
}
.barber-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}


.page-hello {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.stats-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: none;
  width: 100%;
}
.stat-card.icon-stat {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-align: left;
  padding: 1rem 1.15rem;
  min-height: 72px;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.stat-icon.teal {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
}
.stat-icon.gold {
  background: var(--primary-dim);
  color: var(--primary);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
  align-items: center;
  width: 100%;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: none;
  width: 100%;
}
.search-wrap > i {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}
.search-input {
  padding-left: 2.55rem !important;
}

/* Festou-style barber cards — 4 por linha */
.barbers-grid.festou-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 1rem;
  align-items: stretch;
}
@media (max-width: 1200px) {
  .barbers-grid.festou-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 900px) {
  .barbers-grid.festou-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 520px) {
  .barbers-grid.festou-grid {
    grid-template-columns: 1fr !important;
  }
}

.barber-card.festou {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  gap: 0 !important;
  min-width: 0;
  height: 100%;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.barber-card.festou:hover {
  border-color: rgba(194, 159, 97, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.barber-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(145deg, #1a1a18 0%, #121211 100%);
  overflow: hidden;
  flex-shrink: 0;
}
.barber-card-media .media-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.barber-card-media .media-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--primary);
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, rgba(194,159,97,0.18), transparent 70%),
    linear-gradient(145deg, #1c1c1a, #121211);
}
.barber-badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  z-index: 2;
}
.barber-badge.active {
  background: rgba(52, 211, 153, 0.92);
  color: #0c0c0b;
}
.barber-badge.inactive {
  background: rgba(138, 135, 128, 0.9);
  color: #0c0c0b;
}

.barber-card-body {
  padding: 0.85rem 0.95rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-width: 0;
}
.barber-card-body h3 {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.barber-card-body .desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.1em;
}
.barber-meta-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  min-width: 0;
}
.barber-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.barber-meta-row i {
  color: var(--primary);
  font-size: 0.8rem;
  flex-shrink: 0;
}
.barber-pay-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  background: var(--primary-dim);
  border: 1px solid rgba(194, 159, 97, 0.25);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.barber-card-foot {
  display: flex;
  gap: 0.4rem;
  padding: 0.65rem 0.85rem 0.85rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  flex-shrink: 0;
}
.barber-card-foot .btn-icon {
  flex: 1;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  transition: all 0.15s;
  font-size: 0.95rem;
}
.barber-card-foot .btn-icon:hover {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: #3a3a36;
}
.barber-card-foot .btn-icon.danger:hover {
  background: rgba(248,113,113,0.1);
  color: var(--danger);
  border-color: rgba(248,113,113,0.35);
}

/* stats two always 2 cols */
.stats-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  max-width: none !important;
  width: 100%;
  margin-bottom: 1.15rem;
}
@media (min-width: 900px) {
  .stats-grid.two {
    grid-template-columns: repeat(2, minmax(0, 280px)) !important;
  }
}

/* Services */
.services-admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.service-admin-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.service-admin-info { flex: 1; min-width: 0; }
.service-admin-info h3 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.service-admin-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.service-admin-meta {
  display: flex;
  gap: 0.85rem;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
}
.service-admin-meta .price { color: var(--primary); }
.service-admin-meta .duration { color: var(--text-muted); font-weight: 500; }
.service-admin-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* Period */
.period-toggle {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.35rem;
  max-width: 320px;
}
.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-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;
}

/* Forms */
.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; }
.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.9rem !important;
  color: var(--text-secondary) !important;
  user-select: none;
}
.checkbox-label input {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.checkbox-label input:hover {
  border-color: var(--primary);
}
.checkbox-label input:checked {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.checkbox-label input:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #0c0c0b;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 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; }
.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.danger {
  border-color: rgba(248,113,113,0.35);
  color: var(--danger);
}
.btn-outline.danger:hover { background: rgba(248,113,113,0.1); }
.btn-outline.full { width: 100%; justify-content: center; }

/* Modals (mb / md like Conceito) */
.mb {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.mb.open {
  opacity: 1;
  visibility: visible;
}
.md {
  width: min(420px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.25rem 1.25rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transform: scale(0.96);
  transition: transform 0.25s var(--ease);
}
.md::-webkit-scrollbar { display: none; }
.mb.open .md { transform: scale(1); }
.md.confirm-md { text-align: center; width: min(360px, 100%); }
.md-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
  flex-shrink: 0;
}
.md-head h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
}
.md-close {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
.md-close:hover { background: var(--bg-card); color: var(--text); }
.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-md 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;
}
.md-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 1rem;
  flex-shrink: 0;
}
.md-actions .btn-outline,
.md-actions .btn-primary {
  flex: 1;
  justify-content: center;
}
.md-actions.md-actions-end {
  justify-content: flex-end;
}
.md-actions.md-actions-end .btn-outline,
.md-actions.md-actions-end .btn-primary {
  flex: 0 0 auto;
  min-width: 120px;
}

/* Modal header com ícone (estilo Adicionar Peça) */
.md-head.md-head-icon {
  margin-bottom: 0;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}
.md-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.md-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary);
  color: #0c0c0b;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

/* Form modals: header + footer fixos, scroll só no meio */
.md.form-md {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  max-height: min(92vh, 720px);
  width: min(480px, 100%);
}
.md.form-md > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.md-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.15rem 1.25rem 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: #3a3a36 transparent;
}
.md-body::-webkit-scrollbar {
  width: 6px;
}
.md-body::-webkit-scrollbar-track {
  background: transparent;
}
.md-body::-webkit-scrollbar-thumb {
  background: #3a3a36;
  border-radius: 6px;
}
.md.form-md .md-actions {
  margin-top: 0;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}
.barber-form-md {
  width: min(480px, 100%);
}

/* Zona de upload de foto */
.photo-dropzone {
  position: relative;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
}
.photo-dropzone:hover,
.photo-dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-dim);
}
.photo-dropzone.has-image {
  border-style: dashed;
  border-color: var(--border);
  min-height: 120px;
}
.photo-dropzone-empty,
.photo-dropzone-current {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  text-align: center;
  width: 100%;
}
.photo-dropzone-empty i,
.photo-dropzone-current i {
  font-size: 1.75rem;
  color: var(--primary);
  opacity: 0.9;
}
.photo-dropzone-empty span,
.photo-dropzone-current .current-label {
  font-size: 0.85rem;
}
.photo-dropzone-current .current-label {
  color: var(--primary);
  font-weight: 700;
}
.photo-dropzone-current .current-name {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-dropzone-preview {
  display: none !important;
}
.photo-dropzone-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.9);
  color: #fff;
  display: grid;
  place-items: center;
  border: none;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s;
}
.photo-dropzone-remove:hover {
  background: var(--danger);
}
.photo-dropzone-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.85;
  margin-top: 0.1rem;
}
/* Mesmo estilo do dropzone de barbeiro (largura total) */
.photo-dropzone-product {
  min-height: 120px;
  width: 100%;
  max-width: none;
  margin: 0;
  aspect-ratio: auto;
}

.status-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}
.status-options .btn-sm { flex: none; }

.side-backdrop {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.side-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 500;
  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);
}

body.modal-open { overflow: hidden; }

/* Mobile: sidebar drawer */
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "main";
  }
  .side {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.3s var(--ease);
    box-shadow: 8px 0 32px rgba(0,0,0,0.4);
  }
  .side.open { transform: translateX(0); }
  .top { display: flex; }
  .main { padding: 1.25rem 1.1rem 2.5rem; }
  .stats-grid.three { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-head.row { flex-direction: column; }
}

@media (min-width: 901px) {
  .side-backdrop { display: none !important; }
}


/* BARBER SYSTEM CARDS (ESTOQUE PROPORTIONS & SYSTEM THEME) */
.stats-estoque {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-estoque-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon-sq {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  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-txt .lbl {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.stat-txt .val {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.toolbar-estoque {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .toolbar-estoque {
    flex-direction: column;
  }
  .custom-select {
    width: 100%;
    min-width: 0;
  }
}
.toolbar-estoque .search-wrap {
  flex: 1;
  position: relative;
}
.toolbar-estoque .search-wrap i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.toolbar-estoque .search-wrap input {
  width: 100%;
  height: 46px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 1rem 0 2.5rem;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.toolbar-estoque .search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
/* Remove native clear (X) button from search inputs */
.toolbar-estoque .search-wrap input[type="search"]::-webkit-search-cancel-button,
.toolbar-estoque .search-wrap input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
input[type="search"]::-ms-clear {
  display: none;
  width: 0;
  height: 0;
}
/* Custom select (estilo dropdown moderno) */
.custom-select {
  position: relative;
  min-width: 180px;
  flex-shrink: 0;
  height: 46px;
}
.custom-select.custom-select-block {
  width: 100%;
  min-width: 0;
  height: auto;
}
.custom-select.custom-select-block .custom-select-trigger {
  height: 46px;
}
.custom-select.custom-select-block .custom-select-label {
  color: var(--text);
}
.custom-select.custom-select-block .custom-select-label strong {
  color: var(--text);
  font-weight: 500;
}
.custom-select-trigger {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  height: 46px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 1rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  text-align: left;
}
.custom-select-trigger:hover {
  border-color: #3a3a36;
  background: var(--bg-elevated);
}
.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
  outline: none;
}
.custom-select-trigger .bi-funnel {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-shrink: 0;
}
.custom-select-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}
.custom-select-label strong {
  color: var(--primary);
  font-weight: 700;
}
.custom-select-chevron {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: transform 0.2s var(--ease);
  flex-shrink: 0;
}
.custom-select.open .custom-select-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.custom-select.open .custom-select-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  padding: 0.35rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(194, 159, 97, 0.15);
  z-index: 50;
  animation: dropdownIn 0.18s var(--ease);
}
.custom-select-dropdown[hidden] {
  display: none !important;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@keyframes dropdownInUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.custom-select-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.95rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.custom-select-option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
.custom-select-option.selected {
  background: var(--primary-dim);
  color: var(--primary);
  font-weight: 700;
}
.custom-select-option.hidden-by-search {
  display: none !important;
}

/* Dropdown com busca + altura fixa (~3 opções) */
.custom-select-dropdown-search {
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.custom-select-search-wrap {
  position: relative;
  flex-shrink: 0;
}
.custom-select-search-wrap > i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}
.custom-select-search {
  width: 100%;
  height: 38px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 0.75rem 0 2.15rem;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.custom-select-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-dim);
}
.custom-select-search::placeholder {
  color: var(--text-muted);
}
.custom-select-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.custom-select-options {
  max-height: 132px; /* ~3 opções */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #3a3a36 transparent;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.custom-select-options::-webkit-scrollbar {
  width: 6px;
}
.custom-select-options::-webkit-scrollbar-track {
  background: transparent;
}
.custom-select-options::-webkit-scrollbar-thumb {
  background: #3a3a36;
  border-radius: 6px;
}

.barbers-grid.estoque-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 1.25rem;
}
@media (max-width: 1200px) {
  .barbers-grid.estoque-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 900px) {
  .barbers-grid.estoque-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 600px) {
  .barbers-grid.estoque-grid {
    grid-template-columns: 1fr !important;
  }
}

.estoque-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.estoque-card:hover {
  border-color: rgba(194, 159, 97, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.estoque-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(145deg, #1a1a18 0%, #121211 100%);
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}
/* Cards de produto: proporção 4:3 — corta (crop) qualquer imagem */
.estoque-card.product-card .estoque-card-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.estoque-card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}
.estoque-card-img .media-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--primary);
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, rgba(194,159,97,0.18), transparent 70%),
    linear-gradient(145deg, #1c1c1a, #121211);
}
.estoque-card-img .media-fallback.service-media {
  font-size: 2.5rem;
}
.estoque-card-img .media-fallback.service-media i {
  font-size: 2.5rem;
  color: var(--primary);
  opacity: 0.85;
}
.estoque-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  z-index: 2;
}
.estoque-badge.active {
  background: rgba(52, 211, 153, 0.92);
  color: #0c0c0b;
}
.estoque-badge.inactive {
  background: rgba(138, 135, 128, 0.9);
  color: #0c0c0b;
}

.estoque-card-body {
  padding: 1rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.estoque-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.estoque-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.estoque-row .sku {
  color: var(--primary);
  font-weight: 600;
}
.estoque-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.estoque-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
}
.estoque-price span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}
.estoque-stock {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.estoque-stock i {
  color: var(--primary);
  font-size: 0.95rem;
}
.estoque-info-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: var(--primary-dim);
  border: 1px solid rgba(194, 159, 97, 0.25);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  width: fit-content;
  margin-bottom: 1rem;
}

.estoque-card-foot {
  display: flex;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
  margin-top: auto;
}
.estoque-card-foot .btn-action {
  flex: 1;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  transition: all 0.15s;
  font-size: 0.95rem;
  cursor: pointer;
}
.estoque-card-foot .btn-action:hover {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: #3a3a36;
}
.estoque-card-foot .btn-action.danger:hover {
  background: rgba(248,113,113,0.1);
  color: var(--danger);
  border-color: rgba(248,113,113,0.35);
}

/* ========== Agendamentos (estilo unificado) ========== */
.toolbar-agendamentos {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  width: 100%;
  flex-wrap: nowrap;
}
.toolbar-agendamentos .filter-inline {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.toolbar-agendamentos .filter-inline label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.toolbar-agendamentos .filter-inline .input {
  height: 46px;
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 0.9rem;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.toolbar-agendamentos .filter-inline .input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

/* Custom date picker */
.custom-date {
  position: relative;
  width: 100%;
}
.custom-date-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  height: 46px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 0.9rem 0 1rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  text-align: left;
}
.custom-date-trigger:hover {
  border-color: #3a3a36;
  background: var(--bg-elevated);
}
.custom-date.open .custom-date-trigger,
.custom-date-trigger:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
  outline: none;
}
.custom-date-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.custom-date-icon {
  color: var(--primary);
  font-size: 1.05rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
}
.custom-date.open .custom-date-icon {
  color: var(--primary-bright);
}
.custom-date-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  width: 280px;
  background: var(--bg-card);
  border: 0;
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  z-index: 60;
  /* mesma animação do seletor de cor: nasce do botão (origem calculada em JS) */
  transform-origin: var(--ox, calc(100% - 24px)) var(--oy, 0);
  animation: cpPopIn 0.24s var(--ease) both;
}
.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(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.06);
}
.custom-date-nav:active {
  background: rgba(255, 255, 255, 0.1);
}
.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 5px; /* respiro entre colunas para o anel de hoje não encostar no dia ao lado */
}
.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) {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}
.custom-date-day.empty {
  cursor: default;
  visibility: hidden;
}
.custom-date-day.other-month {
  color: var(--text-muted);
  opacity: 0.45;
}
.custom-date-day.today {
  position: relative;
  color: var(--primary);
}
/* anel do dia de hoje: mesmo tamanho dos outros dias, 2px de espessura para dentro */
.custom-date-day.today::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid rgba(194, 159, 97, 0.5);
  border-radius: 8px;
  pointer-events: none;
}
.custom-date-day.today.selected::after { display: none; }
.custom-date-day.selected {
  background: var(--primary);
  color: #0c0c0b;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(194, 159, 97, 0.25);
}
.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: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.toolbar-agendamentos .custom-select {
  width: 100%;
  min-width: 0;
  height: 46px;
}
.toolbar-agendamentos .custom-select-trigger {
  height: 46px;
}
.toolbar-agendamentos .custom-select-label {
  color: var(--text);
}
.toolbar-agendamentos .custom-select-label strong {
  color: var(--text);
  font-weight: 500;
}
@media (max-width: 700px) {
  .toolbar-agendamentos {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: wrap;
  }
}

/* Lista compacta (dashboard) */
.booking-list.booking-list-single {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  max-width: none;
}

/* ========== Produtos — toggle da aba ========== */
.products-tab-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  flex-wrap: wrap;
}
.products-tab-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}
.products-tab-toggle-info strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.products-tab-toggle-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 520px;
}

/* Switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
  cursor: pointer;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  background: #2a2a28;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s;
}
.switch-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s var(--ease), background 0.2s;
}
.switch input:checked + .switch-slider {
  background: var(--primary-dim);
  border-color: var(--primary);
}
.switch input:checked + .switch-slider::before {
  transform: translateY(-50%) translateX(22px);
  background: var(--primary);
}
.switch:hover .switch-slider {
  border-color: #3a3a36;
}
.switch input:checked:hover + .switch-slider {
  border-color: var(--primary-bright);
}

.form-hint {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.form-hint strong {
  color: var(--primary);
  font-weight: 700;
}

.estoque-price .price-old {
  margin-left: 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Modal de produto: altura fixa (foto + promoção) */
.md.form-md.product-form-md {
  height: min(92vh, 680px);
  max-height: min(92vh, 680px);
  display: flex;
  flex-direction: column;
}
.md.form-md.product-form-md form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.md.form-md.product-form-md .md-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #3a3a36 transparent;
}
.md.form-md.product-form-md .md-actions {
  flex-shrink: 0;
}

/* ========== Financeiro (estilo próprio) ========== */
.fin-period-toggle {
  max-width: 420px;
  margin-bottom: 0.5rem;
}
.fin-period-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.stats-estoque.fin-stats {
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 1.5rem;
}
@media (min-width: 900px) {
  .stats-estoque.fin-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}
.stat-icon-sq.teal {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
}
.stat-icon-sq.gold {
  background: var(--primary-dim);
  color: var(--primary);
}

.fin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (min-width: 960px) {
  .fin-grid {
    grid-template-columns: 1.4fr 1fr;
    align-items: stretch;
  }
}

.fin-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.15rem 1.15rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.fin-panel-full {
  margin-bottom: 1.5rem;
}
.fin-panel-head {
  margin-bottom: 0.85rem;
}
.fin-panel-head .block-title {
  margin-bottom: 0.15rem;
}
.fin-panel-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.fin-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 220px;
  flex: 1;
}
.fin-panel-full .fin-chart-wrap {
  min-height: 200px;
}
.fin-chart-wrap canvas {
  width: 100% !important;
  max-height: 260px;
}
.fin-chart-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 2.5rem 1rem;
}

/* Ranking */
.fin-ranking {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}
.fin-rank-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.fin-rank-pos {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 800;
  flex-shrink: 0;
  color: var(--text-secondary);
}
.fin-rank-body {
  flex: 1;
  min-width: 0;
}
.fin-rank-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.fin-rank-top strong {
  font-size: 0.92rem;
  font-weight: 700;
}
.fin-rank-top span {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}
.fin-rank-bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-bottom: 0.3rem;
}
.fin-rank-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-bright));
  min-width: 4px;
  transition: width 0.35s var(--ease);
}
.fin-rank-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.fin-rank-meta span:first-child {
  color: var(--primary);
  font-weight: 600;
}
.fin-rank-empty {
  padding: 1.5rem 0.5rem;
}
.fin-rank-empty i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* ========== Financeiro v2 — lucro real ========== */
.stat-icon-sq.danger {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

.fin-summary-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: -0.5rem 0 1.35rem;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  width: fit-content;
}

#finProfit.fin-loss {
  color: var(--danger) !important;
}

.fin-two-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: stretch;
}
@media (min-width: 900px) {
  .fin-two-cols {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}

.expense-row-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.expense-amount {
  color: var(--danger) !important;
  margin-right: 0.25rem;
}
.btn-icon-sm {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.btn-icon-sm:hover {
  color: var(--text);
  background: var(--bg-elevated);
  border-color: #3a3a36;
}
.btn-icon-sm.danger:hover {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
}

.fin-expenses-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}
.fin-expenses-head .block-title {
  margin-bottom: 0;
}

/* Esconde gráficos antigos se ainda existirem no DOM */
.fin-grid,
.fin-panel-full,
.fin-chart-wrap {
  display: none !important;
}

/* ========== Financeiro v3 — período + parcelado ========== */
.fin-filters {
  margin-bottom: 1.25rem;
}
.fin-filters .fin-custom-range {
  margin: 0.65rem 0 0.25rem;
  max-width: 420px;
}
.fin-filters .fin-custom-range .form-row {
  gap: 0.65rem;
}
.fin-filters .fin-custom-range input[type="date"].input {
  height: 46px;
  color-scheme: dark;
}

/* Date pickers do Personalizado (Financeiro + modais) */
.fin-custom-range .custom-date.fin-date {
  width: 100%;
}
.fin-custom-range .custom-date.fin-date .custom-date-trigger {
  height: 46px;
  width: 100%;
}
.fin-custom-range .custom-date.fin-date .custom-date-dropdown {
  z-index: 270;
  min-width: 280px;
}
.fin-detail-filters .fin-custom-range .custom-date.fin-date .custom-date-dropdown {
  z-index: 280;
}


.fin-period-toggle {
  max-width: 360px;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}
.fin-block-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0;
}
.fin-card-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.15rem 1.15rem;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  max-height: 420px;
  height: 100%;
  overflow: hidden;
}
.fin-card-block .block-title {
  margin-bottom: 0;
}
.fin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
  flex-shrink: 0;
}
.fin-card-head > div {
  min-width: 0;
  flex: 1;
}
.fin-ver-mais {
  flex-shrink: 0;
  height: 36px;
  padding: 0 0.95rem;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  align-self: flex-start;
}
.fin-card-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #3a3a36 transparent;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
}
.fin-card-scroll::-webkit-scrollbar {
  width: 6px;
}
.fin-card-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.fin-card-scroll::-webkit-scrollbar-thumb {
  background: #3a3a36;
  border-radius: 6px;
}
.fin-card-scroll .earnings-history-list:empty {
  display: none;
}
.fin-card-scroll .empty-state {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1rem;
  margin: 0;
  box-sizing: border-box;
}
.fin-card-scroll .empty-state i {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
  display: block;
}
.fin-parcel-tag {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  background: rgba(194, 159, 97, 0.18);
  color: var(--primary);
  vertical-align: middle;
}
.fin-parcel-hint {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-secondary);
}
.fin-summary-note {
  max-width: 100%;
}

/* Modal de despesa: altura fixa + scroll interno */
.md.form-md.expense-form-md {
  height: min(92vh, 560px);
  max-height: min(92vh, 560px);
  display: flex;
  flex-direction: column;
}
.md.form-md.expense-form-md form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.md.form-md.expense-form-md .md-body {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.15rem 1.25rem 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: #3a3a36 transparent;
}
.md.form-md.expense-form-md .md-body::-webkit-scrollbar {
  width: 6px;
}
.md.form-md.expense-form-md .md-body::-webkit-scrollbar-thumb {
  background: #3a3a36;
  border-radius: 6px;
}
.md.form-md.expense-form-md .md-actions {
  flex-shrink: 0;
}

.fin-parcel-tag.entrada {
  background: rgba(52, 211, 153, 0.18);
  color: var(--success);
}

#expenseFrequency.input {
  height: 46px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238a8780' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 5.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2rem;
}

/* Date picker no modal de despesa — dropdown em position:fixed via JS */
#expenseDatePicker {
  width: 100%;
}
#expenseDatePicker .custom-date-trigger {
  height: 46px;
}
#expenseDatePicker .custom-date-dropdown {
  z-index: 200;
}


/* Calendário do modal de despesa (portal no body) */
#expenseDateDropdown:not([hidden]) {
  display: block !important;
}
body > #expenseDateDropdown {
  z-index: 10000;
}


/* Frequência no modal de despesa — abre para cima */
#expenseFrequencySelect {
  width: 100%;
}
#expenseFrequencySelect .custom-select-trigger {
  height: 46px;
}
#expenseFrequencySelect .custom-select-dropdown {
  z-index: 250;
  top: auto !important;
  bottom: calc(100% + 6px) !important;
  left: 0;
  right: 0;
  width: 100%;
  animation: dropdownInUp 0.18s var(--ease);
}
#expenseMb .custom-select.open .custom-select-dropdown {
  display: block;
}

/* ========== Financeiro — modais Ver mais ========== */
.md.form-md.fin-detail-md {
  width: min(560px, 100%);
  height: min(92vh, 640px);
  max-height: min(92vh, 640px);
  display: flex;
  flex-direction: column;
}
.md.form-md.fin-detail-md .fin-detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem 1.25rem 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: #3a3a36 transparent;
}
/* Com pouco conteúdo (sem overflow), padding L/R fica idêntico.
   Com scroll, a barra usa espaço interno — evita gutter reservado assimétrico. */
.md.form-md.fin-detail-md .fin-detail-body::-webkit-scrollbar {
  width: 6px;
}
.md.form-md.fin-detail-md .fin-detail-body::-webkit-scrollbar-thumb {
  background: #3a3a36;
  border-radius: 6px;
}
.fin-detail-filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}
.fin-detail-filters .period-toggle {
  max-width: 100%;
  flex-wrap: wrap;
}
.fin-detail-filters .form-group label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  font-weight: 500;
}
.fin-custom-range .form-row {
  gap: 0.65rem;
}
.fin-custom-range input[type="date"].input {
  height: 46px;
  color-scheme: dark;
}
.fin-detail-list {
  flex: 1;
  min-height: 0;
}
/* Lista vazia não pode competir por espaço com o empty state */
.fin-detail-list:empty {
  display: none !important;
  flex: 0 0 0 !important;
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}
.fin-detail-md .empty-state {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1.25rem;
  margin: 0;
  box-sizing: border-box;
}
.fin-detail-md .empty-state i {
  font-size: 2.25rem;
  margin-bottom: 0.65rem;
  opacity: 0.4;
  display: block;
}
.fin-detail-md #finBarbersModalEmpty,
.fin-detail-md #finExpensesModalEmpty,
.fin-detail-md #finIncomesModalEmpty,
.fin-detail-md #finFutureModalEmpty {
  text-align: center;
}
.fin-detail-md .md-actions {
  flex-shrink: 0;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
.fin-detail-md .md-head.md-head-icon {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
#finBarbersFilterSelect .custom-select-dropdown,
#finExpensesSortSelect .custom-select-dropdown {
  z-index: 260;
}

/* Calendários do Personalizado (portal no body) */
body > [id$="DateFromDropdown"]:not([hidden]),
body > [id$="DateToDropdown"]:not([hidden]) {
  display: block !important;
  z-index: 10000;
}

/* Financeiro — ações do header */
.fin-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.fin-head-actions .btn-primary,
.fin-head-actions .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 44px;
  padding: 0 1.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 10px;
  line-height: 1;
  box-sizing: border-box;
}
.fin-head-actions .btn-outline {
  border-width: 1.5px;
}
.fin-card-block-full {
  margin-top: 1.75rem;
  max-height: 360px;
}
.income-amount {
  color: var(--success) !important;
  margin-right: 0.25rem;
}
#incomeDatePicker {
  width: 100%;
}
#incomeDatePicker .custom-date-trigger {
  height: 46px;
}
body > #incomeDateDropdown:not([hidden]) {
  display: block !important;
  z-index: 10000;
}

/* Modal Nova entrada — padding lateral igual */
#incomeMb .md-head.md-head-icon,
#incomeMb .md-actions {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
#incomeMb .md-body {
  padding: 1.15rem 1.25rem 0.5rem;
}

#incomeMb .custom-select-dropdown {
  z-index: 320;
}

/* Campos só leitura (Nova entrada) */
.input.input-readonly,
input.input-readonly {
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--text-secondary) !important;
  cursor: default;
  pointer-events: none;
  opacity: 0.95;
}
.input.input-readonly:focus {
  outline: none;
  border-color: var(--border);
  box-shadow: none;
}

/* Entradas + Despesas futuras */
.fin-bottom-cols {
  margin-top: 1.75rem;
}



/* ========== Financeiro — ajustes de layout ========== */
/* Todos os cards (topo e base) com a MESMA altura */
.fin-card-block,
.fin-bottom-cols .fin-card-block {
  height: 400px;
  min-height: 400px;
  max-height: 400px;
}
.fin-two-cols > .fin-card-block {
  height: 400px;
}

/* Barra de filtros organizada */
.fin-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.9rem 1.25rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.fin-filters .period-toggle,
.fin-filters .fin-period-toggle {
  margin: 0;
  width: auto;
  max-width: none;
  flex-wrap: nowrap;
}
.fin-filters .period-btn {
  flex: none;
  padding: 0.62rem 1.05rem;
}
.fin-filters .fin-custom-range {
  display: flex;
  margin: 0;
  max-width: none;
}
.fin-filters .fin-custom-range .form-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
}
.fin-filters .fin-custom-range .form-group {
  margin: 0;
  width: 190px;
}
.fin-filters .fin-custom-range .form-group label {
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.fin-filters .fin-custom-range .custom-date.fin-date .custom-date-trigger {
  height: 46px;
}
.fin-report-btn {
  margin-left: auto;
  height: 46px;
  padding: 0 1.15rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  border-color: var(--primary);
  white-space: nowrap;
}
.fin-report-btn:hover {
  background: var(--primary-dim);
  color: var(--primary-bright);
}
.fin-filters .fin-period-label {
  flex-basis: 100%;
  margin: 0;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
}
@media (max-width: 720px) {
  .fin-filters .period-toggle,
  .fin-filters .fin-period-toggle {
    width: 100%;
  }
  .fin-filters .period-btn {
    flex: 1;
    padding: 0.62rem 0.4rem;
  }
  .fin-filters .fin-custom-range,
  .fin-filters .fin-custom-range .form-row {
    width: 100%;
  }
  .fin-filters .fin-custom-range .form-group {
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .fin-report-btn {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}
@media (max-width: 899px) {
  .fin-card-block,
  .fin-bottom-cols .fin-card-block {
    height: 380px;
    min-height: 380px;
    max-height: 380px;
  }
}

/* Distância entre a linha de cima e a de baixo = distância entre as colunas (1.5rem) */
.fin-bottom-cols {
  margin-top: 1.5rem;
}
.fin-bottom-cols > .fin-card-block {
  margin-top: 0;
}


/* ========== Despesas futuras — estilo extrato Nubank ========== */
#finFutureModalList.fin-detail-list {
  gap: 1.35rem;
  padding-bottom: 0.75rem;
}
.nu-day { display: flex; flex-direction: column; }
.nu-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0.15rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.nu-day-total {
  font-size: 0.74rem;
  letter-spacing: 0;
  color: var(--text-muted);
  white-space: nowrap;
}
.nu-day-rows { display: flex; flex-direction: column; }
.nu-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0.15rem;
  border-bottom: 1px solid var(--border-subtle);
}
.nu-day-rows .nu-row:last-child { border-bottom: none; }
.nu-row-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-dim);
  color: var(--primary);
  font-size: 1.05rem;
}
.nu-row-info { flex: 1; min-width: 0; }
.nu-row-info strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nu-row-info span {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.nu-row-amount {
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* ========== Financeiro — barra de filtros (arrumada) ========== */
.fin-filters {
  align-items: center;
  gap: 0.85rem 1rem;
  padding: 1rem 1.1rem;
}
.fin-filters .period-toggle,
.fin-filters .fin-period-toggle {
  height: 50px;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.3rem;
  background: var(--bg-input);
}
.fin-filters .period-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.05rem;
  border-radius: 9px;
  line-height: 1;
}

/* De / Até: uma única caixa, rótulo dentro do campo */
.fin-filters .fin-custom-range {
  display: flex;
  align-items: center;
  margin: 0;
  max-width: none;
}
.fin-filters .fin-custom-range .form-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  height: 50px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fin-filters .fin-custom-range .form-row:hover {
  border-color: #3a3a36;
}
.fin-filters .fin-custom-range .form-row:focus-within,
.fin-filters .fin-custom-range .form-row:has(.custom-date.open) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.fin-filters .fin-custom-range .form-group {
  position: relative;
  width: 178px;
  margin: 0;
}
.fin-filters .fin-custom-range .form-group + .form-group::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--border);
}
.fin-filters .fin-custom-range .form-group label {
  position: absolute;
  top: 7px;
  left: 1rem;
  z-index: 1;
  margin: 0;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
}
.fin-filters .fin-custom-range .custom-date.fin-date,
.fin-filters .fin-custom-range .custom-date.fin-date .custom-date-trigger {
  height: 100%;
}
.fin-filters .fin-custom-range .custom-date.fin-date .custom-date-trigger {
  padding: 16px 0.9rem 0 1rem;
  background: transparent;
  border: none;
  border-radius: 10px;
  box-shadow: none;
  font-size: 0.92rem;
  font-weight: 600;
}
.fin-filters .fin-custom-range .custom-date.fin-date .custom-date-trigger:hover {
  background: rgba(255, 255, 255, 0.03);
}
.fin-filters .fin-custom-range .custom-date.fin-date .custom-date-icon {
  margin-top: -16px;
  color: var(--primary);
}
.fin-filters .fin-custom-range .custom-date.fin-date .custom-date-dropdown {
  top: calc(100% + 10px);
}

/* Botão Gerar relatório */
.fin-filters .fin-report-btn {
  margin-left: auto;
  height: 50px;
  padding: 0 1.3rem;
  gap: 0.55rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-dim);
  border: 1.5px solid rgba(194, 159, 97, 0.55);
}
.fin-filters .fin-report-btn i { font-size: 1.05rem; }
.fin-filters .fin-report-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #0c0c0b;
}
.fin-filters .fin-report-btn:active { transform: translateY(1px); }

@media (max-width: 720px) {
  .fin-filters .period-toggle,
  .fin-filters .fin-period-toggle { height: auto; min-height: 50px; }
  .fin-filters .period-btn { flex: 1; min-height: 40px; padding: 0 0.4rem; }
  .fin-filters .fin-custom-range,
  .fin-filters .fin-custom-range .form-row { width: 100%; }
  .fin-filters .fin-custom-range .form-group { flex: 1; width: auto; min-width: 0; }
  .fin-filters .fin-report-btn { margin-left: 0; width: 100%; justify-content: center; }
}

/* Novo agendamento: campo de data e opções desabilitadas no tema escuro */
#bookingMb input[type="date"] { color-scheme: dark; }
#bookingMb .custom-select-option:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: transparent;
  color: var(--text-muted);
}
#bookingMb .custom-select-dropdown { z-index: 320; }
#bookingMb .md-body { padding-bottom: 0.75rem; }
/* Barbeiro e Horário abrem para cima, para o dropdown não estourar o fim do modal */
#bkBarberSelect .custom-select-dropdown,
#bkTimeSelect .custom-select-dropdown {
  top: auto;
  bottom: calc(100% + 6px);
  animation: dropdownInUp 0.18s var(--ease);
}

/* Calendário do novo agendamento */
#bkDatePicker { width: 100%; }
#bkDatePicker .custom-date-trigger { height: 46px; }
body > #bkDateDropdown:not([hidden]) { display: block !important; z-index: 10000; }
.custom-date-day.disabled,
.custom-date-day:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Calendário do novo agendamento — versão compacta */
#bkDateDropdown { padding: 0.55rem; }
#bkDateDropdown .custom-date-header { margin-bottom: 0.4rem; }
#bkDateDropdown .custom-date-nav { width: 28px; height: 28px; }
#bkDateDropdown .custom-date-month { font-size: 0.82rem; }
#bkDateDropdown .custom-date-weekdays { margin-bottom: 0.15rem; }
#bkDateDropdown .custom-date-weekdays span { font-size: 0.68rem; padding: 0.15rem 0; }
#bkDateDropdown .custom-date-day { aspect-ratio: auto; height: 28px; font-size: 0.78rem; border-radius: 7px; }
#bkDateDropdown .custom-date-footer { margin-top: 0.4rem; padding-top: 0.3rem; }
#bkDateDropdown .custom-date-action { font-size: 0.78rem; padding: 0.25rem 0.5rem; }

/* Barbeiro desabilitado até escolher o horário */
#bookingMb .custom-select-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.03);
}
#bookingMb .custom-select-trigger:disabled:hover { border-color: var(--border); }


/* ========== AGENDA EM GRADE ========== */
.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 { transition: color 0.15s, background 0.15s, border-color 0.15s; }
.agenda-nav-btn:hover { border-color: var(--border); color: var(--text); background: rgba(255, 255, 255, 0.06); }
.agenda-nav-btn:active { background: rgba(255, 255, 255, 0.1); }
.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);
}

.agenda-scroll {
  position: relative; overflow: auto; max-height: calc(100vh - 290px); min-height: 360px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.agenda-grid { display: grid; min-width: min-content; }

.agenda-corner, .agenda-colhead { position: sticky; top: 0; z-index: 6; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.agenda-corner { left: 0; z-index: 8; }
.agenda-colhead {
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.7rem 0.5rem; border-left: 1px solid var(--border-subtle); min-width: 0;
}
.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-avatar img { width: 100%; height: 100%; object-fit: cover; }

.agenda-hours { position: sticky; left: 0; z-index: 5; background: var(--bg-card); }
.agenda-hour {
  display: flex; align-items: flex-start; justify-content: center; padding-top: 4px;
  font-size: 0.7rem; color: var(--text-muted); font-variant-numeric: tabular-nums;
  border-top: 1px solid var(--border-subtle);
}
.agenda-hour.full { color: var(--text-secondary); font-weight: 600; border-top-color: var(--border); }

.agenda-col { position: relative; border-left: 1px solid var(--border-subtle); min-width: 0; }
.agenda-cell {
  border-top: 1px dashed var(--border-subtle); display: flex; align-items: center; justify-content: center;
  color: transparent; font-size: 0.85rem; transition: background 0.15s, color 0.15s;
}
.agenda-cell.full { border-top: 1px solid var(--border); }
.agenda-cell.free { cursor: pointer; }
.agenda-cell.free:hover { background: var(--primary-dim); color: var(--primary); }

.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: 8px; padding: 5px 8px;
  color: #2a2118; cursor: pointer; border-left: 4px solid rgba(0, 0, 0, 0.28);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  outline: none;
}
.agenda-card:hover, .agenda-card:focus-visible { z-index: 4; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); filter: brightness(1.04); }
.agenda-card.confirmed { background: #f6c98a; }
.agenda-card.done { background: #9fe3b0; color: #12301c; }
.agenda-card.noshow { background: #ef7f7f; color: #3a0f0f; }
.agenda-card.cancelled { background: #a9a9a4; color: #262623; opacity: 0.8; }
.agenda-card .ac-name { font-size: 0.78rem; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-card .ac-service { font-size: 0.72rem; line-height: 1.25; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-card .ac-time { font-size: 0.68rem; font-weight: 600; opacity: 0.8; margin-top: 2px; white-space: nowrap; }
.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.ag-sm .ac-time { display: none; }
.agenda-card.cancelled .ac-name { text-decoration: line-through; }

/* Hora atual */
.agenda-now { position: absolute; left: 0; right: 0; z-index: 5; height: 0; border-top: 2px solid #c9a96a; pointer-events: none; }

/* Popover */
.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;
}
.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);
}
.agenda-pop .ap-btn:hover { border-color: var(--primary); color: var(--primary); }
.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; }

@media (max-width: 640px) {
  .agenda-title { font-size: 1.2rem; }
  .agenda-scroll { max-height: calc(100vh - 240px); }
}

/* ---- Faixas separadas por barbeiro ---- */
.agenda-scroll { background: var(--bg); }
.agenda-corner, .agenda-hours { background: var(--bg); }
.agenda-corner { border-bottom: none; }
.agenda-hour { border-top-color: var(--border-subtle); padding-right: 4px; }

.agenda-colhead {
  background: var(--bg);
  border-left: 7px solid var(--bg);
  border-right: 7px solid var(--bg);
  border-bottom: none;
  padding: 0.55rem 0;
}
.agenda-colhead > * { position: relative; }
.agenda-colhead::before {
  content: ''; position: absolute; inset: 0 0 0 0; z-index: 0;
  background: var(--bg-card); border: 1px solid var(--border); border-bottom: 2px solid var(--primary);
  border-radius: 12px 12px 0 0;
}
.agenda-colhead > * { z-index: 1; }

.agenda-col {
  background: var(--bg-card);
  border-left: 7px solid var(--bg);
  border-right: 7px solid var(--bg);
  box-shadow: inset 1px 0 0 var(--border), inset -1px 0 0 var(--border);
  background-clip: padding-box;
}
.agenda-cell { border-top: 1px dashed var(--border-subtle); }
.agenda-cell.full { border-top: 1px solid var(--border-subtle); }
.agenda-card { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }

/* ---- Sem rolagem interna: a página rola ---- */
.agenda-scroll { max-height: none; min-height: 0; overflow-x: auto; overflow-y: visible; }
@media (max-width: 640px) { .agenda-scroll { max-height: none; } }

/* ---- Horários livres visíveis ---- */
.agenda-cell.free { color: var(--text-muted); }
.agenda-cell .free-label {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  color: rgba(138, 135, 128, 0.55); transition: color 0.15s;
}
.agenda-cell.free:hover { background: var(--primary-dim); }
.agenda-cell.free:hover .free-label { color: var(--primary-bright); }
.agenda-cell.past { background: rgba(0, 0, 0, 0.18); }


/* ---- Sem bordas: cada barbeiro é um cartão liso ---- */
.agenda-scroll { border: none; border-radius: 0; background: transparent; }
.agenda-corner, .agenda-hours { background: var(--bg); }

.agenda-colhead::before { border: none; border-radius: 14px 14px 0 0; background: var(--bg-card); }
.agenda-col {
  box-shadow: none;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
}
/* o cabeçalho e a faixa viram um cartão só */
.agenda-colhead { border-radius: 14px 14px 0 0; }

/* linhas de horário mais discretas */
.agenda-cell, .agenda-cell.full { border-top: 1px solid rgba(255, 255, 255, 0.035); }
.agenda-hour, .agenda-hour.full { border-top: none; }
.agenda-hour span { position: relative; top: -2px; }

/* ---- Coluna das horas também é um cartão ---- */
.agenda-corner {
  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'; }
.agenda-hours {
  background: var(--bg-card);
  background-clip: padding-box;
  border-right: 7px solid var(--bg);
  border-radius: 0 0 14px 14px;
  overflow: hidden; /* o hover da última hora acompanha o canto arredondado do cartão */
}

/* ---- Hora centralizada na altura da linha ---- */
.agenda-hour { align-items: center; padding-top: 0; }
.agenda-hour span { top: 0; line-height: 1; }

/* ---- Hover da linha inteira ---- */
.agenda-cell, .agenda-hour { transition: background 0.12s, color 0.12s; }
.agenda-cell.row-hover { background: rgba(255, 255, 255, 0.05); }
.agenda-cell.free.row-hover:hover { background: var(--primary-dim); }
.agenda-cell.row-hover .free-label { color: rgba(212, 178, 122, 0.85); }
.agenda-hour.row-hover { background: var(--primary-dim); color: var(--primary-bright); }
.agenda-hour.row-hover span { color: var(--primary-bright); font-weight: 700; }

/* ---- Card preenchendo o bloco do horário; hover só muda o tom ---- */
.agenda-card {
  border-radius: 0;
  box-shadow: inset 0 1px 0 var(--bg-card), inset 0 -1px 0 var(--bg-card);
  transition: background 0.15s;
}
.agenda-card:hover, .agenda-card:focus-visible {
  transform: none; filter: none; z-index: 3;
  box-shadow: inset 0 1px 0 var(--bg-card), inset 0 -1px 0 var(--bg-card);
}
.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; opacity: 0.8; }


/* ========== BUSCA POR NOME NA AGENDA ========== */
.agenda-search {
  display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.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 1rem 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-card.search-dim { opacity: 0.18; filter: grayscale(0.6); }
.agenda-card.search-hit { z-index: 5; outline: 2px solid var(--primary); outline-offset: 1px; }


/* ---- Busca: resultados, borda e navegação ---- */
.agenda-search-field input { padding-right: 11rem; }
.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; }

/* Todos os resultados: borda dourada. O selecionado: borda branca grossa + brilho */
.agenda-card.search-hit { z-index: 5; outline: 2px solid var(--primary-bright); outline-offset: 1px; }
.agenda-card.search-active {
  z-index: 7; outline: 3px solid #fff; outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--primary-dim), 0 8px 22px rgba(0, 0, 0, 0.55);
}
.agenda-card.search-pulse { animation: agendaSearchPulse 0.9s ease-out 1; }
@keyframes agendaSearchPulse {
  0%   { outline-offset: 10px; outline-color: rgba(255, 255, 255, 0); }
  60%  { outline-offset: 2px;  outline-color: #fff; }
  100% { outline-offset: 2px;  outline-color: #fff; }
}
@media (max-width: 640px) {
  .agenda-search-field input { padding-right: 9.5rem; }
  .agenda-search-count { padding: 0 0.25rem; font-size: 0.7rem; }
}


/* ---- Busca fixa no topo (não some quando a tela rola até o resultado) ---- */
.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: var(--top-h); }
}

/* ---- Bordas do resultado por DENTRO do card (a coluna corta o que passa da borda) ---- */
.agenda-card.search-hit { outline: 2px solid var(--primary-bright); outline-offset: -2px; }
.agenda-card.search-active {
  outline: 3px solid #fff; outline-offset: -3px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
}
@keyframes agendaSearchPulse {
  0%   { outline-offset: -14px; outline-color: rgba(255, 255, 255, 0); }
  60%  { outline-offset: -3px;  outline-color: #fff; }
  100% { outline-offset: -3px;  outline-color: #fff; }
}


/* ---- Ajustes finais do card e da borda da busca ---- */
:root { --primary-deep: #96773f; } /* dourado do tema, mais escuro */

/* remove a faixinha escura do lado esquerdo do card */
.agenda-card { border-left: none; }

/* borda dos resultados: tom dourado do sistema, mais escuro */
.agenda-card.search-hit {
  outline: 2px solid rgba(150, 119, 63, 0.7); outline-offset: -2px;
}
.agenda-card.search-active {
  outline: 3px solid var(--primary-deep); outline-offset: -3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
@keyframes agendaSearchPulse {
  0%   { outline-offset: -14px; outline-color: rgba(150, 119, 63, 0); }
  60%  { outline-offset: -3px;  outline-color: var(--primary-deep); }
  100% { outline-offset: -3px;  outline-color: var(--primary-deep); }
}


/* ---- Borda da busca com mais destaque, sem animação ---- */
:root { --primary-deep: #8a6a30; }
.agenda-card.search-pulse { animation: none; }
.agenda-card.search-hit {
  outline: 3px solid var(--primary-deep); outline-offset: -3px;
}
.agenda-card.search-active {
  outline: 5px solid var(--primary-deep); outline-offset: -5px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}


/* ---- Borda só no resultado selecionado, com espaço entre a borda e o card ---- */
.agenda-card.search-hit { outline: none; }          /* demais resultados: sem borda (só os não encontrados ficam apagados) */
.agenda-card.search-active {
  outline: none;
  /* 4px de respiro (cor do fundo) + 4px de borda dourada escura, por dentro do card */
  box-shadow:
    inset 0 0 0 4px var(--bg-card),
    inset 0 0 0 8px var(--primary-deep);
}
.agenda-card.search-active:hover, .agenda-card.search-active:focus-visible {
  box-shadow:
    inset 0 0 0 4px var(--bg-card),
    inset 0 0 0 8px var(--primary-deep);
}


/* ---- Borda ao redor do card (como no desenho): anel por fora, espaço, depois o card ---- */
.agenda-card.search-active,
.agenda-card.search-active:hover,
.agenda-card.search-active:focus-visible {
  outline: none;
  /* o 1º sombreado fica por cima: anel de 3px na beirada; o 2º preenche o espaço de 4px até o card */
  box-shadow:
    inset 0 0 0 3px var(--primary-deep),
    inset 0 0 0 7px var(--bg-card);
  padding: 9px 13px;
}

/* ===== Agenda: cards mais legíveis ===== */
.agenda-card { padding: 8px 12px; border-left-width: 5px; }
.agenda-card .ac-name    { font-size: 1rem; font-weight: 800; letter-spacing: .01em; }
.agenda-card .ac-service { font-size: .86rem; font-weight: 600; opacity: 1; margin-top: 1px; }
.agenda-card .ac-time    { font-size: .82rem; font-weight: 700; opacity: 1; margin-top: 4px; }
.agenda-card .ac-price   { font-weight: 800; }
.agenda-card.ag-sm .ac-time { display: block; }
.agenda-card.confirmed { background: #f6c98a; color: #1f160c; }
.agenda-card.done      { color: #0b2514; }
.agenda-card.noshow    { color: #2b0808; }

/* ===== Agenda: animações (só nos horários marcados) ===== */
/* Ao trocar de dia/filtro: só os cards agendados entram, um depois do outro.
   A grade, as horas e os horários livres ficam parados. Não roda ao recarregar a página. */
.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; }
}

/* Ao pesquisar: o resultado selecionado dá um "pop" e os outros apagam/voltam suavemente */
.agenda-card.search-pop { animation: agendaSearchPop .38s var(--ease); }
@keyframes agendaSearchPop {
  0%   { transform: scale(.97); }
  50%  { transform: scale(1.025); }
  100% { transform: scale(1); }
}
.agenda-card { transition: transform .18s var(--ease), box-shadow .25s var(--ease), filter .3s, opacity .3s, background-color .25s; }
.agenda-card:active { transform: scale(.985); }

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

/* ===== Popup do agendamento: hover padrão (só cor) + animação de entrada/saída ===== */
.agenda-pop .ap-btn {
  transition: background-color .18s, border-color .18s, color .18s, filter .18s;
}
/* Mesmo hover em TODOS os botões: apenas mudança de cor */
.agenda-pop .ap-btn:hover { filter: brightness(1.12); }
/* Botões neutros: além do brilho, clareiam o fundo */
.agenda-pop .ap-btn:not(.ok):not(.bad):hover { background: #1c1c1a; color: var(--text); border-color: #3a3a36; }
.agenda-pop .ap-btn.ok:hover,
.agenda-pop .ap-btn.bad:hover { color: #0c0c0b; }

/* Entrada e saída do card */
.agenda-pop {
  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); }
}
@media (prefers-reduced-motion: reduce) {
  .agenda-pop, .agenda-pop.closing { animation: none; }
  .agenda-pop .ap-btn { transition: none; }
}

/* Botão único (ex.: Reabrir) ocupa a largura toda do card */
.agenda-pop .ap-actions .ap-btn:only-child { grid-column: 1 / -1; }

/* ========== 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; } }
}


/* =====================================================================
   MOBILE — estilo app (barra de abas embaixo + card de boas-vindas)
   ===================================================================== */

/* Desktop: elementos exclusivos do mobile ficam escondidos */
.hero-card, .bottom-nav, .bn-overlay { display: none; }

@media (max-width: 900px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .main { min-width: 0; padding: 0.5rem 1rem calc(122px + env(safe-area-inset-bottom, 0px)); }
  .panel, .panel.active { min-width: 0; max-width: 100%; }

  /* ---- Barra superior enxuta ---- */
  .top {
    height: 56px;
    padding: env(safe-area-inset-top, 0px) 1rem 0;
    box-sizing: content-box;
    background: rgba(12, 12, 11, 0.92);
    border-bottom: none;
  }
  .top-logo { width: 34px; height: 34px; }
  .top-line { display: none; }
  .top-menu { margin-left: auto; border: none; background: var(--bg-card); border-radius: 50%; font-size: 1.35rem; color: var(--primary); }

  /* Drawer (perfil): sem a lista de abas — elas ficam na barra de baixo */
  .side .nv { display: none; }
  .side .logo { border-bottom: none; }

  /* ---- Card de boas-vindas (o "retângulo" do topo) ---- */
  .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; bottom: -14px;
    width: 46%; max-width: 190px; height: auto;
    opacity: 0.28; transform: rotate(-10deg);
    filter: brightness(0) drop-shadow(0 0 0 transparent);
    pointer-events: none;
  }
  .hero-body { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; }
  .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; }
  .hero-title b { 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 flutuante (4 abas + botão "+" com extras) ---- */
  .bottom-nav {
    display: flex; align-items: center; justify-content: stretch; gap: 10px;
    position: fixed; z-index: 90;
    left: 0; right: 0;
    box-sizing: border-box;
    padding: 0 16px; /* barra ocupa toda a largura, só com o respiro lateral */
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    pointer-events: none; /* só os filhos recebem toque */
  }
  .bn-bar, .bn-more { pointer-events: auto; }
  /* Degradê preto atrás da barra: o conteúdo some suavemente ao chegar nela */
  .bottom-nav::before {
    content: ""; position: absolute; z-index: -1; pointer-events: none;
    left: 0; right: 0;
    bottom: calc(-18px - env(safe-area-inset-bottom, 0px));
    height: calc(170px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top,
      rgba(12, 12, 11, 1) 0%,
      rgba(12, 12, 11, 0.96) 38%,
      rgba(12, 12, 11, 0.7) 62%,
      rgba(12, 12, 11, 0.28) 85%,
      rgba(12, 12, 11, 0) 100%);
  }
  .bn-bar {
    display: flex; align-items: center; justify-content: space-around; gap: 2px;
    flex: 1 1 auto; min-width: 0;
    height: 70px; padding: 8px 12px;
    border-radius: 40px;
    background: #1c1c1a;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
  .bn-item {
    width: 54px; height: 54px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: none; background: none; padding: 0; cursor: pointer;
    color: rgba(200, 197, 188, 0.6);
    -webkit-tap-highlight-color: transparent;
    transition: color 0.22s var(--ease), background-color 0.22s var(--ease);
  }
  .bn-item i { font-size: 1.6rem; line-height: 1; }
  .bn-item:hover { color: var(--text-secondary); }
  .bn-item.active { color: var(--primary-bright); background: var(--primary-dim); }

  .bn-more { position: relative; width: 70px; height: 70px; flex: none; }
  .bn-dynamic {
    position: relative; z-index: 2;
    width: 70px; height: 70px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: none; padding: 0; cursor: pointer;
    background: linear-gradient(135deg, var(--primary-bright), var(--primary));
    color: #14130f;
    box-shadow: 0 0 0 0 rgba(194, 159, 97, 0.3), 0 4px 20px rgba(194, 159, 97, 0.35);
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
  }
  .bn-dynamic i { font-size: 1.65rem; line-height: 1; transition: transform 0.35s var(--ease); }
  .bn-dynamic.open { box-shadow: 0 0 0 6px rgba(194, 159, 97, 0.2), 0 4px 20px rgba(194, 159, 97, 0.3); }

  .bn-extras {
    position: absolute; left: 11px; bottom: 82px; z-index: 1;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(18px) scale(0.85);
    transition: opacity 0.3s var(--ease), transform 0.32s cubic-bezier(0.34, 1.3, 0.64, 1), visibility 0s linear 0.32s;
  }
  .bn-extras.open {
    opacity: 1; visibility: visible; pointer-events: auto;
    transform: none;
    transition: opacity 0.3s var(--ease), transform 0.32s cubic-bezier(0.34, 1.3, 0.64, 1), visibility 0s;
  }
  .bn-extra {
    position: relative;
    width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.07); padding: 0; cursor: pointer;
    background: #1c1c1a; color: var(--text-secondary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
  }
  .bn-extra[hidden] { display: none; }
  .bn-extra i { font-size: 1.25rem; line-height: 1; }
  .bn-extra:active { background: var(--primary-dim); color: var(--primary-bright); }
  .bn-extra-label {
    position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%);
    padding: 0.35rem 0.7rem; border-radius: 999px;
    background: #1c1c1a; border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text); font-size: 0.78rem; font-weight: 700; white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    pointer-events: none;
  }

  .bn-overlay {
    display: block;
    position: fixed; inset: 0; z-index: 89;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s;
  }
  .bn-overlay.show { opacity: 1; visibility: visible; transition: opacity 0.3s var(--ease), visibility 0s; }

  /* Esconde a barra quando um modal está aberto */
  body.modal-open .bottom-nav, body.modal-open .bn-overlay { visibility: hidden; }
  .toast { bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }

  /* ---- Conteúdo sempre dentro da tela ---- */
  .page-head { margin-bottom: 1rem; }
  .page-head.row { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .page-head h1 { font-size: 1.55rem; }
  .page-head .btn-primary, .page-head .btn-outline { width: 100%; justify-content: center; height: 46px; }
  .fin-head-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .fin-head-actions .btn-primary, .fin-head-actions .btn-outline { padding: 0 0.5rem; font-size: 0.82rem; }

  .stats-estoque { gap: 0.65rem; margin-bottom: 1.25rem; }
  .stat-estoque-card { padding: 0.85rem; gap: 0.7rem; min-width: 0; border-radius: 14px; }
  .stat-icon-sq { width: 40px; height: 40px; font-size: 1.15rem; border-radius: 10px; flex: none; }
  .stat-txt { min-width: 0; }
  .stat-txt .lbl { font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stat-txt .val { font-size: 1.05rem; line-height: 1.2; overflow-wrap: anywhere; }

  .fin-summary-note { width: 100%; }
  .products-tab-toggle { padding: 0.9rem; border-radius: 14px; }

  .barbers-grid.estoque-grid { gap: 0.9rem; }
  .estoque-card, .barber-card.festou { border-radius: 16px; }
  .estoque-card-img, .estoque-card.product-card .estoque-card-img { aspect-ratio: 16 / 10; }

  .fin-card-block, .fin-bottom-cols .fin-card-block, .fin-two-cols > .fin-card-block {
    height: 360px; min-height: 360px; max-height: 360px; border-radius: 16px;
  }
  .fin-two-cols { gap: 1rem; }
  .fin-bottom-cols { margin-top: 1rem; }
  .fin-filters { border-radius: 16px; padding: 0.85rem; }

  .history-row { padding: 0.8rem 0.9rem; }
  .agenda-bar { gap: 0.6rem; }
  .agenda-legend { gap: 0.6rem; }
  .agenda-search { top: calc(var(--top-h) - 8px + env(safe-area-inset-top, 0px)); }

  /* Inputs com 16px: evita o zoom automático do iOS */
  .input, .custom-select-search, .agenda-search-field input,
  .toolbar-estoque .search-wrap input, .custom-select-trigger, .custom-date-trigger { font-size: 16px; }

  /* ---- Modais viram "bottom sheet" ---- */
  .mb { align-items: flex-end; padding: 0; }
  .md, .md.form-md, .barber-form-md {
    width: 100%; max-width: none;
    border-radius: 22px 22px 0 0;
    max-height: 92vh; max-height: 92dvh;
    transform: translateY(32px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mb.open .md { transform: none; }
  .md.form-md.product-form-md, .md.form-md.expense-form-md { height: auto; max-height: 92vh; max-height: 92dvh; }
  .md.form-md.fin-detail-md { width: 100%; height: 88vh; height: 88dvh; max-height: 88dvh; }
  .md.confirm-md {
    align-self: center; width: calc(100% - 2rem); margin: 0 1rem;
    border-radius: 22px; transform: scale(0.96);
  }
  .mb.open .md.confirm-md { transform: scale(1); }
  .md.form-md .md-actions { padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
  .md.form-md .md-actions.md-actions-end { justify-content: stretch; }
  .md.form-md .md-actions.md-actions-end .btn-outline,
  .md.form-md .md-actions.md-actions-end .btn-primary { flex: 1; min-width: 0; justify-content: center; }
  .status-options { grid-template-columns: 1fr 1fr; }

  /* Calendários não podem passar da largura da tela */
  .custom-date-dropdown { max-width: calc(100vw - 1.5rem); }
}

@media (max-width: 380px) {
  .bottom-nav { gap: 8px; padding: 0 12px; }
  .bn-item { width: 48px; height: 50px; }
  .bn-bar { height: 66px; }
  .bn-more, .bn-dynamic { width: 66px; height: 66px; }
  .bn-extras { left: 9px; }
  .hero-title b { font-size: 1.85rem; }
  .stat-estoque-card { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-dots span, .bn-item, .bn-dynamic, .bn-dynamic i, .bn-extras, .bn-overlay { transition: none; }
}


/* ---- Ajustes: sem barra do topo; máquina aparecendo (sem silhueta) ---- */
.hero-profile { display: none; }
@media (max-width: 900px) {
  .top { display: none !important; }
  .main { padding-top: calc(env(safe-area-inset-top, 0px) + 0.75rem); }
  .agenda-search { top: env(safe-area-inset-top, 0px); }

  .hero-profile {
    display: grid; position: absolute; top: 0.85rem; right: 0.85rem; z-index: 3;
    width: 40px; height: 40px; border-radius: 50%; border: none;
    background: #0c0c0b; color: var(--primary-bright); font-size: 1.3rem;
  }
  .hero-art {
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
    opacity: 1; z-index: 0;
    right: 2.9rem; top: -18px; bottom: auto;
    width: 38%; max-width: 150px;
    transform: rotate(-8deg);
    -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
  }
}


/* ---- Máquina como na primeira versão; sem botão de perfil ---- */
.hero-profile { display: none !important; }
@media (max-width: 900px) {
  .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);
    -webkit-mask-image: none; mask-image: none;
    pointer-events: none;
  }
}

/* ---- Cards de resumo: sem quebrar palavras no meio ---- */
@media (max-width: 900px) {
  .stat-estoque-card { flex-direction: column; align-items: flex-start; gap: 0.6rem; padding: 0.9rem; }
  .stat-txt { width: 100%; }
  .stat-txt .lbl { white-space: normal; overflow: visible; }
  .stat-txt .val { font-size: 1rem; overflow-wrap: normal; word-break: normal; hyphens: none; }
}

/* ---- Cards de resumo estilo app: carrossel horizontal (como "Últimas lojas" do iFood) ---- */
@media (max-width: 900px) {
  .stats-estoque, .stats-estoque.fin-stats {
    display: flex; grid-template-columns: none;
    gap: 0.7rem; margin: 0 -1rem 1.25rem; padding: 0.15rem 1rem 0.35rem;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; scroll-padding-left: 1rem;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .stats-estoque::-webkit-scrollbar { display: none; }
  .stat-estoque-card, .stats-estoque.fin-stats .stat-estoque-card {
    flex: 0 0 auto; min-width: 66%; max-width: 78%;
    flex-direction: row; align-items: center; gap: 0.8rem;
    padding: 0.9rem 1rem; border-radius: 18px;
    scroll-snap-align: start;
    background: linear-gradient(145deg, #1a1a18, #131312);
  }
  .stat-txt { width: auto; min-width: 0; }
  .stat-txt .lbl { font-size: 0.74rem; white-space: nowrap; margin-bottom: 0.15rem; }
  .stat-txt .val { font-size: 1.1rem; white-space: nowrap; }
  .stat-icon-sq { width: 44px; height: 44px; border-radius: 14px; font-size: 1.25rem; }

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

/* ---- Cards de resumo: um em cima do outro ---- */
@media (max-width: 900px) {
  .stats-estoque, .stats-estoque.fin-stats {
    display: flex; flex-direction: column; gap: 0.65rem;
    margin: 0 0 1.25rem; padding: 0; overflow: visible;
    scroll-snap-type: none;
  }
  .stat-estoque-card, .stats-estoque.fin-stats .stat-estoque-card {
    width: 100%; min-width: 0; max-width: none; flex: none;
    padding: 0.8rem 1rem;
  }
}

/* ---- Agenda (mobile): cabeçalho organizado ---- */
@media (max-width: 900px) {
  .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-nav { display: grid; grid-template-columns: 1fr 44px 44px 44px; gap: 0.5rem; }
  .agenda-nav-btn, .agenda-nav-btn.icon { width: 100%; height: 44px; border-radius: 12px; font-size: 0.9rem; font-weight: 700; padding: 0; }
  .agenda-nav-btn.icon { font-size: 1.05rem; }
  .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; }
}

/* ---- Cards (Barbeiros, Serviços, Produtos): 2 por linha no celular ---- */
@media (max-width: 900px) {
  .barbers-grid.estoque-grid, .barbers-grid.festou-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.7rem;
  }
  .estoque-card { border-radius: 16px; min-width: 0; }
  .estoque-card-img, .estoque-card.product-card .estoque-card-img { aspect-ratio: 1 / 1; }
  .estoque-badge { top: 8px; left: 8px; font-size: 0.56rem; padding: 3px 6px; border-radius: 5px; }
  .estoque-card-body { padding: 0.65rem 0.7rem 0.4rem; min-width: 0; }
  .estoque-title { font-size: 0.92rem; margin-bottom: 0.15rem; }
  .estoque-row { font-size: 0.72rem; margin-bottom: 0.5rem; gap: 0.3rem; flex-wrap: wrap; }
  .estoque-price-row { margin-bottom: 0.5rem; }
  .estoque-price { font-size: 0.98rem; line-height: 1.25; }
  .estoque-price span { font-size: 0.68rem; display: block; margin-left: 0 !important; }
  .estoque-price .price-old { display: inline; font-size: 0.7rem; }
  .estoque-info-pill {
    max-width: 100%; margin-bottom: 0.55rem; padding: 0.3rem 0.5rem; font-size: 0.68rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .estoque-card-foot { padding: 0 0.7rem 0.7rem; gap: 0.4rem; }
  .estoque-card-foot .btn-action { height: 36px; border-radius: 10px; }
  .estoque-card-img .media-fallback, .estoque-card-img .media-fallback.service-media { font-size: 2rem; }
  .estoque-card-img .media-fallback.service-media i { font-size: 2rem; }
}

/* ---- Janelas (bottom sheet): sobem de baixo ao abrir e descem ao fechar ---- */
@media (max-width: 900px) {
  .mb {
    transition: opacity 0.35s ease, visibility 0.35s ease;
  }
  .mb .md, .mb .md.form-md, .mb .barber-form-md {
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
  }
  .mb.open .md, .mb.open .md.form-md, .mb.open .barber-form-md { transform: translateY(0); }

  /* Confirmações (sair, status) continuam centralizadas, com zoom suave */
  .mb .md.confirm-md { transform: scale(0.94); opacity: 0; transition: transform 0.3s var(--ease), opacity 0.25s ease; }
  .mb.open .md.confirm-md { transform: scale(1); opacity: 1; }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .mb, .mb .md { transition: none; }
}

/* ---- Janela sólida: nunca fica transparente, só desliza ---- */
@media (max-width: 900px) {
  .mb, .mb.open { opacity: 1; }
  .mb {
    background: rgba(0, 0, 0, 0);
    transition: background 0.38s ease, visibility 0s linear 0.4s;
  }
  .mb.open {
    background: rgba(0, 0, 0, 0.72);
    transition: background 0.38s ease, visibility 0s linear 0s;
  }
  .mb .md.confirm-md { opacity: 1; transform: translateY(40px) scale(0.96); transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1); }
  .mb.open .md.confirm-md { opacity: 1; transform: none; }
}

/* ---- Janelas com altura fixa (referência: "Editar serviço"); o que passar disso rola por dentro ---- */
@media (max-width: 900px) {
  .mb .md.form-md,
  .mb .md.form-md.product-form-md,
  .mb .md.form-md.expense-form-md,
  .mb .md.form-md.fin-detail-md,
  .mb .barber-form-md {
    height: min(532px, 92dvh) !important;
    max-height: min(532px, 92dvh) !important;
  }
  .mb .md.form-md > form { flex: 1; min-height: 0; }
  .mb .md.form-md .md-body,
  .mb .md.form-md .fin-detail-body {
    flex: 1; min-height: 0;
    overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: #3a3a36 transparent;
  }
}

/* ---- Mobile: fundo travado com janela aberta + barra de rolagem visível na cor do sistema ---- */
@media (max-width: 900px) {
  html:has(body.modal-open), body.modal-open { overflow: hidden; height: 100%; }
  .mb { overscroll-behavior: contain; }

  /* barra sempre visível (usa o estilo webkit, por isso zera o "thin" padrão) */
  .mb .md-body, .mb .fin-detail-body, .fin-card-scroll, .custom-select-options, .md {
    scrollbar-width: auto; scrollbar-color: auto;
  }
  .mb .md-body::-webkit-scrollbar,
  .mb .fin-detail-body::-webkit-scrollbar,
  .fin-card-scroll::-webkit-scrollbar,
  .custom-select-options::-webkit-scrollbar { width: 6px; -webkit-appearance: none; display: block; }
  .mb .md-body::-webkit-scrollbar-track,
  .mb .fin-detail-body::-webkit-scrollbar-track,
  .fin-card-scroll::-webkit-scrollbar-track,
  .custom-select-options::-webkit-scrollbar-track {
    background: rgba(194, 159, 97, 0.12); border-radius: 6px; margin: 6px 0;
  }
  .mb .md-body::-webkit-scrollbar-thumb,
  .mb .fin-detail-body::-webkit-scrollbar-thumb,
  .fin-card-scroll::-webkit-scrollbar-thumb,
  .custom-select-options::-webkit-scrollbar-thumb {
    background: var(--primary); border-radius: 6px; min-height: 40px;
  }
  .md.confirm-md::-webkit-scrollbar { display: none; }

  /* brilho dourado no rodapé da área rolável: some quando chega no fim */
  .mb .md-body, .mb .fin-detail-body {
    background:
      linear-gradient(var(--bg-elevated) 30%, rgba(18, 18, 17, 0)) top / 100% 28px no-repeat local,
      linear-gradient(rgba(18, 18, 17, 0), var(--bg-elevated) 70%) bottom / 100% 28px no-repeat local,
      radial-gradient(farthest-side at 50% 100%, rgba(194, 159, 97, 0.3), rgba(194, 159, 97, 0)) bottom / 100% 14px no-repeat scroll;
  }
}

/* ---- Sem brilho no rodapé; barra lateral dourada bem visível ---- */
@media (max-width: 900px) {
  .mb .md-body, .mb .fin-detail-body { background: none !important; }

  .mb .md-body, .mb .fin-detail-body,
  .fin-card-scroll, .custom-select-options {
    scrollbar-width: thin !important;
    scrollbar-color: var(--primary) rgba(194, 159, 97, 0.18) !important;
  }
  .mb .md-body::-webkit-scrollbar, .mb .fin-detail-body::-webkit-scrollbar,
  .fin-card-scroll::-webkit-scrollbar, .custom-select-options::-webkit-scrollbar { width: 7px; }
  .mb .md-body::-webkit-scrollbar-thumb, .mb .fin-detail-body::-webkit-scrollbar-thumb,
  .fin-card-scroll::-webkit-scrollbar-thumb, .custom-select-options::-webkit-scrollbar-thumb { background: var(--primary); }
}


/* ---- Agenda: sem a linha do horário atual; cards de 30 min sem corte no celular ---- */
.agenda-now { display: none !important; }

@media (max-width: 900px) {
  .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; }
  /* 30 min = 56px: não cabe a 3ª linha, então o horário/preço some só nesse tamanho */
  .agenda-card.ag-sm .ac-time { display: none; }
}


/* ========== 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; }
}

/* ========== Configurações ========== */
.cfg {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.5rem;
  align-items: start;
  max-width: 1500px;
}
.cfg input, .cfg textarea, .cfg button { font-family: inherit; }

/* Cartões */
.cfg-cards {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}
.cfg-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem 1.5rem;
}
.cfg-card-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
}
.cfg-card-ic {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-dim);
  color: var(--primary);
  font-size: 1.1rem;
}
.cfg-card-head h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.15;
}
.cfg-card-head p { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.1rem; }
.cfg-card .form-group:last-child { margin-bottom: 0; }
.cfg-card .form-group > label { font-size: 0.82rem; }
.cfg textarea.cfg-textarea {
  font-family: var(--font-body);
  resize: vertical;
  min-height: 110px;
  line-height: 1.55;
}

/* Contato */
.cfg-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.cfg-group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.cfg-group-title i { color: var(--primary); font-size: 1.1rem; }
.cfg-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.75rem; }
.cfg-fields .form-group:only-child { grid-column: 1 / -1; }

/* Atendimento */
.cfg-atend { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 2rem; }

/* Cor */
.color-hex { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; letter-spacing: 0.04em; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.color-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: var(--swatch);
  cursor: pointer;
  padding: 0;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: transform 0.15s, box-shadow 0.15s;
}
.color-swatch:hover { transform: scale(1.08); }
.color-swatch:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.color-swatch.active { box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--swatch); }
.color-swatch.active::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 46%;
  width: 6px;
  height: 11px;
  border: solid var(--swatch-ink, #0c0c0b);
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* Logo */
.cfg-logo-group { margin-top: 1.5rem; padding-top: 1.4rem; border-top: 1px solid var(--border-subtle); }
.logo-upload-wrap { display: flex; align-items: center; gap: 1.1rem; }
.logo-preview {
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: 16px;
  border: 1.5px dashed var(--border);
  background: var(--bg-input);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }
.logo-placeholder { color: var(--text-muted); font-size: 1.7rem; }
.logo-upload-side { min-width: 0; }
.logo-upload-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* o label global (.form-group label) é block: aqui precisa ser botão */
.cfg .form-group label.cfg-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: auto;
  margin: 0;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.cfg .form-group label.cfg-upload-btn:hover { color: var(--text); }
.cfg .logo-upload-actions .btn-outline { padding: 0.6rem 1rem; }
.logo-upload-side .form-hint { margin-top: 0.6rem; }

/* Dias bloqueados */
.day-blockers { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.45rem; }
.cfg .form-group label.day-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.7rem 0;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.day-chip input { position: absolute; opacity: 0; pointer-events: none; }
.day-chip:hover { border-color: #3a3a36; }
.day-chip:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.cfg .form-group label.day-chip:has(input:checked),
.cfg .form-group label.day-chip.active {
  border-color: var(--danger);
  background: var(--danger);
  color: #0c0c0b;
}

/* Coluna lateral */
.cfg-aside {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cfg-preview {
  --pv: #c29f60;
  --pv-ink: #0c0c0b;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.cfg-pv-caption { font-size: 0.78rem; color: var(--text-muted); }
/* Espelha o cabeçalho do site (.logo-group / .logo-img / .logo-text / .btn-primary) */
.cfg-pv-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  max-width: 100%;
}
.cfg-pv-logo {
  width: 64px;
  height: 64px;
  flex: none;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}
/* igual ao .logo-img do site: 64x64, contain, sem recorte do conteúdo */
.cfg-pv-logo img { width: 64px; height: 64px; object-fit: contain; border-radius: 50%; display: block; }
/* fallback (sem imagem): inicial sobre círculo na cor da marca */
.cfg-pv-logo span { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--pv); color: var(--pv-ink); }
.cfg-pv-logo span[hidden] { display: none; }
.cfg-pv-text { min-width: 0; text-align: center; }
.cfg-pv-name {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  white-space: nowrap;
}
.cfg-pv-next { color: var(--text); }
.cfg-pv-accent { color: var(--pv); transition: color 0.2s; }
.cfg-pv-slogan {
  margin-top: 3px;
  font-size: 0.6rem;
  line-height: 1.35;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: pre-line;
  color: var(--text-muted);
}
.cfg-pv-slogan:empty { display: none; }
.settings-actions { display: flex; flex-direction: column; gap: 0.6rem; }
.settings-actions .btn-primary,
.settings-actions .btn-outline { width: 100%; justify-content: center; padding: 0.85rem 1rem; font-size: 0.92rem; }

/* Telas largas: cartões lado a lado */
@media (min-width: 1101px) {
  .cfg-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
  .cfg-fields { grid-template-columns: minmax(0, 1fr); }
  .cfg-atend { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cfg .form-group label.day-chip { padding: 0.7rem 0; font-size: 0.8rem; }
  .day-blockers { gap: 0.35rem; }
}
@media (min-width: 1560px) {
  .cfg-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cfg-wide { grid-column: 1 / -1; }
  .cfg-groups { gap: 2rem; }
}

/* Telas médias: prévia vira faixa no topo, ações no fim */
@media (max-width: 1100px) {
  .cfg { display: flex; flex-direction: column; align-items: stretch; gap: 1.25rem; }
  .cfg-aside { display: contents; }
  .cfg-preview { order: 0; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 1rem; padding: 1.1rem 1.25rem; }
  .cfg-pv-caption { display: none; }
  .cfg-cards { order: 1; }
  .settings-actions {
    order: 2;
    position: sticky;
    bottom: 0;
    z-index: 20;
    flex-direction: row-reverse;
    justify-content: flex-start;
    padding: 0.8rem 0 1rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
  }
  .settings-actions .btn-primary,
  .settings-actions .btn-outline { width: auto; }
}
@media (max-width: 900px) {
  .settings-actions { bottom: 82px; padding-bottom: 0.8rem; }
}
@media (max-width: 640px) {
  .cfg-card { padding: 1.15rem 1.1rem 1.25rem; }
  .cfg-fields { grid-template-columns: 1fr; }
  .logo-upload-wrap { flex-direction: column; align-items: flex-start; }
  .settings-actions { flex-direction: column-reverse; }
  .settings-actions .btn-primary,
  .settings-actions .btn-outline { width: 100%; height: 46px; }
}


/* Seletor de cor personalizado + conta-gotas */
.cfg [hidden] { display: none !important; }
.color-current { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.color-chip {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 12px;
  background: #c29f60;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.cfg .btn-outline.cfg-eyedropper { margin-left: auto; padding: 0.6rem 0.95rem; }
.cfg-color-native { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.color-custom-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.95rem;
  background: conic-gradient(#ef4444, #f59e0b, #22c55e, #14b8a6, #3b82f6, #8b5cf6, #d40c77, #ef4444);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: transform 0.15s, box-shadow 0.15s;
}
.color-custom-btn i { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.color-custom-btn:hover { transform: scale(1.08); }
.color-custom-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.color-custom-btn.active { background: var(--swatch, #c29f60); box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--swatch, #c29f60); }
.color-custom-btn.active i { display: none; }
.color-custom-btn.active::after {
  content: '';
  width: 6px;
  height: 11px;
  margin-top: -2px;
  border: solid var(--swatch-ink, #0c0c0b);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.cp-sv {
  --h: 40;
  position: relative;
  height: 190px;
  border-radius: 10px;
  cursor: crosshair;
  touch-action: none;
  background:
    linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #fff, hsl(var(--h), 100%, 50%));
}
.cp-sv:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cp-sv-thumb {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.cp-hue {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 14px;
  margin: 1rem 0;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
.cp-hue::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.5);
}
.cp-hue::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.5);
}
.cp-hue:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* Popover do seletor de cor (mesmo estilo do calendário) */
.custom-date-dropdown.cp-pop { width: 280px; padding: 0.8rem; border: 0; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); }
.cp-pop .cp-sv { height: 150px; }
.cp-pop .cp-hue { margin: 0.85rem 0; }
.cp-pop .cp-row { display: flex; align-items: center; gap: 0.5rem; }
.cp-pop .cp-preview {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  background: #c29f60;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.cp-pop .cp-row .input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.7rem;
}
.cp-pop .cp-eye { flex: none; width: 40px; height: 40px; padding: 0; justify-content: center; font-size: 1rem; }
.cp-pop [hidden] { display: none !important; }
.color-custom-btn[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--text-muted); }
.color-custom-btn.active[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--swatch, #c29f60); }

/* Animação de entrada e saída do popover de cor (nasce do botão "+") */
.custom-date-dropdown.cp-pop {
  transform-origin: var(--ox, 20px) var(--oy, 0);
  animation: cpPopIn 0.24s var(--ease) both;
}
.custom-date-dropdown.cp-pop.closing {
  animation: cpPopOut 0.16s ease-in both;
  pointer-events: none;
}
@keyframes cpPopIn {
  from { opacity: 0; transform: translateY(var(--dy, -8px)) scale(0.9); }
  to   { opacity: 1; transform: none; }
}
@keyframes cpPopOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(var(--dy, -8px)) scale(0.94); }
}
@media (prefers-reduced-motion: reduce) {
  .custom-date-dropdown,
  .custom-date-dropdown.cp-pop,
  .custom-date-dropdown.cp-pop.closing { animation-duration: 0.01s; }
}

/* Cópia visual do calendário que toca a animação de saída (criada em JS) */
.custom-date-dropdown.cal-ghost {
  position: fixed;
  margin: 0;
  pointer-events: none;
  animation: cpPopOut 0.16s ease-in both;
}

/* ---- Mobile: um barbeiro por vez ocupando a largura toda; arraste para o lado para ver os demais ---- */
@media (max-width: 640px) {
  .agenda-scroll {
    container-type: inline-size;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 70px;           /* largura da coluna de horas (fica fixa) */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .agenda-grid {
    grid-template-columns: 70px repeat(var(--n, 1), calc(100cqw - 70px)) !important;
  }
  .agenda-colhead,
  .agenda-col {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
}

/* ---- Barras de rolagem: escondidas no sistema todo (a rolagem continua funcionando) ----
   Computador: barra fina e neutra só nos cards, janelas, listas de seleção e agenda.
   Celular: barra na cor do sistema nas janelas/formulários, cards e menus de seleção. */
html { scrollbar-width: none !important; -ms-overflow-style: none !important; }
html::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }

@media (min-width: 901px) {
  html :not(#_):not(.fin-card-scroll):not(.md):not(.md-body):not(.fin-detail-body):not(.custom-select-options):not(.agenda-scroll) {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  html :not(#_):not(.fin-card-scroll):not(.md):not(.md-body):not(.fin-detail-body):not(.custom-select-options):not(.agenda-scroll)::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  /* cards, janelas e listas: barra fina, neutra e discreta (sem a cor do sistema) */
  .fin-card-scroll, .md, .md-body, .fin-detail-body, .custom-select-options, .agenda-scroll {
    scrollbar-width: thin !important;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent !important;
  }
  .fin-card-scroll::-webkit-scrollbar, .md::-webkit-scrollbar, .md-body::-webkit-scrollbar,
  .fin-detail-body::-webkit-scrollbar, .custom-select-options::-webkit-scrollbar, .agenda-scroll::-webkit-scrollbar {
    display: block !important; width: 6px !important; height: 6px !important; background: transparent !important;
  }
  .fin-card-scroll::-webkit-scrollbar-track, .md::-webkit-scrollbar-track, .md-body::-webkit-scrollbar-track,
  .fin-detail-body::-webkit-scrollbar-track, .custom-select-options::-webkit-scrollbar-track, .agenda-scroll::-webkit-scrollbar-track {
    background: transparent !important; margin: 6px 0;
  }
  .fin-card-scroll::-webkit-scrollbar-thumb, .md::-webkit-scrollbar-thumb, .md-body::-webkit-scrollbar-thumb,
  .fin-detail-body::-webkit-scrollbar-thumb, .custom-select-options::-webkit-scrollbar-thumb, .agenda-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14) !important; border-radius: 6px; min-height: 40px;
  }
  .fin-card-scroll::-webkit-scrollbar-thumb:hover, .md::-webkit-scrollbar-thumb:hover, .md-body::-webkit-scrollbar-thumb:hover,
  .fin-detail-body::-webkit-scrollbar-thumb:hover, .custom-select-options::-webkit-scrollbar-thumb:hover, .agenda-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.26) !important;
  }
  .agenda-scroll::-webkit-scrollbar-corner { background: transparent; }
}
@media (max-width: 900px) {
  html :not(#_):not(.fin-card-scroll):not(.md-body):not(.fin-detail-body):not(.custom-select-options) {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  html :not(#_):not(.fin-card-scroll):not(.md-body):not(.fin-detail-body):not(.custom-select-options)::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
  /* barra na cor do sistema, sempre visível nas áreas com rolagem */
  .mb .md-body, .mb .fin-detail-body, .fin-card-scroll, .custom-select-options {
    scrollbar-width: thin !important;
    scrollbar-color: var(--primary) rgba(194, 159, 97, 0.18) !important;
  }
  .mb .md-body::-webkit-scrollbar, .mb .fin-detail-body::-webkit-scrollbar,
  .fin-card-scroll::-webkit-scrollbar, .custom-select-options::-webkit-scrollbar {
    display: block !important; width: 7px !important;
  }
  .mb .md-body::-webkit-scrollbar-track, .mb .fin-detail-body::-webkit-scrollbar-track,
  .fin-card-scroll::-webkit-scrollbar-track, .custom-select-options::-webkit-scrollbar-track {
    background: rgba(194, 159, 97, 0.18); border-radius: 6px; margin: 6px 0;
  }
  .mb .md-body::-webkit-scrollbar-thumb, .mb .fin-detail-body::-webkit-scrollbar-thumb,
  .fin-card-scroll::-webkit-scrollbar-thumb, .custom-select-options::-webkit-scrollbar-thumb {
    background: var(--primary); border-radius: 6px; min-height: 40px;
  }
}
