:root {
  --navy: #16264a;
  --navy-light: #eef1f8;
  --red: #c8102e;
  --gold: #d69e00;
  --gold-bg: #fff6dd;
  --text: #333333;
  --border: #d9d9d9;
  --green: #2e8b57;
  --blue: #1f6feb;
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

body {
  margin: 0;
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
  color: var(--text);
  background: #fafafa;
  line-height: 1.55;
}

a { color: var(--navy); }

.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar .brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar .brand span { color: var(--gold); }
.brand-badge {
  height: 34px;
  width: auto;
  background: #fff;
  border-radius: 8px;
  padding: 2px;
}

.topbar nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 18px;
  font-weight: 600;
  opacity: 0.9;
}
.topbar nav a:hover { opacity: 1; text-decoration: underline; }

.stripe {
  height: 8px;
  display: flex;
}
.stripe span { flex: 1; }
.stripe .s1 { background: var(--navy); }
.stripe .s2 { background: var(--red); }
.stripe .s3 { background: var(--gold); }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 70px;
  position: relative;
}

.page-watermark {
  background-image: url("/img/watermark.png");
  background-repeat: no-repeat;
  background-position: bottom right;
  background-size: 340px auto;
  background-attachment: fixed;
}

.hero {
  text-align: center;
  padding: 30px 10px 10px;
}
.hero .logo-hero {
  max-width: 340px;
  width: 100%;
  height: auto;
  margin-bottom: 8px;
}
.hero h1 {
  color: var(--red);
  font-size: 2rem;
  margin: 6px 0;
}
.hero .subtitle {
  color: var(--gold);
  font-weight: 700;
}
.hero .kicker {
  color: var(--navy);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.cta-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 22px 0 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #a30d24; }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy-light); }
.btn-gold { background: var(--gold); color: #1a1a1a; }
.btn-gold:hover { filter: brightness(0.95); }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red); font-size: 0.8rem; padding: 6px 12px; }
.btn-danger:hover { background: #fdeaea; }

section.rule {
  margin-top: 46px;
}
section.rule h2 {
  color: var(--navy);
  border-bottom: 3px solid var(--red);
  padding-bottom: 10px;
  font-size: 1.4rem;
}
section.rule h3 {
  color: var(--red);
  font-size: 1.05rem;
  margin-top: 24px;
}
section.rule p { margin: 10px 0; }
section.rule ul, section.rule ol { margin: 8px 0; padding-left: 26px; }
section.rule li { margin: 6px 0; }
section.rule .tip {
  background: var(--gold-bg);
  border-left: 4px solid var(--gold);
  padding: 10px 14px;
  border-radius: 4px;
  font-style: italic;
}
section.rule .joke { font-style: italic; color: #666; }

strong.hl { color: var(--navy); }
strong.hl-red { color: var(--red); }
strong.hl-gold { color: var(--gold); }

table.data {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 20px;
  font-size: 0.92rem;
}
table.data th {
  background: var(--navy);
  color: #fff;
  padding: 8px 10px;
  text-align: left;
}
table.data td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
}
table.data tr:nth-child(even) td { background: var(--navy-light); }
table.data.center th, table.data.center td { text-align: center; }

.badges {
  display: flex;
  gap: 8px;
  margin: 10px 0 22px;
  flex-wrap: wrap;
}
.badge {
  flex: 1;
  min-width: 70px;
  text-align: center;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.badge .role {
  color: #fff;
  font-weight: 700;
  padding: 6px 0;
}
.badge .val {
  padding: 8px 0;
  font-weight: 700;
  color: var(--navy);
  background: #fff;
}
.badge.tot .val { background: var(--gold-bg); }
.role.p { background: #f2a900; }
.role.d { background: var(--green); }
.role.c { background: var(--blue); }
.role.a { background: var(--red); }
.role.t { background: var(--navy); }

.moduli-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 20px;
}
.moduli-grid div {
  background: var(--navy-light);
  color: var(--navy);
  font-weight: 700;
  text-align: center;
  padding: 10px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

form.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 26px;
  max-width: 520px;
  margin: 20px auto;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
form.card h2 { color: var(--navy); margin-top: 0; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 5px;
  font-size: 0.9rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}
.field textarea { resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.hint { color: #777; font-size: 0.8rem; margin-top: 4px; }

.radio-row { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 4px; }
.radio-inline { display: flex; align-items: center; gap: 6px; font-weight: 400; color: var(--text); font-size: 0.95rem; }
.radio-inline input { width: auto; }

details.inline-form { margin-top: 8px; }
details.inline-form summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.85rem;
  list-style: none;
}
details.inline-form summary::-webkit-details-marker { display: none; }
details.inline-form .box {
  margin-top: 10px;
  padding: 14px;
  background: var(--navy-light);
  border-radius: 8px;
}
details.inline-form .box .field { margin-bottom: 10px; }
details.inline-form .box input { font-size: 0.9rem; padding: 7px 10px; }

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin: 16px 0;
  font-size: 0.92rem;
}
.alert-error { background: #fdeaea; color: var(--red); border: 1px solid #f3b7bf; }
.alert-success { background: #eaf7ee; color: var(--green); border: 1px solid #bfe6cc; }

footer.site {
  text-align: center;
  color: #999;
  font-size: 0.8rem;
  padding: 30px 10px;
}

.admin-shell { max-width: 1100px; }
.admin-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 24px;
}
.admin-panel h2 { color: var(--navy); margin-top: 0; }
.stat-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.stat-card {
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  padding: 18px 22px;
  min-width: 160px;
}
.stat-card .n { font-size: 2rem; font-weight: 800; color: var(--gold); }
.stat-card .l { font-size: 0.85rem; opacity: 0.9; }

table.list { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.list th {
  background: var(--navy);
  color: #fff;
  padding: 8px 10px;
  text-align: left;
  position: sticky;
  top: 0;
}
table.list td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.list tr:nth-child(even) td { background: var(--navy-light); }
.table-wrap { overflow-x: auto; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--navy) 0%, #0c1730 100%);
  padding: 20px;
}
.login-wrap .login-badge {
  width: 96px;
  height: auto;
  background: #fff;
  border-radius: 16px;
  padding: 8px;
  margin-bottom: 18px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

@media (max-width: 640px) {
  .moduli-grid { grid-template-columns: repeat(2, 1fr); }
  .badges { flex-wrap: wrap; }
  .badge { min-width: 45%; }
  .page-watermark { background-size: 220px auto; }
}
