:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #edf2fa;
  --border: #dbe3f0;
  --text: #14213d;
  --muted: #5f6d86;
  --accent: #1e4fd1;
  --accent-hover: #1a44b6;
  --accent-soft: #e4ebfa;
  --danger: #b4524f;
  --danger-soft: #f8ecea;
  --warn: #b7781f;
  --warn-soft: #faf1e1;
  --ok: #1f8a4c;
  --ok-soft: #e5f4ea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .04), 0 4px 16px rgba(30, 79, 209, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* --- layout --- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 20px; height: 60px;
  display: flex; align-items: center; gap: 24px;
}
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 500; }
.nav a.active, .nav a:hover { background: var(--surface-2); color: var(--text); }
.topbar .spacer { flex: 1; }
.main { max-width: 1120px; margin: 0 auto; padding: 28px 20px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 2px; }

/* --- components --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); font-weight: 500; transition: .15s;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: .5; cursor: default; }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 90px; }
label.field { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.form-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.form-group { margin-bottom: 14px; }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.active { background: var(--ok-soft); color: var(--ok); }
.badge.paused { background: var(--warn-soft); color: var(--warn); }
.badge.finished { background: var(--surface-2); color: var(--muted); }
.badge.overdue { background: var(--danger-soft); color: var(--danger); }
.badge.soon { background: var(--warn-soft); color: var(--warn); }
.badge.tag { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--accent-soft);
  display: inline-flex; align-items: center; justify-content: center; color: var(--accent); font-weight: 700; flex-shrink: 0;
  font-size: 15px;
}
.avatar.lg { width: 96px; height: 96px; font-size: 32px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.stat { padding: 18px 20px; }
.stat .num { font-size: 28px; font-weight: 700; margin-top: 4px; }
.stat.danger .num { color: var(--danger); }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.list-item:first-child { border-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 500; }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.section-head h2 { font-size: 15px; }

/* --- mentee cards --- */
.mentee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mentee-card { padding: 18px; display: flex; gap: 14px; align-items: flex-start; color: var(--text); transition: .15s; }
.mentee-card:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(16,24,40,.09); }
.mentee-card .name { font-weight: 600; }
.mentee-card .meta { font-size: 13px; color: var(--muted); margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .input { width: auto; min-width: 240px; flex: 1; }
.toolbar select.input { flex: 0 0 auto; }

/* --- profile --- */
.profile-head { display: flex; gap: 20px; align-items: flex-start; padding: 24px; }
.profile-head .info { flex: 1; min-width: 0; }
.profile-head .name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-head .contacts { display: flex; gap: 16px; margin-top: 8px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.profile-head .tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.avatar-wrap { position: relative; }
.avatar-wrap .change { position: absolute; bottom: -4px; right: -4px; }
.profile-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-top: 20px; align-items: start; }
.side .block { padding: 16px 20px; border-top: 1px solid var(--border); }
.side .block:first-child { border-top: 0; }
.side .block h3 { margin-bottom: 8px; }
.pre { white-space: pre-wrap; word-break: break-word; }
.timeline { display: flex; flex-direction: column; }
.meeting { padding: 18px 20px; border-top: 1px solid var(--border); }
.meeting:first-child { border-top: 0; }
.meeting .meeting-head { display: flex; align-items: center; gap: 10px; }
.meeting .date { font-weight: 600; }
.meeting .summary { margin-top: 8px; }
.meeting .meeting-tasks { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.task { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-top: 1px solid var(--border); }
.task:first-child { border-top: 0; }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.task input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.task .t-title { flex: 1; }
.task .due { font-size: 13px; color: var(--muted); white-space: nowrap; }
.task .due.overdue { color: var(--danger); font-weight: 600; }
.task .due.soon { color: var(--warn); font-weight: 600; }
.mini-task { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.mini-task .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.mini-task .dot.done { background: var(--ok); }
.mini-task .dot.overdue { background: var(--danger); }
.new-task-row { display: grid; grid-template-columns: 1fr 160px auto; gap: 8px; margin-bottom: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 20px; }
.tabs button { padding: 12px 14px; border: 0; background: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--accent); border-color: var(--accent); }

/* --- modal --- */
.modal-bg { position: fixed; inset: 0; background: rgba(23,26,34,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow: auto; }
.modal { width: 100%; max-width: 640px; }
.modal .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal .modal-body { padding: 22px; }
.modal .modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }

/* --- login --- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login { width: 100%; max-width: 380px; padding: 32px; }
.login h1 { margin-bottom: 4px; }
.login .sub { margin-bottom: 22px; }
.error { color: var(--danger); font-size: 14px; margin-top: 8px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 100;
  box-shadow: var(--shadow);
}
.toast.err { background: var(--danger); }

@media (max-width: 820px) {
  .grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .grid.cols-2, .profile-layout, .form-row, .form-row.three { grid-template-columns: 1fr; }
  .nav a { padding: 7px 9px; }
  .topbar-inner { gap: 12px; }
  .brand span.txt { display: none; }
  .new-task-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .list-item { flex-wrap: wrap; }
  .list-item .grow { flex: 1 1 calc(100% - 44px); }
  .list-item .badge, .list-item > .small { margin-left: 44px; }
  .profile-head { flex-direction: column; }
  .mentee-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topbar-inner { padding: 0 12px; gap: 6px; }
  .nav { margin-left: 0; }
  .topbar .btn.sm { padding: 5px 8px; white-space: nowrap; }
  .main { padding: 20px 16px 48px; }
}
@media (max-width: 600px) {
  .topbar a[download] { display: none; }
}


/* --- v2: fókusz, teendők, jegyzet --- */
.stat-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat .num { margin-top: 6px; }
.page-head .sub { max-width: 620px; }
.focus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 18px 20px 20px; }
.focus-col h3 { margin-bottom: 10px; }
.focus-item { display: block; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text); margin-bottom: 8px; transition: .15s; }
.focus-item:hover { background: var(--accent-soft); }
.focus-item .title { font-weight: 500; }
.focus-item.row { display: flex; }
.focus-item .grow { flex: 1; min-width: 0; }
.overdue { color: var(--danger); font-weight: 600; }
.soon { color: var(--warn); font-weight: 600; }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.open { background: var(--accent-soft); color: var(--accent); }
.pill.in_progress { background: var(--warn-soft); color: var(--warn); }
.pill.done { background: var(--ok-soft); color: var(--ok); }
.pill.overdue { background: var(--danger-soft); color: var(--danger); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 500; }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.active { background: var(--accent-soft); color: var(--accent); }
.status-select {
  padding: 6px 30px 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface) no-repeat right 10px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235f6d86' stroke-width='1.5'/%3E%3C/svg%3E");
  appearance: none; -webkit-appearance: none; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.status-select.open { color: var(--accent); }
.status-select.in_progress { color: var(--warn); background-color: var(--warn-soft); border-color: transparent; }
.status-select.done { color: var(--ok); background-color: var(--ok-soft); border-color: transparent; }
.task { padding: 12px 20px; }
.task .grow { flex: 1; min-width: 0; }
.task .t-title { font-weight: 500; }
.task.done .t-title { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.task.is-overdue .t-title { color: var(--danger); }
.btn.icon { padding: 5px 8px; font-size: 14px; line-height: 1; }
.note-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.note-block { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.note-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.meeting .meeting-tasks { margin-top: 12px; }
.meeting .date { color: var(--accent); }
.pending-box { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.pending-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; font-size: 14px; }
.pending-item input { width: 16px; height: 16px; accent-color: var(--accent); }
.pending-item .due { margin-left: auto; }
.profile-head .tags { align-items: center; }
@media (max-width: 820px) {
  .focus-grid { grid-template-columns: 1fr; }
  .note-grid { grid-template-columns: 1fr; }
  .task { flex-wrap: wrap; }
  .task .grow { flex-basis: 100%; }
}
.list-item .due, .list-item .pill { white-space: nowrap; flex-shrink: 0; }
.list-item .grow .title { overflow-wrap: anywhere; }
@media (max-width: 960px) {
  .grid.cols-2 { grid-template-columns: 1fr; }
}

/* --- v3: keresés, célok, fájlok, megosztás, beállítások, nyomtatás --- */
.search-form { flex: 0 1 260px; }
.search-form .input { padding: 7px 12px; border-radius: 999px; background: var(--surface-2); border-color: transparent; }
.search-form .input:focus { background: var(--surface); border-color: var(--accent); }
.topbar .btn.active { background: var(--surface-2); color: var(--text); }
mark { background: #fff1a8; color: inherit; padding: 0 2px; border-radius: 3px; }
.notice { padding: 12px 16px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.notice.warn { background: var(--warn-soft); color: #7a4f10; margin-bottom: 20px; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice a { font-weight: 600; }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; background: var(--ok); border-radius: 999px; transition: width .3s; }
.pill.g-not_started { background: var(--surface-2); color: var(--muted); }
.pill.g-in_progress { background: var(--warn-soft); color: var(--warn); }
.pill.g-achieved { background: var(--ok-soft); color: var(--ok); }
.pill.kind { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.status-select.g-not_started { color: var(--muted); }
.status-select.g-in_progress { color: var(--warn); background-color: var(--warn-soft); border-color: transparent; }
.status-select.g-achieved { color: var(--ok); background-color: var(--ok-soft); border-color: transparent; }
.goal-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.goal-row:first-of-type { border-top: 0; }
.goal-row .grow { flex: 1; min-width: 0; }
.goal-line { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 14px; }
.goal-line .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--muted); }
.goal-line .dot.g-in_progress { background: var(--warn); }
.goal-line .dot.g-achieved { background: var(--ok); }
.file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.file-list.col { flex-direction: column; margin-top: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 2px 4px 2px 10px; font-size: 13px; max-width: 100%; }
.file-chip a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.share-box { display: flex; gap: 6px; }
.share-box .input { font-size: 13px; }
.head-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.prep-next { padding: 16px 20px; margin-top: 16px; border-left: 4px solid var(--accent); }
.prep-questions { margin: 0; padding-left: 18px; }
.prep-questions li { margin: 4px 0; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.section-head .chips .chip { padding: 5px 10px; font-size: 13px; }
label.btn input[type=file] { display: none; }
input[type=file].input { padding: 7px 10px; }
@media (max-width: 820px) {
  .search-form { order: 10; flex: 1 1 100%; margin-bottom: 8px; display: none; }
  .head-actions { flex-direction: row; flex-wrap: wrap; }
  .topbar .btn .txt { display: none; }
}
@media print {
  .topbar, .no-print, .btn, .toast { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .profile-layout { grid-template-columns: 1fr; }
}
.brand { white-space: nowrap; }
.search-form { flex: 0 1 240px; min-width: 110px; }
.goal-row { flex-wrap: wrap; }
.goal-row .grow { flex: 1 1 100%; }
.goal-row .status-select { margin-left: auto; }

/* --- v4: mérföldkövek, riport --- */
.pill.g-abandoned, .status-select.g-abandoned { color: var(--muted); text-decoration: line-through; }
.goal-row.achieved .g-title, .goal-row.abandoned .g-title { color: var(--muted); }
.goal-row.abandoned .g-title { text-decoration: line-through; }
.goal-line .dot.g-abandoned { background: var(--border); }
.milestones { flex-basis: 100%; padding-left: 4px; }
.progress.thin { height: 4px; margin: 4px 0 6px; }
.milestone { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; cursor: pointer; }
.milestone input { width: 15px; height: 15px; accent-color: var(--ok); flex-shrink: 0; }
.milestone .grow { flex: 1; min-width: 0; }
.milestone.done .grow { color: var(--muted); text-decoration: line-through; }
.milestone .ms-del { opacity: 0; padding: 2px 6px; }
.milestone:hover .ms-del { opacity: 1; }
.ms-add .input { padding: 5px 10px; font-size: 13px; margin-top: 4px; background: transparent; border-style: dashed; }
.ms-add .input:focus { background: var(--surface); border-style: solid; }
.ms-list { margin: 4px 0 0; padding-left: 4px; list-style: none; font-size: 13px; }
.ms-list li { padding: 1px 0; }
.ms-list li.done { color: var(--muted); }
.goal-line .grow { flex: 1; min-width: 0; }
.report .meeting { break-inside: avoid; }
@media print {
  .report .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .report .card { margin-bottom: 12px; }
  .milestone .ms-del, .ms-add { display: none; }
}

/* --- adatvédelmi mód: nevek, képek, elérhetőségek elhalványítva (videófelvételhez) --- */
body.privacy .avatar, body.privacy .mentee-card .name, body.privacy .list-item .title, body.privacy .focus-item .title,
body.privacy .profile-head h1, body.privacy .profile-head .contacts, body.privacy .profile-head .info > p, body.privacy .mentee-card .small.muted,
body.privacy .task .small a, body.privacy .list-item .grow .small, body.privacy .focus-item .small, body.privacy .side .pre,
body.privacy .goal-row .g-title, body.privacy .meeting .summary, body.privacy .note-block, body.privacy .t-title, body.privacy .mini-task,
body.privacy .search-form, body.privacy mark, body.privacy .goal-line, body.privacy .share-box, body.privacy .file-chip, body.privacy .pending-item span {
  filter: blur(6px); user-select: none;
}
body.privacy .avatar img, body.privacy img.avatar { filter: blur(10px); }
body.privacy #privacyToggle { background: var(--warn-soft); color: var(--warn); }

/* --- lenyílók egységes stílusa --- */
select.input {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 36px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235f6d86' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
}
select.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.toolbar select.input { min-width: 170px; font-weight: 500; }
.topbar .btn.key { background: var(--accent-soft); color: var(--accent); }
