/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Paleta clínica — confiança, saúde, modernidade */
  --bg:            #f0f7ff;
  --bg2:           #e8f4fd;
  --surface:       #ffffff;
  --surface2:      #f7fbff;
  --surface3:      #eef6ff;
  --border:        #dae8f5;
  --border-soft:   #edf4fb;

  /* Azul primário — confiança e profissionalismo */
  --primary:       #0284c7;
  --primary-dark:  #0369a1;
  --primary-light: #38bdf8;

  /* Verde saúde — vitalidade e bem-estar */
  --health:        #0d9488;
  --health-light:  #2dd4bf;

  /* Gradientes institucionais */
  --grad-primary:  linear-gradient(135deg, #0284c7 0%, #0891b2 60%, #0d9488 100%);
  --grad-sidebar:  linear-gradient(180deg, #023e6e 0%, #015079 40%, #016a6e 100%);
  --grad-card:     linear-gradient(135deg, #e0f2fe 0%, #ccfbf1 100%);
  --grad-header:   linear-gradient(135deg, #0284c7 0%, #0d9488 100%);

  /* Texto */
  --text:          #0f2744;
  --text-muted:    #5c7a9a;
  --text-light:    #8fadc8;

  /* Status leads */
  --quente:        #dc2626;
  --quente-bg:     #fff1f1;
  --quente-border: #fecaca;
  --morno:         #d97706;
  --morno-bg:      #fffbeb;
  --morno-border:  #fde68a;
  --frio:          #2563eb;
  --frio-bg:       #eff6ff;
  --frio-border:   #bfdbfe;

  /* Status consultas */
  --success:       #059669;
  --success-bg:    #ecfdf5;
  --warning:       #d97706;
  --warning-bg:    #fffbeb;
  --danger:        #dc2626;
  --danger-bg:     #fef2f2;

  /* Estrutura */
  --radius:        14px;
  --radius-sm:     9px;
  --radius-xs:     6px;
  --shadow-sm:     0 1px 3px rgba(2,68,132,0.08), 0 1px 2px rgba(2,68,132,0.04);
  --shadow:        0 4px 16px rgba(2,68,132,0.10), 0 2px 6px rgba(2,68,132,0.06);
  --shadow-lg:     0 12px 40px rgba(2,68,132,0.14), 0 4px 12px rgba(2,68,132,0.08);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5d9ec; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9bbcd8; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 230px;
  min-width: 230px;
  background: var(--grad-sidebar);
  display: flex;
  flex-direction: column;
  padding: 0 0 20px;
  gap: 0;
  box-shadow: 2px 0 20px rgba(2,40,90,0.18);
  position: relative;
  z-index: 10;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 10px;
  position: relative;
}

.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #38bdf8, #2dd4bf);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  color: white;
  box-shadow: 0 4px 12px rgba(56,189,248,0.35);
  flex-shrink: 0;
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  font-weight: 400;
  display: block;
  margin-top: 1px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  width: 100%;
  text-align: left;
  transition: all 0.18s;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}

.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: linear-gradient(180deg, #38bdf8, #2dd4bf);
  border-radius: 0 3px 3px 0;
}

.nav-icon { font-size: 16px; width: 22px; text-align: center; }
.nav-label { flex: 1; }

.nav-badge {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(56,189,248,0.4);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 0 0 0;
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}

.status-dot.online {
  background: #2dd4bf;
  box-shadow: 0 0 0 3px rgba(45,212,191,0.25);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(45,212,191,0.25); }
  50%       { box-shadow: 0 0 0 6px rgba(45,212,191,0.10); }
}

.status-text { font-size: 11.5px; color: rgba(255,255,255,0.5); }

/* ===== MAIN ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 66px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.topbar-left { display: flex; flex-direction: column; gap: 1px; }
.topbar-title  { font-size: 18px; font-weight: 700; color: var(--text); }
.topbar-subtitle { font-size: 12px; color: var(--text-muted); }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.search-box {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 7px 14px;
  gap: 8px;
  transition: border 0.15s, box-shadow 0.15s;
}

.search-box:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(2,132,199,0.08);
}

.search-icon { font-size: 13px; color: var(--text-muted); }

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  width: 180px;
}

.search-box input::placeholder { color: var(--text-light); }

.btn-icon {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 15px;
  color: var(--text-muted);
  transition: all 0.15s;
}

.btn-icon:hover { border-color: var(--primary-light); color: var(--primary); }

.avatar {
  width: 36px; height: 36px;
  background: var(--grad-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  box-shadow: 0 2px 8px rgba(2,132,199,0.3);
}

.avatar-btn { cursor: pointer; }
.avatar-btn:hover { opacity: 0.85; }

/* ===== SECTIONS ===== */
.section { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.section.active { display: flex; }
.section.hidden { display: none; }

/* ===== MENSAGENS ===== */
.messages-layout { display: flex; flex: 1; overflow: hidden; }

/* Conv list */
.conv-list {
  width: 320px;
  min-width: 320px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}

.conv-item:hover { background: var(--surface2); }
.conv-item.active {
  background: linear-gradient(90deg, #e0f2fe 0%, #f0fdfa 100%);
  border-left: 3px solid var(--primary);
}

.conv-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--grad-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--primary);
  border: 2px solid var(--border);
}

.conv-body { flex: 1; min-width: 0; }
.conv-name { font-weight: 600; font-size: 13.5px; margin-bottom: 3px; color: var(--text); }
.conv-preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.conv-time { font-size: 10.5px; color: var(--text-light); }
.conv-unread {
  background: var(--grad-primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(2,132,199,0.35);
}

.lead-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
}

.lead-tag.quente { background: var(--quente-bg); color: var(--quente); border-color: var(--quente-border); }
.lead-tag.morno  { background: var(--morno-bg);  color: var(--morno);  border-color: var(--morno-border); }
.lead-tag.frio   { background: var(--frio-bg);   color: var(--frio);   border-color: var(--frio-border); }

/* Chat window */
.chat-window { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-light);
  background: var(--bg);
}

.chat-empty-icon {
  width: 72px; height: 72px;
  background: var(--grad-card);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  box-shadow: var(--shadow-sm);
}

.chat-empty p { font-size: 14px; color: var(--text-muted); }

.chat-active { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.chat-avatar-wrap { display: flex; align-items: center; gap: 12px; }

.chat-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: white;
  box-shadow: 0 2px 8px rgba(2,132,199,0.25);
}

.chat-info { display: flex; flex-direction: column; gap: 2px; }
.chat-info strong { font-size: 14.5px; color: var(--text); }
.chat-info span { font-size: 12px; color: var(--text-muted); }

.chat-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}

.msg {
  max-width: 68%;
  padding: 10px 15px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  position: relative;
}

.msg .msg-time {
  font-size: 10px;
  margin-top: 5px;
  display: block;
  opacity: 0.55;
}

.msg.received {
  background: var(--surface);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.msg.sent {
  background: var(--grad-primary);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  color: white;
  box-shadow: 0 3px 10px rgba(2,132,199,0.25);
}

.msg.sent .msg-time { color: rgba(255,255,255,0.65); }

.msg.ia {
  background: linear-gradient(135deg, #ecfdf5, #e0f2fe);
  border: 1px solid #a7f3d0;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.msg-label {
  font-size: 10px;
  color: var(--health);
  margin-bottom: 4px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 -2px 10px rgba(2,68,132,0.04);
}

.chat-input-area textarea {
  flex: 1;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 13.5px;
  resize: none;
  outline: none;
  font-family: inherit;
  transition: border 0.15s, box-shadow 0.15s;
}

.chat-input-area textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2,132,199,0.08);
}

.chat-input-area textarea::placeholder { color: var(--text-light); }

.btn-send {
  background: var(--grad-primary);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  width: 44px; height: 44px;
  font-size: 18px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(2,132,199,0.3);
}

.btn-send:hover { opacity: 0.9; transform: scale(1.04); }
.btn-send:active { transform: scale(0.97); }

/* ===== CONSULTAS ===== */
.consultas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.filter-tabs { display: flex; gap: 6px; }

.tab {
  padding: 7px 16px;
  border-radius: 30px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.15s;
}

.tab:hover { border-color: var(--primary-light); color: var(--primary); background: var(--surface2); }
.tab.active { background: var(--grad-primary); border-color: transparent; color: white; box-shadow: 0 2px 8px rgba(2,132,199,0.25); }

.consultas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
}

.consulta-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.18s;
  box-shadow: var(--shadow-sm);
}

.consulta-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.consulta-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.consulta-nome { font-weight: 700; font-size: 15px; color: var(--text); }

.status-badge {
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.status-badge.confirmada { background: var(--success-bg); color: var(--success); border: 1px solid #a7f3d0; }
.status-badge.pendente   { background: var(--warning-bg); color: var(--warning); border: 1px solid #fde68a; }
.status-badge.cancelada  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid #fecaca; }

.consulta-info { display: flex; flex-direction: column; gap: 8px; }

.consulta-row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 7px 10px;
  background: var(--surface2);
  border-radius: var(--radius-xs);
}

.consulta-row strong { color: var(--text); font-weight: 600; }

.consulta-actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
}

/* ===== LEADS KANBAN ===== */
.leads-header { padding: 18px 28px; border-bottom: 1px solid var(--border); background: var(--surface); }

.leads-stats { display: flex; gap: 14px; }

.stat-box {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 110px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}

.stat-box:hover { box-shadow: var(--shadow); }

.stat-box .stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

.stat-box .stat-val { font-size: 26px; font-weight: 800; }
.stat-box.q .stat-val { color: var(--quente); }
.stat-box.m .stat-val { color: var(--morno); }
.stat-box.f .stat-val { color: var(--frio); }
.stat-box    .stat-val { color: var(--primary); }

.kanban {
  display: flex;
  gap: 18px;
  padding: 22px 28px;
  overflow-x: auto;
  flex: 1;
  align-items: flex-start;
}

.kanban-col {
  min-width: 285px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
}

.kanban-col-header.quente {
  background: linear-gradient(90deg, #fff5f5, #fff);
  color: var(--quente);
  border-top: 3px solid var(--quente);
}
.kanban-col-header.morno {
  background: linear-gradient(90deg, #fffdf0, #fff);
  color: var(--morno);
  border-top: 3px solid var(--morno);
}
.kanban-col-header.frio {
  background: linear-gradient(90deg, #f0f6ff, #fff);
  color: var(--frio);
  border-top: 3px solid var(--frio);
}

.col-count {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.kanban-cards {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 270px);
  overflow-y: auto;
}

.lead-card {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.lead-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  background: #fff;
}

.lead-card-name  { font-weight: 700; margin-bottom: 5px; font-size: 13.5px; color: var(--text); }
.lead-card-phone { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }

.lead-card-interest {
  font-size: 12.5px;
  color: var(--text);
  background: var(--grad-card);
  padding: 7px 11px;
  border-radius: var(--radius-xs);
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.lead-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}

.lead-card-date { font-size: 11px; color: var(--text-light); }

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--grad-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(2,132,199,0.25);
}

.btn-primary:hover { opacity: 0.9; box-shadow: 0 4px 14px rgba(2,132,199,0.35); }

.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover { background: var(--surface2); border-color: var(--primary); }

.btn-sm {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-sm:hover { border-color: var(--primary-light); color: var(--primary); background: var(--surface3); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 36, 86, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(6px);
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s cubic-bezier(0.16,1,0.3,1);
}

@keyframes modalIn {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, #f0f9ff, #f0fdfa);
  border-radius: var(--radius) var(--radius) 0 0;
}

.modal-header h2 { font-size: 17px; font-weight: 700; color: var(--text); }

.modal-close {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: all 0.15s;
}

.modal-close:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--quente-border); }

.modal-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.modal-body label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 6px;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  transition: border 0.15s, box-shadow 0.15s;
  width: 100%;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2,132,199,0.08);
}

.modal-body select { appearance: none; cursor: pointer; }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 26px;
  right: 26px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 20px;
  font-size: 13.5px;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: slideUp 0.22s cubic-bezier(0.16,1,0.3,1);
  max-width: 320px;
  font-weight: 500;
}

.toast.hidden { display: none; }
.toast.success { border-color: #a7f3d0; background: var(--success-bg); color: var(--success); }
.toast.error   { border-color: var(--quente-border); background: var(--danger-bg); color: var(--danger); }

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ===== HELPERS ===== */
.hidden { display: none !important; }
