:root {
	--bg: #16161d;
	--nav: #1a1a22;
	--list: #1e1e27;
	--pane: #22222c;
	--card: #2a2a36;
	--line: #33333f;
	--text: #e7e7ef;
	--muted: #9797aa;
	--accent: #6d5dfc;
	--accent-2: #8b7dff;
	--ok: #3fb68b;
	--warn: #e0a54a;
	--bad: #e5615f;
	--note: #3a3420;
	--note-line: #6b5a26;
	--green: #2f9e6e;
	color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
	background: var(--bg);
	color: var(--text);
	font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
code { background: var(--card); padding: 1px 5px; border-radius: 4px; }
pre { background: #121218; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
h1 { font-size: 18px; margin: 0 0 12px; }
h2 { font-size: 15px; margin: 18px 0 8px; }
h3 { font-size: 14px; margin: 14px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; color: var(--text); }
.mark { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #7ee3b0 0 30%, var(--green) 31%); }

/* tlačítka a formuláře */
.btn {
	display: inline-block; border: 0; border-radius: 6px; padding: 8px 14px;
	background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--accent-2); text-decoration: none; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: transparent; border: 1px solid var(--bad); color: var(--bad); margin-top: 8px; }
.link { background: none; border: 0; padding: 0; color: var(--accent-2); cursor: pointer; font: inherit; }
input, textarea, select {
	width: 100%; background: #18181f; color: var(--text); border: 1px solid var(--line);
	border-radius: 6px; padding: 8px 10px; font: inherit;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.field { display: block; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.field input, .field textarea { margin-top: 4px; font-size: 14px; }
.flash { background: #262246; border: 1px solid var(--accent); border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; }
.flash.error { background: #3a1e22; border-color: var(--bad); }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--card); color: var(--muted); }
.tag.open { background: #262246; color: var(--accent-2); }
.tag.done { background: #1d3a2f; color: var(--ok); }
.tag.warn { background: #3b2f1a; color: var(--warn); }
.tag.bad { background: #3a1e22; color: var(--bad); }

/* přihlášení */
body.login { display: grid; place-items: center; }
.login-box { width: 320px; background: var(--pane); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.login-box .btn { width: 100%; }

/* rozhraní kandidáta: Front */
body.app { display: flex; height: 100vh; overflow: hidden; }
.nav { width: 220px; flex: none; background: var(--nav); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav .brand { padding: 4px 8px 14px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; color: var(--text); }
.nav-item:hover { background: var(--card); text-decoration: none; }
.nav-item.on { background: #2c2a45; }
.nav-item .ic { width: 16px; text-align: center; color: var(--muted); }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--muted); }
.nav-item .count.accent { background: var(--accent); color: #fff; border-radius: 9px; padding: 0 7px; }
.nav-foot { margin-top: auto; padding: 8px; border-top: 1px solid var(--line); }
.nav-foot .who { font-weight: 600; }

.list { width: 300px; flex: none; background: var(--list); border-right: 1px solid var(--line); overflow-y: auto; }
.list-head { padding: 14px 16px; font-weight: 600; border-bottom: 1px solid var(--line); }
.conv { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text); }
.conv:hover { background: var(--pane); text-decoration: none; }
.conv.on { background: #26243b; box-shadow: inset 3px 0 var(--accent); }
.conv-top { display: flex; justify-content: space-between; gap: 8px; }
.conv .from { font-weight: 600; }
.conv.unread .from::before { content: "● "; color: var(--accent-2); }
.conv .time { color: var(--muted); font-size: 12px; }
.conv .subj { font-weight: 600; font-size: 13px; margin: 2px 0 4px; }
.conv.waiting { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.empty { padding: 20px 16px; color: var(--muted); }
.empty.big { padding: 60px 30px; text-align: center; }

.pane { flex: 1; min-width: 0; background: var(--pane); overflow-y: auto; padding: 20px 28px 40px; }
.pane.wide .doc { max-width: 760px; }
.pane-head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; }
.pane-head h1 { margin: 0; }
.banner { position: sticky; top: 0; z-index: 2; background: #262246; border: 1px solid var(--accent); border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; }

.doc p, .doc li { max-width: 70ch; }
.steps li { margin-bottom: 10px; }
.checklist { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; }
.check { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check:has(input:checked) span { color: var(--muted); text-decoration: line-through; }
.start { display: flex; gap: 12px; align-items: center; }

.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.msg.out { border-color: #3c3866; }
.msg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.msg-head .from { font-weight: 600; }
.msg-head .time { margin-left: auto; color: var(--muted); font-size: 12px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #3d5a80; font-size: 11px; font-weight: 700; flex: none; }
.avatar.us { background: var(--green); }
.msg-body { white-space: normal; }
.note { background: var(--note); border: 1px solid var(--note-line); border-radius: 8px; padding: 10px 14px; }
.note-head { font-size: 12px; color: var(--warn); margin-bottom: 4px; }

.composer { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.comp-head { font-size: 13px; display: flex; gap: 6px; align-items: center; }
.chip { background: #2c2a45; color: var(--accent-2); padding: 1px 8px; border-radius: 5px; }
.comp-note { background: var(--note); border: 1px dashed var(--note-line); border-radius: 8px; padding: 8px 10px; }
.comp-note textarea { margin-top: 6px; background: #2a2618; }
.comp-foot { display: flex; justify-content: flex-end; }
.sent { margin-top: 18px; color: var(--muted); display: flex; align-items: center; gap: 10px; }

.side { width: 280px; flex: none; background: #1b1b23; border-left: 1px solid var(--line); padding: 14px; overflow-y: auto; }
.side-head { font-weight: 600; margin-bottom: 12px; }
.card { background: var(--card); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.card-title { font-weight: 600; }

.qa { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.qa-item { background: var(--card); border-radius: 8px; padding: 10px 14px; border-left: 3px solid var(--line); }
.qa-item.answer { border-left-color: var(--ok); }
.ask { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

.spinner { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent-2); border-radius: 50%; animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* admin */
body.admin { overflow-y: auto; }
.admin-bar { display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: var(--nav); border-bottom: 1px solid var(--line); }
.admin-bar form { margin-left: auto; }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 20px 24px 60px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.box { background: var(--pane); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin: 16px 0; }
.box h2 { margin-top: 0; }
.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { color: var(--muted); font-weight: 500; font-size: 12px; }
.cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cols3 .box { margin: 0; }
.form { max-width: 640px; }
.form.compact .field { margin-bottom: 8px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0 0 10px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.expect { margin: 8px 0 14px; background: #1d3a2f; border-radius: 8px; padding: 8px 12px; }
.expect summary { cursor: pointer; color: var(--ok); font-weight: 600; }
.admin-thread .msg { padding: 10px 14px; }
details.job { margin-bottom: 6px; }
details summary { cursor: pointer; }

@media (max-width: 900px) {
	body.app { flex-direction: column; height: auto; overflow: visible; }
	.nav, .list, .side { width: auto; border: 0; border-bottom: 1px solid var(--line); }
	.nav { flex-direction: row; flex-wrap: wrap; }
	.nav-foot { margin: 0; border: 0; }
	.pane { padding: 16px; }
	.cols, .cols3 { grid-template-columns: 1fr; }
}
