/* ==========================================================================
   Kanban – felület
   ========================================================================== */

:root {
    color-scheme: light;
    --bg:           #eef1f6;
    --bg-elev:      #ffffff;
    --bg-soft:      #f4f6fa;
    --bg-sunken:    #e6eaf1;
    --fg:           #1b2333;
    --fg-muted:     #5d6880;
    --fg-faint:     #8b95a9;
    --line:         #dde2eb;
    --line-strong:  #c6cedb;
    --accent:       #3d7dfb;
    --accent-fg:    #ffffff;
    --accent-soft:  rgba(61, 125, 251, .12);
    --danger:       #dc4c4c;
    --danger-soft:  rgba(220, 76, 76, .12);
    --warn:         #e08b2c;
    --warn-soft:    rgba(224, 139, 44, .14);
    --ok:           #2f9e63;
    --ok-soft:      rgba(47, 158, 99, .14);
    --shadow-sm:    0 1px 2px rgba(20, 30, 50, .10);
    --shadow-md:    0 4px 14px rgba(20, 30, 50, .12);
    --shadow-lg:    0 18px 48px rgba(16, 24, 40, .22);
    --radius:       10px;
    --radius-lg:    14px;
    --topbar-h:     54px;
    --font:         system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg:           #151922;
    --bg-elev:      #1e232e;
    --bg-soft:      #232935;
    --bg-sunken:    #11151c;
    --fg:           #e4e9f2;
    --fg-muted:     #97a1b4;
    --fg-faint:     #6d7791;
    --line:         #2e3543;
    --line-strong:  #3c4454;
    --accent:       #5a91ff;
    --accent-fg:    #0d1117;
    --accent-soft:  rgba(90, 145, 255, .16);
    --danger:       #f07070;
    --danger-soft:  rgba(240, 112, 112, .16);
    --warn:         #f0a94b;
    --warn-soft:    rgba(240, 169, 75, .16);
    --ok:           #4fc186;
    --ok-soft:      rgba(79, 193, 134, .16);
    --shadow-sm:    0 1px 2px rgba(0, 0, 0, .35);
    --shadow-md:    0 4px 16px rgba(0, 0, 0, .40);
    --shadow-lg:    0 20px 52px rgba(0, 0, 0, .55);
}

@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] {
        color-scheme: dark;
        --bg: #151922; --bg-elev: #1e232e; --bg-soft: #232935; --bg-sunken: #11151c;
        --fg: #e4e9f2; --fg-muted: #97a1b4; --fg-faint: #6d7791;
        --line: #2e3543; --line-strong: #3c4454;
        --accent: #5a91ff; --accent-fg: #0d1117; --accent-soft: rgba(90,145,255,.16);
        --danger: #f07070; --danger-soft: rgba(240,112,112,.16);
        --warn: #f0a94b; --warn-soft: rgba(240,169,75,.16);
        --ok: #4fc186; --ok-soft: rgba(79,193,134,.16);
        --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
        --shadow-md: 0 4px 16px rgba(0,0,0,.40);
        --shadow-lg: 0 20px 52px rgba(0,0,0,.55);
    }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 14px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8;
      stroke-linecap: round; stroke-linejoin: round; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--accent-soft); }

/* Görgetősáv */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--fg-faint); background-clip: padding-box; }

/* ==========================================================================
   Bejelentkezés
   ========================================================================== */

body.auth { display: grid; place-items: center; padding: 24px; background: var(--bg); }

.login-wrap { width: 100%; max-width: 380px; }

.login-card {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.login-logo { display: flex; gap: 4px; justify-content: center; margin-bottom: 18px; }
.login-logo span { width: 10px; height: 30px; border-radius: 3px; background: var(--accent); opacity: .45; }
.login-logo span:nth-child(2) { height: 22px; opacity: .7; align-self: flex-start; }
.login-logo span:nth-child(3) { height: 14px; opacity: 1; align-self: flex-start; }

.login-card h1 { font-size: 21px; margin: 0 0 2px; letter-spacing: -.01em; }
.login-sub { color: var(--fg-muted); margin: 0 0 22px; font-size: 13px; }

.login-card label { display: block; text-align: left; font-size: 12.5px; font-weight: 600;
                    color: var(--fg-muted); margin-bottom: 14px; }
.login-card input {
    width: 100%; margin-top: 6px; padding: 10px 12px; font-weight: 400;
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    background: var(--bg-soft); color: var(--fg);
}
.login-card input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.login-card button {
    width: 100%; margin-top: 6px; padding: 11px; border: 0; border-radius: var(--radius);
    background: var(--accent); color: var(--accent-fg); font-weight: 650; cursor: pointer;
}
.login-card button:hover { filter: brightness(1.06); }

.login-error {
    background: var(--danger-soft); color: var(--danger); border-radius: var(--radius);
    padding: 9px 12px; font-size: 13px; margin-bottom: 16px; text-align: left;
}

/* ==========================================================================
   Fejléc
   ========================================================================== */

body.app { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }

.topbar {
    flex: 0 0 auto; height: var(--topbar-h);
    display: flex; align-items: center; gap: 10px;
    padding: 0 12px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    z-index: 30;
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.01em; }
.brand-mark { display: flex; gap: 2px; align-items: flex-end; }
.brand-mark i { width: 5px; border-radius: 2px; background: var(--accent); }
.brand-mark i:nth-child(1) { height: 16px; opacity: .45; }
.brand-mark i:nth-child(2) { height: 11px; opacity: .7; }
.brand-mark i:nth-child(3) { height: 7px; }
.brand-name { font-size: 15px; }

.topnav { display: flex; gap: 2px; margin-left: 12px; }
.topnav a {
    padding: 7px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 550; color: var(--fg-muted);
}
.topnav a:hover { background: var(--bg-soft); color: var(--fg); }
.topnav a.active { background: var(--accent-soft); color: var(--accent); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.quick-search { position: relative; display: flex; align-items: center; }
.quick-search svg { position: absolute; left: 9px; width: 16px; height: 16px; color: var(--fg-faint); }
.quick-search input {
    width: 190px; padding: 7px 10px 7px 30px; border-radius: 8px;
    border: 1px solid var(--line); background: var(--bg-soft); font-size: 13px;
}
.quick-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; width: 240px; }

.icon-btn {
    display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
    border: 0; border-radius: 8px; background: transparent; color: var(--fg-muted); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--fg); }

.menu-toggle { display: none; }

#themeToggle .icon-moon { display: none; }
html[data-theme="dark"] #themeToggle .icon-sun { display: none; }
html[data-theme="dark"] #themeToggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] #themeToggle .icon-sun { display: none; }
    html[data-theme="auto"] #themeToggle .icon-moon { display: block; }
}

.avatar {
    display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
    border: 0; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 700;
    cursor: pointer; flex: 0 0 auto; text-transform: uppercase;
}
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.avatar.xs { width: 20px; height: 20px; font-size: 10px; }

.user-menu { position: relative; }

.dropdown {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px;
    background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 6px; z-index: 50;
}
.dropdown[hidden] { display: none; }
.dropdown-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px;
                 display: flex; flex-direction: column; gap: 2px; }
.dropdown-head span { font-size: 12px; color: var(--fg-muted); }
.role-chip { align-self: flex-start; margin-top: 6px; background: var(--accent-soft); color: var(--accent);
             padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 650; }
.dropdown a, .dropdown button {
    display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 7px;
    background: transparent; cursor: pointer; font-size: 13.5px;
}
.dropdown a:hover, .dropdown button:hover { background: var(--bg-soft); }
.dropdown .danger { color: var(--danger); }

/* ==========================================================================
   Nézet-keret
   ========================================================================== */

.view { flex: 1 1 auto; min-height: 0; overflow: auto; }
.view.no-scroll { overflow: hidden; }

.page { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; margin: 0; letter-spacing: -.015em; }
.page-head .sub { color: var(--fg-muted); font-size: 13.5px; margin: 3px 0 0; }
.page-head .spacer { flex: 1 1 auto; }

.section-title {
    font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
    color: var(--fg-faint); margin: 28px 0 12px;
}

.empty {
    text-align: center; padding: 48px 20px; color: var(--fg-muted);
    border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--bg-elev);
}
.empty strong { display: block; color: var(--fg); margin-bottom: 4px; font-size: 15px; }

.loading { padding: 40px; text-align: center; color: var(--fg-muted); }

/* Gombok */
.btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px;
    border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg-elev);
    color: var(--fg); font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--bg-soft); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-fg); }
.btn-primary:hover { filter: brightness(1.07); background: var(--accent); }
.btn-danger { color: var(--danger); border-color: transparent; background: var(--danger-soft); }
.btn-danger:hover { background: var(--danger-soft); filter: brightness(1.05); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--fg-muted); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--fg); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Űrlapelemek */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; font-weight: 650; color: var(--fg-muted); margin-bottom: 5px; }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="date"], input[type="time"], input[type="number"], select, textarea {
    width: 100%; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 8px;
    background: var(--bg-soft); color: var(--fg); font-size: 13.5px;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.input:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent;
}
.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ==========================================================================
   Irányítópult
   ========================================================================== */

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat {
    background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px;
}
.stat b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.stat span { font-size: 12.5px; color: var(--fg-muted); }
.stat.warn b { color: var(--danger); }
.stat.due b { color: var(--warn); }

.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; }

.board-tile {
    position: relative; display: flex; flex-direction: column; gap: 10px;
    background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 16px; min-height: 124px; box-shadow: var(--shadow-sm);
    transition: transform .12s ease, box-shadow .12s ease;
    overflow: hidden;
}
.board-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.board-tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--tile-color, var(--accent)); }
.board-tile h3 { margin: 0; font-size: 15.5px; letter-spacing: -.01em; }
.board-tile p { margin: 0; font-size: 12.5px; color: var(--fg-muted);
                display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.board-tile .tile-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
                         font-size: 12px; color: var(--fg-muted); }
.board-tile .tile-owner { margin-left: auto; }

.progress { height: 5px; border-radius: 3px; background: var(--bg-sunken); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px;
        font-size: 11.5px; font-weight: 650; background: var(--bg-sunken); color: var(--fg-muted); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }

.new-board-tile {
    display: grid; place-items: center; gap: 6px; min-height: 124px; cursor: pointer;
    border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
    background: transparent; color: var(--fg-muted); font-weight: 600; font-size: 13.5px;
}
.new-board-tile:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ==========================================================================
   Tábla nézet
   ========================================================================== */

.board-view { display: flex; flex-direction: column; height: 100%; min-height: 0; }

.board-head {
    flex: 0 0 auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--bg-elev);
}
.board-head h1 { margin: 0; font-size: 17px; letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
.board-dot { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
.board-head .spacer { flex: 1 1 auto; }
.board-head .members { display: flex; }
.board-head .members .avatar { margin-left: -6px; border: 2px solid var(--bg-elev); }
.board-head .members .avatar:first-child { margin-left: 0; }

.filter-bar {
    flex: 0 0 auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 9px 18px; background: var(--bg-elev); border-bottom: 1px solid var(--line);
}
.filter-bar.hidden { display: none; }
.filter-bar select, .filter-bar input { width: auto; min-width: 130px; padding: 6px 9px; font-size: 12.5px; }
.filter-count { font-size: 12.5px; color: var(--fg-muted); margin-left: auto; }

.lists-scroller {
    flex: 1 1 auto; min-height: 0;
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 18px 24px; overflow-x: auto; overflow-y: hidden;
}

.list {
    flex: 0 0 286px; width: 286px; max-height: 100%;
    display: flex; flex-direction: column;
    background: var(--bg-sunken); border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}
.list.drag-ghost { opacity: .35; }

.list-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 8px; cursor: grab; }
.list-head:active { cursor: grabbing; }
.list-title {
    flex: 1 1 auto; font-size: 13.5px; font-weight: 700; letter-spacing: -.005em;
    padding: 3px 5px; border-radius: 6px; cursor: text; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-title:hover { background: var(--bg-elev); }
.list-title-input { flex: 1 1 auto; padding: 3px 5px; font-weight: 700; font-size: 13.5px; }
.list-count { font-size: 11.5px; color: var(--fg-faint); font-weight: 650; padding: 0 3px; }

.list-cards {
    flex: 1 1 auto; min-height: 6px; overflow-y: auto; overflow-x: hidden;
    padding: 2px 8px 4px; display: flex; flex-direction: column; gap: 7px;
}
.list-foot { padding: 6px 8px 8px; }
.add-card-btn {
    display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 8px;
    border: 0; border-radius: 8px; background: transparent; color: var(--fg-muted);
    font-size: 13px; font-weight: 600; cursor: pointer; text-align: left;
}
.add-card-btn:hover { background: var(--bg-elev); color: var(--fg); }

.add-list {
    flex: 0 0 286px; width: 286px; padding: 10px;
    border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
    background: transparent; color: var(--fg-muted); font-weight: 600; font-size: 13.5px;
    cursor: pointer; text-align: left;
}
.add-list:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Kártya */
.card {
    position: relative; background: var(--bg-elev); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 8px 10px 9px; cursor: pointer;
    box-shadow: var(--shadow-sm); user-select: none; -webkit-user-select: none;
    touch-action: pan-y;
}
.card:hover { border-color: var(--line-strong); }
.card.drag-ghost { opacity: .35; }
.card.is-done { opacity: .62; }
.card.is-done .card-title { text-decoration: line-through; }

.card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.card-label { height: 7px; min-width: 32px; border-radius: 4px; }
.card-label.named { height: auto; padding: 1px 7px; font-size: 10.5px; font-weight: 700; color: #fff;
                    line-height: 1.5; text-shadow: 0 1px 1px rgba(0,0,0,.25); }

.card-main { display: flex; align-items: flex-start; gap: 7px; }
.card-check {
    flex: 0 0 auto; width: 17px; height: 17px; margin-top: 1px; padding: 0; cursor: pointer;
    border: 1.7px solid var(--line-strong); border-radius: 50%; background: transparent;
    display: grid; place-items: center; color: transparent;
}
.card-check:hover { border-color: var(--ok); color: var(--ok); }
.card-check svg { width: 11px; height: 11px; stroke-width: 3; }
.card.is-done .card-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.card-title { flex: 1 1 auto; font-size: 13.3px; line-height: 1.42; word-break: break-word; }

.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px;
             font-size: 11.5px; color: var(--fg-muted); }
.card-meta .m { display: inline-flex; align-items: center; gap: 3px; }
.card-meta .m.ok { color: var(--ok); font-weight: 650; }
.card-meta svg { width: 13px; height: 13px; }
.card-meta .avatars { margin-left: auto; display: flex; }
.card-meta .avatars .avatar { margin-left: -5px; border: 1.5px solid var(--bg-elev); }
.card-meta .avatars .avatar:first-child { margin-left: 0; }

.due-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 5px;
            font-weight: 650; background: var(--bg-sunken); }
.due-chip.soon { background: var(--warn-soft); color: var(--warn); }
.due-chip.over { background: var(--danger-soft); color: var(--danger); }
.due-chip.done { background: var(--ok-soft); color: var(--ok); }

.card-compose textarea {
    min-height: 62px; font-size: 13.3px; background: var(--bg-elev); border-radius: var(--radius);
}
.card-compose .row { display: flex; gap: 6px; margin-top: 6px; }

/* Behúzás-jelző */
.drop-placeholder {
    border: 2px dashed var(--accent); border-radius: var(--radius);
    background: var(--accent-soft); flex: 0 0 auto;
}

.drag-layer { position: fixed; inset: 0; pointer-events: none; z-index: 1000; display: none; }
.drag-layer.active { display: block; }
.drag-layer .drag-item {
    position: absolute; transform: rotate(2.5deg); box-shadow: var(--shadow-lg);
    opacity: .96; pointer-events: none;
}
body.dragging { cursor: grabbing; }
body.dragging * { cursor: grabbing !important; }

/* ==========================================================================
   Modális ablak
   ========================================================================== */

.modal-backdrop {
    position: fixed; inset: 0; background: rgba(12, 18, 30, .55);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 40px 16px; overflow-y: auto; z-index: 200;
    animation: fade .14s ease;
}
@keyframes fade { from { opacity: 0; } }

.modal {
    width: 100%; max-width: 560px; background: var(--bg-elev); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); border: 1px solid var(--line);
    animation: pop .16s cubic-bezier(.2, .8, .3, 1);
}
.modal.wide { max-width: 760px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }

.modal-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px 12px; }
.modal-head h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; flex: 1 1 auto; }
.modal-head .sub { font-size: 12.5px; color: var(--fg-muted); margin: 3px 0 0; }
.modal-body { padding: 0 20px 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px;
              border-top: 1px solid var(--line); }
.modal-foot .left { margin-right: auto; }

.close-btn { flex: 0 0 auto; }

/* Kártya részletek */
.card-modal-title {
    width: 100%; font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1.35;
    border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 4px 7px;
    margin: -4px 0 0 -7px; resize: none; min-height: auto;
}
.card-modal-title:hover { background: var(--bg-soft); }
.card-modal-title:focus { background: var(--bg-soft); }

.cm-path { font-size: 12px; color: var(--fg-muted); margin: 4px 0 16px 0; }
.cm-path b { font-weight: 650; color: var(--fg); }

.cm-section { margin-bottom: 20px; }
.cm-section > h4 {
    display: flex; align-items: center; gap: 7px; margin: 0 0 8px;
    font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-faint);
}
.cm-section > h4 .spacer { flex: 1 1 auto; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.label-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 6px;
    font-size: 12px; font-weight: 650; color: #fff; border: 0; cursor: pointer;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
.label-chip.off { opacity: .28; }
.label-chip.plain { background: var(--bg-sunken); color: var(--fg-muted); text-shadow: none; }

.assignee-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 20px;
    background: var(--bg-sunken); border: 0; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.assignee-chip.off { opacity: .45; }
.assignee-chip:hover { background: var(--line); }

.markdown { font-size: 13.5px; line-height: 1.65; word-break: break-word; }
.markdown p { margin: 0 0 10px; }
.markdown p:last-child { margin-bottom: 0; }
.markdown h1, .markdown h2, .markdown h3 { margin: 16px 0 8px; font-size: 15px; letter-spacing: -.01em; }
.markdown h1 { font-size: 17px; }
.markdown ul, .markdown ol { margin: 0 0 10px; padding-left: 22px; }
.markdown li { margin-bottom: 3px; }
.markdown code { background: var(--bg-sunken); padding: 1px 5px; border-radius: 4px; font-size: 12.5px;
                 font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.markdown pre { background: var(--bg-sunken); padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.markdown pre code { background: none; padding: 0; }
.markdown a { color: var(--accent); text-decoration: underline; }
.markdown blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--line-strong); color: var(--fg-muted); }
.markdown hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.desc-placeholder {
    padding: 11px 12px; border-radius: 8px; background: var(--bg-soft); color: var(--fg-muted);
    font-size: 13px; cursor: pointer; border: 1px dashed var(--line-strong);
}
.desc-placeholder:hover { border-color: var(--accent); color: var(--accent); }
.desc-view { padding: 4px 2px; cursor: pointer; border-radius: 8px; }
.desc-view:hover { background: var(--bg-soft); }
.md-hint { font-size: 11.5px; color: var(--fg-faint); margin-top: 6px; }

.checklist { margin-bottom: 16px; }
.checklist-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.checklist-head h5 { margin: 0; font-size: 13.5px; font-weight: 650; }
.checklist-head .spacer { flex: 1 1 auto; }
.checklist-progress { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.checklist-progress span { font-size: 11.5px; color: var(--fg-muted); min-width: 32px; }
.checklist-progress .progress { flex: 1 1 auto; }

.chk-item { display: flex; align-items: flex-start; gap: 8px; padding: 4px 6px; border-radius: 7px; }
.chk-item:hover { background: var(--bg-soft); }
.chk-item input { margin-top: 2px; width: 15px; height: 15px; accent-color: var(--ok); flex: 0 0 auto; }
.chk-item .txt { flex: 1 1 auto; font-size: 13.2px; cursor: text; word-break: break-word; }
.chk-item.done .txt { text-decoration: line-through; color: var(--fg-faint); }
.chk-item .del { opacity: 0; }
.chk-item:hover .del { opacity: 1; }

.comment { display: flex; gap: 9px; margin-bottom: 14px; }
.comment-body { flex: 1 1 auto; min-width: 0; }
.comment-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.comment-meta b { font-size: 13px; }
.comment-meta time { font-size: 11.5px; color: var(--fg-faint); }
.comment-meta .actions { margin-left: auto; display: flex; gap: 4px; opacity: 0; }
.comment:hover .comment-meta .actions { opacity: 1; }
.comment-text {
    background: var(--bg-soft); border-radius: 8px; padding: 8px 11px; font-size: 13.3px; line-height: 1.55;
    word-break: break-word;
}

.attachment { display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: 8px; }
.attachment:hover { background: var(--bg-soft); }
.attachment .thumb {
    width: 44px; height: 44px; border-radius: 6px; background: var(--bg-sunken); flex: 0 0 auto;
    display: grid; place-items: center; overflow: hidden; color: var(--fg-faint);
}
.attachment .thumb img { width: 100%; height: 100%; object-fit: cover; }
.attachment .info { flex: 1 1 auto; min-width: 0; }
.attachment .info b { display: block; font-size: 13px; font-weight: 600;
                      overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment .info span { font-size: 11.5px; color: var(--fg-muted); }

.activity-item { display: flex; gap: 9px; margin-bottom: 11px; font-size: 12.5px; }
.activity-item .t { flex: 1 1 auto; color: var(--fg-muted); }
.activity-item .t b { color: var(--fg); font-weight: 650; }
.activity-item time { font-size: 11px; color: var(--fg-faint); display: block; margin-top: 1px; }

.file-drop {
    border: 1px dashed var(--line-strong); border-radius: 8px; padding: 14px; text-align: center;
    color: var(--fg-muted); font-size: 12.5px; cursor: pointer;
}
.file-drop:hover, .file-drop.over { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ==========================================================================
   Naptár
   ========================================================================== */

.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-head h2 { margin: 0; font-size: 18px; min-width: 190px; letter-spacing: -.01em; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
            background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.cal-dow { background: var(--bg-elev); padding: 8px 10px; font-size: 11.5px; font-weight: 700;
           text-transform: uppercase; letter-spacing: .05em; color: var(--fg-faint); text-align: center; }
.cal-cell { background: var(--bg-elev); min-height: 108px; padding: 6px 7px; display: flex; flex-direction: column; gap: 4px; }
.cal-cell.other { background: var(--bg-soft); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-date { font-size: 11.5px; font-weight: 700; color: var(--fg-muted); }
.cal-cell.today .cal-date { color: var(--accent); }
.cal-card {
    display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 5px;
    background: var(--bg-soft); font-size: 11.5px; cursor: pointer; border-left: 3px solid var(--c, var(--accent));
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-cell.other .cal-card { background: var(--bg-elev); }
.cal-card:hover { background: var(--accent-soft); }
.cal-card.done { opacity: .5; text-decoration: line-through; }
.cal-card.over { border-left-color: var(--danger); }

/* ==========================================================================
   Listás nézetek (feladataim, keresés, admin)
   ========================================================================== */

/* ==========================================================================
   Időkövetés
   ========================================================================== */

/* Fejléc-kijelző */
.timer-widget {
    display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 11px;
    background: var(--ok-soft); border: 1px solid transparent; border-radius: 22px;
    max-width: 290px;
}
.timer-widget[hidden] { display: none; }
.timer-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: 0 0 auto;
    animation: pulse 1.8s ease-in-out infinite;
}
.timer-dot.big { width: 11px; height: 11px; }
@keyframes pulse { 50% { opacity: .35; } }

.timer-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.timer-clock { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ok); }
.timer-label { font-size: 11px; color: var(--fg-muted);
               overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.timer-stop {
    display: inline-flex; align-items: center; gap: 4px; border: 0; border-radius: 16px;
    background: var(--ok); color: #fff; font-size: 12px; font-weight: 650;
    padding: 5px 11px; cursor: pointer; flex: 0 0 auto;
}
.timer-stop:hover { filter: brightness(1.07); }
.timer-stop svg { width: 13px; height: 13px; }

/* Fülek */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab {
    padding: 9px 15px; border: 0; border-bottom: 2px solid transparent; background: transparent;
    color: var(--fg-muted); font-size: 13.5px; font-weight: 600; cursor: pointer; margin-bottom: -1px;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-intro { font-size: 13px; color: var(--fg-muted); margin: 0 0 14px; max-width: 620px; }

/* Időszakválasztó */
.period-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
    background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px;
}
.period-bar b { font-size: 14px; min-width: 150px; }
.period-bar .spacer { flex: 1 1 auto; }
.period-bar input { width: auto; padding: 6px 9px; font-size: 12.5px; }

/* Mai panel */
.today-panel {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
    background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 18px;
}
.today-panel .tp-left { display: flex; align-items: center; gap: 10px; }
.today-panel .tp-left b { display: block; font-size: 14px; }
.today-panel .tp-left span { font-size: 12.5px; color: var(--fg-muted); }
.today-panel .spacer { flex: 1 1 auto; }
.tp-clock { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ok); }

/* Napi fejléc és bejegyzések */
.day-head {
    display: flex; align-items: baseline; gap: 8px; margin: 22px 0 8px;
    padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.day-head b { font-size: 13.5px; }
.day-head .dow { font-size: 11.5px; color: var(--fg-faint); font-weight: 650;
                 background: var(--bg-sunken); padding: 1px 7px; border-radius: 20px; }
.day-head .spacer { flex: 1 1 auto; }
.day-head .day-total { font-size: 13.5px; color: var(--accent); font-variant-numeric: tabular-nums; }

.entry-row {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 5px;
    background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
}
.entry-row:hover { border-color: var(--line-strong); }
.entry-row .e-time { font-size: 12px; color: var(--fg-faint); font-variant-numeric: tabular-nums;
                     flex: 0 0 auto; min-width: 36px; }
.entry-row .e-main { flex: 1 1 auto; min-width: 0; }
.entry-row .e-title { font-size: 13.5px; font-weight: 550; word-break: break-word; }
.entry-row .e-note { font-size: 12px; color: var(--fg-muted); margin-top: 1px; }
.entry-row .e-min { font-size: 13.5px; font-variant-numeric: tabular-nums; flex: 0 0 auto;
                    min-width: 68px; text-align: right; }
.entry-row .e-src { color: var(--fg-faint); display: inline-flex; }
.entry-row .e-src svg { width: 14px; height: 14px; }
.entry-row .icon-btn { width: 28px; height: 28px; opacity: 0; }
.entry-row:hover .icon-btn { opacity: 1; }
@media (hover: none) { .entry-row .icon-btn { opacity: 1; } }

.tracked-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 8px;
    background: var(--ok-soft); color: var(--ok); font-size: 12.5px; font-weight: 650;
}
.tracked-chip svg { width: 14px; height: 14px; }

/* Riportok */
.report-row {
    display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; margin-bottom: 10px;
    background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.report-row .r-main { flex: 1 1 auto; min-width: 0; }
.report-row .r-title { font-size: 14.5px; font-weight: 650; }
.report-row .r-sub { display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
                     font-size: 12px; color: var(--fg-muted); margin: 3px 0 9px; }
.report-row .r-url { display: flex; gap: 6px; align-items: center; }
.report-row .r-url input {
    flex: 1 1 auto; font-size: 12px; padding: 6px 9px; background: var(--bg-sunken);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.report-row .r-actions { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.report-preview { margin-top: 18px; }

/* Beállítások dobozok */
.settings-box {
    background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 20px; margin-bottom: 18px; max-width: 620px;
}
.settings-box h3 { margin: 0 0 6px; font-size: 15.5px; letter-spacing: -.01em; }
.settings-box .md-hint { margin: 0 0 16px; }

.sync-status {
    background: var(--bg-soft); border-radius: var(--radius); padding: 11px 14px; margin-bottom: 16px;
}
.sync-status b { display: block; font-size: 13.5px; }
.sync-status span { font-size: 12px; color: var(--fg-muted); }
.sync-status.warn { background: var(--warn-soft); }
.sync-status .stale-note { margin: 9px 0 0; font-size: 12px; color: var(--warn); line-height: 1.5; }

/* Tömeges kártyalétrehozás */

.bulk-preview { margin: 12px 0 4px; }
.bulk-count {
    display: flex; align-items: center; gap: 6px; margin: 0 0 8px;
    font-size: 13px; font-weight: 650; color: var(--ok);
}
.bulk-count svg { width: 16px; height: 16px; }
.bulk-count.muted { color: var(--fg-muted); font-weight: 400; }
.bulk-count.over { color: var(--danger); }

.bulk-list {
    margin: 0; padding: 10px 10px 10px 30px; list-style: decimal;
    background: var(--bg-soft); border-radius: 8px; border: 1px solid var(--line);
    max-height: 190px; overflow-y: auto;
}
.bulk-list li { font-size: 12.5px; margin-bottom: 4px; color: var(--fg-muted); }
.bulk-list li b { font-weight: 600; color: var(--fg); }
.bulk-list li span { display: block; font-size: 11.5px; opacity: .8;
                     overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-list li.more { list-style: none; margin-left: -14px; font-style: italic; }

.search-filters {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    background: var(--bg-elev); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 12px; margin-bottom: 18px;
}
.search-filters select { width: auto; min-width: 136px; }
.search-filters .q { flex: 1 1 220px; min-width: 180px; }

.task-group { margin-bottom: 22px; }
.task-group > h3 { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 0 0 8px; }
.task-group > h3 .n { font-size: 11.5px; color: var(--fg-faint); font-weight: 600; }

.task-row {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
    background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 6px;
}
.task-row:hover { border-color: var(--line-strong); }
.task-row.done { opacity: .6; }
.task-row.done .t-title { text-decoration: line-through; }
.task-row.done .card-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.task-row .t-main { flex: 1 1 auto; min-width: 0; }
.task-row .t-title { font-size: 13.5px; font-weight: 550; word-break: break-word; }
.task-row .t-sub { font-size: 11.5px; color: var(--fg-muted); margin-top: 2px;
                   display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.task-row .t-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.board-tag { display: inline-flex; align-items: center; gap: 4px; }
.board-tag i { width: 8px; height: 8px; border-radius: 2px; }

.table { width: 100%; border-collapse: collapse; background: var(--bg-elev);
         border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.table th, .table td { padding: 10px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--line); }
.table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-faint);
            background: var(--bg-soft); font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.table td .row-actions { display: flex; gap: 5px; justify-content: flex-end; }
.table .inactive { opacity: .5; }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast-root { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
              display: flex; flex-direction: column; gap: 8px; z-index: 500; pointer-events: none; }
.toast {
    background: var(--fg); color: var(--bg-elev); padding: 10px 16px; border-radius: 22px;
    font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); pointer-events: auto;
    animation: toastIn .18s ease;
}
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* ==========================================================================
   Mobil
   ========================================================================== */

@media (max-width: 860px) {
    .menu-toggle { display: grid; }
    .topnav {
        position: absolute; top: var(--topbar-h); left: 0; right: 0; flex-direction: column;
        background: var(--bg-elev); border-bottom: 1px solid var(--line); padding: 8px; margin: 0; gap: 2px;
        box-shadow: var(--shadow-md); display: none;
    }
    .topnav.open { display: flex; }
    .topnav a { padding: 10px 12px; font-size: 14.5px; }
    .quick-search input { width: 120px; }
    .quick-search input:focus { width: 150px; }
    .brand-name { display: none; }
    .page { padding: 16px 12px 48px; }
    .lists-scroller { padding: 12px; gap: 10px; scroll-snap-type: x mandatory; }
    .list, .add-list { flex-basis: 84vw; width: 84vw; scroll-snap-align: center; }
    .board-head, .filter-bar { padding: 10px 12px; }
    .modal-backdrop { padding: 0; align-items: stretch; }
    .modal { max-width: none; border-radius: 0; min-height: 100%; border: 0; }
    .timer-widget { max-width: 150px; padding-left: 8px; }
    .timer-label { display: none; }
    .timer-stop span { display: none; }
    .report-row { flex-direction: column; }
    .report-row .r-actions { width: 100%; }
    .entry-row { flex-wrap: wrap; }
    .entry-row .e-main { flex-basis: 100%; order: -1; }
    .cal-cell { min-height: 76px; font-size: 11px; }
    .cal-grid { font-size: 11px; }
    .stat b { font-size: 20px; }
}

@media (max-width: 560px) {
    .quick-search { display: none; }
    .cal-card span.ttl { display: none; }
    .cal-cell { min-height: 58px; }
    .cal-card { padding: 2px 4px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
