/* ═══════════════════════════════════════════════════════════════════
   COLIH Captação — Design System Premium
   Paleta: Dokterian Style
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Dokterian Aesthetic */
  --bg-base:       #F8F9FA;
  --bg-surface:    #F5F5F5;
  --bg-card:       #FFFFFF;
  --bg-card-hover: #F0F4FD;
  --bg-input:      #FAFAFA;
  --bg-modal:      #FFFFFF;

  --border:        rgba(36, 107, 253, 0.08);
  --border-bright: rgba(36, 107, 253, 0.2);

  --text-primary:  #212121;
  --text-secondary:#616161;
  --text-muted:    #9E9E9E;

  --accent-blue:   #246BFD; /* Vibrant Dokterian Blue */
  --accent-indigo: #1C58D5;
  --accent-cyan:   #34C759; /* Bright green for positive actions */
  --accent-purple: #FF9500; /* Vibrant orange for highlights */

  --grad-main:     linear-gradient(135deg, #F0F4FD 0%, #FFFFFF 100%);
  --grad-header:   linear-gradient(135deg, #246BFD 0%, #1C58D5 100%);
  --grad-btn:      linear-gradient(135deg, #246BFD, #1C58D5);
  --grad-accent:   linear-gradient(135deg, #246BFD, #34C759);

  --status-novo:       #3b82f6;
  --status-em_contato: #eab308;
  --status-aguardando: #f97316;
  --status-reuniao:    #a855f7;
  --status-cooperador: #22c55e;
  --shadow-sm:     0 4px 12px rgba(36, 107, 253, 0.04);
  --shadow-md:     0 10px 30px rgba(33, 33, 33, 0.05);
  --shadow-lg:     0 20px 40px rgba(36, 107, 253, 0.08);
  --shadow-glow:   0 0 15px rgba(36, 107, 253, 0.3);

  --radius-sm:     12px;
  --radius-md:     16px;
  --radius-lg:     24px;
  --radius-pill:   100px;

  --transition: 0.2s ease;
}

/* ─── Reset & Base ──────────────────────────────────────────────── */
* {
  margin: 0; padding: 0; box-sizing: border-box;
}

body {
  font-family: 'Urbanist', 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.7); }

/* ─── Header ────────────────────────────────────────────────────── */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo svg { width: 36px; height: 36px; }

.brand-text { display: flex; flex-direction: column; }

.brand-name {
  font-size: 18px;
  font-weight: 800;
  color: #003B71;
  letter-spacing: -0.5px;
}

.brand-sub { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* Meta badges (fonte, data, total) */
.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.meta-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  transition: var(--transition);
}

.meta-badge.highlight {
  background: rgba(36, 107, 253, 0.08);
  border-color: rgba(36, 107, 253, 0.2);
}

.meta-icon { font-size: 16px; color: var(--accent-blue); }

.meta-info { display: flex; flex-direction: column; line-height: 1.2; }

.meta-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

.meta-value { font-size: 12px; font-weight: 700; color: var(--text-primary); }

/* User select */
.header-user { flex-shrink: 0; }

.user-select {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.user-select:focus { border-color: var(--accent-indigo); }

/* ─── Tab Navigation ────────────────────────────────────────────── */
.tab-nav {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 65px;
  z-index: 90;
}

.tab-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  position: relative;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.03); }

.tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  background: rgba(59,130,246,0.05);
}

.tab-icon { font-size: 16px; }

.tab-badge {
  background: var(--accent-indigo);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

/* ─── Main / Panels ─────────────────────────────────────────────── */
.app-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.tab-panel { display: none; animation: fadeIn 0.25s ease; }
.tab-panel.active { display: block; }

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

.panel-header { margin-bottom: 24px; }

.panel-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }

.panel-header p { color: var(--text-secondary); font-size: 14px; }

/* ─── Search Bar ────────────────────────────────────────────────── */
.search-bar { margin-bottom: 16px; }

.search-field-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px 6px 16px;
  transition: var(--transition);
}

.search-field-wrap:focus-within {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

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

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
}

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

.filter-select {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
}

/* ─── Fonte Info Bar ────────────────────────────────────────────── */
.fonte-info-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(6,182,212,0.06);
  border: 1px solid rgba(6,182,212,0.15);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.fonte-info-bar.small { font-size: 11px; padding: 6px 12px; }

.fonte-icon { font-size: 14px; flex-shrink: 0; }

.fonte-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(6,182,212,0.1);
  border: 1px solid rgba(6,182,212,0.2);
  color: var(--accent-cyan);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--grad-btn);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.35); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-secondary:hover { background: rgba(255,255,255,0.10); border-color: var(--border-bright); }

.btn-danger {
  background: rgba(239,68,68,0.12);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--accent-blue);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.btn-back:hover { background: rgba(59,130,246,0.08); }

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37,211,102,0.12);
  color: #4ade80;
  border: 1px solid rgba(37,211,102,0.25);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-whatsapp:hover { background: rgba(37,211,102,0.2); }

/* ─── Glass Card ────────────────────────────────────────────────── */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.info-card {
  padding: 20px;
  margin-bottom: 16px;
}

.info-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--text-primary); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.info-item label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); display: block; margin-bottom: 3px; }

.info-item span { font-size: 14px; color: var(--text-primary); font-weight: 500; }

/* ─── Tables ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: rgba(255,255,255,0.04);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr { transition: background var(--transition); }

tbody tr:hover { background: rgba(99,142,255,0.05); }

tbody tr:not(:last-child) { border-bottom: 1px solid rgba(99,142,255,0.07); }

tbody td {
  padding: 11px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}

.td-muted { color: var(--text-secondary); }

.td-actions { display: flex; gap: 6px; align-items: center; }

/* ─── Status Badges ─────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.status-novo       { background: rgba(59,130,246,0.15);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.status-em_contato { background: rgba(234,179,8,0.15);   color: #fbbf24; border: 1px solid rgba(234,179,8,0.25); }
.status-aguardando { background: rgba(249,115,22,0.15);  color: #fb923c; border: 1px solid rgba(249,115,22,0.25); }
.status-reuniao    { background: rgba(168,85,247,0.15);  color: #c084fc; border: 1px solid rgba(168,85,247,0.25); }
.status-cooperador { background: rgba(34,197,94,0.15);   color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }
.status-recusou    { background: rgba(239,68,68,0.15);   color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.status-na         { background: rgba(100,116,139,0.12); color: var(--text-muted); border: 1px solid rgba(100,116,139,0.2); }

/* ─── Pipeline Toolbar ──────────────────────────────────────────── */
.pipeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-filters { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.filter-input:focus { border-color: var(--accent-indigo); }
.filter-input.short { width: 180px; }

/* ─── Status Summary Cards ──────────────────────────────────────── */
.status-summary {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.summary-card {
  flex: 1;
  min-width: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.summary-card:hover { border-color: var(--border-bright); transform: translateY(-2px); }

.summary-card.active-filter { border-color: var(--accent-indigo); background: rgba(99,102,241,0.1); }

.summary-num { font-size: 24px; font-weight: 800; line-height: 1; margin-bottom: 4px; }

.summary-label { font-size: 11px; color: var(--text-muted); }

/* ─── Stats Grid ────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

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

.stat-card h3 { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.06em; }

.stat-number {
  font-size: 40px;
  font-weight: 800;
  background: var(--grad-btn);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-sub { font-size: 12px; color: var(--text-muted); }

.stat-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.stat-list li { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }

.stat-list li .stat-count { font-weight: 600; color: var(--accent-cyan); }

/* ─── Detail Panel ──────────────────────────────────────────────── */
.detail-panel { animation: slideIn 0.25s ease; }

@keyframes slideIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }

.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.detail-body {}

.section-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.section-title-row h2 { font-size: 16px; font-weight: 700; }

.prof-filter-wrap { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.count-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(99,102,241,0.15);
  color: var(--accent-indigo);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
}

.med-cards-row { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 240px; }

/* ─── Vínculos / Ativo badge ────────────────────────────────────── */
.ativo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.ativo-badge.ativo   { background: rgba(34,197,94,0.1); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.ativo-badge.inativo { background: rgba(100,116,139,0.1); color: var(--text-muted); border: 1px solid rgba(100,116,139,0.2); }

/* ─── Captacao Actions ──────────────────────────────────────────── */
.captacao-actions {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.captacao-actions .action-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 1;
  min-width: 200px;
}

/* ─── Pipeline badge inline ─────────────────────────────────────── */
.pipeline-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
  margin-right: 4px;
}

/* ─── Modais ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,10,0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--bg-modal);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.25s ease;
}

.modal-box.large { max-width: 720px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 16px; font-weight: 700; }

.modal-close {
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }

.modal-body { padding: 20px 24px; }

.modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}

/* ─── Forms ─────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

.form-group label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-control:focus { border-color: var(--accent-indigo); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }

.form-control:read-only { opacity: 0.6; cursor: default; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

textarea.form-control { resize: vertical; min-height: 80px; }

.input-with-action { display: flex; gap: 8px; align-items: stretch; }
.input-with-action .form-control { flex: 1; }

/* ─── Inner Tabs (modal) ────────────────────────────────────────── */
.tabs-inner {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 4px;
}

.inner-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.inner-tab.active { background: rgba(99,102,241,0.2); color: var(--accent-indigo); }
.inner-tab:hover:not(.active) { background: rgba(255,255,255,0.05); }

.inner-tab-panel { display: none; }
.inner-tab-panel.active { display: block; }

/* ─── Interações ────────────────────────────────────────────────── */
.add-interacao-form {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.add-interacao-form h4 { font-size: 13px; font-weight: 700; margin-bottom: 12px; color: var(--text-secondary); }

.interacoes-lista { display: flex; flex-direction: column; gap: 10px; }

.interacao-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-indigo);
  border-radius: 8px;
  padding: 12px 14px;
}

.interacao-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.interacao-tipo { font-size: 12px; font-weight: 600; color: var(--accent-cyan); }

.interacao-data { font-size: 11px; color: var(--text-muted); margin-left: auto; }

.interacao-desc { font-size: 13px; color: var(--text-secondary); }

.interacao-resultado { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-style: italic; }

/* ─── CFM Info Box ──────────────────────────────────────────────── */
.cfm-info-box {
  display: flex;
  gap: 12px;
  background: rgba(139,92,246,0.08);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.cfm-badge {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  height: fit-content;
}

.cfm-info-box p { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.cfm-link { margin-bottom: 12px; }

.fonte-note { font-size: 11px; color: var(--text-muted); line-height: 1.6; }
.fonte-note a { color: var(--accent-cyan); text-decoration: none; }
.fonte-note a:hover { text-decoration: underline; }

/* ─── Med Edit Header ───────────────────────────────────────────── */
.med-edit-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  margin-bottom: 16px;
}

/* ─── Results Area ──────────────────────────────────────────────── */
.results-area { margin-top: 8px; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }

.empty-state p { font-size: 14px; }

.loading-state {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}

/* Hosps grid */
.hosps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }

.hosp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.hosp-card:hover { border-color: var(--border-bright); transform: translateY(-3px); box-shadow: var(--shadow); }

.hosp-card-name { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--text-primary); }

.hosp-card-meta { font-size: 12px; color: var(--text-secondary); display: flex; flex-direction: column; gap: 3px; }

.hosp-card-resp { font-size: 11px; color: var(--accent-cyan); margin-top: 8px; }

/* ─── Toast ─────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 360px;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error   { border-color: rgba(239,68,68,0.4); }

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner { gap: 10px; padding: 10px 16px; }
  .header-meta { display: none; }
  .app-main { padding: 16px; }
  .tab-btn { padding: 12px 10px; font-size: 12px; }
  .tab-btn .tab-icon { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .med-cards-row { flex-direction: column; }
  .status-summary { gap: 6px; }
  .summary-card { min-width: 80px; padding: 10px; }
}


/* ─── SIDEBAR & MAIN LAYOUT (GLPI Style) ────────────────────────── */
body {
    display: flex;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 240px;
    background-color: #0f172a;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 1000;
    font-size: 12px;
    overflow-y: auto;
}

.sidebar-header {
    padding: 12px 10px;
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    background-color: #0f172a;
    border-bottom: 1px solid #334155;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.menu-group {
    padding: 8px 12px 4px 12px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.5px;
}

.menu-item {
    padding: 6px 12px;
    margin: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    transition: 0.2s;
    font-size: 12px;
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.menu-item:hover {
    background-color: #334155;
    color: #fff;
    border-left: 4px solid #3b82f6;
    padding-left: 16px;
}

.menu-item.active {
    background-color: #2563eb;
    color: #fff;
    border-left: 4px solid #60a5fa;
    padding-left: 16px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: #0f172a;
    padding: 0;
}

.topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 20px;
    background-color: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.tab-panel {
    padding: 20px;
}

.navbar {
    display: none !important;
}
