import React from 'react';

function Badge({ children, tone = 'gray' }) {
  const tones = { green: 'bg-green-100 text-green-800 border-green-200', yellow: 'bg-yellow-100 text-yellow-800 border-yellow-200', red: 'bg-red-100 text-red-800 border-red-200', gray: 'bg-slate-100 text-slate-700 border-slate-200' };
  return <span className={`inline-flex rounded-full border px-3 py-1 text-xs font-semibold ${tones[tone]}`}>{children}</span>;
}

export default function FA13OfflineSyncKonflikte() {
  return (
    <div className="min-h-screen bg-slate-50 p-6 text-slate-900">
      <div className="mx-auto max-w-7xl space-y-5">
        <header className="rounded-2xl border border-sky-200 bg-sky-50 p-6 shadow-sm"><p className="text-sm font-semibold uppercase tracking-wide text-sky-700">UC03 · FA-13</p><h1 className="mt-1 text-3xl font-bold">Offline- / Sync-Konflikte</h1><p className="mt-2 text-sm text-slate-600">pending_sync, Konflikte und vorgemerkte Offline-Verbräuche prüfen.</p></header>
        <div className="grid gap-5 lg:grid-cols-[390px_1fr]">
          <section className="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm"><h2 className="text-lg font-bold">Konfliktliste</h2><div className="mt-4 space-y-3"><div className="rounded-2xl border border-orange-300 bg-orange-50 p-4"><p className="font-semibold">Nina Graf</p><p className="text-sm text-slate-500">Punktekarte · offline -1 · 17:12</p><div className="mt-2"><Badge tone="red">conflict</Badge></div></div><div className="rounded-2xl border border-slate-200 bg-slate-50 p-4"><p className="font-semibold">Maria Keller</p><p className="text-sm text-slate-500">pending_sync · Nitrox 32</p></div><div className="rounded-2xl border border-slate-200 bg-slate-50 p-4"><p className="font-semibold">Luca Meier</p><p className="text-sm text-slate-500">offline vorgemerkt · Luft</p></div></div></section>
          <div className="space-y-5"><section className="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm"><h2 className="text-lg font-bold">Detailprüfung</h2><p className="mt-3 text-sm text-slate-700"><strong>Nina Graf</strong> · Punktekarte gemischt</p><p className="mt-2 text-sm text-slate-600">Online-Saldo: 1 Punkt · Offline-Verbrauch: -1 · zweiter Offline-Verbrauch erkannt</p><div className="mt-4 flex flex-wrap gap-2"><Badge tone="yellow">Saldo knapp</Badge><Badge tone="red">Konflikt</Badge></div><p className="mt-4 text-sm text-slate-600">Keine automatische Gegenbuchung. Benutzerentscheidung erforderlich.</p></section><section className="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm"><h2 className="text-lg font-bold">Systemvorschlag</h2><p className="mt-3 text-sm text-slate-600">Erste Buchung übernehmen, zweite Buchung ablehnen oder FA-10-Korrektur vorbereiten.</p><div className="mt-4 flex flex-wrap gap-2"><button className="rounded-xl border border-slate-300 px-4 py-2 text-sm font-semibold">Übernehmen</button><button className="rounded-xl border border-slate-300 px-4 py-2 text-sm font-semibold">Ablehnen</button><button className="rounded-xl bg-amber-500 px-4 py-2 text-sm font-semibold text-white">FA-10</button></div></section><section className="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm"><h2 className="text-lg font-bold">Audit</h2><div className="mt-4 rounded-xl border border-slate-300 bg-slate-50 px-3 py-2 text-sm text-slate-500">Pflichtgrund für Konfliktentscheidung</div><p className="mt-3 text-sm text-slate-600">Entscheidung wird mit Benutzer und Zeitpunkt gespeichert.</p></section></div>
        </div>
      </div>
    </div>
  );
}
