/* Miran_AI2 – enoten oblikovni sistem (svetla turkizno-modra tema) */
:root {
  --bg: #eef5f7;
  --surface: #ffffff;
  --surface-2: #f5fafb;
  --line: #d9e7eb;
  --line-strong: #bcd4db;
  --text: #16333d;
  --text-2: #4d6a74;
  --text-3: #7d959d;
  --brand: #1f86a0;
  --brand-600: #196f85;
  --brand-50: #e3f3f7;
  --brand-100: #c9e8f0;
  --side-1: #2a6f86;
  --side-2: #3b8ea5;
  --danger: #c83b3b;
  --danger-50: #fdecec;
  --warn: #b98300;
  --warn-50: #fff5d6;
  --ok: #278a52;
  --ok-50: #e5f5ec;
  --info: #5b5bd6;
  --info-50: #eeeefd;
  --blocked: #8a5a00;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(22, 51, 61, .06), 0 4px 14px rgba(22, 51, 61, .06);
  --shadow-lg: 0 12px 40px rgba(22, 51, 61, .18);
  --side-w: 256px;
  --side-rail: 74px;
  --gap: 16px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--text-2); }

/* ---------- ogrodje ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; transition: grid-template-columns .2s; }
.shell.collapsed { grid-template-columns: var(--side-rail) 1fr; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 16px 12px;
  background: linear-gradient(180deg, var(--side-1), var(--side-2)); color: #eaf6f9; overflow-y: auto; overflow-x: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; border-bottom: 1px solid rgba(255,255,255,.15); }
.brand-logo { display: block; width: 100%; max-height: 64px; object-fit: contain; background: rgba(255,255,255,.92); border-radius: 12px; padding: 6px; }
.collapsed .brand-logo { display: none; }
.brand-mark { width: 38px; height: 38px; flex: none; border-radius: 10px; background: rgba(255,255,255,.14); display: grid; place-items: center; }
.brand-text b { display: block; font-size: 15px; letter-spacing: .02em; }
.brand-text span { font-size: 11.5px; opacity: .8; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: rgba(0,0,0,.14); border-radius: 12px; }
.mode-switch button { border: 0; border-radius: 9px; padding: 8px 6px; background: transparent; color: #dff1f5; font-weight: 600; font-size: 12px; letter-spacing: .04em; cursor: pointer; display: flex; gap: 6px; align-items: center; justify-content: center; }
.mode-switch button.on { background: #fff; color: var(--side-1); }
.nav-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; padding: 4px 10px 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: #eaf6f9; font-weight: 500; white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.nav a.on { background: rgba(255,255,255,.2); box-shadow: inset 3px 0 0 #fff; }
.nav a .count { margin-left: auto; font-size: 11.5px; background: rgba(255,255,255,.2); padding: 1px 8px; border-radius: 99px; }
.nav svg, .icon { width: 19px; height: 19px; flex: none; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.sys-pill { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 11px; background: rgba(0,0,0,.14); font-size: 12.5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #9fb3b9; flex: none; }
.dot.ok { background: #5fe08f; } .dot.bad { background: #ff8a8a; } .dot.warn { background: #ffd35c; }
.user { display: flex; align-items: center; gap: 10px; padding: 8px 8px 2px; border-top: 1px solid rgba(255,255,255,.15); }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: #fff; color: var(--side-1); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.user small { display: block; opacity: .75; font-size: 11.5px; }
.collapsed .brand-text, .collapsed .nav-label, .collapsed .nav a span, .collapsed .nav a .count, .collapsed .user div,
.collapsed .sys-pill span, .collapsed .mode-switch span { display: none; }
.collapsed .mode-switch { grid-template-columns: 1fr; }
.collapsed .nav a { justify-content: center; padding: 11px 0; }
.handle { position: fixed; top: 50%; transform: translateY(-50%); left: calc(var(--side-w) - 14px); z-index: 30; width: 28px; height: 56px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; color: var(--brand-600); transition: left .2s; }
.collapsed .handle { left: calc(var(--side-rail) - 14px); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(238,245,247,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text-3); cursor: text; }
.search kbd { margin-left: auto; font: 11px var(--font); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: var(--surface-2); }
.topbar .menu-btn { display: none; }
.page { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: var(--gap); max-width: 1600px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--brand-600); font-weight: 700; }

/* ---------- gradniki ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 16.5px; }
.card-head h3 { font-size: 15px; }
.card-head .spacer { flex: 1; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); font-size: 12.5px; }
.grid { display: grid; gap: var(--gap); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; color: var(--text); text-decoration: none !important; }
.btn:hover { border-color: var(--brand); color: var(--brand-600); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); color: #fff; }
.btn.danger { color: var(--danger); border-color: #efc4c4; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--brand-50); border-radius: 10px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--brand-600); box-shadow: var(--shadow); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip b { font-weight: 700; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.red { background: var(--danger-50); color: var(--danger); border-color: #f4caca; }
.badge.yellow { background: var(--warn-50); color: var(--warn); border-color: #f1dea0; }
.badge.green { background: var(--ok-50); color: var(--ok); border-color: #bfe3cd; }
.badge.blue { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-100); }
.badge.violet { background: var(--info-50); color: var(--info); border-color: #d6d6f7; }
.badge.brown { background: #f7eee0; color: var(--blocked); border-color: #ead7b5; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.input, select.input, textarea.input { width: 100%; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); outline: none; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
textarea.input { resize: vertical; min-height: 90px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { min-width: 150px; flex: 1; max-width: 260px; }
.empty { padding: 28px 16px; text-align: center; color: var(--text-3); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.progress { height: 7px; background: var(--brand-50); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.sep { height: 1px; background: var(--line); margin: 6px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--text-2); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.list { display: flex; flex-direction: column; }
.list > .item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.list > .item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 600; overflow-wrap: anywhere; }
.item .meta { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.clickable { cursor: pointer; }
.clickable:hover { background: var(--surface-2); }

/* ---------- pregled ---------- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 26px; border-radius: 18px; color: #fff;
  background: linear-gradient(120deg, #2a7a93 0%, #4aa0b6 60%, #69b7c8 100%); box-shadow: var(--shadow); }
.hero h1 { font-size: 30px; font-weight: 700; }
.hero p { margin: 6px 0 0; opacity: .9; }
.hero .eyebrow { color: #d9f3f8; }
.focus-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); color: #fff; cursor: pointer; min-width: 240px; }
.focus-card small { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.kpi { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; min-width: 0; }
.kpi:hover { border-color: var(--brand); }
.kpi .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); flex: none; }
.kpi b { display: block; font-size: 24px; line-height: 1.1; }
.kpi small { color: var(--text-2); font-size: 12.5px; }
.kpi .lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.kpi.red { border-color: #f1c6c6; background: linear-gradient(0deg, #fff, var(--danger-50)); } .kpi.red .ic { background: var(--danger-50); color: var(--danger); } .kpi.red b { color: var(--danger); }
.kpi.yellow { border-color: #eed89a; background: linear-gradient(0deg, #fff, var(--warn-50)); } .kpi.yellow .ic { background: var(--warn-50); color: var(--warn); } .kpi.yellow b { color: var(--warn); }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quick button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; text-align: left; }
.quick button:hover { border-color: var(--brand); background: var(--brand-50); }
.quick small { color: var(--text-2); font-size: 12px; }

/* ---------- datum / roki ---------- */
.date-box { width: 48px; flex: none; text-align: center; border-radius: 10px; background: var(--brand-50); padding: 5px 0; color: var(--brand-600); }
.date-box b { display: block; font-size: 17px; line-height: 1.1; }
.date-box small { font-size: 10.5px; text-transform: uppercase; font-weight: 700; }
.due { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.due.overdue { color: var(--danger); } .due.today { color: var(--warn); } .due.done { color: var(--ok); }

/* ---------- naloge ---------- */
.task { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px 10px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.task:hover { background: var(--surface-2); }
.task.overdue { border-left-color: var(--danger); }
.task.today { border-left-color: #e6b400; background: #fffbea; }
.task.done { border-left-color: var(--ok); }
.task.done .title { text-decoration: line-through; color: var(--text-3); }
.check { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-strong); background: var(--surface); cursor: pointer; display: grid; place-items: center; margin-top: 1px; padding: 0; }
.check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.task .side-info { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; max-width: 280px; }
.waiting-on { font-size: 12px; color: var(--blocked); margin-top: 4px; }
.group-title { display: flex; align-items: center; gap: 8px; padding: 14px 4px 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); cursor: pointer; user-select: none; }
.group-title .n { background: var(--brand-50); color: var(--brand-600); border-radius: 99px; padding: 0 8px; }
.group-title.red { color: var(--danger); } .group-title.yellow { color: var(--warn); }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 200px; display: flex; flex-direction: column; gap: 8px; }
.kcol.drop { outline: 2px dashed var(--brand); background: var(--brand-50); }
.kcol h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 10px; padding: 10px; cursor: grab; box-shadow: var(--shadow); }
.kcard.overdue { border-left-color: var(--danger); } .kcard.today { border-left-color: #e6b400; } .kcard.done { border-left-color: var(--ok); }
.kcard .title { font-weight: 600; font-size: 13px; }
.kcard .meta { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.kcard.dragging { opacity: .5; }

/* ---------- časovnica ---------- */
.gantt-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); max-height: 70vh; }
.gantt { position: relative; }
.g-head { position: sticky; top: 0; z-index: 3; display: flex; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.g-label-col { position: sticky; left: 0; z-index: 4; flex: none; width: 300px; background: var(--surface-2); border-right: 1px solid var(--line); padding: 8px 10px; font-weight: 700; font-size: 12px; }
.g-cell { flex: none; border-right: 1px solid var(--line); font-size: 11px; text-align: center; padding: 8px 0; color: var(--text-2); overflow: hidden; white-space: nowrap; }
.g-cell.weekend { background: #eef3f5; }
.g-row { display: flex; border-bottom: 1px solid var(--line); min-height: 34px; position: relative; }
.g-row:hover { background: var(--surface-2); }
.g-row .g-label { position: sticky; left: 0; z-index: 2; flex: none; width: 300px; background: inherit; background-color: var(--surface); border-right: 1px solid var(--line); padding: 7px 10px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.g-group { background: var(--brand-50) !important; font-weight: 700; }
.g-group .g-label { background-color: var(--brand-50); }
.g-track { position: relative; flex: none; }
.g-bar { position: absolute; top: 8px; height: 18px; border-radius: 6px; background: var(--brand); color: #fff; font-size: 11px; line-height: 18px; padding: 0 6px; white-space: nowrap; overflow: hidden; cursor: pointer; }
.g-bar.overdue { background: var(--danger); } .g-bar.done { background: var(--ok); } .g-bar.blocked { background: #b08a4a; }
.g-bar .pg { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.28); }
.g-ms { position: absolute; top: 9px; width: 16px; height: 16px; transform: rotate(45deg); background: var(--info); border-radius: 3px; cursor: pointer; }
.g-ms.done { background: var(--ok); } .g-ms.overdue { background: var(--danger); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #f0b400; z-index: 1; pointer-events: none; }
.g-deps { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; }

/* ---------- koledar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal .dow { padding: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-2); background: var(--surface-2); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal .day { min-height: 104px; padding: 5px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal .day.other { background: #f7fafb; color: var(--text-3); }
.cal .day.today { background: #fffbea; box-shadow: inset 0 0 0 2px #f0c94a; }
.cal .num { font-size: 12px; font-weight: 700; }
.cal .ev { font-size: 11.5px; padding: 2px 6px; border-radius: 6px; background: var(--brand-50); color: var(--brand-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal .ev.task { background: #f1eefc; color: var(--info); }
.cal .ev.task.overdue { background: var(--danger-50); color: var(--danger); }
.cal .ev.task.done { background: var(--ok-50); color: var(--ok); }

/* ---------- plaud / obsidian ---------- */
.split { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: var(--gap); align-items: start; }
.rec { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.rec.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.rec:hover { border-color: var(--brand); }
.summary-text { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; max-height: 420px; overflow: auto; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.folder-list { display: flex; flex-direction: column; gap: 2px; max-height: 480px; overflow: auto; }
.folder-list button { display: flex; justify-content: space-between; gap: 8px; border: 0; background: transparent; padding: 7px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.folder-list button.on, .folder-list button:hover { background: var(--brand-50); color: var(--brand-600); }

/* ---------- zakonodaja ---------- */
.file-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.file-card .fname { font-weight: 700; overflow-wrap: anywhere; }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pkg { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); border-top: 4px solid var(--line-strong); }
.pkg.upload { border-top-color: var(--warn); } .pkg.rebuild { border-top-color: var(--danger); } .pkg.ok { border-top-color: var(--ok); } .pkg.na { border-top-color: var(--text-3); opacity: .8; }
.pkg .code { font-weight: 800; color: var(--brand-600); font-size: 12px; letter-spacing: .06em; }
.change { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.change.approved { border-left: 4px solid var(--ok); } .change.rejected { border-left: 4px solid var(--danger); } .change.pending { border-left: 4px solid var(--warn); }
.status-tile { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.status-tile small { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.status-tile b { display: block; font-size: 18px; margin-top: 4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; }

/* ---------- modal / toast / iskanje ---------- */
.overlay { position: fixed; inset: 0; background: rgba(12, 35, 43, .42); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .12s ease-out; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); }
.modal.wide { width: min(1000px, 100%); }
.modal-head { position: sticky; top: 0; background: var(--surface); display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); z-index: 1; }
.modal-head h2 { font-size: 17px; flex: 1; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { position: sticky; bottom: 0; background: var(--surface); display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
#toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); max-width: 380px; animation: fade .15s; }
.toast.error { background: var(--danger); } .toast.ok { background: var(--ok); }
.palette { width: min(640px, 100%); align-self: start; margin-top: 10vh; }
.palette input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; font-size: 16px; }
.palette .res { max-height: 55vh; overflow: auto; padding: 6px; }
.palette .res button { display: flex; gap: 10px; width: 100%; border: 0; background: transparent; padding: 10px 12px; border-radius: 10px; cursor: pointer; text-align: left; align-items: center; }
.palette .res button:hover, .palette .res button.on { background: var(--brand-50); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(135deg, var(--side-1), #6bb8c9); }
.login .card { width: min(380px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.bottom-nav { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- odzivnost ---------- */
@media (max-width: 1350px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .page { padding: 20px; }
  .topbar { padding: 10px 20px; }
}
@media (max-width: 767px) {
  body { font-size: 14.5px; }
  .shell, .shell.collapsed { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 90; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .shell.drawer .side { transform: none; }
  .shell.drawer::after { content: ""; position: fixed; inset: 0; background: rgba(12,35,43,.4); z-index: 80; }
  .collapsed .brand-text, .collapsed .nav-label, .collapsed .nav a span, .collapsed .nav a .count, .collapsed .user div, .collapsed .sys-pill span, .collapsed .mode-switch span { display: revert; }
  .collapsed .nav a { justify-content: flex-start; padding: 10px 12px; }
  .collapsed .mode-switch { grid-template-columns: 1fr 1fr; }
  .handle { display: none; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .search kbd { display: none; }
  .search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kpi .ic { display: none; }
  .topbar .btn span { display: none; }
  .page { padding: 14px 12px 96px; gap: 12px; }
  .page-head h1 { font-size: 21px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .hero h1 { font-size: 24px; }
  .focus-card { min-width: 0; }
  .kpi { padding: 12px; } .kpi b { font-size: 20px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .quick { grid-template-columns: 1fr 1fr; }
  .card { padding: 14px; }
  .filters .field { max-width: none; min-width: 130px; }
  .form-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; }
  .kcol { scroll-snap-align: start; }
  .g-label-col, .g-row .g-label { width: 150px; }
  .cal .day { min-height: 64px; padding: 3px; }
  .cal .ev { font-size: 10px; padding: 1px 3px; }
  .task { grid-template-columns: auto 1fr; }
  .task .side-info { grid-column: 2; justify-content: flex-start; max-width: none; }
  .modal { border-radius: 16px 16px 0 0; align-self: end; max-height: 92vh; }
  .overlay { padding: 0; place-items: end center; }
  .palette { margin-top: 0; align-self: start; border-radius: 0 0 16px 16px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 14px rgba(22,51,61,.08); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--text-2); padding: 4px 0; text-decoration: none; }
  .bottom-nav a.on { color: var(--brand-600); font-weight: 700; }
  #toast-root { left: 12px; right: 12px; bottom: 84px; }
}

/* ---------- Obsidian: drevo map ---------- */
.tree { display: flex; flex-direction: column; max-height: 62vh; overflow: auto; }
.trow { display: flex; align-items: center; gap: 2px; border-radius: 8px; }
.tnode .tnode { margin-left: 14px; border-left: 1px dashed var(--line); }
.trow.on .tname { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.ttog { width: 22px; height: 22px; flex: none; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); cursor: pointer; font-weight: 700; line-height: 1; color: var(--brand-600); padding: 0; }
.ttog:hover { border-color: var(--brand); }
.ttog-sp { width: 22px; flex: none; }
.tname { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 6px 8px; border-radius: 8px; cursor: pointer; text-align: left; }
.tname:hover { background: var(--surface-2); }
.tname span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tname em { font-style: normal; font-size: 11.5px; color: var(--text-3); }
.tname .icon { width: 16px; height: 16px; color: var(--brand-600); }

/* ---------- Obsidian: prikaz zapisa ---------- */
.md { font-size: 15px; line-height: 1.65; color: var(--text); max-width: 860px; }
.md .md-h { margin: 1.1em 0 .45em; line-height: 1.25; }
.md h1.md-h { font-size: 26px; } .md h2.md-h { font-size: 21px; border-bottom: 1px solid var(--line); padding-bottom: 4px; } .md h3.md-h { font-size: 18px; } .md h4.md-h, .md h5.md-h, .md h6.md-h { font-size: 15.5px; }
.md > :first-child { margin-top: 0; }
.md p { margin: .55em 0; }
.md hr { border: 0; border-top: 1px solid var(--line-strong); margin: 1.2em 0; }
.md code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: #eef4f6; border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; }
.md .md-code { background: #f3f7f8; border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: auto; }
.md .md-code code { border: 0; background: none; padding: 0; }
.md blockquote { margin: .7em 0; padding: 4px 14px; border-left: 3px solid var(--brand-100); color: var(--text-2); }
.md mark { background: #fff1a8; padding: 0 2px; border-radius: 3px; }
.md-list { margin: .35em 0; padding-left: 1.5em; }
.md-list .md-list { margin: .1em 0; }
.md-list li { margin: .15em 0; }
.md-task { list-style: none; display: flex; gap: 8px; align-items: flex-start; margin-left: -1.5em !important; }
.md-task .check { flex: none; margin-top: 3px; width: 18px; height: 18px; }
.md-task.done > span { color: var(--text-3); text-decoration: line-through; }
.md-task > span { flex: 1; min-width: 0; }
.md-task + .md-list, .md-task > .md-list { margin-left: 1.5em; }
.md-tag { display: inline-block; color: var(--brand-600); background: var(--brand-50); border-radius: 99px; padding: 0 7px; font-size: .88em; }
.md-wiki { color: #6b4fd8; text-decoration: none; border-bottom: 1px dashed currentColor; }
.md-wiki.missing { color: var(--text-3); }
.md-embed { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: .9em; }
.md-embed .icon, .md-date .icon { width: 14px; height: 14px; }
.md-date { display: inline-flex; align-items: center; gap: 3px; font-size: .88em; color: var(--text-2); background: var(--surface-2); border-radius: 6px; padding: 0 6px; }
.md-callout { margin: .8em 0; padding: 10px 14px; border-radius: 10px; border-left: 4px solid var(--brand); background: var(--brand-50); }
.md-callout .co-title { font-weight: 700; margin-bottom: 4px; text-transform: capitalize; }
.md-callout.warning, .md-callout.caution, .md-callout.attention { border-color: var(--warn); background: var(--warn-50); }
.md-callout.danger, .md-callout.error, .md-callout.bug { border-color: var(--danger); background: var(--danger-50); }
.md-callout.success, .md-callout.check, .md-callout.done { border-color: var(--ok); background: var(--ok-50); }
.md-table { margin: .6em 0; }
.md-query { margin: .8em 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.md-query pre { margin: 6px 0; font-size: 12px; color: var(--text-2); white-space: pre-wrap; }
.md-props { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; padding: 10px 14px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.md-props dt { color: var(--text-2); } .md-props dd { margin: 0; }
.vt { padding-left: 1.5em; }

/* ---------- Obsidian: Kanban ---------- */
.kb { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kb-lane { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.kb-lane.drop { outline: 2px dashed var(--brand); background: var(--brand-50); }
.kb-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px 4px; }
.kb-head b { flex: 1; }
.kb-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; box-shadow: var(--shadow); cursor: grab; font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }
.kb-card.done .grow { color: var(--text-3); text-decoration: line-through; }
.kb-card.dragging { opacity: .5; }
.kb-card .check { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.kb-move { align-self: flex-end; font-size: 11.5px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--text-2); padding: 2px 4px; max-width: 100%; }
.kb-add { justify-content: flex-start; }
@media (min-width: 768px) { .kb-move { opacity: .55; } .kb-card:hover .kb-move { opacity: 1; } }
@media (max-width: 767px) { .kb { grid-auto-columns: 82vw; scroll-snap-type: x mandatory; } .kb-lane { scroll-snap-align: start; } .md { font-size: 15.5px; } .tree { max-height: 40vh; } }
[hidden] { display: none !important; }
.md-task { flex-wrap: wrap; }
.md-task > .md-list { flex-basis: 100%; margin-left: 1.6em !important; padding-left: 0; }
.obs-split { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: var(--gap); align-items: start; }
@media (max-width: 767px) { .obs-split { grid-template-columns: 1fr; } }
.modal { overflow-x: hidden; }
.modal-body > *, #nview, .md { min-width: 0; max-width: 100%; }
.md { overflow-wrap: anywhere; }
.md .table-wrap { max-width: 100%; }
.search { min-width: 0; }
.split > *, .obs-split > *, .grid > * { min-width: 0; }
.rec b { overflow-wrap: anywhere; }
@media (max-width: 767px) { .seg { flex-wrap: wrap; max-width: 100%; } .table-wrap { max-width: 100%; } }
