/* Forsolution Hírlevél – adminfelület */
:root {
    --bg: #f4f6fa;
    --card: #ffffff;
    --ink: #1c2433;
    --muted: #667085;
    --line: #e3e7ee;
    --primary: #1f4fd1;
    --primary-ink: #ffffff;
    --primary-soft: #e8eefc;
    --ok: #157a4a;
    --ok-soft: #e4f5ec;
    --warn: #9a5b00;
    --warn-soft: #fff4dc;
    --err: #b42318;
    --err-soft: #fdecea;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--primary); }
h1 { font-size: 24px; line-height: 1.25; margin: 0; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
code { background: #eef1f6; padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* Felső sáv */
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 24px; min-height: 60px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M7 10h18v12H7z' fill='none' stroke='white' stroke-width='2'/%3E%3Cpath d='M7 10l9 7 9-7' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E") center/100% no-repeat; flex: none; }
.client { color: var(--muted); font-size: 13px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a, .nav .linklike { padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; }
.nav a:hover, .nav .linklike:hover { background: var(--bg); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; font-size: 18px; padding: 4px 10px; cursor: pointer; }
form.inline { display: inline; margin: 0; }

.main { max-width: 1100px; margin: 0 auto; padding: 28px 24px 40px; }
.main.wide { max-width: 1440px; }
.appfoot { text-align: center; color: var(--muted); font-size: 12px; padding: 0 0 24px; }

/* Belépés / telepítő */
.bare-main { max-width: 440px; margin: 0 auto; padding: 64px 16px; }
.bare-main.wide { max-width: 640px; }
.bare-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 18px; margin-bottom: 20px; }
.login-card h1 { margin-bottom: 16px; }

/* Kártyák, elrendezés */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 20px; }
.card.narrow { max-width: 520px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.subcard { border: 1px dashed var(--line); border-radius: 10px; padding: 14px 16px; margin-top: 16px; background: #fafbfd; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head form { margin: 0; }
.page-head .badge { margin-top: 6px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > input, .row > label { flex: 1 1 180px; }
.row > .grow { flex: 2 1 260px; }
.row .btn { flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid2.tight { gap: 0 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.notice { background: var(--warn-soft); border-color: #f3dca6; border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.card.notice { padding: 14px 18px; }

/* Űrlapok */
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
label .muted { font-weight: normal; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea {
    display: block; width: 100%; margin-top: 6px; padding: 9px 11px; font: inherit; font-weight: normal; color: var(--ink);
    background: #fff; border: 1px solid #cfd5df; border-radius: 8px; transition: border-color .15s, box-shadow .15s;
}
.row > input, .row select, .filters input, .filters select { margin-top: 0; }
input:focus, select:focus, textarea:focus, .visual:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 79, 209, .15); }
input:disabled { background: #f3f4f6; color: var(--muted); }
input[type=color] { display: block; margin-top: 6px; width: 100%; height: 42px; padding: 3px; border: 1px solid #cfd5df; border-radius: 8px; background: #fff; cursor: pointer; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: normal; }
label.check input { width: 18px; height: 18px; margin: 0; }
textarea { resize: vertical; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid #cfd5df; border-radius: 8px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #f6f7f9; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: #1a43b3; }
.btn-block { width: 100%; }
.btn-danger-ghost { color: var(--err); border-color: #f0c2bd; }
.btn-danger-ghost:hover { background: var(--err-soft); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; }
.linklike.danger { color: var(--err); }
.linklike:hover { text-decoration: underline; }

.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid transparent; }
.flash-ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe5cf; }
.flash-error { background: var(--err-soft); color: var(--err); border-color: #f4c7c2; }
.flash-info { background: var(--primary-soft); color: var(--primary); }

/* Statisztikák */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stats-inline { margin: 16px 0; }
.stat { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.stats-inline .stat { box-shadow: none; background: #fafbfd; }
a.stat:hover { border-color: var(--primary); }
.stat-num { font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 13px; }

/* Táblázatok */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline; margin-left: 10px; }
.preview-table td { font-size: 13px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters input[type=search] { flex: 1 1 240px; width: auto; }
.filters select { width: auto; }
.pager { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 16px; }
.pager a, .pager span { padding: 5px 10px; border-radius: 6px; text-decoration: none; font-size: 14px; }
.pager a.active { background: var(--primary); color: #fff; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef1f6; color: var(--muted); white-space: nowrap; }
.badge-sending { background: var(--primary-soft); color: var(--primary); }
.badge-paused { background: var(--warn-soft); color: var(--warn); }
.badge-sent, .badge-active { background: var(--ok-soft); color: var(--ok); }
.badge-unsubscribed { background: #f1f2f4; color: #555; }
.badge-bounced { background: var(--err-soft); color: var(--err); }

/* Folyamatjelző */
.progress { height: 12px; background: #eef1f6; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 999px; transition: width .6s ease; }
.sender-msg { color: var(--muted); min-height: 1.5em; }
.sender-msg.err { color: var(--err); }
.sender-msg.ok { color: var(--ok); }

/* Szerkesztő */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 20px; align-items: start; }
.editor-side { position: sticky; top: 80px; }
.toolbar { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 6px; background: #f6f7fa; border: 1px solid #cfd5df; border-bottom: 0; border-radius: 8px 8px 0 0; }
.tool-group { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
.toolbar button, .seg button { background: none; border: 1px solid transparent; border-radius: 6px; padding: 5px 9px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.toolbar button:hover { background: #fff; border-color: var(--line); }
.toolbar button.active, .seg button.active { background: #fff; border-color: #cfd5df; font-weight: 600; }
.toolbar select { width: auto; margin: 0; padding: 4px 8px; font-size: 13px; }
.visual, .html-src { min-height: 460px; border: 1px solid #cfd5df; border-radius: 0 0 8px 8px; background: #fff; }
.visual { padding: 20px 24px; font: 16px/1.6 Arial, Helvetica, sans-serif; color: #222; overflow-wrap: anywhere; }
.visual img { max-width: 100%; height: auto; }
.visual img.selected { outline: 3px solid var(--primary); }
.visual h1 { font-size: 26px; } .visual h2 { font-size: 21px; }
.html-src { display: block; width: 100%; margin: 0; padding: 14px; font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.seg { display: inline-flex; background: #f1f3f7; padding: 3px; border-radius: 8px; }
.preview-wrap { background: #eef1f6; border-radius: 10px; padding: 10px; display: flex; justify-content: center; }
.preview { width: 100%; height: 640px; border: 0; background: #fff; border-radius: 6px; transition: width .2s; }
.preview.mobile { width: 375px; max-width: 100%; }
.save-state { font-size: 13px; }
.danger-zone { display: flex; justify-content: flex-end; background: transparent; box-shadow: none; border-style: dashed; }
.danger-zone form { margin: 0; }

/* Beállítások */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.logo-row { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.logo-preview { width: 280px; height: 96px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 14px; }
.logo-preview img { max-width: 100%; max-height: 64px; }
.logo-preview span { color: rgba(255, 255, 255, .8); font-size: 13px; }
.log { background: #111827; color: #e5e7eb; padding: 10px 12px; border-radius: 8px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; max-height: 300px; }
.dropzone { position: relative; border: 2px dashed #cfd5df; border-radius: 12px; padding: 28px; text-align: center; margin: 14px 0; background: #fafbfd; transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone input { display: block; margin: 0 auto 8px; }
details summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
.result-ok { color: var(--ok); }
.result-err { color: var(--err); }

@media (max-width: 980px) {
    .editor-grid { grid-template-columns: 1fr; }
    .editor-side { position: static; }
}
@media (max-width: 760px) {
    .topbar { padding: 10px 16px; }
    .nav-toggle { display: block; }
    .client { display: none; }
    .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; margin: 0; padding-bottom: 8px; }
    .nav.open { display: flex; }
    .nav-sep { display: none; }
    .main { padding: 20px 16px 32px; }
    .grid2, .grid3 { grid-template-columns: 1fr; }
    .card { padding: 16px; }
    .row-actions { text-align: left; }
}
.checklist { list-style: none; padding: 0; margin: 0 0 18px; font-size: 14px; }
.checklist li { padding: 2px 0; }
.logo-ask { display: flex; gap: 20px; align-items: center; border-color: #f3dca6; background: #fffdf6; flex-wrap: wrap; }
.logo-ask h2 { margin-bottom: 4px; }
.logo-ask-preview { width: 200px; height: 80px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.logo-ask-preview span { color: #fff; font-weight: 700; font-size: 18px; opacity: .85; }
.logo-ask-body { flex: 1 1 300px; }
.logo-ask .row input[type=file] { flex: 1 1 200px; }
.install-logo { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.install-logo .logo-preview { width: 220px; height: 80px; }
.inline-details { display: inline-block; vertical-align: top; margin-left: 10px; text-align: left; }
.inline-details summary { list-style: none; display: inline; font-weight: normal; margin: 0; }
.inline-details summary::-webkit-details-marker { display: none; }
.mini-form { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.mini-form input { width: auto; margin: 0; padding: 6px 9px; }
.mini-form .btn { padding: 6px 12px; }
select.compact { width: auto; margin: 0; padding: 5px 8px; font-size: 14px; }
