:root {
  --navy: #0D0F14;
  --blue: #0066FF;
  --blue-dark: #0052CC;
  --bg: #F4F6FA;
  --card-bg: #FFFFFF;
  --border: #E2E6EE;
  --text: #1A1D24;
  --text-muted: #6B7280;
  --danger: #DC2626;
  --success: #16A34A;
  --radius: 10px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; color: var(--text); padding: 12px 24px; flex-wrap: wrap; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.topbar__brand { display: flex; align-items: center; gap: 10px; }
.topbar__logo { height: 34px; width: auto; display: block; }
.topbar__nav { display: flex; gap: 18px; }
.topbar__nav a { color: var(--text-muted); font-weight: 600; }
.topbar__nav a:hover { color: var(--blue); text-decoration: none; }
.topbar__user { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-weight: 500; }

.auth-topbar { display: flex; justify-content: center; padding: 28px 0 0; }
.auth-topbar__logo { height: 46px; width: auto; }

.container { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.page-head--inline { margin-bottom: 12px; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.page-head h2 { font-size: 1.1rem; margin: 0; }

.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; }
.stat-card__value { display: block; font-size: 2rem; font-weight: 700; color: var(--blue); }
.stat-card__label { color: var(--text-muted); font-size: .85rem; }

.btn { display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); text-decoration: none; }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--ghost:hover { background: #F1F3F8; text-decoration: none; }
.btn--small { padding: 6px 12px; font-size: .8rem; }
.btn--block { width: 100%; text-align: center; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--text-muted); font-weight: 600; }
.form-grid input, .form-grid select, .form-grid textarea {
  font-family: inherit; font-size: .95rem; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: #fff;
}
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; }

.search-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.search-bar input { flex: 1; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: .9rem; }
.table th { color: var(--text-muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.table .empty { text-align: center; color: var(--text-muted); padding: 24px; }
.text-muted { color: var(--text-muted); }
.table__actions { display: flex; gap: 12px; align-items: center; white-space: nowrap; }

.inline-form { display: inline; }
.link-btn { background: none; border: none; color: var(--blue); cursor: pointer; font-size: .9rem; padding: 0; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.link-btn--danger { color: var(--danger); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--text-muted);
  font-size: .75rem; font-weight: 700; font-style: italic; cursor: pointer; padding: 0; line-height: 1;
}
.icon-btn:hover { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Campo de busca de cliente (combobox) */
.combo { position: relative; }
.combo__input { width: 100%; }
.combo__list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 20; margin-top: 4px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,.08);
  max-height: 220px; overflow-y: auto;
}
.combo__option { padding: 9px 12px; font-size: .9rem; cursor: pointer; }
.combo__option:hover { background: #F1F5FF; }
.combo__empty { padding: 9px 12px; font-size: .85rem; color: var(--text-muted); }

/* Modal de informações do cliente */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(13,15,20,.5); display: flex;
  align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal { background: #fff; border-radius: var(--radius); max-width: 420px; width: 100%; padding: 20px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal__head h3 { margin: 0; font-size: 1.1rem; }
.modal__close { background: none; border: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--text-muted); padding: 0; }
.modal__close:hover { color: var(--text); }
.modal__body { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.modal__body dt { color: var(--text-muted); font-size: .8rem; font-weight: 600; }
.modal__body dd { margin: 0; font-size: .9rem; word-break: break-word; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge--agendada { background: #DBEAFE; color: #1D4ED8; }
.badge--realizada { background: #DCFCE7; color: #15803D; }
.badge--cancelada { background: #FEE2E2; color: #B91C1C; }

.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 8px 2px; color: var(--text-muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; }
.tabs a.is-active { color: var(--blue); border-color: var(--blue); }

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; }
.alert--success { background: #DCFCE7; color: #15803D; }
.alert--error { background: #FEE2E2; color: #B91C1C; }

.see-all { display: inline-block; margin-top: 10px; font-size: .9rem; font-weight: 600; }

.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.calendar-head h2 { margin: 0; font-size: 1.15rem; }
.calendar-head__right { display: flex; gap: 8px; }

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar__weekday { text-align: center; font-size: .75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; padding-bottom: 6px; }
.calendar__day {
  min-height: 92px; border: 1px solid var(--border); border-radius: 8px; padding: 6px;
  display: flex; flex-direction: column; gap: 4px; background: #fff;
}
.calendar__day--vazio { border: none; background: transparent; }
.calendar__day.is-today { border-color: var(--blue); background: #F5F9FF; }
.calendar__day-head { display: flex; align-items: center; justify-content: space-between; }
.calendar__day-num { font-size: .8rem; font-weight: 700; color: var(--text-muted); }
.calendar__day.is-today .calendar__day-num { color: var(--blue); }
.calendar__add {
  display: none; width: 18px; height: 18px; border-radius: 50%; background: var(--blue); color: #fff;
  text-align: center; line-height: 18px; font-size: .8rem; font-weight: 700;
}
.calendar__day:hover .calendar__add { display: block; text-decoration: none; }
.calendar__evento {
  display: block; font-size: .72rem; line-height: 1.3; padding: 2px 5px; border-radius: 5px;
  color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.calendar__evento:hover { text-decoration: none; filter: brightness(0.95); }

.calendar-legend { display: flex; gap: 18px; margin-top: 16px; flex-wrap: wrap; }
.calendar-legend__item { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-muted); }
.calendar-legend__item i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

@media (max-width: 720px) {
  .calendar__weekday:nth-child(n) { font-size: .65rem; }
  .calendar__day { min-height: 64px; padding: 4px; }
  .calendar__evento { font-size: .65rem; }
}

.auth-wrap { display: flex; justify-content: center; align-items: center; min-height: 80vh; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { margin: 0 0 4px; }
.auth-card h1 span { color: var(--blue); }
.auth-sub { color: var(--text-muted); margin: 0 0 18px; font-size: .9rem; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.auth-card input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: .95rem; }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
