/* ==========================================================================
   TVN CRM — app.css
   Mobil-first, design tokenek CSS custom propertykkel. Nincs build lépés.
   ========================================================================== */

:root {
  --c-primary: #1e3a8a;
  --c-primary-hover: #1e40af;
  --c-primary-soft: #dbe4ff;
  --c-accent: #f59e0b;
  --c-accent-soft: #fef3c7;
  --c-success: #16a34a;
  --c-success-soft: #dcfce7;
  --c-danger: #dc2626;
  --c-danger-soft: #fee2e2;
  --c-warning: #d97706;
  --c-warning-soft: #fef3c7;
  --c-info: #0284c7;
  --c-info-soft: #e0f2fe;

  --c-bg: #f3f4f6;
  --c-surface: #ffffff;
  --c-surface-2: #f9fafb;
  --c-border: #e5e7eb;
  --c-border-strong: #d1d5db;
  --c-text: #111827;
  --c-text-2: #4b5563;
  --c-text-3: #6b7280;
  --c-muted: #9ca3af;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;

  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.06), 0 1px 3px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 10px 30px rgba(17, 24, 39, 0.15);

  --topbar-h: 56px;
  --bottomnav-h: 60px;
  --page-max: 1280px;
  --tap: 44px;
}

/* --- Reset / alap --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
}
h1, h2, h3, h4 { margin: 0 0 var(--sp-3); line-height: 1.25; font-weight: 700; }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
p { margin: 0 0 var(--sp-3); }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: var(--sp-2); z-index: 100; }
.skip:focus { left: var(--sp-2); }

.muted { color: var(--c-text-3); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-family: var(--font-mono); }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mb-4 { margin-bottom: var(--sp-4); }
.flex { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.flex--between { justify-content: space-between; }
.flex--end { justify-content: flex-end; }
.grow { flex: 1 1 auto; }
.stack > * + * { margin-top: var(--sp-3); }
.danger { color: var(--c-danger); }
.success { color: var(--c-success); }
.warning { color: var(--c-warning); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide-mobile { display: none !important; }
.show-mobile { display: revert; }

/* --- Fejléc --- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--c-primary); color: #fff;
  box-shadow: var(--shadow);
  padding-top: env(safe-area-inset-top);
}
.topbar__inner {
  max-width: var(--page-max); margin: 0 auto;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 0 var(--sp-4);
}
.brand { display: flex; align-items: center; gap: var(--sp-2); color: #fff; font-weight: 800; font-size: var(--fs-lg); letter-spacing: 0.01em; }
.brand:hover { text-decoration: none; }
.brand__logo { width: 26px; height: 26px; color: var(--c-accent); }
.topnav { display: none; gap: var(--sp-1); flex: 1; }
.topnav a {
  color: rgba(255,255,255,0.85); padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm); font-weight: 500; font-size: var(--fs-sm);
}
.topnav a:hover { background: rgba(255,255,255,0.12); text-decoration: none; color: #fff; }
.topnav a.is-active { background: rgba(255,255,255,0.18); color: #fff; }
.usermenu { margin-left: auto; position: relative; }
.usermenu__btn {
  display: flex; align-items: center; gap: var(--sp-2);
  background: transparent; border: 0; color: #fff; padding: var(--sp-1); border-radius: var(--radius-pill);
  min-height: var(--tap);
}
.usermenu__btn:hover { background: rgba(255,255,255,0.12); }
.usermenu__name { display: none; font-size: var(--fs-sm); font-weight: 500; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--c-accent); color: #1f2937; font-weight: 700; font-size: var(--fs-sm);
  flex-shrink: 0;
}
.avatar--sm { width: 26px; height: 26px; font-size: var(--fs-xs); }
.avatar--muted { background: var(--c-border); color: var(--c-text-2); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--c-surface); color: var(--c-text);
  min-width: 220px; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--c-border); overflow: hidden; z-index: 50;
}
.dropdown__head { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--c-border); display: flex; flex-direction: column; }
.dropdown__head small { color: var(--c-text-3); }
.dropdown a, .dropdown__logout {
  display: block; width: 100%; text-align: left; padding: var(--sp-3) var(--sp-4);
  color: var(--c-text); background: none; border: 0; font-size: var(--fs-sm);
}
.dropdown a:hover, .dropdown__logout:hover { background: var(--c-surface-2); text-decoration: none; }
.dropdown__logout { color: var(--c-danger); border-top: 1px solid var(--c-border); }

/* --- Alsó navigáció (mobil) --- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--c-surface); border-top: 1px solid var(--c-border);
  padding-bottom: env(safe-area-inset-bottom);
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--c-text-3); font-size: 0.7rem; font-weight: 500;
}
.bottomnav a:hover { text-decoration: none; }
.bottomnav svg { width: 24px; height: 24px; fill: currentColor; }
.bottomnav a.is-active { color: var(--c-primary); }

/* --- Oldal --- */
.page { max-width: var(--page-max); margin: 0 auto; padding: var(--sp-4); }
.page__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.page__head h1 { margin: 0; flex: 1 1 auto; }
.page__actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.breadcrumb { font-size: var(--fs-sm); color: var(--c-text-3); margin-bottom: var(--sp-2); }
.breadcrumb a { color: var(--c-text-3); }

/* --- Kártya --- */
.card {
  --card-pad: var(--sp-4);
  background: var(--c-surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: var(--card-pad);
  margin-bottom: var(--sp-4);
}
.card__title { font-size: var(--fs-md); margin-bottom: var(--sp-3); display: flex; align-items: center; gap: var(--sp-2); }
.card__title .badge { margin-left: auto; }
.card--flat { box-shadow: none; border: 1px solid var(--c-border); }
.card--tight { --card-pad: var(--sp-3); }
.grid { display: grid; gap: var(--sp-4); }
.grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }

/* --- Gombok --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap); padding: 0 var(--sp-4);
  border-radius: var(--radius-sm); border: 1px solid var(--c-border-strong);
  background: var(--c-surface); color: var(--c-text);
  font-weight: 600; font-size: var(--fs-sm); white-space: nowrap;
  text-decoration: none; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--c-surface-2); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-hover); }
.btn--accent { background: var(--c-accent); border-color: var(--c-accent); color: #1f2937; }
.btn--danger { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn--danger:hover { background: #b91c1c; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--c-primary); }
.btn--ghost:hover { background: var(--c-primary-soft); }
.btn--sm { min-height: 34px; padding: 0 var(--sp-3); font-size: var(--fs-xs); }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: var(--tap); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }

/* --- Űrlapok --- */
.form { display: flex; flex-direction: column; gap: var(--sp-4); }
.form__row { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
.form__actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; padding-top: var(--sp-2); }
.field { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.field label { font-size: var(--fs-sm); font-weight: 600; color: var(--c-text-2); }
.field input:not([type="checkbox"]):not([type="radio"]),
.field select, .field textarea, .input {
  width: 100%; min-height: var(--tap);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm);
  background: var(--c-surface); font-size: 16px; /* iOS zoom elkerülése */
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: 2px solid var(--c-primary); outline-offset: 0; border-color: var(--c-primary);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--c-danger); }
.field__error { color: var(--c-danger); font-size: var(--fs-xs); margin: 0; }
.field__hint { color: var(--c-text-3); font-size: var(--fs-xs); margin: 0; }
.check { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); min-height: var(--tap); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--c-primary); margin: 0; }
.input-group { display: flex; }
.input-group > * + * { margin-left: -1px; }
.input-group input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.fieldset { border: 1px solid var(--c-border); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4) var(--sp-4); margin: 0; }
.fieldset legend { font-weight: 700; font-size: var(--fs-sm); padding: 0 var(--sp-2); color: var(--c-text-2); }
.suffix { position: relative; }
.suffix::after { content: attr(data-suffix); position: absolute; right: var(--sp-3); top: 50%; transform: translateY(-50%); color: var(--c-text-3); font-size: var(--fs-sm); pointer-events: none; }
.suffix input { padding-right: 3rem; }

/* Szegmentált választó (típus választó gyors jegyzetnél, nézetváltó) */
.segmented { display: inline-flex; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 2px; gap: 2px; flex-wrap: wrap; }
.segmented label, .segmented a { position: relative; }
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented span, .segmented a {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1);
  min-height: 36px; padding: 0 var(--sp-3); border-radius: 4px;
  font-size: var(--fs-sm); font-weight: 500; color: var(--c-text-2); cursor: pointer; white-space: nowrap;
}
.segmented input:checked + span, .segmented a.is-active { background: var(--c-surface); color: var(--c-primary); box-shadow: var(--shadow); font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--c-primary); }
.segmented a:hover { text-decoration: none; }

/* --- Alert / flash --- */
.alert {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm);
  margin-bottom: var(--sp-4); font-size: var(--fs-sm);
  border: 1px solid transparent;
}
.alert span { flex: 1; }
.alert--success { background: var(--c-success-soft); color: #14532d; border-color: #bbf7d0; }
.alert--error, .alert--danger { background: var(--c-danger-soft); color: #7f1d1d; border-color: #fecaca; }
.alert--warning { background: var(--c-warning-soft); color: #78350f; border-color: #fde68a; }
.alert--info { background: var(--c-info-soft); color: #0c4a6e; border-color: #bae6fd; }
.alert__close { background: none; border: 0; font-size: 1.25rem; line-height: 1; color: inherit; opacity: .6; padding: 0 var(--sp-1); }
.alert__close:hover { opacity: 1; }

/* --- Címkék --- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
  background: var(--c-border); color: var(--c-text-2); line-height: 1.5;
}
.badge--primary { background: var(--c-primary-soft); color: var(--c-primary); }
.badge--success { background: var(--c-success-soft); color: #166534; }
.badge--danger { background: var(--c-danger-soft); color: #991b1b; }
.badge--warning { background: var(--c-warning-soft); color: #92400e; }
.badge--info { background: var(--c-info-soft); color: #075985; }
.badge--dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--badge-color, currentColor); }
.badge--outline { background: transparent; border: 1px solid var(--c-border-strong); }
.status { --sc: #6b7280; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--sc) 14%, white); color: color-mix(in srgb, var(--sc) 80%, black); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sc); flex-shrink: 0; }

/* --- Táblázat --- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--card-pad, var(--sp-4))); padding: 0 var(--card-pad, var(--sp-4)); }
.table { font-size: var(--fs-sm); }
.table th, .table td { padding: var(--sp-3) var(--sp-3); text-align: left; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.table th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--c-text-3); font-weight: 600; white-space: nowrap; background: var(--c-surface-2); }
.table tbody tr:hover { background: var(--c-surface-2); }
.table td.right, .table th.right { text-align: right; }
.table a.row-link { color: inherit; font-weight: 600; }
.table--clickable tbody tr { cursor: pointer; }
.table .actions { white-space: nowrap; text-align: right; }

/* Lista-kártyák mobilra (táblázat helyett) */
.list { display: flex; flex-direction: column; gap: var(--sp-2); }
.list-item {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: var(--sp-3) var(--sp-4); color: inherit;
}
.list-item:hover { text-decoration: none; background: var(--c-surface-2); }
.list-item__body { flex: 1; min-width: 0; }
.list-item__title { font-weight: 600; display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.list-item__meta { color: var(--c-text-3); font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin-top: 2px; }
.list-item__side { text-align: right; flex-shrink: 0; font-size: var(--fs-sm); display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-1); }
.list-item--done { opacity: .6; }
.list-item--done .list-item__title { text-decoration: line-through; }

/* Üres állapot */
.empty { text-align: center; padding: var(--sp-8) var(--sp-4); color: var(--c-text-3); }
.empty__icon { font-size: 2rem; margin-bottom: var(--sp-2); }

/* --- Szűrők --- */
.filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: flex-end; margin-bottom: var(--sp-4); }
.filters .field { flex: 1 1 140px; }
.filters .field--search { flex: 2 1 220px; }
.filters .field label { font-size: var(--fs-xs); }
.filters .btn { min-height: var(--tap); }
details.filters-toggle > summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); color: var(--c-primary); list-style: none; display: inline-flex; align-items: center; gap: var(--sp-1); min-height: var(--tap); }
details.filters-toggle > summary::-webkit-details-marker { display: none; }
details.filters-toggle > summary::before { content: "▸"; transition: transform .15s; }
details.filters-toggle[open] > summary::before { transform: rotate(90deg); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--sp-3); border-radius: var(--radius-pill); border: 1px solid var(--c-border-strong); background: var(--c-surface); font-size: var(--fs-sm); font-weight: 500; color: var(--c-text-2); }
.chip:hover { text-decoration: none; background: var(--c-surface-2); }
.chip.is-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

/* --- Lapozás --- */
.pagination { display: flex; gap: var(--sp-1); flex-wrap: wrap; justify-content: center; margin-top: var(--sp-4); }
.pagination a, .pagination span { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: 1px solid var(--c-border); background: var(--c-surface); font-size: var(--fs-sm); padding: 0 var(--sp-2); }
.pagination .is-active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* --- Fülek --- */
.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--c-border); margin-bottom: var(--sp-4); overflow-x: auto; }
.tabs a { padding: var(--sp-3) var(--sp-3); color: var(--c-text-2); font-weight: 600; font-size: var(--fs-sm); border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; min-height: var(--tap); display: inline-flex; align-items: center; gap: var(--sp-1); }
.tabs a:hover { text-decoration: none; color: var(--c-primary); }
.tabs a.is-active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.tabs .count { background: var(--c-border); color: var(--c-text-2); border-radius: var(--radius-pill); padding: 0 6px; font-size: var(--fs-xs); }

/* --- Definíciós lista (adatlap) --- */
.dl { display: grid; grid-template-columns: minmax(110px, 35%) 1fr; gap: var(--sp-2) var(--sp-3); margin: 0; font-size: var(--fs-sm); }
.dl dt { color: var(--c-text-3); }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }

/* --- Statisztika csempék --- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.stat { background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--sp-3) var(--sp-4); }
.stat__label { font-size: var(--fs-xs); color: var(--c-text-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat__value { font-size: var(--fs-xl); font-weight: 800; line-height: 1.2; margin-top: 2px; }
.stat__sub { font-size: var(--fs-xs); color: var(--c-text-3); }
.stat--accent .stat__value { color: var(--c-primary); }

/* Pipeline sáv */
.pipeline { display: flex; flex-direction: column; gap: var(--sp-2); }
.pipeline__row { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2); align-items: center; font-size: var(--fs-sm); color: inherit; }
.pipeline__row:hover { text-decoration: none; background: var(--c-surface-2); }
.pipeline__bar { height: 8px; border-radius: 4px; background: var(--c-border); overflow: hidden; grid-column: 1 / -1; }
.pipeline__bar i { display: block; height: 100%; background: var(--sc, var(--c-primary)); }

/* --- Idővonal --- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--c-border); }
.timeline__item { position: relative; padding-left: 44px; padding-bottom: var(--sp-4); }
.timeline__icon { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--c-surface); border: 2px solid var(--c-border); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.timeline__item--statuszvaltas .timeline__icon { border-color: var(--c-primary); background: var(--c-primary-soft); }
.timeline__item--rendszer .timeline__icon { background: var(--c-surface-2); }
.timeline__head { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); font-size: var(--fs-xs); color: var(--c-text-3); align-items: center; }
.timeline__head strong { color: var(--c-text-2); }
.timeline__body { margin-top: 2px; font-size: var(--fs-sm); white-space: pre-wrap; word-break: break-word; }
.timeline__body a { font-weight: 500; }

/* --- Teendő sor --- */
.todo { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-2) 0; border-bottom: 1px solid var(--c-border); }
.todo:last-child { border-bottom: 0; }
.todo__check { flex-shrink: 0; width: var(--tap); height: var(--tap); display: flex; align-items: center; justify-content: center; margin: -8px 0 -8px -8px; }
.todo__check input { width: 22px; height: 22px; accent-color: var(--c-success); margin: 0; cursor: pointer; }
.todo__body { flex: 1; min-width: 0; }
.todo__title { font-weight: 600; font-size: var(--fs-sm); }
.todo__meta { font-size: var(--fs-xs); color: var(--c-text-3); display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); }
.todo--done .todo__title { text-decoration: line-through; color: var(--c-text-3); font-weight: 500; }
.todo--overdue .todo__meta .due { color: var(--c-danger); font-weight: 600; }
.todo--today .todo__meta .due { color: var(--c-warning); font-weight: 600; }
.todo--fontos .todo__title::before { content: "!"; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--c-danger); color: #fff; font-size: 11px; margin-right: 6px; vertical-align: 1px; }

/* --- Kanban --- */
.kanban { display: flex; gap: var(--sp-3); overflow-x: auto; padding-bottom: var(--sp-3); margin: 0 calc(-1 * var(--sp-4)); padding-left: var(--sp-4); padding-right: var(--sp-4); align-items: flex-start; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.kanban__col { flex: 0 0 280px; scroll-snap-align: start; background: var(--c-bg); border-radius: var(--radius); border: 1px solid var(--c-border); display: flex; flex-direction: column; max-height: calc(100vh - var(--topbar-h) - 150px); }
.kanban__head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3); font-weight: 700; font-size: var(--fs-sm); border-top: 3px solid var(--sc, var(--c-border)); border-radius: var(--radius) var(--radius) 0 0; background: var(--c-surface); }
.kanban__head .count { margin-left: auto; background: var(--c-border); border-radius: var(--radius-pill); padding: 0 8px; font-size: var(--fs-xs); }
.kanban__sum { font-size: var(--fs-xs); color: var(--c-text-3); font-weight: 500; }
.kanban__cards { padding: var(--sp-2); display: flex; flex-direction: column; gap: var(--sp-2); overflow-y: auto; min-height: 60px; flex: 1; }
.kanban__col.is-over .kanban__cards { background: var(--c-primary-soft); border-radius: 0 0 var(--radius) var(--radius); }
.kcard { background: var(--c-surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: var(--sp-3); cursor: grab; display: block; color: inherit; border-left: 3px solid transparent; }
.kcard:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.kcard.is-dragging { opacity: .5; }
.kcard.sortable-ghost { opacity: .35; }
.kcard--neglected { border-left-color: var(--c-danger); }
.kcard__title { font-weight: 700; font-size: var(--fs-sm); display: flex; gap: var(--sp-2); align-items: center; }
.kcard__title .ico { font-size: 1rem; }
.kcard__sub { font-size: var(--fs-xs); color: var(--c-text-3); margin-top: 2px; }
.kcard__foot { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); font-size: var(--fs-xs); }
.kcard__foot .avatar { margin-left: auto; }
.kcard__age { color: var(--c-text-3); }
.kcard--neglected .kcard__age { color: var(--c-danger); font-weight: 600; }

/* --- Modal --- */
.modal { position: fixed; inset: 0; z-index: 60; align-items: flex-end; justify-content: center; background: rgba(17,24,39,.5); padding: var(--sp-4); }
.modal:not(dialog) { display: flex; }
.modal__box { background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; padding: var(--sp-5); max-height: 90vh; overflow-y: auto; }
.modal__title { margin-bottom: var(--sp-3); }
dialog.modal { border: 0; margin: 0; max-width: none; max-height: none; width: 100%; height: 100%; }
dialog.modal:not([open]) { display: none !important; }
dialog.modal[open] { display: flex; }
dialog.modal::backdrop { background: transparent; }

/* --- Toast --- */
.toast { position: fixed; left: 50%; bottom: calc(var(--bottomnav-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #111827; color: #fff; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm); font-size: var(--fs-sm); box-shadow: var(--shadow-lg); z-index: 70; max-width: calc(100vw - 32px); }
.toast--error { background: var(--c-danger); }
.toast--success { background: var(--c-success); }

/* --- Auth oldalak --- */
.auth-body { padding-bottom: 0; background: linear-gradient(160deg, var(--c-primary) 0%, #0f172a 100%); min-height: 100vh; }
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--sp-4); }
.auth__card { background: var(--c-surface); border-radius: 14px; box-shadow: var(--shadow-lg); padding: var(--sp-6); width: 100%; max-width: 400px; }
.auth__brand { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.auth__brand svg { width: 40px; height: 40px; color: var(--c-accent); background: var(--c-primary); border-radius: 10px; padding: 6px; }
.auth__brand strong { display: block; font-size: var(--fs-lg); }
.auth__brand small { color: var(--c-text-3); }
.auth__title { font-size: var(--fs-lg); margin-bottom: var(--sp-4); }
.auth__link { text-align: center; font-size: var(--fs-sm); margin: 0; }
.auth__foot { color: rgba(255,255,255,.6); font-size: var(--fs-xs); margin-top: var(--sp-4); }

/* --- Hibaoldal --- */
.errorpage { text-align: center; padding: var(--sp-8) var(--sp-4); }
.errorpage__code { font-size: 3rem; font-weight: 800; color: var(--c-primary); margin: 0; line-height: 1; }

/* --- Gyors jegyzet --- */
.quicknote textarea { min-height: 72px; }
.quicknote__bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.quicknote__bar .segmented { flex: 1 1 auto; }

/* Elhanyagolt jelzés */
.age { font-size: var(--fs-xs); color: var(--c-text-3); }
.age--neglected { color: var(--c-danger); font-weight: 600; }

/* Kód / napló */
.log { background: #111827; color: #e5e7eb; font-family: var(--font-mono); font-size: 12px; padding: var(--sp-3); border-radius: var(--radius-sm); overflow: auto; max-height: 60vh; white-space: pre; }

/* Sorrendezhető beállítás-lista */
.editlist { display: flex; flex-direction: column; gap: var(--sp-2); }
.editlist__row { display: grid; grid-template-columns: 28px 1fr auto; gap: var(--sp-2); align-items: center; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: var(--sp-2); }
.editlist__row input[type="text"] { min-height: 38px; }
.editlist__handle { cursor: grab; color: var(--c-muted); text-align: center; font-size: 1.1rem; }
.editlist__row--wide { grid-template-columns: 28px 1fr 1fr auto; }
.editlist__row input[type="color"] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm); background: #fff; }

/* Import előnézet */
.preview-table td, .preview-table th { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapping { display: grid; gap: var(--sp-2); }
.mapping__row { display: grid; grid-template-columns: 1fr; gap: var(--sp-2); align-items: center; padding: var(--sp-2); border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface-2); }
.mapping__row strong { font-size: var(--fs-sm); }
.mapping__row small { display: block; color: var(--c-text-3); font-size: var(--fs-xs); }
.steps { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-4); font-size: var(--fs-xs); }
.steps span { padding: 4px 10px; border-radius: var(--radius-pill); background: var(--c-border); color: var(--c-text-2); font-weight: 600; }
.steps span.is-active { background: var(--c-primary); color: #fff; }
.steps span.is-done { background: var(--c-success-soft); color: #166534; }

/* Mobil "Több" menü */
.menu-list { display: flex; flex-direction: column; }
.menu-list a { display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; padding: 0 var(--sp-3); border-bottom: 1px solid var(--c-border); color: var(--c-text); font-weight: 500; }
.menu-list a:last-child { border-bottom: 0; }
.menu-list a:hover { background: var(--c-surface-2); text-decoration: none; }

/* Kanban mobilon: keskenyebb oszlopok, teljes magasság */
@media (max-width: 899px) {
  .kanban__col { flex-basis: 78vw; max-height: calc(100vh - var(--topbar-h) - var(--bottomnav-h) - 140px); }
}

/* --- Reszponzív: tablet és asztali --- */
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .mapping__row { grid-template-columns: 1fr 1fr; }
  .form__row { grid-template-columns: 1fr 1fr; }
  .form__row--3 { grid-template-columns: 1fr 1fr 1fr; }
  .modal { align-items: center; }
  .grid--2 { grid-template-columns: 1fr 1fr; }
  .hide-mobile { display: revert !important; }
  .show-mobile { display: none !important; }
}
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .bottomnav { display: none; }
  .topnav { display: flex; }
  .usermenu__name { display: inline; }
  .page { padding: var(--sp-6) var(--sp-6); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .grid--main { grid-template-columns: 2fr 1fr; }
  .toast { bottom: 24px; }
  .table-wrap { margin: 0; padding: 0; }
  .kanban { margin: 0; padding-left: 0; padding-right: 0; }
  .dl { grid-template-columns: 160px 1fr; }
}
@media print {
  .topbar, .bottomnav, .btn, .filters, .toast { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
