/* WiseLogic Podpora — schéma WiseLogic „Grafit a mandarínka“ (ako Akadémia), písmo Ubuntu. Bez CDN (CSP self).
   Svetlý aj tmavý režim (systém + prepínač), mobil od 360 px bez vodorovného posúvania stránky. */
@font-face { font-family: "Ubuntu"; src: url("fonts/ubuntu.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Ubuntu Sans"; src: url("fonts/ubuntusans.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --navy-1: #121417; --navy-2: #1C2026; --navy-3: #262B33;
  --acc: #C2490B; --acc-h: #A33C08; --acc-ink: #FFFFFF; --acc-soft: #FFE6D5; --acc-text: #8A3300; --link: #B04209;
  --bg: #F4F3F0; --surface: #FFFFFF; --surface-2: #EEECE7; --col: #E9E7E2; --line: #E2DFD8; --line-2: #CFCBC2;
  --ink: #1C2026; --ink-2: #535A66; --muted: #5F6670;
  --ok: #2A6E2E; --ok-bg: #E4F1E4; --info: #1F66C9; --info-bg: #E5EEFC; --warn: #8A6100; --warn-bg: #FBF0D6;
  --bad: #B42318; --bad-bg: #FDE7E5; --neutral-bg: #EEECE7;
  --shadow-sm: 0 1px 2px rgba(28,32,38,.07), 0 1px 1px rgba(28,32,38,.04);
  --shadow: 0 6px 20px -8px rgba(28,32,38,.25);
  --r-sm: 8px; --r: 12px;
  --font: "Ubuntu Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-h: "Ubuntu", "Ubuntu Sans", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --acc: #FF8A3D; --acc-h: #FFA766; --acc-ink: #121417; --acc-soft: #3A2210; --acc-text: #FFC299; --link: #FF9C57;
    --bg: #111316; --surface: #1B1E23; --surface-2: #23272D; --col: #16191D; --line: #2A2E35; --line-2: #3A3F48;
    --ink: #ECEEF1; --ink-2: #C9CED6; --muted: #9AA1AB;
    --ok: #7CC47F; --ok-bg: #16301A; --info: #7DB5FF; --info-bg: #132845; --warn: #E5B53A; --warn-bg: #35280C;
    --bad: #F07167; --bad-bg: #3A1513; --neutral-bg: #23272D;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.45); --shadow: 0 8px 24px -8px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --acc: #FF8A3D; --acc-h: #FFA766; --acc-ink: #121417; --acc-soft: #3A2210; --acc-text: #FFC299; --link: #FF9C57;
  --bg: #111316; --surface: #1B1E23; --surface-2: #23272D; --col: #16191D; --line: #2A2E35; --line-2: #3A3F48;
  --ink: #ECEEF1; --ink-2: #C9CED6; --muted: #9AA1AB;
  --ok: #7CC47F; --ok-bg: #16301A; --info: #7DB5FF; --info-bg: #132845; --warn: #E5B53A; --warn-bg: #35280C;
  --bad: #F07167; --bad-bg: #3A1513; --neutral-bg: #23272D;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.45); --shadow: 0 8px 24px -8px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--font); -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--acc) 60%, transparent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-h); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); overflow-wrap: anywhere; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .nowrap { white-space: nowrap; }
.inline { display: inline; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--acc); color: var(--acc-ink); padding: 8px 14px; border-radius: var(--r-sm); z-index: 99; }
.skip:focus { left: 12px; }
.eyebrow { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--acc-text); font-weight: 600; margin-bottom: .3em; }

/* hlavička — vždy grafitová */
.top { position: sticky; top: 0; z-index: 30; background: rgba(18,20,23,.96); color: #fff; border-bottom: 1px solid rgba(255,255,255,.07); }
.top-in { max-width: 1680px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 14px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; flex: none; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; display: block; }
.brand-t { display: flex; flex-direction: column; line-height: 1.1; font-family: var(--font-h); }
.brand-t strong { font-weight: 600; font-size: .98rem; }
.brand-t span { font-size: .74rem; color: #AEB4BD; }
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: #C9CED6; padding: 8px 11px; border-radius: 8px; font-size: .9rem; font-weight: 500; white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav a[aria-current="page"] { color: #fff; background: rgba(255,138,61,.16); box-shadow: inset 0 -2px 0 #FF8A3D; }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.who { font-size: .84rem; color: #C9CED6; }
.iconbtn { appearance: none; background: none; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; width: 34px; height: 34px;
  display: grid; place-items: center; cursor: pointer; color: #E6E8EB; }
.iconbtn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.iconbtn:hover { background: rgba(255,255,255,.08); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: none; } :root:not([data-theme="light"]) .i-moon { display: block; } }
.top .pill { color: #E6E8EB; border-color: rgba(255,255,255,.18); }
.top .pill:hover { background: rgba(255,255,255,.08); }

/* tlačidlá, formuláre */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--acc);
  background: var(--acc); color: var(--acc-ink); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--acc-h); border-color: var(--acc-h); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 11px; font-size: .82rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; width: 100%; }
.pill { appearance: none; background: none; font: inherit; font-size: .82rem; font-weight: 600; color: var(--ink); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.linkbtn { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
label { font-size: .8rem; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 3px; }
input[type=text], input[type=search], input[type=date], select, textarea {
  font: inherit; font-size: .92rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 7px 10px; width: 100%; min-width: 0; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 22%, transparent); }
.field { margin-bottom: 12px; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.flash { padding: 10px 14px; border-radius: var(--r-sm); margin: 0 0 14px; font-size: .9rem; }
.flash.err { background: var(--bad-bg); color: var(--bad); }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.info { background: var(--info-bg); color: var(--info); }
.msg { font-size: .82rem; min-height: 1.2em; }
.msg.ok { color: var(--ok); } .msg.err { color: var(--bad); }

/* rozloženie */
.main { flex: 1; width: 100%; max-width: 1680px; margin: 0 auto; padding: 20px 16px 48px; }
.main.narrow { max-width: 1100px; }
.foot { border-top: 1px solid var(--line); padding: 14px 16px; color: var(--muted); font-size: .78rem; display: flex; gap: 6px 20px; flex-wrap: wrap; justify-content: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-sm); }
.card.narrow { max-width: 520px; margin: 40px auto; }
.pagehead { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.pagehead h1 { margin: 0; }
.tbl-wrap { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* štítky */
.proj { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; color: var(--ink-2); max-width: 100%; }
.proj::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c, #6B7280); flex: none; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--neutral-bg); color: var(--ink-2); white-space: nowrap; }
.badge.p-critical { background: var(--bad); color: #fff; }
.badge.p-high { background: var(--bad-bg); color: var(--bad); }
.badge.p-medium { background: var(--warn-bg); color: var(--warn); }
.badge.p-low { background: var(--neutral-bg); color: var(--muted); }
.badge.auto { background: var(--info-bg); color: var(--info); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.err { background: var(--bad-bg); color: var(--bad); }
.tag { display: inline-block; font-size: .72rem; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--ink-2); }

/* filtre */
.filters { display: grid; gap: 8px; grid-template-columns: 2fr repeat(5, minmax(0, 1fr)) auto; align-items: end; margin-bottom: 14px; }
.filters label { margin-bottom: 2px; }
.filters .act { display: flex; gap: 6px; }
@media (max-width: 1100px) { .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } .filters .q { grid-column: 1 / -1; } }
@media (max-width: 560px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* kanban */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
.col { background: var(--col); border-radius: var(--r); padding: 8px; min-width: 0; border: 1px solid transparent; }
.col.over { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 8%, var(--col)); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 8px; font-family: var(--font-h); font-weight: 600; font-size: .92rem; }
.col-h .n { margin-left: auto; font-family: var(--font); font-size: .78rem; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 0 8px; }
.col-h .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.st-novy .dot { background: #2F80ED; } .st-todo .dot { background: #8A94A3; } .st-in_progress .dot { background: var(--acc); }
.st-caka .dot { background: #D4A100; } .st-done .dot { background: #2A9D4B; } .st-tested .dot { background: #1E7B3A; } .st-zrusene .dot { background: #9AA1AB; }
.cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.empty { font-size: .8rem; color: var(--muted); text-align: center; padding: 10px 4px; border: 1px dashed var(--line-2); border-radius: var(--r-sm); }
.cards:has(.karta) .empty { display: none; }
.karta { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; box-shadow: var(--shadow-sm); cursor: grab; position: relative; min-width: 0; }
.karta:hover { border-color: var(--line-2); }
.karta.dragging { opacity: .45; }
.karta.saving { opacity: .7; }
.karta.p-critical { border-left: 3px solid var(--bad); }
.karta.p-high { border-left: 3px solid color-mix(in srgb, var(--bad) 55%, transparent); }
.k-top { display: flex; align-items: center; gap: 6px; justify-content: space-between; margin-bottom: 3px; min-width: 0; }
.k-top .proj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-title { display: block; color: var(--ink); font-weight: 600; font-size: .9rem; line-height: 1.35; overflow-wrap: anywhere; }
.k-title:hover { color: var(--link); }
.k-meta { display: flex; flex-wrap: wrap; gap: 3px 10px; margin-top: 6px; font-size: .75rem; color: var(--muted); align-items: center; }
.k-meta .late { color: var(--bad); font-weight: 600; }
.k-ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; overflow-wrap: anywhere; }
.k-move { display: flex; gap: 4px; margin-top: 6px; justify-content: flex-end; }
.k-move button { appearance: none; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 6px; font: inherit;
  font-size: .75rem; padding: 1px 8px; cursor: pointer; line-height: 1.6; }
.k-move button:hover { border-color: var(--acc); color: var(--acc-text); }
.k-move button:disabled { opacity: .35; cursor: default; }
.board-rest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
details.col > summary { list-style: none; cursor: pointer; }
details.col > summary::-webkit-details-marker { display: none; }
details.col > summary .col-h::after { content: "▸"; color: var(--muted); font-size: .8rem; }
details.col[open] > summary .col-h::after { content: "▾"; }
details.col .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--navy-2); color: #fff; padding: 9px 16px;
  border-radius: 10px; font-size: .88rem; box-shadow: var(--shadow); z-index: 50; max-width: calc(100vw - 32px); }
.toast.err { background: var(--bad); }
@media (max-width: 1180px) { .board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .board, .board-rest { grid-template-columns: minmax(0, 1fr); }
  .karta { cursor: default; }
  details.col .cards { grid-template-columns: minmax(0, 1fr); }
}

/* detail tasku */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: minmax(0, 1fr); } }
.side .field select, .side .field input { font-size: .9rem; }
.side dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: .86rem; }
.side dt { color: var(--muted); }
.side dd { margin: 0; overflow-wrap: anywhere; }
.save-state { font-size: .78rem; color: var(--muted); min-height: 1.2em; }
.save-state.ok { color: var(--ok); } .save-state.err { color: var(--bad); }
.md { overflow-wrap: anywhere; }
.md pre { background: var(--surface-2); padding: 10px; border-radius: var(--r-sm); overflow-x: auto; font-size: .85rem; }
.md code { font-size: .88em; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.md pre code { background: none; padding: 0; }
.md img { max-width: 100%; }
.md table { font-size: .85rem; }
.section { margin-top: 18px; }
.note { border-top: 1px solid var(--line); padding: 10px 0; }
.note:first-child { border-top: 0; }
.note-h { font-size: .8rem; color: var(--muted); margin-bottom: 3px; }
.note-h strong { color: var(--ink); }
.acts { list-style: none; margin: 0; padding: 0; font-size: .84rem; }
.acts li { padding: 6px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; }
.acts li:first-child { border-top: 0; }
@media (max-width: 560px) { .acts li { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.src-box { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; font-size: .86rem; }

/* projekty, členovia */
.st-cell { font-variant-numeric: tabular-nums; }
.members { display: grid; gap: 10px; }
.member { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: end; }
.member.off { opacity: .65; }
.members .member + .member { border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 900px) { .member { grid-template-columns: repeat(2, minmax(0, 1fr)); } .member .act { grid-column: 1 / -1; } }

/* prihlásenie */
.login-body .main { display: grid; place-items: center; }
.auth { max-width: 440px; width: 100%; margin: 24px auto; text-align: center; }
.auth .wl { width: 52px; height: 52px; margin: 0 auto 10px; display: block; }
.qr-frame { background: #fff; display: inline-block; padding: 12px; border-radius: 14px; border: 1px solid var(--line); margin: 8px 0 12px; }
.qr-frame img { display: block; width: 232px; height: 232px; image-rendering: pixelated; }
.qr-label { margin: 0; font-size: .85rem; color: var(--muted); }
.qr-num { font-family: var(--font-h); font-size: 2.6rem; font-weight: 700; margin: 0 0 6px; color: var(--acc-text); }
.qr-state { font-size: .9rem; }
.qr-state.ok { color: var(--ok); } .qr-state.err { color: var(--bad); }

/* hlavička na mobile: menu do druhého riadku, meno skryté (je v tooltipe tlačidla Odhlásiť) */
@media (max-width: 760px) {
  .top-in { flex-wrap: wrap; gap: 6px 10px; padding-top: 8px; padding-bottom: 6px; }
  .nav { order: 3; flex: 1 0 100%; }
  .who { display: none; }
  .brand-t span { display: none; }
}
