:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #273449;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --accent: #22c55e;
  --danger: #ef4444;
  --warn: #f59e0b;
  --radius: 10px;
}

* { box-sizing: border-box; }

/* Atrybut hidden musi zawsze wygrywać z regułami display (np. display:flex) */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.muted { color: var(--muted); }
.error { color: var(--danger); font-size: 0.9rem; }

/* Logowanie */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.login-card { width: 100%; max-width: 360px; }
.login-card h1 { margin: 0 0 0.25rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

label { display: block; margin: 0.75rem 0 0.25rem; font-size: 0.85rem; color: var(--muted); }
input, select {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn:hover { filter: brightness(1.1); }
.btn.primary { background: var(--primary); border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; }
.btn.small { padding: 0.25rem 0.55rem; font-size: 0.8rem; }

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }

.content { max-width: 1000px; margin: 0 auto; padding: 1.5rem; }

.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }

.cards { display: flex; flex-direction: column; gap: 0.75rem; }
.case-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.case-card:hover { border-color: var(--primary); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.badge.accepted { color: var(--accent); border-color: var(--accent); }
.badge.rejected { color: var(--danger); border-color: var(--danger); }
.badge.needs_review { color: var(--warn); border-color: var(--warn); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--muted); font-weight: 500; }

.upload-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.upload-row input[type="file"] { flex: 1; min-width: 180px; }

dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
dialog::backdrop { background: rgba(0,0,0,0.6); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }

h3 { margin: 0 0 0.5rem; }
.block { margin: 1.25rem 0; }
