:root {
  --bg: #fbfbfa;
  --panel: #ffffff;
  --ink: #22201d;
  --muted: #77726c;
  --line: #e5e2dd;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --danger: #a4392f;
  --ok-bg: #eef4f1;
  --warn-bg: #fdf4e7;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1917;
    --panel: #232220;
    --ink: #eceae6;
    --muted: #9b958d;
    --line: #35332f;
    --accent: #6ea391;
    --accent-ink: #14211d;
    --danger: #d98a80;
    --ok-bg: #24302b;
    --warn-bg: #322a1e;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 6px 0 0; }

h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 2px; letter-spacing: -0.01em; }

/* Belépés */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 340px;
}
.login-box label { display: block; margin: 18px 0 6px; font-size: 13px; color: var(--muted); }
.login-box button { width: 100%; margin-top: 14px; }

/* Fejléc */
header { border-bottom: 1px solid var(--line); background: var(--panel); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { font-weight: 600; }
nav { display: flex; gap: 4px; margin-left: auto; }

.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 6px 10px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  border-radius: 0;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }

main { padding: 28px 20px 60px; }

/* Elrendezés */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.col { min-width: 0; }

.row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* Űrlapelemek */
textarea, input[type="text"], input[type="password"], select {
  width: 100%;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
  margin-top: 8px;
}
textarea { resize: vertical; line-height: 1.6; }
textarea:focus, input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
}
select, input[type="text"] { width: auto; flex: 1; min-width: 140px; margin-top: 0; }
input[type="file"] { font: inherit; font-size: 13px; color: var(--muted); flex: 1; }

button {
  font: inherit;
  font-size: 14px;
  border-radius: var(--radius);
  padding: 9px 16px;
  cursor: pointer;
  border: 1px solid transparent;
}
button:disabled { opacity: 0.5; cursor: default; }

.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover:not(:disabled) { filter: brightness(1.08); }
.secondary { background: var(--panel); color: var(--ink); border-color: var(--line); margin-top: 10px; }
.link { background: none; border: 0; color: var(--muted); padding: 6px 4px; text-decoration: underline; }
.link:hover { color: var(--ink); }

/* Eredmény */
.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  margin-top: 8px;
  font-size: 14px;
}

.verdict {
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 8px;
  font-size: 14px;
  background: var(--ok-bg);
}
.verdict.warn { background: var(--warn-bg); border-left-color: #c98a2e; }
.verdict.good { border-left-color: var(--accent); }
.verdict strong { display: block; margin-bottom: 2px; }

.draft-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 16px; }

.disclaimer {
  margin: 32px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--muted);
  background: var(--panel);
}

/* Panel + táblázat */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 16px 0 24px;
}
.panel details { margin-top: 12px; }
.panel summary { cursor: pointer; }

.table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--panel); }
.table td:last-child, .table th:last-child { text-align: right; }

.pill {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill.on { background: var(--ok-bg); color: var(--ink); border-color: transparent; }

/* Számláló a fülön: hány levél vár feldolgozásra */
.badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  line-height: 17px;
  text-align: center;
}

/* Táblázatok ne tolják szét a lapot kis kijelzőn */
@media (max-width: 700px) {
  .table { display: block; overflow-x: auto; }
  .header-inner { gap: 12px; }
  nav { gap: 0; }
}
