/* Tema claro unico, espelhando o app nativo (combinei-app/src/theme).
   O painel ja teve um bloco prefers-color-scheme: dark - foi removido de
   proposito: o app e light-only, e com o modo escuro ligado os dois viravam
   produtos visualmente diferentes pro mesmo salao. */
:root {
  color-scheme: light;

  --pink-50: #fff5f8;
  --pink-100: #ffe4ec;
  --pink-200: #ffc9d9;
  --pink-300: #ffaec7;
  --pink-400: #ff8fb3;
  --pink-500: #ff6a9c; /* cor de marca, extraida do toutlissie.com.br */
  --pink-600: #f2477e;
  --pink-700: #d6336c;
  --pink-800: #a82655;
  --pink-900: #7a1f3d;

  --ink: #241820;
  --muted: #8a6b76;
  --surface: #ffffff;
  --bg: var(--pink-50);
  --border: #ffd9e4;
  --shadow: 0 6px 20px rgba(214, 51, 108, 0.10);
  --shadow-sm: 0 2px 8px rgba(214, 51, 108, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-width: 232px;

  --status-confirmado-bg: #e3f7ec; --status-confirmado-fg: #1a8f5f;
  --status-pendente-bg: #fff2d9; --status-pendente-fg: #a8720b;
  --status-cancelado-bg: #ffe3ea; --status-cancelado-fg: #c22458;
  --status-concluido-bg: #e8e6ff; --status-concluido-fg: #5b4bd6;
}

* { box-sizing: border-box; }

body {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pink-700); }

h1, h2, h3 { font-weight: 700; margin: 0 0 1rem; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.15rem; color: var(--pink-800); }

/* ---------- shell / sidebar ---------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: 0; bottom: 0; left: 0;
  background: linear-gradient(165deg, var(--pink-700), var(--pink-900));
  color: #fff;
  padding: 1.75rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.hamburger {
  display: none;
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  box-shadow: none;
  flex-shrink: 0;
}
.hamburger svg { width: 22px; min-width: 22px; height: 22px; flex-shrink: 0; }
.hamburger:hover { background: rgba(255, 255, 255, 0.24); }

.sidebar .brand {
  display: block;
  margin-bottom: 0.25rem;
}

.sidebar .brand img {
  display: block;
  width: 100%;
  max-width: 172px;
  height: auto;
  margin: 0 auto;
}

.sidebar .tagline {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
  margin-bottom: 1.75rem;
}

.sidebar nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.93rem;
  transition: background 0.15s, color 0.15s;
}

.sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.9; }
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.sidebar nav a.active { background: rgba(255, 255, 255, 0.22); color: #fff; }

.sidebar .signed-in {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 1rem;
  margin-top: 0.5rem;
}

.sidebar .signed-in .who { font-size: 0.85rem; color: rgba(255, 255, 255, 0.85); margin-bottom: 0.5rem; }
.sidebar .signed-in form button {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 100%;
  box-shadow: none;
}
.sidebar .signed-in form button:hover { background: rgba(255, 255, 255, 0.22); }

.main { margin-left: var(--sidebar-width); flex: 1; padding: 2rem 2.5rem 4rem; max-width: 1180px; }

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-header p { color: var(--muted); margin: -0.75rem 0 0; }

/* ---------- login (sem sidebar) ---------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, var(--pink-200), transparent 55%),
              radial-gradient(circle at 80% 80%, var(--pink-300), transparent 55%),
              var(--bg);
  padding: 1.5rem;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.auth-card .brand img {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 auto 0.15rem;
}

.auth-card .tagline {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 2rem;
}

.auth-card form { display: flex; flex-direction: column; gap: 1rem; text-align: left; }
.auth-card label { font-size: 0.85rem; font-weight: 500; color: var(--muted); display: flex; flex-direction: column; gap: 0.35rem; }
.auth-card button { margin-top: 0.5rem; }

/* ---------- cards / stats ---------- */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-tile {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.4rem;
}

.stat-tile .label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.stat-tile .value { font-size: 1.9rem; font-weight: 700; color: var(--ink); margin-top: 0.3rem; }
.stat-tile .delta { font-size: 0.82rem; margin-top: 0.35rem; font-weight: 600; }
.stat-tile .delta.positive { color: #1a8f5f; }
.stat-tile .delta.negative { color: var(--pink-700); }
.stat-tile .delta.neutral { color: var(--muted); font-weight: 500; }

/* ---------- forms ---------- */

form.inline {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: end;
}

form.inline label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  gap: 0.3rem;
}

input, select, textarea {
  font-family: inherit;
  font-size: 0.92rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  color: var(--ink);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--pink-500);
  box-shadow: 0 0 0 3px rgba(255, 106, 156, 0.22);
}

button, .btn {
  font-family: inherit;
  background: var(--pink-700);
  color: #fff;
  border: none;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, background 0.15s ease;
}

.btn { text-decoration: none; display: inline-block; }

button:hover, .btn:hover { background: var(--pink-600); transform: translateY(-1px); }
button:active { transform: translateY(0); }

button.secondary, .btn.secondary {
  background: var(--surface);
  color: var(--pink-700);
  border: 1px solid var(--pink-200);
  box-shadow: none;
}
button.secondary:hover { background: var(--pink-50); }

button.danger, .btn.danger {
  background: var(--surface);
  color: var(--status-cancelado-fg);
  border: 1px solid var(--status-cancelado-bg);
  box-shadow: none;
}
button.danger:hover { background: var(--status-cancelado-bg); }

.row-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.row-actions button, .row-actions .btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 1.5rem; }

thead th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  padding: 0.6rem 0.9rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody td { padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
tbody tr:hover { background: var(--pink-50); }

.status-pill {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}
.status-confirmado { background: var(--status-confirmado-bg); color: var(--status-confirmado-fg); }
.status-pendente { background: var(--status-pendente-bg); color: var(--status-pendente-fg); }
.status-cancelado, .status-no_show { background: var(--status-cancelado-bg); color: var(--status-cancelado-fg); }
.status-concluido { background: var(--status-concluido-bg); color: var(--status-concluido-fg); }

.day-nav { display: flex; gap: 1.25rem; align-items: end; margin-bottom: 1.25rem; }
.erro { color: var(--pink-700); font-weight: 500; }
.hint { color: var(--muted); font-size: 0.85rem; }
.empty-state { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* ---------- financeiro ---------- */

.chart-card { padding: 1.5rem; }
.chart-card canvas { max-height: 320px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 999px; margin-right: 0.4rem; }

/* ==========================================================================
   Versao mobile - so entra abaixo de 768px. Acima disso nada muda: o
   desktop continua exatamente como estava.
   ========================================================================== */
@media (max-width: 768px) {
  .app-shell { flex-direction: column; min-height: auto; }

  .sidebar {
    position: relative;
    top: auto; bottom: auto; left: auto;
    width: 100%;
    padding: 0.85rem 1rem;
    gap: 0;
  }

  .sidebar .brand { margin-bottom: 0; }
  .sidebar .brand img { max-width: 132px; margin: 0; }
  .sidebar .tagline { display: none; }
  .hamburger { display: inline-flex; }

  .sidebar nav,
  .sidebar .signed-in {
    display: none;
    width: 100%;
  }

  .sidebar.nav-open .tagline { display: block; text-align: left; margin: 0.85rem 0 0.5rem; }
  .sidebar.nav-open nav { display: flex; margin-top: 0.75rem; }
  .sidebar.nav-open .signed-in { display: block; }

  .main { margin-left: 0; padding: 1.25rem 1rem 3rem; max-width: 100%; }

  .page-header { flex-direction: column; align-items: flex-start; }

  form.inline { gap: 0.75rem; }
  form.inline label { flex: 1 1 100%; }
  form.inline button, form.inline .btn { width: 100%; }

  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

  .auth-card { padding: 2rem 1.5rem; }

  .row-actions { flex-wrap: wrap; }
  .row-actions button, .row-actions .btn { flex: 1 1 auto; }
}

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

/* ---------------------------------------------------------------------------
   Componentes espelhados do app nativo (combinei-app/src/components).
   O painel e o app sao dois front-ends do mesmo backend: se a agenda for
   tabela num lado e card no outro, o salão acha que sao dois produtos.
   Medidas em px batendo com o spacing(n) = n*4 do tema do app.
   --------------------------------------------------------------------------- */

/* DayStrip.tsx - faixa de dias rolavel */
.day-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}
.day-strip::-webkit-scrollbar { display: none; }
.day-strip a {
  flex: 0 0 auto;
  width: 48px;
  padding: 10px 0;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.day-strip a:hover { border-color: var(--pink-300); }
.day-strip .semana {
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  line-height: 1;
}
.day-strip .numero { font-size: 0.94rem; font-weight: 500; line-height: 1; }
.day-strip .ponto-hoje { width: 4px; height: 4px; border-radius: 50%; background: var(--pink-700); }
.day-strip a.ativo { background: var(--pink-700); border-color: var(--pink-700); }
.day-strip a.ativo .semana,
.day-strip a.ativo .numero { color: #fff; }
.day-strip a.ativo .ponto-hoje { background: #fff; }

/* Filtros em pilula (chips de profissional) */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.81rem;
  text-decoration: none;
  white-space: nowrap;
}
.chip:hover { border-color: var(--pink-300); }
.chip .ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--cor, var(--pink-700)); }
.chip.ativo {
  background: var(--cor, var(--pink-700));
  border-color: var(--cor, var(--pink-700));
  color: #fff;
}
.chip.ativo .ponto { display: none; }

/* AppointmentCard.tsx */
.agenda-lista { display: flex; flex-direction: column; gap: 10px; margin-bottom: 1.5rem; }
.appointment-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 4px solid var(--cor, var(--pink-700));
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.appointment-card .topo { display: flex; align-items: center; justify-content: space-between; }
.appointment-card .hora-chip {
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--cor, var(--pink-700));
  background: var(--pink-100);
  background: color-mix(in srgb, var(--cor, var(--pink-700)) 12%, transparent);
}
/* h1,h2,h3 do painel sao rosa; no card o titulo e escuro, como no app. */
.appointment-card .servico { font-size: 1.05rem; font-weight: 600; margin: 2px 0 0; color: var(--ink); }
.appointment-card .detalhe {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.81rem;
  color: var(--muted);
}
.appointment-card .detalhe .ponto {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cor, var(--pink-700));
  flex: 0 0 auto;
}
.appointment-card .rodape {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.appointment-card .preco { font-size: 0.94rem; font-weight: 500; }
.appointment-card .acoes { display: flex; gap: 8px; }
.appointment-card .acoes button {
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.81rem;
  font-weight: 400;
  box-shadow: none;
}
.appointment-card .acoes .concluir { background: var(--status-concluido-bg); color: var(--status-concluido-fg); }
.appointment-card .acoes .cancelar { background: var(--status-cancelado-bg); color: var(--status-cancelado-fg); }
.appointment-card .acoes button:hover { filter: brightness(0.96); transform: none; }

/* ScreenState.tsx - estado vazio centrado */
.vazio {
  text-align: center;
  padding: 3.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.vazio .icone { font-size: 2rem; line-height: 1; margin-bottom: 4px; }
.vazio h2 { font-size: 1.15rem; margin: 0; }
.vazio p { color: var(--muted); margin: 0 0 14px; }

/* Formulario recolhido atras de um botao, como o "+" que abre tela nova no app */
.novo-agendamento { margin-bottom: 1.5rem; }
.novo-agendamento > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pink-700);
  color: #fff;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  user-select: none;
}
.novo-agendamento > summary::-webkit-details-marker { display: none; }
.novo-agendamento > summary:hover { background: var(--pink-800); }
.novo-agendamento[open] > summary { background: var(--pink-100); color: var(--pink-700); }
.novo-agendamento[open] > summary .rotulo-abrir { display: none; }
.novo-agendamento:not([open]) > summary .rotulo-fechar { display: none; }
.novo-agendamento .card { margin-top: 12px; }

/* Linha-card das listas (Clientes, Serviços, Profissionais, Notificações).
   Equivale as linhas brancas das telas de lista do app - mesmo raio, mesma
   borda, acoes a direita. Substitui as tabelas, que nao existem no app. */
.lista-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 1.5rem; }
.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.item-card .info { flex: 1 1 220px; min-width: 0; }
.item-card .principal { font-size: 0.94rem; font-weight: 500; }
.item-card .secundario { font-size: 0.81rem; color: var(--muted); }
.item-card.inativo .principal { color: var(--muted); text-decoration: line-through; }
.item-card .acoes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-card .acoes button,
.item-card .acoes .btn { padding: 0.4rem 0.9rem; font-size: 0.81rem; box-shadow: none; }

/* Busca em linha, como o campo de busca da tela Clientes do app */
.barra-busca { display: flex; gap: 8px; margin-bottom: 1.25rem; }
.barra-busca input { flex: 1; }
.ponto-profissional {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
}

/* Card de assinatura (Notificações e página de bloqueio) */
.assinatura-card .assinatura-topo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.assinatura-card .assinatura-topo h2 { margin: 0; }
.assinatura-destaque {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0.6rem 0 0.2rem;
}
