/* ====== Správa projektů — vzhled (tmavý výchozí + světlý přepínatelný) ====== */

:root {
  /* — tmavé téma (výchozí) — */
  --bg: #0c1322;
  --surface: #162033;
  --surface-2: #111a2b;
  --border: #26364f;
  --text: #e7edf6;
  --text-soft: #92a5c0;
  --primary: #5b9dff;
  --primary-dark: #3f83f0;
  --primary-grad: linear-gradient(135deg, #4f8cf7, #7c5ff7);
  --danger: #f4726b;
  --ok: #43d17c;
  --warn: #f5b544;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .28);
  --input-bg: #0f1828;
  --hover-bg: #1d2a42;
  --chip-bg: #223050;
  --topbar-bg: #0a1120;
  --focus-ring: rgba(91, 157, 255, .35);
  --bg-glow: radial-gradient(1100px 500px at 70% -10%, rgba(79, 140, 247, .13), transparent 60%),
             radial-gradient(900px 420px at 10% -10%, rgba(124, 95, 247, .10), transparent 55%);
}

:root.light {
  /* — světlé téma — */
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-soft: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-grad: linear-gradient(135deg, #2563eb, #6d4ee0);
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 14px rgba(15, 23, 42, .06);
  --input-bg: #ffffff;
  --hover-bg: #f1f5f9;
  --chip-bg: #eef2f7;
  --topbar-bg: #0f172a;
  --focus-ring: rgba(37, 99, 235, .3);
  --bg-glow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  transition: background-color .25s, color .25s;
}
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }
::selection { background: rgba(91, 157, 255, .35); }

/* jemný scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-soft); }

/* ---------- tlačítka a formuláře ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text);
  padding: 8px 14px; font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { background: var(--hover-bg); border-color: var(--text-soft); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary-grad); border-color: transparent; color: #fff;
  box-shadow: 0 2px 10px rgba(79, 140, 247, .25);
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(79, 140, 247, .35); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgba(244, 114, 107, .12); border-color: rgba(244, 114, 107, .4); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 12px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search],
textarea, select {
  display: block; width: 100%; margin-top: 4px;
  border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 11px; font: inherit; color: var(--text); background: var(--input-bg);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring);
}
textarea { resize: vertical; min-height: 70px; }
select option { background: var(--surface); color: var(--text); }
input[type=date] { color-scheme: dark; }
:root.light input[type=date] { color-scheme: light; }

.form-error {
  background: rgba(244, 114, 107, .12); color: var(--danger);
  border: 1px solid rgba(244, 114, 107, .38);
  border-radius: 9px; padding: 8px 11px; font-size: 13px; margin-bottom: 12px;
}
.form-row { display: flex; gap: 12px; }
.form-row > label { flex: 1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ---------- přihlašovací obrazovka ---------- */
.auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1000px 600px at 75% -10%, rgba(79, 140, 247, .28), transparent 60%),
              radial-gradient(800px 500px at 15% 110%, rgba(124, 95, 247, .22), transparent 55%),
              var(--bg);
  padding: 20px;
}
:root.light .auth-screen {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 34px 36px; width: 100%; max-width: 380px; text-align: center;
}
.auth-logo { font-size: 42px; }
.auth-card h1 { margin: 6px 0 2px; font-size: 22px; letter-spacing: 1px; }
.auth-tagline {
  margin: 0 0 10px; color: var(--primary); font-size: 12.5px; font-weight: 600;
  letter-spacing: .3px;
}
.auth-subtitle { margin: 0 0 20px; color: var(--text-soft); font-size: 14px; }
.auth-card form { text-align: left; }

/* ---------- horní lišta ---------- */
.topbar {
  display: flex; align-items: center; gap: 22px;
  background: var(--topbar-bg); color: #fff; padding: 0 20px; height: 54px;
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--border);
}
:root.light .topbar { border-bottom-color: transparent; }
.brand { color: #fff; font-weight: 700; font-size: 16px; white-space: nowrap; }
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a {
  color: #b7c5da; padding: 6px 12px; border-radius: 9px; font-weight: 600; font-size: 14px;
  transition: background .15s, color .15s;
}
.topnav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.topnav a.active { background: rgba(91, 157, 255, .22); color: #fff; }
.topbar-user { display: flex; align-items: center; gap: 10px; color: #dbe4f2; font-size: 14px; }
.topbar-user .btn-ghost { color: #b7c5da; }
.profile-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; background: none; color: #dbe4f2; font: inherit; cursor: pointer;
  padding: 4px 8px; border-radius: 9px; transition: background .15s;
}
.profile-btn:hover { background: rgba(255, 255, 255, .12); }

.topsearch { margin-right: 14px; }
.topsearch input {
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
  color: #fff; border-radius: 9px; padding: 6px 12px; font: inherit; font-size: 13.5px;
  width: 210px; margin: 0; transition: width .2s, background .15s, border-color .15s;
}
.topsearch input::placeholder { color: #8fa0ba; }
.topsearch input:focus { outline: none; background: rgba(255, 255, 255, .16); width: 264px; border-color: var(--primary); box-shadow: none; }

.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-grad); color: #fff; font-size: 12px; font-weight: 700;
  flex: none; text-transform: uppercase;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }

/* ---------- obsah ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 26px 20px 60px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; flex: 1; letter-spacing: -.3px; }
.muted { color: var(--text-soft); }
.empty {
  text-align: center; color: var(--text-soft); padding: 46px 10px;
  border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface-2);
}

/* ---------- seznam projektů (řádky) ---------- */
.project-rows { display: flex; flex-direction: column; gap: 6px; }
.project-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; cursor: pointer; min-width: 0;
  transition: background .12s, border-color .15s;
}
.project-row:hover { background: var(--hover-bg); border-color: var(--primary); }
.project-row.archived { opacity: .55; }
.project-row .row-title {
  flex: 1; min-width: 0; font-weight: 600; font-size: 14.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-row .proj-progress {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-soft); white-space: nowrap;
}
.project-row .proj-progress .progress { display: block; width: 80px; margin: 0; }
.project-row .row-meta { flex: none; font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.project-row .member-stack, .project-row .role-pill { flex: none; }
@media (max-width: 720px) {
  .project-row { flex-wrap: wrap; row-gap: 5px; }
  .project-row .row-title { flex-basis: 100%; white-space: normal; }
}
.member-stack { display: flex; }
.member-stack .avatar.sm { margin-left: -7px; border: 2px solid var(--surface); }
.member-stack .avatar.sm:first-child { margin-left: 0; }

.badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px;
  border-radius: 999px; text-transform: uppercase; letter-spacing: .3px;
}
.badge.active   { background: rgba(91, 157, 255, .18); color: #8ab8ff; }
.badge.done     { background: rgba(67, 209, 124, .16); color: #7ce3a4; }
.badge.archived { background: rgba(146, 165, 192, .16); color: #a8b8ce; }
:root.light .badge.active   { background: #dbeafe; color: #1d4ed8; }
:root.light .badge.done     { background: #dcfce7; color: #15803d; }
:root.light .badge.archived { background: #e2e8f0; color: #475569; }

.progress { height: 7px; background: var(--chip-bg); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #43d17c, #2fb96a); border-radius: 99px; transition: width .25s; }
.progress.over > i { background: var(--danger); }

/* ---------- detail projektu ---------- */
.detail-head {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 22px; margin-bottom: 20px;
}
.detail-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-title-row h1 { margin: 0; font-size: 23px; flex: 1; letter-spacing: -.3px; }
.detail-desc { color: var(--text-soft); margin: 8px 0 0; white-space: pre-wrap; }
.detail-stats { display: flex; gap: 26px; margin-top: 14px; flex-wrap: wrap; }
.stat { min-width: 150px; }
.stat .stat-label { font-size: 12px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: .4px; }
.stat .stat-value { font-size: 19px; font-weight: 700; margin: 2px 0 6px; }
.stat .stat-value small { font-size: 13px; font-weight: 500; color: var(--text-soft); }

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  border: none; background: none; font: inherit; font-weight: 600; color: var(--text-soft);
  padding: 9px 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .count, .group-title .count {
  background: var(--chip-bg); color: var(--text-soft); border-radius: 999px;
  font-size: 11.5px; padding: 1px 7px; margin-left: 5px;
}

/* ---------- barevné tečky stavů (sekce seznamu) ---------- */
.col-todo .dot { background: #8fa3bd; }
.col-in_progress .dot { background: var(--warn); }
.col-done .dot { background: var(--ok); }

/* priority — štítek */
.prio-tag {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px;
  border-radius: 999px; margin-left: 6px; vertical-align: 1px; white-space: nowrap;
}
.prio-tag-4 { background: rgba(244, 114, 107, .16); color: #ff9d97; }
.prio-tag-3 { background: rgba(251, 146, 60, .16); color: #ffb684; }
.prio-tag-2 { background: rgba(245, 181, 68, .16); color: #f8cd6f; }
.prio-tag-1 { background: rgba(91, 157, 255, .16); color: #8ab8ff; }
:root.light .prio-tag-4 { background: #fee2e2; color: #b91c1c; }
:root.light .prio-tag-3 { background: #ffedd5; color: #c2410c; }
:root.light .prio-tag-2 { background: #fef9c3; color: #a16207; }
:root.light .prio-tag-1 { background: #dbeafe; color: #1d4ed8; }

/* lišta nad seznamem úkolů + přepínač řazení */
.kanban-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.kanban-toolbar .spacer { flex: 1; }
.sort-switch {
  display: inline-flex; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 3px; gap: 2px;
}
.sort-btn {
  border: none; background: none; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-soft); padding: 4px 11px; border-radius: 7px; cursor: pointer;
  transition: background .15s, color .15s;
}
.sort-btn:hover { color: var(--text); background: var(--hover-bg); }
/* aktivní volba musí být jednoznačně vidět (kontrast, ne barva) */
.sort-btn.active {
  background: #35507d; color: #fff; font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.sort-btn.active:hover { background: #3d5c8f; color: #fff; }
:root.light .sort-btn.active {
  background: #1f2b45; color: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .3), inset 0 0 0 1px rgba(255, 255, 255, .1);
}
:root.light .sort-btn.active:hover { background: #2b3a5c; color: #fff; }

.due { padding: 1px 7px; border-radius: 999px; background: var(--chip-bg); }
.due.overdue { background: rgba(244, 114, 107, .16); color: #ff9d97; font-weight: 600; }
:root.light .due.overdue { background: #fee2e2; color: #dc2626; }
.task-actions { display: flex; gap: 2px; }
.icon-btn {
  border: none; background: none; cursor: pointer; font-size: 13px;
  color: var(--text-soft); padding: 2px 5px; border-radius: 6px;
  transition: background .15s;
}
.icon-btn:hover { background: var(--hover-bg); color: var(--text); }
.icon-btn.danger:hover { background: rgba(244, 114, 107, .15); color: var(--danger); }
/* rychlý posun stavu úkolu (nahradilo drag & drop) */
.icon-btn.next-status { font-weight: 800; color: var(--primary); }
.icon-btn.next-status:hover { background: rgba(91, 157, 255, .16); }

/* ---------- seznamové (řádkové) zobrazení úkolů ---------- */
.task-list { display: flex; flex-direction: column; gap: 12px; }
.list-section {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px;
  transition: background .15s;
}
.list-section.dragover { outline: 2px dashed var(--primary); outline-offset: -4px; background: rgba(91, 157, 255, .07); }
.list-section h4 {
  margin: 2px 4px 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-soft); display: flex; align-items: center; gap: 7px;
}
.list-section h4 .dot { width: 9px; height: 9px; border-radius: 50%; }
.list-section h4.collapsible { cursor: pointer; user-select: none; }
.list-section h4 .caret { font-size: 11px; }
.list-section.collapsed h4 { margin-bottom: 2px; }
.list-section.collapsed .list-rows { display: none; }
.list-section .list-empty { font-size: 12.5px; margin: 2px 4px 4px; }
.task-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  border-left: 4px solid var(--border);
  padding: 7px 10px; margin-bottom: 6px; cursor: grab;
  font-size: 13.5px; min-width: 0;
  transition: background .12s;
}
.task-row:last-child { margin-bottom: 0; }
.task-row:hover { background: var(--hover-bg); }
.task-row:active { cursor: grabbing; }
.task-row.dragging { opacity: .45; }
.task-row.drop-before { box-shadow: 0 -3px 0 0 var(--primary); }
.task-row.prio-4 { border-left-color: #f4726b; }
.task-row.prio-3 { border-left-color: #fb923c; }
.task-row.prio-2 { border-left-color: #f5b544; }
.task-row.prio-1 { border-left-color: #5b9dff; }
.task-row .row-title {
  flex: 1; min-width: 0; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-row.done .row-title { text-decoration: line-through; color: var(--text-soft); font-weight: 500; }
.task-row .due, .task-row .row-meta { flex: none; font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.task-row .member-stack, .task-row .task-actions { flex: none; }
@media (max-width: 720px) {
  .task-row { flex-wrap: wrap; row-gap: 4px; }
  .task-row .row-title { flex-basis: 100%; white-space: normal; }
}

/* ---------- upozornění: zvonek, panel, souhrnný pruh ---------- */
.bell-btn {
  position: relative; border: none; background: none; cursor: pointer;
  font-size: 17px; line-height: 1; padding: 5px 7px; border-radius: 8px;
  transition: background .15s;
}
.bell-btn:hover { background: var(--hover-bg); }
.bell-btn.has-news { animation: bell-pulse 2s ease-in-out 3; }
@keyframes bell-pulse { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-12deg); } 30% { transform: rotate(10deg); } 45% { transform: rotate(-6deg); } 60% { transform: rotate(0); } }
.bell-count {
  position: absolute; top: -2px; right: -2px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center;
}
.bell-panel {
  position: fixed; top: 56px; right: 14px; z-index: 60; width: min(420px, calc(100vw - 24px));
  max-height: min(70vh, 640px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .45); padding: 12px 14px;
}
:root.light .bell-panel { box-shadow: 0 14px 40px rgba(15, 23, 42, .18); }
.bell-head { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.bell-section { margin-bottom: 12px; }
.bell-section:last-child { margin-bottom: 0; }
.bell-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-soft); margin-bottom: 6px;
}
.bell-empty { font-size: 13px; margin: 2px 0 4px; }
.bell-link { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; }
.bell-link:hover { text-decoration: underline; }
.notif-row {
  display: flex; align-items: flex-start; gap: 9px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 4px solid var(--border); border-radius: 8px;
  padding: 7px 10px; margin-bottom: 6px;
  transition: background .12s;
}
.notif-row:hover { background: var(--hover-bg); }
.notif-icon { flex: none; font-size: 15px; line-height: 1.35; }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-title { font-weight: 600; font-size: 13.5px; }
.notif-meta { font-size: 12px; color: var(--text-soft); }
/* podskupiny termínů v panelu zvonku */
.bell-group { margin-bottom: 8px; }
.bell-group:last-of-type { margin-bottom: 0; }
.bell-group-label {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  margin: 0 0 4px 2px;
}
.bell-group-label.lvl-overdue, .bell-group-label.lvl-today { color: #ff9d97; }
.bell-group-label.lvl-soon { color: #ffb684; }
.bell-group-label.lvl-week { color: #f8cd6f; }
.bell-group-label.lvl-month { color: #8ab8ff; }
:root.light .bell-group-label.lvl-overdue, :root.light .bell-group-label.lvl-today { color: #b91c1c; }
:root.light .bell-group-label.lvl-soon { color: #c2410c; }
:root.light .bell-group-label.lvl-week { color: #a16207; }
:root.light .bell-group-label.lvl-month { color: #1d4ed8; }
.notif-row.lvl-new { border-left-color: var(--primary); }
/* gradace termínů — jednotné barvy všude */
.lvl-overdue { border-left-color: #f4726b; }
.lvl-today { border-left-color: #f4726b; }
.lvl-soon { border-left-color: #fb923c; }
.lvl-week { border-left-color: #f5b544; }
.lvl-month { border-left-color: #5b9dff; }
/* dlaždice termínů = rychlý filtr (stránka Úkoly) — velikost jako filtrovací chipy.
   ZÁMĚRNĚ pilulkový tvar (priority mají hranaté sekce) — dvě různé škály, dva tvary */
.due-tiles { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.due-tile {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 13px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text-soft);
  transition: background .15s, color .15s, border-color .15s;
}
.due-tile b { color: var(--text); font-weight: 800; }
.due-tile:hover { background: var(--hover-bg); color: var(--text); }
/* aktivní dlaždice = barevná výplň */
.due-tile.active, .due-tile.active b { color: #fff; }
.due-tile.active { border-color: transparent; }
.due-tile.tile-new.active { background: var(--primary); }
.due-tile.lvl-overdue.active, .due-tile.lvl-today.active { background: #d9534f; }
.due-tile.lvl-soon.active { background: #e07b25; }
.due-tile.lvl-week.active { background: #c9922a; }
.due-tile.lvl-month.active { background: #3f7fd6; }
.due-tile.tile-ok { cursor: default; }
.due-tile.tile-ok:hover { background: var(--surface-2); color: var(--text-soft); }
/* box blížících se termínů v kalendáři */
.due-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 16px;
}
.due-box-head { font-size: 14.5px; font-weight: 700; margin-bottom: 8px; }
.due-group { margin-bottom: 10px; }
.due-group:last-child { margin-bottom: 0; }
.due-group-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-soft); margin-bottom: 5px; padding-left: 7px; border-left: 3px solid var(--border);
}
.due-group-label.collapsible { cursor: pointer; user-select: none; padding-top: 2px; padding-bottom: 2px; border-radius: 0 6px 6px 0; }
.due-group-label.collapsible:hover { background: var(--hover-bg); color: var(--text); }
.due-group-label .caret { font-size: 11px; }
.due-group.collapsed { margin-bottom: 4px; }
.due-group.collapsed .due-group-label { margin-bottom: 0; }
.due-group.collapsed .due-group-rows { display: none; }

/* ---------- Kalendář ---------- */
/* navigace obdobím: šipky těsně u zobrazeného data/rozmezí */
.cal-nav {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 2px 4px;
}
.cal-arrow {
  border: none; background: none; cursor: pointer; color: var(--text-soft);
  font-size: 17px; line-height: 1; font-weight: 700; padding: 3px 8px; border-radius: 7px;
  transition: background .15s, color .15s;
}
.cal-arrow:hover { background: var(--hover-bg); color: var(--text); }
.cal-title { font-weight: 700; font-size: 15.5px; min-width: 150px; text-align: center; }
.cal-head-row {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 4px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-soft);
}
.cal-head-row div { padding: 0 4px; }
.cal-week-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-cell {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  min-height: 88px; padding: 5px 6px; overflow: hidden; min-width: 0;
}
.cal-cell[data-has] { cursor: pointer; transition: border-color .15s; }
.cal-cell[data-has]:hover { border-color: var(--primary); }
.cal-cell.other { opacity: .45; }
.cal-cell.today { outline: 2px solid var(--primary); outline-offset: -2px; background: rgba(91, 157, 255, .06); }
.cal-daynum {
  font-size: 12px; font-weight: 700; color: var(--text-soft); margin-bottom: 3px;
  display: flex; align-items: center; gap: 5px;
}
.cal-cell.today .cal-daynum { color: var(--primary); }
.cal-today-tag {
  font-size: 9.5px; font-weight: 800; letter-spacing: .5px; color: #fff;
  background: var(--primary); border-radius: 999px; padding: 1px 6px;
}
.cal-chip {
  font-size: 11.5px; font-weight: 600; line-height: 1.3;
  padding: 2px 5px 2px 7px; border-radius: 5px; margin-bottom: 3px;
  background: var(--surface-2); border-left: 3px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.cal-chip:hover { background: var(--hover-bg); }
.cal-chip.prio-c-4 { border-left-color: #f4726b; }
.cal-chip.prio-c-3 { border-left-color: #fb923c; }
.cal-chip.prio-c-2 { border-left-color: #f5b544; }
.cal-chip.prio-c-1 { border-left-color: #5b9dff; }
.cal-chip.done { text-decoration: line-through; color: var(--text-soft); border-left-color: var(--ok); }
.cal-chip.late { background: rgba(244, 114, 107, .14); color: #ff9d97; }
:root.light .cal-chip.late { background: #fee2e2; color: #b91c1c; }
.cal-more { font-size: 11px; color: var(--text-soft); font-weight: 600; }
.cal-today-sec { outline: 2px solid var(--primary); outline-offset: -2px; }
/* roční přehled */
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cal-mini {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; cursor: pointer; transition: border-color .15s;
}
.cal-mini:hover { border-color: var(--primary); }
.cal-mini-name { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.cal-mini-name .count { color: var(--text-soft); font-weight: 600; font-size: 11.5px; }
.cal-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.cal-mini-day { font-size: 10px; text-align: center; padding: 2px 0; border-radius: 4px; color: var(--text-soft); }
.cal-mini-day.has { background: rgba(91, 157, 255, .18); color: var(--text); font-weight: 700; }
:root.light .cal-mini-day.has { background: #dbeafe; }
.cal-mini-day.today { outline: 2px solid var(--primary); outline-offset: -1px; font-weight: 800; }
.cal-day-list { display: flex; flex-direction: column; margin-bottom: 4px; }
.cal-day-list .task-row { cursor: pointer; }
@media (max-width: 720px) {
  .cal-cell { min-height: 58px; padding: 3px 4px; }
  .cal-chip { font-size: 10px; padding: 1px 3px 1px 5px; }
  .cal-title { font-size: 13.5px; }
}

/* ---------- tabulky (náklady, uživatelé) ---------- */
.table-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-soft); background: var(--surface-2); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--hover-bg); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; background: var(--surface-2); }

/* ---------- komentáře / historie ---------- */
.comment-list, .history-list { display: flex; flex-direction: column; gap: 10px; }
.comment {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; display: flex; gap: 11px;
}
.comment .comment-head { font-size: 13px; color: var(--text-soft); margin-bottom: 3px; }
.comment .comment-head b { color: var(--text); }
.comment .comment-body { white-space: pre-wrap; }
.comment-form { display: flex; gap: 10px; margin-top: 14px; align-items: flex-start; }
.comment-form textarea { flex: 1; margin: 0; min-height: 44px; }

.history-item { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; padding: 7px 4px; border-bottom: 1px dashed var(--border); }
.history-item time { color: var(--text-soft); font-size: 12px; white-space: nowrap; min-width: 118px; }

/* ---------- členové ---------- */
.member-list { display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.member-row {
  display: flex; align-items: center; gap: 11px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 13px;
}
.member-row .grow { flex: 1; }
.member-row .uname { color: var(--text-soft); font-size: 12.5px; }

/* online indikátor na stránce Uživatelé */
.online-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 6px rgba(67, 209, 124, .7);
  margin-right: 3px; vertical-align: 1px;
}

/* čtecí detail úkolu (klik na kartu) */
.task-view-title { margin: 0 0 12px; font-size: 19px; line-height: 1.35; }
.view-rows { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.view-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.view-label {
  min-width: 86px; flex: none; font-size: 12px; font-weight: 700;
  color: var(--text-soft); text-transform: uppercase; letter-spacing: .4px;
}
.view-row .avatar.sm { vertical-align: -6px; }
.view-desc {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 12px; margin-bottom: 12px; white-space: pre-wrap; font-size: 14px;
}

/* dokumenty (záložka + sekce v úkolu) */
.doc-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.doc-row {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px;
}
.doc-icon { font-size: 17px; flex: none; }
.doc-name {
  flex: 1; min-width: 0; font-weight: 600; color: var(--text); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doc-name:hover { color: var(--primary); text-decoration: underline; }
.doc-meta { flex: none; font-size: 12px; color: var(--text-soft); white-space: nowrap; }
a.icon-btn { text-decoration: none; }
@media (max-width: 720px) {
  .doc-row { flex-wrap: wrap; row-gap: 4px; }
  .doc-name { flex-basis: 100%; white-space: normal; }
}

/* poznámky k úkolu (čtecí detail) */
.task-notes { margin-bottom: 12px; }
.task-note {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 10px; margin-bottom: 7px;
}
.task-note-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-soft); margin-bottom: 4px;
}
.task-note-head b { color: var(--text); }
.task-note-head .spacer { flex: 1; }
.task-note-body { white-space: pre-wrap; font-size: 13.5px; }
.task-note-form { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.task-note-form textarea { flex: 1; margin: 0; min-height: 40px; }
.task-note-editarea { width: 100%; min-height: 56px; margin: 0 0 6px; }
.task-note-editacts { display: flex; gap: 6px; justify-content: flex-end; }

/* nebezpečná zóna v úpravě projektu (mazání — jen admin) */
.danger-zone {
  margin-top: 16px; padding-top: 12px;
  border-top: 1px dashed rgba(244, 114, 107, .45);
}

/* náhled součtu v modalu nákladu */
.cost-total-preview {
  margin: -4px 0 12px; font-size: 13.5px; font-weight: 600;
  color: var(--primary);
}

/* přesun úkolu do jiného projektu */
.task-move-row { display: flex; gap: 8px; align-items: center; }
.task-move-row select { flex: 1; margin: 0; }

/* ---------- stránka Úkoly (napříč projekty) ---------- */
.task-row-list { display: flex; flex-direction: column; gap: 8px; }
.task-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--border); border-radius: 10px;
  padding: 10px 14px; cursor: pointer;
  transition: transform .12s, border-color .15s;
}
.task-row:hover { transform: translateX(3px); border-color: var(--primary); }
.task-row.prio-4 { border-left-color: #f4726b; }
.task-row.prio-3 { border-left-color: #fb923c; }
.task-row.prio-2 { border-left-color: #f5b544; }
.task-row.prio-1 { border-left-color: #5b9dff; }
.task-row.done .task-row-title { text-decoration: line-through; color: var(--text-soft); }
/* úkol po termínu — červený nádech celého řádku, ať je vidět na první pohled (obě stránky) */
.task-row.overdue { background: rgba(244, 114, 107, .10); }
.task-row.overdue:hover { background: rgba(244, 114, 107, .17); }
:root.light .task-row.overdue { background: #fef2f2; }
:root.light .task-row.overdue:hover { background: #fee2e2; }
.task-row .due.overdue { font-weight: 700; }
/* archiv Hotové: termín → reálné dokončení (červeně, když se nestihlo) */
.task-row .done-dates { flex: none; font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.done-dates .done-late { color: #ff9d97; font-weight: 700; }
:root.light .done-dates .done-late { color: #dc2626; }
.task-row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-row-title { font-weight: 600; }
.status-chip {
  font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  white-space: nowrap;
}
.status-chip.st-todo { background: rgba(146, 165, 192, .16); color: #a8b8ce; }
.status-chip.st-in_progress { background: rgba(245, 181, 68, .16); color: #f8cd6f; }
.status-chip.st-done { background: rgba(67, 209, 124, .16); color: #7ce3a4; }
:root.light .status-chip.st-todo { background: #e2e8f0; color: #475569; }
:root.light .status-chip.st-in_progress { background: #fef3c7; color: #a16207; }
:root.light .status-chip.st-done { background: #dcfce7; color: #15803d; }
.done-toggle {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  font-size: 13px; color: var(--text-soft); cursor: pointer; font-weight: 600;
}
.done-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }

@media (max-width: 720px) {
  .task-row { flex-wrap: wrap; gap: 8px; }
}

/* přiřazení úkolu více lidem (checkboxy v modalu) */
.assignee-checks {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px; margin-bottom: 14px;
}
.assignee-check {
  display: flex; align-items: center; gap: 8px; margin: 0;
  border: 1px solid var(--border); border-radius: 9px; padding: 6px 10px;
  cursor: pointer; font-weight: 500; color: var(--text); font-size: 13.5px;
  transition: border-color .15s, background .15s;
}
.assignee-check:hover { border-color: var(--primary); }
.assignee-check:has(input:checked) { background: rgba(91, 157, 255, .12); border-color: var(--primary); }
.assignee-check input[type=checkbox] {
  width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--primary);
  display: inline-block;
}
/* nečlenové projektu (jen pro správce) — zaškrtnutím se přidají do projektu */
.assignee-check.nonmember { opacity: .55; border-style: dashed; }
.assignee-check.nonmember:hover,
.assignee-check.nonmember:has(input:checked) { opacity: 1; }
.nonmember-tag {
  font-size: 10.5px; font-weight: 700; color: var(--text-soft);
  background: var(--chip-bg); border-radius: 999px; padding: 1px 7px; white-space: nowrap;
}
.assignee-hint { font-size: 12.5px; margin: -8px 0 12px; }
.more-count {
  font-size: 11px; font-weight: 700; color: var(--text-soft); align-self: center;
  margin-left: 3px;
}

/* zaškrtávací správa viditelnosti projektu */
.member-check input[type=checkbox] {
  width: 18px; height: 18px; margin: 0; flex: none; cursor: pointer;
  accent-color: var(--primary);
}
.member-check:not(.is-member) { opacity: .6; background: var(--surface-2); }
.member-check:not(.is-member):hover { opacity: 1; }

/* ---------- skupiny projektů / sekce fotek ---------- */
.project-group, .photo-group { margin-bottom: 26px; }
.group-title {
  font-size: 15px; margin: 0 0 10px; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: .5px; display: flex; align-items: center; gap: 8px;
}
.group-title .count { text-transform: none; letter-spacing: 0; }
/* sbalitelné skupiny na stránce Projekty (stav si pamatuje prohlížeč) */
.group-title.collapsible { cursor: pointer; user-select: none; border-radius: 8px; padding: 4px 6px; margin-left: -6px; }
.group-title.collapsible:hover { background: var(--hover-bg); color: var(--text); }
.group-title .caret { font-size: 12px; }
.project-group.collapsed { margin-bottom: 10px; }
.project-group.collapsed .project-rows { display: none; }
.group-list .group-row { display: flex; gap: 8px; align-items: center; margin-bottom: 9px; }
.group-list .group-row input { margin: 0; flex: 1; }

/* ---------- vyhledávání ---------- */
.search-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.search-hit {
  display: flex; gap: 12px; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 11px 15px; cursor: pointer; transition: transform .12s, border-color .15s;
}
.search-hit:hover { transform: translateX(3px); border-color: var(--primary); }
.search-hit .grow { flex: 1; min-width: 0; }
.search-icon { font-size: 18px; }
.search-title { font-weight: 600; }
.search-snippet { color: var(--text-soft); font-size: 13px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-project {
  background: rgba(91, 157, 255, .16); color: #8ab8ff; border-radius: 999px; font-size: 12px;
  font-weight: 600; padding: 2px 10px; white-space: nowrap;
}
:root.light .search-project { background: #eef2ff; color: #3730a3; }
mark { background: var(--warn); color: #101828; border-radius: 3px; padding: 0 1px; }

/* zvýraznění cíle po prokliknutí z hledání */
@keyframes flashfade {
  0%, 55% { box-shadow: 0 0 0 3px var(--warn); }
  100% { box-shadow: 0 0 0 3px transparent; }
}
.flash { animation: flashfade 2.5s ease-out; }
tr.flash td { background: rgba(245, 181, 68, .16); transition: background 2s; }

/* ---------- fotky ---------- */
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px;
}
.photo-card {
  position: relative; margin: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.photo-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.photo-card img {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in;
  background: var(--surface-2);
}
.photo-card .photo-meta {
  padding: 8px 10px; font-size: 12px; color: var(--text-soft); line-height: 1.5;
}
.photo-card .photo-meta b { color: var(--text); }
.photo-task {
  display: inline-block; background: var(--chip-bg); border-radius: 999px;
  padding: 0 8px; margin-left: 4px; white-space: nowrap; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}
.photo-del {
  position: absolute; top: 6px; right: 6px; border: none; cursor: pointer;
  background: rgba(10, 15, 26, .6); color: #fff; border-radius: 8px;
  padding: 4px 7px; font-size: 13px;
}
.photo-del:hover { background: rgba(244, 114, 107, .85); }

.lightbox {
  position: fixed; inset: 0; z-index: 120; background: rgba(4, 8, 16, .9);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out; padding: 18px; overflow-y: auto;
}
.lightbox-inner {
  position: relative; cursor: default; display: flex; flex-direction: column;
  align-items: center; gap: 10px; max-width: min(94vw, 760px); margin: auto;
}
.lightbox img {
  max-width: 100%; max-height: 58vh; border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .6); background: #fff;
}
.lightbox-caption { color: #dbe4f2; font-size: 13.5px; text-align: center; line-height: 1.5; }
.lightbox-panel {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
}
.lightbox-panel .lightbox-caption { color: var(--text-soft); text-align: left; margin-bottom: 8px; }
.lb-comments { max-height: 24vh; overflow-y: auto; margin-bottom: 10px; }
.lb-comment {
  font-size: 13.5px; padding: 6px 2px; border-bottom: 1px dashed var(--border);
  line-height: 1.45; white-space: pre-wrap;
}
.lb-comment:last-child { border-bottom: none; }
.lb-comment-form { display: flex; gap: 8px; align-items: flex-start; }
.lb-comment-form textarea { flex: 1; margin: 0; min-height: 40px; }
.lightbox-close {
  position: absolute; top: -6px; right: -6px; border: none; cursor: pointer;
  background: rgba(10, 15, 26, .75); color: #fff; border-radius: 8px;
  padding: 6px 10px; font-size: 14px; z-index: 2;
}
.lightbox-close:hover { background: rgba(244, 114, 107, .85); }

.task-photos-mini {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}
.task-photos-mini img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); cursor: zoom-in;
}
.photo-add-mini {
  width: 64px; height: 64px; border-radius: 8px; border: 2px dashed var(--border);
  background: none; cursor: pointer; color: var(--text-soft); font-size: 13px; font-weight: 600;
  transition: border-color .15s, color .15s;
}
.photo-add-mini:hover { border-color: var(--primary); color: var(--primary); }
/* miniatura s mazátkem (editace úkolu) */
.mini-wrap { position: relative; display: inline-block; line-height: 0; }
.mini-del {
  position: absolute; top: 3px; right: 3px; border: none; cursor: pointer;
  background: rgba(15, 23, 42, .72); color: #fff; border-radius: 6px;
  font-size: 11px; line-height: 1; padding: 3px 4px;
  opacity: 0; transition: opacity .15s, background .15s;
}
.mini-wrap:hover .mini-del, .mini-del:focus { opacity: 1; }
.mini-del:hover { background: var(--danger); }
@media (pointer: coarse) { .mini-del { opacity: 1; padding: 5px 6px; font-size: 13px; } }
/* mazání fotky ve velkém náhledu */
.lightbox-panel .lb-del { align-self: flex-start; margin-top: 4px; }

/* ---------- náklady ---------- */
.cost-task {
  display: inline-block; background: var(--chip-bg); border-radius: 999px;
  padding: 1px 8px; font-size: 12.5px; white-space: nowrap;
}
.task-costs-mini { margin-bottom: 14px; }
.task-cost-row {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 2px; border-bottom: 1px dashed var(--border); font-size: 13.5px;
}
.task-cost-row .cost-desc { flex: 1; min-width: 0; }
.task-cost-row .num { font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: auto; }
.task-cost-row .cost-acts { flex: none; display: flex; gap: 1px; }
.task-cost-row .cost-acts .icon-btn { font-size: 12px; padding: 1px 4px; }
.task-costs-mini .btn { margin-top: 8px; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4, 8, 16, .66);
  display: flex; align-items: flex-start; justify-content: center; z-index: 50;
  padding: 60px 16px 16px; overflow-y: auto;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
  width: 100%; max-width: 460px; animation: pop .16s ease-out;
}
:root.light .modal { box-shadow: var(--shadow); }
@keyframes pop { from { transform: scale(.96) translateY(6px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-head { display: flex; align-items: center; padding: 16px 20px 0; }
.modal-head h2 { margin: 0; font-size: 18px; flex: 1; }
.modal-close { border: none; background: none; font-size: 15px; cursor: pointer; color: var(--text-soft); padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: var(--hover-bg); color: var(--text); }
.modal-body { padding: 14px 20px 20px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 11px;
  font-size: 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, .45); z-index: 99; max-width: 90vw;
}
:root.light .toast { background: #0f172a; color: #fff; border-color: transparent; }
.toast.error { background: var(--danger); color: #fff; border-color: transparent; }

/* ---------- role / uživatelé ---------- */
.role-pill { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.role-pill.admin,
.role-pill.manager { background: rgba(245, 181, 68, .16); color: #f8cd6f; }
.role-pill.member,
.role-pill.editor { background: rgba(91, 157, 255, .16); color: #8ab8ff; }
.role-pill.viewer { background: rgba(146, 165, 192, .16); color: #a8b8ce; }
:root.light .role-pill.admin,
:root.light .role-pill.manager { background: #fde68a; color: #92400e; }
:root.light .role-pill.member,
:root.light .role-pill.editor { background: #dbeafe; color: #1d4ed8; }
:root.light .role-pill.viewer { background: #e2e8f0; color: #475569; }
.inactive-row { opacity: .55; }

/* ---------- mobil (úzké displeje) ---------- */
@media (max-width: 720px) {
  /* topbar: dva řádky — logo + uživatel nahoře, menu + hledání pod tím */
  .topbar {
    flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px 10px;
    row-gap: 8px;
  }
  .brand { order: 1; font-size: 15px; }
  .topbar-user { order: 2; margin-left: auto; gap: 7px; }
  .topnav { order: 3; flex: 0 1 auto; }
  .topsearch { order: 4; flex: 1 1 130px; margin-right: 0; }
  .topsearch input { width: 100%; }
  .topsearch input:focus { width: 100%; }
  #me-name { display: none; }             /* jméno je v avataru — šetří místo */

  main { padding: 16px 12px 50px; }
  .page-head h1 { font-size: 20px; }
  .detail-title-row h1 { font-size: 19px; }
  .detail-stats { gap: 14px; }
  .stat { min-width: 120px; }

  /* formuláře: pole pod sebe */
  .form-row { flex-direction: column; gap: 0; }

  /* komentářový formulář pod sebe */
  .comment-form { flex-direction: column; }
  .comment-form .btn { align-self: flex-end; }
}

/* větší dotykové cíle na zařízeních bez myši */
@media (pointer: coarse) {
  .icon-btn { padding: 9px 11px; font-size: 15px; }
  .tabs button { padding: 11px 14px; }
  .sort-btn { padding: 8px 12px; }
  .btn-sm { padding: 8px 13px; }
  .photo-del { padding: 8px 11px; }
  .member-check input[type=checkbox] { width: 22px; height: 22px; }
  input[type=text], input[type=password], input[type=number], input[type=date],
  input[type=search], textarea, select { padding: 11px 12px; }
}
