/* style.css — Hospital Private: branco + vinho */
:root {
  --vinho: #7B1A38;
  --vinho-hover: #9D2449;
  --vinho-light: #f5e8ec;
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);

  --aguardando-bg: #fef2f2;
  --aguardando-border: #ef4444;
  --aguardando-text: #dc2626;
  --aguardando-dot: #ef4444;

  --processando-bg: #fffbeb;
  --processando-border: #f59e0b;
  --processando-text: #d97706;
  --processando-dot: #f59e0b;

  --liberado-bg: #f0fdf4;
  --liberado-border: #22c55e;
  --liberado-text: #16a34a;
  --liberado-dot: #22c55e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--vinho);
  color: white;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(123,26,56,0.25);
}
.header h1 { font-size: 17px; font-weight: 700; letter-spacing: 0.3px; }
.header .subtitle { font-size: 12px; opacity: 0.7; margin-top: 2px; display: flex; align-items: center; gap: 4px; }

/* Container */
.container { max-width: 860px; margin: 0 auto; padding: 24px 16px; }

/* Seletor de setor */
.setor-selector { display: flex; gap: 10px; margin-bottom: 24px; }
.setor-btn {
  flex: 1; padding: 14px 12px; border: 2px solid var(--border);
  border-radius: 10px; background: white; cursor: pointer;
  text-align: center; transition: all 0.15s;
  font-size: 13px; font-weight: 700; color: var(--text-muted);
  font-family: inherit;
}
.setor-btn .icon { font-size: 22px; margin-bottom: 4px; display: block; }
.setor-btn.active {
  border-color: var(--vinho);
  background: var(--vinho-light);
  color: var(--vinho);
}
.setor-btn:hover:not(.active) { border-color: #d1d5db; }

/* Formulário novo paciente */
.form-card {
  background: white; border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; margin-bottom: 24px;
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); font-weight: 700;
}
.input-iniciais {
  border: 2px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 20px; font-weight: 800;
  width: 90px; text-align: center; text-transform: uppercase;
  outline: none; transition: border-color 0.15s; font-family: inherit;
}
.input-iniciais:focus { border-color: var(--vinho); }
.setor-toggle { display: flex; gap: 8px; }
.setor-toggle-btn {
  padding: 10px 14px; border: 2px solid var(--border);
  border-radius: 8px; cursor: pointer; font-size: 12px;
  font-weight: 700; color: var(--text-muted); background: white;
  transition: all 0.15s; font-family: inherit;
}
.setor-toggle-btn.active { border-color: var(--vinho); background: var(--vinho); color: white; }
.btn-novo {
  padding: 12px 20px; background: var(--vinho); color: white;
  border: none; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 700; transition: background 0.15s;
  white-space: nowrap; font-family: inherit;
}
.btn-novo:hover { background: var(--vinho-hover); }

/* Título da seção */
.section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); margin-bottom: 10px; font-weight: 600;
}

/* Cards de exame */
.exames-list { display: flex; flex-direction: column; gap: 8px; }
.exame-card {
  border-radius: 10px; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  border: 2px solid; flex-wrap: wrap;
  transition: box-shadow 0.15s;
}
.exame-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.09); }
.exame-card.aguardando { background: var(--aguardando-bg); border-color: var(--aguardando-border); }
.exame-card.processando { background: var(--processando-bg); border-color: var(--processando-border); }
.exame-card.liberado { background: var(--liberado-bg); border-color: var(--liberado-border); }

.status-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.aguardando .status-dot { background: var(--aguardando-dot); }
.processando .status-dot { background: var(--processando-dot); }
.liberado .status-dot { background: var(--liberado-dot); }

.iniciais {
  font-size: 22px; font-weight: 900; min-width: 60px; letter-spacing: 1px;
}
.aguardando .iniciais { color: var(--aguardando-text); }
.processando .iniciais { color: var(--processando-text); }
.liberado .iniciais { color: var(--liberado-text); }

.setor-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 4px; text-transform: uppercase;
  background: var(--vinho-light); color: var(--vinho);
  white-space: nowrap;
}
.hora { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* Botões de status */
.status-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.status-btn {
  padding: 6px 10px; border-radius: 6px; font-size: 11px;
  font-weight: 700; cursor: pointer; border: 1px solid transparent;
  transition: all 0.15s; font-family: inherit; white-space: nowrap;
}
.status-btn.active-aguardando { background: #ef4444; color: white; border-color: #ef4444; }
.status-btn.active-processando { background: #f59e0b; color: white; border-color: #f59e0b; }
.status-btn.active-liberado { background: #22c55e; color: white; border-color: #22c55e; }
.status-btn.inactive {
  background: white; color: #d1d5db; border-color: var(--border);
}
.status-btn.inactive:hover { border-color: #9ca3af; color: #6b7280; }

/* Badge de status (somente leitura — página médico) */
.status-badge {
  font-size: 12px; font-weight: 700; padding: 4px 10px;
  border-radius: 6px; margin-left: auto; white-space: nowrap;
}
.aguardando .status-badge { color: var(--aguardando-text); background: white; border: 1px solid var(--aguardando-border); }
.processando .status-badge { color: var(--processando-text); background: white; border: 1px solid var(--processando-border); }
.liberado .status-badge { color: var(--liberado-text); background: white; border: 1px solid var(--liberado-border); }

/* Botão excluir */
.btn-excluir {
  padding: 6px 12px; background: white; color: var(--vinho);
  border: 1px solid var(--vinho); border-radius: 6px;
  font-size: 11px; font-weight: 700; cursor: pointer;
  transition: all 0.15s; font-family: inherit; white-space: nowrap;
}
.btn-excluir:hover { background: var(--vinho); color: white; }

/* Estado vazio */
.empty {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted); font-size: 14px;
}

/* Indicador de conexão */
.conn-indicator {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block;
}
.conn-indicator.connected { background: #86efac; }
.conn-indicator.disconnected { background: #fca5a5; }
