/* APP Učebna – styly odvozené z návrhu v app_lms.pen */
:root {
  --bg: #F5F4EF;
  --surface: #FFFFFF;
  --ink: #16201D;
  --muted: #5F6B67;
  --faint: #9AA39F;
  --line: #E4E2DA;
  --accent: #145C4C;
  --accent-soft: #E3EFEA;
  --accent-tint: #F4F9F7;
  --warn: #B5541C;
  --warn-soft: #FBEBDD;
  --ok: #1E7A4E;
  --ok-soft: #E3F3EA;
  --blue: #2D4E9A;
  --blue-soft: #E6ECF8;
  --ochre: #7A5A12;
  --ochre-soft: #F3EEDF;
  --chip-bg: #EAE8E0;
  --subtle: #FAF9F6;
  --font-ui: "Open Sans", system-ui, sans-serif;
  --font-display: "Open Sans", system-ui, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.icon { display: inline-block; flex: none; stroke-width: 2; vertical-align: middle; }
.muted { color: var(--muted); }
.warn-text { color: var(--warn); }
.ok-text { color: var(--ok); }
.accent-text { color: var(--accent); }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ----------------------------------------------------------------- layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 28px; padding: 28px 20px;
  background: var(--surface); border-right: 1px solid var(--line);
}
.main { flex: 1; min-width: 0; padding: 28px 40px 40px; display: flex; flex-direction: column; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.logo-text { font-family: var(--font-display); font-size: 25px; font-weight: 700; letter-spacing: -2px; color: var(--accent); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; font-weight: 500; color: var(--ink); }
.nav-item .icon { color: var(--muted); }
.nav-item:hover { background: var(--subtle); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav-item.is-active .icon { color: var(--accent); }
.nav-badge { margin-left: auto; min-width: 21px; padding: 2px 7px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.nav-item.is-active .nav-badge { background: var(--accent); }
.sidebar-spacer { flex: 1; }
.streak-card { background: var(--accent); color: #fff; border-radius: 12px; padding: 16px; }
.streak-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.streak-card .flame { color: #F2A25C; }
.streak-card p { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--bg); }
.user-block { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.user-block:hover, .user-block.is-active { background: var(--accent-soft); }
.user-block.is-active strong, .user-block.is-active .icon { color: var(--accent); }
.user-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.user-text strong { font-size: 13px; }
.user-text small { font-size: 12px; color: var(--muted); }
.user-block > .icon { color: var(--muted); }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 800; flex: none; letter-spacing: .02em; }
.avatar-photo { background-repeat: no-repeat; background-color: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(22,32,29,.08); }

/* -------------------------------------------------------------- typography */
.h-display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.5px; }
.page-header { display: flex; align-items: flex-end; gap: 24px; }
.page-header .title-block { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; color: var(--muted); text-transform: uppercase; }
.page-title { font-family: var(--font-display); font-size: 36px; font-weight: 500; letter-spacing: -0.5px; line-height: 1.15; }
.section-title { font-family: var(--font-display); font-size: 22px; font-weight: 500; }
.card-title { font-family: var(--font-display); font-size: 18px; font-weight: 500; }
.label-caps { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.stats { display: flex; gap: 28px; align-items: flex-end; }
.stat { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.stat strong { font-family: var(--font-display); font-size: 24px; font-weight: 500; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.is-warn strong, .stat.is-warn span { color: var(--warn); }
.stat.is-warn span, .stat.is-accent span { font-weight: 700; }
.stat.is-accent strong, .stat.is-accent span { color: var(--accent); }

/* ------------------------------------------------------------- components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head small { font-size: 12px; font-weight: 600; color: var(--muted); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; }
.gap-14 { gap: 14px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; } .gap-28 { gap: 28px; }
.grow { flex: 1; min-width: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #CFCBBF; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #0F4D3F; border-color: #0F4D3F; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-soft { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.btn-danger-link { background: none; border: none; color: var(--warn); font-weight: 700; font-size: 12px; cursor: pointer; padding: 0; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { color: var(--accent); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pill-muted { background: #F2F1EC; color: var(--muted); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-green { background: var(--ok-soft); color: var(--ok); }
.pill-ochre { background: var(--ochre-soft); color: var(--ochre); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-dark { background: var(--ink); color: #fff; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--chip-bg); height: 40px; align-items: stretch; }
.segmented a, .segmented button { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); border: none; background: none; cursor: pointer; }
.segmented .is-on { background: var(--surface); color: var(--ink); font-weight: 700; }
.segmented small { font-size: 11px; font-weight: 700; color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 600; }
.chip small { color: var(--muted); font-weight: 700; font-size: 11px; }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.chip.is-on small { color: #B9C4C0; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.search input { border: none; outline: none; background: transparent; width: 100%; font-size: 13px; }
.search .icon { color: var(--muted); }
.select { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; }
.input, .textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; outline: none; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { min-height: 70px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.progress { height: 6px; border-radius: 3px; background: #ECEAE3; overflow: hidden; flex: 1; }
.progress > span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.code-badge { display: inline-grid; place-items: center; border-radius: 10px; font-size: 10px; font-weight: 800; letter-spacing: .4px; flex: none; }
.icon-box { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; flex: none; }
.divider-row + .divider-row { border-top: 1px solid var(--line); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px; color: var(--muted); text-align: center; }
.empty-state.big { padding: 80px 20px; }
.empty-state.big .h-display { font-size: 30px; color: var(--ink); }
.flash { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 10px; font-weight: 600; font-size: 13px; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--warn-soft); color: var(--warn); }
.toggle { position: relative; width: 34px; height: 20px; flex: none; display: inline-block; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 10px; background: #D9D6CC; transition: background .15s; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(14px); }
.toggle input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

/* -------------------------------------------------------------- grades */
.grade-chip { position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; font-family: var(--font-display); font-size: 15px; font-weight: 600; flex: none; }
.grade-new { position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.grade-badge { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-family: var(--font-display); font-size: 15px; font-weight: 600; }

/* ------------------------------------------------------------ tables */
.table { width: 100%; border-collapse: collapse; }
.table-card { overflow: hidden; }
.table th { text-align: left; padding: 10px 16px; font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); background: var(--subtle); border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .num { text-align: right; }
.table tr.is-selected td { background: #FFF8F0; }
.table tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.table tr.row-link { cursor: pointer; }
.table tr.row-link:hover td { background: var(--subtle); }

/* ----------------------------------------------------------- dashboard */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.two-col.wide-side { grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; }
.hero {
  display: flex; border-radius: 16px; overflow: hidden; background: var(--accent); color: #fff; min-height: 220px;
}
.hero-art { width: 260px; flex: none; position: relative; overflow: hidden; background: #2A7A66; }
.hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-body { flex: 1; padding: 28px 32px; display: flex; flex-direction: column; gap: 10px; }
.hero .eyebrow { color: #9FD1C1; font-size: 11px; letter-spacing: 1.4px; }
.hero h2 { font-family: var(--font-display); font-size: 26px; font-weight: 500; line-height: 1.2; }
.hero p { color: #D3E6DF; }
.hero .progress { background: rgba(255,255,255,.2); }
.hero .progress > span { background: #fff; }
.hero .btn { background: #fff; border-color: #fff; color: var(--accent); }
.list-row { display: flex; align-items: center; gap: 12px; }
.deadline-badge { width: 44px; height: 48px; border-radius: 10px; background: #F2F1EC; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.deadline-badge strong { font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1.1; }
.deadline-badge small { font-size: 9px; font-weight: 700; letter-spacing: .8px; color: var(--muted); text-transform: uppercase; }
.deadline-badge.is-urgent { background: var(--warn-soft); color: var(--warn); }
.deadline-badge.is-urgent small { color: var(--warn); }
.timeline-item { display: flex; gap: 12px; padding: 10px 12px; border-radius: 10px; }
.timeline-item.is-now { background: var(--accent-soft); }
.timeline-item.is-past { color: var(--faint); }
.timeline-item .time { font-size: 12px; font-weight: 700; width: 38px; flex: none; }
.timeline-item .body { flex: 1; padding-left: 12px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.timeline-item.is-now .body { border-left-color: var(--accent); }
.timeline-item.is-now .time { color: var(--accent); }
.timeline-item.is-cancelled .title { text-decoration: line-through; }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 150px; flex: 1; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; }
.bar-col .bar { width: 100%; border-radius: 6px 6px 2px 2px; background: #BFD6CD; min-height: 4px; }
.bar-col.is-today .bar { background: var(--accent); }
.bar-col.is-empty .bar { background: #ECEAE3; }
.bar-col small { font-size: 11px; font-weight: 600; color: var(--muted); }
.bar-col.is-today small { color: var(--accent); }
.bar-col span { font-size: 12px; color: var(--muted); }
.bar-col.is-today span { color: var(--ink); font-weight: 800; }

/* ----------------------------------------------------------- course cards */
.course-overview { display: flex; align-items: center; gap: 22px; padding: 22px 24px; }
.course-overview-symbol { width: 72px; height: 72px; flex: none; display: grid; place-items: center; border-radius: 14px; }
.course-overview-symbol img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.course-overview-top { justify-content: space-between; font-size: 13px; }
.course-overview-top > span { flex: none; white-space: nowrap; }
.course-overview .progress { flex: none; width: 100%; }
.course-description { font-size: 13px; line-height: 1.55; }
.course-learning { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.lesson-panel { overflow: hidden; }
.lesson-panel-head { padding: 26px 28px; display: flex; flex-direction: column; gap: 10px; }
.lesson-panel-head h2 { font-family: var(--font-display); font-size: 28px; font-weight: 500; line-height: 1.2; }
.lesson-panel-body { min-height: 180px; padding: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.lesson-copy { max-width: 70ch; font-size: 15px; line-height: 1.75; white-space: normal; }
.lesson-panel-foot { display: flex; justify-content: flex-end; align-items: center; padding: 18px 28px; border-top: 1px solid var(--line); }
.course-outline { position: sticky; top: 28px; display: flex; flex-direction: column; gap: 20px; max-height: calc(100vh - 56px); overflow-y: auto; }
.course-outline section { border-top: 1px solid var(--line); padding-top: 14px; }
.course-outline h3 { font-size: 12px; font-weight: 800; }
.outline-lesson { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px; border-radius: 9px; font-size: 12px; }
.outline-lesson:hover { background: var(--subtle); }
.outline-lesson.is-selected { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.outline-lesson span { min-width: 0; }
.outline-lesson small { flex: none; font-size: 10px; color: var(--muted); }
.course-resources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.course-resource { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.course-resource strong, .course-resource small { display: block; font-size: 12px; }
.course-resource small { margin-top: 3px; }
.course-resource:hover strong { color: var(--accent); }
.course-grid { display: grid; gap: 16px; }
.course-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.course-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.course-card { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s; }
.course-card:hover { border-color: #CFCBBF; box-shadow: 0 6px 18px rgba(22,32,29,.06); }
.course-cover { height: 92px; padding: 16px; display: flex; justify-content: space-between; position: relative; overflow: hidden; }
.course-cover-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.course-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,rgba(22,32,29,.08),rgba(22,32,29,.25)); pointer-events: none; }
.course-cover .icon-box, .course-cover .code { position: relative; z-index: 1; }
.course-cover .icon-box { width: 40px; height: 40px; background: rgba(255,255,255,.9); border-radius: 10px; }
.course-cover .code { align-self: flex-start; text-align: right; font-size: 11px; line-height: 1.5; color: #fff; background: rgba(22,32,29,.65); padding: 4px 8px; border-radius: 7px; }
.course-cover .code strong { display: block; font-weight: 800; letter-spacing: 1px; }
.course-body { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.course-body h3 { font-family: var(--font-display); font-size: 17px; font-weight: 500; line-height: 1.22; }
.course-body .teacher { font-size: 12px; color: var(--muted); margin-top: 4px; }
.course-titles { min-height: 64px; }
.course-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.course-foot .next { flex: 1; min-width: 0; }
.course-foot .avg { display: flex; align-items: baseline; gap: 4px; color: var(--muted); }
.course-foot .avg strong { font-family: var(--font-display); font-size: 18px; font-weight: 500; color: var(--ink); }
.lib-cover { height: 136px; position: relative; overflow: hidden; }
.lib-cover .pill { position: absolute; z-index: 1; top: 12px; left: 12px; background: rgba(255,255,255,.94); color: var(--ink); }
.lib-cover-icon { position: absolute; z-index: 1; right: 12px; bottom: 12px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.9); }
.lib-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; font-weight: 600; color: var(--muted); }
.lib-meta span { display: inline-flex; align-items: center; gap: 5px; }
.banner { display: flex; border-radius: 16px; overflow: hidden; background: var(--accent); color: #fff; }
.banner-body { flex: 1; padding: 28px 32px; display: flex; flex-direction: column; gap: 10px; }
.banner h2 { font-family: var(--font-display); font-size: 28px; font-weight: 500; line-height: 1.15; }
.banner p { color: #D3E6DF; max-width: 640px; }
.banner .deadline { align-self: flex-start; background: rgba(255,255,255,.12); color: #F2C08F; }
.banner .slot { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.banner .slot.is-filled { background: #fff; color: var(--accent); }
.banner .slot.is-empty { border: 1.5px dashed rgba(255,255,255,.45); color: #D3E6DF; font-weight: 600; }
.banner-art { width: 300px; flex: none; display: grid; place-items: center; background: radial-gradient(circle at 70% 40%, #2A7A66, #0E4337); }
.banner-art .icon { width: 80px; height: 80px; color: #9FD1C1; stroke-width: 1.3; }

/* ----------------------------------------------------------- schedule */
.timetable { overflow: hidden; }
.tt-head, .tt-row { display: grid; grid-template-columns: 112px repeat(var(--hours), minmax(0, 1fr)); }
.tt-head { background: var(--subtle); height: 40px; }
.tt-head > div { display: flex; align-items: center; padding: 0 8px; font-size: 11px; font-weight: 600; color: var(--muted); border-left: 1px solid var(--line); }
.tt-head > div:first-child { border-left: none; padding: 0 14px; font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.tt-row { border-top: 1px solid var(--line); height: 96px; position: relative; }
.tt-row.is-today { background: var(--accent-tint); }
.tt-row > .cell { border-left: 1px solid var(--line); }
.tt-day { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.tt-day .date { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--muted); }
.tt-day .num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-size: 18px; color: var(--ink); letter-spacing: 0; }
.tt-row.is-today .tt-day .date { color: var(--accent); }
.tt-row.is-today .tt-day .num { background: var(--accent); color: #fff; }
.tt-lanes { position: absolute; top: 0; bottom: 0; right: 0; }
.tt-event {
  position: absolute; top: 6px; bottom: 6px; padding: 7px 7px 7px 9px; border-radius: 6px; overflow: hidden;
  border-left: 3px solid; display: flex; flex-direction: column; gap: 1px; cursor: pointer; text-align: left; font: inherit;
  border-top: none; border-right: none; border-bottom: none;
}
.tt-event:hover { filter: brightness(.97); }
.tt-event .t { font-size: 11.5px; font-weight: 700; line-height: 1.2; }
.tt-event .m { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.tt-event.is-cancelled { opacity: .55; }
.tt-event.is-cancelled .t { text-decoration: line-through; }
.tt-event.is-dark { background: var(--ink) !important; color: #fff; border-left-color: var(--ink) !important; }
.tt-event.is-dark .m { color: #C9D3CF; }
.tt-event.is-selected { box-shadow: 0 0 0 2px var(--ink); }
.tt-now { position: absolute; top: -4px; bottom: 0; width: 2px; background: var(--warn); z-index: 2; pointer-events: none; }
.tt-now::before { content: ""; position: absolute; top: 0; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.tt-change-tag { position: absolute; right: 4px; top: 4px; }

/* ---------------------------------------------------------- tasks list */
.task-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--subtle); }
.task-row.is-selected { background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--accent); }
.task-row .title { font-size: 14px; font-weight: 700; }
.task-row .meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.task-row .due { width: 128px; text-align: right; flex: none; }
.task-row .due strong { display: block; font-size: 13px; font-weight: 600; }
.task-row .due small { font-size: 12px; color: var(--muted); }
.task-row .due small.is-urgent { color: var(--warn); font-weight: 700; }
.task-row .status { width: 112px; display: flex; justify-content: flex-end; flex: none; }
.detail-panel { position: sticky; top: 28px; overflow: hidden; }
.detail-head { padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 12px; }
.detail-head h2 { font-family: var(--font-display); font-size: 24px; font-weight: 500; line-height: 1.2; }
.detail-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 20px; }
.detail-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.facts { display: flex; gap: 20px; flex-wrap: wrap; }
.facts div { display: flex; flex-direction: column; gap: 2px; }
.facts small { font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.facts strong { font-size: 13px; }
.file-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 12px; }
.file-row:hover { border-color: #CFCBBF; }
.file-row strong { display: block; font-weight: 700; color: var(--ink); }
.file-row small { color: var(--muted); font-size: 11px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; border-radius: 10px; border: 1.5px dashed #CFCBBF; background: #FCFBF9; text-align: center; cursor: pointer; font-size: 12px; font-weight: 600; }
.dropzone input { display: none; }
.dropzone small { color: var(--muted); font-weight: 500; }
.dropzone.has-file { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); }

/* -------------------------------------------------------------- messages */
.messenger { display: grid; grid-template-columns: 340px minmax(0, 1fr) 280px; height: calc(100vh - 28px - 40px - 66px - 24px); min-height: 640px; overflow: hidden; }
.conv-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.conv-items { overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 2px; }
.conv-item { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 10px; }
.conv-item:hover { background: var(--subtle); }
.conv-item.is-active { background: var(--accent-soft); }
.conv-item .name { font-size: 14px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item .preview { font-size: 12px; color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item.is-unread .preview { color: var(--ink); font-weight: 600; }
.conv-item time { font-size: 11px; color: var(--muted); }
.conv-item.is-unread time { color: var(--accent); font-weight: 700; }
.unread-dot { min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.group-avatar { display: inline-grid; place-items: center; border-radius: 12px; flex: none; }
.thread { display: flex; flex-direction: column; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.thread-messages { flex: 1; overflow-y: auto; padding: 20px 28px; display: flex; flex-direction: column; gap: 14px; background: #FCFBF9; }
.day-divider { display: flex; align-items: center; gap: 12px; font-size: 11px; font-weight: 700; color: var(--muted); }
.day-divider::before, .day-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { display: flex; flex-direction: column; gap: 4px; max-width: 460px; align-self: flex-start; align-items: flex-start; }
.msg.is-me { align-self: flex-end; align-items: flex-end; }
.msg .bubble { padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.msg.is-me .bubble { background: var(--accent); border-color: var(--accent); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg .meta { font-size: 11px; color: var(--muted); }
.msg .sender { font-size: 11px; font-weight: 700; color: var(--muted); }
.composer { padding: 14px 24px; border-top: 1px solid var(--line); }
.composer form { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--line); border-radius: 12px; }
.composer textarea { flex: 1; border: none; outline: none; resize: none; height: 24px; max-height: 120px; padding: 2px 0; font-size: 13px; }
.composer .attach { cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.composer .attach input { display: none; }
.contact-panel { border-left: 1px solid var(--line); background: #FCFBF9; padding: 24px; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; }

/* --------------------------------------------------------------- profile */
.profile-card { display: flex; align-items: center; gap: 24px; padding: 24px 28px; }
.section-nav { width: 210px; flex: none; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 28px; align-self: flex-start; }
.section-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.section-nav a .icon { color: var(--muted); }
.section-nav a:hover { background: var(--surface); }
.field-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.field-row:last-child { border-bottom: none; }
.field-row .k { width: 128px; flex: none; font-size: 12px; color: var(--muted); }
.field-row .v { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; }
.field-row .v .input { padding: 6px 10px; font-weight: 600; }
.lock { color: #A9B0AC; }
.pref-row { display: grid; grid-template-columns: 1fr 58px 58px; gap: 16px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pref-row:last-child { border-bottom: none; }
.pref-row .cell { display: flex; justify-content: center; }

/* ----------------------------------------------------------------- auth */
.auth-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, #E3EFEA, var(--bg) 55%); }
.auth { width: 100%; padding: 24px; display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 20px 50px rgba(22,32,29,.08); }
.auth-card .logo { padding: 0; margin-bottom: 8px; }
.auth-card .h-display { font-size: 30px; }
.auth-flash { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); }
.demo-note { display: flex; gap: 8px; align-items: flex-start; line-height: 1.6; padding: 10px 12px; border-radius: 10px; background: var(--subtle); font-size: 12px; color: var(--muted); }
.demo-note strong { color: var(--ink); }

@media (max-width: 1280px) {
  .course-grid.cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .two-col, .two-col.wide-side { grid-template-columns: minmax(0, 1fr) 320px; }
  .messenger { grid-template-columns: 300px minmax(0, 1fr); }
  .contact-panel { display: none; }
}
@media (max-width: 1000px) {
  .sidebar { width: 76px; padding: 20px 12px; }
  .sidebar .logo-text, .nav-item span, .streak-card, .user-text, .user-block > .icon:last-child { display: none; }
  .nav-badge { display: none; }
  .two-col, .two-col.wide-side { grid-template-columns: 1fr; }
  .course-grid.cols-4, .course-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 20px; }
}
@media (max-width: 800px) {
  .hero { flex-direction: column; }
  .hero-art { width: 100%; height: 140px; }
  .hero-body { padding: 20px; }
  .course-learning { grid-template-columns: 1fr; }
  .course-outline { position: static; max-height: none; }
  .course-resources { grid-template-columns: 1fr; }
  .course-overview { align-items: flex-start; }
}
@media (max-width: 600px) {
  .course-overview-symbol { width: 48px; height: 48px; }
  .lesson-panel-head, .lesson-panel-body { padding: 20px; }
  .lesson-panel-foot { padding: 16px 20px; }
  .lesson-panel-foot form { flex-wrap: wrap; }
  .lesson-panel-foot .btn { white-space: normal; }
}
.scenario.is-worse { border-color: #E8C9AE !important; }
.scenario.is-worse [data-avg], .scenario.is-worse [data-pred] { color: var(--warn); }
@media print { .sidebar, .toolbar, .detail-panel { display: none !important; } .two-col { display: block; } }
.slot-option { position: relative; }
.slot-option input { position: absolute; opacity: 0; }
.slot-option span { display: grid; place-items: center; height: 34px; border-radius: 8px; border: 1px solid var(--line); font-size: 11px; font-weight: 700; cursor: pointer; }
.slot-option input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.slot-option input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.big-avatar { box-shadow: 0 0 0 3px #fff; }
.new-msg { position: relative; }
.new-msg summary { list-style: none; }
.new-msg summary::-webkit-details-marker { display: none; }
.new-msg-pop { position: absolute; right: 0; top: 48px; z-index: 20; width: 300px; max-height: 420px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 16px 40px rgba(22,32,29,.12); }
.new-msg-pop a { padding: 4px; border-radius: 8px; }
.new-msg-pop a:hover { background: var(--subtle); }
.icon.star { color: #D9902B; fill: #D9902B; }

/* ================================================== rozhraní učitele a admina */
.nav-item.is-disabled { color: var(--faint); cursor: default; }
.nav-item.is-disabled:hover { background: none; }
.nav-item.is-disabled .icon { color: #C4C9C5; }
.nav-soon { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--faint); }
.nav-badge.is-warn { background: var(--warn); }
.streak-card .card-icon { color: #9FD1C1; }
.icon-button { display: grid; place-items: center; width: 32px; height: 32px; border: none; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.icon-button:hover { background: var(--subtle); color: var(--ink); }
.user-block form { margin: 0; }

/* hlavní karta s příští hodinou */
.lesson-hero { display: flex; border-radius: 16px; overflow: hidden; background: var(--accent); color: #fff; min-height: 220px; }
.lesson-hero-body { flex: 1; padding: 28px 32px; display: flex; flex-direction: column; gap: 10px; }
.lesson-hero .eyebrow { color: #9FD1C1; font-size: 11px; letter-spacing: 1.4px; }
.lesson-hero h2 { font-family: var(--font-display); font-size: 26px; font-weight: 500; line-height: 1.2; }
.lesson-hero p { color: #D3E6DF; }
.lesson-hero .btn { background: #fff; border-color: #fff; color: var(--accent); }
.lesson-hero .btn-ghost { background: transparent; border-color: rgba(255,255,255,.35); color: #fff; }
.lesson-prep { width: 250px; flex: none; background: #0F4A3D; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.prep-item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #D3E6DF; }
.prep-item .check { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #9FD1C1; color: #0F4A3D; flex: none; }
.prep-item.is-todo { color: #F7C79A; font-weight: 700; }
.prep-item.is-todo .check { background: none; box-shadow: inset 0 0 0 1.5px #F2A25C; }

/* pás s čísly */
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); }
.kpi { padding: 18px 22px; display: flex; flex-direction: column; gap: 4px; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi strong { font-family: var(--font-display); font-size: 30px; font-weight: 500; line-height: 1.15; }
.kpi small { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi small.is-warn { color: var(--warn); }
.kpi small.is-accent { color: var(--accent); }
.class-tag { display: inline-block; padding: 2px 6px; border-radius: 5px; background: #F2F1EC; font-size: 11px; font-weight: 700; }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-action { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); }
.quick-action:hover { background: var(--surface); }
.quick-action strong { display: block; font-size: 13px; }
.quick-action small { font-size: 11px; color: var(--muted); }
.initials { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 700; flex: none; background: #F2F1EC; color: var(--muted); }
.initials.is-risk { background: var(--warn-soft); color: var(--warn); }
.initials.is-warn { background: var(--ochre-soft); color: var(--ochre); }

/* opravování */
.grading { display: grid; grid-template-columns: 264px minmax(0, 1fr) 320px; gap: 20px; align-items: stretch; min-height: calc(100vh - 170px); }
.sub-list { display: flex; flex-direction: column; overflow: hidden; }
.sub-list-head { padding: 18px 16px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.sub-list .segmented { height: 34px; width: 100%; }
.sub-list .segmented a { flex: 1; justify-content: center; padding: 0 4px; font-size: 12px; }
.sub-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sub-item:hover { background: var(--subtle); }
.sub-item.is-selected { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.sub-item strong { display: block; font-size: 13px; }
.sub-item small { font-size: 11px; color: var(--muted); }
.preview { display: flex; flex-direction: column; overflow: hidden; }
.preview-toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.preview-stage { flex: 1; background: #EFEDE6; padding: 24px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; overflow: auto; }
.paper { width: 100%; max-width: 560px; background: #fff; border-radius: 4px; padding: 32px 36px; box-shadow: 0 2px 10px rgba(22,32,29,.08); }
.paper pre { margin: 0; white-space: pre-wrap; font-family: var(--font-ui); font-size: 13px; line-height: 1.6; color: #3A4542; }
.student-note { width: 100%; max-width: 560px; padding: 12px 14px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 13px; }
.preview-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.rubric { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.criterion { display: flex; flex-direction: column; gap: 6px; }
.criterion-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; }
.points-input { width: 64px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); text-align: right; font-weight: 700; }
.points-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.segments { display: flex; gap: 3px; }
.segments i { flex: 1; height: 6px; border-radius: 2px; background: #ECEAE3; }
.segments i.on { background: var(--accent); }
.segments.is-low i.on { background: var(--warn); }
.total-box { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--subtle); border: 1px solid var(--line); }
.total-box strong { font-family: var(--font-display); font-size: 28px; font-weight: 500; }
.grade-pick { display: flex; gap: 4px; }
.grade-pick label { position: relative; }
.grade-pick input { position: absolute; opacity: 0; }
.grade-pick span { display: grid; place-items: center; width: 30px; height: 34px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); font-family: var(--font-display); font-size: 16px; font-weight: 600; cursor: pointer; }
.grade-pick input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.grade-pick input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

/* klasifikace */
.gradebook { overflow-x: auto; }
.gradebook .table th, .gradebook .table td { padding: 9px 10px; }
.gradebook .table th:first-child, .gradebook .table td:first-child { padding-left: 16px; }
.gradebook th.col { text-align: center; text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--ink); min-width: 70px; }
.gradebook th.col small { display: block; font-weight: 500; color: var(--muted); }
.gradebook th.col em { display: block; font-style: normal; color: var(--accent); }
.gradebook td.cell { text-align: center; }
.gradebook tr.is-risk td { background: #FDF6F0; }
.gradebook tfoot td { background: var(--subtle); font-weight: 700; font-size: 12px; border-top: 1px solid var(--line); }
.dot-pending { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.dot-planned { display: inline-block; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--muted); }
.missing-chip { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; box-shadow: inset 0 0 0 1px var(--warn); color: var(--warn); font-size: 11px; font-weight: 700; }
.dist { display: flex; align-items: flex-end; gap: 10px; height: 130px; }
.dist-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; font-size: 11px; font-weight: 700; }
.dist-col i { width: 100%; border-radius: 4px 4px 0 0; }
.dist-col span { font-family: var(--font-display); font-size: 14px; color: var(--muted); }
.new-grade summary { list-style: none; cursor: pointer; }
.new-grade summary::-webkit-details-marker { display: none; }
.new-grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; }
.new-grade-grid label { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 8px; background: var(--subtle); font-size: 13px; font-weight: 600; }
.new-grade-grid select { height: 30px; border-radius: 7px; border: 1px solid var(--line); background: #fff; font-weight: 700; }

/* tvorba kurzů */
.builder { display: grid; grid-template-columns: 280px minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.outline { overflow: hidden; }
.outline-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.outline-module { border-bottom: 1px solid var(--line); }
.outline-module summary { display: flex; align-items: center; gap: 10px; padding: 13px 18px; font-size: 13px; font-weight: 700; cursor: pointer; list-style: none; }
.outline-module summary::-webkit-details-marker { display: none; }
.outline-module summary small { margin-left: auto; color: var(--muted); font-size: 11px; }
.outline-lessons { display: flex; flex-direction: column; gap: 2px; padding: 0 10px 10px; }
.outline-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; font-size: 12px; }
.outline-item:hover { background: var(--subtle); }
.outline-item.is-selected { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.outline-item .icon { color: var(--muted); }
.outline-item.is-selected .icon { color: var(--accent); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-left: auto; background: #C9C6BA; }
.status-dot.is-done { background: var(--accent); }
.editor-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.editor-tabs span { padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.editor-tabs span.is-on { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.block { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.block-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.block-label .spacer { flex: 1; }
.block .input.title-input { font-family: var(--font-display); font-size: 20px; font-weight: 600; border-color: transparent; padding: 4px 0; }
.block .input.title-input:focus { box-shadow: none; border-color: transparent; border-bottom-color: var(--accent); border-radius: 0; }
.block .textarea { min-height: 180px; line-height: 1.6; }
.video-thumb { aspect-ratio: 16 / 7; border-radius: 10px; background: #0F4A3D center / cover no-repeat; display: grid; place-items: center; }
.video-thumb span { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.9); display: grid; place-items: center; color: var(--accent); }
.radio-seg { display: flex; padding: 3px; gap: 3px; border-radius: 8px; background: var(--chip-bg); }
.radio-seg label { flex: 1; position: relative; }
.radio-seg input { position: absolute; opacity: 0; }
.radio-seg span { display: block; text-align: center; padding: 6px 0; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer; }
.radio-seg input:checked + span { background: var(--surface); color: var(--ink); font-weight: 700; }

/* moje třídy */
.mini-bars { display: flex; align-items: flex-end; gap: 6px; height: 90px; }
.mini-bars i { flex: 1; border-radius: 3px 3px 0 0; background: #BFD9CF; }
.mini-bars i.is-low { background: var(--warn); }
.mini-bars i.is-last { background: var(--accent); }
.roster-flag { display: block; font-size: 11px; font-weight: 700; }

/* admin – databáze */
.db-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.db-tables { overflow: hidden; position: sticky; top: 20px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.db-tables-head { padding: 18px 16px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.db-tables-list { padding: 14px 10px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.db-group { display: flex; flex-direction: column; gap: 2px; }
.db-group > .label-caps { padding: 0 8px 4px; }
.db-table-link { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 7px; font-size: 13px; }
.db-table-link:hover { background: var(--subtle); }
.db-table-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.db-table-link small { font-size: 11px; font-weight: 600; color: var(--muted); }
.db-table-link .icon { color: var(--muted); }
.db-table-link.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.db-table-link.is-on .icon, .db-table-link.is-on small { color: var(--accent); }
.db-conn { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: auto; }
.db-conn i { width: 8px; height: 8px; border-radius: 50%; background: #2E9E6B; }
.db-view { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.db-view-head { padding: 18px 20px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.db-view .editor-tabs { border-bottom: none; }
.db-view .editor-tabs a { padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.db-view .editor-tabs a.is-on { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.db-filter-bar { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.db-filter { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 10px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }
.db-filter a { display: grid; place-items: center; }
.db-filter-form { display: flex; align-items: center; gap: 6px; }
.db-filter-form .select, .db-filter-form .input { height: 30px; padding: 0 8px; font-size: 12px; border-radius: 7px; width: auto; }
.db-grid { overflow-x: auto; }
.db-grid table { width: 100%; border-collapse: collapse; font-size: 12px; }
.db-grid th { position: sticky; top: 0; text-align: left; padding: 8px 14px; background: var(--subtle); border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: bottom; }
.db-grid th a { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink); }
.db-grid th small { display: block; font-size: 10px; font-weight: 500; color: var(--muted); }
.db-grid td { padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; color: #3A4542; }
.db-grid tbody tr:nth-child(even) td { background: #FCFBF8; }
.db-grid tbody tr:hover td { background: var(--accent-tint); }
.db-grid .is-null { color: #B9BDB6; font-style: italic; font-weight: 700; font-size: 11px; }
.db-grid .is-masked { color: var(--faint); letter-spacing: 2px; }
.db-grid .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.db-grid .fk { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.db-grid .pk { color: var(--muted); font-weight: 700; }
.db-foot { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--subtle); font-size: 12px; font-weight: 600; color: var(--muted); }
.pager { display: flex; gap: 4px; margin-left: auto; }
.pager a, .pager span { min-width: 28px; height: 28px; padding: 0 6px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink); }
.pager .is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager .is-gap { border: none; background: none; }
.readonly-badge { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 700; }
.ochre-text { color: #C9A24A; }
.stack > .progress { flex: none; }
.gradebook .table th:last-child, .gradebook .table td:last-child { padding-right: 20px; }
.criterion-top > span:last-child, .total-box small { white-space: nowrap; }
.points-input { width: 56px; }

/* admin – uživatelé */
.users-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.users-layout.has-drawer { grid-template-columns: minmax(0, 1fr) 360px; }
.table tr.is-picked td { background: var(--accent-soft); }
.table tr.is-picked td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.drawer { display: flex; flex-direction: column; position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow: hidden; }
.drawer-head { padding: 20px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 20px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.sec-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--subtle); color: var(--muted); }
.sec-row strong { display: block; font-size: 13px; color: var(--ink); }
.sec-row small { font-size: 11px; color: var(--muted); }
.sec-row form { margin: 0; }
.danger-row { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); margin: 0; }
.danger-row strong { display: block; font-size: 13px; }
.danger-row small { font-size: 11px; }
.secret-box { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--ochre-soft); margin: 0; }
.secret-box code { font-size: 15px; font-weight: 700; background: #fff; padding: 4px 8px; border-radius: 6px; letter-spacing: .5px; }

/* admin – role a oprávnění */
.roles-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.role-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; }
.role-item:hover { background: var(--subtle); }
.role-item strong { font-size: 13px; }
.role-item small { font-size: 11px; color: var(--muted); }
.role-item.is-on { background: var(--accent-soft); }
.role-item.is-on strong { color: var(--accent); }
.perm-matrix { overflow: hidden; }
.perm-head { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.perm-table td { padding: 8px 16px; }
.perm-table .perm-group td { padding: 12px 16px 6px; background: none; font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--muted); border-bottom: none; }
.perm-table tr.is-off td { color: var(--faint); }
.perm-table tr.is-off .icon { color: #C4C9C5; }
.perm-table td .icon { color: var(--accent); }
.scope-input { height: 30px; padding: 0 8px; font-size: 12px; font-weight: 600; border-color: transparent; background: transparent; }
.scope-input:hover, .scope-input:focus { border-color: var(--line); background: #fff; }
.perm-check { position: relative; display: inline-grid; place-items: center; }
.perm-check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.perm-check span { width: 18px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 1.5px #C9C6BA; display: grid; place-items: center; color: transparent; background: #fff; }
.perm-check input:checked + span { background: var(--accent); box-shadow: none; color: #fff; }
.perm-check input:checked + span .icon { color: #fff; }
.perm-check input:disabled + span { opacity: .6; }
.perm-check input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.diff-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.diff-table th, .diff-table td { padding: 7px 10px; }
.diff-table del { background: #F9E1DF; color: #B3261E; padding: 1px 5px; border-radius: 4px; }
.diff-table ins { background: var(--ok-soft); color: var(--ok); padding: 1px 5px; border-radius: 4px; text-decoration: none; font-weight: 600; }
.backup-hero { display: flex; align-items: center; gap: 24px; padding: 24px 28px; border-radius: 16px; background: var(--accent); color: #fff; }
.backup-hero.is-failed { background: #8A3F14; }
.backup-hero h2 { font-family: var(--font-display); font-size: 24px; font-weight: 500; }
.backup-hero p { color: #D3E6DF; font-size: 13px; }

/* admin – nastavení */
.settings-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { padding: 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 20px; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.settings-nav a .icon { color: var(--muted); }
.settings-nav a:hover { background: var(--subtle); }
.settings-nav a.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.settings-nav a.is-on .icon { color: var(--accent); }
.settings-nav .nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.settings-nav-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.settings-grid section { scroll-margin-top: 20px; }
.notif-table td, .notif-table th { padding: 9px 0; }
.notif-table th { background: none; }
@media (max-width: 1280px) { .settings-grid, .roles-layout { grid-template-columns: 1fr; } }
.cell-clip { max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roles-layout { grid-template-columns: 240px minmax(0, 1fr) 280px; }
.perm-table td:first-child strong { white-space: nowrap; }
.perm-table td .perm-check .icon { color: transparent; }
.perm-table td .perm-check input:checked + span .icon { color: #fff; }
.perm-table .scope-input { font-size: 11px; padding: 0 6px; }

/* admin – databáze: úpravy a SQL konzole */
.readonly-badge.is-edit { background: var(--ochre-soft); color: var(--ochre); }
.db-layout.has-editor { grid-template-columns: 240px minmax(0, 1fr) 380px; }
.db-sql-link { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; }
.db-sql-link .icon { color: #9FD1C1; }
.db-sql-link.is-on, .db-sql-link:hover { background: #0F4A3D; }
.db-row-act { width: 34px; padding: 0 0 0 12px !important; }
.db-row-act a { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: var(--muted); }
.db-row-act a:hover { background: var(--accent-soft); color: var(--accent); }
.db-grid tr.is-picked td { background: var(--accent-soft) !important; }
.db-editor { display: flex; flex-direction: column; position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow: hidden; }
.db-editor-form { gap: 14px; }
.db-field { display: flex; flex-direction: column; gap: 6px; }
.db-field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.db-field-label label { font-size: 12px; font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; gap: 4px; }
.db-field-label small { font-size: 10px; font-weight: 600; color: var(--muted); text-align: right; }
.db-field .input, .db-field .select { height: 36px; padding: 0 10px; }
.db-field .textarea { min-height: 80px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.db-ro-value { padding: 8px 10px; border-radius: 8px; background: var(--subtle); font-size: 13px; color: #3A4542; word-break: break-word; display: flex; align-items: center; gap: 6px; }
.db-field.is-ro .db-field-label label { color: var(--muted); }
.null-toggle { position: relative; flex: none; }
.null-toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.null-toggle span { display: grid; place-items: center; height: 36px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); font-size: 10px; font-weight: 800; letter-spacing: .5px; color: var(--faint); background: var(--surface); }
.null-toggle input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.null-toggle input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.db-field [data-null-target]:disabled { opacity: .4; }
.db-fk-link { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--accent); }
.db-sql { overflow: hidden; }
.sql-editor { display: block; width: 100%; min-height: 180px; padding: 16px 20px; border: none; outline: none; resize: vertical; background: #10201B; color: #E3EFEA;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
.sql-editor::placeholder { color: #5F7A72; }
.sql-confirm { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; background: var(--warn-soft); border-bottom: 1px solid #F2C9A8; }
.sql-history { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: none; border-radius: 8px; background: none; cursor: pointer; text-align: left; width: 100%; }
.sql-history:hover { background: var(--subtle); }
.sql-history code { flex: 1; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.db-deps { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; background: var(--subtle); }
.db-deps a:hover span.grow { color: var(--accent); }
.db-view-head > .row { flex-wrap: wrap; row-gap: 10px; }
.db-view-head > .row > .grow { min-width: 180px; }
.db-layout.has-editor .db-view-head .btn-sm { padding: 0 10px; }
