/* ==========================================================================
   Gestia — telas do sistema (login, painel e área do cliente)
   Usa os tokens e componentes de styles.css.
   ========================================================================== */

[hidden] { display: none !important; }

body.app-body { min-height: 100vh; background: var(--bg); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Controles genéricos ---------- */
.input {
  width: 100%;
  padding: .75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color .2s, box-shadow .2s;
}
.input:hover { border-color: rgba(244, 238, 228, .25); }
.input:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 4px var(--brass-lo); }
select.input {
  padding-right: 2.6rem;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A26B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-position: right .9rem center;
  background-size: 16px;
  background-repeat: no-repeat;
  cursor: pointer;
}
select.input option { background: var(--surface); }
.input-sm { padding: .55rem .8rem; font-size: .9rem; border-radius: 10px; }

.field-hint { color: var(--text-3); font-size: .78rem; }
.field input[type="date"],
.field input[type="time"],
.input[type="date"] { color-scheme: dark; }

.search { position: relative; }
.search .ic { position: absolute; left: .9rem; top: 50%; width: 16px; height: 16px; color: var(--text-3); transform: translateY(-50%); pointer-events: none; }
.search .input { padding-left: 2.5rem; }

.btn-xs { padding: .55em .85em; font-size: .8rem; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a83a33; transform: translateY(-2px); }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: currentColor;
  border-top-color: var(--on-brass);
  animation: spin .8s linear infinite;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .2s, color .2s, background-color .2s;
}
.icon-btn:hover { border-color: var(--brass); color: var(--text); }
.icon-btn.perigo:hover { border-color: var(--red); color: var(--red-soft); }
.icon-btn .ic { width: 18px; height: 18px; }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .2rem;
  padding: .25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.seg button {
  padding: .55rem 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.seg button { display: inline-flex; align-items: center; gap: .4rem; }
.seg button .ic { width: 16px; height: 16px; }
.seg button:hover { color: var(--text); }
.inline-list > * { display: inline-flex; align-items: center; gap: .3rem; }
.inline-list .ic { width: 14px; height: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.menu > summary.btn .ic { width: 14px; height: 14px; }
.seg button[aria-pressed="true"] { background: var(--brass); color: var(--on-brass); }

.switch { position: relative; display: inline-flex; align-items: center; gap: .6rem; color: var(--text-2); font-size: .85rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch .trilho { position: relative; width: 40px; height: 22px; flex-shrink: 0; border-radius: 999px; background: var(--surface-3); transition: background-color .2s; }
.switch .trilho::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform .25s var(--ease), background-color .2s;
}
.switch input:checked + .trilho { background: var(--brass); }
.switch input:checked + .trilho::after { transform: translateX(18px); background: var(--on-brass); }
.switch input:focus-visible + .trilho { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
.switch input:disabled + .trilho { opacity: .5; }

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid rgba(201, 162, 107, .3);
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--brass-hi);
  font-size: .75rem;
  font-weight: 800;
}
.avatar.lg { width: 56px; height: 56px; font-family: var(--font-display); font-size: 1.3rem; font-weight: 400; }

.link { color: var(--brass-hi); font-weight: 700; text-decoration: none; }
.link:hover { text-decoration: underline; }
.muted { color: var(--text-3); }

/* ---------- Cartões e grade ---------- */
.card {
  min-width: 0;
  padding: clamp(18px, 2.5vw, 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.card-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem 1rem; margin-bottom: 1.1rem; }
.card-head h2 { font-size: 1.35rem; }
.card-head p { color: var(--text-3); font-size: .85rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.stat { padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat small { display: flex; align-items: center; gap: .45rem; color: var(--text-3); font-size: .78rem; font-weight: 600; }
.stat small .ic { width: 15px; height: 15px; color: var(--brass); }
.stat strong { display: block; margin-top: .4rem; font-family: var(--font-display); font-size: 1.9rem; font-weight: 400; line-height: 1.1; }
.stat > span { color: var(--text-3); font-size: .78rem; }
.stat.alerta strong { color: var(--red-soft); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.toolbar .grow { flex: 1 1 220px; }

/* ---------- Listas ---------- */
.list { display: grid; gap: .6rem; }
.row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color .2s, background-color .2s;
}
.row:hover { border-color: var(--line-2); }
.row.clicavel { cursor: pointer; }
.row.clicavel:hover { background: var(--surface-2); }
.row.inativo { opacity: .55; }
.row-main { flex: 1; min-width: 0; }
.row-main strong { display: block; overflow: hidden; font-size: .95rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { display: block; overflow: hidden; color: var(--text-3); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: flex; align-items: center; gap: 1.25rem; flex-shrink: 0; color: var(--text-2); font-size: .85rem; }
.row-meta > span { display: grid; text-align: right; }
.row-meta > span small { color: var(--text-3); font-size: .72rem; }
.row-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.inline-list { display: flex; flex-wrap: wrap; gap: .35rem .9rem; color: var(--text-3); font-size: .82rem; }
.inline-list a { color: var(--text-2); text-decoration: none; }
.inline-list a:hover { color: var(--brass-hi); }

/* Agenda */
.ag-item {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: .95rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brass);
  border-radius: 14px;
}
.ag-item[data-status="confirmado"] { border-left-color: var(--green); }
.ag-item[data-status="concluido"] { border-left-color: var(--text-3); }
.ag-item[data-status="cancelado"] { border-left-color: var(--red); opacity: .6; }
.ag-item[data-status="faltou"] { border-left-color: var(--amber); opacity: .75; }
.ag-time strong { display: block; font-family: var(--font-display); font-size: 1.4rem; font-weight: 400; line-height: 1; }
.ag-time small { color: var(--text-3); font-size: .78rem; }
.ag-info { min-width: 0; }
.ag-info > strong { display: block; font-size: .98rem; font-weight: 700; }
.ag-info .inline-list { margin-top: .25rem; }
.ag-obs { margin-top: .4rem; color: var(--text-2); font-size: .82rem; font-style: italic; }
.ag-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .4rem; }

/* Menu suspenso */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 15;
  display: grid;
  min-width: 200px;
  padding: .35rem;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .7);
}
.menu-pop button,
.menu-pop a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .75rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: 600 .86rem var(--font-body);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu-pop button:hover,
.menu-pop a:hover { background: var(--surface-3); }
.menu-pop .perigo { color: var(--red-soft); }
.menu-pop .ic { width: 16px; height: 16px; }

/* Estados */
.empty { padding: 2.5rem 1rem; border: 1px dashed var(--line-2); border-radius: var(--radius-lg); color: var(--text-3); text-align: center; }
.empty .ic { display: block; width: 34px; height: 34px; margin: 0 auto .75rem; color: var(--brass); }
.empty strong { display: block; margin-bottom: .25rem; color: var(--text); font-size: 1.05rem; }
.empty p { max-width: 28rem; margin: 0 auto; font-size: .9rem; }
.empty .btn { margin-top: 1.1rem; }

.loading { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 3rem 1rem; color: var(--text-3); }
.spinner { width: 22px; height: 22px; border: 2px solid var(--line-2); border-top-color: var(--brass); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.aviso {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: 1rem 1.1rem;
  background: var(--brass-lo);
  border: 1px solid rgba(201, 162, 107, .3);
  border-radius: var(--radius);
  font-size: .9rem;
}
.aviso .ic { margin-top: .1rem; color: var(--brass); }
.aviso.erro { background: var(--red-lo); border-color: rgba(194, 75, 67, .35); }
.aviso.erro .ic { color: var(--red-soft); }
.aviso > div { flex: 1; min-width: 0; }
.aviso strong { display: block; }

.link-box {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .4rem .4rem 1rem;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 12px;
}
.link-box code { flex: 1; min-width: 0; overflow: hidden; color: var(--text-2); font-size: .85rem; text-overflow: ellipsis; white-space: nowrap; }

/* Combobox de clientes */
.combo-list {
  display: grid;
  gap: .15rem;
  max-height: 230px;
  margin-top: .4rem;
  padding: .3rem;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.combo-list button {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem .75rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: 600 .88rem var(--font-body);
  text-align: left;
  cursor: pointer;
}
.combo-list button small { color: var(--text-3); font-weight: 500; }
.combo-list button:hover,
.combo-list button:focus-visible { background: var(--surface-2); outline: none; }
.combo-list .novo { color: var(--brass-hi); }
.combo-sel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem .7rem .7rem 1rem;
  background: var(--brass-lo);
  border: 1px solid rgba(201, 162, 107, .45);
  border-radius: 12px;
}
.combo-sel small { display: block; color: var(--text-3); }

/* Barra de nível */
.nivel { display: flex; align-items: center; gap: .6rem; min-width: 150px; }
.nivel .meter { flex: 1; }
.nivel .meter.baixo i { background: var(--red); }
.nivel .meter.atencao i { background: var(--amber); }

.historico { display: grid; gap: .1rem; max-height: 340px; overflow-y: auto; }
.historico li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .86rem; }
.historico li:last-child { border-bottom: 0; }
.historico small { display: block; color: var(--text-3); }
.historico ul, ul.historico { margin: 0; padding: 0; list-style: none; }

.barras { display: grid; gap: .7rem; }
.barras li { display: grid; gap: .3rem; list-style: none; }
.barras ul, ul.barras { margin: 0; padding: 0; }
.barras p { display: flex; justify-content: space-between; font-size: .85rem; }
.barras p span { color: var(--text-2); }

.dias-semana { display: flex; flex-wrap: wrap; gap: .4rem; }

/* Comissões */
.input-sufixo { position: relative; }
.input-sufixo input { padding-right: 2.2rem !important; }
.input-sufixo > span { position: absolute; top: 50%; right: .9rem; color: var(--text-3); font-weight: 700; transform: translateY(-50%); pointer-events: none; }
.exemplo { padding: .8rem 1rem; background: var(--bg); border: 1px dashed var(--line-2); border-radius: 12px; color: var(--text-2); font-size: .88rem; }
.valor-ganho { color: var(--brass-hi); }
.row.ganho .row-meta strong { font-weight: 800; }

/* Contato com o cliente */
.contato-canais { display: flex; flex-wrap: wrap; gap: .5rem; }
.contato-canais .btn { flex: 1 1 140px; }
.contato-dados { display: flex; align-items: center; gap: .9rem; }
.contato-dados > div { min-width: 0; }
.contato-dados strong { display: block; }
.contato-dados small { display: block; color: var(--text-3); }
.btn-whats { background: #25D366; color: #0b2e17; }
.btn-whats:hover { background: #3ee07a; transform: translateY(-2px); }
.dias-semana .chip { padding: .5rem .8rem; }

/* ---------- Modal ---------- */
dialog.modal {
  width: 100%;
  max-width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}
dialog.modal.largo { max-width: min(780px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(6, 5, 4, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog.modal[open] { animation: modal-in .28s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.modal-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 24px);
  margin: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 22px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 1.45rem; }
.modal-body { display: grid; gap: 1rem; padding: 1.25rem; overflow-y: auto; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; padding: 1rem 1.25rem; border-top: 1px solid var(--line); }
.modal-erro { padding: .75rem 1rem; background: var(--red-lo); border-radius: 10px; color: var(--red-soft); font-size: .875rem; }
.modal-texto { color: var(--text-2); }
.modal-body .form-grid { gap: 1rem; }
.secao-titulo {
  color: var(--text-3);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 100;
  display: grid;
  gap: .5rem;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
}
.toast-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .8);
  font-size: .9rem;
  animation: toast-in .3s var(--ease);
  transition: opacity .3s, transform .3s;
}
.toast-item .ic { color: var(--green); stroke-width: 2.5; }
.toast-item.erro .ic { color: var(--red-soft); }
.toast-item.saindo { opacity: 0; transform: translateY(10px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Tela de configuração pendente ---------- */
.setup { max-width: 560px; margin: 12vh auto; padding: 0 16px; text-align: center; }
.setup > .ic { width: 40px; height: 40px; margin: 0 auto 1rem; color: var(--brass); }
.setup h1 { margin-bottom: 1rem; font-size: 2rem; }
.setup p { margin-bottom: .9rem; color: var(--text-2); }
.setup code { padding: .1em .4em; background: var(--surface-2); border-radius: 6px; color: var(--brass-hi); font-size: .9em; }
.setup .btn { margin-top: 1rem; }

/* ==========================================================================
   Login / cadastro
   ========================================================================== */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-aside {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(32px, 5vw, 56px);
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 80% 20%, rgba(201, 162, 107, .16), transparent 70%),
    radial-gradient(40% 40% at 0% 100%, rgba(194, 75, 67, .1), transparent 70%),
    #0A0908;
  border-right: 1px solid var(--line);
}
.auth-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 60% 40%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 60% 40%, #000 10%, transparent 75%);
}
.auth-aside h2 { max-width: 30rem; margin: 1.25rem 0 1.25rem; font-size: clamp(2.2rem, 1.4rem + 2.4vw, 3.4rem); }
.auth-aside .checklist li { color: var(--text-2); }
.auth-aside blockquote { max-width: 28rem; color: var(--text-2); font-size: 1.15rem; }
.auth-aside blockquote footer { margin-top: .6rem; color: var(--text-3); font-family: var(--font-body); font-size: .85rem; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .logo { display: none; margin-bottom: 2rem; }
.auth-card h1 { margin-bottom: .5rem; font-size: clamp(1.9rem, 1.5rem + 1.2vw, 2.4rem); }
.auth-card .sub { margin-bottom: 1.75rem; color: var(--text-2); }
.auth-card form { display: grid; gap: 1rem; }
.auth-card .btn-lg { width: 100%; margin-top: .25rem; }
.auth-tabs { display: flex; width: 100%; margin-bottom: 1.75rem; }
.auth-tabs button { flex: 1; }
.tipo-conta { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.tipo-conta label {
  display: grid;
  justify-items: center;
  gap: .35rem;
  padding: .85rem .5rem;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  color: var(--text-2);
  font-size: .8rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s;
}
.tipo-conta label:hover { border-color: var(--brass); color: var(--text); }
.tipo-conta input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tipo-conta .ic { width: 22px; height: 22px; color: var(--brass); }
.tipo-conta label:has(input:checked) { background: var(--brass-lo); border-color: var(--brass); color: var(--text); }
.tipo-conta label:has(input:focus-visible) { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
.senha-wrap { position: relative; }
.senha-wrap input { padding-right: 3rem; }
.senha-wrap .icon-btn { position: absolute; top: 50%; right: .35rem; width: 34px; height: 34px; border: 0; transform: translateY(-50%); }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; font-size: .88rem; }
.auth-links button { padding: 0; border: 0; background: none; color: var(--brass-hi); font: 700 .88rem var(--font-body); cursor: pointer; }
.auth-links button:hover { text-decoration: underline; }
.auth-foot { margin-top: 2rem; color: var(--text-3); font-size: .85rem; text-align: center; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-card .logo { display: inline-flex; }
}

/* ==========================================================================
   Painel (equipe)
   ========================================================================== */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  height: 100vh;
  padding: 1.25rem .9rem;
  overflow-y: auto;
  background: #0A0908;
  border-right: 1px solid var(--line);
}
.sidebar .logo { padding: .25rem .5rem; font-size: 1.5rem; }
.sidebar .logo-mark { width: 32px; height: 32px; }

.shop-box { padding: .85rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.shop-box small { display: block; color: var(--text-3); font-size: .66rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.shop-box strong { display: block; margin-top: .2rem; overflow: hidden; font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.shop-box .input { margin-top: .5rem; }

.side-nav { display: grid; gap: .15rem; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .68rem .8rem;
  border-radius: 12px;
  color: var(--text-2);
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s, color .2s;
}
.side-nav a:hover { background: var(--surface); color: var(--text); }
.side-nav a[aria-current="page"] { background: var(--brass-lo); color: var(--brass-hi); box-shadow: inset 2px 0 0 var(--brass); }
.side-nav .ic { width: 19px; height: 19px; }
.side-sep { height: 1px; margin: .35rem .3rem; background: var(--line); }
.side-titulo { padding: .3rem .8rem 0; color: var(--text-3); font-size: .66rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.side-foot { display: grid; gap: .5rem; margin-top: auto; }
.user-card { display: flex; align-items: center; gap: .7rem; padding: .7rem; border: 1px solid var(--line); border-radius: 14px; }
.user-card > div { min-width: 0; flex: 1; }
.user-card strong { display: block; overflow: hidden; font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.user-card .tag { margin-top: .2rem; }

.app-main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .9rem;
  min-height: 68px;
  padding: .85rem clamp(16px, 3vw, 32px);
  background: rgba(14, 13, 11, .86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { flex: 1; min-width: 0; overflow: hidden; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem); text-overflow: ellipsis; white-space: nowrap; }
.topbar-acoes { display: flex; gap: .5rem; }
.nav-btn { display: none; }
.view { display: grid; align-content: start; gap: 1.25rem; width: 100%; max-width: 1280px; padding: clamp(16px, 3vw, 32px); }
.scrim { display: none; }

.saudacao h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); }
.saudacao p { color: var(--text-3); }

.acoes-rapidas { display: flex; flex-wrap: wrap; gap: .6rem; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(290px, 86vw);
    transform: translateX(-100%);
    transition: transform .3s var(--ease);
  }
  .sidebar.is-open { transform: none; box-shadow: 30px 0 60px rgba(0, 0, 0, .55); }
  .scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility 0s linear .3s;
  }
  .scrim.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
  .nav-btn { display: inline-grid; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .row { flex-wrap: wrap; }
  .row-meta { order: 3; width: 100%; flex-wrap: wrap; gap: .5rem 1.25rem; }
  .row-meta > span { text-align: left; }
  .ag-item { grid-template-columns: 4rem minmax(0, 1fr); }
  .ag-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .topbar-acoes .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topbar-acoes .btn { padding: .7em; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat strong { font-size: 1.55rem; }
}

@media (max-width: 560px) {
  dialog.modal,
  dialog.modal.largo { max-width: 100vw; margin: auto 0 0; }
  .modal-card { border-radius: 22px 22px 0 0; }
  .modal-foot .btn { flex: 1; }
  .tipo-conta label { font-size: .74rem; }
}

/* ==========================================================================
   Área do cliente
   ========================================================================== */
.cli-top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(14, 13, 11, .86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.cli-top .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.cli-top .logo { font-size: 1.5rem; }
.cli-top .logo-mark { width: 32px; height: 32px; }
.cli-main { padding-block: clamp(20px, 4vw, 40px) 64px; }
.cli-main .container { display: grid; gap: 1.25rem; max-width: 960px; }
.cli-head h1 { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); }
.cli-head p { color: var(--text-2); }

.passo { display: grid; gap: .8rem; }
.passo + .passo { padding-top: 1.25rem; border-top: 1px solid var(--line); }
.passo h3 { font-family: var(--font-body); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }

.shop-card { display: flex; align-items: center; gap: 1rem; }
.shop-card > div { flex: 1; min-width: 0; }
.shop-card strong { display: block; font-size: 1.05rem; }
.shop-card small { display: block; color: var(--text-3); font-size: .84rem; }

.dias { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.dias::-webkit-scrollbar { height: 6px; }
.dias::-webkit-scrollbar-track { background: transparent; }
.dias::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }
html { color-scheme: dark; }
.dia {
  position: relative;
  display: grid;
  flex: 0 0 64px;
  justify-items: center;
  gap: .1rem;
  padding: .6rem 0;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color .2s, background-color .2s;
}
.dia input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dia small { color: var(--text-3); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.dia strong { font-family: var(--font-display); font-size: 1.4rem; font-weight: 400; line-height: 1.1; }
.dia:hover { border-color: var(--brass); }
.dia:has(input:checked) { background: var(--brass); border-color: var(--brass); color: var(--on-brass); }
.dia:has(input:checked) small { color: rgba(23, 18, 11, .7); }
.dia:has(input:disabled) { opacity: .3; cursor: not-allowed; }
.dia:has(input:focus-visible) { outline: 2px solid var(--brass-hi); outline-offset: 2px; }

.resumo-agendamento {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
}
.resumo-agendamento p { color: var(--text-2); font-size: .92rem; }
.resumo-agendamento strong { color: var(--text); }

.shop-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.shop-lista button {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, transform .2s var(--ease);
}
.shop-lista button:hover { border-color: var(--brass); transform: translateY(-2px); }
.shop-lista strong { display: block; }
.shop-lista small { color: var(--text-3); font-size: .8rem; }

@media (max-width: 720px) {
  .cli-top .tabs-cli { display: none; }
}

/* ==========================================================================
   Planos e assinatura
   ========================================================================== */
.aviso-assinatura {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem clamp(16px, 3vw, 32px);
  background: var(--brass-lo);
  border-bottom: 1px solid rgba(201, 162, 107, .25);
  font-size: .88rem;
}
.aviso-assinatura .ic { flex-shrink: 0; color: var(--brass); }
.aviso-assinatura p { flex: 1; min-width: 0; color: var(--text-2); }
.aviso-assinatura strong { color: var(--text); }

.side-nav a.travado { color: var(--text-3); }
.side-nav a .cadeado { width: 14px; height: 14px; margin-left: auto; opacity: .7; }

.empty.upsell { border-style: solid; background: var(--surface); }
.empty.upsell > .ic { color: var(--brass); }

.plans-painel { gap: 1rem; }
.plans-painel .plan { padding: 1.5rem; }
.plans-painel .plan .amount { font-size: 2.8rem; }
.plans-painel .plan .checklist { margin: 1.25rem 0 1.5rem; padding-top: 1.25rem; }

.pagamento { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.pagamento p + p { margin-top: .35rem; }
.valor-plano { font-family: var(--font-display); font-size: 2.2rem; line-height: 1.1; color: var(--text); }
.valor-plano span { font-family: var(--font-body); font-size: .9rem; color: var(--text-3); }
.pagamento-acoes { display: grid; gap: .6rem; justify-items: start; }

.chips-unidades { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }

/* Cartão fidelidade */
.stamps.livre { display: flex; flex-wrap: wrap; gap: .45rem; }
.stamps.livre i { width: 24px; height: 24px; }
.tag-cortesia { color: var(--green); background: var(--green-lo); }

@media (max-width: 720px) {
  .pagamento { grid-template-columns: 1fr; }
}

/* Página exclusiva da barbearia (agendar.html) */
.cli-top .logo .shop-avatar.marca { width: 36px; height: 36px; border-radius: 11px; font-size: 1.15rem; }
.cli-top .logo .marca-nome {
  max-width: 52vw;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.35rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.credito { padding: .5rem 0 0; color: var(--text-3); font-size: .8rem; text-align: center; }
.credito a { color: var(--text-2); text-decoration: none; }
.credito a:hover { color: var(--brass-hi); }

#convites:empty,
#fidelidade:empty { display: none; }

/* ==========================================================================
   Fotos dos profissionais
   ========================================================================== */
img.avatar { object-fit: cover; padding: 0; background: var(--surface-3); }
.avatar.xl { width: 120px; height: 120px; font-family: var(--font-display); font-size: 2.4rem; font-weight: 400; }
.avatar-btn {
  position: relative;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.avatar-btn:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
.avatar-cam {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--brass);
  color: var(--on-brass);
  opacity: 0;
  transition: opacity .2s;
}
.avatar-cam .ic { width: 11px; height: 11px; }
.avatar-btn:hover .avatar-cam,
.avatar-btn:focus-visible .avatar-cam,
.avatar-btn .avatar.lg + .avatar-cam { opacity: 1; }
.avatar-btn .avatar.lg + .avatar-cam { width: 24px; height: 24px; }
.avatar-btn .avatar.lg + .avatar-cam .ic { width: 13px; height: 13px; }
@media (hover: none) { .avatar-cam { opacity: 1; } }
.foto-editor { display: grid; justify-items: center; gap: 1rem; text-align: center; }
.foto-editor .acoes-rapidas { justify-content: center; }
.btn.perigo:hover { border-color: var(--red); color: var(--red-soft); }
.tag .ic { width: 12px; height: 12px; }

/* Escolha do profissional, com foto (agendar e reagendar) */
.profs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .6rem; }
.prof {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: .55rem;
  padding: .95rem .5rem .85rem;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  color: var(--text-2);
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: border-color .2s, background-color .2s, transform .2s var(--ease);
}
.prof input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.prof .avatar { width: 64px; height: 64px; font-size: 1.15rem; transition: box-shadow .2s; }
.prof:hover { border-color: var(--brass); color: var(--text); }
.prof:active { transform: scale(.97); }
.prof:has(input:checked) { border-color: var(--brass); background: var(--brass-lo); color: var(--text); }
.prof:has(input:checked) .avatar { box-shadow: 0 0 0 3px var(--brass); }
.prof:has(input:focus-visible) { outline: 2px solid var(--brass-hi); outline-offset: 2px; }

/* ==========================================================================
   Link da rede: escolha da unidade com a distância
   ========================================================================== */
.local-barra { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.unidades { display: grid; gap: .75rem; }
.unidade {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "av info dist" "av acoes acoes";
  align-items: center;
  gap: .7rem 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color .2s;
}
.unidade:hover { border-color: var(--line-2); }
.unidade.perto { border-color: var(--brass); }
.unidade > .shop-avatar { grid-area: av; align-self: start; }
.unidade-info { grid-area: info; display: grid; gap: .3rem; min-width: 0; }
.unidade-info strong { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: 1.02rem; }
.unidade-info small { display: flex; align-items: flex-start; gap: .4rem; color: var(--text-3); font-size: .84rem; }
.unidade-info small .ic { width: 14px; height: 14px; flex-shrink: 0; margin-top: .15rem; }
.unidade-dist { grid-area: dist; display: grid; justify-items: end; text-align: right; }
.unidade-dist strong { font-family: var(--font-display); font-size: 1.4rem; font-weight: 400; line-height: 1.1; color: var(--brass-hi); white-space: nowrap; }
.unidade-dist small { color: var(--text-3); font-size: .78rem; }
.unidade-acoes { grid-area: acoes; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
@media (max-width: 560px) {
  .unidade { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "av info" "dist dist" "acoes acoes"; }
  .unidade-dist { justify-items: start; text-align: left; }
  .unidade-dist:empty { display: none; }
  .unidade-acoes > * { flex: 1; justify-content: center; }
}

/* Comissões: ver a rede inteira ou uma unidade */
.escopo { display: inline-flex; align-items: center; gap: .45rem; color: var(--text-3); }
.escopo .ic { width: 16px; height: 16px; }
.escopo select { width: auto; min-width: 210px; }

/* Em tela estreita, se o nome ficaria espremido, os controles da linha descem para baixo dele */
@media (max-width: 560px) {
  .row-main { min-width: 8.5rem; }
}
