/* Sleepyo tvorcovia - vzhľad podľa CLAUDE.md: Quicksand, Cream pozadie, Forest Green nadpisy a tlačidlá,
   Gold len jemné akcenty, čierny text, Mint len obrys na zelenom (nikdy na krémovej/bielej, nikdy plocha). */
:root {
  --green: #4D6B58;
  --cream: #F7F2EA;
  --gold: #D6B98A;
  --black: #000000;
  --white: #FFFFFF;
  --mint: #00FFA3;
  --line: rgba(0, 0, 0, .12);
  --muted: rgba(0, 0, 0, .62);
  --tint: rgba(77, 107, 88, .09);
  --alert: #A4462F;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--cream);
  color: var(--black);
  font: 500 15px/1.5 Quicksand, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--green); font-weight: 700; line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 24px; } h2 { font-size: 19px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
a { color: var(--green); font-weight: 600; }
p { margin: 0 0 .6em; }
small, .muted { color: var(--muted); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- tlačidlá ---------- */
.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: var(--green); color: var(--cream); border: 0; border-radius: 999px;
  padding: 9px 18px; min-height: 40px; text-decoration: none; white-space: nowrap;
}
.btn:hover, .btn:focus-visible { outline: 2px solid var(--mint); outline-offset: -5px; }
.btn.ghost { background: transparent; color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
.btn.ghost:hover, .btn.ghost:focus-visible { outline: none; background: var(--tint); }
.btn.quiet { background: transparent; color: var(--green); padding: 6px 10px; min-height: 32px; }
.btn.quiet:hover, .btn.quiet:focus-visible { outline: none; background: var(--tint); }
.btn.danger { background: transparent; color: var(--alert); box-shadow: inset 0 0 0 1.5px var(--alert); }
.btn.danger:hover, .btn.danger:focus-visible { outline: none; background: rgba(164, 70, 47, .08); }
.btn.small { padding: 5px 12px; min-height: 32px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; outline: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- formuláre ---------- */
label.field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea {
  font: inherit; font-weight: 500; color: var(--black); background: var(--white);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; width: 100%; min-height: 40px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 2px var(--tint); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--green); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 14px; }
.form-grid .wide { grid-column: 1 / -1; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { color: var(--green); font-weight: 700; font-size: 15px; margin-bottom: 8px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 10px; background: var(--white); font-size: 13px; cursor: pointer; }
.chip input { width: 14px; height: 14px; }
.chip.on { border-color: var(--green); background: var(--tint); }

/* ---------- karty, mriežky ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card.click { cursor: pointer; }
.card.click:hover { border-color: var(--green); }
.grid { display: grid; gap: 14px; }
.grid.cols { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.kpi b { display: block; font-size: 22px; color: var(--green); font-weight: 700; }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi.accent { border-top: 3px solid var(--gold); }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty .oko { margin: 0 auto 8px; }

/* ---------- štítky ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; background: rgba(0,0,0,.06); color: var(--black); }
.badge.green { background: var(--green); color: var(--cream); }
.badge.ring { background: var(--green); color: var(--cream); box-shadow: inset 0 0 0 2px var(--mint); }
.badge.gold { background: var(--gold); color: var(--black); }
.badge.line { background: transparent; color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
.badge.off { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.badge.alert { background: transparent; color: var(--alert); box-shadow: inset 0 0 0 1.5px var(--alert); }
.badge.sample { background: var(--gold); color: var(--black); letter-spacing: .04em; }
.alert-text { color: var(--alert); font-weight: 700; }

/* ---------- avatar a oko ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--green); color: var(--cream); display: grid; place-items: center; font-weight: 700; flex: none; letter-spacing: .02em; }
.avatar.big { width: 68px; height: 68px; font-size: 22px; }
.oko { display: block; }

/* ---------- tabuľky ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; background: var(--white); position: sticky; top: 0; }
th.sort { cursor: pointer; } th.sort:hover { color: var(--green); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--tint); }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- záložky ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1.5px solid var(--line); margin: 6px 0 16px; scrollbar-width: none; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 700; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.tabs a.on { color: var(--green); border-bottom-color: var(--green); }
.seg { display: inline-flex; border: 1.5px solid var(--green); border-radius: 999px; overflow: hidden; }
.seg button { font: inherit; font-weight: 700; font-size: 13px; border: 0; background: transparent; color: var(--green); padding: 6px 14px; cursor: pointer; }
.seg button.on { background: var(--green); color: var(--cream); }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(205px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kcol { background: var(--tint); border-radius: var(--r); padding: 10px; min-height: 120px; }
.kcol h4 { display: flex; justify-content: space-between; margin: 2px 4px 10px; }
.kcol.drop { outline: 2px dashed var(--green); outline-offset: -4px; }
.kcard { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; font-size: 14px; }
.kcard:hover { border-color: var(--green); }
.kcard.dragging { opacity: .5; }
.kcard .t { font-weight: 700; }

/* ---------- priebeh, časová os ---------- */
.progress { height: 6px; border-radius: 999px; background: rgba(0,0,0,.08); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--green); }
.timeline { display: grid; gap: 10px; }
.msg { border-radius: 14px; padding: 10px 12px; background: var(--white); border: 1px solid var(--line); max-width: 680px; }
.msg.in { border-left: 3px solid var(--gold); }
.msg.out { border-left: 3px solid var(--green); }
.msg.note { background: transparent; border-style: dashed; }
.msg .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.msg .body { white-space: pre-wrap; word-break: break-word; }
.dates { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.dates div { background: var(--tint); border-radius: 10px; padding: 8px 10px; }
.dates b { display: block; font-size: 15px; }
.dates span { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- knižnica ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.media { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.media .thumb { aspect-ratio: 9 / 12; background: var(--tint); display: grid; place-items: center; color: var(--green); font-weight: 700; overflow: hidden; }
.media .thumb img, .media .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media .info { padding: 8px 10px; font-size: 13px; display: grid; gap: 4px; }
.media .name { font-weight: 700; word-break: break-all; }

/* ---------- rebríček ---------- */
.rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: rgba(0,0,0,.06); }
.rank.r1, .rank.r2, .rank.r3 { background: var(--gold); }
.bar { height: 8px; border-radius: 999px; background: var(--green); min-width: 2px; }

/* ---------- modálne okno, hláška ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--cream); color: var(--black); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--cream); z-index: 1; }
.dlg-head h2 { margin: 0; flex: 1; }
.dlg-body { padding: 18px; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--cream); }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--green); color: var(--cream); padding: 10px 18px; border-radius: 999px; font-weight: 700; z-index: 99; max-width: calc(100vw - 32px); }
#toast.err { background: var(--black); }

/* ---------- rozloženie správcu ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--green); color: var(--cream); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.logo-field { background: var(--cream); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-decoration: none; }
.logo-field img { height: 34px; width: auto; display: block; }
.logo-field span { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--green); }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-weight: 600; padding: 9px 12px; border-radius: 10px; position: relative; }
.nav a:hover { background: rgba(247, 242, 234, .1); }
.nav a.on { background: rgba(247, 242, 234, .16); font-weight: 700; }
.nav a.on::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--mint); }
.nav .count { margin-left: auto; background: var(--cream); color: var(--green); border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.side .who { margin-top: auto; font-size: 13px; padding: 10px 12px; border-top: 1px solid rgba(247, 242, 234, .2); }
.side .who button { font: inherit; color: var(--cream); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; font-weight: 600; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 10px; padding: 18px 26px 6px; flex-wrap: wrap; }
.top h1 { margin: 0; flex: 1; min-width: 200px; }
.bell { position: relative; }
.bell .dot { position: absolute; top: -4px; right: -4px; background: var(--gold); color: var(--black); font-size: 11px; border-radius: 999px; padding: 0 6px; font-weight: 700; }
.view { padding: 10px 26px 40px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters > * { width: auto; }
.filters input[type=search] { min-width: 200px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.section-title h2 { margin: 0; flex: 1; }
.matrix td, .matrix th { text-align: center; }
.matrix td.ok { background: var(--tint); color: var(--green); font-weight: 700; }
.matrix td.low { color: var(--alert); font-weight: 700; }

/* ---------- prihlásenie ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(420px, 100%); padding: 26px; display: grid; gap: 14px; }
.login .logo { height: 46px; width: auto; }

/* ---------- portál tvorcu ---------- */
.portal-top { background: var(--green); color: var(--cream); }
.portal-top .in { max-width: 920px; margin: auto; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.portal-top .logo-field { margin: 0; padding: 8px 12px; }
.portal-top .logo-field img { height: 26px; }
.portal { max-width: 920px; margin: auto; padding: 20px 16px 60px; display: grid; gap: 18px; }
.drop-zone { border: 2px dashed var(--green); border-radius: var(--r); padding: 18px; text-align: center; background: var(--white); }
.drop-zone.over { background: var(--tint); }
.upl { display: grid; gap: 4px; font-size: 13px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; gap: 8px; overflow-x: auto; }
  .logo-field { margin: 0; padding: 6px 10px; flex: none; }
  .logo-field img { height: 22px; }
  .logo-field span { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { padding: 7px 10px; white-space: nowrap; font-size: 14px; }
  .nav a.on::before { left: 8px; right: 8px; top: auto; bottom: 2px; width: auto; height: 3px; }
  .side .who { display: none; }
  .top { padding: 14px 16px 4px; }
  .view { padding: 8px 16px 40px; }
  .filters > * { flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
