/* Tela Início */

/* Números do dia */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-bottom: 16px;
}
.stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 13px; color: var(--ink-3); }
.stat-value {
  font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.stat-value small { font-size: 14px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.stat-foot { font-size: 12.5px; color: var(--ink-3); }
.meter { display: block; height: 4px; margin: 6px 0 4px; border-radius: 99px; background: #EDEEF2; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .3s ease; }

/* Grade principal */
.home-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 16px;
  align-items: start;
}
.home-side { display: flex; flex-direction: column; gap: 16px; }

/* Agenda de hoje */
.link-more {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13.5px; font-weight: 500; color: var(--brand-strong);
}
.link-more .ico { width: 14px; height: 14px; }
.link-more:hover { text-decoration: underline; text-underline-offset: 3px; }

.appts { list-style: none; margin: 0; padding: 0 8px 8px; }
.appt {
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 8px 10px;
}
.appt + .appt { box-shadow: 0 -1px 0 var(--line); }
.appt-open {
  display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
  align-self: stretch; text-align: left; border-radius: var(--radius-sm);
}
.appt-open:hover .appt-info strong { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.appt-time {
  width: 44px; flex: none;
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.appt-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: #F0F1F4; color: var(--ink-2);
  font-size: 11.5px; font-weight: 600;
}
.appt-info { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.appt-info strong { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-info span { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.appt.is-past .appt-time,
.appt.is-past .appt-info strong { color: var(--ink-3); font-weight: 500; }
.appt.is-missed .appt-info strong { text-decoration: line-through; text-decoration-color: #C6C9D0; }
.appt.is-next { background: var(--brand-soft); box-shadow: none; border-radius: var(--radius); }
.appt.is-next + .appt { box-shadow: none; }
.appt.is-next .appt-avatar { background: var(--brand); color: #fff; }
.appt.is-next .appt-time { color: var(--brand-strong); }
.appt.is-next .chip--brand { background: var(--surface); border: 1px solid var(--brand-line); }

.now-line {
  position: relative; display: flex; align-items: center;
  height: 22px; margin: 2px 0;
}
.now-line::before { content: ""; position: absolute; left: 10px; right: 10px; height: 1px; background: var(--brand-line); }
.now-line::after {
  content: ""; position: absolute; left: 6px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.now-line span {
  position: relative; margin-left: 22px; padding: 0 8px;
  font-size: 12px; font-weight: 600; color: var(--brand-strong);
  background: var(--surface);
}
.now-line + .appt { box-shadow: none; }

.day-empty { padding: 8px 18px 22px; }
.day-empty p { margin: 0 0 14px; font-size: 14px; color: var(--ink-2); }

/* Aviso do WhatsApp */
.nudge {
  display: flex; gap: 12px; padding: 16px;
  background: linear-gradient(180deg, var(--brand-soft), #fff 80%);
  border-color: var(--brand-line);
}
.nudge-ico {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
}
.nudge-ico .ico { width: 16px; height: 16px; }
.nudge strong { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.nudge p { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); }

/* Link de agendamento */
.share { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.share > .muted { margin: -4px 0 2px; font-size: 13px; }
.share-url {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px; border-radius: var(--radius);
  background: #F6F7F9; border: 1px solid var(--line);
  font-size: 13.5px; color: var(--ink-2);
}
.share-url .ico { width: 15px; height: 15px; color: var(--ink-3); }
.share-url span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tablet: uma coluna só */
@media (max-width: 1180px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .home-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Celular: tudo em uma coluna */
@media (max-width: 820px) {
  .stats { gap: 8px; margin-bottom: 12px; }
  .stat { padding: 12px; }
  .stat-label { font-size: 12px; }
  .stat-value { font-size: 19px; }
  .stat-value small { font-size: 12px; }
  .meter { margin-bottom: 0; }

  .home-grid { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .home-side { display: flex; flex-direction: column; gap: 12px; }

  .card-head { padding: 14px 14px 10px; }
  .appts { padding: 0 4px 6px; }
  .appt { gap: 10px; padding: 8px; }
  .appt-open { gap: 10px; }
  .appt-avatar { display: none; }
}

@media (max-width: 560px) {
  .stat-foot { display: none; }
}
