:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-text: #3730a3;
  --green-bg: #ecfdf3; --green-fg: #067647;
  --amber-bg: #fffaeb; --amber-fg: #b54708;
  --red-bg: #fef3f2;   --red-fg: #b42318;
  --blue-bg: #eff8ff;  --blue-fg: #175cd3;
  --gray-bg: #f2f4f7;  --gray-fg: #344054;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, .18);
  --radius: 12px;
  --radius-sm: 8px;
  --bar-bg: #111827;
  --bar-fg: #ffffff;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --surface: #13161d;
    --surface-2: #181c24;
    --border: #262b36;
    --border-strong: #343a47;
    --text: #f3f4f6;
    --text-2: #d1d5db;
    --muted: #9ca3af;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-soft: #1e1b4b;
    --accent-text: #c7d2fe;
    --green-bg: #0b2a1c; --green-fg: #6ce9a6;
    --amber-bg: #2d1f07; --amber-fg: #fdb022;
    --red-bg: #2f1212;   --red-fg: #fda29b;
    --blue-bg: #0c1f3d;  --blue-fg: #84caff;
    --gray-bg: #1f2430;  --gray-fg: #d0d5dd;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .6);
    --bar-bg: #f3f4f6;
    --bar-fg: #111827;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }

/* ------------------------------------------------------------ fejléc */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1360px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 14px;
}
.logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: grid; place-items: center; color: #fff; flex: none;
  box-shadow: 0 4px 10px rgba(79, 70, 229, .3);
}
.title h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.title p { margin: 1px 0 0; color: var(--muted); font-size: 12.5px; }
.topbar .spacer { flex: 1; }

main { max-width: 1360px; margin: 0 auto; padding: 20px 24px 120px; }

/* ----------------------------------------------------------- gombok */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font-weight: 550; cursor: pointer;
  box-shadow: var(--shadow-sm); white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:focus-visible, .chip:focus-visible, .seg button:focus-visible, .ms-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: var(--gray-bg); color: var(--text); }
.btn[disabled] { opacity: .55; cursor: default; }

/* ------------------------------------------------------- szinkron */
.banner {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  padding: 12px 16px; border-radius: var(--radius); font-size: 13.5px;
  background: var(--blue-bg); color: var(--blue-fg); border: 1px solid transparent;
}
.banner.warn { background: var(--amber-bg); color: var(--amber-fg); }
.banner.err { background: var(--red-bg); color: var(--red-fg); }
.banner b { font-weight: 650; }
.banner .spinner { border-color: currentColor; border-top-color: transparent; opacity: .8; flex: none; }
#sync-btn.busy svg { animation: spin 1s linear infinite; }

/* ----------------------------------------------------------- szűrők */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.filters { padding: 16px 18px; display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.label {
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); margin-right: 4px; min-width: 64px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: 13px; font-weight: 500;
}
.chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); font-weight: 600; }

.daterange {
  display: inline-flex; align-items: center; gap: 6px; height: 34px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 10px; background: var(--surface);
}
.daterange input {
  border: 0; background: transparent; outline: none; width: 128px; font-size: 13px;
}
.daterange span { color: var(--muted); }

.divider { height: 1px; background: var(--border); margin: 0 -18px; }

/* multi-select */
.ms { position: relative; }
.ms-btn {
  height: 36px; padding: 0 10px 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; min-width: 180px; max-width: 280px;
  text-align: left;
}
.ms-btn .k { color: var(--muted); font-size: 13px; }
.ms-btn .v { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ms-btn.active { border-color: var(--accent); background: var(--accent-soft); }
.ms-btn.active .v { color: var(--accent-text); }
.ms-btn svg { flex: none; color: var(--muted); }
.ms-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  width: 320px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
}
.ms-search { padding: 10px; border-bottom: 1px solid var(--border); }
.ms-search input {
  width: 100%; height: 32px; border: 1px solid var(--border-strong); border-radius: 7px;
  padding: 0 10px; background: var(--surface); outline: none;
}
.ms-search input:focus { border-color: var(--accent); }
.ms-list { max-height: 300px; overflow: auto; padding: 6px; }
.ms-opt {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px;
  cursor: pointer; user-select: none;
}
.ms-opt:hover { background: var(--surface-2); }
.ms-opt .t { flex: 1; }
.ms-opt .n { color: var(--muted); font-size: 12px; }
.ms-foot {
  display: flex; justify-content: space-between; padding: 8px 10px;
  border-top: 1px solid var(--border); background: var(--surface-2);
}
.ms-foot .btn { height: 30px; padding: 0 10px; font-size: 13px; }

/* segmented */
.seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px;
  background: var(--gray-bg); border: 1px solid var(--border);
}
.seg button {
  border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 7px;
  cursor: pointer; color: var(--muted); font-weight: 550; font-size: 13px;
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.search {
  position: relative; flex: 1; min-width: 220px;
}
.search input {
  width: 100%; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  padding: 0 12px 0 36px; outline: none;
}
.search input:focus, .daterange:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { position: absolute; left: 11px; top: 10px; color: var(--muted); }

/* --------------------------------------------------------- összegző */
.summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px;
  margin: 18px 2px 10px;
}
.summary .big { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.summary .sub { color: var(--muted); }
.summary .sub b { color: var(--text-2); font-weight: 600; }
.summary .spacer { flex: 1; }
.notice {
  margin: 0 0 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--amber-bg); color: var(--amber-fg); font-size: 13px;
}

/* ---------------------------------------------------------- táblázat */
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2); color: var(--muted);
  font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 11px 12px; border-bottom: 1px solid var(--border);
  vertical-align: middle; color: var(--text-2);
}
tbody tr { cursor: pointer; transition: background .08s; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr.sel td { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td.cb, th.cb { width: 44px; padding-right: 0; }
.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.who b { display: block; font-weight: 550; color: var(--text); }
.who small { color: var(--muted); font-size: 12px; }
.date b { display: block; font-weight: 500; color: var(--text); white-space: nowrap; }
.date small { color: var(--muted); font-size: 12px; }
.amount { font-weight: 600; color: var(--text); white-space: nowrap; }
.dim { color: var(--muted); }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 550; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-green { background: var(--green-bg); color: var(--green-fg); }
.b-amber { background: var(--amber-bg); color: var(--amber-fg); }
.b-red { background: var(--red-bg); color: var(--red-fg); }
.b-blue { background: var(--blue-bg); color: var(--blue-fg); }
.b-gray { background: var(--gray-bg); color: var(--gray-fg); }

.links { display: flex; gap: 6px; justify-content: flex-end; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px;
  border-radius: 7px; border: 1px solid var(--border); background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.storno { color: var(--red-fg); }
.pill.storno:hover { border-color: var(--red-fg); }

/* checkbox */
.ck {
  appearance: none; width: 18px; height: 18px; margin: 0; cursor: pointer;
  border: 1.5px solid var(--border-strong); border-radius: 5px; background: var(--surface);
  display: inline-grid; place-items: center; vertical-align: middle;
  transition: background .1s, border-color .1s;
}
.ck:hover { border-color: var(--accent); }
.ck:checked, .ck:indeterminate { background: var(--accent); border-color: var(--accent); }
.ck:checked::after {
  content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: translateY(-1px) rotate(-45deg);
}
.ck:indeterminate::after { content: ""; width: 8px; height: 2px; background: #fff; border-radius: 1px; }
.ck:disabled { opacity: .35; cursor: not-allowed; }

.more { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--border); }

.empty { padding: 64px 20px; text-align: center; color: var(--muted); }
.empty svg { color: var(--border-strong); margin-bottom: 8px; }
.empty h3 { margin: 0 0 4px; color: var(--text); font-size: 15px; font-weight: 600; }

.skeleton td { cursor: default; }
.sk { height: 12px; border-radius: 6px; background: var(--gray-bg); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* ------------------------------------------------- kijelölés-sáv */
.selbar {
  position: fixed; left: 50%; bottom: 22px; z-index: 50;
  transform: translate(-50%, 140%); opacity: 0;
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), opacity .18s;
  background: var(--bar-bg); color: var(--bar-fg);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 18px;
  width: max-content; max-width: calc(100vw - 32px);
}
.selbar.show { transform: translate(-50%, 0); opacity: 1; }
.selbar .count { font-weight: 650; white-space: nowrap; }
.selbar .meta { opacity: .7; font-size: 13px; white-space: nowrap; }
.selbar .sep { width: 1px; align-self: stretch; background: currentColor; opacity: .18; }
.selbar label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.selbar .btn.ghost { color: inherit; opacity: .75; }
.selbar .btn.ghost:hover { background: rgba(127, 127, 127, .18); opacity: 1; }
.selbar .ck { border-color: rgba(127, 127, 127, .6); background: transparent; }
.selbar .ck:checked { background: var(--accent); border-color: var(--accent); }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* toast */
.toast {
  position: fixed; right: 22px; top: 76px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-left-width: 4px;
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 12px 16px;
  max-width: 380px; transform: translateX(120%); transition: transform .25s;
}
.toast.show { transform: none; }
.toast.ok { border-left-color: var(--green-fg); }
.toast.warn { border-left-color: var(--amber-fg); }
.toast.err { border-left-color: var(--red-fg); }
.toast b { display: block; margin-bottom: 2px; }
.toast span { color: var(--muted); font-size: 13px; }

/* ----------------------------------------------------- belépőoldal */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login {
  width: 100%; max-width: 380px; padding: 32px 28px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-md);
}
.login .logo { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 18px; }
.login h1 { margin: 0 0 4px; font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.login p { margin: 0 0 22px; color: var(--muted); }
.login label { display: block; font-weight: 550; margin-bottom: 6px; font-size: 13px; }
.login input {
  width: 100%; height: 42px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); padding: 0 12px; outline: none; margin-bottom: 14px;
}
.login input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login .btn { width: 100%; height: 42px; }
.login .err { color: var(--red-fg); font-size: 13px; margin: -6px 0 12px; min-height: 18px; }

/* ------------------------------------------------------------ mobil */
@media (max-width: 900px) {
  .hide-md { display: none; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 12px 16px; }
  main { padding: 14px 16px 140px; }
  .filters { padding: 14px; }
  .divider { margin: 0 -14px; }
  .label { min-width: 0; width: 100%; }
  .ms, .ms-btn { width: 100%; max-width: none; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 0 4px; font-size: 12px; white-space: nowrap; }
  tbody td, thead th { padding-left: 8px; padding-right: 8px; }
  .ellipsis { max-width: 130px; }
  .daterange { width: 100%; }
  .daterange input { width: auto; flex: 1; min-width: 0; }
  .hide-sm { display: none; }
  .selbar { gap: 10px; padding: 10px 10px 10px 14px; flex-wrap: wrap; justify-content: space-between; }
  .selbar .sep, .selbar .meta { display: none; }
  .selbar .btn.primary { flex: 1 1 100%; }
  .toast { left: 16px; right: 16px; max-width: none; }
}

/* ------------------------------------------------------------- fülek */
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--gray-bg); border: 1px solid var(--border); margin-left: 18px; }
.tabs button {
  border: 0; background: transparent; height: 30px; padding: 0 14px; border-radius: 7px;
  cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px;
}
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs .cnt {
  min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; background: var(--red-bg); color: var(--red-fg);
}
.tabs .cnt:empty { display: none; }
body:not([data-view="invoices"]) .selbar { display: none; }
body:not([data-view="invoices"]) .inv-only { display: none !important; }

/* ------------------------------------------------------ összesítő kártyák */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; margin: 18px 0 14px; }
.stat {
  text-align: left; cursor: pointer; padding: 13px 14px 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 2px; position: relative; transition: border-color .12s, box-shadow .12s;
}
.stat:hover { border-color: var(--border-strong); }
.stat.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stat[disabled] { cursor: default; }
.stat .n { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; color: var(--text); }
.stat .l { font-weight: 600; color: var(--text-2); font-size: 13px; }
.stat .s { color: var(--muted); font-size: 12px; }
.stat::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.stat.red::before { background: var(--red-fg); }
.stat.amber::before { background: var(--amber-fg); }
.stat.green::before { background: var(--green-fg); }
.stat.blue::before { background: var(--blue-fg); }
.stat.red .n { color: var(--red-fg); }
.stat.zero .n { color: var(--muted); }

.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.tools h2 { margin: 0 auto 0 0; font-size: 15px; font-weight: 650; }
.tools .search { flex: 0 1 320px; min-width: 200px; }
.select {
  height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); padding: 0 10px; outline: none; max-width: 100%;
}
.select:focus { border-color: var(--accent); }
.inline { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.sub { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.note { max-width: 300px; white-space: normal; }

/* ------------------------------------------------------- részletek panel */
dialog.sheet {
  margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: 560px; max-width: 100vw;
  border: 0; padding: 0; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg);
}
dialog.sheet::backdrop { background: rgba(15, 23, 42, .35); backdrop-filter: blur(2px); }
dialog.sheet[open] { animation: slidein .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.sheet-head {
  position: sticky; top: 0; z-index: 2; background: var(--surface);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.sheet-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.sheet-body { padding: 18px 20px 28px; display: grid; gap: 16px; align-content: start; }
.verdict { padding: 12px 14px; border-radius: 10px; font-weight: 600; }
.verdict p { margin: 4px 0 0; font-weight: 400; font-size: 13px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.resolve { border: 1px dashed var(--border-strong); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; }
.resolve input {
  height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); padding: 0 10px; outline: none; width: 100%;
}
.parcel { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.parcel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.parcel .hint { margin: 0; padding: 8px 14px 0; color: var(--muted); font-size: 12.5px; }
.timeline { list-style: none; margin: 0; padding: 8px 14px 12px; }
.timeline li { display: grid; grid-template-columns: 124px 30px 1fr; gap: 8px; padding: 6px 0; font-size: 12.5px; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline li > span:first-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.timeline .code { font-family: "JetBrains Mono", ui-monospace, monospace; color: var(--muted); }
.timeline .place { display: block; color: var(--muted); font-size: 11.5px; }
.timeline li.hit { color: var(--red-fg); }
.timeline li.hit > span:first-child, .timeline li.hit .code { color: var(--red-fg); }

@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; }
  .tabs { order: 5; margin: 0; width: 100%; }
  .tabs button { flex: 1; justify-content: center; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools .search { flex: 1 1 100%; }
  .kv { grid-template-columns: 96px 1fr; }
  .timeline li { grid-template-columns: 96px 28px 1fr; }
}

/* hosszú állapotcímkék a csomagos táblákban */
.badge.wrap { white-space: normal; height: auto; min-height: 24px; padding: 3px 10px; line-height: 1.3; }
.badge.wrap::before { flex: none; }
td b.mono { white-space: nowrap; }
@media (max-width: 1320px) { .hide-lg { display: none; } }

/* fejléc: a cím ne tolja külön sorba a gombokat */
.title { min-width: 0; flex: 0 1 auto; }
.title h1, .title p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .topbar .spacer { display: none; }
  .title { flex: 1 1 0; }
}

/* ------------------------------------------------------- beállítások */
#settings form { display: flex; flex-direction: column; min-height: 100%; }
#settings .sheet-body { flex: 1; }
.form-sec { display: grid; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.form-sec:last-child { border-bottom: 0; }
.form-sec h4 { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: .02em; color: var(--text); }
.field { display: grid; gap: 5px; font-size: 13px; }
.field > span { color: var(--text-2); font-weight: 550; display: flex; gap: 6px; align-items: baseline; }
.field input {
  height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); padding: 0 11px; outline: none; width: 100%; min-width: 0;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input.set::placeholder { color: var(--green-fg); opacity: 1; }
.src { font-style: normal; font-weight: 500; font-size: 11px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { margin: 0; color: var(--muted); font-size: 12px; }
.def-grp { border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; }
.def-grp + .def-grp { margin-top: 8px; }
.def-grp summary { cursor: pointer; padding: 10px 0; font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.def-n { margin-left: auto; font-weight: 500; color: var(--muted); font-size: 12px; }
.def-opts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 12px; max-height: 220px; overflow: auto; }
.def-opt { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; }
.def-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.def-opt input { margin: 0; accent-color: var(--accent); }
.test-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.test-res { font-size: 12.5px; font-weight: 550; }
.test-res.ok { color: var(--green-fg); }
.test-res.bad { color: var(--red-fg); }
.sec-note {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 10px;
  background: var(--green-bg); color: var(--green-fg); font-size: 12.5px;
}
.sec-note.warn { background: var(--amber-bg); color: var(--amber-fg); }
.sec-note svg { flex: none; margin-top: 1px; }
.sheet-foot {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; justify-content: flex-end;
  padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface);
}
.sheet-foot .err { margin-right: auto; color: var(--red-fg); font-size: 12.5px; }
.banner .btn { margin-left: auto; flex: none; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------------------------------------------- szélesség-biztos táblák */
/* a jobb szélső művelet-oszlop (PDF / Megoldva / Elrejtés) mindig látszik */
th.act, td.act {
  position: sticky; right: 0; z-index: 1;
  background: var(--surface);
  box-shadow: inset 1px 0 0 var(--border);
}
thead th.act { z-index: 2; background: var(--surface-2); }
td.pay small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
td.pay .ellipsis, td.pay small { max-width: 240px; }
@media (max-width: 1440px) {
  .ellipsis, td.pay .ellipsis, td.pay small { max-width: 170px; }
  tbody td, thead th { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 1200px) { .hide-xl { display: none; } }
@media (max-width: 1100px) {
  .ellipsis, td.pay .ellipsis, td.pay small { max-width: 130px; }
  tbody td, thead th { padding-left: 8px; padding-right: 8px; }
  .badge.wrap { padding: 3px 8px; }
}
td.mono { white-space: nowrap; }

/* --------------------------------------------------------- fiókmenü */
.acct { position: relative; }
.acct-btn { gap: 8px; padding: 0 8px 0 4px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent-text);
}
.avatar.sm { width: 32px; height: 32px; }
.acct-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: 270px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; display: grid; gap: 2px;
}
.acct-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.acct-head b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.acct-head small { color: var(--muted); font-size: 12px; }
.acct-sec { display: grid; gap: 1px; padding-bottom: 4px; }
.acct-sec + .acct-sec { border-top: 1px solid var(--border); padding-top: 4px; }
.acct-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 10px 2px; }
.mi {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 7px;
  cursor: pointer; color: var(--text-2); font-size: 13.5px; text-decoration: none;
}
.mi:hover { background: var(--surface-2); color: var(--text); }
.mi.tenant.on { color: var(--accent-text); font-weight: 600; }

/* ---------------------------------------------------- felhasználók panel */
.invite-row { display: flex; gap: 8px; flex-wrap: wrap; }
.invite-row input {
  flex: 1 1 200px; min-width: 0; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); padding: 0 11px; outline: none;
}
.invite-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.linkbox { border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; font-size: 13px; }
.linkrow { display: flex; gap: 8px; }
.linkrow input { flex: 1; min-width: 0; height: 32px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface); padding: 0 8px; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; }
.ulist { list-style: none; margin: 0; padding: 0; display: grid; }
.ulist li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ulist li:last-child { border-bottom: 0; }
.u-main { flex: 1 1 160px; min-width: 0; }
.u-main b { display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-main small { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.select.sm { height: 30px; font-size: 12.5px; padding: 0 6px; }
.btn.danger { color: var(--red-fg); }
.btn.danger:hover { background: var(--red-bg); }
.u-main .badge { height: 20px; font-size: 11px; }
dialog.sheet.narrow { width: 420px; }
#pw-form { display: flex; flex-direction: column; min-height: 100%; }
#pw-form .sheet-body { flex: 1; }
.login .forgot { display: block; text-align: center; margin-top: 14px; font-size: 13px; }
.login .ok { color: var(--green-fg); font-size: 13.5px; background: var(--green-bg); padding: 10px 12px; border-radius: 9px; margin-bottom: 12px; }
.login .meta { font-size: 13px; color: var(--muted); margin: -10px 0 18px; }
.login .meta b { color: var(--text-2); }
.admin-tools { padding: 18px; margin-top: 18px; display: grid; gap: 10px; }
.admin-tools h2 { margin: 0; font-size: 15px; font-weight: 650; }
.admin-tools .invite-row { max-width: 560px; }
.banner.warn code, .banner code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; }
#mail-card .invite-row input { flex: 1 1 220px; }
#mail-status .badge { margin-right: 6px; }
/* kijelölés-sáv: második letöltő gomb a sötét sávon */
.selbar .pdf-btn { background: transparent; color: inherit; border-color: rgba(127, 127, 127, .45); box-shadow: none; }
.selbar .pdf-btn:hover { background: rgba(127, 127, 127, .18); }
@media (max-width: 640px) { .selbar .pdf-btn { flex: 1 1 auto; } }
.who .grp { color: var(--accent-text); font-weight: 550; }

/* Szállítási idő */
.tr-hint { margin: 0; padding: 0 16px 14px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.tr-hint b { color: var(--text-2); }
.tr-info { display: inline; font-weight: 500; margin-left: 4px; }
.sub.inline { display: inline; }
.tr-sum th, .tr-sum td { white-space: nowrap; }
.tr-sum tr.grp td { font-weight: 650; background: var(--surface-2); }
.tr-sum td.tr-b span { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.tr-sum td.zero { color: var(--muted); }
.tr-sum td.tr-b.late { color: var(--red-fg); font-weight: 650; }
#t-slow tr { cursor: pointer; }
