/* ============================================================
   Vetnóstico – Global CSS Design System
   Paleta: bordô/vinho primária, fundo branco, cinza claro
   ============================================================ */

:root {
  --primary:        #7d1c2c;
  --primary-dark:   #5c1220;
  --primary-light:  #f5e8ea;
  --primary-muted:  #e8c5cb;

  --bg:             #ffffff;
  --bg-secondary:   #f7f7f8;
  --bg-tertiary:    #f0f0f2;

  --text:           #2d2d2d;
  --text-secondary: #666666;
  --text-muted:     #999999;

  --border:         #e5e5e7;
  --border-focus:   #7d1c2c;

  --success:        #1a7a4a;
  --success-bg:     #edf7f2;
  --error:          #c0392b;
  --error-bg:       #fdf2f2;
  --warning:        #b45309;
  --warning-bg:     #fef9ec;

  --shadow-sm:      0 1px 3px rgba(0,0,0,.06);
  --shadow:         0 2px 8px rgba(0,0,0,.08);
  --shadow-md:      0 4px 16px rgba(0,0,0,.10);

  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      14px;
  --radius-xl:      18px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg-secondary);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ── */
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.3px; color: var(--text); }
h2 { font-size: 1.2rem; font-weight: 600; color: var(--text); }
h3 { font-size: 1rem; font-weight: 600; color: var(--text); }
p  { color: var(--text-secondary); font-size: .9375rem; }

/* ── Layout ── */
.container { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.container--wide { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ── Card ── */
.card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  border: 1px solid var(--border);
}
.card--flat {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-xl);
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, opacity .15s, transform .1s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary {
  background: var(--primary);
  color: #fff;
}
.btn--primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn--outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn--outline:hover:not(:disabled) { background: var(--primary-light); }

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn--ghost:hover:not(:disabled) { background: var(--bg-secondary); }

.btn--danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1.5px solid #f5c6c6;
}
.btn--danger:hover:not(:disabled) { background: #fce8e8; }

.btn--sm { padding: 7px 14px; font-size: .875rem; border-radius: var(--radius); }
.btn--lg { padding: 14px 28px; font-size: 1rem; width: 100%; }
.btn--block { width: 100%; }

/* ── Form controls ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.form-label .req { color: var(--error); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9375rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  font-family: var(--font);
  -webkit-appearance: none;
  appearance: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(125,28,44,.1);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input.error, .select.error, .textarea.error { border-color: var(--error); }
.textarea { resize: vertical; min-height: 80px; }
.select {
  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='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-hint { font-size: .8125rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .8125rem; color: var(--error); margin-top: 4px; }

/* ── Radio/Toggle selector ── */
.selector-group { display: flex; gap: 10px; flex-wrap: wrap; }
.selector-btn {
  flex: 1;
  min-width: 120px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.selector-btn:hover { border-color: var(--primary-muted); }
.selector-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
}
.selector-btn .selector-title {
  font-weight: 600;
  font-size: .9375rem;
  color: var(--text);
  display: block;
}
.selector-btn.active .selector-title { color: var(--primary); }
.selector-btn .selector-desc {
  font-size: .8125rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

/* ── Chips (time slots) ── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg);
  color: var(--text);
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover:not(.chip--disabled) { border-color: var(--primary); color: var(--primary); }
.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.chip--disabled {
  opacity: .4;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ── Stepper ── */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
  padding: 0;
}
.step {
  display: flex;
  align-items: center;
  flex: 1;
}
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
  background: var(--bg);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all .2s;
  z-index: 1;
}
.step-dot.done {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.step-dot.current {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 4px rgba(125,28,44,.12);
}
.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  transition: background .2s;
}
.step-line.done { background: var(--primary); }
.step-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
  white-space: nowrap;
}
.step-label.current { color: var(--primary); font-weight: 600; }

/* ── Calendar ── */
.calendar { user-select: none; }
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.calendar-title { font-weight: 600; font-size: .9375rem; color: var(--text); }
.calendar-nav {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: var(--text-secondary);
  transition: all .15s;
}
.calendar-nav:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.calendar-nav:disabled { opacity: .3; cursor: not-allowed; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-day-name {
  text-align: center;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}
.calendar-day {
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 36px;
}
.calendar-day:hover:not(.disabled):not(.empty) {
  border-color: var(--primary-muted);
  color: var(--primary);
}
.calendar-day.available { font-weight: 600; color: var(--text); }
.calendar-day.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 700;
}
.calendar-day.today:not(.selected) {
  border-color: var(--primary-muted);
  color: var(--primary);
}
.calendar-day.disabled { color: var(--text-muted); opacity: .4; cursor: not-allowed; }
.calendar-day.empty { cursor: default; }

/* ── Badge / status ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge--confirmado  { background: #e8f5ee; color: #1a7a4a; }
.badge--cancelado   { background: #fdf2f2; color: #c0392b; }
.badge--concluido   { background: #eef2ff; color: #3730a3; }
.badge--no_show     { background: #fef9ec; color: #b45309; }

/* ── Alert ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 16px;
  border-left: 3px solid;
}
.alert--info    { background: #eff6ff; color: #1e40af; border-color: #3b82f6; }
.alert--success { background: var(--success-bg); color: var(--success); border-color: #1a7a4a; }
.alert--error   { background: var(--error-bg); color: var(--error); border-color: var(--error); }
.alert--warning { background: var(--warning-bg); color: var(--warning); border-color: #f59e0b; }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Checkbox toggle ── */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.toggle-row input[type=checkbox] {
  width: 18px; height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.toggle-row .toggle-label {
  font-size: .9375rem;
  color: var(--text);
}

/* ── Table ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.table th {
  text-align: left;
  padding: 10px 14px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-secondary); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.modal-close:hover { background: var(--bg-tertiary); }

/* ── Skeleton loader ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { font-size: .9375rem; }

/* ── Header ── */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.logo-mark {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: .875rem;
}
.logo-name {
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--text);
  letter-spacing: -.2px;
}
.logo-sub {
  font-size: .6875rem;
  color: var(--text-muted);
  margin-top: -2px;
}

/* ── Admin sidebar / nav ── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-main { flex: 1; padding: 28px 24px; min-width: 0; }

.sidebar-logo {
  padding: 4px 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.sidebar-nav { padding: 0 10px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-link:hover { background: var(--bg-secondary); color: var(--text); }
.sidebar-link.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar-icon { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }

/* ── Stats cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 600px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.stat-card .stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 600;
}
.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
  line-height: 1;
}
.stat-card.primary .stat-value { color: var(--primary); }

/* ── Detail row ── */
.detail-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
  font-size: .8125rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 140px;
  flex-shrink: 0;
}
.detail-value { font-size: .9375rem; color: var(--text); }

/* ── Success screen ── */
.success-screen {
  text-align: center;
  padding: 32px 24px;
}
.success-icon {
  width: 72px; height: 72px;
  background: var(--success-bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .admin-sidebar { display: none; }
  .admin-main { padding: 16px; }
  .card, .modal { padding: 18px; }
  .selector-group { flex-direction: column; }
  .selector-btn { min-width: unset; }
  h1 { font-size: 1.25rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile admin nav (bottom bar) */
.mobile-admin-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 50;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}
.mobile-admin-nav .nav-items {
  display: flex;
  justify-content: space-around;
}
.mobile-admin-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: .6875rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 12px;
  border-radius: var(--radius);
  border: none;
  background: none;
  transition: color .15s;
  font-weight: 500;
  font-family: var(--font);
}
.mobile-admin-nav .nav-item .nav-icon { font-size: 1.25rem; }
.mobile-admin-nav .nav-item.active { color: var(--primary); }
@media (max-width: 640px) {
  .mobile-admin-nav { display: block; }
  .admin-main { padding-bottom: 72px; }
}

/* ── Loading spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
