// LPR Platform — Doctor screens (Dashboard, Patients list, Patient overview, Domains, Alerts, Evolution)

// ─────────────────────────────────────────────────────────────
// 1. Login
// ─────────────────────────────────────────────────────────────
function LoginScreen({ T, onLogin }) {
  const [role, setRole] = React.useState('doctor');
  const [email, setEmail] = React.useState('helena.marques@longevium.com.br');
  const [password, setPassword] = React.useState('••••••••••••');
  const roles = [
    { id: 'doctor',  label: 'Médico',   icon: <Icons.Stethoscope size={16}/>, sub: 'Acesso clínico completo' },
    { id: 'clinic', label: 'Clínica',  icon: <Icons.Building size={16}/>,    sub: 'Gestão e governança' },
    { id: 'patient', label: 'Paciente', icon: <Icons.User size={16}/>,        sub: 'Acompanhamento do protocolo' },
  ];
  return (
    <div style={{
      width: '100%', height: '100%', display: 'flex', background: T.bg, fontFamily: T.fontUI, color: T.text,
    }}>
      {/* Left — form */}
      <div style={{ flex: '0 0 52%', padding: '64px 80px', display: 'flex', flexDirection: 'column' }}>
        <div style={{ flexShrink: 0 }}>
          <LPRLogo T={T} size={28}/>
        </div>

        <div style={{ flex: 1, display: 'flex', alignItems: 'center' }}>
          <div style={{ width: '100%', maxWidth: 400 }}>
            <div style={{ fontFamily: T.fontDisplay, fontSize: 28, fontWeight: 600, color: T.text, letterSpacing: -0.6, marginBottom: 6 }}>
              Entrar na plataforma
            </div>
            <div style={{ fontSize: 13.5, color: T.textMute, marginBottom: 28, lineHeight: 1.5 }}>
              Plataforma clínica do protocolo <strong style={{ color: T.text, fontWeight: 600 }}>LPR — Lifestyle Precision Reset</strong>.
            </div>

            <div style={{ display: 'flex', gap: 8, marginBottom: 22 }}>
              {roles.map((r) => {
                const on = role === r.id;
                return (
                  <button key={r.id} onClick={() => setRole(r.id)} className="lpr-btn" style={{
                    flex: 1, padding: '12px 10px', borderRadius: 9,
                    border: `1px solid ${on ? T.p600 : T.border}`,
                    background: on ? T.p50 : T.bg, color: on ? T.p700 : T.text,
                    cursor: 'pointer', display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: 4,
                    boxShadow: on ? `0 0 0 3px ${T.p100}` : 'none',
                  }}>
                    <span style={{ display: 'flex', alignItems: 'center', gap: 6, fontSize: 13, fontWeight: 600 }}>
                      {r.icon} {r.label}
                    </span>
                    <span style={{ fontSize: 11, color: on ? T.p700 : T.textMute, fontWeight: 400 }}>{r.sub}</span>
                  </button>
                );
              })}
            </div>

            <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
              <div>
                <label style={{ fontSize: 12, fontWeight: 500, color: T.textSoft, marginBottom: 5, display: 'block' }}>E-mail profissional</label>
                <Input T={T} icon={<Icons.Mail/>} value={email} onChange={setEmail} full/>
              </div>
              <div>
                <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', marginBottom: 5 }}>
                  <label style={{ fontSize: 12, fontWeight: 500, color: T.textSoft }}>Senha</label>
                  <a className="lpr-link" style={{ fontSize: 11.5, color: T.p600, fontWeight: 500 }}>Esqueci a senha</a>
                </div>
                <Input T={T} icon={<Icons.Lock/>} type="password" value={password} onChange={setPassword} full/>
              </div>
              <Button T={T} kind="primary" size="lg" full onClick={onLogin} iconRight={<Icons.ChevronR/>}>
                Entrar como {roles.find((r) => r.id === role).label.toLowerCase()}
              </Button>
              <Button T={T} kind="secondary" size="lg" full icon={<Icons.Shield/>}>
                SSO institucional · Longevium
              </Button>
            </div>

            <div style={{ marginTop: 22, padding: 12, background: T.surfaceAlt, borderRadius: 8, display: 'flex', gap: 10, alignItems: 'flex-start' }}>
              <Icons.ShieldChk size={16} color={T.p600} style={{ marginTop: 1 }}/>
              <div style={{ fontSize: 11.5, color: T.textSoft, lineHeight: 1.5 }}>
                Sistema em conformidade com <strong style={{ color: T.text }}>LGPD</strong> e <strong style={{ color: T.text }}>HIPAA</strong>. Dados clínicos criptografados em trânsito e em repouso.
                Auditoria completa de acessos.
              </div>
            </div>
          </div>
        </div>

        <div style={{ flexShrink: 0, fontSize: 11, color: T.textFaint, display: 'flex', justifyContent: 'space-between' }}>
          <span>© 2026 Longevium · LPR Platform v1.4.2</span>
          <span>Suporte clínico · suporte@longevium.com.br</span>
        </div>
      </div>

      {/* Right — visual side */}
      <div style={{
        flex: 1, position: 'relative', overflow: 'hidden',
        background: `linear-gradient(135deg, ${T.p700} 0%, ${T.p900} 100%)`,
        color: '#fff', padding: '64px 56px', display: 'flex', flexDirection: 'column',
      }}>
        {/* Decorative concentric rings */}
        <svg style={{ position: 'absolute', right: -80, top: -80, opacity: 0.16 }} width="520" height="520" viewBox="0 0 520 520">
          {[1,2,3,4,5,6,7,8].map((i) => (
            <circle key={i} cx="260" cy="260" r={30 * i} fill="none" stroke="#fff" strokeWidth="1"/>
          ))}
        </svg>
        <svg style={{ position: 'absolute', left: -120, bottom: -120, opacity: 0.1 }} width="420" height="420" viewBox="0 0 420 420">
          {[1,2,3,4,5,6].map((i) => (
            <circle key={i} cx="210" cy="210" r={28 * i} fill="none" stroke="#fff" strokeWidth="1"/>
          ))}
        </svg>

        <div style={{ flex: 1, display: 'flex', flexDirection: 'column', justifyContent: 'flex-end', position: 'relative' }}>
          <div style={{
            fontSize: 11, fontWeight: 500, letterSpacing: 1.2, textTransform: 'uppercase',
            color: 'rgba(255,255,255,0.65)', marginBottom: 18,
          }}>Plataforma clínica · Precisão por padrões</div>
          <div style={{ fontFamily: T.fontDisplay, fontSize: 36, fontWeight: 600, letterSpacing: -0.8, lineHeight: 1.15, marginBottom: 18 }}>
            O sistema não responde ao dado.<br/>
            <span style={{ color: T.p200 }}>Responde ao padrão ao longo do tempo.</span>
          </div>
          <div style={{ fontSize: 14, color: 'rgba(255,255,255,0.78)', lineHeight: 1.55, maxWidth: 420 }}>
            Orquestração de protocolos clínicos longitudinais com Safety Engine integrado, análise interdomínios e governança médica.
          </div>

          <div style={{
            marginTop: 36, display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 18,
            paddingTop: 22, borderTop: '1px solid rgba(255,255,255,0.18)',
          }}>
            <div>
              <div style={{ fontSize: 22, fontWeight: 700, letterSpacing: -0.4 }}>8</div>
              <div style={{ fontSize: 11, color: 'rgba(255,255,255,0.65)', marginTop: 2 }}>Domínios clínicos</div>
            </div>
            <div>
              <div style={{ fontSize: 22, fontWeight: 700, letterSpacing: -0.4 }}>120+</div>
              <div style={{ fontSize: 11, color: 'rgba(255,255,255,0.65)', marginTop: 2 }}>Marcadores rastreados</div>
            </div>
            <div>
              <div style={{ fontSize: 22, fontWeight: 700, letterSpacing: -0.4 }}>24/7</div>
              <div style={{ fontSize: 11, color: 'rgba(255,255,255,0.65)', marginTop: 2 }}>Monitoramento contínuo</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// 2. Dashboard do médico
// ─────────────────────────────────────────────────────────────
function DashboardScreen({ T, onOpenPatient, onNavigate }) {
  const [filter, setFilter] = React.useState('all');
  const filters = [
    { id: 'all',     label: 'Todos',        count: 47 },
    { id: 'red',     label: 'Alerta vermelho', count: 4 },
    { id: 'pending', label: 'Exames pendentes', count: 11 },
    { id: 'low',     label: 'Baixa adesão',     count: 6 },
    { id: 'block',   label: 'Bloqueado pelo Safety', count: 3 },
  ];
  const priority = PATIENTS.slice().sort((a, b) => {
    const order = { red: 0, yellow: 1, green: 2 };
    return order[a.semaphore] - order[b.semaphore] || (a.adherence - b.adherence);
  });
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 20 }}>

      {/* Hero KPI strip */}
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(5, 1fr)', gap: 12 }}>
        <KPI T={T} label="Pacientes ativos" value="47" sub={<>em 3 protocolos</>} icon={<Icons.Users/>} tone="primary"
             onClick={() => setFilter('all')} active={filter === 'all'}
             trend={<Trend value={+3} T={T} suffix=" novos"/>}/>
        <KPI T={T} label="Alerta vermelho" value="4" sub="exigem atenção hoje" icon={<Icons.AlertTri/>} tone="error"
             onClick={() => setFilter('red')} active={filter === 'red'}
             trend={<Trend value={+1} T={T} positiveIsGood={false}/>}/>
        <KPI T={T} label="Exames pendentes" value="11" sub="aguardando validação" icon={<Icons.FileText/>} tone="warning"
             onClick={() => setFilter('pending')} active={filter === 'pending'}/>
        <KPI T={T} label="Baixa adesão" value="6" sub="< 70% no plano" icon={<Icons.TrendDn/>} tone="warning"
             onClick={() => setFilter('low')} active={filter === 'low'}/>
        <KPI T={T} label="Bloq. Safety Engine" value="3" sub="intervenção pausada" icon={<Icons.ShieldX/>} tone="error"
             onClick={() => setFilter('block')} active={filter === 'block'}/>
      </div>

      <div style={{ display: 'grid', gridTemplateColumns: '1.7fr 1fr', gap: 16 }}>
        {/* Priority list */}
        <Card T={T} padding={0}
          title="Lista priorizada de pacientes"
          subtitle="Ordenado por risco e tempo desde último check-in"
          action={
            <div style={{ display: 'flex', gap: 8 }}>
              <Button T={T} kind="ghost" size="sm" icon={<Icons.Filter/>}>Filtros</Button>
              <Button T={T} kind="secondary" size="sm" iconRight={<Icons.ChevronR/>} onClick={() => onNavigate && onNavigate('patients')}>Ver todos</Button>
            </div>
          }>
          <div style={{ display: 'flex', gap: 6, padding: '0 16px 12px', borderBottom: `1px solid ${T.border}`, flexWrap: 'wrap' }}>
            {filters.map((f) => {
              const on = filter === f.id;
              return (
                <button key={f.id} onClick={() => setFilter(f.id)} className="lpr-btn" style={{
                  border: `1px solid ${on ? T.p600 : T.border}`,
                  background: on ? T.p50 : T.bg, color: on ? T.p700 : T.textSoft,
                  padding: '5px 10px', borderRadius: 999, cursor: 'pointer',
                  fontSize: 12, fontWeight: 500, display: 'inline-flex', alignItems: 'center', gap: 6,
                }}>
                  {f.label}
                  <span style={{ fontSize: 10.5, fontWeight: 600, color: on ? T.p700 : T.textMute }}>{f.count}</span>
                </button>
              );
            })}
          </div>
          <div>
            {priority.slice(0, 7).map((p, i) => (
              <PatientRow key={p.id} p={p} T={T} divider={i < 6} compact onClick={() => onOpenPatient && onOpenPatient(p.id)}/>
            ))}
          </div>
        </Card>

        {/* Right column — activity + insights */}
        <div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
          <Card T={T} title="Resumo do dia" subtitle="Sexta · 03 maio 2026"
            action={<Pill T={T} tone="primary">Plantão Dr. Helena</Pill>}>
            <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 10, marginBottom: 12 }}>
              <Stat T={T} label="Check-ins hoje" value="34/47" sub="72% no horário"/>
              <Stat T={T} label="LPR Daily preenchido" value="29/47" sub="62% até 12h"/>
              <Stat T={T} label="Decisões Safety" value="12" sub="3 bloqueios · 5 cautelas"/>
              <Stat T={T} label="Score médio coorte" value="64.3" sub={<Trend value={+1.2} T={T}/>}/>
            </div>
            <Meter T={T} label="Adesão média da coorte" right="73%" value={73} color={T.warning}/>
            <div style={{ height: 10 }}/>
            <Meter T={T} label="Cobertura de dados (8 domínios)" right="81%" value={81} color={T.p500}/>
          </Card>

          <Card T={T} title="Padrões emergentes detectados" subtitle="Análise interdomínios · últimos 7 dias"
            action={<Pill T={T} tone="info" icon={<Icons.Zap size={11}/>}>3 padrões</Pill>}>
            {[
              { p: ['Mariana Corrêa'], pat: 'Sono → Glicemia → Adesão', sev: 'high', delta: 'piorando' },
              { p: ['Eduardo Pacheco'], pat: 'Inflamação + Metabólico', sev: 'high', delta: 'piorando' },
              { p: ['Sofia Mendonça'], pat: 'Hormonal + Comportamental', sev: 'medium', delta: 'estável' },
            ].map((row, i) => (
              <div key={i} style={{
                display: 'flex', alignItems: 'flex-start', gap: 10, padding: '10px 0',
                borderBottom: i < 2 ? `1px solid ${T.border}` : 0,
              }}>
                <Dot T={T} status={row.sev === 'high' ? 'red' : 'yellow'} size={8}/>
                <div style={{ flex: 1, minWidth: 0 }}>
                  <div style={{ fontSize: 12.5, fontWeight: 500, color: T.text }}>{row.pat}</div>
                  <div style={{ fontSize: 11.5, color: T.textMute, marginTop: 2 }}>{row.p[0]} · {row.delta}</div>
                </div>
                <Icons.ChevronR size={14} color={T.textFaint} style={{ marginTop: 4 }}/>
              </div>
            ))}
          </Card>
        </div>
      </div>
    </div>
  );
}

function Stat({ T, label, value, sub }) {
  return (
    <div style={{ padding: '10px 12px', background: T.surface, borderRadius: 8, border: `1px solid ${T.border}` }}>
      <div style={{ fontSize: 10.5, color: T.textMute, fontWeight: 500, letterSpacing: 0.1, textTransform: 'uppercase' }}>{label}</div>
      <div style={{ fontFamily: T.fontDisplay, fontSize: 18, fontWeight: 700, color: T.text, letterSpacing: -0.3, marginTop: 3 }}>{value}</div>
      {sub != null ? <div style={{ fontSize: 11, color: T.textMute, marginTop: 1 }}>{sub}</div> : null}
    </div>
  );
}

function PatientRow({ p, T, divider, compact, onClick }) {
  const sem = STATUS_COLOR(T)[p.semaphore];
  return (
    <div className="lpr-row" onClick={onClick} style={{
      display: 'flex', alignItems: 'center', gap: 14, padding: '12px 16px',
      borderBottom: divider ? `1px solid ${T.border}` : 0, cursor: 'pointer',
    }}
      onMouseEnter={(e) => e.currentTarget.style.background = T.surfaceAlt}
      onMouseLeave={(e) => e.currentTarget.style.background = 'transparent'}>
      <Avatar name={p.name} T={T} size={32}/>
      <div style={{ flex: 1, minWidth: 0 }}>
        <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
          <span style={{ fontSize: 13, fontWeight: 600, color: T.text }}>{p.name}</span>
          <span style={{ fontSize: 11, color: T.textMute }}>{p.age}a · {p.sex}</span>
          {p.safety === 'block' ? <Pill T={T} tone="error" icon={<Icons.ShieldX size={10}/>}>Safety bloqueia</Pill> : null}
          {p.safety === 'caution' ? <Pill T={T} tone="warning" icon={<Icons.Shield size={10}/>}>Cautela</Pill> : null}
        </div>
        <div style={{ display: 'flex', alignItems: 'center', gap: 10, marginTop: 3, fontSize: 11.5, color: T.textMute }}>
          <span>{p.cycle}</span>
          <span>·</span>
          <span>Check-in {p.lastCheckin}</span>
          {p.alerts > 0 ? <><span>·</span><span style={{ color: T.error, fontWeight: 600 }}>{p.alerts} alertas</span></> : null}
        </div>
      </div>

      {/* Domain dots */}
      {!compact ? null : (
        <div style={{ display: 'flex', gap: 3 }}>
          {LPR_DOMAINS.map((d) => {
            let s = 'green';
            if ((p.redDomains || []).includes(d.id)) s = 'red';
            else if ((p.yellowDomains || []).includes(d.id)) s = 'yellow';
            const c = STATUS_COLOR(T)[s];
            return <span key={d.id} title={d.label} style={{ width: 8, height: 8, borderRadius: '50%', background: c.fg }}/>;
          })}
        </div>
      )}

      <div style={{ width: 84, textAlign: 'right' }}>
        <div style={{ fontSize: 10.5, color: T.textMute, marginBottom: 2 }}>Score LPR</div>
        <div style={{ display: 'inline-flex', alignItems: 'baseline', gap: 4 }}>
          <span style={{ fontFamily: T.fontDisplay, fontSize: 18, fontWeight: 700, color: sem.fg, letterSpacing: -0.3 }}>{p.scoreGlobal}</span>
          <Trend value={p.scoreGlobalDelta} T={T}/>
        </div>
      </div>

      <Sparkline T={T} values={p.scoreTrend || [50,52,54,53,55,56]} color={sem.fg} fill={sem.bg} width={70} height={28}/>

      <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
        <div style={{
          width: 10, height: 10, borderRadius: '50%', background: sem.fg, boxShadow: `0 0 0 3px ${sem.bg}`,
        }}/>
      </div>

      <Button T={T} kind="ghost" size="sm" iconRight={<Icons.ChevronR/>}>Abrir</Button>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────
// 3. Lista de pacientes (tabela)
// ─────────────────────────────────────────────────────────────
function PatientsListScreen({ T, onOpenPatient }) {
  const [search, setSearch] = React.useState('');
  const [sort, setSort] = React.useState('priority');
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 14 }}>
      <div style={{ display: 'flex', gap: 10, alignItems: 'center' }}>
        <Input T={T} icon={<Icons.Search/>} placeholder="Buscar por nome, MRN, e-mail" value={search} onChange={setSearch} style={{ flex: 1, maxWidth: 360 }} full/>
        <Button T={T} kind="secondary" size="sm" icon={<Icons.Filter/>}>Protocolo: LPR-LR-1</Button>
        <Button T={T} kind="secondary" size="sm" icon={<Icons.Filter/>}>Status: ativos</Button>
        <Button T={T} kind="secondary" size="sm" icon={<Icons.Filter/>}>Risco: todos</Button>
        <Button T={T} kind="secondary" size="sm" icon={<Icons.Calendar/>}>Última atualização: 7d</Button>
        <div style={{ flex: 1 }}/>
        <Button T={T} kind="primary" size="sm" icon={<Icons.Plus/>}>Adicionar paciente</Button>
      </div>

      <Card T={T} padding={0}>
        <table style={{ width: '100%', borderCollapse: 'collapse', fontFamily: T.fontUI }}>
          <thead>
            <tr style={{ background: T.surface, borderBottom: `1px solid ${T.border}` }}>
              {['Paciente', 'Protocolo', 'Score LPR', 'Semáforo', 'Domínios em vermelho', 'Último check-in', 'Alertas', 'Exames', ''].map((h, i) => (
                <th key={i} style={{
                  padding: '10px 14px', textAlign: i === 2 ? 'right' : 'left',
                  fontSize: 11, fontWeight: 600, color: T.textMute, letterSpacing: 0.2, textTransform: 'uppercase',
                }}>{h}</th>
              ))}
            </tr>
          </thead>
          <tbody>
            {PATIENTS.map((p, i) => {
              const sem = STATUS_COLOR(T)[p.semaphore];
              return (
                <tr key={p.id} className="lpr-row" onClick={() => onOpenPatient && onOpenPatient(p.id)}
                  style={{ borderBottom: i < PATIENTS.length - 1 ? `1px solid ${T.border}` : 0, cursor: 'pointer' }}
                  onMouseEnter={(e) => e.currentTarget.style.background = T.surface}
                  onMouseLeave={(e) => e.currentTarget.style.background = 'transparent'}>
                  <td style={{ padding: '12px 14px' }}>
                    <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
                      <Avatar name={p.name} T={T} size={30}/>
                      <div>
                        <div style={{ fontSize: 13, fontWeight: 600, color: T.text }}>{p.name}</div>
                        <div style={{ fontSize: 11, color: T.textMute }}>{p.age}a · {p.sex} · {p.mrn}</div>
                      </div>
                    </div>
                  </td>
                  <td style={{ padding: '12px 14px' }}>
                    <div style={{ fontSize: 12.5, color: T.text, fontWeight: 500 }}>{p.protocolShort}</div>
                    <div style={{ fontSize: 11, color: T.textMute }}>{p.cycle}</div>
                  </td>
                  <td style={{ padding: '12px 14px', textAlign: 'right' }}>
                    <div style={{ display: 'inline-flex', alignItems: 'center', gap: 8, justifyContent: 'flex-end' }}>
                      <Sparkline T={T} values={p.scoreTrend} color={sem.fg} fill={sem.bg} width={56} height={22}/>
                      <span style={{ fontFamily: T.fontDisplay, fontSize: 16, fontWeight: 700, color: sem.fg, letterSpacing: -0.3, fontVariantNumeric: 'tabular-nums' }}>{p.scoreGlobal}</span>
                      <Trend value={p.scoreGlobalDelta} T={T}/>
                    </div>
                  </td>
                  <td style={{ padding: '12px 14px' }}><Semaphore T={T} status={p.semaphore}/></td>
                  <td style={{ padding: '12px 14px' }}>
                    <div style={{ display: 'flex', gap: 4, flexWrap: 'wrap' }}>
                      {(p.redDomains || []).length === 0 ? <span style={{ fontSize: 12, color: T.textFaint }}>—</span>
                        : (p.redDomains || []).map((d) => (
                          <Pill key={d} T={T} tone="error">{LPR_DOMAINS.find((x) => x.id === d)?.short}</Pill>
                        ))}
                    </div>
                  </td>
                  <td style={{ padding: '12px 14px', fontSize: 12, color: T.textSoft }}>{p.lastCheckin}</td>
                  <td style={{ padding: '12px 14px' }}>
                    {p.alerts > 0 ? (
                      <Pill T={T} tone={p.alerts >= 3 ? 'error' : 'warning'} icon={<Icons.Bell size={10}/>}>{p.alerts}</Pill>
                    ) : <span style={{ fontSize: 12, color: T.textFaint }}>—</span>}
                  </td>
                  <td style={{ padding: '12px 14px' }}>
                    {p.examsStatus === 'pending' && <Pill T={T} tone="warning">Pendentes</Pill>}
                    {p.examsStatus === 'lowConfidence' && <Pill T={T} tone="error">Baixa confiança</Pill>}
                    {p.examsStatus === 'validated' && <Pill T={T} tone="success" icon={<Icons.Check size={10}/>}>Validados</Pill>}
                  </td>
                  <td style={{ padding: '12px 14px', textAlign: 'right' }}>
                    <Button T={T} kind="ghost" size="sm" iconRight={<Icons.ChevronR/>}>Abrir</Button>
                  </td>
                </tr>
              );
            })}
          </tbody>
        </table>
      </Card>

      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', fontSize: 12, color: T.textMute }}>
        <span>Mostrando 1–8 de 47 pacientes</span>
        <div style={{ display: 'flex', gap: 6 }}>
          <Button T={T} kind="ghost" size="sm" icon={<Icons.ChevronL/>}>Anterior</Button>
          <Button T={T} kind="secondary" size="sm" iconRight={<Icons.ChevronR/>}>Próxima</Button>
        </div>
      </div>
    </div>
  );
}

Object.assign(window, { LoginScreen, DashboardScreen, PatientsListScreen, Stat, PatientRow });
