:root {
  --ebr-primary: #195f3b;
  --ebr-primary-2: #2f8f5b;
  --ebr-primary-3: #0f3d29;
  --ebr-primary-soft: #eaf7ef;
  --ebr-blue: #245b7a;
  --ebr-gold: #b7791f;

  --bg: #f5f7f5;
  --bg2: #eef3f0;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #62717f;
  --brand: var(--ebr-primary);
  --border: #d8e2dc;

  --danger: #be123c;
  --danger2: #e11d48;
  --warn: #b7791f;
  --ok: #15803d;
  --info: #1d4ed8;

  --ebr-warning-bg: #fff7ed;
  --ebr-warning-border: #fdba74;
  --ebr-warning-text: #7c2d12;
  --ebr-danger-bg: #fff1f2;
  --ebr-danger-text: #9f1239;

  --shadow: 0 20px 50px rgba(15, 23, 42, 0.09);
  --shadow-soft: 0 10px 26px rgba(15, 23, 42, 0.06);

  --radius-lg: 28px;
  --radius-md: 22px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(47, 143, 91, 0.13), transparent 34rem),
    radial-gradient(circle at top right, rgba(36, 91, 122, 0.10), transparent 30rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 42%, var(--bg2) 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.58;
}

body::before {
  content: "";
  display: block;
  height: 7px;
  background: linear-gradient(90deg, var(--ebr-primary-3), var(--ebr-primary-2), var(--ebr-blue));
}

a {
  color: var(--ebr-primary);
  text-decoration: none;
}

a:hover {
  color: var(--ebr-primary-3);
  text-decoration: underline;
}

/* ===== Felső sáv / admin header ===== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  color: var(--text);
  border-bottom: 1px solid rgba(216, 226, 220, 0.92);
  padding: 0;
  display: block;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.035);
}

.topbar-inner,
.topbar {
  min-height: 68px;
}

.topbar {
  padding-left: max(18px, calc((100vw - 1160px) / 2 + 18px));
  padding-right: max(18px, calc((100vw - 1160px) / 2 + 18px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar a {
  color: var(--ebr-primary);
  font-weight: 750;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.brand a {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand a::before {
  content: "R";
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--ebr-primary), var(--ebr-primary-2));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  box-shadow: 0 10px 20px rgba(27, 95, 59, 0.2);
}

/* ===== Oldal konténer ===== */

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px 18px 56px;
}

/* ===== Navigáció ===== */

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 24px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(216, 226, 220, 0.92);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(216, 226, 220, 0.95);
  color: #344054;
  text-decoration: none;
  font-weight: 750;
  font-size: 0.92rem;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.nav a:hover {
  transform: translateY(-1px);
  background: var(--ebr-primary-soft);
  color: var(--ebr-primary-3);
  border-color: rgba(47, 143, 91, 0.38);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
  text-decoration: none;
}

/* ===== Kártyák, dashboard, panelek ===== */

.card,
.stat,
.login {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(216, 226, 220, 0.95);
  border-radius: 24px;
  padding: 22px;
  margin: 16px 0;
  box-shadow: var(--shadow-soft);
}

.card h1,
.card h2,
.card h3,
.stat h1,
.stat h2,
.stat h3 {
  margin-top: 0;
  color: #173b2a;
  letter-spacing: -0.015em;
}

.card > h1:first-child,
.wrap > h1:first-child {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(234,247,239,0.96)),
    radial-gradient(circle at right top, rgba(47,143,91,0.18), transparent 28rem);
  border: 1px solid rgba(216, 226, 220, 0.94);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  margin: 0 0 20px;
  box-shadow: var(--shadow);
  color: #13261d;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.12;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.stat {
  min-height: 128px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(47, 143, 91, 0.36);
}

.stat b {
  font-size: 2rem;
  display: block;
  color: var(--ebr-primary-3);
  letter-spacing: -0.04em;
}

.muted {
  color: var(--muted);
}

/* ===== Gombok ===== */

.btn,
button,
input[type=submit] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 17px;
  background: linear-gradient(135deg, var(--ebr-primary), var(--ebr-primary-2));
  color: #fff;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(27, 95, 59, 0.22);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.btn:hover,
button:hover,
input[type=submit]:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(27, 95, 59, 0.27);
  color: #fff;
  text-decoration: none;
}

.btn.secondary,
button.secondary,
input[type=submit].secondary {
  background: #ffffff;
  color: var(--ebr-primary);
  border-color: var(--border);
  box-shadow: none;
}

.btn.secondary:hover {
  background: var(--ebr-primary-soft);
  border-color: rgba(47, 143, 91, 0.38);
  color: var(--ebr-primary-3);
}

.btn.danger,
button.danger,
input[type=submit].danger {
  background: linear-gradient(135deg, var(--danger), var(--danger2));
  box-shadow: 0 8px 18px rgba(190, 18, 60, 0.22);
}

/* ===== Űrlapok ===== */

input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(47, 143, 91, 0.58);
  box-shadow: 0 0 0 4px rgba(47, 143, 91, 0.12);
}

textarea {
  min-height: 112px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 13px;
}

.field {
  margin: 10px 0;
}

.field label {
  display: block;
  font-weight: 800;
  margin-bottom: 6px;
  color: #243b2f;
}

/* ===== Táblák ===== */

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.035);
}

.table th,
.table td {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table th {
  background: #eef7f1;
  color: var(--ebr-primary);
  font-weight: 850;
}

.table tr:hover td {
  background: #fbfdfc;
}

/* ===== Jelvények, figyelmeztetések ===== */

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 850;
  background: #e8eef5;
  color: #172033;
}

.badge.surgos,
.badge.warn {
  background: #fff7ed;
  color: #9a3412;
}

.badge.azonnali,
.badge.danger {
  background: #ffe4e6;
  color: #9f1239;
}

.badge.ok {
  background: #dcfce7;
  color: #166534;
}

.alert {
  position: relative;
  padding: 14px 16px 14px 48px;
  border-radius: 18px;
  margin: 14px 0;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}

.alert::before {
  content: "i";
  position: absolute;
  left: 16px;
  top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #3b82f6;
  color: #fff;
  font-size: .85rem;
  font-weight: 900;
}

.alert.err {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

.alert.err::before {
  content: "!";
  background: #e11d48;
}

.alert.ok {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.alert.ok::before {
  content: "✓";
  background: #16a34a;
}

/* ===== Publikus EBR hero ===== */

.public-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(15, 61, 41, 0.98), rgba(47, 143, 91, 0.93)),
    radial-gradient(circle at right top, rgba(255,255,255,0.24), transparent 24rem);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 34px 36px;
  box-shadow: var(--shadow);
  margin: 18px 0 24px;
}

.public-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 3vw, 2.6rem);
  line-height: 1.12;
}

.public-hero p {
  max-width: 780px;
  color: rgba(255,255,255,0.88);
}

.public-hero a {
  color: #fff;
  text-decoration: underline;
  font-weight: 800;
}

/* ===== Login ===== */

.login {
  max-width: 430px;
  margin: 68px auto;
}

.login h1,
.login h2 {
  text-align: center;
}

.login::before {
  content: "EBR";
  display: flex;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--ebr-primary), var(--ebr-primary-2));
  color: #fff;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  box-shadow: 0 14px 28px rgba(27, 95, 59, 0.24);
}

.small {
  font-size: 12px;
}

.right {
  text-align: right;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ===== Apró kompatibilitási finomítások ===== */

pre,
code {
  border-radius: 12px;
  background: #f8faf9;
  border: 1px solid var(--border);
}

pre {
  padding: 14px;
  overflow-x: auto;
}

img,
video {
  max-width: 100%;
  border-radius: 14px;
}

/* ===== Mobil ===== */

@media (max-width: 980px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .wrap {
    padding: 20px 12px 40px;
  }

  .nav {
    border-radius: 20px;
    padding: 10px;
  }

  .nav a {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .card,
  .stat,
  .public-hero,
  .login {
    border-radius: 20px;
    padding: 18px;
  }

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .btn,
  button,
  input[type=submit] {
    width: 100%;
  }

  .right {
    text-align: left;
  }
}
