/* ============================================================
   Bella Nostra Web — Componentes
   Layout moderno: sidebar verde, listas em cards, mobile-first.
   ============================================================ */

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-input);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: filter .15s, background .15s, box-shadow .15s, transform .1s;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-white);
  box-shadow: 0 3px 10px rgba(102, 187, 106, .35);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(56, 142, 60, .4); }
.btn-secondary { background: var(--secondary); color: var(--text-white); }
.btn-secondary:hover:not(:disabled) { background: var(--secondary-dark); }
.btn-danger { background: var(--error); color: var(--text-white); }
.btn-danger:hover:not(:disabled) { background: var(--error-dark); }
.btn-warning { background: var(--warning); color: var(--text-white); }
.btn-warning:hover:not(:disabled) { background: var(--warning-dark); }
.btn-outline {
  background: var(--background-light);
  color: var(--primary-dark);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover:not(:disabled) { background: rgba(102, 187, 106, .10); }
.btn-text { background: transparent; color: var(--primary-dark); padding: 8px 12px; }
.btn-text:hover:not(:disabled) { background: rgba(102, 187, 106, .10); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-icon {
  background: transparent; border: none; cursor: pointer;
  padding: 7px; border-radius: 10px; color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.btn-icon:hover { background: var(--background-dark); color: var(--text-primary); }
.btn-icon.danger:hover { background: rgba(244, 67, 54, .12); color: var(--error); }
.btn svg, .btn-icon svg { width: 17px; height: 17px; flex: none; }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > label { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }
.field > label .req { color: var(--error); }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-input);
  background: var(--background-light);
  color: var(--text-primary);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 187, 106, .18);
}
.field textarea { resize: vertical; min-height: 80px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 14px; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > .field { flex: 1; min-width: 140px; }
.package-sessions-info { margin: 2px 0 10px; color: var(--info-dark); font-size: 13px; }
.package-sessions { padding: 12px; border: 1px solid var(--divider); border-radius: 12px; background: var(--terciary); }
.package-sessions-heading { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.package-sessions-heading b { font-size: 13px; }
.package-sessions-heading span { color: var(--text-secondary); font-size: 11.5px; }
.package-session-row { display: grid; grid-template-columns: 78px minmax(140px, 1fr) minmax(110px, .7fr); align-items: end; gap: 10px; padding: 9px 0; border-top: 1px solid var(--divider); }
.package-session-row:first-child { border-top: 0; padding-top: 0; }
.package-session-row:last-child { padding-bottom: 0; }
.package-session-row .field { margin-bottom: 0; }
.package-session-number { align-self: center; color: var(--primary-dark); font-size: 12px; font-weight: 700; }

/* ---------- Cards ---------- */
.card {
  background: var(--background-light);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(224, 224, 224, .6);
  padding: 18px;
}
.card + .card { margin-top: 14px; }

/* ---------- Página ---------- */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-header h1 { font-size: 22px; font-weight: 600; color: var(--text-primary); letter-spacing: -.2px; }
.page-header .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .field { margin-bottom: 0; }

.searchbar {
  display: flex; align-items: center; gap: 8px;
  background: var(--background-light);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 9px 16px; min-width: 240px;
  transition: border-color .15s, box-shadow .15s;
}
.searchbar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(102, 187, 106, .18); }
.searchbar input { border: none; outline: none; flex: 1; background: transparent; min-width: 0; }
.searchbar svg { width: 16px; height: 16px; color: var(--text-tertiary); flex: none; }

/* ---------- Listas em cards (substitui tabelas nas listagens) ---------- */
.list-rows { display: flex; flex-direction: column; gap: 10px; }
.list-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--background-light);
  border: 1px solid rgba(224, 224, 224, .6);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 13px 16px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.list-row:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.list-row.inativa { opacity: .62; }
.lr-icon {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: rgba(102, 187, 106, .14); color: var(--primary-dark);
  display: inline-flex; align-items: center; justify-content: center;
}
.lr-icon svg { width: 20px; height: 20px; }
.lr-main { flex: 1; min-width: 0; }
.lr-title { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.lr-value { text-align: right; font-weight: 700; font-size: 15px; white-space: nowrap; }
.lr-value small { display: block; font-weight: 400; font-size: 11.5px; color: var(--text-tertiary); }
.lr-actions { display: flex; gap: 2px; align-items: center; flex: none; }

/* grupo de valores rotulados (caixa) */
.lr-figures { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.fig { text-align: right; min-width: 74px; }
.fig .f-label { font-size: 11px; color: var(--text-tertiary); font-weight: 500; text-transform: uppercase; letter-spacing: .3px; }
.fig .f-value { font-size: 13.5px; font-weight: 600; margin-top: 1px; }
.fig.f-green .f-value { color: var(--success-dark); }
.fig.f-orange .f-value { color: var(--warning-dark); }

/* selo de data (vendas) */
.date-badge {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  background: rgba(102, 187, 106, .14); color: var(--primary-dark);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1.05;
}
.date-badge b { font-size: 16px; font-weight: 700; }
.date-badge span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.date-badge.cancelada { background: rgba(244, 67, 54, .10); color: var(--error-dark); }

/* ---------- Tabelas (mantidas p/ conteúdos internos de modal) ---------- */
.table-wrap {
  overflow-x: auto; overflow-y: auto;
  -webkit-overflow-scrolling: touch;   /* rolagem lateral suave no mobile */
  border-radius: var(--radius-card); background: var(--background-light); box-shadow: var(--shadow-sm);
}
table.tbl { width: 100%; border-collapse: collapse; min-width: 480px; }
.tbl th {
  text-align: left; padding: 11px 14px; font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-secondary); background: var(--terciary);
  border-bottom: 1px solid var(--divider); white-space: nowrap;
  position: sticky; top: 0; z-index: 2;   /* cabeçalho fixo ao rolar */
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: rgba(102, 187, 106, .06); }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl td.center, .tbl th.center { text-align: center; }
.tbl .row-actions { display: flex; gap: 2px; justify-content: flex-end; }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.chip-success { background: rgba(76, 175, 80, .15); color: var(--success-dark); }
.chip-error { background: rgba(244, 67, 54, .13); color: var(--error-dark); }
.chip-warning { background: rgba(255, 152, 0, .15); color: var(--warning-dark); }
.chip-info { background: rgba(33, 150, 243, .13); color: var(--info-dark); }
.chip-dark { background: rgba(33, 33, 33, .1); color: var(--text-primary); }
.chip-neutral { background: var(--background-dark); color: var(--text-secondary); }
.chip svg { width: 12.5px; height: 12.5px; flex: none; }

/* chip clicável (abre dropdown) */
.chip-btn {
  border: none; cursor: pointer; font-family: var(--font);
  transition: filter .12s, box-shadow .12s;
}
.chip-btn:hover { filter: brightness(.94); box-shadow: 0 1px 5px var(--shadow); }
.chip-btn svg:last-child { width: 11px; height: 11px; opacity: .65; }

/* menu flutuante ancorado em chip */
.ctx-menu {
  position: fixed; z-index: 1000;
  background: var(--background-light);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 215px;
  animation: modalIn .15s ease;
}
.ctx-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  cursor: pointer; font-size: 13.5px;
}
.ctx-item:hover { background: var(--terciary); }
.ctx-item.current { background: rgba(102, 187, 106, .10); font-weight: 600; }
.ctx-item .ctx-ic { display: inline-flex; flex: none; }
.ctx-item .ctx-ic svg { width: 16px; height: 16px; }
.ctx-item .ctx-label { flex: 1; }
.ctx-item .ctx-check { display: inline-flex; color: var(--primary-dark); }
.ctx-item .ctx-check svg { width: 14px; height: 14px; }

/* ---------- Avatar ---------- */
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 15px; overflow: hidden; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 84px; height: 84px; font-size: 26px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
  z-index: 900; padding: 20px; animation: fadeIn .18s ease;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--background-light);
  border-radius: var(--radius-dialog);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column;
  animation: modalIn .2s ease;
}
.modal.modal-lg { max-width: 860px; }
.modal.modal-xl { max-width: 1100px; }
.modal.modal-sm { max-width: 400px; }
/* tabela de vendas do fechamento: compacta p/ caber sem scroll horizontal */
.caixa-vendas-tbl { table-layout: fixed; width: 100%; }
.caixa-vendas-tbl th, .caixa-vendas-tbl td { padding: 8px 8px; font-size: 12.5px; }
.caixa-vendas-tbl th { font-size: 10.5px; }
.caixa-vendas-tbl td { white-space: normal; word-break: break-word; }
.caixa-vendas-tbl td.num, .caixa-vendas-tbl th.num, .caixa-vendas-tbl .center { white-space: nowrap; }
.caixa-vendas-tbl .chip { padding: 3px 7px; font-size: 11px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--divider);
  flex: none;
}
.modal-header h2 { font-size: 17px; font-weight: 600; }
.modal-body { padding: 18px 20px; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--divider);
  flex: none; flex-wrap: wrap;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sheetIn { from { transform: translateY(40%); opacity: .6; } to { transform: none; opacity: 1; } }

/* ---------- Snackbar (customSnackBar) ---------- */
#snackbar-container {
  position: fixed; right: 20px; bottom: 20px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 1200; pointer-events: none;
}
.snackbar {
  min-width: 300px; max-width: 400px;
  color: var(--text-white);
  border-radius: var(--radius-card);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  padding: 13px 16px;
  display: flex; gap: 11px; align-items: flex-start;
  pointer-events: auto;
  animation: snackIn .4s cubic-bezier(.21, 1.02, .73, 1);
}
.snackbar.out { animation: snackOut .3s ease forwards; }
.snackbar .sb-icon { font-size: 17px; line-height: 1.3; flex: none; }
.snackbar .sb-title { font-weight: 600; font-size: 14px; }
.snackbar .sb-msg { font-size: 13px; opacity: .95; margin-top: 2px; }
.snackbar-success { background: var(--success); }
.snackbar-error { background: var(--error); }
.snackbar-warning { background: var(--warning); }
.snackbar-info { background: var(--info); }
@keyframes snackIn { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes snackOut { to { opacity: 0; transform: translateX(60px); } }

/* ---------- Loading overlay ---------- */
#loading-overlay {
  position: fixed; inset: 0; background: var(--overlay-light);
  display: flex; align-items: center; justify-content: center;
  z-index: 1100;
}
.spinner {
  width: 44px; height: 44px;
  border: 4px solid rgba(255, 255, 255, .55);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.spinner-sm { width: 18px; height: 18px; border-width: 2.5px; border-color: rgba(255,255,255,.4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Estado vazio ---------- */
.empty-state {
  text-align: center; padding: 52px 20px; color: var(--text-tertiary);
  background: var(--background-light);
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius-card);
}
.empty-state svg { width: 40px; height: 40px; margin-bottom: 12px; opacity: .55; }
.empty-state p { font-size: 14px; }

/* ---------- Layout do app (sidebar + conteúdo) ---------- */
.app-layout { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-deep) 100%);
  display: flex; flex-direction: column;
  transition: width .2s ease, transform .25s ease;
  flex: none;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 14px; border-bottom: 1px solid rgba(255, 255, 255, .14);
  min-height: 62px;
}
.sidebar-brand img {
  width: 36px; height: 36px; object-fit: contain; flex: none;
  background: var(--background-light); border-radius: 10px; padding: 4px;
}
.sidebar-brand span { font-weight: 700; font-size: 17px; color: var(--text-white); white-space: nowrap; letter-spacing: .2px; }
.sidebar .btn-icon { color: rgba(255, 255, 255, .85); }
.sidebar .btn-icon:hover { background: rgba(255, 255, 255, .14); color: var(--text-white); }
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 10px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .25); }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 10px 12px; margin-bottom: 3px;
  border: none; background: transparent;
  border-radius: 12px; cursor: pointer;
  color: rgba(255, 255, 255, .82); font-size: 14px; font-weight: 500;
  text-align: left; white-space: nowrap;
  transition: background .12s, color .12s;
}
.nav-item svg { width: 19px; height: 19px; flex: none; }
.nav-item:hover { background: rgba(255, 255, 255, .12); color: var(--text-white); }
.nav-item.active {
  background: var(--background-light);
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.sidebar.collapsed .nav-item span, .sidebar.collapsed .sidebar-brand span { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; }
.sidebar-footer { border-top: 1px solid rgba(255, 255, 255, .14); padding: 10px 10px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin-bottom: 4px; }
.sidebar-user .avatar { background: var(--background-light); color: var(--primary-dark); }
.sidebar-user .u-info { overflow: hidden; }
.sidebar-user .u-nome { font-size: 13px; font-weight: 600; color: var(--text-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .u-perm { font-size: 11.5px; color: rgba(255, 255, 255, .65); text-transform: capitalize; }
.sidebar.collapsed .sidebar-user .u-info { display: none; }

.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: var(--overlay); z-index: 940;
  animation: fadeIn .2s ease;
}
.sidebar-backdrop.show { display: block; }

/* topbar — visível apenas no mobile */
.topbar {
  display: none;
  align-items: center; gap: 10px;
  height: var(--topbar-height); flex: none;
  padding: 0 12px;
  background: var(--background-light);
  border-bottom: 1px solid var(--divider);
  box-shadow: var(--shadow-sm);
  position: relative; z-index: 10;
}
.topbar img { width: 30px; height: 30px; object-fit: contain; }
.topbar-title { font-weight: 600; font-size: 16px; color: var(--text-primary); }

.main-content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 22px 26px; -webkit-overflow-scrolling: touch; animation: pageIn .28s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh; min-height: 100dvh; display: flex;
}
.login-hero {
  flex: 1.1;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-white); padding: 40px; gap: 18px;
}
.login-hero img { width: 130px; height: 130px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(0,0,0,.15)); }
.login-hero h1 { font-size: 32px; font-weight: 700; }
.login-hero p { font-size: 15px; opacity: .95; text-align: center; max-width: 340px; }
.login-form-side {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 30px; background: var(--background);
}
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.login-card .sub { color: var(--text-secondary); margin-bottom: 22px; font-size: 14px; }
.login-brand-mobile {
  display: none;
  flex-direction: column; align-items: center; gap: 8px;
  margin-bottom: 20px;
}
.login-brand-mobile img { width: 72px; height: 72px; object-fit: contain; }
.login-brand-mobile span { font-size: 22px; font-weight: 700; color: var(--primary-dark); }
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 42px; }
.pwd-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
}
@media (max-width: 900px) {
  .login-hero { display: none; }
  .login-brand-mobile { display: flex; }
  .login-form-side { padding: 20px 16px; }
}

/* ---------- Autocomplete (acField) ---------- */
.ac-wrap { position: relative; }
.ac-dd {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  z-index: 60;
  background: var(--background-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-md);
  max-height: 240px; overflow-y: auto;
  display: none;
}
.ac-opt { padding: 10px 12px; cursor: pointer; font-size: 14px; }
.ac-opt:hover { background: var(--terciary); }
.ac-opt + .ac-opt { border-top: 1px solid var(--terciary); }
.ac-empty { padding: 10px 12px; font-size: 13px; color: var(--text-tertiary); }
.ac-clear {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  display: none;
}
.ac-wrap.selected .ac-clear { display: inline-flex; }
.ac-wrap.selected input {
  padding-right: 40px;
  background: rgba(102, 187, 106, .08);
  border-color: var(--primary);
  font-weight: 500;
  cursor: default;
}

/* ---------- Agenda ---------- */
.agenda-layout { display: flex; gap: 16px; align-items: flex-start; }
.agenda-search { min-width: 330px; }
.agenda-prof-filter { min-width: 240px; margin: 0 0 0 auto; }
.agenda-prof-filter-control { position: relative; }
.agenda-prof-filter-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 240px; padding-top: 7px !important; padding-bottom: 7px !important; font-family: var(--font); font-size: 13px; text-align: left; cursor: pointer; }
.agenda-prof-filter-toggle span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.agenda-prof-filter-toggle svg { width: 14px; height: 14px; flex: none; color: var(--text-tertiary); }
.agenda-prof-filter-menu { position: absolute; top: calc(100% + 5px); right: 0; z-index: 80; width: max-content; min-width: 260px; max-width: min(340px, 85vw); max-height: 280px; overflow-y: auto; padding: 7px; border: 1px solid var(--border-light); border-radius: 12px; background: var(--background-light); box-shadow: var(--shadow-lg); }
.agenda-prof-filter-menu[hidden] { display: none; }
.agenda-prof-option { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.agenda-prof-option:hover { background: var(--terciary); }
.agenda-prof-option input { width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.agenda-prof-all { font-weight: 600; color: var(--primary-dark); }
.agenda-prof-divider { height: 1px; margin: 4px 7px; background: var(--divider); }
.agenda-prof-empty { display: block; padding: 9px; color: var(--text-tertiary); font-size: 12.5px; }
.send-agenda-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 10px; padding: 9px 11px; border-radius: 10px; background: var(--terciary); }
.send-agenda-toolbar > span { color: var(--text-tertiary); font-size: 12px; }
.send-agenda-list { display: flex; flex-direction: column; gap: 8px; }
.send-agenda-item { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--divider); border-radius: 12px; cursor: pointer; transition: border-color .12s, background .12s; }
.send-agenda-item:hover { border-color: var(--primary-light); background: rgba(102,187,106,.04); }
.send-agenda-item.cancelled { opacity: .65; }
.send-agenda-item > input { width: 17px; height: 17px; accent-color: var(--primary); flex: none; }
.send-agenda-time { display: flex; align-items: center; gap: 5px; min-width: 58px; color: var(--primary-dark); }
.send-agenda-time svg { width: 14px; height: 14px; }
.send-agenda-time b { font-size: 13.5px; }
.send-agenda-info { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; }
.send-agenda-info b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.send-agenda-info span { color: var(--text-secondary); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-main { flex: 1; min-width: 0; }
.agenda-cal {
  width: 292px; flex: none;
  position: sticky; top: 0;
  padding: 14px;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-weight: 600; font-size: 14px; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow {
  font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  text-align: center; padding: 4px 0; text-transform: uppercase;
}
.cal-day {
  aspect-ratio: 1; border: none; background: transparent;
  border-radius: 10px; cursor: pointer;
  font-family: var(--font); font-size: 13px; color: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.cal-day:hover { background: var(--terciary); }
.cal-day.other { color: var(--text-tertiary); opacity: .55; }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--primary); color: var(--primary-dark); font-weight: 600; }
.cal-day.sel {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-white); font-weight: 600;
  box-shadow: 0 2px 8px rgba(102, 187, 106, .4);
}
.cal-day.sel:hover { background: var(--primary-dark); }

.day-nav {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--terciary);
  border-radius: 999px; padding: 4px 6px;
}
.day-nav input[type=date] {
  border: none; background: transparent; outline: none;
  font-family: var(--font); font-size: 14px; font-weight: 600;
  color: var(--text-primary); padding: 6px 4px;
}
.day-label { color: var(--text-secondary); font-weight: 500; font-size: 13.5px; }

.agenda-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--background-light);
  border: 1px solid rgba(224, 224, 224, .6);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 13px 16px; margin-bottom: 10px;
  border-left: 5px solid var(--border);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.agenda-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.agenda-item.st-_ { border-left-color: var(--text-primary); }
.agenda-item.st-presente { border-left-color: var(--success); }
.agenda-item.st-confirmado { border-left-color: var(--info); }
.agenda-item.st-ausente { border-left-color: var(--warning); }
.agenda-item.st-cancelou_paciente, .agenda-item.st-cancelou_profissional { border-left-color: var(--error); }
.agenda-hora {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 58px; flex: none;
  font-size: 16px; font-weight: 700; color: var(--primary-dark);
}
.agenda-hora svg { width: 14px; height: 14px; opacity: .6; margin-bottom: 2px; }
.agenda-info { flex: 1; min-width: 0; }
.agenda-info .a-cliente { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* nome do paciente na lista da agenda em preto (não verde) */
.agenda-item .a-cliente, .agenda-item .a-cliente.patient-link { color: var(--text-primary); }
.agenda-item .a-cliente.patient-link:hover, .agenda-item .a-cliente.patient-link:focus-visible { color: var(--primary-deep); }
.patient-link { display: block; max-width: 100%; padding: 0; border: none; background: transparent; color: var(--primary-dark); font-family: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: color .12s, text-decoration-color .12s; }
.patient-link:hover, .patient-link:focus-visible { color: var(--primary-deep); text-decoration-color: currentColor; outline: none; }
.patient-link-inline { display: inline; font-size: inherit; font-weight: 600; }
.agenda-info .a-det { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.agenda-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }

/* botão WhatsApp do cliente (último, ao lado do pago) */
.wa-chip {
  border: none; cursor: pointer; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border-radius: 999px;
  background: rgba(76, 175, 80, .15); color: var(--success-dark);
  transition: background .12s, color .12s, transform .1s;
}
.wa-chip:hover { background: var(--success); color: var(--text-white); }
.wa-chip:active { transform: scale(.94); }
.wa-chip svg { width: 18px; height: 18px; }

/* seletor de status no modal */
.status-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.status-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--border-light); background: var(--background-light);
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  transition: border-color .12s, background .12s;
}
.status-opt svg { width: 15px; height: 15px; flex: none; }
.status-opt:hover { border-color: var(--border); }
.status-opt.sel-success { border-color: var(--success); background: rgba(76,175,80,.13); color: var(--success-dark); }
.status-opt.sel-warning { border-color: var(--warning); background: rgba(255,152,0,.14); color: var(--warning-dark); }
.status-opt.sel-error { border-color: var(--error); background: rgba(244,67,54,.12); color: var(--error-dark); }
.status-opt.sel-info { border-color: var(--info); background: rgba(33,150,243,.12); color: var(--info-dark); }
.status-opt.sel-dark { border-color: var(--text-primary); background: rgba(33,33,33,.08); color: var(--text-primary); }

/* ---------- Detalhes do atendimento ---------- */
.appointment-detail-people { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.appointment-person-card { min-width: 0; padding: 14px; border: 1px solid var(--divider); border-radius: 14px; background: var(--terciary); }
.appointment-section-label { display: block; margin-bottom: 9px; color: var(--text-tertiary); font-size: 10.5px; font-weight: 700; letter-spacing: .55px; text-transform: uppercase; }
.appointment-person-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.appointment-avatar { width: 64px; height: 64px; font-size: 21px; box-shadow: 0 2px 8px rgba(0,0,0,.10); }
.avatar-with-fallback { position: relative; }
.avatar-with-fallback .avatar-fallback { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.avatar-with-fallback img { position: absolute; inset: 0; z-index: 1; background: var(--background-light); }
.appointment-person-info { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.appointment-person-name { max-width: 100%; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appointment-person-info > span { color: var(--text-secondary); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appointment-responsibles { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--divider); }
.appointment-responsibles .appointment-section-label { margin-bottom: 7px; }
.appointment-responsible { display: flex; align-items: center; gap: 8px; min-width: 0; }
.appointment-responsible + .appointment-responsible { margin-top: 7px; }
.appointment-responsible > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.appointment-responsible b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appointment-responsible span, .appointment-no-responsible { color: var(--text-tertiary); font-size: 11.5px; }
.appointment-responsible .appointment-responsible-phone { color: var(--text-secondary); font-weight: 500; }
.appointment-detail-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--divider); }
.appointment-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.appointment-fact { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 11px; border-radius: 11px; background: var(--terciary); }
.appointment-fact-wide { grid-column: span 2; }
.appointment-fact span { color: var(--text-tertiary); font-size: 10.5px; font-weight: 600; text-transform: uppercase; }
.appointment-fact b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appointment-payment-row, .appointment-reschedule { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.appointment-reschedule .input { min-width: 145px; }

/* ---------- Cards de resumo (caixa / início) ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--background-light); border-radius: var(--radius-card);
  border: 1px solid rgba(224, 224, 224, .6);
  box-shadow: var(--shadow-sm); padding: 16px 18px;
}
.stat-card .s-icon {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.stat-card .s-icon svg { width: 21px; height: 21px; }
.stat-card .s-label { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }
.stat-card .s-value { font-size: 22px; font-weight: 700; margin-top: 2px; }
.stat-card.s-green .s-value { color: var(--success-dark); }
.stat-card.s-green .s-icon { background: rgba(76, 175, 80, .14); color: var(--success-dark); }
.stat-card.s-orange .s-value { color: var(--warning-dark); }
.stat-card.s-orange .s-icon { background: rgba(255, 152, 0, .14); color: var(--warning-dark); }
.stat-card.s-blue .s-value { color: var(--info-dark); }
.stat-card.s-blue .s-icon { background: rgba(33, 150, 243, .13); color: var(--info-dark); }

/* ---------- Acesso rápido (início) ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 18px 10px;
  background: var(--background-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--text-primary);
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.tile .t-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(102, 187, 106, .14); color: var(--primary-dark);
  display: inline-flex; align-items: center; justify-content: center;
}
.tile .t-icon svg { width: 20px; height: 20px; }

/* ---------- Lista de cadastros (cliente/profissional) ---------- */
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 13px; }
.client-pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 18px; color: var(--text-secondary); font-size: 13px;
}
.client-pagination .actions { display: flex; align-items: center; gap: 10px; }
.client-pagination .btn svg { width: 16px; height: 16px; }
.person-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--background-light); border-radius: var(--radius-card);
  border: 1px solid rgba(224, 224, 224, .6);
  box-shadow: var(--shadow-sm); padding: 14px; cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.person-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.client-show-deleted { padding: 8px 10px; border: 1px solid var(--divider); border-radius: var(--radius-input); background: var(--background-light); color: var(--text-secondary); font-size: 12.5px; }
.client-deleted-card { border-color: rgba(244, 67, 54, .24); background: rgba(244, 67, 54, .035); }
.client-deleted-card .avatar { filter: grayscale(1); opacity: .72; }
.person-card { min-width: 0; }   /* item de grid encolhe até a coluna, não estoura */
.person-card .p-info { flex: 1; min-width: 0; }
.person-card .p-nome { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-card .p-det { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Página do cliente ---------- */
.client-detail-header { align-items: flex-end; }
.client-title-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.client-title-wrap > .btn-icon { color: var(--primary-dark); }
.client-breadcrumb { color: var(--text-tertiary); font-size: 11.5px; margin-bottom: 2px; }
.client-title-wrap h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-page-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, .85fr); gap: 16px; align-items: start; }
.client-main-column, .client-side-column { min-width: 0; }
.client-side-column { position: sticky; top: 0; }
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.client-number-field { max-width: 110px; }
.client-weight-field { max-width: 130px; }
.client-save-hint { display: flex; align-items: center; gap: 12px; color: var(--text-secondary); }
.client-save-hint > svg { width: 24px; height: 24px; color: var(--primary-dark); flex: none; }
.client-save-hint div { display: flex; flex-direction: column; gap: 2px; }
.client-save-hint b { color: var(--text-primary); font-size: 14px; }
.client-save-hint span, .muted { color: var(--text-tertiary); font-size: 12.5px; }
.client-agenda-card { padding: 0; overflow: hidden; }
.client-agenda-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px 12px; }
.client-agenda-heading h2 { font-size: 15px; font-weight: 600; }
.client-agenda-heading .eyebrow { display: block; color: var(--primary-dark); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.client-history-heading { margin-top: 8px; border-top: 1px solid var(--divider); }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: rgba(102, 187, 106, .14); color: var(--primary-dark); font-size: 12px; font-weight: 700; }
.count-badge.neutral { background: var(--background-dark); color: var(--text-secondary); }
.client-appointment-list { padding: 0 12px 8px; display: flex; flex-direction: column; gap: 8px; }
.client-appointment { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px; border: 1px solid var(--divider); border-left: 4px solid var(--border); border-radius: 12px; background: var(--background-light); cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }
.client-appointment:hover { border-color: var(--primary-light); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.client-appointment.st-_ { border-left-color: var(--text-primary); }
.client-appointment.st-presente { border-left-color: var(--success); }
.client-appointment.st-confirmado { border-left-color: var(--info); }
.client-appointment.st-ausente { border-left-color: var(--warning); }
.client-appointment.st-cancelou_paciente, .client-appointment.st-cancelou_profissional { border-left-color: var(--error); }
.client-appointment .date-badge { width: 42px; height: 42px; }
.client-appointment-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.client-appointment-info b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-appointment-info span { color: var(--text-secondary); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-appointment-chips { display: flex; flex: 1 0 100%; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 5px; padding-left: 52px; }
.client-appointment-chips .chip { font-size: 10.5px; padding: 2px 7px; }
.client-appointment-chips .chip svg { width: 11px; height: 11px; }
.client-appointment-chips .wa-chip { width: 27px; height: 27px; }
.client-appointment-chips .wa-chip svg, .client-appointment-chips .client-more svg { width: 15px; height: 15px; }
.client-more { padding: 5px; }
.client-agenda-empty { margin: 0 12px 10px; padding: 22px 12px; border: 1px dashed var(--divider); border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-tertiary); font-size: 12.5px; }
.client-agenda-empty svg { width: 22px; height: 22px; opacity: .65; }

/* ---------- Gestão da agenda online ---------- */
.page-subtitle { margin-top: 3px; color: var(--text-secondary); font-size: 13px; }
.online-security-note { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; color: var(--text-secondary); }
.online-security-note > svg { width: 23px; height: 23px; flex: none; color: var(--primary-dark); }
.online-security-note > div { display: flex; flex-direction: column; gap: 3px; }
.online-security-note b { color: var(--text-primary); }
.online-security-note span { font-size: 12.5px; }
.online-access-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; }
.online-access-card { display: flex; flex-direction: column; gap: 13px; }
.online-professional { display: flex; align-items: center; gap: 11px; min-width: 0; }
.online-professional > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.online-professional b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online-professional span { color: var(--text-secondary); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online-access-status { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 11px; border-radius: 11px; background: var(--terciary); }
.online-access-status > span:not(.chip) { color: var(--text-tertiary); font-size: 11.5px; }
.online-access-actions { display: flex; gap: 7px; margin-top: auto; flex-wrap: wrap; }
.online-modal-copy { margin-bottom: 14px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.online-link-success { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-bottom: 15px; text-align: center; }
.online-link-success > svg { width: 34px; height: 34px; color: var(--success); }
.online-link-success span { color: var(--text-secondary); font-size: 12px; }

/* ---------- Foto upload ---------- */
.foto-upload { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.foto-upload .foto-actions { display: flex; flex-direction: column; gap: 6px; flex-wrap: wrap; }

/* ---------- Multi-select (profissional) ---------- */
.multi-box {
  border: 1px solid var(--border-light); border-radius: var(--radius-input);
  padding: 10px 12px; max-height: 210px; overflow-y: auto;
  background: var(--background-light);
  display: flex; flex-direction: column; gap: 6px;
}
.multi-box .check { padding: 3px 0; }
.svc-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px 0; }
.svc-row .svc-inputs { display: flex; gap: 6px; margin-left: 25px; flex-wrap: wrap; }
.svc-row .svc-inputs input { width: 92px; padding: 6px 8px; border: 1px solid var(--border-light); border-radius: 8px; }

/* ---------- Página do profissional ---------- */
.professional-detail-header { align-items: flex-end; }
.professional-form-page { display: flex; flex-direction: column; gap: 16px; }
.professional-section { padding: 20px; min-width: 0; }
.professional-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.professional-section-heading .eyebrow { display: block; margin-bottom: 2px; color: var(--primary-dark); font-size: 10.5px; font-weight: 700; letter-spacing: .55px; text-transform: uppercase; }
.professional-section-heading h2 { font-size: 17px; font-weight: 600; }
.professional-section-heading p { margin-top: 3px; color: var(--text-secondary); font-size: 12.5px; }
.professional-functional-field { max-width: 150px; }
.professional-number-field { max-width: 110px; }
.professional-active-field { max-width: 210px; }
.professional-active-check { min-height: 42px; padding: 10px 12px; border: 1px solid var(--border-light); border-radius: var(--radius-input); background: var(--terciary); }
.professional-relations-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.professional-relations-grid > div { min-width: 0; }
.professional-relations-grid h3 { margin-bottom: 7px; color: var(--text-secondary); font-size: 12.5px; font-weight: 600; }
.professional-service-picker { display: grid; grid-template-columns: minmax(280px, .82fr) minmax(420px, 1.18fr); gap: 14px; align-items: start; }
.professional-service-panel { min-width: 0; overflow: hidden; border: 1px solid var(--divider); border-radius: 14px; background: var(--background-light); }
.professional-service-panel.available { background: var(--terciary); }
.professional-service-panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 14px 15px 10px; }
.professional-service-panel-heading h3 { font-size: 14px; font-weight: 600; }
.professional-service-panel-heading span { display: block; margin-top: 1px; color: var(--text-tertiary); font-size: 11.5px; }
.professional-service-search { margin: 0 12px 11px; width: auto; background: var(--background-light); }
.professional-service-list { display: flex; flex-direction: column; gap: 8px; max-height: 590px; padding: 0 11px 12px; overflow-y: auto; }
.professional-service-item { min-width: 0; padding: 11px; border: 1px solid var(--divider); border-radius: 11px; background: var(--background-light); }
.professional-service-item.available-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.professional-service-item.available-item > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.professional-service-item b { font-size: 12.5px; }
.professional-service-item.available-item > div:first-child > b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.professional-service-item.available-item > div:first-child > span { color: var(--text-secondary); font-size: 11.5px; }
.professional-service-item-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; flex-wrap: wrap; flex: none; }
.professional-service-item-actions .chip { font-size: 10px; padding: 2px 6px; }
.professional-service-item-actions .btn { padding: 6px 9px; }
.professional-service-panel.added .professional-service-list { background: rgba(102, 187, 106, .025); }
.professional-service-item.added-item { border-left: 3px solid var(--primary); box-shadow: var(--shadow-sm); }
.professional-service-item.added-item.just-added { border-color: var(--primary); background: rgba(102, 187, 106, .12); animation: professionalServiceAdded 1.1s ease 2; }
@keyframes professionalServiceAdded { 0%, 100% { box-shadow: var(--shadow-sm); } 50% { box-shadow: 0 0 0 4px rgba(102, 187, 106, .20); } }
.professional-added-service-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.professional-added-service-heading > div { display: flex; align-items: center; gap: 6px; min-width: 0; }
.professional-added-service-heading b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.professional-service-values { display: grid; grid-template-columns: 1fr .85fr 1fr; gap: 8px; }
.professional-service-values .field { margin-bottom: 0; min-width: 0; }
.professional-service-values .field label { font-size: 10.5px; }
.professional-service-values input { padding: 8px 9px !important; }
.professional-service-empty { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 18px; color: var(--text-tertiary); text-align: center; font-size: 12px; }
.professional-service-empty svg { width: 23px; height: 23px; opacity: .65; }
.professional-service-empty small { font-size: 10.5px; }

/* ---------- Impressão ---------- */
@media print {
  .sidebar, .topbar, .sidebar-backdrop, .page-header .actions, .no-print, #snackbar-container { display: none !important; }
  .main-content { padding: 0; overflow: visible; animation: none; }
  body { background: #fff; }
  .card, .table-wrap, .stat-card, .list-row, .agenda-item { box-shadow: none; border: 1px solid #ddd; }
  .list-row, .agenda-item { break-inside: avoid; }
}

/* ---------- Impressão de um único profissional (caixa) ---------- */
.caixa-print { display: none; color: #000; }
.caixa-print .cp-head { text-align: center; margin-bottom: 18px; }
.caixa-print .cp-head h1 { font-size: 20px; font-weight: 700; }
.caixa-print .cp-sub { font-size: 13px; color: #555; margin-top: 3px; }
.caixa-print .cp-tbl { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 16px; }
.caixa-print .cp-tbl th, .caixa-print .cp-tbl td { border: 1px solid #bbb; padding: 6px 9px; text-align: left; }
.caixa-print .cp-tbl th { background: #eee; font-weight: 600; }
.caixa-print .cp-tbl th.r, .caixa-print .cp-tbl td.r { text-align: right; }
.caixa-print .cp-tbl tr { break-inside: avoid; }
.caixa-print .cp-tot {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px 32px;
  font-size: 13px; max-width: 560px;
}
.caixa-print .cp-tot .k { color: #555; border-bottom: 1px dotted #ccc; padding-bottom: 3px; }
.caixa-print .cp-tot .k b { float: right; color: #000; }
.caixa-print .cp-tot .cp-strong { font-weight: 700; color: #000; }
.caixa-print .cp-tot .cp-wide { grid-column: 1 / -1; }
.caixa-print .cp-foot { margin-top: 22px; font-size: 11px; color: #888; text-align: right; }

@media print {
  /* mostra só o relatório do profissional, esconde app + modais */
  body.printing-prof > * { display: none !important; }
  body.printing-prof > .caixa-print { display: block !important; }
}

/* ============================================================
   Responsivo — tablet / celular
   ============================================================ */
@media (max-width: 900px) {
  /* sidebar vira gaveta (off-canvas) */
  .topbar { display: flex; }
  .sidebar, .sidebar.collapsed {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 264px; z-index: 950;
    transform: translateX(-105%);
    box-shadow: none;
  }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .sidebar.collapsed .nav-item span,
  .sidebar.collapsed .sidebar-brand span { display: inline; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; }
  .sidebar.collapsed .sidebar-user .u-info { display: block; }
  #btn-collapse { display: none; }

  .main-content { padding: 16px 14px; }

  /* agenda: calendário some; navegação por dia continua na toolbar */
  .agenda-layout { flex-direction: column; }
  .agenda-cal { display: none; }
  .agenda-main { width: 100%; }
  .client-page-grid { grid-template-columns: 1fr; }
  .client-side-column { position: static; }
  .professional-service-picker { grid-template-columns: 1fr; }
  .professional-service-list { max-height: 420px; }
}

@media (max-width: 640px) {
  .page-header h1 { font-size: 19px; }
  .page-header .actions { width: 100%; }
  .page-header .actions .searchbar { flex: 1; min-width: 0; }
  .agenda-search { flex-basis: 100% !important; }
  .page-header .actions .btn { flex: 1; }
  .toolbar { gap: 8px; }
  .toolbar .field { min-width: calc(50% - 8px); }
  .toolbar > .btn { width: 100%; }
  .day-label { width: 100%; margin-left: 0 !important; text-align: center; }
  .agenda-prof-filter { width: 100%; min-width: 0; margin-left: 0; }
  .agenda-prof-filter-toggle { width: 100%; min-width: 0; }
  .agenda-prof-filter-menu { left: 0; right: auto; width: 100%; min-width: 0; }
  .send-agenda-item { flex-wrap: wrap; }
  .send-agenda-info { min-width: calc(100% - 98px); }
  .send-agenda-item > .chip { margin-left: 28px; }

  /* linhas de lista: metadados quebram para baixo */
  .list-row { flex-wrap: wrap; row-gap: 8px; padding: 12px 14px; }
  .lr-main { flex: 1 1 55%; }
  .lr-meta { justify-content: flex-start; flex-basis: 100%; order: 5; }
  .lr-figures { flex-basis: 100%; order: 4; justify-content: space-between; gap: 10px; }
  .fig { text-align: left; min-width: 0; }
  .lr-actions { margin-left: auto; }

  .agenda-item { flex-wrap: wrap; row-gap: 8px; gap: 10px; padding: 12px 14px; }
  .agenda-chips { flex-basis: 100%; justify-content: flex-start; }

  .stat-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 13px 14px; gap: 10px; }
  .stat-card .s-icon { width: 38px; height: 38px; }
  .stat-card .s-value { font-size: 18px; }

  .person-grid { grid-template-columns: 1fr; }
  .client-pagination { align-items: stretch; flex-direction: column; }
  .client-pagination .actions { justify-content: space-between; }
  .client-detail-header { align-items: stretch; }
  .client-detail-header .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .client-detail-header .actions .btn-primary { grid-column: 1 / -1; grid-row: 1; }
  .professional-detail-header { align-items: stretch; }
  .professional-detail-header .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .professional-detail-header .actions .btn-primary { grid-column: 1 / -1; grid-row: 1; }
  .professional-section { padding: 16px; }
  .professional-functional-field, .professional-number-field, .professional-active-field { max-width: none; }
  .professional-relations-grid { grid-template-columns: 1fr; }
  .professional-service-item.available-item { align-items: flex-start; flex-direction: column; }
  .professional-service-item-actions { width: 100%; justify-content: flex-start; }
  .professional-service-item-actions .btn { margin-left: auto; }
  .professional-service-values { grid-template-columns: 1fr 1fr; }
  .professional-service-values .field:first-child { grid-column: 1 / -1; }
  .client-number-field, .client-weight-field { max-width: none; }
  .client-appointment { align-items: flex-start; }
  .client-appointment-info { min-width: calc(100% - 54px); }
  .client-appointment-chips { padding-left: 0; justify-content: flex-start; }
  .appointment-detail-people { grid-template-columns: 1fr; }
  .appointment-facts { grid-template-columns: 1fr 1fr; }
  .appointment-fact-wide { grid-column: 1 / -1; }
  .appointment-reschedule .input, .appointment-reschedule .btn { width: 100% !important; }

  /* modal vira folha inferior (bottom sheet) */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal, .modal.modal-lg, .modal.modal-sm {
    max-width: 100%;
    max-height: 94vh; max-height: 94dvh;
    border-radius: var(--radius-dialog) var(--radius-dialog) 0 0;
    animation: sheetIn .25s ease;
  }
  .modal-footer { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .modal-footer .btn { flex: 1; }
  .modal-footer .btn-text { flex: 0; }

  /* snackbar ocupa a largura */
  #snackbar-container { left: 12px; right: 12px; bottom: 12px; }
  .snackbar { min-width: 0; max-width: none; width: 100%; }

  .form-row > .field { min-width: calc(50% - 12px); }
  .package-session-row { grid-template-columns: 1fr 1fr; }
  .package-session-number { grid-column: 1 / -1; }
  .foto-upload .foto-actions { flex-direction: row; }

  /* ---- lista de profissionais: mostra as profissões inteiras (sem cortar) ---- */
  .person-card .p-nome { white-space: normal; }
  .person-card .p-det { white-space: normal; overflow: visible; text-overflow: clip; }

  /* ---- tabela .tbl-cards vira cartões empilhados (ex.: vendas do mês no caixa) ---- */
  /* nada de rolagem horizontal: cada venda é um cartão com rótulo por campo */
  table.tbl-cards { display: block; width: 100%; min-width: 0; }
  .tbl-cards thead { display: none; }
  .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; width: 100%; }
  .tbl-cards tbody tr {
    border: 1px solid var(--divider); border-radius: 12px;
    padding: 6px 12px; margin-bottom: 10px; background: var(--background-light);
  }
  .tbl-cards tbody tr:last-child { margin-bottom: 0; }
  .tbl-cards tbody tr:hover { background: var(--background-light); }
  .tbl-cards td {
    border: none; padding: 6px 0;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    text-align: right; font-size: 13.5px;
  }
  .tbl-cards td + td { border-top: 1px solid var(--divider); }
  .tbl-cards td::before {
    content: attr(data-label);
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
    color: var(--text-tertiary); text-align: left; flex: none; white-space: nowrap;
  }
  .tbl-cards td[data-label=""] { justify-content: flex-end; }
  .tbl-cards td[data-label=""]::before { content: none; }

  /* ---- form profissional: inputs de serviço não estouram a largura ---- */
  .svc-row .svc-inputs { margin-left: 0; width: 100%; }
  .svc-row .svc-inputs input { flex: 1; min-width: 0; width: auto; }
}
