/* ============================================================
   App da profissional — celular primeiro (Anexo I, 1.2 e 3.0).
   Paleta rosa do App (base.css); telas largas ganham menu lateral.
   ============================================================ */
@import url('base.css');

body.ap { background: var(--bg); padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.ap-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); background: rgba(251, 245, 247, .94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.ap-top h1 { font-size: 1.12rem; margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-top .ap-brand { display: flex; align-items: center; gap: 8px; margin-right: auto; min-width: 0; }
.ap-top .ap-brand img { width: 30px; height: 30px; }
.ap-top .ap-brand b { font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--rose-900); color: #fff; font-weight: 700; font-size: .82rem; flex: 0 0 38px; }
.ap-content { width: 100%; max-width: 760px; margin-inline: auto; padding: 14px 14px 24px; display: flex; flex-direction: column; gap: 14px; }

/* Barra de abas inferior (celular) / menu lateral (tela larga) */
.ap-tabs { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.ap-tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 62px; font-size: .7rem; font-weight: 600; color: var(--ink-3); }
.ap-tabs a svg { width: 22px; height: 22px; }
.ap-tabs a.is-active { color: var(--rose-900); }
.ap-tabs a.is-active svg { color: var(--pink-500); }

/* Cartões e listas */
.ap-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ap-card > h2, .ap-section-title { font-size: .98rem; display: flex; align-items: center; gap: 8px; }
.ap-section-title { margin: 6px 2px -4px; color: var(--ink-2); }
.ap-card--accent { background: linear-gradient(140deg, var(--rose-900), var(--rose-700)); color: #fff; border: 0; }
.ap-card--accent .lv-help, .ap-card--accent small { color: #F6D0E0; }
.ap-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.ap-item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line-2); text-align: left; width: 100%; box-shadow: inset 4px 0 0 transparent; }
.ap-item:last-child { border-bottom: 0; }
button.ap-item:hover, a.ap-item:hover { background: var(--rose-50); }
.ap-item .ap-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ap-item .ap-item-main b { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-item .ap-item-main small { color: var(--ink-3); font-size: .8rem; }
.ap-item .ap-item-side { text-align: right; font-size: .86rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ap-item .ap-time { font-weight: 700; font-size: .95rem; min-width: 50px; font-variant-numeric: tabular-nums; }
.ap-item.tone-info { box-shadow: inset 4px 0 0 var(--rose-600); }
.ap-item.tone-success { box-shadow: inset 4px 0 0 var(--green-600); }
.ap-item.tone-warning { box-shadow: inset 4px 0 0 var(--amber-500); }
.ap-item.tone-danger { box-shadow: inset 4px 0 0 var(--red-500); }
.ap-item.tone-neutral { box-shadow: inset 4px 0 0 var(--ink-4); }
.ap-item .ap-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--rose-50); color: var(--rose-700); flex: 0 0 40px; }

/* Indicadores */
.ap-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ap-stat { background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; }
.ap-stat small { color: var(--ink-3); font-size: .76rem; display: flex; align-items: center; gap: 6px; }
.ap-stat b { display: block; font-size: 1.25rem; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ap-stat.is-in b { color: var(--green-700); }
.ap-stat.is-out b { color: var(--red-600); }

/* Botão flutuante de adicionar */
.ap-fab { position: fixed; z-index: 44; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; background: var(--pink-500); color: #fff; display: grid; place-items: center; box-shadow: var(--sh-md); }
.ap-fab svg { width: 26px; height: 26px; }

/* Controle segmentado e chips */
.ap-seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; overflow-x: auto; }
.ap-seg button { flex: 1; height: 36px; padding: 0 12px; border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.ap-seg button.is-active { background: var(--rose-900); color: #fff; }
.ap-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.ap-slot { height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 650; font-variant-numeric: tabular-nums; }
.ap-slot.is-active { background: var(--rose-900); border-color: var(--rose-900); color: #fff; }
.ap-days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.ap-day { flex: 0 0 64px; height: 72px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .74rem; color: var(--ink-3); }
.ap-day b { font-size: 1.2rem; color: var(--ink); }
.ap-day.is-active { background: var(--rose-900); border-color: var(--rose-900); color: #F3C9DB; }
.ap-day.is-active b { color: #fff; }
.ap-day:disabled { opacity: .45; }

/* Calendário do mês */
.ap-cal { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px; }
.ap-cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.ap-cal-head b { margin-right: auto; }
.ap-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ap-cal-grid span { text-align: center; font-size: .68rem; color: var(--ink-3); font-weight: 650; text-transform: uppercase; padding: 2px 0; }
.ap-cal-grid button { aspect-ratio: 1; border-radius: 10px; font-size: .86rem; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative; }
.ap-cal-grid button.is-out { color: var(--ink-4); }
.ap-cal-grid button.is-today { box-shadow: inset 0 0 0 1.5px var(--pink-500); }
.ap-cal-grid button.is-active { background: var(--rose-900); color: #fff; }
.ap-cal-grid button i { width: 5px; height: 5px; border-radius: 50%; background: var(--rose-600); display: block; }
.ap-cal-grid button.is-active i { background: #fff; }
.ap-cal-grid button.is-blocked { background: repeating-linear-gradient(-45deg, var(--surface-2), var(--surface-2) 4px, var(--line-2) 4px, var(--line-2) 8px); }

/* Folha inferior (formulários) */
.ap-sheet { position: fixed; inset: 0; z-index: 90; visibility: hidden; }
.ap-sheet.is-open { visibility: visible; }
.ap-sheet-bg { position: absolute; inset: 0; background: rgba(46, 10, 29, .45); opacity: 0; transition: var(--t); }
.ap-sheet.is-open .ap-sheet-bg { opacity: 1; }
.ap-sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; background: var(--bg); border-radius: 22px 22px 0 0; transform: translateY(100%); transition: transform .28s var(--ease); display: flex; flex-direction: column; margin-inline: auto; max-width: 760px; }
.ap-sheet.is-open .ap-sheet-panel { transform: none; }
.ap-sheet-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.ap-sheet-head h2 { font-size: 1.05rem; margin-right: auto; }
.ap-sheet-body { padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.ap-sheet-foot { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); display: flex; gap: 10px; }
.ap-sheet-foot .lv-btn { flex: 1; }

.ap-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ap-form .lv-field { grid-column: 1 / -1; }
.ap-form .lv-field.half { grid-column: span 1; }
.ap-dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; font-size: .9rem; margin: 0; }
.ap-dl dt { color: var(--ink-3); }
.ap-dl dd { margin: 0; overflow-wrap: anywhere; }
.ap-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-actions .lv-btn { height: 42px; padding: 0 16px; font-size: .88rem; }
.ap-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ap-menu a { background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; font-weight: 650; font-size: .92rem; }
.ap-menu a svg { width: 24px; height: 24px; color: var(--rose-700); }
.ap-menu a small { color: var(--ink-3); font-weight: 500; font-size: .76rem; }
.ap-copy { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; font-size: .84rem; }
.ap-copy span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--surface-2); flex: 0 0 52px; }

/* Avisos do App instalado (sem conexão, instalar, versão nova) */
#apAvisos { display: flex; flex-direction: column; gap: 8px; }
#apAvisos:empty { display: none; }
.ap-aviso { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; font-size: .86rem; background: var(--surface); border: 1px solid var(--line-2); }
.ap-aviso > span { flex: 1; min-width: 0; }
.ap-aviso svg.lucide { display: inline-block; vertical-align: -2px; }
.ap-aviso--aviso { background: var(--amber-50); color: var(--amber-700); border-color: transparent; }
.ap-aviso--info { background: var(--rose-50); color: var(--rose-800); border-color: transparent; }
.ap-aviso .lv-icon-btn { width: 34px; height: 34px; flex: 0 0 34px; }
.ap-card p svg.lucide { display: inline-block; vertical-align: -2px; }

/* Páginas públicas (página da profissional, convite, entrada) */
.pb { min-height: 100vh; }
.pb-hero { background: linear-gradient(150deg, var(--rose-900), var(--pink-600)); color: #fff; padding: 28px 16px 64px; text-align: center; }
.pb-hero img.pb-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; border: 3px solid rgba(255, 255, 255, .8); background: var(--rose-800); }
.pb-hero h1 { font-size: 1.6rem; }
.pb-hero p { color: #FBDDEA; margin-top: 6px; }
.pb-body { max-width: 720px; margin: -44px auto 0; padding: 0 14px 40px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.pb-foot { text-align: center; color: var(--ink-3); font-size: .78rem; padding: 18px 14px 28px; }
.pb-auth { min-height: 100vh; display: grid; place-items: center; padding: 20px 14px; background: linear-gradient(150deg, var(--rose-900), var(--pink-600)); }
.pb-auth form, .pb-auth .lv-box { width: min(460px, 100%); }

@media (min-width: 960px) {
  body.ap { padding-bottom: 0; padding-left: 232px; }
  .ap-tabs { top: 0; bottom: 0; right: auto; width: 232px; grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: start; gap: 4px; padding: 76px 12px 12px; border-top: 0; border-right: 1px solid var(--line); }
  .ap-tabs a { flex-direction: row; justify-content: flex-start; gap: 12px; height: 46px; padding: 0 14px; border-radius: 12px; font-size: .9rem; }
  .ap-tabs a.is-active { background: var(--rose-50); }
  .ap-fab { bottom: 24px; right: 24px; }
  .ap-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ap-menu { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .ap-form { grid-template-columns: 1fr; }
  .ap-form .lv-field.half { grid-column: 1 / -1; }
  .ap-dl { grid-template-columns: 1fr; }
}

/* Pedido de agendamento da cliente: situação, Pix do sinal (QR e copia-e-cola). */
.pa-ico { width: 52px; height: 52px; color: var(--amber-700); margin: 0 auto; }
.pa-ico.is-ok { color: var(--green-600); }
.pa-qr { width: 220px; max-width: 100%; height: auto; margin: 0 auto; display: block; background: #fff; border-radius: 12px; }
.pa-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; word-break: break-all; }
/* Central de notificações (sino) */
.ap-bell { position: relative; }
/* Botão "Ajuda" (Central de Ajuda) no topo: só o ícone; o rótulo fica para leitores de tela. */
.ap-ajuda { display: inline-flex; }
.ap-ajuda .ajc-rotulo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ap-bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--pink-600, #D63477); color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; }
.ap-notif { display: flex; gap: 10px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: inherit; }
.ap-notif.is-new b { color: var(--rose-700, #7A1A4A); }
.ap-notif small { display: block; color: var(--ink-3); }
