/* ═══════════════════════════════════════════════════════════════
   global.css — Primeiro Olá
   Design: elegante maternidade, aquarela, tons quentes
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: 'DM Sans', sans-serif; background: var(--cream); color: var(--dark); min-height: 100vh; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ── Variáveis ── */
:root {
  --cream:       #FDF8F5;
  --cream2:      #F5EDE8;
  --cream3:      #EDE0D8;
  --brown:       #C9897A;
  --brown2:      #A0604F;
  --brown3:      #7A4035;
  --dark:        #3D1A0E;
  --dark2:       #5C2A18;
  --mid:         #9A7A6E;
  --muted:       #B89A90;
  --border:      rgba(61,26,14,0.1);
  --border2:     rgba(61,26,14,0.2);
  --shadow-sm:   0 2px 8px rgba(61,26,14,0.08);
  --shadow-md:   0 4px 20px rgba(61,26,14,0.12);
  --shadow-lg:   0 8px 40px rgba(61,26,14,0.16);
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   28px;
}

/* ── Tipografia ── */
.font-serif  { font-family: 'Cormorant Garamond', serif; }
.font-script { font-family: 'Dancing Script', cursive; }

/* ── Card ── */
.card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.card-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
}
.card-body { padding: 1.25rem; }

/* ── Botões ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  transition: all .2s;
  cursor: pointer;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--dark);
  color: white;
}
.btn-primary:hover { background: var(--dark2); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-brown {
  background: var(--brown);
  color: white;
}
.btn-brown:hover { background: var(--brown2); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--dark);
  border: 1.5px solid var(--border2);
}
.btn-outline:hover { border-color: var(--brown); color: var(--brown); }

.btn-ghost {
  background: transparent;
  color: var(--mid);
}
.btn-ghost:hover { background: var(--cream2); color: var(--dark); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Campos de formulário ── */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .4rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--dark);
  background: white;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(201,137,122,0.15);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); }
.field textarea { resize: vertical; min-height: 80px; }
.field-hint { font-size: 11px; color: var(--muted); margin-top: .3rem; }
.field-error { font-size: 11px; color: #C0392B; margin-top: .3rem; }

/* Input com ícone */
.input-wrap { position: relative; }
.input-wrap input { padding-left: 40px; }
.input-wrap .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  width: 16px; height: 16px;
}
.input-wrap .input-icon-right {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  cursor: pointer;
  width: 16px; height: 16px;
}

/* ── Alerts ── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: .75rem;
  display: none;
}
.alert.show { display: block; }
.alert-error   { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.alert-info    { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-green  { background: #D1FAE5; color: #065F46; }
.badge-red    { background: #FEE2E2; color: #991B1B; }
.badge-cream  { background: var(--cream2); color: var(--brown2); }
.badge-blue   { background: #DBEAFE; color: #1E40AF; }

/* ── Toast ── */
.mv-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--dark);
  color: white;
  padding: .85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: all .3s cubic-bezier(.16,1,.3,1);
  pointer-events: none;
}
.mv-toast.mv-toast-show { transform: translateY(0); opacity: 1; }
.mv-toast-sucesso { background: #065F46; }
.mv-toast-erro    { background: #991B1B; }
.mv-toast-info    { background: #1E40AF; }
.mv-toast-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,10,5,0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: white;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(24px) scale(.97);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; color: var(--dark); }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--cream2);
  border: none;
  font-size: 14px;
  color: var(--mid);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.modal-close:hover { background: var(--cream3); color: var(--dark); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  display: flex;
  gap: .75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted);
}
.empty-icon {
  width: 56px; height: 56px;
  background: var(--cream2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
  color: var(--mid);
}
.empty-icon svg { width: 24px; height: 24px; }
.empty-state p { font-size: 14px; margin-bottom: 1rem; }

/* ── Loader ── */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border2);
  border-top-color: var(--brown);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Layout com sidebar ── */
body.with-sidebar { display: flex; min-height: 100vh; }
.main-content {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--dark);
  font-family: 'Cormorant Garamond', serif;
}
.topbar-sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.page-content { padding: 1.75rem 2rem; flex: 1; }

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.blue   { background: #DBEAFE; color: #1E40AF; }
.stat-icon.green  { background: #D1FAE5; color: #065F46; }
.stat-icon.gold   { background: #FEF3C7; color: #92400E; }
.stat-icon.brown  { background: var(--cream2); color: var(--brown2); }
.stat-num { font-size: 24px; font-weight: 700; color: var(--dark); line-height: 1; }
.stat-lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Filtros ── */
.filtros {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.filtro-busca {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: white;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  flex: 1;
  max-width: 320px;
}
.filtro-busca svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.filtro-busca input {
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--dark);
  background: transparent;
  flex: 1;
}
.filtro-busca input::placeholder { color: var(--muted); }
.filtro-tabs { display: flex; gap: .35rem; }
.filtro-tab {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--mid);
  cursor: pointer;
  transition: all .2s;
}
.filtro-tab:hover { background: var(--cream2); color: var(--dark); }
.filtro-tab.active { background: var(--dark); color: white; }

/* ── Responsivo ── */
@media (max-width: 768px) {
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: .85rem 1.25rem; flex-wrap: wrap; gap: .5rem; }
  .topbar-title { font-size: 18px; }
  .topbar-sub { font-size: 12px; }
  .page-content { padding: 1rem; }
  .card { border-radius: 12px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}