/* ── Tema Light (padrão) ── */
:root,
:root[data-theme="light"] {
  --primary:       #1B3A6B;
  --primary-hover: #142D54;
  --primary-dim:   rgba(27,58,107,0.10);
  --primary-dim2:  rgba(27,58,107,0.06);

  /* Sidebar Light — mesmas cores do body */
  --sidebar-bg:         #FFFFFF;
  --sidebar-text:       #1A1A2E;
  --sidebar-text-muted: #6B7280;
  --sidebar-item-color: #6B7280;

  --secondary:       #C0392B;
  --secondary-light: #E74C3C;

  --bg:       #F0F4F8;
  --surface:  #FFFFFF;
  --surface-2:#F8F9FC;
  --border:   #E4E6EF;
  --border-2: #CDD0E0;

  --text:   #1A1A2E;
  --text-2: #6B7280;
  --text-3: #9CA3AF;

  --green: #22C55E;
  --red:   #EF4444;

  --radius:    14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow:    0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.07);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --transition: .17s ease;
  --sidebar-w: 248px;
}

/* ── Tema Dark ── */
:root[data-theme="dark"] {
  --primary:       #ffaf02;
  --primary-hover: #ffb921;
  --primary-dim:   rgba(255,175,2,0.12);
  --primary-dim2:  rgba(255,175,2,0.06);

  /* Sidebar Dark — fundo bem escuro, diferente do bg geral */
  --sidebar-bg:         #13131f;
  --sidebar-text:       #ffffff;
  --sidebar-text-muted: rgba(255,255,255,0.45);
  --sidebar-item-color: rgba(255,255,255,0.6);

  --secondary:       #ffca00;
  --secondary-light: #ffb921;

  --bg:       #121212;
  --surface:  #181b20;
  --surface-2:#20242a;
  --border:   rgba(255,255,255,0.08);
  --border-2: rgba(255,255,255,0.15);

  --text:   #ffffff;
  --text-2: rgba(255,255,255,0.6);
  --text-3: rgba(255,255,255,0.35);

  --green: #02ab15;
  --red:   #ef4444;

  --radius:    14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.3);
  --transition: .17s ease;
  --sidebar-w: 248px;
}

/* ── Tema Violet ── */
:root[data-theme="violet"] {
  --primary:       #7c3aed;
  --primary-hover: #6d28d9;
  --primary-dim:   rgba(124,58,237,0.15);
  --primary-dim2:  rgba(124,58,237,0.08);

  /* Sidebar Violet — fundo quase preto violáceo */
  --sidebar-bg:         #0e0e1a;
  --sidebar-text:       #ffffff;
  --sidebar-text-muted: rgba(255,255,255,0.4);
  --sidebar-item-color: rgba(255,255,255,0.55);

  --secondary:       #a78bfa;
  --secondary-light: #c4b5fd;

  --bg:       #0f0f1a;
  --surface:  #1a1b2e;
  --surface-2:#22243a;
  --border:   rgba(255,255,255,0.08);
  --border-2: rgba(255,255,255,0.14);

  --text:   #ffffff;
  --text-2: rgba(255,255,255,0.65);
  --text-3: rgba(255,255,255,0.38);

  --green: #10b981;
  --red:   #ef4444;

  --radius:    16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow:    0 4px 24px rgba(0,0,0,0.5);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.35);
  --transition: .17s ease;
  --sidebar-w: 248px;
}
/* -- Tema Orange (marca Lagenda) -- */
:root[data-theme="orange"] {
  --primary:       #F7931E;
  --primary-hover: #E67E22;
  --primary-dim:   rgba(247,147,30,0.14);
  --primary-dim2:  rgba(247,147,30,0.07);

  --sidebar-bg:         #0f0f0f;
  --sidebar-text:       #ffffff;
  --sidebar-text-muted: rgba(255,255,255,0.45);
  --sidebar-item-color: rgba(255,255,255,0.6);

  --secondary:       #FFB347;
  --secondary-light: #FFC97A;

  --bg:       #121212;
  --surface:  #1a1a1a;
  --surface-2:#20242a;
  --border:   rgba(255,255,255,0.08);
  --border-2: rgba(255,255,255,0.15);

  --text:   #ffffff;
  --text-2: rgba(255,255,255,0.6);
  --text-3: rgba(255,255,255,0.35);

  --green: #02ab15;
  --red:   #ef4444;

  --radius:    14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.3);
  --transition: .17s ease;
  --sidebar-w: 248px;
}


/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", system-ui, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════
   LAYOUT
══════════════════════ */
.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg, var(--surface));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform .25s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── Cabeçalho: ícone + nome do sistema ── */
.sidebar-header {
  padding: 1.35rem 1.1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-brand-wrap {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 3px 10px var(--primary-dim);
}
.sidebar-brand-name {
  font-family: "Fredoka", sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--sidebar-text, var(--text));
  letter-spacing: .02em;
  text-transform: uppercase;
}

/* ── Bloco do usuário ── */
.sidebar-user-block {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.1rem;
  flex-shrink: 0;
}
.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 800;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 2px 8px var(--primary-dim);
}
.sidebar-user-info {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  min-width: 0;
}
.sidebar-user-greeting {
  font-size: .88rem;
  font-weight: 700;
  color: var(--sidebar-text, var(--text));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-date {
  font-size: .72rem;
  color: var(--sidebar-text-muted, var(--text-2));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
}

/* ── Divisor ── */
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0 1.1rem;
  flex-shrink: 0;
}

/* ── Nav principal ── */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: .85rem .75rem;
  gap: .55rem;
  flex-shrink: 0;
}

/* ── Espaçador ── */
.sidebar-spacer {
  flex: 1;
  min-height: .5rem;
}

/* ── Nav inferior ── */
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  padding: .5rem .75rem;
  gap: .15rem;
  flex-shrink: 0;
}

/* ── Rodapé ── */
.sidebar-footer-info {
  padding: .75rem 1.1rem;
  font-size: .72rem;
  color: var(--sidebar-text-muted, var(--text-3));
  flex-shrink: 0;
  opacity: .6;
}

/* ── Nav item — base ── */
.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  color: var(--sidebar-item-color, var(--text-2));
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  position: relative;
}
.nav-item:hover:not(.nav-item--soon) {
  background: var(--primary-dim2);
  color: var(--sidebar-text, var(--text));
}

/* ── Nav item ativo — fundo sólido igual à referência FSW ── */
.nav-item.active,
.nav-item.active-exact {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 10px var(--primary-dim);
}

/* Tema dark: texto escuro sobre dourado ── */
[data-theme="dark"] .nav-item.active,
[data-theme="dark"] .nav-item.active-exact {
  color: #121212;
}
[data-theme="orange"] .nav-item.active,
[data-theme="orange"] .nav-item.active-exact {
  color: #121212;
}

/* Remove barra lateral — agora o fundo sólido é o indicador ── */
.nav-item.active-exact::before {
  display: none;
}

.nav-item--soon { opacity: .55; pointer-events: auto; cursor: default; }

.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
}
.nav-label { flex: 1; }
.nav-badge {
  font-size: .62rem;
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: .1rem .5rem;
}

/* Aliases mantidos para compatibilidade com overrides de tema */
.sidebar-logo-img { display: none; }
.sidebar-upgrade  { display: none; }
.btn-upgrade      { display: none; }

/* ── Overlay mobile ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 190;
}
.sidebar-overlay.show { display: block; }

/* ── Main wrapper ── */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ── Barra de período de teste ── */
#trial-banner {
  position: sticky;
  top: 0;
  z-index: 101;
  background: #F59E0B;
  color: #1A1A2E;
  font-size: .88rem;
  font-weight: 600;
  text-align: center;
  padding: .85rem 1rem;
  flex-shrink: 0;
}

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 2rem;
  height: 64px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  letter-spacing: -.01em;
}
.topbar-right { display: flex; align-items: center; gap: .75rem; }

.topbar-notif {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.topbar-notif:hover { background: var(--primary-dim); color: var(--primary); }
.notif-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 7px; height: 7px;
  background: #EF4444;
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}

.topbar-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--primary-dim);
  border: 2px solid var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  user-select: none;
  overflow: hidden;
}
.topbar-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}

/* ── Avatar dropdown menu ── */
.avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 200;
  overflow: hidden;
}
.avatar-menu-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .65rem 1rem;
  background: none;
  border: none;
  text-align: left;
  font-size: .875rem;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
  font-family: "Montserrat", sans-serif;
}
.avatar-menu-item:hover {
  background: var(--primary-dim);
  color: var(--primary);
}

/* ── Hamburger ── */
.sidebar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 7px;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--primary-dim); }
.sidebar-toggle span {
  display: block; width: 100%; height: 2px;
  background: var(--text-2); border-radius: 2px;
}

/* ── Main content ── */
.main {
  flex: 1;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 2rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ══════════════════════
   COMPONENTS
══════════════════════ */

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .85rem;
}
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .95rem 1.35rem;
  border-bottom: 1px solid var(--border);
}
.card-icon {
  width: 18px; height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}
.card-title {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--primary);
}
.card-body { padding: 1.35rem; }

/* ── Field grid ── */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field--full   { grid-column: 1 / -1; }
.field--cep    { grid-column: span 1; }
.field--street { grid-column: span 2; }
.field--number { grid-column: span 1; }
.field--state  { grid-column: span 1; max-width: 90px; }

@media (max-width: 520px) {
  .field-grid { grid-template-columns: 1fr; }
  .field-grid--3 { grid-template-columns: 1fr; }
  .field--street, .field--number, .field--state,
  .field--cep { grid-column: span 1; }
  .field--state { max-width: 100%; }
}

/* ── Label ── */
.label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
}
.required { color: var(--primary); }

/* ── Input ── */
.input {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  padding: .65rem .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  font-family: "Montserrat", inherit;
}
.input::placeholder { color: var(--text-3); }
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.input::-webkit-inner-spin-button,
.input::-webkit-outer-spin-button { opacity: .5; }
.input.error { border-color: var(--red); }

/* ── Input group ── */
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); flex: 1; }
.input-group .input:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-prefix, .input-suffix {
  display: flex; align-items: center;
  padding: 0 .75rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  color: var(--text-3);
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}
.input-prefix { border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-suffix { border-left: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .input:not(:first-child):not(:last-child) { border-radius: 0; }
.input-group .input:first-child:not(:last-child) { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }

/* Botão de busca CEP */
.btn-icon-search {
  background: var(--primary);
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #fff;
  padding: 0 .9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}
.btn-icon-search:hover { background: var(--primary-hover); }
.btn-icon-search:disabled { opacity: .5; cursor: not-allowed; }

/* ── Field error ── */
.field-error { font-size: .78rem; color: var(--red); min-height: 1rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: background var(--transition), transform var(--transition),
              opacity var(--transition), box-shadow var(--transition);
  font-family: "Montserrat", inherit;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: var(--surface);
  border-radius: var(--radius-sm);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
}
.btn-ghost:hover { color: var(--text); background: var(--primary-dim2); }

.btn-danger {
  background: transparent; color: var(--red);
  border: 1.5px solid rgba(239,68,68,.4);
  border-radius: 8px;
  padding: .35rem .85rem; font-size: .8rem;
}
.btn-danger:hover { background: rgba(239,68,68,.06); }

.btn-edit {
  background: var(--primary-dim); color: var(--primary);
  border: 1.5px solid var(--primary-dim2);
  padding: .35rem .85rem; font-size: .8rem;
}
.btn-edit:hover { background: var(--primary-dim); filter: brightness(0.9); }

/* ── Form actions ── */
.form-actions { display: flex; justify-content: flex-end; padding: .25rem 0; }
@media (max-width: 520px) {
  .form-actions {
    position: fixed; bottom: 0; left: 0; right: 0;
    padding: .9rem 1.25rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 50;
    box-shadow: 0 -2px 12px rgba(0,0,0,.07);
  }
  .form-actions .btn { width: 100%; justify-content: center; }
}

/* ── Badge ── */
.badge {
  background: var(--primary-dim); color: var(--primary);
  border: 1.5px solid var(--primary-dim);
  border-radius: 99px;
  padding: .15rem .75rem; font-size: .78rem; font-weight: 700;
  min-width: 28px; text-align: center;
}

/* ── Barbers grid ── */
.barbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: .75rem;
}

/* ── Barber card ── */
.barber-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: flex; flex-direction: column; gap: .7rem;
  box-shadow: var(--shadow);
  transition: border-color var(--transition), transform var(--transition),
              box-shadow var(--transition);
}
.barber-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--primary-dim);
}
.barber-card-top { display: flex; align-items: flex-start; gap: .85rem; }
.barber-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary-dim); border: 2px solid var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: var(--primary);
  flex-shrink: 0; text-transform: uppercase;
}
.barber-info { flex: 1; min-width: 0; }
.barber-name {
  font-weight: 700; font-size: 1rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.barber-nickname { font-size: .82rem; color: var(--text-2); margin-top: .1rem; }
.barber-meta {
  display: flex; flex-wrap: wrap; gap: .3rem .7rem;
  font-size: .8rem; color: var(--text-2);
}
.barber-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.barber-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: .2rem .65rem;
}
.barber-chip--highlight {
  color: var(--primary);
  background: var(--primary-dim);
  border-color: var(--primary-dim);
}

/* Client type chips */
.chip--mensalista {
  color: var(--primary);
  background: var(--primary-dim);
  border-color: var(--primary-dim);
  font-weight: 600;
}
.chip--avulso {
  color: var(--text-2);
  background: var(--surface-2);
  border-color: var(--border);
}

/* Client avatar — accent verde para distinguir de barbeiros */
.client-avatar {
  background: rgba(34,197,94,.10) !important;
  border-color: #22C55E !important;
  color: #16A34A !important;
}

.barber-card-actions { display: flex; gap: .5rem; margin-top: .25rem; }

/* ── Topbar breadcrumb ── */
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  padding: .3rem .5rem;
  border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
  font-family: inherit;
}
.btn-back:hover { color: var(--primary); background: var(--primary-dim); }
.breadcrumb-sep { color: var(--text-3); font-size: .85rem; }
.breadcrumb-current { color: var(--text); font-size: .875rem; font-weight: 600; }

/* ── Form actions (2 buttons) ── */
.form-actions { display: flex; justify-content: flex-end; gap: .65rem; padding: .25rem 0; }
@media (max-width: 520px) {
  .form-actions {
    position: fixed; bottom: 0; left: 0; right: 0;
    padding: .9rem 1.25rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 50;
    box-shadow: 0 -2px 12px rgba(0,0,0,.07);
  }
  .form-actions .btn { flex: 1; justify-content: center; }
}

/* ── Empty state ── */
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-3); }
.empty-icon-wrap {
  width: 72px; height: 72px;
  background: var(--primary-dim);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  color: var(--primary);
}
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text-2); margin-bottom: .35rem; }
.empty-sub   { font-size: .875rem; color: var(--text-3); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 5rem; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); padding: .75rem 1.5rem; border-radius: 99px;
  font-size: .875rem; font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 300; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(2,171,21,0.5); color: var(--green); }
.toast.error   { border-color: rgba(239,68,68,0.5); color: var(--red); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Service card styles ── */

/* Avatar base para serviços — cor sobrescrita pelas variantes de tipo abaixo */
.service-avatar {
  background: rgba(251, 146, 60, 0.12) !important;
  border-color: #F97316 !important;
  color: #EA580C !important;
}

/* Avatar Avulso — mesma paleta laranja do chip --avulso */
.service-avatar--avulso {
  background: rgba(251, 146, 60, 0.12) !important;
  border-color: #F97316 !important;
  color: #EA580C !important;
}

/* Avatar Mensal — roxo para distinguir do azul marinho primário */
.service-avatar--mensal {
  background: rgba(124, 58, 237, .10) !important;
  border-color: #7C3AED !important;
  color: #7C3AED !important;
}

.service-price-badge {
  font-size: .9rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: .15rem;
  letter-spacing: -.01em;
}

.service-desc-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-type-chip {
  font-size: .72rem;
  font-weight: 600;
  padding: .18rem .5rem;
  border-radius: 20px;
}
.service-type-chip--mensal {
  background: rgba(124, 58, 237, .10);
  color: #7C3AED;
}
.service-type-chip--avulso {
  background: rgba(251, 146, 60, .12);
  color: #EA580C;
}

/* ── Separadores de grupo na lista de serviços ── */
.service-group-separator {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0 .65rem;
}
.service-group-separator::before,
.service-group-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.service-group-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  white-space: nowrap;
}

/* Remove margem do primeiro separador para não criar espaço extra no topo */
.service-group-separator:first-child {
  margin-top: 0;
}

/* Garante que o grid de cards dentro de cada grupo não herde gap do container pai */
.service-group-grid {
  margin-bottom: .25rem;
}

/* ══════════════════════
   SERVIÇOS — NOVA LISTA
══════════════════════ */

/* Search bar */
.svc-search-wrap {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .65rem 1rem;
  margin-bottom: .85rem;
}
.svc-search-icon { color: var(--text-3); flex-shrink: 0; }
.svc-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: .9rem;
  color: var(--text);
  outline: none;
  font-family: inherit;
}
.svc-search-input::placeholder { color: var(--text-3); }

/* Filter tabs */
.svc-filter-tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.svc-filter-tabs::-webkit-scrollbar { display: none; }
.svc-tab {
  padding: .45rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s, color .14s, border-color .14s;
  font-family: inherit;
}
.svc-tab--active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* List container */
.svc-list {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

/* Row */
.svc-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .75rem 1rem;
  cursor: pointer;
  transition: background .14s, border-color .14s;
}
.svc-row:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}

/* Thumbnail */
.svc-row-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  flex-shrink: 0;
  overflow: hidden;
}
.svc-row-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}
.svc-row-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 12px;
}

/* Info */
.svc-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.svc-row-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.svc-row-meta {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.svc-row-duration {
  font-size: .78rem;
  color: var(--text-2);
  font-weight: 500;
}
.svc-row-cuts {
  font-size: .72rem;
  font-weight: 600;
  padding: .18rem .55rem;
  border-radius: 20px;
  background: rgba(124,58,237,.10);
  color: #7c3aed;
  margin-left: .35rem;
}

/* Divisória de seção — separa Avulso / Mensal na tela Serviços */
.svc-section-divider {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-2);
  padding: .6rem 0 .1rem;
}
.svc-section-divider:first-child {
  padding-top: 0;
}

/* Price */
.svc-row-price {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Chevron */
.svc-row-chevron { color: var(--text-3); flex-shrink: 0; }

/* No results */
.svc-no-results {
  text-align: center;
  color: var(--text-2);
  font-size: .9rem;
  padding: 2rem 0;
}

/* ══════════════════════
   SERVIÇOS — FORMULÁRIO FOTO
══════════════════════ */
.svc-photo-field { margin-bottom: .5rem; }
.svc-photo-upload {
  width: 110px;
  height: 110px;
  border-radius: 14px;
  border: 2px dashed var(--border-2);
  cursor: pointer;
  overflow: hidden;
  background: var(--surface-2);
  transition: border-color .14s;
}
.svc-photo-upload:hover { border-color: var(--primary); }
.svc-photo-preview {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--text-3);
  text-align: center;
  padding: .5rem;
}
.svc-photo-hint { font-size: .7rem; line-height: 1.3; }
.svc-photo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }

/* ══════════════════════
   SERVIÇOS — DRAWER
══════════════════════ */
.svc-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.svc-drawer-overlay.open { opacity: 1; pointer-events: auto; }

.svc-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100%;
  background: var(--surface);
  z-index: 1101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}
.svc-drawer.open { transform: translateX(0); }

.svc-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.svc-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background .14s;
  font-family: inherit;
}
.svc-drawer-close:hover { background: var(--surface-2); }

.svc-drawer-edit-btn {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .9rem;
  border-radius: 10px;
  border: 1px solid var(--primary);
  background: var(--primary-dim);
  color: var(--primary);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .14s;
  font-family: inherit;
}
.svc-drawer-edit-btn:hover { background: var(--primary-dim2); }

.svc-drawer-thumb-wrap {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1.25rem .75rem;
  flex-shrink: 0;
}
.svc-drawer-thumb {
  width: 100px;
  height: 100px;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.svc-drawer-img { width: 100%; height: 100%; object-fit: cover; }
.svc-drawer-initials { font-size: 2rem; font-weight: 800; }

.svc-drawer-body {
  padding: .5rem 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.svc-drawer-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}
.svc-drawer-meta {
  font-size: .83rem;
  color: var(--text-2);
  text-align: center;
  font-weight: 500;
}
.svc-drawer-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  margin-top: .25rem;
}
.svc-drawer-desc {
  font-size: .87rem;
  color: var(--text-2);
  text-align: center;
  margin-top: .5rem;
  line-height: 1.5;
}
.svc-drawer-section {
  margin-top: .75rem;
  padding: .75rem .9rem;
  border-radius: .6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.svc-drawer-section-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-2);
  margin-bottom: .3rem;
}
.svc-drawer-notes {
  font-size: .87rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.svc-drawer-actions {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ══════════════════════
   AGENDA — VIEW WRAPPER
══════════════════════ */
#view-appointments {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* ── Topbar da agenda ── */
.apt-topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
  padding: .85rem 1.5rem .6rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.apt-topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
  margin-right: .25rem;
}
.apt-nav-group {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.apt-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  font-size: .95rem;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.apt-nav-btn:hover { background: var(--primary-dim); color: var(--primary); }
.apt-nav-today {
  padding: 0 .75rem;
  width: auto;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
}
#apt-week-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
  min-width: 160px;
  text-align: center;
}
.apt-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-left: auto;
  align-items: center;
}

/* ── Pills de filtro de barbeiro ── */
.barber-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 9px;
  border-radius: 12px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}
.barber-pill:hover { opacity: .88; transform: scale(.97); }
.barber-pill:active { transform: scale(.94); }

/* Dot colorido (legado — mantido para não quebrar JS) */
.barber-pill .pill-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Avatar circular opcional (foto do barbeiro) */
.barber-pill .pill-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,.2);
}

/* Estado inativo — reduz opacidade sutilmente */
.barber-pill.inactive {
  opacity: .75;
}
.barber-pill.inactive:hover { opacity: 1; }

/* ── Container do calendário (scroll horizontal no mobile) ── */
.apt-calendar-scroll {
  flex: 1;
  overflow: auto;
  padding: .5rem 1rem 2rem;
  min-height: 0;
}

/* ── Grid do calendário ── */
.calendar-grid {
  display: grid;
  grid-template-columns: 52px repeat(7, minmax(90px, 1fr));
  min-width: 700px;
}

/* Cabeçalho vazio (canto) */
.calendar-header-cell {
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid var(--border);
}

/* Cabeçalhos dos dias */
.calendar-day-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .5rem .25rem .4rem;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  border-left: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 1px;
}
.calendar-day-header--today {
  background: var(--primary-dim);
  border-bottom-color: var(--primary);
}
.cal-day-name {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.cal-day-num {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.cal-day-num--today {
  background: var(--primary);
  color: var(--surface);
  border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
}
.cal-day-month {
  font-size: .65rem;
  color: var(--text-3);
}

/* Label de horário */
.calendar-time-label {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-right: 6px;
  padding-top: 3px;
  height: 40px;
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
  flex-shrink: 0;
}

/* Slot (célula) */
.calendar-slot {
  height: 40px;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background .1s;
  box-sizing: border-box;
}
.calendar-slot:hover { background: var(--primary-dim2); }
.calendar-slot:hover .calendar-slot-plus { opacity: 1; }
.calendar-slot-plus {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--primary);
  opacity: 0;
  pointer-events: none;
  line-height: 1;
  transition: opacity .1s;
}

/* ── Evento de agendamento ── */
.apt-event {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 10px;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1px;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: opacity .15s, transform .1s;
}
.apt-event:hover { opacity: .9; transform: scale(1.01); z-index: 3; }
.apt-event.status-concluido { opacity: .55; }
.apt-event.status-cancelado { text-decoration: line-through; opacity: .45; }
.apt-ev-time   { font-size: 9px; opacity: .85; font-weight: 600; }
.apt-ev-client { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apt-ev-svc    { font-size: 9px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 400;
}
.modal-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem 1.5rem 1.25rem;
  width: 92%;
  max-width: 420px;
  z-index: 401;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  max-height: 92vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 1.3rem;
  line-height: 1;
  padding: .1rem .3rem;
  border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
  font-family: inherit;
}
.modal-close:hover { color: var(--text); background: var(--primary-dim2); }
.modal-fields {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.modal-fields .field { gap: .3rem; }
.modal-fields .label { font-size: .78rem; }
.modal-fields .input {
  padding: .55rem .8rem;
  font-size: .875rem;
}
.modal-details-toggle {
  margin-top: .5rem;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary);
  user-select: none;
}
.modal-details-toggle::-webkit-details-marker { display: none; }
.modal-details-body { display: flex; flex-direction: column; gap: .75rem; padding-top: .5rem; }
.btn-save-big {
  display: block;
  width: 100%;
  padding: .8rem;
  background: var(--primary);
  color: var(--surface);
  border: none;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  font-family: "Montserrat", inherit;
  margin-top: 1rem;
  letter-spacing: .01em;
}
.btn-save-big:hover:not(:disabled) { background: var(--primary-hover); }
.btn-save-big:active { transform: scale(.98); }
.btn-save-big:disabled { opacity: .55; cursor: not-allowed; }
.modal-footer {
  display: flex;
  gap: .6rem;
  margin-top: .65rem;
  align-items: center;
}
.btn-modal-cancel {
  flex: 1;
  padding: .65rem;
  background: transparent;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), color var(--transition);
}
.btn-modal-cancel:hover { background: var(--primary-dim2); color: var(--text); }
.btn-delete-apt {
  padding: .65rem 1rem;
  background: transparent;
  border: 1.5px solid rgba(239,68,68,.4);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition);
  white-space: nowrap;
}
.btn-delete-apt:hover { background: rgba(239,68,68,.06); }

/* ── main da agenda usa toda a largura disponível ── */
.main--appointments {
  max-width: 100%;
  padding: 0;
  gap: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ══════════════════════
   FINANCEIRO
══════════════════════ */

/* ── Dashboard KPI ── */
.fin-dashboard { margin-bottom: 1.25rem; }

.fin-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .85rem;
  margin-bottom: .75rem;
}

.fin-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.fin-kpi-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
}

.fin-kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.1;
}

.fin-kpi-value--green  { color: #16A34A; }
.fin-kpi-value--orange { color: #D97706; }
.fin-kpi-value--period { font-size: .95rem; font-weight: 600; color: var(--text-2); }
.fin-kpi-card--period  { border-style: dashed; }

/* Breakdown por método */
.fin-methods-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.fin-method-pill {
  display: inline-flex;
  align-items: center;
  padding: .25rem .85rem;
  border-radius: 99px;
  font-size: .8rem;
  font-weight: 600;
  border: 1.5px solid transparent;
}

.fin-method--dinheiro { background: rgba(34,197,94,.10);  color: #16A34A; border-color: rgba(34,197,94,.3);  }
.fin-method--pix      { background: rgba(59,130,246,.10); color: #1D4ED8; border-color: rgba(59,130,246,.3); }
.fin-method--credito  { background: rgba(255,175,2,0.12); color: #ffaf02; border-color: rgba(255,175,2,.3); }
.fin-method--debito   { background: rgba(234,88,12,.10);  color: #C2410C; border-color: rgba(234,88,12,.3);  }
.fin-method--voucher  { background: rgba(255,255,255,0.06); color: var(--text-2); border-color: rgba(255,255,255,0.08); }

/* ── Seletor de período ── */
.fin-period-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.1rem;
}

.fin-period-inputs {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.fin-period-input {
  width: auto;
  max-width: 150px;
}

.fin-period-shortcuts {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.fin-shortcut-btn {
  padding: .4rem .85rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  border-radius: 99px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  font-family: "Montserrat", inherit;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.fin-shortcut-btn:hover { background: var(--primary-dim); color: var(--primary); border-color: var(--primary-dim); }

/* ── Abas ── */
.fin-tabs {
  display: flex;
  gap: .25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
}

.fin-tab {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1.1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  font-family: inherit;
  transition: color var(--transition), border-color var(--transition);
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
}
.fin-tab:hover { color: var(--text-2); }
.fin-tab--active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-dim2);
}

/* ── Painel header ── */
.fin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .85rem;
}

/* ── Lista de pagamentos ── */
.fin-payments-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.fin-payment-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition);
}
.fin-payment-row:hover { border-color: var(--primary); }

.fin-payment-main {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-wrap: wrap;
}

.fin-payment-date {
  display: flex;
  flex-direction: column;
  min-width: 72px;
  flex-shrink: 0;
}
.fin-payment-day  { font-size: .82rem; font-weight: 700; color: var(--text); }
.fin-payment-time { font-size: .75rem; color: var(--text-3); }

.fin-payment-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.fin-payment-client {
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fin-payment-meta { font-size: .78rem; color: var(--text-2); }

.fin-payment-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .25rem;
  flex-shrink: 0;
}
.fin-payment-amount {
  font-size: 1rem;
  font-weight: 800;
  color: #16A34A;
  letter-spacing: -.01em;
}

.fin-payment-actions {
  display: flex;
  gap: .4rem;
  margin-top: .55rem;
  padding-top: .55rem;
  border-top: 1px solid var(--border);
}

/* ── Badges de método ── */
.fin-badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .65rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  border: 1.5px solid transparent;
}
.fin-badge--dinheiro { background: rgba(34,197,94,.10);  color: #16A34A; border-color: rgba(34,197,94,.3);  }
.fin-badge--pix      { background: rgba(59,130,246,.10); color: #1D4ED8; border-color: rgba(59,130,246,.3); }
.fin-badge--credito  { background: rgba(255,175,2,0.12); color: #ffaf02; border-color: rgba(255,175,2,.3); }
.fin-badge--debito   { background: rgba(234,88,12,.10);  color: #C2410C; border-color: rgba(234,88,12,.3);  }
.fin-badge--voucher  { background: rgba(255,255,255,0.06); color: var(--text-2); border-color: rgba(255,255,255,0.08); }

/* ── Empty state financeiro ── */
.fin-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}
.fin-empty p { font-size: .9rem; font-weight: 500; }
.fin-empty-text { font-size: .9rem; color: var(--text-3); padding: 2rem 0; text-align: center; }

/* ── Caixa de barbeiros ── */
.fin-caixa-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.fin-commission-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: border-color var(--transition);
}
.fin-commission-card:hover { border-color: var(--primary); }
.fin-commission-card--zero { opacity: .75; }

.fin-commission-top {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.fin-commission-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.fin-commission-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fin-commission-rule { font-size: .78rem; color: var(--text-2); }

.fin-commission-rows { display: flex; flex-direction: column; gap: .3rem; }
.fin-commission-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .84rem;
  color: var(--text-2);
}
.fin-commission-row--total {
  font-weight: 700;
  font-size: .92rem;
  color: var(--text);
}
.fin-commission-divider {
  height: 1px;
  background: var(--border);
  margin: .25rem 0;
}

.fin-due--positive { color: #16A34A; font-weight: 800; font-size: 1rem; }
.fin-due--zero     { color: var(--text-3); font-weight: 600; }

.fin-btn-pay-comm {
  width: 100%;
  padding: .6rem;
  background: var(--primary);
  color: var(--surface);
  border: none;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  font-family: "Montserrat", inherit;
  transition: background var(--transition);
  box-shadow: 0 2px 8px var(--primary-dim);
  margin-top: .1rem;
}
.fin-btn-pay-comm:hover { background: var(--primary-hover); }

.fin-no-commission {
  text-align: center;
  font-size: .8rem;
  color: var(--text-3);
  padding: .25rem 0;
}

/* ══════════════════════
   BADGE INATIVO (barbeiros)
══════════════════════ */
.badge-inactive {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .15rem .5rem;
  border-radius: 99px;
  margin-left: .45rem;
  vertical-align: middle;
  text-transform: uppercase;
}

.barber-card--inactive {
  opacity: .55;
}
.barber-card--inactive .barber-avatar {
  background: var(--surface-2);
  color: var(--text-3);
}

/* ══════════════════════
   FILTRO DE CLIENTES
══════════════════════ */
.filter-bar {
  margin-bottom: 1rem;
}
.filter-bar-inner {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  align-items: center;
}
.filter-search-wrap {
  position: relative;
  flex: 1 1 180px;
  min-width: 160px;
}
.filter-search-icon {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.filter-search-input {
  padding-left: 2.1rem !important;
  width: 100%;
}
.filter-select {
  flex: 0 1 160px;
  min-width: 130px;
}

/* ══════════════════════
   LISTA CLIENTES (linhas)
══════════════════════ */
.client-rows {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.client-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 1rem 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), border-color var(--transition);
  min-width: 0;
}
.client-row--clickable {
  cursor: pointer;
}
.client-row:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,.1);
  border-color: var(--primary-dim2);
}

.client-row-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-dim);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: -.01em;
}

.client-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.client-row-top {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}

.client-row-name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-type-badge {
  display: inline-flex;
  align-items: center;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .15rem .5rem;
  border-radius: 99px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.client-type-badge--mensalista {
  background: var(--primary-dim);
  color: var(--primary);
}
.client-type-badge--avulso {
  background: rgba(2,171,21,.12);
  color: #02ab15;
}
.client-type-badge--pacote {
  background: rgba(234,179,8,.12);
  color: #ca8a04;
}

/* ── Package chips (lista de clientes) ─────────────────────────── */
.pkg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.pkg-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  padding: .2rem .55rem;
  border-radius: 99px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.pkg-chip--ok    { color: #15803d; background: #dcfce7; border-color: #bbf7d0; }
.pkg-chip--low   { color: #b45309; background: #fef3c7; border-color: #fde68a; }
.pkg-chip--empty { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }
.pkg-use-btn {
  background: none;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: .05rem .35rem;
  font-size: .68rem;
  cursor: pointer;
  color: inherit;
  line-height: 1.4;
}
.pkg-use-btn:disabled { opacity: .45; cursor: not-allowed; }
.pkg-use-btn:not(:disabled):hover { opacity: .75; }

.field-hint { font-size: .8rem; color: var(--text-2); margin: -.25rem 0 .5rem; }

.client-row-metas {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.client-row-meta {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  color: var(--text-2);
}

.client-row-meta--value {
  color: #16A34A;
  font-weight: 600;
}

/* Badge de desconto — verde, compacto, ao lado do nome na listagem */
.client-discount-badge {
  display: inline-flex;
  align-items: center;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: .15rem .45rem;
  border-radius: 99px;
  background: #DCFCE7;
  color: #16A34A;
  flex-shrink: 0;
}

/* ── Checkbox group para multi-seleção de serviços ── */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  max-height: 220px;
  overflow-y: auto;
  padding: .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.checkbox-group-empty {
  font-size: .85rem;
  color: var(--text-3);
  padding: .25rem 0;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .65rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}
.checkbox-option:hover {
  background: var(--primary-dim2);
}
.checkbox-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox-option input[type="checkbox"]:checked + .checkbox-option-label {
  color: var(--primary);
  font-weight: 600;
}
.checkbox-option-label {
  flex: 1;
  font-size: .875rem;
  color: var(--text);
  transition: color var(--transition);
}
.checkbox-option-price {
  font-size: .78rem;
  color: var(--text-2);
  white-space: nowrap;
  margin-left: auto;
}
.checkbox-option-cuts {
  font-size: .72rem;
  color: var(--text-3);
  white-space: nowrap;
}

.client-row-actions {
  display: flex;
  gap: .4rem;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition);
}
.client-row:hover .client-row-actions {
  opacity: 1;
}

/* No mobile os botões ficam sempre visíveis (sem hover) */
@media (hover: none) {
  .client-row-actions { opacity: 1; }
}

.btn-sm {
  padding: .35rem .7rem;
  font-size: .8rem;
}

/* ══════════════════════
   MOBILE
══════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .sidebar-toggle { display: flex; }
  .main-wrapper { margin-left: 0; }
  .main { padding: 1.25rem 1rem 5rem; }
  .topbar { padding: 0 1rem; height: 56px; }

  /* Agenda mobile: grid mostra só hoje + scroll horizontal para outros dias */
  .apt-topbar { padding: .6rem .75rem .5rem; gap: .4rem; }
  .apt-pills-wrap { margin-left: 0; }
  .apt-calendar-scroll { padding: .25rem .25rem 2rem; }
  .calendar-grid {
    /* No mobile mantém o min-width para forçar scroll horizontal */
    min-width: 520px;
  }
  .modal-box { padding: 1.1rem 1rem 1rem; }

  /* Financeiro mobile */
  .fin-kpi-row { grid-template-columns: 1fr 1fr; }
  .fin-kpi-card--period { grid-column: 1 / -1; }
  .fin-kpi-value { font-size: 1.15rem; }
  .fin-period-bar { flex-direction: column; align-items: flex-start; }
  .fin-caixa-list { grid-template-columns: 1fr; }
  .fin-payment-main { gap: .5rem; }
  .fin-panel-header { flex-direction: column; align-items: flex-start; gap: .65rem; }
  .fin-panel-header .btn { width: 100%; justify-content: center; }

  /* Clientes mobile: filtros em coluna, botões sempre visíveis */
  .filter-bar-inner { flex-direction: column; align-items: stretch; }
  .filter-search-wrap { flex: none; }
  .filter-select { flex: none; min-width: 0; }
  .client-row { padding: .65rem .75rem; gap: .65rem; }
  .client-row-actions { opacity: 1; }
  .client-row-name { font-size: .9rem; }
  .btn-label { display: none; }
}

@media (max-width: 400px) {
  .fin-kpi-row { grid-template-columns: 1fr; }
  .fin-kpi-card--period { grid-column: span 1; }
}

/* ── Password strength indicator ── */
.pwd-req { color: var(--text-3); transition: color .15s; }
.pwd-req--ok { color: var(--green); }

/* ── Trio de campos: desconto / acréscimo / valor mensal final ── */
.monthly-value-trio {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}
.monthly-value-trio .field:last-child {
  flex: 1.5;
}
.monthly-value-trio .field:not(:last-child) {
  flex: 1;
}
@media (max-width: 480px) {
  .monthly-value-trio {
    flex-direction: column;
  }
  .monthly-value-trio .field,
  .monthly-value-trio .field:last-child {
    flex: none;
    width: 100%;
  }
}

/* ══════════════════════
   BOTÃO VER (clientes)
══════════════════════ */
.btn-view {
  background: rgba(107,114,128,.08);
  color: var(--text-2);
  border: 1.5px solid rgba(107,114,128,.25);
  padding: .35rem .85rem;
  font-size: .8rem;
}
.btn-view:hover { background: rgba(107,114,128,.15); color: var(--text); }

/* ══════════════════════
   MODAL DE VISUALIZAÇÃO DO CLIENTE
══════════════════════ */
.modal-box--view {
  max-width: 460px;
}

/* Nome + badge no topo do modal */
.cvm-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--border);
}

/* Linhas de dados */
.cvm-rows {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.cvm-row {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}

.cvm-label {
  flex-shrink: 0;
  width: 120px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-3);
  padding-top: .05rem;
}

.cvm-value {
  flex: 1;
  font-size: .88rem;
  color: var(--text);
  word-break: break-word;
}

.cvm-value--highlight {
  font-weight: 700;
  color: #16A34A;
}

.cvm-value--notes {
  color: var(--text-2);
  font-style: italic;
  line-height: 1.45;
}

/* Link WhatsApp dentro do modal */
.cvm-wa-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: #16A34A;
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition);
}
.cvm-wa-link:hover { opacity: .75; }

/* Seção de bloco (mensalista / pacote) */
.cvm-section {
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border);
}

.cvm-section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--primary);
  margin-bottom: .65rem;
}

/* pkg-chips dentro do modal: sem botão Usar */
#cvm-pkg-list .pkg-chip {
  cursor: default;
}

/* ── Painel de Cortes ── */
.cvm-cortes-header {
  display: flex;
  align-items: center;
  margin-bottom: .75rem;
}
.cvm-cortes-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-height: 340px;
  overflow-y: auto;
}
.cvm-corte-card {
  display: flex;
  flex-direction: column;
  gap: .18rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.cvm-corte-card--concluido { border-left: 3px solid var(--green, #22c55e); }
.cvm-corte-card--cancelado { border-left: 3px solid var(--red, #ef4444); }
.cvm-corte-card--agendado  { border-left: 3px solid var(--primary); }
.cvm-corte-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cvm-corte-date { font-size: .82rem; font-weight: 600; color: var(--text); }
.cvm-corte-status {
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cvm-corte-status--concluido { background: rgba(34,197,94,.12); color: #16a34a; }
.cvm-corte-status--cancelado { background: rgba(239,68,68,.1);  color: var(--red); }
.cvm-corte-status--agendado  { background: rgba(255,175,2,.12); color: #ffaf02; }
.cvm-corte-info { font-size: .8rem; color: var(--text-2); }
.cvm-cortes-loading { color: var(--text-2); font-size: .85rem; padding: .5rem 0; }
.cvm-cortes-empty  { color: var(--text-2); font-size: .85rem; padding: .5rem 0; }

/* Botão secundário no modal */
.btn.btn-secondary {
  background: transparent;
  color: #ffaf02;
  border: 1.5px solid #ffaf02;
  box-shadow: none;
}
.btn.btn-secondary:hover:not(:disabled) {
  background: rgba(255,175,2,.12);
  box-shadow: none;
}

@media (max-width: 480px) {
  .cvm-label { width: 100px; }
}

/* ── Campo somente leitura que exibe o valor final calculado ── */
.input--readonly-final {
  border: 1.5px solid #02ab15 !important;
  background: rgba(2,171,21,.08) !important;
  color: #02ab15 !important;
  font-weight: 600 !important;
  cursor: default;
}
.input--readonly-final:focus {
  box-shadow: 0 0 0 3px rgba(2,171,21,.18) !important;
  border-color: #02ab15 !important;
}

/* ══════════════════════
   CONFIGURAÇÕES
══════════════════════ */
.settings-radio-label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .9rem;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.settings-radio-label input[type="radio"] { display: none; }
.settings-radio-label:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.settings-radio-label--active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-dim);
  font-weight: 600;
}

/* Toggle switch */
.settings-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  user-select: none;
}
.settings-toggle-wrap { position: relative; }
.settings-toggle-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.settings-toggle-track {
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--border-2);
  position: relative;
  transition: background var(--transition);
}
.settings-toggle-wrap input:checked + .settings-toggle-track {
  background: var(--primary);
}
.settings-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform var(--transition);
}
.settings-toggle-wrap input:checked + .settings-toggle-track .settings-toggle-thumb {
  transform: translateX(20px);
}
.settings-toggle-text {
  font-size: .9rem;
  color: var(--text);
}

.settings-feedback--ok    { color: #16A34A; }
.settings-feedback--error { color: var(--red); }

/* ── Grade de horário semanal (work_schedule) ── */
.ws-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .45rem 0;
  flex-wrap: wrap;
}
.ws-row + .ws-row {
  border-top: 1px solid var(--border);
}
.ws-day-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  min-width: 108px;
  flex-shrink: 0;
}
.ws-day-label span {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
}
.ws-sep {
  font-size: .8rem;
  color: var(--text-2);
  flex-shrink: 0;
}
.ws-select {
  width: 120px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .85rem;
  font-family: inherit;
  padding: .38rem .5rem;
  transition: border-color var(--transition), opacity var(--transition);
  outline: none;
  cursor: pointer;
  appearance: auto;
}
.ws-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.ws-select:disabled {
  opacity: .4;
  cursor: default;
  pointer-events: none;
}
@media (max-width: 480px) {
  .ws-row { flex-wrap: wrap; gap: .5rem; }
  .ws-day-label { min-width: 100%; }
  .ws-select { flex: 1; width: auto; min-width: 80px; }
}

/* ── Loading screen (painel admin) ── */
.ld-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary, #ffaf02);
  animation: ld-bounce .6s ease-in-out infinite alternate;
}
@keyframes ld-bounce {
  from { opacity: .3; transform: translateY(0); }
  to   { opacity: 1;  transform: translateY(-5px); }
}

/* ── Toast notifications (painel admin) ── */
.admin-toast {
  background: var(--surface-2);
  color: var(--text);
  padding: .7rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.22);
  pointer-events: none;
  opacity: 1;
  transition: opacity .3s ease;
  animation: admin-toast-in .2s ease;
  white-space: nowrap;
}
.admin-toast--success { background: #15803D; }
.admin-toast--error   { background: #DC2626; }
@keyframes admin-toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════
   TELA DE LOGIN
══════════════════════ */
.login-screen {
  position: fixed;
  inset: 0;
  background: #121212;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Montserrat", system-ui, sans-serif;
}
.login-card {
  background: #181b20;
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  margin: 1rem;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,0.08);
}
.login-header {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo {
  max-width: 80px;
  max-height: 80px;
  object-fit: contain;
  display: block;
  margin: 0 auto 1rem;
}
.login-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  color: #fff;
  font-size: 1.5rem;
}
.login-title {
  font-size: 1.5rem;
  font-weight: 400;
  color: #fff;
  margin: 0 0 .25rem;
  font-family: "Fredoka", sans-serif;
}
.login-subtitle {
  color: rgba(255,255,255,0.5);
  font-size: .88rem;
  margin: 0;
  font-family: "Montserrat", sans-serif;
}
.login-fields {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.login-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  font-family: "Montserrat", sans-serif;
}
.login-input {
  width: 100%;
  box-sizing: border-box;
  padding: .7rem 1rem;
  background: #20242a;
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  font-size: .93rem;
  outline: none;
  font-family: "Montserrat", inherit;
  color: #fff;
  transition: border-color .17s, box-shadow .17s;
}
.login-input::placeholder { color: rgba(255,255,255,0.3); }
.login-input:focus {
  border-color: #ffaf02;
  box-shadow: 0 0 0 3px rgba(255,175,2,0.15);
}
.login-error {
  color: #ef4444;
  font-size: .84rem;
  text-align: center;
  min-height: 1.2em;
}
.login-btn {
  background: #ffaf02;
  color: #121212;
  border: none;
  border-radius: 9999px;
  padding: .8rem;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  font-family: "Montserrat", inherit;
  box-shadow: 0 2px 10px rgba(255,175,2,0.3);
  transition: background .17s, transform .17s, box-shadow .17s;
}
.login-btn:hover { background: #ffb921; transform: translateY(-1px); }
.login-btn:active { transform: scale(.97); }

/* Login: overrides para tema violet */
[data-theme="violet"] .login-screen {
  background: #0f0f1a;
  font-family: "Inter", system-ui, sans-serif;
}
[data-theme="orange"] .login-screen {
  background: #121212;
  font-family: "Inter", system-ui, sans-serif;
}
[data-theme="violet"] .login-card {
  background: #1a1b2e;
  border-radius: 24px;
  padding: 2.5rem 2rem;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
[data-theme="orange"] .login-card {
  background: #1a1a1a;
  border-radius: 24px;
  padding: 2.5rem 2rem;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
[data-theme="violet"] .login-subtitle,
[data-theme="orange"] .login-subtitle {
  font-family: "Inter", sans-serif;
}
[data-theme="violet"] .login-label,
[data-theme="orange"] .login-label {
  font-family: "Inter", sans-serif;
}
[data-theme="violet"] .login-input {
  background: #22243a;
  border-color: rgba(255,255,255,0.1);
  border-radius: 8px;
  font-family: "Inter", sans-serif;
}
[data-theme="orange"] .login-input {
  background: #20242a;
  border-color: rgba(255,255,255,0.1);
  border-radius: 8px;
  font-family: "Inter", sans-serif;
}
[data-theme="violet"] .login-input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}
[data-theme="orange"] .login-input:focus {
  border-color: #F7931E;
  box-shadow: 0 0 0 3px rgba(247,147,30,0.2);
}
[data-theme="violet"] .login-btn {
  background: #7c3aed;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 14px rgba(124,58,237,0.45);
}
[data-theme="orange"] .login-btn {
  background: #F7931E;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 14px rgba(247,147,30,0.45);
}
[data-theme="violet"] .login-btn:hover {
  background: #6d28d9;
  box-shadow: 0 6px 20px rgba(124,58,237,0.55);
}
[data-theme="orange"] .login-btn:hover {
  background: #E67E22;
  box-shadow: 0 6px 20px rgba(247,147,30,0.55);
}

/* Login: overrides para tema light */
[data-theme="light"] .login-screen {
  background: var(--bg);
}
[data-theme="light"] .login-card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
[data-theme="light"] .login-title {
  color: var(--text);
}
[data-theme="light"] .login-subtitle {
  color: var(--text-2);
}
[data-theme="light"] .login-label {
  color: var(--text-2);
}
[data-theme="light"] .login-input {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text);
}
[data-theme="light"] .login-input::placeholder {
  color: var(--text-3);
}
[data-theme="light"] .login-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
[data-theme="light"] .login-btn {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 10px var(--primary-dim);
}
[data-theme="light"] .login-btn:hover { background: var(--primary-hover); }
[data-theme="light"] .login-error { color: var(--red); }

/* ── Overrides Dark ─────────────────────────────── */
[data-theme="dark"] body,
[data-theme="orange"] body {
  font-family: "Montserrat", system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] .btn-primary {
  border-radius: 9999px;
  box-shadow: 0 2px 10px rgba(255,175,2,0.3);
}
[data-theme="orange"] .btn-primary {
  border-radius: 9999px;
  box-shadow: 0 2px 10px rgba(247,147,30,0.3);
}
[data-theme="dark"] .btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(255,175,2,0.45);
  transform: translateY(-2px);
}
[data-theme="orange"] .btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(247,147,30,0.45);
  transform: translateY(-2px);
}
[data-theme="dark"] .btn-ghost,
[data-theme="orange"] .btn-ghost {
  border-radius: 9999px;
}
[data-theme="dark"] .btn-save-big {
  background: #ffaf02;
  color: #121212;
  border-radius: 9999px;
}
[data-theme="orange"] .btn-save-big {
  background: #F7931E;
  color: #121212;
  border-radius: 9999px;
}
[data-theme="dark"] .btn-save-big:hover:not(:disabled) {
  background: #ffb921;
}
[data-theme="orange"] .btn-save-big:hover:not(:disabled) {
  background: #E67E22;
}
[data-theme="dark"] .sidebar {
  background: var(--sidebar-bg);
  border-right-color: rgba(255,255,255,0.06);
}
[data-theme="orange"] .sidebar {
  background: var(--sidebar-bg);
  border-right-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .sidebar-divider {
  background: rgba(255,255,255,0.07);
  margin-left: 0;
  margin-right: 0;
}
[data-theme="orange"] .sidebar-divider {
  background: rgba(255,255,255,0.07);
  margin-left: 0;
  margin-right: 0;
}
[data-theme="dark"] .sidebar-brand-icon {
  box-shadow: 0 3px 12px rgba(255,175,2,0.35);
}
[data-theme="orange"] .sidebar-brand-icon {
  box-shadow: 0 3px 12px rgba(247,147,30,0.35);
}
[data-theme="dark"] .sidebar-user-avatar {
  color: #121212;
}
[data-theme="orange"] .sidebar-user-avatar {
  color: #121212;
}
[data-theme="dark"] .nav-item:hover:not(.nav-item--soon) {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
[data-theme="orange"] .nav-item:hover:not(.nav-item--soon) {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
[data-theme="dark"] .topbar {
  background: #181b20;
}
[data-theme="orange"] .topbar {
  background: #1a1a1a;
}
[data-theme="dark"] .modal-box {
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
}
[data-theme="orange"] .modal-box {
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
}
[data-theme="dark"] .modal-backdrop {
  background: rgba(0,0,0,0.72);
}
[data-theme="orange"] .modal-backdrop {
  background: rgba(0,0,0,0.72);
}
[data-theme="dark"] .input,
[data-theme="orange"] .input {
  background: var(--surface-2);
}
[data-theme="dark"] .input::placeholder {
  color: rgba(255,255,255,0.3);
}
[data-theme="orange"] .input::placeholder {
  color: rgba(255,255,255,0.3);
}
/* dark: active já herdado do bloco base — cor escura sobre dourado definida em `.nav-item` override */
[data-theme="dark"] .cal-day-num--today {
  background: #ffaf02;
  color: #121212;
}
[data-theme="orange"] .cal-day-num--today {
  background: #F7931E;
  color: #121212;
}
[data-theme="dark"] .calendar-day-header--today {
  background: rgba(255,175,2,0.08);
  border-bottom-color: #ffaf02;
}
[data-theme="orange"] .calendar-day-header--today {
  background: rgba(247,147,30,0.08);
  border-bottom-color: #F7931E;
}
[data-theme="dark"] .calendar-slot:hover {
  background: rgba(255,175,2,0.06);
}
[data-theme="orange"] .calendar-slot:hover {
  background: rgba(247,147,30,0.06);
}
[data-theme="dark"] .toast.success {
  border-color: rgba(2,171,21,0.5);
  color: #02ab15;
}
[data-theme="orange"] .toast.success {
  border-color: rgba(2,171,21,0.5);
  color: #02ab15;
}
[data-theme="dark"] .toast.error {
  border-color: rgba(239,68,68,0.5);
  color: #ef4444;
}
[data-theme="orange"] .toast.error {
  border-color: rgba(239,68,68,0.5);
  color: #ef4444;
}
[data-theme="dark"] ::-webkit-scrollbar-track { background: #121212; }
[data-theme="orange"] ::-webkit-scrollbar-track { background: #121212; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
[data-theme="orange"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,175,2,0.4); }
[data-theme="orange"] ::-webkit-scrollbar-thumb:hover { background: rgba(247,147,30,0.4); }
[data-theme="dark"] .topbar-avatar {
  background: rgba(255,175,2,0.15);
  border-color: #ffaf02;
  color: #ffaf02;
}
[data-theme="orange"] .topbar-avatar {
  background: rgba(247,147,30,0.15);
  border-color: #F7931E;
  color: #F7931E;
}
[data-theme="dark"] .barber-avatar {
  background: rgba(255,175,2,0.15);
  border-color: #ffaf02;
  color: #ffaf02;
}
[data-theme="orange"] .barber-avatar {
  background: rgba(247,147,30,0.15);
  border-color: #F7931E;
  color: #F7931E;
}
[data-theme="dark"] .empty-icon-wrap {
  background: rgba(255,175,2,0.12);
  color: #ffaf02;
}
[data-theme="orange"] .empty-icon-wrap {
  background: rgba(247,147,30,0.12);
  color: #F7931E;
}
[data-theme="dark"] .fin-kpi-value { color: #ffffff; }
[data-theme="orange"] .fin-kpi-value { color: #ffffff; }

/* Tema toggle button */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--primary-dim);
  color: var(--primary);
  border-color: var(--primary);
}

/* ── Overrides Violet ─────────────────────────── */
[data-theme="violet"] body {
  font-family: "Inter", system-ui, sans-serif;
  background: #0f0f1a;
}

/* Sidebar */
[data-theme="violet"] .sidebar {
  background: var(--sidebar-bg);
  border-right-color: rgba(255,255,255,0.06);
}
[data-theme="violet"] .sidebar-brand-icon {
  background: #7c3aed;
  box-shadow: 0 4px 14px rgba(124,58,237,0.45);
}
[data-theme="violet"] .sidebar-divider {
  background: rgba(255,255,255,0.06);
  margin-left: 0;
  margin-right: 0;
}
[data-theme="violet"] .nav-item:hover:not(.nav-item--soon) {
  background: rgba(255,255,255,0.05);
  color: #fff;
}
/* violet: active já herdado do bloco base com fundo sólido var(--primary) */
[data-theme="violet"] .nav-item.active .nav-icon,
[data-theme="violet"] .nav-item.active-exact .nav-icon,
[data-theme="orange"] .nav-item.active .nav-icon,
[data-theme="orange"] .nav-item.active-exact .nav-icon { opacity: 1; }

/* Topbar */
[data-theme="violet"] .topbar {
  background: #13131f;
  border-bottom-color: rgba(255,255,255,0.07);
}
[data-theme="violet"] .topbar-notif {
  background: #1a1b2e;
  border-color: rgba(255,255,255,0.1);
}
[data-theme="orange"] .topbar-notif {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.1);
}
[data-theme="violet"] .topbar-avatar {
  background: rgba(124,58,237,0.2);
  border-color: #7c3aed;
  color: #7c3aed;
}

/* Cards */
[data-theme="violet"] .card {
  background: #1a1b2e;
  border-color: rgba(255,255,255,0.07);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
[data-theme="orange"] .card {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.07);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
[data-theme="violet"] .card-title { color: rgba(255,255,255,0.5); }
[data-theme="orange"] .card-title { color: rgba(255,255,255,0.5); }
[data-theme="violet"] .card-icon  { color: #7c3aed; }
[data-theme="orange"] .card-icon { color: #F7931E; }

/* Inputs */
[data-theme="violet"] .input {
  background: #22243a;
  border-color: rgba(255,255,255,0.1);
  color: #fff;
}
[data-theme="violet"] .input::placeholder { color: rgba(255,255,255,0.3); }
[data-theme="violet"] .input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}
[data-theme="orange"] .input:focus {
  border-color: #F7931E;
  box-shadow: 0 0 0 3px rgba(247,147,30,0.2);
}

/* Botões */
[data-theme="violet"] .btn-primary {
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 3px 12px rgba(124,58,237,0.4);
}
[data-theme="violet"] .btn-primary:hover:not(:disabled) {
  background: #6d28d9;
  box-shadow: 0 6px 20px rgba(124,58,237,0.55);
  transform: translateY(-1px);
}
[data-theme="violet"] .btn-edit {
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
  border-color: rgba(124,58,237,0.3);
}
[data-theme="orange"] .btn-edit {
  background: rgba(247,147,30,0.15);
  color: #FFB347;
  border-color: rgba(247,147,30,0.3);
}
[data-theme="violet"] .btn-edit:hover { background: rgba(124,58,237,0.25); }
[data-theme="orange"] .btn-edit:hover { background: rgba(247,147,30,0.25); }
[data-theme="violet"] .btn-save-big {
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 3px 12px rgba(124,58,237,0.4);
  border-radius: var(--radius-sm);
}
[data-theme="violet"] .btn-save-big:hover:not(:disabled) { background: #6d28d9; }

/* Barber cards */
[data-theme="violet"] .barber-card {
  background: #1a1b2e;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="orange"] .barber-card {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="violet"] .barber-card:hover {
  border-color: rgba(124,58,237,0.45);
  box-shadow: 0 4px 20px rgba(124,58,237,0.15);
}
[data-theme="orange"] .barber-card:hover {
  border-color: rgba(247,147,30,0.45);
  box-shadow: 0 4px 20px rgba(247,147,30,0.15);
}
[data-theme="violet"] .barber-avatar {
  background: rgba(124,58,237,0.2);
  border-color: #7c3aed;
  color: #a78bfa;
}
[data-theme="violet"] .barber-chip {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="orange"] .barber-chip {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="violet"] .barber-chip--highlight {
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
  border-color: rgba(124,58,237,0.3);
}
[data-theme="orange"] .barber-chip--highlight {
  background: rgba(247,147,30,0.15);
  color: #FFB347;
  border-color: rgba(247,147,30,0.3);
}

/* Calendar / Agenda */
[data-theme="violet"] .calendar-slot:hover { background: rgba(124,58,237,0.08); }
[data-theme="violet"] .calendar-day-header--today {
  background: rgba(124,58,237,0.1);
  border-bottom-color: #7c3aed;
}
[data-theme="violet"] .cal-day-num--today {
  background: #7c3aed;
  color: #fff;
}

/* Modal */
[data-theme="violet"] .modal-box {
  background: #1a1b2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
}
[data-theme="violet"] .modal-backdrop { background: rgba(0,0,0,0.72); }

/* Badges */
[data-theme="violet"] .badge {
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
  border-color: rgba(124,58,237,0.3);
}
[data-theme="orange"] .badge {
  background: rgba(247,147,30,0.15);
  color: #FFB347;
  border-color: rgba(247,147,30,0.3);
}
[data-theme="violet"] .badge-inactive {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.4);
}
[data-theme="orange"] .badge-inactive {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.4);
}

/* Status de agendamentos */
[data-theme="violet"] .apt-event,
[data-theme="orange"] .apt-event { border-radius: 8px; }

/* Financeiro KPIs */
[data-theme="violet"] .fin-kpi-card {
  background: #1a1b2e;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="orange"] .fin-kpi-card {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="violet"] .fin-kpi-value { color: #fff; }
[data-theme="violet"] .fin-kpi-label { color: rgba(255,255,255,0.45); }
[data-theme="orange"] .fin-kpi-label { color: rgba(255,255,255,0.45); }

/* Client rows */
[data-theme="violet"] .client-row {
  background: #1a1b2e;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="orange"] .client-row {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="violet"] .client-row:hover {
  border-color: rgba(124,58,237,0.4);
  box-shadow: 0 2px 12px rgba(124,58,237,0.1);
}
[data-theme="orange"] .client-row:hover {
  border-color: rgba(247,147,30,0.4);
  box-shadow: 0 2px 12px rgba(247,147,30,0.1);
}
[data-theme="violet"] .client-row-avatar {
  background: rgba(124,58,237,0.2);
  color: #a78bfa;
}
[data-theme="orange"] .client-row-avatar {
  background: rgba(247,147,30,0.2);
  color: #FFB347;
}

/* Fin payment rows */
[data-theme="violet"] .fin-payment-row {
  background: #1a1b2e;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="orange"] .fin-payment-row {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="violet"] .fin-payment-row:hover { border-color: rgba(124,58,237,0.4); }
[data-theme="orange"] .fin-payment-row:hover { border-color: rgba(247,147,30,0.4); }

/* Tabs */
[data-theme="violet"] .fin-tab--active {
  color: #a78bfa;
  border-bottom-color: #7c3aed;
  background: rgba(124,58,237,0.08);
}
[data-theme="orange"] .fin-tab--active {
  color: #FFB347;
  border-bottom-color: #F7931E;
  background: rgba(247,147,30,0.08);
}

/* Toast */
[data-theme="violet"] .toast { background: #1a1b2e; border-color: rgba(255,255,255,0.12); }
[data-theme="orange"] .toast { background: #1a1a1a; border-color: rgba(255,255,255,0.12); }
[data-theme="violet"] .toast.success { border-color: rgba(16,185,129,0.5); color: #10b981; }
[data-theme="violet"] .toast.error   { border-color: rgba(239,68,68,0.5);  color: #ef4444; }

/* Empty state */
[data-theme="violet"] .empty-icon-wrap {
  background: rgba(124,58,237,0.12);
  color: #7c3aed;
}

/* Scrollbar */
[data-theme="violet"] ::-webkit-scrollbar-track { background: #0f0f1a; }
[data-theme="violet"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); }
[data-theme="violet"] ::-webkit-scrollbar-thumb:hover { background: rgba(124,58,237,0.5); }

/* Theme toggle */
[data-theme="violet"] .theme-toggle:hover {
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
  border-color: rgba(124,58,237,0.4);
}
[data-theme="orange"] .theme-toggle:hover {
  background: rgba(247,147,30,0.15);
  color: #FFB347;
  border-color: rgba(247,147,30,0.4);
}

/* Agenda topbar */
[data-theme="violet"] .apt-topbar {
  background: #13131f;
  border-bottom-color: rgba(255,255,255,0.07);
}
[data-theme="orange"] .apt-topbar {
  background: #0f0f0f;
  border-bottom-color: rgba(255,255,255,0.07);
}
[data-theme="violet"] .apt-nav-btn {
  background: #1a1b2e;
  border-color: rgba(255,255,255,0.1);
}
[data-theme="orange"] .apt-nav-btn {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.1);
}
[data-theme="violet"] .apt-nav-btn:hover {
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
}
[data-theme="orange"] .apt-nav-btn:hover {
  background: rgba(247,147,30,0.15);
  color: #FFB347;
}
[data-theme="violet"] .calendar-header-cell,
[data-theme="violet"] .calendar-day-header {
  background: #13131f;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="orange"] .calendar-header-cell,
[data-theme="orange"] .calendar-day-header {
  background: #0f0f0f;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="violet"] .calendar-time-label { color: rgba(255,255,255,0.3); }
[data-theme="orange"] .calendar-time-label { color: rgba(255,255,255,0.3); }
[data-theme="violet"] .calendar-slot { border-color: rgba(255,255,255,0.05); }
[data-theme="orange"] .calendar-slot { border-color: rgba(255,255,255,0.05); }

/* Fin commission card */
[data-theme="violet"] .fin-commission-card {
  background: #1a1b2e;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="orange"] .fin-commission-card {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="violet"] .fin-commission-card:hover { border-color: rgba(124,58,237,0.4); }
[data-theme="orange"] .fin-commission-card:hover { border-color: rgba(247,147,30,0.4); }
[data-theme="violet"] .fin-btn-pay-comm {
  background: #7c3aed;
  box-shadow: 0 2px 8px rgba(124,58,237,0.3);
}
[data-theme="orange"] .fin-btn-pay-comm {
  background: #F7931E;
  box-shadow: 0 2px 8px rgba(247,147,30,0.3);
}
[data-theme="violet"] .fin-btn-pay-comm:hover { background: #6d28d9; }
[data-theme="orange"] .fin-btn-pay-comm:hover { background: #E67E22; }

/* Avatar menu */
[data-theme="violet"] .avatar-menu {
  background: #22243a;
  border-color: rgba(255,255,255,0.1);
}
[data-theme="orange"] .avatar-menu {
  background: #20242a;
  border-color: rgba(255,255,255,0.1);
}
[data-theme="violet"] .avatar-menu-item:hover {
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
}
[data-theme="orange"] .avatar-menu-item:hover {
  background: rgba(247,147,30,0.15);
  color: #FFB347;
}

/* Form actions mobile */
[data-theme="violet"] .form-actions {
  background: #1a1b2e;
  border-top-color: rgba(255,255,255,0.07);
}
[data-theme="orange"] .form-actions {
  background: #1a1a1a;
  border-top-color: rgba(255,255,255,0.07);
}

/* ══════════════════════════════════════════════
   AGENDA FSW — Week Strip + Timeline
   Usada pelo admin (appointments.js) e
   pelo portal do barbeiro (portal.js)
══════════════════════════════════════════════ */

/* ── Week strip ── */
.week-strip {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 10px 16px 10px;
  scrollbar-width: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.week-strip::-webkit-scrollbar { display: none; }

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;
  gap: 5px;
  transition: background var(--transition), border-color var(--transition);
  border: 2px solid transparent;
  flex-shrink: 0;
  user-select: none;
}
.week-day:hover:not(.week-day--active) {
  background: var(--primary-dim2);
  border-color: var(--primary-dim);
}

/* Abreviação do dia — legível em todos os temas */
.wday-label {
  font-size: .63rem;
  font-weight: 700;
  color: var(--text-2);   /* text-2 em vez de text-3 para melhor contraste */
  text-transform: uppercase;
  letter-spacing: .05em;
  line-height: 1;
}
.wday-num {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

/* Hoje: anel da cor primary, sem fundo preenchido */
.week-day--today {
  border-color: var(--primary);
}
.week-day--today .wday-label,
.week-day--today .wday-num { color: var(--primary); }

/* Dia selecionado: fundo primário sólido */
.week-day--active {
  background: var(--primary);
  border-color: var(--primary);
}
.week-day--active .wday-label,
.week-day--active .wday-num { color: #fff; }

/* Hoje + Selecionado: texto escuro sobre amarelo (dark) */
[data-theme="dark"] .week-day--active .wday-label,
[data-theme="dark"] .week-day--active .wday-num { color: #121212; }
[data-theme="orange"] .week-day--active .wday-label,
[data-theme="orange"] .week-day--active .wday-num { color: #121212; }

/* Quando hoje E selecionado ao mesmo tempo: garante texto escuro (evita amarelo sobre amarelo) */
[data-theme="dark"] .week-day--today.week-day--active .wday-label,
[data-theme="dark"] .week-day--today.week-day--active .wday-num { color: #121212; }
[data-theme="orange"] .week-day--today.week-day--active .wday-label,
[data-theme="orange"] .week-day--today.week-day--active .wday-num { color: #121212; }

/* Texto legível nos temas escuros (dias não-ativos) */
[data-theme="dark"] .wday-label,
[data-theme="violet"] .wday-label,
[data-theme="orange"] .wday-label {
  color: rgba(255,255,255,0.55);
}
[data-theme="dark"] .wday-num,
[data-theme="violet"] .wday-num,
[data-theme="orange"] .wday-num {
  color: rgba(255,255,255,0.88);
}

/* Anel "hoje" nos temas escuros usa a cor primária com leve glow */
[data-theme="dark"] .week-day--today {
  border-color: #ffaf02;
  box-shadow: 0 0 0 1px rgba(255,175,2,.18);
}
[data-theme="orange"] .week-day--today {
  border-color: #F7931E;
  box-shadow: 0 0 0 1px rgba(247,147,30,.18);
}
[data-theme="dark"] .week-day--today .wday-label,
[data-theme="dark"] .week-day--today .wday-num { color: #ffaf02; }
[data-theme="orange"] .week-day--today .wday-label,
[data-theme="orange"] .week-day--today .wday-num { color: #F7931E; }

[data-theme="violet"] .week-day--today {
  border-color: #7c3aed;
  box-shadow: 0 0 0 1px rgba(124,58,237,.22);
}
[data-theme="violet"] .week-day--today .wday-label,
[data-theme="violet"] .week-day--today .wday-num { color: #a78bfa; }

/* Violet ativo: texto branco sobre roxo */
[data-theme="violet"] .week-day--active .wday-label,
[data-theme="violet"] .week-day--active .wday-num { color: #fff; }

/* Quando hoje E selecionado: garante branco (evita roxo claro sobre roxo) */
[data-theme="violet"] .week-day--today.week-day--active .wday-label,
[data-theme="violet"] .week-day--today.week-day--active .wday-num { color: #fff; }

/* ── Label da data selecionada ── */
.agenda-date-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
  padding: 8px 16px 4px;
  flex-shrink: 0;
  background: var(--surface);
  letter-spacing: .01em;
  text-transform: capitalize;
}

/* ── Timeline (container com scroll) ── */
.agenda-timeline-wrap {
  flex: 1;
  overflow-y: auto;
  padding: .6rem 1rem 5rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

/* ── Linha de agendamento (horário + card) ── */
.agenda-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: .5rem;
  align-items: flex-start;
}
.agenda-time {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-3);
  padding-top: .9rem;
  text-align: right;
  line-height: 1;
  flex-shrink: 0;
  letter-spacing: .01em;
}

/* ── Card de agendamento ── */
.appt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem .85rem;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: .5rem .65rem;
  align-items: center;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: var(--shadow-sm);
}
.appt-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px var(--primary-dim);
}
.appt-card--concluido { opacity: .65; }
.appt-card--cancelado { opacity: .5; }

/* Avatar circular 40px */
.appt-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-dim);
  color: var(--primary);
  font-size: .78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.appt-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Info central */
.appt-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.appt-service {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.appt-client {
  font-size: .76rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.appt-notes-hint {
  font-size: .68rem;
  color: var(--text-3);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Coluna direita (preço + badge) */
.appt-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.appt-price {
  font-size: .82rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

/* Badges de status */
.appt-badge {
  border-radius: 9999px;
  font-size: .65rem;
  font-weight: 700;
  padding: .18rem .55rem;
  white-space: nowrap;
  line-height: 1.4;
  letter-spacing: .02em;
}
.appt-badge--agendado {
  background: var(--primary-dim);
  color: var(--primary);
}
.appt-badge--concluido {
  background: rgba(34,197,94,.12);
  color: #16A34A;
}
.appt-badge--cancelado {
  background: rgba(239,68,68,.10);
  color: var(--red);
}
/* Dark: texto escuro sobre amarelo */
[data-theme="dark"] .appt-badge--agendado { color: #121212; background: rgba(255,175,2,.2); }
[data-theme="orange"] .appt-badge--agendado { color: #121212; background: rgba(247,147,30,.2); }

/* Tag de tipo (mensalista/pacote) */
.appt-type-tag {
  font-size: .58rem;
  font-weight: 700;
  padding: .1rem .35rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.5;
  flex-shrink: 0;
}
.appt-type-tag--mensalista { background: var(--primary-dim); color: var(--primary); }
.appt-type-tag--pacote     { background: rgba(245,158,11,.13); color: #92400E; }
[data-theme="dark"] .appt-type-tag--mensalista { color: #121212; }
[data-theme="orange"] .appt-type-tag--mensalista { color: #121212; }

/* ── State vazio ── */
.agenda-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--text-3);
  gap: .75rem;
  text-align: center;
}
.agenda-empty svg { opacity: .38; }
.agenda-empty-text {
  font-size: .88rem;
  color: var(--text-3);
}

/* ── Nav semana dentro da view de agenda admin (acima do week-strip) ── */
.apt-topbar-fsw {
  display: flex;
  align-items: center;
  padding: .7rem 1rem .55rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: .65rem;
  flex-shrink: 0;
}
.apt-topbar-fsw-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  flex: 1;
}
.apt-topbar-fsw-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.apt-week-nav-group {
  display: flex;
  align-items: center;
  gap: .3rem;
}
.apt-week-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.apt-week-nav-btn:hover { background: var(--primary-dim); color: var(--primary); }
.apt-btn-new {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9999px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}
.apt-btn-new:hover { background: var(--primary-hover); transform: translateY(-1px); }
[data-theme="dark"] .apt-btn-new { color: #121212; }
[data-theme="orange"] .apt-btn-new { color: #121212; }

/* Pills de filtro de barbeiro (mantidas no header FSW) */
.apt-barber-pills-fsw {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .55rem 1rem .45rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  align-items: center;
  /* Mobile: scroll horizontal para evitar quebra de linha */
  overflow-x: auto;
  scrollbar-width: none;
}
.apt-barber-pills-fsw::-webkit-scrollbar { display: none; }

/* ── Overrides dark/violet — topbar e superfícies ── */
[data-theme="dark"] .week-strip,
[data-theme="dark"] .agenda-date-label,
[data-theme="dark"] .apt-topbar-fsw,
[data-theme="dark"] .apt-barber-pills-fsw,
[data-theme="violet"] .week-strip,
[data-theme="violet"] .agenda-date-label,
[data-theme="violet"] .apt-topbar-fsw,
[data-theme="violet"] .apt-barber-pills-fsw,
[data-theme="orange"] .week-strip,
[data-theme="orange"] .agenda-date-label,
[data-theme="orange"] .apt-topbar-fsw,
[data-theme="orange"] .apt-barber-pills-fsw {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .appt-card,
[data-theme="orange"] .appt-card {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .appt-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 14px rgba(255,175,2,.12);
}
[data-theme="orange"] .appt-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 14px rgba(247,147,30,.12);
}

/* ── Pills de barbeiro nos temas escuros ──
   O JS injeta style="border-color:X;color:X" (inactive) e style="background:X;border-color:X" (active).
   Nos temas escuros as cores do mapa BARBER_COLORS incluem tons escuros (ex: #1B3A6B)
   que ficam ilegíveis. Sobrescrevemos com !important apenas border/color do inactive. */

[data-theme="dark"] .barber-pill.inactive,
[data-theme="violet"] .barber-pill.inactive,
[data-theme="orange"] .barber-pill.inactive {
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.2) !important;
  color: rgba(255,255,255,.75) !important;
  opacity: 1;
}
/* O pill-dot mantém a cor do barbeiro (injetada via style inline — não sobrescrevemos) */

/* Pill ativo nos temas escuros: texto sempre legível sobre qualquer cor de barbeiro */
[data-theme="dark"] .barber-pill.active,
[data-theme="violet"] .barber-pill.active,
[data-theme="orange"] .barber-pill.active {
  color: #fff !important;
  box-shadow: 0 1px 8px rgba(0,0,0,.4);
}
/* Correção pontual: cor azul marinho (#1B3A6B) ativo no dark fica quase invisível.
   O texto branco já resolve; o background fica como identificador visual do barbeiro. */
[data-theme="dark"] .barber-pill.active .pill-dot,
[data-theme="violet"] .barber-pill.active .pill-dot,
[data-theme="orange"] .barber-pill.active .pill-dot {
  background: rgba(255,255,255,.9) !important;
}

[data-theme="violet"] .appt-badge--agendado {
  background: rgba(124,58,237,.15);
  color: #a78bfa;
}
[data-theme="violet"] .appt-card:hover {
  border-color: #7c3aed;
  box-shadow: 0 2px 12px rgba(124,58,237,.12);
}

/* ── A grade semanal antiga (.apt-topbar + .apt-calendar-scroll) é ocultada
   em favor do novo layout FSW — em todas as telas ── */
#view-appointments > .apt-topbar,
#view-appointments > .apt-calendar-scroll {
  display: none !important;
}

/* ── Responsividade do layout FSW ── */
@media (max-width: 599px) {
  /* Pills: nowrap + scroll horizontal em mobile */
  .apt-barber-pills-fsw {
    flex-wrap: nowrap;
    padding: .45rem .75rem .35rem;
  }

  .week-strip { padding: 8px 10px 8px; gap: 3px; }
  .week-day { min-width: 40px; padding: 7px 4px; border-radius: 10px; }
  .wday-num { font-size: .98rem; }

  .agenda-timeline-wrap { padding: .5rem .75rem 5rem; }
  .agenda-row { grid-template-columns: 40px 1fr; gap: .4rem; }

  .appt-card { grid-template-columns: 36px 1fr auto; padding: .65rem .75rem; }
  .appt-avatar { width: 36px; height: 36px; font-size: .72rem; }
}
@media (max-width: 480px) {
  .appt-right { gap: 4px; }
  .appt-price { font-size: .78rem; }
  .appt-badge { font-size: .62rem; padding: .15rem .45rem; }
}

/* ══════════════════════════════════════════════
   BARBER CARD — versão compacta (clicável)
══════════════════════════════════════════════ */
.barber-card-compact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition),
              box-shadow var(--transition);
  min-width: 0;
  user-select: none;
}
.barber-card-compact:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--primary-dim);
}
.barber-card-compact:active {
  transform: translateY(0);
}

/* Avatar circular 64px */
.barber-card-compact__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-dim);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
  text-transform: uppercase;
  overflow: hidden;
}
.barber-card-compact__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.barber-card-compact__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.barber-card-compact__name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.barber-card-compact__spec {
  font-size: .78rem;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.barber-card-compact__foot {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  margin-top: .1rem;
}
.barber-card-compact__badge {
  display: inline-flex;
  align-items: center;
  background: var(--primary-dim);
  color: var(--primary);
  border: 1px solid var(--primary-dim);
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .6rem;
  white-space: nowrap;
}
.barber-card-compact__rating {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .78rem;
  font-weight: 600;
  color: #eab308;
}
.barber-card-compact__arrow {
  flex-shrink: 0;
  color: var(--text-3);
  transition: color var(--transition), transform var(--transition);
}
.barber-card-compact:hover .barber-card-compact__arrow {
  color: var(--primary);
  transform: translateX(2px);
}

/* Inactive */
.barber-card-compact--inactive {
  opacity: .55;
}
.barber-card-compact--inactive .barber-card-compact__avatar {
  background: var(--surface-2);
  color: var(--text-3);
  border-color: var(--border-2);
}

/* Overrides dark/violet para card compacto */
[data-theme="dark"] .barber-card-compact__avatar {
  background: rgba(255,175,2,0.15);
  border-color: #ffaf02;
  color: #ffaf02;
}
[data-theme="orange"] .barber-card-compact__avatar {
  background: rgba(247,147,30,0.15);
  border-color: #F7931E;
  color: #F7931E;
}
[data-theme="dark"] .barber-card-compact:hover {
  border-color: rgba(255,175,2,0.5);
  box-shadow: 0 4px 20px rgba(255,175,2,0.12);
}
[data-theme="orange"] .barber-card-compact:hover {
  border-color: rgba(247,147,30,0.5);
  box-shadow: 0 4px 20px rgba(247,147,30,0.12);
}
[data-theme="violet"] .barber-card-compact__avatar {
  background: rgba(124,58,237,0.2);
  border-color: #7c3aed;
  color: #a78bfa;
}
[data-theme="violet"] .barber-card-compact {
  background: #1a1b2e;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="orange"] .barber-card-compact {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.07);
}
[data-theme="violet"] .barber-card-compact:hover {
  border-color: rgba(124,58,237,0.45);
  box-shadow: 0 4px 20px rgba(124,58,237,0.15);
}

/* ══════════════════════════════════════════════
   BARBER DETAIL DRAWER
══════════════════════════════════════════════ */

/* Overlay */
.barber-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.barber-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Painel drawer */
.barber-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 400px;
  max-width: 100vw;
  background: var(--surface);
  box-shadow: -4px 0 32px rgba(0,0,0,.25);
  z-index: 501;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.barber-drawer.open {
  transform: translateX(0);
}

/* Mobile: bottom-sheet */
@media (max-width: 768px) {
  .barber-drawer {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 92vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  .barber-drawer.open {
    transform: translateY(0);
  }
}

/* ── Hero — banner da empresa ── */
.barber-drawer-hero {
  position: relative;
  height: 160px;
  flex-shrink: 0;
  overflow: visible;
  background: var(--primary);
}
/* Capa da empresa como background do hero */
.barber-drawer-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
}
/* Gradiente escuro na metade inferior para legibilidade dos controles */
.barber-drawer-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(0,0,0,.25) 0%, rgba(0,0,0,.55) 100%);
  opacity: 1;
}
/* Fade sutil na borda inferior para suavizar a transição com o body */
.barber-drawer-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  z-index: 2;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,.18));
  pointer-events: none;
}
.barber-drawer-hero__controls {
  position: absolute;
  top: .85rem;
  left: .85rem;
  right: .85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
}
.barber-drawer-hero__btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background var(--transition);
  flex-shrink: 0;
}
.barber-drawer-hero__btn:hover {
  background: rgba(0,0,0,.6);
}

/* ── Conteúdo scrollável ── */
.barber-drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Identidade (nome + spec + rating — avatar está no hero) ── */
.barber-drawer-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: 52px 1.25rem 0;
  position: relative;
  z-index: 4;
}
.barber-drawer-identity__avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--primary-dim);
  border: 3px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
  text-transform: uppercase;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,.35);
  /* ancorado no rodapé do hero, centralizado, sobressai para o body */
  position: absolute;
  bottom: -45px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
}
.barber-drawer-identity__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.barber-drawer-identity__name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
}
.barber-drawer-identity__row {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  justify-content: center;
}
.barber-drawer-identity__spec {
  display: inline-flex;
  align-items: center;
  background: var(--primary-dim);
  color: var(--primary);
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .7rem;
}
.barber-drawer-identity__rating {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .82rem;
  font-weight: 700;
  color: #eab308;
}

/* ── 4 Action Buttons ── */
.barber-drawer-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
  padding: 1rem 1.25rem .25rem;
}
.barber-drawer-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: .7rem .4rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-2);
  font-size: .68rem;
  font-weight: 600;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), transform var(--transition);
  text-decoration: none;
  font-family: "Montserrat", inherit;
  text-align: center;
  line-height: 1.2;
}
.barber-drawer-action:hover {
  background: var(--primary-dim);
  border-color: var(--primary-dim);
  color: var(--primary);
  transform: translateY(-2px);
}
.barber-drawer-action--whatsapp:hover {
  background: rgba(37,211,102,.1);
  border-color: rgba(37,211,102,.3);
  color: #25D366;
}
.barber-drawer-action--call:hover {
  background: rgba(59,130,246,.1);
  border-color: rgba(59,130,246,.3);
  color: #3b82f6;
}

/* ── Seção de informações ── */
.barber-drawer-section {
  padding: 1rem 1.25rem 0;
}
.barber-drawer-section__title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  margin-bottom: .65rem;
}
.barber-drawer-info-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.barber-drawer-info-row {
  display: flex;
  align-items: center;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: .75rem;
}
.barber-drawer-info-row:last-child {
  border-bottom: none;
}
.barber-drawer-info-row--link:hover {
  background: var(--primary-dim2);
}
.barber-drawer-copy-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.barber-drawer-copy-link-btn:hover {
  background: var(--primary-dim2);
  color: var(--primary);
  border-color: var(--primary);
}
.barber-drawer-info-row__icon {
  flex-shrink: 0;
  color: var(--text-3);
  display: flex;
  align-items: center;
}
.barber-drawer-info-row__label {
  flex: 0 0 90px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-3);
}
.barber-drawer-info-row__value {
  flex: 1;
  font-size: .88rem;
  color: var(--text);
  min-width: 0;
  word-break: break-word;
}

/* ── Seção histórico de serviços ── */
.barber-drawer-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .65rem;
}
.barber-drawer-history-header__title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
}
.barber-drawer-history-header__link {
  font-size: .75rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}
.barber-drawer-history-header__link:hover {
  text-decoration: underline;
}

.barber-drawer-history-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding-bottom: 2rem;
}
.barber-drawer-history-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.barber-drawer-history-item__info {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}
.barber-drawer-history-item__service {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.barber-drawer-history-item__meta {
  font-size: .75rem;
  color: var(--text-3);
}
.barber-drawer-history-item__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .25rem;
  flex-shrink: 0;
}
.barber-drawer-history-item__price {
  font-size: .9rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.01em;
}

/* Badge de status do histórico */
.bdh-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .5rem;
  letter-spacing: .02em;
}
.bdh-badge--agendado {
  background: var(--primary-dim);
  color: var(--primary);
}
.bdh-badge--concluido {
  background: rgba(34,197,94,.12);
  color: #16A34A;
}
.bdh-badge--cancelado {
  background: rgba(239,68,68,.10);
  color: var(--red);
}

/* Overrides dark/violet para o drawer */
[data-theme="dark"] .barber-drawer {
  background: #181b20;
}
[data-theme="orange"] .barber-drawer {
  background: #1a1a1a;
}
[data-theme="dark"] .barber-drawer-hero {
  background: #20242a;
}
[data-theme="orange"] .barber-drawer-hero {
  background: #20242a;
}
[data-theme="dark"] .barber-drawer-identity__avatar {
  background: rgba(255,175,2,0.2);
  border-color: #181b20;
  color: #ffaf02;
}
[data-theme="orange"] .barber-drawer-identity__avatar {
  background: rgba(247,147,30,0.2);
  border-color: #1a1a1a;
  color: #F7931E;
}
[data-theme="dark"] .barber-drawer-info-list {
  background: #20242a;
  border-color: rgba(255,255,255,0.08);
}
[data-theme="orange"] .barber-drawer-info-list {
  background: #20242a;
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .barber-drawer-info-row {
  border-bottom-color: rgba(255,255,255,0.06);
}
[data-theme="orange"] .barber-drawer-info-row {
  border-bottom-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .barber-drawer-history-item {
  background: #20242a;
  border-color: rgba(255,255,255,0.08);
}
[data-theme="orange"] .barber-drawer-history-item {
  background: #20242a;
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .barber-drawer-action {
  background: #20242a;
  border-color: rgba(255,255,255,0.08);
}
[data-theme="orange"] .barber-drawer-action {
  background: #20242a;
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .bdh-badge--agendado { color: #121212; background: rgba(255,175,2,.2); }
[data-theme="orange"] .bdh-badge--agendado { color: #121212; background: rgba(247,147,30,.2); }

[data-theme="violet"] .barber-drawer {
  background: #1a1b2e;
}
[data-theme="violet"] .barber-drawer-hero {
  background: #22243a;
}
[data-theme="violet"] .barber-drawer-identity__avatar {
  background: rgba(124,58,237,0.25);
  border-color: #1a1b2e;
  color: #a78bfa;
}
[data-theme="violet"] .barber-drawer-info-list {
  background: #22243a;
  border-color: rgba(255,255,255,0.08);
}
[data-theme="violet"] .barber-drawer-info-row {
  border-bottom-color: rgba(255,255,255,0.06);
}
[data-theme="violet"] .barber-drawer-history-item {
  background: #22243a;
  border-color: rgba(255,255,255,0.08);
}
[data-theme="violet"] .barber-drawer-action {
  background: #22243a;
  border-color: rgba(255,255,255,0.08);
}
[data-theme="violet"] .barber-drawer-action:hover {
  background: rgba(124,58,237,0.15);
  border-color: rgba(124,58,237,0.3);
  color: #a78bfa;
}
[data-theme="orange"] .barber-drawer-action:hover {
  background: rgba(247,147,30,0.15);
  border-color: rgba(247,147,30,0.3);
  color: #FFB347;
}
[data-theme="violet"] .barber-drawer-identity__spec {
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
}
[data-theme="orange"] .barber-drawer-identity__spec {
  background: rgba(247,147,30,0.15);
  color: #FFB347;
}
[data-theme="violet"] .bdh-badge--agendado {
  background: rgba(124,58,237,.15);
  color: #a78bfa;
}

/* ══════════════════════════════════════════════
   REDESIGN SIDEBAR — header com logo + tagline
   + perfil rodapé com indicador Online
══════════════════════════════════════════════ */

/* Brand text abaixo do ícone */
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: .05rem;
  min-width: 0;
}
.sidebar-brand-tagline {
  font-size: .6rem;
  font-weight: 500;
  color: var(--sidebar-text-muted, var(--text-3));
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Rodapé do sidebar — perfil do usuário */
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1rem .85rem 1.1rem;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}
.sidebar-profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 800;
  flex-shrink: 0;
  text-transform: uppercase;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--primary-dim);
}
.sidebar-profile-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.sidebar-profile-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.sidebar-profile-name {
  font-size: .83rem;
  font-weight: 700;
  color: var(--sidebar-text, var(--text));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.sidebar-profile-role {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .68rem;
  color: var(--sidebar-text-muted, var(--text-3));
  font-weight: 500;
}
.sidebar-online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22C55E;
  flex-shrink: 0;
  box-shadow: 0 0 0 1.5px rgba(34,197,94,.25);
}
.sidebar-profile-logout {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sidebar-text-muted, var(--text-3));
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.sidebar-profile-logout:hover {
  background: rgba(239,68,68,.1);
  color: var(--red);
  border-color: rgba(239,68,68,.3);
}

/* Dark: avatar primário usa cor escura no texto */
[data-theme="dark"] .sidebar-profile-avatar {
  color: #121212;
}
[data-theme="orange"] .sidebar-profile-avatar {
  color: #121212;
}
/* Violet: anel roxo */
[data-theme="violet"] .sidebar-profile-avatar {
  background: #7c3aed;
  color: #fff;
}

/* Sidebar divider no dark/violet sem margem lateral */
[data-theme="dark"] .sidebar-profile,
[data-theme="violet"] .sidebar-profile,
[data-theme="orange"] .sidebar-profile {
  border-top-color: rgba(255,255,255,0.07);
}

/* ══════════════════════════════════════════════
   REDESIGN AGENDA — topbar FSW aprimorado
   Título grande + subtítulo de data
══════════════════════════════════════════════ */

/* Sobrescreve o topbar FSW para o novo layout em 2 linhas */
.apt-topbar-fsw {
  flex-wrap: wrap;
  padding: .85rem 1.25rem .65rem;
  gap: .5rem .75rem;
}

/* Grupo esquerdo: título + subtítulo de data */
.apt-topbar-fsw-left {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  flex: 1;
  min-width: 0;
}
.apt-topbar-fsw-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.025em;
  line-height: 1.15;
  flex: none;   /* neutraliza o flex:1 da definição original */
}
.apt-topbar-fsw-subtitle {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-2);
  text-transform: capitalize;
  letter-spacing: .01em;
}

/* Grupo direito: sino + botão hoje + botão novo */
.apt-topbar-fsw-right {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-shrink: 0;
}

/* Botão Hoje — outline */
.apt-btn-today {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .42rem .9rem;
  background: transparent;
  color: var(--text-2);
  border: 1.5px solid var(--border-2);
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  white-space: nowrap;
}
.apt-btn-today:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-dim2);
}

/* Botão sino de notificação */
.apt-btn-notif {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.apt-btn-notif:hover { background: var(--primary-dim); color: var(--primary); }
.apt-notif-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  background: #EF4444;
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}

/* Botão + Novo agendamento — redefinição para coexistir com o novo layout */
.apt-btn-new {
  padding: .42rem 1rem;
  font-size: .78rem;
  border-radius: 8px;
}
[data-theme="dark"] .apt-btn-new,
[data-theme="orange"] .apt-btn-new {
  border-radius: 9999px;
}

/* Nav de semana: ocupa linha própria no mobile, fica inline no desktop */
.apt-topbar-fsw-nav {
  display: flex;
  align-items: center;
  gap: .3rem;
  order: 3;         /* mobile: terceiro item → segunda linha */
  width: 100%;
}
@media (min-width: 600px) {
  .apt-topbar-fsw {
    align-items: center;
  }
  .apt-topbar-fsw-left {
    flex: 1;
  }
  .apt-topbar-fsw-nav {
    width: auto;
    order: 2;       /* desktop: fica entre left e right */
    flex-shrink: 0;
  }
  .apt-topbar-fsw-right {
    order: 3;
    flex-shrink: 0;
  }
}

/* Card de agendamento: borda colorida esquerda como detalhe visual */
.appt-card {
  border-left: 3px solid var(--border);
}
.appt-card--agendado  { border-left-color: var(--primary); }
.appt-card--concluido { border-left-color: var(--green); }
.appt-card--cancelado { border-left-color: var(--red); }

/* Duração no card de agendamento */
.appt-duration {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .65rem;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
}

/* Overrides temáticos para novos elementos */
[data-theme="dark"] .apt-btn-today,
[data-theme="orange"] .apt-btn-today {
  border-radius: 9999px;
}
[data-theme="dark"] .apt-btn-notif {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="orange"] .apt-btn-notif {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .apt-notif-badge {
  border-color: #181b20;
}
[data-theme="orange"] .apt-notif-badge {
  border-color: #1a1a1a;
}
[data-theme="violet"] .apt-btn-today {
  border-color: rgba(255,255,255,0.15);
}
[data-theme="violet"] .apt-btn-today:hover {
  background: rgba(124,58,237,0.1);
  border-color: #7c3aed;
  color: #a78bfa;
}
[data-theme="orange"] .apt-btn-today:hover {
  background: rgba(247,147,30,0.1);
  border-color: #F7931E;
  color: #FFB347;
}
[data-theme="violet"] .apt-btn-notif {
  background: #20222e;
  border-color: rgba(255,255,255,0.1);
}

/* Week nav botões — ajuste de radius no dark */
[data-theme="dark"] .apt-week-nav-btn,
[data-theme="orange"] .apt-week-nav-btn {
  border-radius: 50%;
}

@media (max-width: 599px) {
  .apt-topbar-fsw {
    padding: .65rem .85rem .5rem;
    gap: .4rem .5rem;
  }
  .apt-topbar-fsw-title {
    font-size: 1.25rem;
  }
  .apt-topbar-fsw-right {
    gap: .35rem;
  }
  .apt-btn-today {
    display: none; /* oculta "Ver hoje" no mobile pequeno — usa week strip */
  }
}

/* ══════════════════════════════════════════════════════════
   AGENDA — LAYOUT 2 COLUNAS (main + sidebar direita)
══════════════════════════════════════════════════════════ */

/* Body em 2 colunas — ocupa o restante do espaço vertical da view */
.apt-fsw-body {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  gap: 0;
  overflow: hidden;
  /* neutraliza qualquer overflow da agenda-timeline-wrap ancestral */
}

/* Coluna principal (timeline) — override de .agenda-timeline-wrap dentro do body 2-col */
.apt-fsw-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: .6rem 1rem 5rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  -webkit-overflow-scrolling: touch;
  /* neutraliza flex: 1 da regra .agenda-timeline-wrap se aplicada sozinha */
}
/* Quando usada dentro do body em 2 colunas, garante que não quebre o flex */
.apt-fsw-body .apt-fsw-main {
  flex: 1;
  min-height: 0;
}

/* Coluna sidebar direita */
.apt-fsw-sidebar {
  width: 260px;
  min-width: 200px;
  max-width: 260px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: .75rem .75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  background: var(--bg);
  border-left: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

/* Card da sidebar */
.apt-sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem .85rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Título de seção da sidebar */
.apt-sidebar-section-title {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  margin-bottom: .75rem;
}

/* ── Mini calendário ── */
.apt-sidebar-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .65rem;
}
.apt-sidebar-cal-month {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  text-transform: capitalize;
  letter-spacing: .01em;
}
.apt-cal-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1.5px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.apt-cal-nav-btn:hover { background: var(--primary-dim); color: var(--primary); }

/* Grid do mini calendário: 7 colunas */
.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.mini-cal-hdr {
  font-size: .6rem;
  font-weight: 700;
  color: var(--text-3);
  text-align: center;
  padding: 2px 0 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.mini-cal-cell {
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-2);
  text-align: center;
  padding: 4px 2px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  line-height: 1.4;
  position: relative;
}
.mini-cal-cell:hover:not(.mini-cal-cell--selected):not(.mini-cal-cell--empty) {
  background: var(--primary-dim2);
  color: var(--primary);
}
.mini-cal-cell--empty { pointer-events: none; }
.mini-cal-cell--today {
  color: var(--primary);
  font-weight: 700;
}
.mini-cal-cell--selected {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: default;
}
.mini-cal-cell--has-apts::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}
[data-theme="dark"] .mini-cal-cell--selected { color: #121212; }
[data-theme="orange"] .mini-cal-cell--selected { color: #121212; }
[data-theme="dark"] .mini-cal-cell--today { color: #ffaf02; }
[data-theme="orange"] .mini-cal-cell--today { color: #F7931E; }
[data-theme="dark"] .mini-cal-cell--has-apts::after { background: #ffaf02; }
[data-theme="orange"] .mini-cal-cell--has-apts::after { background: #F7931E; }
[data-theme="violet"] .mini-cal-cell--today { color: #a78bfa; }

/* ── Resumo do dia (grid 2x2 de KPIs) ── */
.apt-day-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
}
.apt-kpi-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .55rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
  overflow: hidden;
}
.apt-kpi-value {
  font-size: .95rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.apt-kpi-value--green { color: #16A34A; }
.apt-kpi-value--red   { color: var(--red); }
.apt-kpi-label {
  font-size: .58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-theme="dark"] .apt-kpi-value { color: #fff; }
[data-theme="orange"] .apt-kpi-value { color: #fff; }
[data-theme="dark"] .apt-kpi-card,
[data-theme="orange"] .apt-kpi-card {
  background: var(--surface-2);
  border-color: var(--border);
}

/* ── Legenda ── */
.apt-legend {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.apt-legend-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .78rem;
  color: var(--text-2);
}
.apt-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.apt-legend-label {
  font-size: .78rem;
  color: var(--text-2);
  font-weight: 500;
}

/* ── Dark/Violet overrides para sidebar ── */
[data-theme="dark"] .apt-fsw-sidebar {
  background: #121212;
  border-left-color: rgba(255,255,255,0.07);
}
[data-theme="orange"] .apt-fsw-sidebar {
  background: #121212;
  border-left-color: rgba(255,255,255,0.07);
}
[data-theme="dark"] .apt-sidebar-card {
  background: #181b20;
  border-color: rgba(255,255,255,0.08);
}
[data-theme="orange"] .apt-sidebar-card {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.08);
}
[data-theme="violet"] .apt-fsw-sidebar {
  background: #0f0f1a;
  border-left-color: rgba(255,255,255,0.07);
}
[data-theme="violet"] .apt-sidebar-card {
  background: #1a1b2e;
  border-color: rgba(255,255,255,0.08);
}

/* ── Week strip: contador de agendamentos no dia ── */
.wday-count {
  font-size: .58rem;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  border-radius: 99px;
  min-width: 16px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  margin-top: 1px;
}
.wday-count--empty {
  background: transparent;
  min-width: 16px;
  height: 14px;
}
[data-theme="dark"] .wday-count { color: #121212; }
[data-theme="orange"] .wday-count { color: #121212; }
.week-day--active .wday-count {
  background: rgba(255,255,255,0.3);
  color: #fff;
}

/* ── View switcher Dia | Semana | Mês ── */
.apt-view-switcher {
  display: flex;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.apt-view-btn {
  padding: .3rem .7rem;
  background: var(--surface-2);
  border: none;
  color: var(--text-3);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  border-right: 1px solid var(--border-2);
}
.apt-view-btn:last-child { border-right: none; }
.apt-view-btn:hover { background: var(--primary-dim2); color: var(--text); }
.apt-view-btn--active {
  background: var(--primary);
  color: #fff;
}
[data-theme="dark"] .apt-view-btn--active { color: #121212; }
[data-theme="orange"] .apt-view-btn--active { color: #121212; }

/* ── Card de agendamento aprimorado ── */

/* Barra colorida já via border-left inline + classe base */
.appt-card {
  border-left-width: 4px;
}

/* Linha de tipo de atendimento */
.appt-type-row {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* Badge de tipo (AVULSO / PACOTE / MENSALISTA) */
.appt-type-badge {
  border-radius: 4px;
  font-size: .58rem;
  font-weight: 700;
  padding: .12rem .4rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  line-height: 1.4;
  flex-shrink: 0;
}
.appt-type-badge--avulso    { background: rgba(239,68,68,.12);  color: var(--red); }
.appt-type-badge--pacote    { background: rgba(34,197,94,.12);  color: #16A34A; }
.appt-type-badge--mensalista{ background: rgba(249,115,22,.12); color: #C2410C; }
.appt-type-badge--fixo      { background: rgba(59,130,246,.12); color: #2563EB; }

/* Cortes restantes (pacote) */
.appt-pkg-remaining {
  font-size: .62rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}
[data-theme="dark"] .appt-pkg-remaining { color: #ffaf02; }
[data-theme="orange"] .appt-pkg-remaining { color: #F7931E; }

/* Telefone */
.appt-phone {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .68rem;
  color: var(--text-3);
  white-space: nowrap;
  margin-top: 1px;
}

/* Nome do barbeiro */
.appt-barber-name {
  font-size: .72rem;
  font-weight: 600;
  display: block;
  margin-top: 1px;
}

/* Preço com destaque */
.appt-price {
  font-size: .84rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  letter-spacing: -.01em;
}
[data-theme="dark"] .appt-price { color: #ffaf02; }
[data-theme="orange"] .appt-price { color: #F7931E; }

/* ── Responsividade: sidebar adapta largura em telas intermediárias ── */
@media (max-width: 1100px) {
  .apt-fsw-sidebar { width: 220px; min-width: 180px; max-width: 220px; }
}
@media (max-width: 920px) {
  .apt-fsw-sidebar { width: 190px; min-width: 160px; max-width: 190px; }
  .apt-sidebar-card { padding: .75rem; }
}

/* ── Responsividade: sidebar vai para baixo no mobile ── */
@media (max-width: 768px) {
  .apt-fsw-body {
    flex-direction: column;
    overflow: auto;
  }
  .apt-fsw-main {
    overflow-y: visible;
    padding-bottom: 1rem;
  }
  .apt-fsw-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border-left: none;
    border-top: 1px solid var(--border);
    padding: .75rem .75rem 1.5rem;
  }
  .apt-day-summary {
    grid-template-columns: repeat(4, 1fr);
  }
  .apt-kpi-value { font-size: .9rem; }
}
@media (max-width: 520px) {
  .apt-day-summary { grid-template-columns: 1fr 1fr; }
}

/* ── Nav item badge "Em breve" ── */
.nav-badge {
  font-size: .58rem;
  font-weight: 700;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: .08rem .45rem;
  white-space: nowrap;
  flex-shrink: 0;
}
[data-theme="dark"] .nav-item--soon,
[data-theme="orange"] .nav-item--soon {
  opacity: .5;
}
[data-theme="violet"] .nav-item--soon {
  opacity: .5;
}

/* ══════════════════════════════════════════════════════
   WIZARD — NOVO AGENDAMENTO (3 steps)
══════════════════════════════════════════════════════ */

/* Overlay full-screen */
.wiz-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 600px) {
  .wiz-overlay { align-items: center; }
}

/* Painel do wizard */
.wiz-panel {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -4px 40px rgba(0,0,0,.18);
}
@media (min-width: 600px) {
  .wiz-panel {
    border-radius: 20px;
    max-height: 90vh;
  }
}

/* Header */
.wiz-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.1rem 1.25rem .85rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.wiz-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  transition: background var(--transition), color var(--transition);
  font-family: inherit;
  flex-shrink: 0;
}
.wiz-back-btn:hover { background: var(--primary-dim); color: var(--primary); }
.wiz-header-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.wiz-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 1.3rem;
  line-height: 1;
  padding: .1rem .3rem;
  border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
  font-family: inherit;
}
.wiz-close-btn:hover { color: var(--text); background: var(--primary-dim2); }

/* Step indicators */
.wiz-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .9rem 1.25rem .75rem;
  gap: 0;
  flex-shrink: 0;
}
.wiz-step-item {
  display: flex;
  align-items: center;
}
.wiz-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.wiz-step-circle--active {
  background: var(--primary);
  color: #fff;
}
.wiz-step-circle--done {
  background: var(--primary-dim);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.wiz-step-circle--pending {
  background: var(--surface-2);
  color: var(--text-3);
  border: 1.5px solid var(--border);
}
.wiz-step-label {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-3);
  margin-top: .2rem;
  white-space: nowrap;
}
.wiz-step-label--active { color: var(--primary); }
.wiz-step-label--done   { color: var(--text-2); }
.wiz-step-connector {
  flex: 1;
  height: 2px;
  min-width: 24px;
  max-width: 56px;
  background: var(--border);
  margin: 0 .3rem;
  border-radius: 1px;
  transition: background var(--transition);
}
.wiz-step-connector--done { background: var(--primary); }

/* Wrapper com label + círculo empilhados */
.wiz-step-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
}

/* Conteúdo scrollável */
.wiz-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

/* Seção dentro do step */
.wiz-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.wiz-section-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1rem .6rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.wiz-section-icon {
  color: var(--primary);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.wiz-section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-2);
}
.wiz-section-body {
  padding: .85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

/* Toggle avulso/cadastrado */
.wiz-type-tabs {
  display: flex;
  gap: .35rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: .3rem;
}
.wiz-type-tab {
  flex: 1;
  padding: .5rem .75rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.wiz-type-tab--active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.wiz-type-tab:hover:not(.wiz-type-tab--active) { color: var(--text); }

/* Campo do wizard */
.wiz-field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.wiz-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .02em;
}
.wiz-input {
  width: 100%;
  padding: .58rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: .875rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.wiz-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.wiz-input::placeholder { color: var(--text-3); }

/* Painel de plano do cliente (pacote/mensalista) — wizard step 1 */
.wiz-client-plan {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .65rem .75rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.wiz-client-plan-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
}
.wiz-client-plan-hint {
  font-size: .72rem;
  color: var(--text-3);
}
.wiz-client-plan-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.wiz-client-plan-empty {
  font-size: .78rem;
  color: var(--text-3);
  margin: 0;
}

/* Lista de serviços */
.wiz-service-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.wiz-service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface);
  transition: border-color var(--transition), background var(--transition);
  gap: .5rem;
}
.wiz-service-item:hover { border-color: var(--primary); background: var(--primary-dim2); }
.wiz-service-item--selected {
  border-color: var(--primary);
  background: var(--primary-dim);
}
.wiz-service-name {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.wiz-service-price {
  font-size: .82rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.wiz-service-check {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}
.wiz-service-item--selected .wiz-service-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Grade de slots de horário */
.wiz-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .4rem;
}
@media (max-width: 380px) {
  .wiz-slots-grid { grid-template-columns: repeat(3, 1fr); }
}
.wiz-slot {
  padding: .5rem .25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  font-family: inherit;
}
.wiz-slot:hover:not(.wiz-slot--busy) { border-color: var(--primary); color: var(--primary); background: var(--primary-dim2); }
.wiz-slot--selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.wiz-slot--busy {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-3);
  cursor: not-allowed;
  text-decoration: line-through;
  opacity: .55;
}

/* Step 3 — Resumo */
.wiz-summary-row {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--border);
}
.wiz-summary-row:last-child { border-bottom: none; padding-bottom: 0; }
.wiz-summary-row:first-child { padding-top: 0; }
.wiz-summary-icon {
  color: var(--primary);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-top: .1rem;
}
.wiz-summary-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .1rem;
}
.wiz-summary-value {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
}
.wiz-summary-sub {
  font-size: .78rem;
  color: var(--text-2);
  margin-top: .1rem;
}

/* Badge tipo cliente no resumo */
.wiz-badge {
  display: inline-flex;
  align-items: center;
  padding: .18rem .6rem;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-left: .4rem;
}
.wiz-badge--avulso   { background: rgba(239,68,68,.1);  color: var(--red); }
.wiz-badge--cadastrado { background: var(--primary-dim); color: var(--primary); }
.wiz-badge--pacote   { background: rgba(34,197,94,.1);  color: #16A34A; }

/* Rodapé com botões de navegação */
.wiz-footer {
  display: flex;
  gap: .65rem;
  padding: .85rem 1.25rem 1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}
.wiz-btn-next {
  flex: 1;
  padding: .8rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  font-family: inherit;
  letter-spacing: .01em;
}
.wiz-btn-next:hover:not(:disabled) { background: var(--primary-hover); }
.wiz-btn-next:active { transform: scale(.98); }
.wiz-btn-next:disabled { opacity: .5; cursor: not-allowed; }
.wiz-btn-prev {
  padding: .8rem 1.1rem;
  background: transparent;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.wiz-btn-prev:hover { background: var(--primary-dim2); color: var(--text); border-color: var(--border-2); }

/* Hint de erro inline */
.wiz-error-hint {
  font-size: .75rem;
  color: var(--red);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .3rem;
}

/* Estado vazio serviços */
.wiz-empty-services {
  text-align: center;
  color: var(--text-3);
  font-size: .82rem;
  padding: 1rem 0;
}

/* Loading dots no slot */
.wiz-slots-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-3);
  font-size: .82rem;
  padding: .75rem 0;
}

/* Dark theme overrides para o wizard */
[data-theme="dark"] .wiz-panel,
[data-theme="orange"] .wiz-panel { background: var(--surface); }
[data-theme="dark"] .wiz-section,
[data-theme="orange"] .wiz-section { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .wiz-section-header { background: var(--card-dark, #20242a); }
[data-theme="orange"] .wiz-section-header { background: var(--card-dark, #20242a); }
[data-theme="dark"] .wiz-input,
[data-theme="orange"] .wiz-input { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .wiz-service-item,
[data-theme="orange"] .wiz-service-item { background: var(--surface-2); }
[data-theme="dark"] .wiz-service-item--selected,
[data-theme="orange"] .wiz-service-item--selected { background: var(--primary-dim); }
[data-theme="dark"] .wiz-slot,
[data-theme="orange"] .wiz-slot { background: var(--surface-2); }
[data-theme="dark"] .wiz-type-tabs,
[data-theme="orange"] .wiz-type-tabs { background: var(--surface-2); }
[data-theme="dark"] .wiz-type-tab--active,
[data-theme="orange"] .wiz-type-tab--active { background: var(--surface); }
[data-theme="dark"] .wiz-footer,
[data-theme="orange"] .wiz-footer { background: var(--surface); }

/* Violet theme overrides */
[data-theme="violet"] .wiz-btn-next,
[data-theme="orange"] .wiz-btn-next { background: var(--primary); }
[data-theme="violet"] .wiz-btn-next:hover:not(:disabled),
[data-theme="orange"] .wiz-btn-next:hover:not(:disabled) { background: var(--primary-hover); }

/* ── Responsive: wizard em telas ≤ 375px ── */
@media (max-width: 375px) {
  .wiz-body { padding: .85rem 1rem; }
  .wiz-footer { padding: .75rem 1rem .9rem; }
  .wiz-header { padding: .9rem 1rem .7rem; }
  .wiz-steps { padding: .7rem 1rem .6rem; }
  .wiz-step-connector { min-width: 16px; }
  .wiz-btn-prev { padding: .8rem .75rem; font-size: .82rem; }
}

/* ══════════════════════
   PRODUTOS — NOVA LISTA (KPIs, filtros, tabela, paginação)
   Design System A — Light (mesmas variáveis do restante do admin)
══════════════════════ */

/* Subtítulo abaixo do topbar (título "Produtos" já vem do #page-title) */
.prod-subtitle {
  font-size: .85rem;
  color: var(--text-2);
  margin: -.75rem 0 1.25rem;
}

/* ── Linha de KPIs ── */
.prod-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .85rem;
  margin-bottom: 1.25rem;
}
.prod-kpi-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
.prod-kpi-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prod-kpi-icon--total    { background: var(--primary-dim); color: var(--primary); }
.prod-kpi-icon--stock    { background: rgba(34,197,94,.12); color: #16A34A; }
.prod-kpi-icon--low      { background: rgba(217,119,6,.12); color: #D97706; }
.prod-kpi-icon--value    { background: rgba(59,130,246,.10); color: #1D4ED8; }
.prod-kpi-text { min-width: 0; }
.prod-kpi-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prod-kpi-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text);
  margin-top: .1rem;
}
.prod-kpi-sub {
  font-size: .72rem;
  color: var(--text-3);
  margin-top: .1rem;
}

/* ── Toggle de visualização (lista/grade) ── */
.prod-view-toggle {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.prod-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--surface);
  border: none;
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.prod-view-btn:first-child { border-right: 1.5px solid var(--border-2); }
.prod-view-btn:hover { background: var(--primary-dim2); color: var(--text-2); }
.prod-view-btn--active,
.prod-view-btn--active:hover {
  background: var(--primary);
  color: #fff;
}

/* ── Badge de categoria (placeholder — sem campo no banco) ── */
.prod-category-badge {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 600;
  padding: .18rem .6rem;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px dashed var(--border-2);
  white-space: nowrap;
}

/* ── Badge de status (computado a partir de stock_quantity) ── */
.prod-status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .74rem;
  font-weight: 700;
  padding: .22rem .65rem;
  border-radius: 99px;
  white-space: nowrap;
}
.prod-status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.prod-status-badge--instock { background: rgba(34,197,94,.12);  color: #16A34A; }
.prod-status-badge--low     { background: rgba(217,119,6,.12);  color: #D97706; }
.prod-status-badge--out     { background: rgba(239,68,68,.12);  color: var(--red); }

/* ── Avatar do produto (iniciais, ou foto quando photo_url existir) ── */
.product-avatar {
  background: rgba(13,148,136,.10) !important;
  border-color: #0D9488 !important;
  color: #0D9488 !important;
  overflow: hidden;
}
.prod-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ── Tabela de produtos ── */
.prod-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
  margin-bottom: 1rem;
}
.prod-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
.prod-table thead th {
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.prod-table th.prod-th-actions,
.prod-table td.prod-td-actions { text-align: right; }
.prod-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.prod-table tbody tr:last-child { border-bottom: none; }
.prod-table tbody tr:hover { background: var(--surface-2); }
.prod-table td {
  padding: .8rem 1.1rem;
  font-size: .85rem;
  color: var(--text);
  vertical-align: middle;
}

.prod-cell-product {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 180px;
}
.prod-cell-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  border: 1.5px solid;
}
.prod-cell-name {
  font-weight: 700;
  font-size: .87rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.prod-cell-sub {
  font-size: .74rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.prod-cell-price { font-weight: 700; white-space: nowrap; }
.prod-cell-stock { white-space: nowrap; color: var(--text-2); }

.prod-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
}
.prod-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border-2);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.prod-icon-btn:hover { background: var(--primary-dim); color: var(--primary); border-color: var(--primary-dim2); }
.prod-icon-btn--danger:hover { background: rgba(239,68,68,.08); color: var(--red); border-color: rgba(239,68,68,.3); }

/* ── Grade de produtos (modo grid) ── */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .85rem;
  margin-bottom: 1rem;
}
.prod-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .65rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.prod-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--primary-dim);
}
.prod-card-top { display: flex; align-items: flex-start; gap: .75rem; }
.prod-card-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 800;
  border: 2px solid;
}
.prod-card-info { flex: 1; min-width: 0; }
.prod-card-name {
  font-weight: 700;
  font-size: .92rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prod-card-sub {
  font-size: .76rem;
  color: var(--text-3);
  margin-top: .1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prod-card-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.prod-card-price { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.prod-card-stock { font-size: .78rem; color: var(--text-2); }
.prod-card-actions { display: flex; gap: .4rem; margin-top: .1rem; }
.prod-card-actions .prod-icon-btn { flex: 1; width: auto; }

/* ── Paginação ── */
.prod-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  padding: .25rem .1rem 1rem;
}
.prod-pagination-info {
  font-size: .8rem;
  color: var(--text-2);
}
.prod-pagination-pages {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
}
.prod-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 .5rem;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border-2);
  background: var(--surface);
  color: var(--text-2);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  font-family: inherit;
}
.prod-page-btn:hover:not(:disabled) { background: var(--primary-dim2); color: var(--text); }
.prod-page-btn:disabled { opacity: .4; cursor: not-allowed; }
.prod-page-btn--active,
.prod-page-btn--active:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Responsivo: Produtos ── */
@media (max-width: 768px) {
  .prod-kpi-row { grid-template-columns: 1fr 1fr; }
  .prod-table-wrap { border-radius: var(--radius-sm); }
  .prod-pagination-bar { justify-content: center; text-align: center; }
}
@media (max-width: 480px) {
  .filter-bar-inner .filter-select { flex: 1 1 auto; min-width: 0; }
  .prod-view-toggle { width: 100%; }
  .prod-view-btn { flex: 1; }
}
@media (max-width: 400px) {
  .prod-kpi-row { grid-template-columns: 1fr; }
}
