/* ========================================================================== */
/*  dablio — Design System                                                     */
/* ========================================================================== */

:root {
  --cream:        #f8fafc;
  --cream-dark:   #f1f5f9;
  --espresso:     #2a3682;
  --espresso-mid: #3d4d9e;
  --gold:         #c8a96a;
  --gold-light:   #e8d5a3;
  --rose:         #c97a95;
  --rose-light:   #f7e8ef;
  --rose-mid:     #efd0dc;
  --muted:        #7a8494;
  --border:       #e2e8f0;
  --shadow:       rgba(42, 54, 130, 0.12);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--cream);
  color: var(--espresso);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
header {
  background: var(--espresso);
  /* Safe area: respeita notch / Dynamic Island no iPhone */
  padding: calc(0.9rem + env(safe-area-inset-top, 0px)) 2rem 0.9rem;
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header-date-bar {
  background: var(--espresso);
  border-top: 1px solid rgba(200, 169, 106, 0.2);
  padding: 0.25rem 2rem;
  max-width: 100%;
}

.header-date-bar span {
  font-size: 0.72rem;
  color: var(--gold-light);
  font-family: "Lato", sans-serif;
  font-weight: 300;
  text-transform: capitalize;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.header-icon {
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 2px;
}

header h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--gold-light);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ── dablio logo no header ─────────────────────────────────────────────────── */
.header-logo-img {
  height: 44px;
  width: auto;
  display: block;
  object-fit: contain;
  /* filtro leve para o logo dourado brilhar no fundo azul escuro */
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.35));
}

/* ── dablio logo no drawer ─────────────────────────────────────────────────── */
.drawer-brand-logo {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

/* ── Main layout ─────────────────────────────────────────────────────────── */
main {
  max-width: 680px;
  margin: 2rem auto;
  padding: 0 calc(1rem + env(safe-area-inset-right, 0px))
             2rem
             calc(1rem + env(safe-area-inset-left, 0px));
}

/* ── Hamburger button ────────────────────────────────────────────────────── */
.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  margin-left: auto;
  border-radius: 6px;
  transition: background 0.15s;
}

.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold-light);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}

.hamburger-btn:hover {
  background: rgba(200, 169, 106, 0.12);
}

/* Animated X when open */
.hamburger-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Menu overlay ────────────────────────────────────────────────────────── */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 50, 0.60);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  backdrop-filter: blur(2px);
}

.menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Side drawer ─────────────────────────────────────────────────────────── */
.side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100dvh;
  background: var(--espresso);
  border-left: 2px solid var(--gold);
  z-index: 400;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -6px 0 24px rgba(10, 15, 50, 0.45);
  /* Safe area para notch / Dynamic Island */
  padding-top: env(safe-area-inset-top, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.side-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(200, 169, 106, 0.25);
}

.drawer-brand {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
  color: var(--gold-light);
  letter-spacing: 1.5px;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.drawer-close:hover {
  color: var(--gold-light);
  background: rgba(200, 169, 106, 0.1);
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.25rem;
  text-decoration: none;
  color: var(--gold-light);
  font-family: "Lato", sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.3px;
  border-bottom: 1px solid rgba(200, 169, 106, 0.08);
  transition: background 0.15s, color 0.15s;
}

.drawer-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  flex-shrink: 0;
  opacity: 0.75;
}

.drawer-item:hover {
  background: rgba(200, 169, 106, 0.1);
  color: var(--gold);
}

.drawer-item:hover svg {
  opacity: 1;
}

.drawer-active {
  color: var(--gold);
  background: rgba(200, 169, 106, 0.08);
  font-weight: 700;
}

.drawer-active svg {
  opacity: 1;
}

/* ── Drawer footer (user info + logout) ──────────────────────────────────── */
.drawer-footer {
  margin-top: auto;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.drawer-user-info {
  margin-bottom: 0.75rem;
}

.drawer-user-name {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-user-email {
  display: block;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: rgba(255,255,255,0.75);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.drawer-logout-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ── Trial banner ────────────────────────────────────────────────────────── */
.trial-banner {
  text-align: center;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.trial-banner--info {
  background: rgba(42, 54, 130, 0.07);
  color: var(--espresso);
  border-bottom: 1px solid rgba(42, 54, 130, 0.1);
}

.trial-banner--warning {
  background: #fef9e7;
  color: #856404;
  border-bottom: 1px solid #fde68a;
}

.trial-banner--expired {
  background: #fde8e8;
  color: #c0392b;
  border-bottom: 1px solid #fca5a5;
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
/* ── Toast container — fixed top-right ───────────────────────────────────── */
.alerts {
  position: fixed;
  top: calc(4.5rem + env(safe-area-inset-top, 0px));
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;      /* não bloqueia cliques abaixo */
  max-width: 320px;
  width: calc(100vw - 2rem);
}

.alert {
  pointer-events: auto;
  padding: 0.75rem 1rem 0.75rem 1.1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18), 0 1px 4px rgba(0,0,0,0.10);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  /* Slide-in da direita */
  animation: toast-in 0.28s cubic-bezier(.2,.8,.4,1) both;
}

.alert.toast-hiding {
  animation: toast-out 0.35s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0);   max-height: 80px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(32px); max-height: 0;   margin-bottom: -0.5rem; }
}

/* Ícone antes do texto */
.alert::before {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.alert-success {
  background: #1a2a1a;
  color: #d1fae5;
  border-left: 3px solid #10b981;
}

.alert-success::before {
  content: "✓";
  color: #10b981;
  font-weight: 700;
}

.alert-error {
  background: #2a1a1a;
  color: #fee2e2;
  border-left: 3px solid #ef4444;
}

.alert-error::before {
  content: "!";
  color: #ef4444;
  font-weight: 700;
  font-family: monospace;
  font-size: 1.1rem;
}

/* Mobile: toast vai para baixo para não cobrir o header */
@media (max-width: 600px) {
  .alerts {
    top: auto;
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-width: none;
  }
}

/* ── Day Cards (próximos 3 dias) ─────────────────────────────────────────── */
.day-card {
  border-radius: 14px;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(42, 54, 130, 0.09);
  border: 1.5px solid var(--border);
  background: #fff;
}

.day-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem 0.65rem;
}

.day-card-header--clickable {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.12s;
}

.day-card-header--clickable:hover {
  opacity: 0.85;
}

.day-card-arrow {
  font-size: 1.1rem;
  opacity: 0.6;
  transition: transform 0.15s, opacity 0.15s;
}

.day-card-header--clickable:hover .day-card-arrow {
  transform: translateX(3px);
  opacity: 1;
}

.day-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.day-card-label {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.2px;
}

.day-card-date {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.day-card-count {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--cream-dark);
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
  color: var(--muted);
  border: 1px solid var(--border);
}

.day-card .agenda-list {
  padding: 0 1rem 0.75rem;
}

/* Today — barra lateral azul + header tintado */
.day-card--today {
  border-left: 4px solid var(--espresso);
}

.day-card--today .day-card-header {
  background: linear-gradient(135deg, var(--espresso) 0%, var(--espresso-mid) 100%);
}

.day-card--today .day-card-label,
.day-card--today .day-card-date {
  color: #fff;
}

.day-card--today .day-card-count {
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.3);
}

/* Tomorrow — barra lateral dourada + header tintado */
.day-card--tomorrow {
  border-left: 4px solid var(--gold);
}

.day-card--tomorrow .day-card-header {
  background: linear-gradient(135deg, #a07820 0%, var(--gold) 100%);
}

.day-card--tomorrow .day-card-label,
.day-card--tomorrow .day-card-date {
  color: #fff;
}

.day-card--tomorrow .day-card-count {
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.3);
}

/* Other day — label couro, header cinza chumbo */
.day-card--other {
  border-left: 4px solid #7d8899;
}

.day-card--other .day-card-header {
  background: #6b7280;
}

.day-card--other .day-card-label {
  color: #fff;
}

.day-card--other .day-card-date {
  color: rgba(255,255,255,0.8);
}

/* Empty state */
.day-card--empty {
  padding: 1.5rem 1rem;
  text-align: center;
  border-left: none;
}

/* ── Hero / Greeting ─────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--espresso) 0%, var(--espresso-mid) 100%);
  border-radius: 14px;
  padding: 2rem 2rem 1.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(200, 169, 106, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(201, 122, 149, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.hero-deco {
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 6px;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.hero-greeting {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 300;
  font-style: italic;
  color: var(--rose-mid);
  letter-spacing: 0.5px;
  margin-bottom: 0.3rem;
}

.hero-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--gold-light);
  letter-spacing: 1px;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero-date {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: capitalize;
  letter-spacing: 0.5px;
}

/* ── Botão flutuante (FAB) ───────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.25rem;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--espresso);
  color: var(--gold-light);
  font-size: 2rem;
  line-height: 54px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(42, 54, 130, 0.4);
  border: 2px solid var(--cream);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  z-index: 100;
  user-select: none;
  display: none; /* Desktop: coberto pelo "+ New appointment" no top bar */
}

.fab:hover {
  background: var(--espresso-mid);
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(42, 54, 130, 0.5);
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 4px rgba(42,54,130,0.06), 0 4px 16px rgba(42,54,130,0.08);
  border: 1px solid var(--border);
}

.card h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--espresso);
  margin-bottom: 1.1rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--border);
  letter-spacing: 0.3px;
}

/* ── Form ────────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--espresso-mid);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: "Lato", sans-serif;
  color: var(--espresso);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 169, 106, 0.18);
}

button[type="submit"] {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.7rem 1rem;
  background: var(--espresso);
  color: var(--gold-light);
  border: none;
  border-radius: 8px;
  font-family: "Lato", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}

button[type="submit"]:hover {
  background: var(--espresso-mid);
}

/* ── Agenda list ─────────────────────────────────────────────────────────── */
.agenda-list {
  list-style: none;
}

.agenda-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.5rem 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: background 0.12s;
  cursor: pointer;
}

.agenda-item:hover {
  background: var(--cream-dark);
}

.agenda-item:last-child {
  border-bottom: none;
}

.item-chevron {
  font-size: 1.1rem;
  color: var(--muted);
  opacity: 0.5;
  flex-shrink: 0;
  transition: transform 0.12s, opacity 0.12s;
}

.agenda-item:hover .item-chevron {
  transform: translateX(2px);
  opacity: 1;
}

/* Status left-border colours */
.agenda-item.status-scheduled { border-left-color: #f59e0b; }
.agenda-item.status-completed { border-left-color: #10b981; }
.agenda-item.status-cancelled { border-left-color: #ef4444; }
.agenda-item.status-no_show   { border-left-color: #ef4444; }

.agenda-item-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.client-notes-inline {
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--espresso);
  min-width: 48px;
  font-variant-numeric: tabular-nums;
}

.client {
  font-weight: 500;
  color: var(--espresso);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.empty {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 1.25rem 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
}

/* ── Calendar ────────────────────────────────────────────────────────────── */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.cal-month-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--espresso);
  letter-spacing: 0.5px;
}

.cal-nav-btn {
  font-size: 1.5rem;
  color: var(--espresso-mid);
  text-decoration: none;
  padding: 0 0.5rem;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s;
}

.cal-nav-btn:hover {
  color: var(--gold);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.cal-dow {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0.4rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 0;
  overflow: hidden;
}

.cal-day {
  min-height: 52px;
  border-radius: 8px;
  padding: 0.3rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: background 0.1s;
  min-width: 0;
  overflow: hidden;
}

.cal-day:hover {
  background: var(--cream-dark);
}

.cal-day-empty {
  cursor: default;
}

.cal-day-empty:hover {
  background: transparent;
}

.cal-day-num {
  font-size: 0.85rem;
  color: var(--espresso);
  font-weight: 400;
  line-height: 1;
}

.cal-today .cal-day-num {
  background: var(--espresso);
  color: var(--gold-light);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
}

.cal-has-appts {
  background: var(--rose-light);
}

.cal-selected {
  background: var(--rose-mid) !important;
  outline: 2px solid var(--rose);
}

.cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
}

/* Status-coloured dots */
.cal-dot-scheduled  { background: #f59e0b; }
.cal-dot-completed  { background: #10b981; }
.cal-dot-cancelled  { background: #ef4444; }
.cal-dot-no_show    { background: #ef4444; }

/* Calendar day status backgrounds */
.cal-status-green  { background: #d1fae5 !important; }
.cal-status-yellow { background: #fef3c7 !important; }
.cal-status-red    { background: #fee2e2 !important; }

/* Busy level — light (1 appt) and high (4+ appts) modifiers */
.cal-status-green.cal-busy-low   { background: #ecfdf5 !important; }
.cal-status-green.cal-busy-high  { background: #6ee7b7 !important; }
.cal-status-yellow.cal-busy-low  { background: #fffbeb !important; }
.cal-status-yellow.cal-busy-high { background: #fcd34d !important; }
.cal-status-red.cal-busy-low     { background: #fff5f5 !important; }
.cal-status-red.cal-busy-high    { background: #fca5a5 !important; }

/* ── Calendar dot overflow badge ─────────────────────────────────────────── */
.cal-dot-more {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  margin-left: 1px;
}

/* ── Calendar view toggle ────────────────────────────────────────────────── */
.cal-view-toggle {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 1rem;
}

.cal-toggle-btn {
  font-family: "Lato", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.35rem 1.25rem;
  border: 1.5px solid var(--espresso-mid);
  background: transparent;
  color: var(--espresso-mid);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cal-toggle-btn:first-child {
  border-radius: 20px 0 0 20px;
  border-right-width: 0.75px;
}

.cal-toggle-btn:last-child {
  border-radius: 0 20px 20px 0;
  border-left-width: 0.75px;
}

.cal-toggle-btn.cal-toggle-active {
  background: var(--espresso);
  color: var(--gold-light);
  border-color: var(--espresso);
}

.cal-toggle-btn:hover:not(.cal-toggle-active) {
  background: var(--cream-dark);
}

/* ── View panel fade transition ──────────────────────────────────────────── */
.cal-view-panel {
  transition: opacity 0.15s ease;
}

/* ── Day view ────────────────────────────────────────────────────────────── */
.day-view-content {
  min-height: 80px;
}

/* ── Fix <button> nav arrows (no browser default styles) ────────────────── */
.cal-nav-btn--btn {
  background: transparent;
  border: none;
  cursor: pointer;
}

/* ── Day detail ──────────────────────────────────────────────────────────── */
.day-detail {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.day-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.day-detail-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--espresso);
  text-transform: capitalize;
  letter-spacing: 0.3px;
}

.edit-link {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--espresso-mid);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.25rem 0.65rem;
  border: 1.5px solid var(--espresso-mid);
  border-radius: 20px;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.3px;
}

.edit-link:hover {
  background: var(--espresso);
  color: var(--gold-light);
  border-color: var(--espresso);
}

/* ── Edit page ───────────────────────────────────────────────────────────── */
.appt-info {
  background: #f0f4ff;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  border: 1px solid #c7d2fe;
}

.appt-info p {
  margin-bottom: 0.25rem;
}

.appt-info p:last-child {
  margin-bottom: 0;
}

.appt-info-label {
  font-weight: 700;
  color: var(--espresso-mid);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 1.25rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--espresso-mid);
  text-decoration: none;
  transition: color 0.15s;
  letter-spacing: 0.2px;
}

.back-link:hover {
  color: var(--espresso);
}

/* ── Select (recorrência) ────────────────────────────────────────────────── */
select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: "Lato", sans-serif;
  color: var(--espresso);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a8494' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.25rem;
}

select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 169, 106, 0.18);
}

/* ── Recurrence badge ────────────────────────────────────────────────────── */
.rec-badge {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.8rem;
  color: var(--rose);
  font-style: normal;
}

.rec-edit-note {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--rose);
  font-style: italic;
}

/* ── Series options (recurrence propagation) ─────────────────────────────── */
.series-options {
  background: #f0f4ff;
  border: 1.5px solid #c7d2fe;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin: 1rem 0;
}

.series-options-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--espresso);
  margin-bottom: 0.5rem;
}

/* ── Invoice button ──────────────────────────────────────────────────────── */
.btn-invoice {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  text-align: center;
  background: #ecfdf5;
  color: #065f46;
  border: 1.5px solid #a7f3d0;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-invoice:hover {
  background: #d1fae5;
}

/* ── Remove inline button (services list) ───────────────────────────────── */
.btn-remove-inline {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 8px;
  color: #cbd5e1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}

.item-list-row:hover .btn-remove-inline {
  opacity: 1;
}

.btn-remove-inline:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #ef4444;
}

/* ── Cancel button ───────────────────────────────────────────────────────── */
.btn-cancel {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.6rem 1rem;
  background: transparent;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  font-family: "Lato", sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-cancel:hover {
  background: #fee2e2;
}

/* ── Agenda day groups ───────────────────────────────────────────────────── */
.agenda-day-group + .agenda-day-group {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.agenda-day-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--espresso-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.agenda-day-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Invoice form ────────────────────────────────────────────────────────── */
textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: "Lato", sans-serif;
  color: var(--espresso);
  background: #fff;
  resize: vertical;
  transition: border-color 0.15s;
  min-height: 80px;
}

textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 169, 106, 0.18);
}

.inv-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.inv-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

.inv-item-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  margin-bottom: 0.5rem;
}

.inv-desc { flex: 3; }
.inv-qty  { flex: 1; min-width: 60px; }
.inv-price { flex: 2; }

.inv-remove-btn {
  background: transparent;
  border: 1px solid #fca5a5;
  color: #dc2626;
  border-radius: 6px;
  width: 32px;
  height: 36px;
  cursor: pointer;
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-bottom: 0;
  padding: 0;
  transition: background 0.15s;
}

.inv-remove-btn:hover { background: #fee2e2; }

.inv-add-btn {
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-family: "Lato", sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 0.25rem;
  transition: border-color 0.15s, color 0.15s;
}

.inv-add-btn:hover {
  border-color: var(--gold);
  color: var(--espresso);
}

/* ── Live total preview no formulário ───────────────────────────────────── */
.inv-total-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--espresso);
  color: var(--gold-light);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
}

.inv-total-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
}

.inv-total-value {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .day-card {
    border-radius: 10px;
  }

  .day-card-label {
    font-size: 1.1rem;
  }

  header {
    padding: 0.65rem 1rem;
  }

  header h1 {
    font-size: 1rem;
    letter-spacing: 1px;
  }

  .header-date-bar {
    padding: 0.2rem 1rem;
  }

  .header-date-bar span {
    font-size: 0.68rem;
  }

  .day-view-footer {
    display: block;
  }

  .fab {
    display: block;    /* reativa no mobile */
    width: 48px;
    height: 48px;
    font-size: 1.75rem;
    line-height: 48px;
    bottom: 1.25rem;
    right: 1rem;
  }

  main {
    margin: 0.75rem auto;
    padding: 0 0.5rem 2rem;
    width: 100%;
  }

  .card {
    padding: 0.85rem 0.65rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
  }

  .card h2 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }

  /* Agenda items mais compactos */
  .agenda-item {
    gap: 0.5rem;
    padding: 0.5rem 0;
    flex-wrap: wrap;
  }

  .time {
    font-size: 0.78rem;
    min-width: 38px;
  }

  .time-col {
    min-width: 60px;
  }

  .time-block {
    flex-shrink: 1;   /* permite encolher em telas muito estreitas */
    flex-wrap: wrap;
    gap: 0.15rem;
  }

  .time-sep {
    font-size: 0.7rem;
  }

  .client {
    font-size: 0.88rem;
  }

  .service {
    font-size: 0.78rem;
    white-space: normal;
    width: 100%;
    padding-left: 50px;
    color: var(--muted);
  }

  .edit-link {
    margin-left: auto;
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
  }

  .agenda-day-label {
    font-size: 0.72rem;
  }

  /* Calendário compacto */
  .cal-grid {
    gap: 1px;
  }

  .cal-dow {
    font-size: 0.58rem;
    padding: 0.2rem 0;
    letter-spacing: 0;
  }

  .cal-day {
    min-height: 36px;
    padding: 0.15rem 0.1rem;
    border-radius: 5px;
    gap: 2px;
  }

  .cal-day-num {
    font-size: 0.72rem;
  }

  .cal-today .cal-day-num {
    width: 18px;
    height: 18px;
    font-size: 0.68rem;
  }

  .cal-dot {
    width: 3px;
    height: 3px;
  }

  .cal-month-title {
    font-size: 0.95rem;
  }

  .cal-nav-btn {
    font-size: 1.2rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* ========================================================================== */
/*  CLIENTS & SERVICES — List / Detail / Forms                                  */
/* ========================================================================== */

/* ── Generic list ─────────────────────────────────────────────────────────── */
.list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.list-header h2,
.list-header h3 {
  margin: 0;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.item-list-row {
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-right: 0.75rem;
  transition: background 0.12s;
}

.item-list-row:last-child {
  border-bottom: none;
}

.item-list-row:hover {
  background: var(--cream-dark);
}

/* Status left-border — consistent with agenda-item */
.item-list-row.status-scheduled { border-left-color: #f59e0b; }
.item-list-row.status-completed { border-left-color: #10b981; }
.item-list-row.status-cancelled { border-left-color: #ef4444; }
.item-list-row.status-no_show   { border-left-color: #ef4444; }

.item-list-row:last-child {
  border-bottom: none;
}

.item-list-row.item-inactive {
  opacity: 0.55;
}

.item-list-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  flex: 1;
  min-width: 0;
}

.item-list-link:hover {
  background: var(--cream-dark);
}

.item-list-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.item-list-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--espresso);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-list-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.item-list-desc {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-list-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.item-list-arrow {
  font-size: 1.2rem;
  color: var(--gold);
  flex-shrink: 0;
}

.inactive-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--border);
  color: var(--muted);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-new {
  display: inline-block;
  padding: 0.45rem 1rem;
  background: var(--espresso);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-family: "Lato", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-new:hover {
  background: var(--espresso-mid);
}

/* ── Client info card ────────────────────────────────────────────────────── */
.client-info-card {
  transition: box-shadow 0.15s;
}

.client-edit-hint {
  font-size: 1rem;
  color: var(--muted);
  opacity: 0.5;
  text-decoration: none;
  transition: opacity 0.15s, color 0.15s;
  cursor: pointer;
}

.client-edit-hint:hover {
  opacity: 1;
  color: var(--espresso);
}

/* ── Inline name editing ─────────────────────────────────────────────────── */
.client-name-heading {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.1rem;
}

.client-name-heading::after {
  content: '✎';
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s;
  line-height: 1;
}

.client-name-heading:hover::after {
  opacity: 0.7;
}

.client-name-edit-form {
  margin-bottom: 0.25rem;
}

/* Input looks like an h2 — no buttons, Enter to save */
.client-name-edit-input {
  display: block;
  width: 100%;
  padding: 0.05rem 0.2rem;
  border: none;
  border-bottom: 2px solid var(--espresso);
  border-radius: 0;
  font-size: 1.25rem;
  font-family: inherit;
  font-weight: 700;
  color: var(--espresso);
  background: transparent;
  outline: none;
  line-height: 1.3;
  box-sizing: border-box;
}

.client-name-edit-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
  letter-spacing: 0.01em;
}

.btn-edit {
  display: inline-block;
  padding: 0.45rem 1rem;
  background: transparent;
  color: var(--espresso);
  border: 2px solid var(--espresso);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-edit:hover {
  background: var(--espresso);
  color: #fff;
}

/* ── Client detail ───────────────────────────────────────────────────────── */
.client-meta-line {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.client-notes {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.5rem;
  font-style: italic;
  border-left: 3px solid var(--gold);
  padding-left: 0.75rem;
}

/* ── Status badges ───────────────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 20px;
  padding: 3px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-scheduled  { background: #dbeafe; color: #1d4ed8; }
.status-completed  { background: #dcfce7; color: #15803d; }
.status-cancelled  { background: #fee2e2; color: #b91c1c; }
.status-no_show    { background: #fef3c7; color: #92400e; }

/* ── Form helpers ─────────────────────────────────────────────────────────── */
.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.form-hint a,
.form-help-link {
  color: var(--espresso);
  font-size: 0.75rem;
  text-decoration: underline;
  display: inline-block;
  margin-top: 0.3rem;
}

/* ── End-time preview badge ─────────────────────────────────────────────── */
.end-time-badge {
  display: inline-block;
  background: var(--espresso);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 0.35rem 1rem;
  letter-spacing: 0.5px;
}

/* ── Checkbox label ─────────────────────────────────────────────────────── */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--espresso);
  flex-shrink: 0;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Coluna esquerda: hora + status ──────────────────────────────────────── */
.time-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  flex-shrink: 0;
  min-width: 72px;
}

/* ── Horário início → fim na agenda ──────────────────────────────────────── */
.time-block {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.time-sep {
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1;
}

.time-end {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

/* ── Preço do cliente na lista ───────────────────────────────────────────── */
.price-tag {
  color: var(--espresso) !important;
  font-weight: 700;
}

.client-price {
  color: var(--espresso) !important;
  font-weight: 700;
}

/* ── Preço no item da agenda ─────────────────────────────────────────────── */
.appt-price {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--espresso);
  background: var(--gold-light);
  border-radius: 12px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Billing card (client detail) ───────────────────────────────────────── */
/* ── Billing block (client detail) ──────────────────────────────────────── */
.billing-block {
  border-left: 3px solid var(--gold);
}

.billing-block-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.billing-block-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.billing-status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 20px;
}

.billing-status-ready {
  background: #d1fae5;
  color: #065f46;
}

.billing-status-not-ready {
  background: var(--cream-dark);
  color: var(--muted);
}

.billing-status-pending {
  background: var(--cream-dark);
  color: var(--muted);
}

/* Definition list rows */
.billing-details {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0 0 1rem;
}

.billing-detail-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.billing-detail-row dt {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  min-width: 130px;
  flex-shrink: 0;
}

.billing-detail-row dt::after {
  content: ":";
}

.billing-detail-row dd {
  font-size: 0.88rem;
  color: var(--espresso);
  font-weight: 600;
  margin: 0;
}

.billing-count-highlight {
  color: var(--espresso);
  font-weight: 700;
}

.billing-next-ready {
  color: #065f46;
  font-weight: 700;
}

.billing-action {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.btn-invoice {
  display: inline-block;
  background: var(--espresso);
  color: #fff;
  border-radius: 8px;
  padding: 0.5rem 1.1rem;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-invoice:hover {
  background: var(--espresso-mid);
}

/* Dimmed state — not yet ready */
.btn-invoice--dim {
  background: var(--cream-dark);
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-invoice--dim:hover {
  background: var(--border);
  color: var(--espresso);
}

/* Featured row — Next invoice (prominent, primary answer) */
.billing-detail-row--featured dt {
  font-size: 0.82rem;
  color: var(--espresso);
  font-weight: 600;
}
.billing-detail-row--featured dd {
  font-size: 1rem;
  font-weight: 700;
  color: var(--espresso);
}

/* Secondary row — Unbilled sessions (contextual, smaller) */
.billing-detail-row--secondary dt,
.billing-detail-row--secondary dd {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

/* Helper hint near dim button */
.billing-hint {
  font-size: 0.73rem;
  color: var(--muted);
  margin-left: 0.5rem;
  display: inline-block;
  vertical-align: middle;
}

/* ── Form section title ──────────────────────────────────────────────────── */
.form-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 1.25rem 0 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

/* ── Invoice from client — line items preview ───────────────────────────── */
.invoice-items-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}

.invoice-items-list {
  list-style: none;
  margin: 0 0 0.75rem;
}

.invoice-item-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.invoice-item-row:hover {
  background: var(--cream-dark);
}

.invoice-item-label {
  display: flex;
  flex-direction: column;
  cursor: default;
}

.invoice-item-desc {
  font-size: 0.88rem;
  color: var(--espresso);
}

.invoice-item-price {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--espresso);
  text-align: right;
  white-space: nowrap;
}

.invoice-item-check {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--espresso);
  cursor: pointer;
  justify-self: center;
}

.invoice-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.5rem 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.invoice-subtotal-value {
  font-weight: 700;
  font-size: 1rem;
  color: var(--espresso);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.muted {
  color: var(--muted);
}

/* ── Day View footer — visível apenas no mobile ──────────────────────────── */
.day-view-footer {
  display: none;
  text-align: right;
  margin-top: 0.75rem;
}

.day-view-new-btn {
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/*  HOME PAGE — Calendar-dominant two-column layout                           */
/* ══════════════════════════════════════════════════════════════════════════ */

/* ── Grid: Calendar (main) + Agenda (sidebar) ────────────────────────────── */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  align-items: start;
}

/* ── Calendar card ───────────────────────────────────────────────────────── */
.home-calendar-card {
  padding: 1.25rem 1.5rem 1.5rem;
}

/* Top bar: toggle + "New appointment" link */
.cal-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.cal-top-bar .cal-view-toggle {
  margin-bottom: 0;          /* override default margin */
}

.btn-new-inline {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--espresso);
  text-decoration: none;
  border: 1.5px solid var(--espresso);
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-new-inline:hover {
  background: var(--espresso);
  color: #fff;
}

/* Bigger calendar cells on desktop */
.home-calendar-card .cal-day {
  min-height: 82px;
  padding: 0.45rem 0.35rem;
  gap: 4px;
  align-items: center;
}

.home-calendar-card .cal-day-num {
  font-size: 0.92rem;
  font-weight: 500;
}

.home-calendar-card .cal-today .cal-day-num {
  width: 26px;
  height: 26px;
  font-size: 0.88rem;
}

/* Count badge — appointment total on each day */
.cal-appt-count {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  letter-spacing: 0;
}

/* Dot row stays compact */
.home-calendar-card .cal-dots {
  gap: 3px;
}

.home-calendar-card .cal-dot {
  width: 7px;
  height: 7px;
}

/* DOW header slightly larger */
.home-calendar-card .cal-dow {
  font-size: 0.75rem;
  padding: 0.5rem 0;
}

/* Cal grid gap slightly more open */
.home-calendar-card .cal-grid {
  gap: 3px;
}

/* ── Sidebar label ───────────────────────────────────────────────────────── */
.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
  padding-left: 0.1rem;
}

/* ── Sidebar stack ───────────────────────────────────────────────────────── */
.home-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Day cards inside sidebar: no bottom margin (gap handles spacing) */
.home-sidebar .day-card {
  margin-bottom: 0;
}

/* Sidebar agenda items — compact since column is narrower */
.home-sidebar .agenda-item {
  padding: 0.45rem 0;
  gap: 0.45rem;
}

.home-sidebar .time {
  font-size: 0.72rem;
}

.home-sidebar .time-end {
  font-size: 0.65rem;
}

.home-sidebar .client {
  font-size: 0.82rem;
}

.home-sidebar .service {
  font-size: 0.72rem;
}

.home-sidebar .status-badge {
  font-size: 0.6rem;
  padding: 1px 5px;
}

/* Day card count — just the number, no label */
.home-sidebar .day-card-count {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--cream-dark);
  border-radius: 10px;
  padding: 1px 6px;
  color: var(--espresso);
}

/* ── Responsive: ≤860px → stack (calendar on top, agenda below) ─────────── */
@media (max-width: 860px) {
  main {
    padding: 0 0.5rem 2rem;
    width: 100%;
    box-sizing: border-box;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .home-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .home-layout > * {
    min-width: 0;
    overflow: hidden;
  }

  /* Reduz padding do card do calendário para ganhar espaço nas células */
  .home-calendar-card {
    padding: 0.85rem 0.5rem 0.85rem;
  }

  .home-calendar-card .cal-day {
    min-height: 48px;
    padding: 0.25rem 0.1rem;
    gap: 2px;
  }

  .home-calendar-card .cal-day-num {
    font-size: 0.78rem;
  }

  .home-calendar-card .cal-today .cal-day-num {
    width: 20px;
    height: 20px;
    font-size: 0.72rem;
  }

  .home-calendar-card .cal-dow {
    font-size: 0.62rem;
    padding: 0.25rem 0;
    letter-spacing: 0;
  }

  .home-calendar-card .cal-dot {
    width: 5px;
    height: 5px;
  }

  .home-calendar-card .cal-appt-count {
    display: none;    /* em telas pequenas o count ocupa espaço desnecessário */
  }

  .home-calendar-card .cal-grid {
    gap: 2px;
  }

  .btn-new-inline {
    display: none;             /* FAB handles "New" on mobile */
  }

  .home-sidebar .agenda-item {
    padding: 0.5rem 0;
    gap: 0.5rem;
  }

  .home-sidebar .time,
  .home-sidebar .client,
  .home-sidebar .service {
    font-size: inherit;
  }
}

/* ══════════════════════════════════════════════════════════════════════════ */
/*  CLIENTS — Search / Access Page                                            */
/* ══════════════════════════════════════════════════════════════════════════ */

.client-search-wrap {
  margin-top: 0.35rem;
  position: relative;
}

/* Search box (input + icons) — also the dropdown anchor */
.client-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.client-search-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.client-search-input {
  width: 100%;
  padding: 0.65rem 2.5rem 0.65rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--espresso);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.client-search-input:focus {
  border-color: var(--espresso);
  box-shadow: 0 0 0 3px rgba(62, 37, 15, 0.08);
}

.client-search-input::placeholder {
  color: var(--muted);
  font-size: 0.88rem;
}

.client-search-clear {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.1s;
}

.client-search-clear:hover { color: var(--espresso); }

/* Dropdown — anchored to .client-search-box */
.client-search-dropdown {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  list-style: none;
  margin: 0;
  padding: 0.3rem 0;
  z-index: 200;
  max-height: 240px;
  overflow-y: auto;
}

.client-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  cursor: pointer;
  gap: 0.75rem;
  transition: background 0.1s;
}

.client-search-item:hover,
.client-search-item--active {
  background: var(--cream-dark);
}

.client-search-item--empty {
  color: var(--muted);
  font-size: 0.88rem;
  cursor: default;
  justify-content: center;
}

.client-search-item-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--espresso);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-search-item-sub {
  font-size: 0.78rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* Initial hint state */
.client-search-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  gap: 0.75rem;
  text-align: center;
}

.client-search-hint-icon {
  opacity: 0.35;
}

.client-search-hint p {
  margin: 0;
  font-size: 0.9rem;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/*  APP FOOTER — assinatura institucional                                     */
/* ══════════════════════════════════════════════════════════════════════════ */

.app-footer {
  text-align: center;
  padding: 1.25rem 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.app-footer-sig {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.55;
  pointer-events: none;
}

.app-footer-sep {
  font-size: 0.65rem;
  color: var(--muted);
  opacity: 0.35;
  pointer-events: none;
}

.app-footer-link {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.55;
  text-decoration: none;
  transition: opacity 0.15s, color 0.15s;
}

.app-footer-link:hover {
  opacity: 1;
  color: var(--espresso);
}
