:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f1b2d;
  --ink-soft: #475569;
  --line: #dde4ec;

  /* WEBHOSTING márkaszínek */
  --brand-green: #6fae3e;
  --brand-purple: #6e4e8e;

  --primary: #6e4e8e;        /* márkalila – gombok, linkek, fókusz */
  --primary-dark: #573e72;
  --accent: #6fae3e;         /* márkazöld – kiemelések */

  /* Eszkalációs állapot-színek (a folyamat fokozatai) */
  --ok: #16a34a;
  --r1: #2563eb;
  --r2: #d97706;
  --r3: #ea580c;
  --r4: #dc2626;
  --susp: #7f1d1d;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(15,27,45,.06), 0 4px 16px rgba(15,27,45,.06);
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--sans); background: var(--bg); color: var(--ink);
  line-height: 1.5; font-size: 15px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Fejléc ---- */
.topbar {
  background: #fff; color: var(--ink); display: flex; align-items: center;
  justify-content: space-between; padding: 0 22px; height: 60px;
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--line); box-shadow: 0 1px 2px rgba(15,27,45,.04);
}
.topbar .brand { display: flex; align-items: center; gap: 14px; font-weight: 600; color: var(--ink); }
.topbar .brand:hover { text-decoration: none; }
.topbar .brand .logo { height: 30px; width: auto; display: block; }
.topbar .brand .app-name {
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  padding-left: 14px; border-left: 1px solid var(--line);
}
.topbar nav { display: flex; align-items: center; gap: 4px; }
.topbar nav a {
  color: var(--ink-soft); padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.topbar nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.topbar nav a.active { background: rgba(110,78,142,.10); color: var(--primary); }
.topbar form { margin: 0; }
.btn-logout {
  background: transparent; border: 1px solid var(--line); color: var(--ink-soft);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.btn-logout:hover { background: var(--surface-2); color: var(--ink); }

/* ---- Tartalom ---- */
.wrap { max-width: 1180px; margin: 24px auto; padding: 0 20px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 28px 0 12px; }
.subtitle { color: var(--ink-soft); margin: 0 0 20px; font-size: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px;
}

/* ---- Eszkalációs csővezeték (signature elem) ---- */
.pipeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.stage {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  background: var(--surface-2); position: relative; overflow: hidden;
}
.stage::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background: var(--line); }
.stage .num { font-size: 28px; font-weight: 700; line-height: 1; }
.stage .lbl { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.stage.s-ok::before   { background: var(--ok); }
.stage.s-r1::before   { background: var(--r1); }
.stage.s-r2::before   { background: var(--r2); }
.stage.s-r3::before   { background: var(--r3); }
.stage.s-r4::before   { background: var(--r4); }
.stage.s-susp::before { background: var(--susp); }

/* ---- Kiemelt számok ---- */
.kpis { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.kpi { flex: 1; min-width: 150px; }
.kpi .v { font-size: 24px; font-weight: 700; }
.kpi .sub { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.kpi .k { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
.amount-sub { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.phone { font-size: 12px; color: var(--ink-soft); }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--primary); }
th.sortable .sort-ind { color: var(--primary); font-size: 11px; }

/* Kattintható sorok */
.row-click { cursor: pointer; transition: background .12s; }
.row-click:hover { background: var(--surface-2); }
.row-click .client-name { color: var(--primary); font-weight: 600; }
.row-click:hover .client-name { text-decoration: underline; }

/* Nettó/Bruttó kapcsoló */
.amount-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #c8d2dd; border-radius: 24px; transition: .2s; }
.switch .slider:before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(18px); }
.amount-toggle .t-net { color: var(--ink); font-weight: 600; }
.amount-toggle .t-gross { color: var(--ink-soft); font-weight: 600; }
body.show-gross .amount-toggle .t-net { color: var(--ink-soft); }
body.show-gross .amount-toggle .t-gross { color: var(--ink); }

/* Az összegek nettó/bruttó megjelenítése a kapcsoló szerint */
.amt-gross { display: none; }
body.show-gross .amt-net { display: none; }
body.show-gross .amt-gross { display: inline; }

/* ---- Táblázat ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 13px; }
/* DNS állapot szekció */
.dns-zones { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.dns-zone-block { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.dns-zone-ok   { border-left: 4px solid #22c55e; }
.dns-zone-blocked { border-left: 4px solid #ef4444; }

.dns-zone-hdr { display: flex; align-items: center; gap: 12px; padding: 8px 14px;
                background: var(--surface-2); flex-wrap: wrap; }
.dns-zone-name   { font-weight: 700; font-size: 14px; color: var(--ink); }
.dns-zone-domains { font-size: 12px; color: var(--ink-soft); flex: 1; }
.dns-zone-badge  { margin-left: auto; }

.dns-recs { display: flex; flex-wrap: wrap; gap: 0; padding: 0; }
.dns-rec-group { display: flex; align-items: flex-start; gap: 8px; padding: 8px 14px;
                 border-top: 1px solid var(--border); min-width: 280px; flex: 1; }
.dns-rec-group + .dns-rec-group { border-left: 1px solid var(--border); }
.dns-rec-type-label { font-size: 11px; font-weight: 700; color: var(--ink-soft);
                      background: var(--surface-2); border-radius: 4px;
                      padding: 2px 6px; margin-top: 2px; min-width: 28px; text-align: center; }
.dns-rec-table { border-collapse: collapse; font-size: 13px; flex: 1; }
.dns-rec-table tr:not(:last-child) td { padding-bottom: 3px; }
.dns-rec-name  { color: var(--ink-soft); padding-right: 6px; white-space: nowrap; max-width: 280px;
                 overflow: hidden; text-overflow: ellipsis; }
.dns-rec-arrow { color: var(--ink-soft); padding: 0 4px; font-size: 11px; }
.dns-rec-val   { color: var(--ink); white-space: nowrap; }
.dns-val-blocked { color: #ef4444; font-weight: 600; }
.dns-zone-err  { padding: 8px 14px; color: #ef4444; font-size: 13px; margin: 0; }
.dns-zone-empty { padding: 6px 14px; color: var(--ink-soft); font-size: 13px; margin: 0; }
.dns-nozone-hint { font-size: 12px; color: var(--ink-soft); margin: 8px 0 4px 0; }
.dns-legend { font-size: 11px; color: var(--ink-soft); margin: 4px 0 0 0; }

/* DNS propagáció ellenőrző */
.dns-prop-box { margin-top: 16px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.dns-prop-hdr { display: flex; justify-content: space-between; align-items: center;
                padding: 10px 14px; background: var(--surface-2); font-weight: 600; font-size: 13px; }
.dns-prop-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dns-prop-table th { background: var(--surface-2); padding: 6px 10px; text-align: left;
                     font-weight: 600; color: var(--ink-soft); border-bottom: 1px solid var(--border); white-space: nowrap; }
.dns-prop-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.dns-prop-table tr:last-child td { border-bottom: none; }
.dns-prop-ok   { margin: 10px 14px; color: #16a34a; font-size: 13px; font-weight: 600; }
.dns-prop-warn { margin: 10px 14px; color: #d97706; font-size: 13px; font-weight: 600; }
.dns-prop-err  { margin: 10px 14px; color: #dc2626; font-size: 13px; }
.dns-prop-domain { border: 1px solid var(--border); border-radius: 8px; margin: 10px 0; overflow: hidden; }
.dns-prop-domain-hdr { display: flex; justify-content: space-between; align-items: center;
                       padding: 8px 12px; background: var(--surface-2); }
.dns-prop-status.ok   { color: #16a34a; font-weight: 600; font-size: 13px; }
.dns-prop-status.warn { color: #d97706; font-weight: 600; font-size: 13px; }
.dns-prop-ns-label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.whis-id a { color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.whis-id a:hover { color: var(--primary); text-decoration: underline; }
.whis-link { color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.whis-link:hover { color: var(--primary); text-decoration: underline; }
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap .pw-input { flex: 1; padding-right: 38px; }
.pw-wrap .pw-eye { position: absolute; right: 8px; background: none; border: none;
  cursor: pointer; font-size: 16px; opacity: .4; padding: 0; line-height: 1;
  transition: opacity .15s; }
.pw-wrap .pw-eye:hover { opacity: .8; }

/* Eszkalációs kártya – kattintható */
.stage-clickable { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.stage-clickable:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.12); }

/* Stage modal */
.stage-modal-bg { display:none; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:900; align-items:center; justify-content:center; }
.stage-modal-bg.open { display:flex; }
.stage-modal-box { background:var(--surface); border-radius:12px; width:min(96vw,1100px); max-height:85vh; display:flex; flex-direction:column; box-shadow:0 8px 40px rgba(0,0,0,.25); overflow:hidden; }
.stage-modal-hdr { display:flex; justify-content:space-between; align-items:center; padding:16px 20px; border-bottom:1px solid var(--border); font-weight:700; font-size:16px; }
.stage-modal-close { background:none; border:none; font-size:20px; cursor:pointer; color:var(--ink-soft); line-height:1; padding:0 4px; }
.stage-modal-close:hover { color:var(--ink); }
#stage-modal-body { overflow-y:auto; }
.stage-modal-table { width:100%; border-collapse:collapse; font-size:14px; }
.stage-modal-table thead tr { position:sticky; top:0; background:var(--surface-2); }
.stage-modal-table th { padding:8px 12px; text-align:left; font-weight:600; color:var(--ink-soft); font-size:12px; white-space:nowrap; border-bottom:1px solid var(--border); }
.stage-modal-table td { padding:9px 12px; border-bottom:1px solid var(--border); vertical-align:middle; }
.stage-modal-table tbody tr:hover { background:var(--surface-2); }
.stage-modal-table .bold-name a { font-weight:600; color:var(--primary); text-decoration:none; }
.stage-modal-table .bold-name a:hover { text-decoration:underline; }
.stage-modal-table .num { text-align:right; }

/* ---- Állapot-címke ---- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px;
  font-weight: 600; color: #fff; white-space: nowrap;
}
.badge.s-ok   { background: var(--ok); }
.badge.s-r1   { background: var(--r1); }
.badge.s-r2   { background: var(--r2); }
.badge.s-r3   { background: var(--r3); }
.badge.s-r4   { background: var(--r4); }
.badge.s-susp { background: var(--susp); }
.badge.hold   { background: #64748b; }

/* ---- Gombok ---- */
.btn {
  display: inline-block; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); padding: 9px 16px; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-family: inherit;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.success { background: var(--brand-green); border-color: var(--brand-green); color: #fff; }
.btn.success:hover { filter: brightness(0.93); }
.btn.danger { background: var(--r4); border-color: var(--r4); color: #fff; }
.btn.danger:hover { background: var(--susp); }
.btn.warn { background: var(--r2); border-color: var(--r2); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Űrlap ---- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field .hint { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
input[type=text], input[type=password], input[type=number], input[type=email], textarea, select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
textarea { font-family: var(--mono); font-size: 13px; min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 20px; }
legend { font-weight: 600; padding: 0 8px; color: var(--ink); }

/* ---- Beállítások: kétoszlopos elrendezés + ugró tartalomjegyzék ---- */
.settings-layout { display: grid; grid-template-columns: 232px 1fr; gap: 30px; align-items: start; }
.settings-main { min-width: 0; }   /* megakadályozza a túlcsordulást */

.settings-nav {
  position: sticky; top: 80px; align-self: start;
  max-height: min(340px, calc(100vh - 100px)); overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;                          /* Firefox */
  scrollbar-color: #c2ccd8 transparent;
}
.settings-nav::-webkit-scrollbar { width: 8px; }
.settings-nav::-webkit-scrollbar-track { background: transparent; }
.settings-nav::-webkit-scrollbar-thumb { background: #c8d2dd; border-radius: 4px; }
.settings-nav::-webkit-scrollbar-thumb:hover { background: #aab6c4; }
.settings-nav .nav-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-soft); font-weight: 700; margin: 0 0 10px 14px;
}
.settings-nav ul { list-style: none; margin: 0; padding: 0; }
.settings-nav li { margin: 0; list-style: none; }
.settings-nav a {
  display: block; padding: 7px 14px; font-size: 13.5px; color: var(--ink-soft);
  border-left: 2px solid transparent; line-height: 1.35;
}
.settings-nav a:hover { color: var(--ink); text-decoration: none; }
.settings-nav a.active { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

/* Hogy a sticky fejléc ne takarja el az ugrási célt */
.settings-main fieldset[id],
.settings-main .card[id] { scroll-margin-top: 80px; }

/* Mindig elérhető „Beállítások mentése" sáv az ablak alján */
.sticky-save {
  position: sticky; bottom: 0; z-index: 10;
  background: var(--surface); padding: 14px 0 12px; margin-top: 8px;
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 18px -10px rgba(15,27,45,.18);
}

/* ---- Üzenetek ---- */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; border: 1px solid; }
.flash.info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.flash.error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash.warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.test-result { font-size: 13px; padding: 8px 12px; border-radius: 8px; margin-top: 8px; }
.test-result.ok { background: #ecfdf5; color: #065f46; }
.test-result.fail { background: #fef2f2; color: #991b1b; }

/* ---- Toast (buborék értesítés) ---- */
#toast-root {
  position: fixed; top: 16px; right: 16px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  pointer-events: auto; min-width: 240px; max-width: 360px; cursor: pointer;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-left: 4px solid var(--primary);
  border-radius: 10px; box-shadow: 0 8px 28px rgba(15,27,45,.18);
  padding: 12px 16px; font-size: 14px; line-height: 1.4;
  opacity: 0; transform: translateX(14px); transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.ok      { border-left-color: var(--ok); }
.toast.error   { border-left-color: var(--r4); }
.toast.warning { border-left-color: var(--r2); }
.toast.info    { border-left-color: var(--primary); }
@media (max-width: 560px) {
  #toast-root { left: 12px; right: 12px; }
  .toast { max-width: none; }
}

.dry-banner {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  padding: 10px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px;
}

.logitem { font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; }
.logitem .ts { color: var(--ink-soft); white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.logitem.warning .act { color: var(--r2); font-weight: 600; }
.logitem.error .act { color: var(--r4); font-weight: 600; }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink); padding: 20px; }
.login-card { background: #fff; border-radius: 14px; padding: 36px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.login-card .login-brand img { height: 36px; width: auto; display: block; }
.login-card .login-app { font-weight: 700; font-size: 16px; margin: 16px 0 4px; }
.login-card .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.login-card .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.login-card p.sub { color: var(--ink-soft); font-size: 13px; margin: 0 0 24px; }

/* ---- Felfüggesztési oldal ---- */
.susp-page { background: #0f1b2d; min-height: 100vh; padding: 24px 16px; box-sizing: border-box; }
.susp-card { background: #fff; border-radius: 16px; max-width: 540px; width: 100%; margin: 0 auto;
             padding: 28px 36px 22px; text-align: center; box-shadow: 0 24px 70px rgba(0,0,0,.45); }
.susp-logo { margin-bottom: 16px; }
.susp-logo-img { max-width: 180px; height: auto; }
.susp-divider { height: 1px; background: #e5e7eb; margin: 0 0 18px 0; }
.susp-card h1 { font-size: 20px; margin: 0 0 10px; color: #111; }
.susp-card .msg { color: #6b7280; white-space: pre-line; margin-bottom: 16px; line-height: 1.6; font-size: 14px; }
.susp-contact { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px;
                padding: 12px 16px; text-align: left; display: flex; flex-direction: column;
                gap: 6px; margin-bottom: 16px; }
.susp-contact div { font-size: 13px; color: #374151; }
.susp-contact a { font-weight: 600; color: #2563eb; text-decoration: none; }
.susp-contact a:hover { text-decoration: underline; }
.susp-footer { border-top: 1px solid #e5e7eb; padding-top: 14px; display: flex;
               align-items: center; justify-content: center; gap: 10px;
               color: #9ca3af; font-size: 12px; }
.susp-footer a { display: flex; align-items: center; }
.susp-footer-logo { max-width: 80px; height: auto; opacity: .75; transition: opacity .2s; }
.susp-footer-logo:hover { opacity: 1; }
.susp-lang-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0 12px;
                     color: #d1d5db; font-size: 16px; }
.susp-lang-divider::before, .susp-lang-divider::after {
    content: ""; flex: 1; height: 1px; background: #e5e7eb; }
.susp-title-en { font-size: 18px; margin: 0 0 8px; color: #374151; font-weight: 600; }
.susp-msg-en { color: #6b7280; margin-bottom: 14px; font-size: 14px; }

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; gap: 16px; }
  .settings-nav {
    position: static; top: auto; margin-bottom: 8px;
    max-height: none; overflow: visible; padding-right: 0;
  }
  .settings-nav ul {
    display: flex; flex-wrap: wrap; gap: 4px; border-left: none;
    border: 1px solid var(--line); border-radius: var(--radius); padding: 8px;
    background: var(--surface);
  }
  .settings-nav a { border-left: none; margin-left: 0; border-radius: 6px; padding: 6px 10px; }
  .settings-nav a.active { background: rgba(110,78,142,.10); }
}

@media (max-width: 760px) {
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .topbar .brand .app-name { display: none; }
  .topbar nav a { padding: 8px 10px; }
  table { font-size: 13px; }
  th:nth-child(3), td:nth-child(3) { display: none; }
}
