:root {
  --primary: #1a5276;
  --primary-light: #2c74a8;
  --bg: #f4f6f8;
  --card-bg: #ffffff;
  --border: #dfe4ea;
  --text: #2c3e50;
  --muted: #6b7785;
  --success: #1e8449;
  --error: #c0392b;
  --pending: #b9770e;
}

* { box-sizing: border-box; }

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

.navbar {
  background: var(--primary);
  color: white;
  padding: 0.9rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.navbar a { color: white; text-decoration: none; margin-right: 1rem; font-size: 0.95rem; }
.navbar a:hover { text-decoration: underline; }
.navbar .brand { font-weight: 700; font-size: 1.1rem; margin-right: 2rem; }
.navbar .nav-right { display: flex; align-items: center; flex-wrap: wrap; }

.container { max-width: 960px; margin: 1.5rem auto; padding: 0 1rem; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.card h2, .card h3 { margin-top: 0; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}
.badge.online { background: #2980b9; }
.badge.stacjonarny { background: #8e44ad; }
.badge.zatwierdzony { background: var(--success); }
.badge.oczekujący { background: var(--pending); }
.badge.odrzucony { background: var(--error); }
.badge.tak { background: var(--success); }
.badge.nie { background: var(--muted); }

table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; }

form.inline { display: inline; }

.btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
}
.btn:hover { background: var(--primary-light); }
.btn.small { padding: 0.3rem 0.7rem; font-size: 0.82rem; }
.btn.success { background: var(--success); }
.btn.danger { background: var(--error); }
.btn.muted { background: var(--muted); }

.form-group { margin-bottom: 1rem; }
label { display: block; margin-bottom: 0.3rem; font-weight: 600; font-size: 0.9rem; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
textarea, select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}
textarea { min-height: 90px; resize: vertical; }

.flash { padding: 0.7rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.92rem; }
.flash.success { background: #d5f5e3; color: var(--success); }
.flash.error { background: #fadbd8; color: var(--error); }

.empty-state { color: var(--muted); font-style: italic; padding: 1rem 0; }
.actions-row { display: flex; gap: 0.5rem; align-items: center; }
.page-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

/* --- Widok zaświadczenia (do druku / zapisu jako PDF) --- */
.certificate-page {
  background: white;
  border: 6px double var(--primary);
  border-radius: 4px;
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 800px;
  margin: 1.5rem auto;
}
.certificate-page h1 {
  font-size: 1.9rem;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 2rem;
}
.certificate-page .participant-name {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0.6rem 0 1.4rem;
}
.certificate-page .course-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 0.4rem 0 1rem;
}
.certificate-page .meta { color: var(--muted); font-size: 0.95rem; margin-bottom: 2rem; }
.certificate-page .issue-date { color: var(--muted); font-size: 0.85rem; margin-top: 3rem; }
.print-toolbar { max-width: 800px; margin: 0 auto 1rem; text-align: right; }

@media print {
  .navbar, .print-toolbar, .flash { display: none !important; }
  body { background: white; }
  .container { margin: 0; max-width: none; }
  .certificate-page { border-width: 3px; margin: 0; }
}
