/* ==========================================================================
   Zagreb Marathon – UI modernization (Proposal B)
   One shared component layer on top of Bootstrap 4.3.1 and style.css.
   Loaded last (after the inline <style> in base.html and after
   {% block head %} in base_iframe.html), so no !important is needed for
   ordinary overrides. New classes use the .zgm- prefix.
   ========================================================================== */
:root {
  --zgm-ink: #231f20;
  --zgm-sky: #12a9e1;
  --zgm-lime: #8bc53a;
  --zgm-action: #0a5f86;
  --zgm-action-hover: #084c6b;
  --zgm-action-tint: #e3f3fb;
  --zgm-success: #3d7a14;
  --zgm-success-bg: #eef6e4;
  --zgm-warn: #7a5600;
  --zgm-warn-bg: #fff5d6;
  --zgm-danger: #b42a35;
  --zgm-danger-bg: #fbeaec;
  --zgm-muted: #5b6670;
  --zgm-paper: #f2f5f7;
  --zgm-line: #dce3e8;
  --zgm-field: #c6d0d8;
  --zgm-radius: 6px;
  --zgm-radius-lg: 10px;
  --zgm-font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --zgm-display: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  /* race colours: small markers and the bib header only */
  --race-1: #231f20;  /* marathon   */
  --race-2: #0a5f86;  /* half       */
  --race-3: #8bc53a;  /* 10 km      */
  --race-4: #12a9e1;  /* relay      */
  --race-5: #f2a900;  /* children's */
  --race-0: #8a969f;  /* unknown    */
}

/* ---------- Base ---------- */
body {
  font-family: var(--zgm-font);
  color: var(--zgm-ink);
  background: var(--zgm-paper);
  line-height: 1.55;
}
.overlay { display: none; }
h1, h2, h3, h4, h5 { font-family: var(--zgm-display); font-weight: 600; color: var(--zgm-ink); }
a { color: var(--zgm-action); }
a:hover { color: var(--zgm-action-hover); }
.text-muted { color: var(--zgm-muted) !important; } /* Bootstrap's own rule is !important */
:focus-visible { outline: 3px solid var(--zgm-sky); outline-offset: 2px; }
.btn:focus-visible { outline: 3px solid var(--zgm-sky); outline-offset: 2px; }

/* ---------- Header (base.html #mainNav) ---------- */
#mainNav.zgm-header {
  background: #fff linear-gradient(90deg, var(--zgm-lime) 50%, var(--zgm-sky) 50%) top / 100% 3px no-repeat;
  border-bottom: 1px solid var(--zgm-line);
  box-shadow: none;
  padding-top: calc(.5rem + 3px);
}
#mainNav.zgm-header img.logo-img { height: 34px; max-height: 34px; margin-top: 0; }
#mainNav.zgm-header .navbar-nav .nav-link {
  color: var(--zgm-ink);
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.5;
  text-transform: none;
  padding: .45rem .75rem;
  border-radius: var(--zgm-radius);
}
#mainNav.zgm-header .navbar-nav .nav-link:hover { background: var(--zgm-paper); color: var(--zgm-ink); opacity: 1; }
#mainNav.zgm-header .navbar-nav .nav-link[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--zgm-action); border-radius: 0; }
#mainNav.zgm-header .navbar-toggler { border-color: var(--zgm-line); }
.zgm-lang { display: inline-flex; border: 1px solid var(--zgm-line); border-radius: var(--zgm-radius); overflow: hidden; margin-left: .5rem; }
.zgm-lang a { padding: .3rem .6rem; font-size: .85rem; font-weight: 600; color: var(--zgm-muted); text-decoration: none; }
.zgm-lang a:hover { background: var(--zgm-paper); color: var(--zgm-ink); }
.zgm-lang a[aria-current="true"] { background: var(--zgm-ink); color: #fff; }
.zgm-skip:focus { position: fixed; top: .5rem; left: .5rem; z-index: 1100; background: #fff; padding: .5rem 1rem; border-radius: var(--zgm-radius); }

/* ---------- Page scaffolding ---------- */
#main-content {
  margin-top: 96px;
  border: 1px solid var(--zgm-line);
  border-radius: var(--zgm-radius-lg);
  box-shadow: none;
}
.zgm-hero + #main-content { margin-top: 1.5rem; }
#main-content.zgm-wide { max-width: 1500px; }
div.prijave-title h2, .zgm-page-head h2 { font-size: 2.2rem; line-height: 1.1; }
.zgm-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.zgm-page-head h2 { margin: 0; }
.zgm-panel { background: #fff; border: 1px solid var(--zgm-line); border-radius: var(--zgm-radius-lg); padding: 1.5rem; }
.zgm-panel + .zgm-panel { margin-top: 1.25rem; }
.zgm-panel > h3 { font-size: 1.5rem; margin-bottom: 1rem; }

/* ---------- Buttons ---------- */
.btn { border-radius: var(--zgm-radius); font-weight: 600; }
.btn-primary, .btn-primary:not(:disabled):not(.disabled):active { background: var(--zgm-action); border-color: var(--zgm-action); }
.btn-primary:hover { background: var(--zgm-action-hover); border-color: var(--zgm-action-hover); }
.btn-outline-secondary { color: var(--zgm-ink); border-color: var(--zgm-field); background: #fff; }
.btn-outline-secondary:hover, .btn-outline-secondary:not(:disabled):not(.disabled):active { background: var(--zgm-paper); color: var(--zgm-ink); border-color: var(--zgm-muted); }
.btn-secondary { background: #fff; color: var(--zgm-ink); border-color: var(--zgm-field); }
.btn-secondary:hover { background: var(--zgm-paper); color: var(--zgm-ink); border-color: var(--zgm-muted); }
.btn-icon {
  width: 2rem; height: 2rem; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--zgm-radius); color: var(--zgm-muted); background: transparent; text-decoration: none;
}
.btn-icon:hover { background: var(--zgm-paper); border-color: var(--zgm-line); color: var(--zgm-ink); text-decoration: none; }
.btn-icon.is-danger:hover { background: var(--zgm-danger-bg); color: var(--zgm-danger); border-color: #f0c4c9; }

/* ---------- Forms (all pages) ---------- */
#main-content label { font-weight: 500; }
#main-content .form-control:not(.form-control-sm) { border-color: var(--zgm-field); border-radius: var(--zgm-radius); min-height: 2.75rem; }
#main-content .input-group-text { border-color: var(--zgm-field); background: var(--zgm-paper); }
.form-control:focus { border-color: var(--zgm-action); box-shadow: 0 0 0 3px rgba(18, 169, 225, .25); }
.select2-container--bootstrap4 .select2-selection--single { display: flex; align-items: center; min-height: 2.75rem; border-color: var(--zgm-field); border-radius: var(--zgm-radius); }
.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow { top: 0; height: 100%; }
.zgm-consent .form-check-input { width: 1.1rem; height: 1.1rem; margin-top: .2rem; }
.zgm-consent { padding-left: 1.75rem; }
.zgm-consent .form-check-input { margin-left: -1.75rem; }
.zgm-fieldset { border: 0; padding: 0; margin: 0 0 2rem; min-width: 0; }
.zgm-fieldset > legend {
  font-family: var(--zgm-display); font-size: 1.5rem; font-weight: 600; width: 100%;
  padding-bottom: .5rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--zgm-line);
}
.zgm-subfieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.zgm-subfieldset > legend { font-size: 1rem; font-weight: 500; margin-bottom: .5rem; }
.zgm-section-title { font-family: var(--zgm-display); font-size: 1.3rem; font-weight: 600; margin: .5rem 0 .75rem; }
div.gdpr-box { background: var(--zgm-paper); border: 1px solid var(--zgm-line); border-radius: var(--zgm-radius); padding: .9rem 1.1rem; font-size: .9rem; height: 190px; overflow-y: auto; }
div.show-pdf p { background: var(--zgm-warn-bg); border-left: 4px solid #f2a900; border-radius: var(--zgm-radius); padding: .75rem 1rem; color: #5c4300; font-size: .9rem; }
#main-content hr { border-top-color: var(--zgm-line); }

/* option card: existing .form-check add-ons (engraving, refund protection) */
.form-check.zgm-option {
  border: 1px solid var(--zgm-line); border-radius: var(--zgm-radius-lg); background: #fff;
  padding: .9rem 1.1rem .9rem 2.8rem; margin-bottom: .25rem;
}
.form-check.zgm-option .form-check-input { margin-left: -1.65rem; margin-top: .25rem; width: 1.1rem; height: 1.1rem; }
.form-check.zgm-option .form-check-label { font-weight: 600; }
.form-check.zgm-option p.small { margin: .15rem 0 0; color: var(--zgm-muted); }
.form-check.zgm-option:has(input:checked) { border-color: var(--zgm-action); background: var(--zgm-action-tint); }
.zgm-consent .form-check-label { font-weight: 500; }

/* relay runner blocks (existing div#marathon-relay-rN / #marathon-relay-rN) */
.zgm-runner { border: 1px solid var(--zgm-line); border-radius: var(--zgm-radius-lg); padding: 1rem 1rem .25rem; margin: 0 0 1rem; }
.zgm-runner h2 { font-size: 1.35rem; margin-bottom: .75rem; }
.zgm-runner + hr { display: none; }

/* ---------- Callouts ---------- */
.zgm-callout { display: flex; gap: .75rem; border-radius: var(--zgm-radius); padding: .85rem 1rem; border-left: 4px solid; margin-bottom: 1.25rem; }
.zgm-callout .fa { margin-top: .3rem; }
.zgm-callout p:last-child { margin-bottom: 0; }
.zgm-callout--success { background: var(--zgm-success-bg); border-color: var(--zgm-lime); color: #2b5a0c; }
.zgm-callout--warn { background: var(--zgm-warn-bg); border-color: #f2a900; color: #5c4300; }

/* ---------- Hero + race cards (register.html) ---------- */
.zgm-hero {
  color: #fff;
  background:
    linear-gradient(100deg, rgba(35, 31, 32, .9) 0%, rgba(35, 31, 32, .72) 45%, rgba(10, 95, 134, .6) 100%),
    url(/static/bgs/fitsum-admasu-oGv9xIl7DkY-unsplash.jpg) center 35% / cover no-repeat;
  margin-top: 66px;
  padding: 2.75rem 0;
}
.zgm-hero__edition { font-family: var(--zgm-display); font-weight: 600; font-size: 1.25rem; color: var(--zgm-lime); margin: 0; }
.zgm-hero h1 { color: #fff; font-size: 3.6rem; font-weight: 700; line-height: 1.05; margin: .1rem 0 .5rem; }
.zgm-hero__date { font-size: 1.15rem; margin: 0; }
.zgm-hero__login { margin: 1.1rem 0 0; font-size: .95rem; }
.zgm-hero__login small { font-size: inherit; }
.zgm-hero__login a { color: #fff; font-weight: 600; text-decoration: underline; }

.zgm-races__hint { color: var(--zgm-muted); margin: -.5rem 0 1rem; }
.zgm-races__error { display: none; margin: .75rem 0 0; padding: .6rem .9rem; color: var(--zgm-danger); font-weight: 600; background: #fdecec; border-left: 4px solid var(--zgm-danger); border-radius: var(--zgm-radius); }
.zgm-races.is-invalid .zgm-races__error { display: block; }
.zgm-race-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; }
/* cards sit in the narrower form column: indicator on its own line so names keep the full card width */
@media (min-width: 768px) {
  .zgm-race-grid .zgm-race__card { padding: .8rem .75rem .75rem; }
  .zgm-race-grid .zgm-race__name::before { display: block; margin: 0 0 .4rem; }
  .zgm-race-grid .zgm-race__dist { font-size: 1.6rem; white-space: nowrap; }
}
.zgm-race { position: relative; display: block; margin: 0; cursor: pointer; }
.zgm-race input { position: absolute; opacity: 0; top: 0; left: 0; width: 100%; height: 100%; margin: 0; }
.zgm-race__card {
  height: 100%; background: #fff; border: 1px solid var(--zgm-line); border-top: 5px solid var(--race, var(--race-0));
  border-radius: var(--zgm-radius-lg); padding: .9rem 1rem .85rem; box-shadow: 0 6px 18px rgba(35, 31, 32, .12);
  display: flex; flex-direction: column;
}
.zgm-race__name { font-weight: 600; }
.zgm-race__dist { font-family: var(--zgm-display); font-weight: 700; font-size: 1.9rem; line-height: 1.05; }
.zgm-race__dist small { font-size: 1rem; font-weight: 600; }
.zgm-race__price { font-weight: 600; margin-top: .3rem; }
.zgm-race__spots { font-size: .85rem; color: var(--zgm-muted); margin-top: auto; padding-top: .5rem; }
.zgm-meter { display: block; height: 4px; background: var(--zgm-paper); border-radius: 2px; margin-top: .3rem; overflow: hidden; }
.zgm-meter span { display: block; height: 100%; background: var(--zgm-muted); }
/* radio-style indicator before every race name: hollow when free, filled with a tick when selected */
.zgm-race__name::before {
  content: ""; display: inline-block; box-sizing: border-box; width: 1.1rem; height: 1.1rem; margin-right: .45rem; vertical-align: -.2rem;
  border: 2px solid var(--zgm-muted); border-radius: 50%; background: #fff;
  font: normal .65rem/calc(1.1rem - 4px) FontAwesome; color: #fff; text-align: center;
}
.zgm-race input:checked + .zgm-race__card { background: #eef7fb; border-color: var(--zgm-ink); border-top-color: var(--race, var(--race-0)); box-shadow: 0 0 0 3px var(--zgm-ink), 0 6px 18px rgba(35, 31, 32, .12); }
.zgm-race input:checked + .zgm-race__card .zgm-race__name::before { content: "\f00c"; border-color: var(--zgm-ink); background: var(--zgm-ink); }
.zgm-race input:focus-visible + .zgm-race__card { outline: 3px solid var(--zgm-sky); outline-offset: 2px; }
.zgm-race input:disabled + .zgm-race__card { opacity: .62; cursor: not-allowed; box-shadow: none; background: #f7f9fa; }
.zgm-race:hover input:not(:disabled) + .zgm-race__card { border-color: var(--zgm-muted); }
.zgm-race-more { margin-top: 1rem; display: flex; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; }
.zgm-race-more__label { color: var(--zgm-muted); font-weight: 500; }
.zgm-race-grid--compact { display: flex; flex-wrap: wrap; gap: .5rem; }
.zgm-race--compact .zgm-race__card {
  flex-direction: row; align-items: baseline; gap: .6rem; padding: .45rem .8rem;
  border-top-width: 1px; border-left: 4px solid var(--race, var(--race-0)); box-shadow: none;
}
.zgm-race--compact .zgm-race__dist, .zgm-race--compact .zgm-meter, .zgm-race--compact .zgm-race__spots { display: none; }
.zgm-race--compact .zgm-race__price { margin: 0; color: var(--zgm-muted); font-weight: 500; }
.zgm-summary { position: sticky; top: 88px; }
.zgm-summary h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.zgm-summary__race { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: 1.1rem; }

/* ---------- Race dot & status pill ---------- */
.zgm-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--race, var(--race-0)); flex: none; }
.zgm-status { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .8rem; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.zgm-status--paid { background: var(--zgm-success-bg); color: var(--zgm-success); }
.zgm-status--due { background: var(--zgm-warn-bg); color: var(--zgm-warn); }
.zgm-status--free { background: var(--zgm-paper); color: var(--zgm-muted); }
[data-race="1"] { --race: var(--race-1); } [data-race="2"] { --race: var(--race-2); } [data-race="3"] { --race: var(--race-3); }
[data-race="4"] { --race: var(--race-4); } [data-race="5"] { --race: var(--race-5); }

/* ---------- Race bibs (list_your.html) ---------- */
.zgm-bibs { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.25rem; }
.zgm-bib {
  position: relative; background: #fff; border: 1px solid var(--zgm-line); border-radius: var(--zgm-radius-lg);
  box-shadow: 0 1px 2px rgba(35, 31, 32, .05); display: flex; flex-direction: column; overflow: hidden;
}
.zgm-bib__top {
  background: var(--race, var(--race-0)); color: #fff; padding: .55rem 2.2rem;
  display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-weight: 600; font-size: .95rem;
}
.zgm-bib[data-race="3"] .zgm-bib__top, .zgm-bib[data-race="4"] .zgm-bib__top, .zgm-bib[data-race="5"] .zgm-bib__top { color: var(--zgm-ink); }
/* safety-pin holes */
.zgm-bib::before, .zgm-bib::after, .zgm-bib__face::before, .zgm-bib__face::after {
  content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--zgm-paper);
  box-shadow: inset 0 0 0 1.5px rgba(35, 31, 32, .25); z-index: 1;
}
.zgm-bib::before { top: 13px; left: 12px; }
.zgm-bib::after { top: 13px; right: 12px; }
.zgm-bib__face { position: relative; text-align: center; padding: 1.1rem 1.25rem .9rem; border-bottom: 1px dashed var(--zgm-line); }
.zgm-bib__face::before { bottom: 12px; left: 12px; }
.zgm-bib__face::after { bottom: 12px; right: 12px; }
.zgm-bib__number { font-family: var(--zgm-display); font-weight: 700; font-size: 4.2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.zgm-bib__number.is-pending { color: #b8c4cc; }
.zgm-bib__numcap { font-size: .8rem; color: var(--zgm-muted); }
.zgm-bib__name { font-family: var(--zgm-display); font-size: 1.55rem; font-weight: 600; margin: .55rem 0 .1rem; overflow-wrap: anywhere; }
.zgm-bib__meta { color: var(--zgm-muted); font-size: .9rem; margin-bottom: .5rem; }
.zgm-bib__body { padding: .9rem 1.25rem; flex: 1; }
.zgm-bib__body dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: 0; font-size: .95rem; }
.zgm-bib__body dt { color: var(--zgm-muted); font-weight: 400; }
.zgm-bib__body dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.zgm-bib__actions { display: flex; gap: .5rem; padding: 0 1.25rem 1.25rem; }
.zgm-bib__actions .btn { flex: 1; }
.zgm-history { list-style: none; padding: 0; margin: 0; }
.zgm-history li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .8rem 0; border-top: 1px solid var(--zgm-line); }
.zgm-history li:first-child { border-top: 0; }
.zgm-history__who { flex: 1 1 14rem; overflow-wrap: anywhere; }
.zgm-history small { color: var(--zgm-muted); display: block; font-size: .875rem; }

/* ---------- Payment (pay.html) ---------- */
.zgm-receipt { font-variant-numeric: tabular-nums; }
.zgm-receipt__who { font-family: var(--zgm-display); font-size: 1.6rem; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.zgm-receipt table { width: 100%; margin-top: .75rem; }
.zgm-receipt th, .zgm-receipt td { padding: .55rem 0; border-top: 1px solid var(--zgm-line); vertical-align: top; font-weight: 400; }
.zgm-receipt td { text-align: right; white-space: nowrap; padding-left: 1rem; }
.zgm-receipt tr.is-total th, .zgm-receipt tr.is-total td { border-top: 2px solid var(--zgm-ink); font-weight: 700; font-size: 1.2rem; padding-top: .75rem; }
.zgm-paycard { border: 2px solid var(--zgm-ink); border-radius: var(--zgm-radius-lg); padding: 1.25rem; }
.zgm-paycard__logos { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .9rem; }
.zgm-paycard__logos img { height: 22px; width: auto; }
#show-bank-payment { margin-top: 1rem; }
.zgm-bank { border: 1px solid var(--zgm-line); border-radius: var(--zgm-radius-lg); margin-top: 1rem; padding: 1.25rem; }
.zgm-bank h4 { font-size: 1.25rem; }
.zgm-kv { display: grid; grid-template-columns: 10rem 1fr auto; gap: .2rem .75rem; align-items: center; margin: 0; }
.zgm-kv dt { color: var(--zgm-muted); font-weight: 400; padding: .4rem 0; }
.zgm-kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.zgm-copy { border: 1px solid var(--zgm-line); background: #fff; border-radius: var(--zgm-radius); font-size: .8rem; padding: .2rem .55rem; color: var(--zgm-muted); }
.zgm-copy:hover { color: var(--zgm-ink); border-color: var(--zgm-muted); }
.zgm-copy.is-done { color: var(--zgm-success); border-color: var(--zgm-lime); }
.zgm-barcode { margin-top: 1rem; max-width: 100%; }
.zgm-fees { font-variant-numeric: tabular-nums; }
.zgm-fees td, .zgm-fees th { padding: .55rem .6rem; border-top: 1px solid var(--zgm-line); }
.zgm-fees td.text-right { white-space: nowrap; }
.zgm-fees thead th { border-top: 0; border-bottom: 2px solid var(--zgm-line); font-weight: 600; font-size: .9rem; }

/* ---------- Data tables (all lists) ---------- */
table.zgm-table { border: 0; font-size: .95rem; }
table.zgm-table.table-striped tbody tr:nth-of-type(odd) { background: transparent; }
table.zgm-table thead th { border: 0; border-bottom: 2px solid var(--zgm-ink); font-weight: 600; font-size: .85rem; padding: .6rem .75rem; white-space: nowrap; vertical-align: bottom; }
table.zgm-table.table-bordered thead tr:nth-child(2) { background: #fff; color: var(--zgm-ink); }
table.zgm-table thead tr:first-child th { border-bottom: 1px solid var(--zgm-line); background: var(--zgm-paper); padding: .4rem .3rem; }
table.zgm-table tbody td { border: 0; border-top: 1px solid var(--zgm-line); padding: .55rem .75rem; vertical-align: middle; }
table.zgm-table tbody tr:hover td { background: #f7fafc; }
table.zgm-table input.datatables-filter {
  width: 100%; min-width: 3.5rem; font-size: .8rem; font-weight: 400; padding: .25rem .45rem;
  border: 1px solid var(--zgm-field); border-radius: 4px; background: #fff;
}
table.zgm-table--dense { font-size: .875rem; }
table.zgm-table--dense tbody td { padding: .35rem .6rem; }
.zgm-race-cell { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.zgm-num { font-variant-numeric: tabular-nums; }
td.zgm-actions { white-space: nowrap; text-align: right; }
.zgm-sep { display: inline-block; width: 1px; height: 1.2rem; background: var(--zgm-line); vertical-align: middle; margin: 0 .25rem; }
.zgm-count { color: var(--zgm-muted); margin: .25rem 0 0; }
.dataTables_wrapper .dataTables_filter input { border-color: var(--zgm-field); border-radius: var(--zgm-radius); min-height: 2.4rem; min-width: 14rem; }
.dataTables_wrapper .dataTables_length select { border-radius: var(--zgm-radius); border-color: var(--zgm-field); min-width: 4.5rem; }
.dataTables_wrapper .dataTables_info { color: var(--zgm-muted); }
.page-link { color: var(--zgm-action); border-color: var(--zgm-line); }
.page-item.active .page-link { background: var(--zgm-ink); border-color: var(--zgm-ink); }
div.dataTables_wrapper div.dataTables_processing { border: 1px solid var(--zgm-line); box-shadow: 0 6px 20px rgba(35, 31, 32, .1); border-radius: var(--zgm-radius); }

/* ---------- Footer ---------- */
footer.zgm-footer { border-top: 1px solid var(--zgm-line); padding-top: 2rem !important; font-size: .92rem; color: #3e474e; } /* beats Bootstrap's .pt-3 */
footer.zgm-footer b { font-family: var(--zgm-display); font-size: 1.1rem; font-weight: 600; color: var(--zgm-ink); }

/* ---------- Flash messages and info box: fluid, correctly centred ---------- */
.message_wrapper { width: calc(100% - 2rem); max-width: 500px; margin-left: 0; transform: translateX(-50%); top: 76px; z-index: 1040; }
ul.flashes { padding: 0; }
ul.flashes li { width: auto; }
.info-box { width: calc(100% - 2rem); max-width: 400px; margin-left: 0; transform: translateX(-50%); background-color: var(--zgm-success); }
.info-box.error { background-color: var(--zgm-danger); }

/* ---------- Embedded lists (base_iframe.html) ---------- */
body.zgm-embed { background: #fff; }
/* embed pages put .row directly in <body> (no .container): drop the negative gutters that caused sideways scrolling */
body.zgm-embed > .row { margin-left: 0; margin-right: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
  .zgm-race-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 991.98px) {
  .zgm-summary { position: static; margin-top: 1.5rem; }
  .zgm-lang { margin: .5rem .75rem; }
}
@media (max-width: 767.98px) {
  #main-content { margin-top: 78px; border-radius: 0; border-left: 0; border-right: 0; }
  div.prijave-title h2, .zgm-page-head h2 { font-size: 1.9rem; }
  #main-content .form-control:not(.form-control-sm) { font-size: 16px; min-height: 48px; } /* no iOS zoom on focus */
  .zgm-panel { padding: 1.1rem; }
  .zgm-hero { margin-top: 60px; padding: 1.75rem 0; }
  .zgm-hero h1 { font-size: 2.5rem; }
  .zgm-race-grid { grid-template-columns: 1fr; gap: .5rem; }
  .zgm-race__card {
    display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 .75rem;
    border-top-width: 1px; border-left: 5px solid var(--race, var(--race-0)); padding: .65rem .9rem;
  }
  .zgm-race__name { grid-column: 1; grid-row: 1; }
  .zgm-race__dist { grid-column: 1; grid-row: 2; font-size: 1.35rem; }
  .zgm-race__price { grid-column: 2; grid-row: 1; margin: 0; text-align: right; }
  .zgm-race__spots { grid-column: 2; grid-row: 2; padding: 0; text-align: right; font-size: .8rem; }
  .zgm-race .zgm-meter { display: none; }
  .zgm-race input:checked + .zgm-race__card { border-left-color: var(--race, var(--race-0)); }
  .zgm-kv { grid-template-columns: 1fr auto; }
  .zgm-kv dt { grid-column: 1 / -1; padding-bottom: 0; }
  .zgm-fees { font-size: .85rem; }
  .zgm-fees td, .zgm-fees th { white-space: nowrap; padding: .5rem .45rem; }
  table.zgm-table { font-size: .875rem; }
  /* public list: rows collapse to "Surname, Name / club / race + status" */
  table.zgm-table--stack thead { display: none; }
  table.zgm-table--stack, table.zgm-table--stack tbody, table.zgm-table--stack td { display: block; width: 100%; }
  table.zgm-table--stack tbody tr {
    display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; padding: .7rem .25rem; border-top: 1px solid var(--zgm-line);
  }
  table.zgm-table--stack tbody td { border: 0; padding: 0; }
  table.zgm-table--stack td.c-last { grid-column: 1; font-weight: 600; font-size: 1.05rem; }
  table.zgm-table--stack td.c-first { display: none; }
  table.zgm-table--stack td.c-status { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  table.zgm-table--stack td.c-club { grid-column: 1; color: var(--zgm-muted); font-size: .9rem; }
  table.zgm-table--stack td.c-club:empty { display: none; }
  table.zgm-table--stack td.c-race { grid-column: 1; font-size: .9rem; }
  table.zgm-table--stack td.dataTables_empty { grid-column: 1 / -1; }
  .dataTables_wrapper .dataTables_filter input { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
