/* Design podle polarion.cz: tmavé "space" pozadí, zlatý akcent, Montserrat + Inter, pill tlačítka */
:root {
  --space: #070b14; --polar: #1b3a5f;
  --gold: #c9a45c; --gold-light: #e2c485; --gold-dark: #b08d4c;
  --bg: var(--space); --panel: rgba(255,255,255,.05); --panel-solid: #0e1424;
  --text: #f3f5f9; --muted: #93a0b4; --line: rgba(255,255,255,.1);
  --accent: var(--gold); --accent-soft: rgba(201,164,92,.15);
  --danger: #ef7b7b; --ok: #5fcf9a; --warn: #e6b65a;
  --head: Montserrat, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; display: flex; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; position: relative; }
body::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(600px 400px at 85% -5%, rgba(201,164,92,.16), transparent 70%),
    radial-gradient(700px 500px at -5% 105%, rgba(27,58,95,.45), transparent 70%); }
.side, main { position: relative; z-index: 1; }
a { color: var(--gold-light); }
.side { width: 210px; padding: 22px 14px; position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--line); background: rgba(7,11,20,.7); backdrop-filter: blur(14px); }
.brand { font-family: var(--head); font-weight: 700; font-size: 20px; letter-spacing: .15em; text-transform: uppercase; padding: 0 10px 22px; }
.brand b { font-weight: 700; background: linear-gradient(to right, var(--gold-light), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand small { display: block; font: 500 10px Inter, sans-serif; letter-spacing: .2em; color: var(--muted); margin-top: 2px; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side a { color: var(--muted); text-decoration: none; padding: 9px 14px; border-radius: 8px; font-weight: 500; transition: .15s; }
.side a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.side a.on { background: var(--accent-soft); color: var(--gold-light); box-shadow: inset 0 0 0 1px rgba(201,164,92,.3); }
main { flex: 1; padding: 32px 36px; min-width: 0; }
h1 { font-family: var(--head); font-size: 26px; font-weight: 800; letter-spacing: -.02em; text-transform: uppercase; margin: 0; }
h2 { font-family: var(--head); font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 12px; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.sp { flex: 1; }
.muted { color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; backdrop-filter: blur(10px); }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 14px; }
.cols2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; top: -50px; right: -50px; width: 120px; height: 120px; border-radius: 50%; background: rgba(201,164,92,.1); }
.kpi .v { font-family: var(--head); font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.kpi .s { color: var(--muted); font-size: 12px; }
button, .btn { font: 500 14px Inter, sans-serif; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--text);
  padding: 8px 16px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; transition: .15s; }
button:hover { border-color: rgba(201,164,92,.6); }
button.primary { background: linear-gradient(to right, var(--gold), var(--gold-dark)); border-color: transparent; color: #0a0e18; font-weight: 600;
  box-shadow: 0 0 22px rgba(201,164,92,.35); }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--danger); }
button.ghost { background: transparent; }
button.small { padding: 4px 12px; font-size: 12px; }
input, select, textarea { font: inherit; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(255,255,255,.05); color: var(--text); }
select option { background: var(--panel-solid); color: var(--text); }
input::placeholder, textarea::placeholder { color: #66738a; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,164,92,.18); }
input[type=checkbox] { accent-color: var(--gold); }
.search { max-width: 300px; border-radius: 8px; padding-left: 16px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; transition: .12s; }
tbody tr.click:hover { background: rgba(201,164,92,.07); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--accent-soft); color: var(--gold-light); border: 1px solid rgba(201,164,92,.3); }
.badge.klient { background: rgba(95,207,154,.12); color: var(--ok); border-color: rgba(95,207,154,.3); }
.badge.partner { background: rgba(27,58,95,.55); color: #9cc3f0; border-color: rgba(156,195,240,.3); }
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 6px; background: rgba(255,255,255,.06); border: 1px solid var(--line); margin: 2px 4px 0 0; color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .t { flex: 1; min-width: 0; }
.row.done .t { text-decoration: line-through; color: var(--muted); }
.late { color: var(--danger); font-weight: 600; }
.bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(to right, var(--gold-light), var(--gold-dark)); border-radius: 4px; }
.lines > div { display: grid; grid-template-columns: 120px 1fr 100px; gap: 12px; align-items: center; padding: 6px 0; }
/* kanban */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; align-items: start; padding-bottom: 14px; }
.col { background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: 170px; }
.col.over { border-color: var(--gold); background: var(--accent-soft); }
.col h3 { font-family: var(--head); font-size: 13px; font-weight: 700; margin: 2px 4px 10px; display: flex; justify-content: space-between; gap: 8px; }
.col h3 span { color: var(--muted); font: 400 12px Inter, sans-serif; }
.deal { background: var(--panel-solid); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 8px; cursor: grab; transition: .15s; }
.deal:hover { border-color: rgba(201,164,92,.6); transform: translateY(-1px); }
.deal.dragging { opacity: .4; }
.deal b { display: block; font-weight: 600; }
.deal .m { font-size: 12px; color: var(--gold-light); margin-top: 6px; }
/* detail */
.detail { grid-template-columns: 300px 1fr; align-items: start; }
dl { margin: 0; } dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 12px; } dd { margin: 3px 0 0; }
.note { padding: 12px 0; border-bottom: 1px solid var(--line); white-space: pre-wrap; }
.note small { display: block; color: var(--muted); margin-bottom: 3px; }
dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); color: var(--text); padding: 26px; width: min(460px, 92vw);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 60px rgba(201,164,92,.08); }
dialog::backdrop { background: rgba(3,6,12,.7); backdrop-filter: blur(4px); }
dialog h3 { font-family: var(--head); font-size: 18px; margin: 0 0 14px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; }
.actions { display: flex; gap: 8px; margin-top: 20px; }
.tabs { display: flex; gap: 6px; }
.tabs button.on { background: var(--accent-soft); border-color: rgba(201,164,92,.5); color: var(--gold-light); }
.empty { color: var(--muted); padding: 20px 0; text-align: center; }
.dot { display: none; font-style: normal; background: var(--gold); color: #0a0e18; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 0 7px; margin-left: 6px; }
.dot.show { display: inline-block; }
/* e-mail */
.mail { display: grid; grid-template-columns: 360px 1fr; gap: 14px; align-items: start; }
.maillist { max-height: calc(100vh - 170px); overflow-y: auto; }
.mailrow { padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.mailrow:hover { background: rgba(201,164,92,.07); }
.mailrow.sel { background: var(--accent-soft); }
.mailrow .top { display: flex; justify-content: space-between; gap: 8px; }
.mailrow .subj, .mailrow .snip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mailrow.unread b, .mailrow.unread .subj { color: var(--gold-light); font-weight: 700; }
.mailview { min-height: 300px; }
.mailview iframe { width: 100%; height: 60vh; border: 0; border-radius: 12px; background: #fff; }
.mailtext { white-space: pre-wrap; font: inherit; margin: 0; }
/* chat */
.chat { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: stretch; height: calc(100vh - 150px); }
.chans { overflow-y: auto; }
.chan { padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.chan:hover { color: var(--text); background: rgba(255,255,255,.05); }
.chan.on { background: var(--accent-soft); color: var(--gold-light); }
.chatmain { display: flex; flex-direction: column; padding: 0; min-height: 0; }
.msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; max-width: 78%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.av { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #0a0e18; font-weight: 700; }
.bub { background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; white-space: pre-wrap; word-break: break-word; }
.msg.mine .bub { background: var(--accent-soft); border-color: rgba(201,164,92,.35); }
.bub small { display: block; color: var(--muted); margin-bottom: 2px; }
#send { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
#send textarea { resize: none; border-radius: 10px; }
/* přihlášení + uživatel */
body.auth .side { display: none; }
body.auth main { display: grid; place-items: center; }
.authbox { width: min(400px, 92vw); padding: 28px; }
.brand.big { font-size: 26px; padding: 0 0 18px; text-align: center; }
.err { color: var(--danger); min-height: 18px; margin-top: 10px; }
.side { display: flex; flex-direction: column; }
.side nav { flex: 1; }
.userbox { border-top: 1px solid var(--line); padding-top: 14px; }
.userbox .who { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.userbox .ub { display: flex; gap: 6px; flex-wrap: wrap; }
[hidden] { display: none !important; }
a.plink { color: inherit; text-decoration: none; }
a.plink:hover { background: rgba(201,164,92,.06); }
.col.won { border-color: rgba(95,207,154,.35); }
.col.won h3 { color: var(--ok); }
.col.lost { border-color: rgba(239,123,123,.3); }
.col.lost h3 { color: var(--danger); }
.strow { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.strow input { flex: 1; min-width: 0; }
.strow select { width: 120px; flex: none; }
.strow button:disabled { opacity: .35; cursor: default; }
@media (max-width: 800px) {
  .mail, .chat { grid-template-columns: 1fr; height: auto; } .maillist { max-height: 300px; } .msgs { max-height: 55vh; }
  .detail { grid-template-columns: 1fr; } body { flex-direction: column; }
  .side { width: auto; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
  .side nav { flex-direction: row; flex-wrap: wrap; } main { padding: 18px; }
}

/* přehled: provize, trychtýř, aktivita */
.big { font-family: var(--head); font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.big.sm { font-size: 22px; margin: 2px 0; }
.cats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.cat { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.delta { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }
.fbar { margin: 0 auto; min-width: 150px; display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-radius: 8px;
  background: linear-gradient(to right, var(--gold-light), var(--gold-dark)); color: #1a1405; font-weight: 600; }
.fconv { text-align: center; font-size: 11px; color: var(--muted); margin: 3px 0; }
.strow select[data-step] { width: 120px; }
.pie-wrap { display: flex; align-items: center; gap: 22px; margin-top: 16px; flex-wrap: wrap; }
.pie { width: 130px; height: 130px; border-radius: 50%; flex: none; -webkit-mask: radial-gradient(circle, transparent 38px, #000 39px); mask: radial-gradient(circle, transparent 38px, #000 39px); }
.pie-leg { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 13px; }
.pie-leg i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.est { margin: 10px 0 2px; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); border: 1px solid rgba(201,164,92,.3); font-size: 13px; }
.est button { margin-left: 8px; }
.badge.studeny { background: rgba(120,170,230,.12); color: #8fbdf0; border-color: rgba(120,170,230,.3); }
.dotc { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.av { overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gear { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.gear:hover { color: var(--gold-light); background: rgba(255,255,255,.06); }
