/* ─── Reset & základní proměnné ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w: 240px;
  --header-h: 60px;
  --color-bg:      #f4f6f9;
  --color-surface: #ffffff;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-accent:  #0ea5e9;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-danger:  #dc2626;
  --color-text:    #1e293b;
  --color-muted:   #64748b;
  --color-border:  #e2e8f0;
  --color-sidebar: #1e293b;
  --color-sidebar-text: #cbd5e1;
  --color-sidebar-active: #2563eb;
  --radius:  8px;
  --radius-lg: 12px;
  --shadow:  0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --transition: 0.15s ease;
}

html { font-size: 16px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── Přihlašovací obrazovka ──────────────────────────────────────────────── */
#login-screen {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
#login-screen.hidden { display: none; }

.login-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-card .logo {
  width: 56px; height: 56px;
  background: var(--color-primary);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.5rem; color: white;
}
.login-card h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: .25rem; }
.login-card p.subtitle { color: var(--color-muted); font-size: .9rem; margin-bottom: 1.75rem; }

.login-card select {
  width: 100%; padding: .75rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem; color: var(--color-text);
  background: var(--color-bg);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  cursor: pointer;
  margin-bottom: 1.25rem;
  outline: none;
}
.login-card select:focus { border-color: var(--color-primary); }

#auth-status {
  font-size: .825rem; color: var(--color-muted);
  margin-bottom: 1rem; min-height: 1.2em;
}
#auth-status.error { color: var(--color-danger); }

/* ─── Layout ──────────────────────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }
#app.hidden { display: none; }

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--color-sidebar);
  color: var(--color-sidebar-text);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  text-align: center;
}
.sidebar-logo {
  height: 48px; width: auto;
  filter: brightness(0) invert(1);
  opacity: .92;
}
.sidebar-brand .name { font-weight: 700; font-size: .95rem; color: #f1f5f9; line-height: 1.2; }
.sidebar-brand .sub  { font-size: .72rem; color: var(--color-sidebar-text); opacity: .6; }

.sidebar-user {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: .75rem;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: white; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info .name { font-size: .85rem; font-weight: 600; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .role { font-size: .72rem; color: var(--color-sidebar-text); opacity: .7; }
.sidebar-user button.logout-btn {
  background: none; border: none; cursor: pointer;
  color: var(--color-sidebar-text); opacity: .5; padding: .25rem;
  border-radius: 4px; font-size: .85rem;
  transition: opacity var(--transition);
}
.sidebar-user button.logout-btn:hover { opacity: 1; }

nav.sidebar-nav { flex: 1; padding: .75rem 0; overflow-y: auto; }

.nav-section { margin-bottom: .25rem; }
.nav-section-title {
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: rgba(255,255,255,.3);
  padding: .5rem 1.25rem .25rem;
}
.nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem 1.25rem;
  cursor: pointer;
  border-radius: 0;
  font-size: .875rem; font-weight: 500;
  color: var(--color-sidebar-text);
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #f1f5f9; }
.nav-item.active {
  background: rgba(37,99,235,.25);
  color: #93c5fd;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--color-primary);
  border-radius: 0 2px 2px 0;
}
.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item .badge {
  margin-left: auto;
  background: var(--color-primary);
  color: white; font-size: .65rem; font-weight: 700;
  padding: .1rem .4rem; border-radius: 999px; min-width: 18px; text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .75rem; color: rgba(255,255,255,.25);
  text-align: center;
}

/* ─── Hlavní obsah ────────────────────────────────────────────────────────── */
#main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center;
  padding: 0 1.75rem;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.topbar h2 { font-size: 1.1rem; font-weight: 700; flex: 1; }
.topbar .topbar-actions { display: flex; align-items: center; gap: .75rem; }

.hamburger {
  display: none; background: none; border: none;
  cursor: pointer; font-size: 1.25rem; padding: .25rem;
  color: var(--color-text);
}

#page-content { padding: 1.75rem; flex: 1; }

/* ─── Karty / panely ──────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; gap: .75rem;
}
.card-header h3 { font-size: .95rem; font-weight: 700; flex: 1; }
.card-body { padding: 1.25rem; }

/* ─── Dashboard ───────────────────────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex; align-items: flex-start; gap: 1rem;
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.stat-icon.blue   { background: #dbeafe; }
.stat-icon.green  { background: #dcfce7; }
.stat-icon.yellow { background: #fef9c3; }
.stat-icon.purple { background: #f3e8ff; }
.stat-val { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-lbl { font-size: .78rem; color: var(--color-muted); margin-top: .2rem; }
.stat-card-link { transition: box-shadow var(--transition), transform var(--transition); }
.stat-card-link:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.dash-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }

/* ─── Activity log ────────────────────────────────────────────────────────── */
.akt-item {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--color-border);
}
.akt-item:last-child { border-bottom: none; }
.akt-icon { font-size: 1rem; margin-top: .05rem; flex-shrink: 0; }
.akt-body { flex: 1; min-width: 0; }
.akt-text { font-size: .82rem; line-height: 1.4; color: var(--color-text); }
.akt-autor { font-weight: 700; margin-right: .3rem; }
.akt-proj {
  font-size: .75rem; color: var(--color-primary);
  margin-top: .15rem; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.akt-proj:hover { text-decoration: underline; }
.akt-time { font-size: .72rem; color: var(--color-muted); white-space: nowrap; flex-shrink: 0; margin-top: .1rem; }

/* ─── Tlačítka ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: var(--radius);
  font-size: .875rem; font-weight: 600; cursor: pointer;
  border: none; transition: background var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--color-primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--color-primary-dark); }
.btn-secondary { background: var(--color-bg); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-secondary:hover:not(:disabled) { background: var(--color-border); }
.btn-danger    { background: #fee2e2; color: var(--color-danger); }
.btn-danger:hover:not(:disabled) { background: #fecaca; }
.btn-success   { background: #dcfce7; color: var(--color-success); }
.btn-ghost     { background: transparent; color: var(--color-muted); border: none; }
.btn-ghost:hover { background: var(--color-bg); color: var(--color-text); }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; }
.btn-icon { padding: .4rem; border-radius: var(--radius); background: none; border: none; cursor: pointer; color: var(--color-muted); font-size: 1rem; transition: background var(--transition); }
.btn-icon:hover { background: var(--color-bg); color: var(--color-text); }

/* ─── Formulářové prvky ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .825rem; font-weight: 600; margin-bottom: .375rem; color: var(--color-text); }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: .6rem .875rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .9rem; color: var(--color-text);
  background: var(--color-surface);
  outline: none; transition: border-color var(--transition);
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ─── Modální okna ────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 1rem;
  animation: fadeIn .15s ease;
}
.modal-backdrop.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 580px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease;
}
.modal.modal-lg { max-width: 760px; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center;
}
.modal-header h3 { flex: 1; font-size: 1.05rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--color-muted); padding: .2rem; border-radius: 4px; }
.modal-close:hover { color: var(--color-text); background: var(--color-bg); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex; justify-content: flex-end; gap: .75rem;
}

/* ─── Projekty ────────────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.page-header h2 { font-size: 1.35rem; font-weight: 800; flex: 1; }

/* ─── Sekce projektů (seskupení podle stavu) ────────────────────────────── */
.proj-sekce { margin-bottom: 1.5rem; }

.proj-sekce-header {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  margin-bottom: .85rem;
  transition: background var(--transition);
}
.proj-sekce-header:hover { background: #f8fafc; }

.proj-sekce-icon { font-size: 1rem; }
.proj-sekce-label { font-size: .95rem; font-weight: 700; flex: 1; }
.proj-sekce-cnt {
  font-size: .72rem; font-weight: 700;
  padding: .15rem .55rem; border-radius: 99px;
}
.proj-sekce-chevron { font-size: .8rem; color: var(--color-muted); }

/* ─── Projekty – mřížka a karty ────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.project-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  border-left-width: 4px;        /* barevný okraj dle stavu (nastavuje JS) */
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  overflow: hidden;
}
.project-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.project-card-header { padding: .9rem 1.1rem .65rem 1rem; }
.project-card-header h4 { font-size: .95rem; font-weight: 700; margin-bottom: .3rem; line-height: 1.35; }
.project-card-header p  { font-size: .8rem; color: var(--color-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.project-card-footer {
  padding: .6rem 1.1rem .6rem 1rem;
  border-top: 1px solid var(--color-border);
  display: flex; align-items: center; gap: .5rem;
  background: var(--color-bg);
}
.project-meta { display: flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--color-muted); white-space: nowrap; }
.progress-bar { flex: 1; height: 4px; background: var(--color-border); border-radius: 99px; overflow: hidden; min-width: 40px; }
.progress-bar-fill { height: 100%; border-radius: 99px; transition: width .3s; }

/* status-dot se stále používá v detailu projektu */
.status-dot {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; padding: .2rem .55rem;
  border-radius: 999px;
}
.status-dot.todo       { background: #f1f5f9; color: #475569; }
.status-dot.inprogress { background: #dbeafe; color: #1e40af; }
.status-dot.done       { background: #dcfce7; color: #14532d; }
.status-dot.paused     { background: #fef3c7; color: #92400e; }

/* ─── Úkoly ───────────────────────────────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: .5rem; }
.task-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .85rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: background var(--transition);
}
.task-item:hover { background: #fafbff; }
.task-item.done-task { opacity: .6; }
.task-check {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 2px solid var(--color-border);
  border-radius: 5px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-top: .1rem;
  transition: background var(--transition), border-color var(--transition);
}
.task-check.checked { background: var(--color-primary); border-color: var(--color-primary); color: white; font-size: .75rem; }
.task-content { flex: 1; min-width: 0; }
.task-content .task-name { font-size: .9rem; font-weight: 600; }
.task-item.done-task .task-name { text-decoration: line-through; }
.task-meta-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .25rem; }
.tag { display: inline-flex; align-items: center; gap: .2rem; font-size: .72rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; }
.tag-prio-high  { background: #fee2e2; color: var(--color-danger); }
.tag-prio-med   { background: #fef9c3; color: #92400e; }
.tag-prio-low   { background: #f1f5f9; color: var(--color-muted); }
.tag-user { background: var(--color-primary-light); color: var(--color-primary-dark); }
.task-deadline { font-size: .75rem; color: var(--color-muted); }
.task-deadline.overdue { color: var(--color-danger); font-weight: 600; }
.task-actions { display: flex; gap: .25rem; flex-shrink: 0; }

/* Kanban sloupce v detailu projektu */
.kanban { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.kanban-col { background: var(--color-bg); border-radius: var(--radius); padding: .75rem; }
.kanban-col-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--color-muted); margin-bottom: .75rem; display: flex; align-items: center; gap: .4rem; }
.kanban-col-title .cnt { background: var(--color-border); border-radius: 999px; padding: .1rem .45rem; font-size: .68rem; }

/* ─── Nástěnka ────────────────────────────────────────────────────────────── */
.post-list { display: flex; flex-direction: column; gap: 1rem; }
.post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.post-header { padding: 1rem 1.25rem .75rem; display: flex; align-items: flex-start; gap: .75rem; }
.post-header .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.post-info { flex: 1; }
.post-info .author { font-weight: 700; font-size: .9rem; }
.post-info .date   { font-size: .75rem; color: var(--color-muted); }
.post-body { padding: 0 1.25rem .75rem; font-size: .9rem; white-space: pre-wrap; line-height: 1.65; }
.post-deadline-badge { margin: 0 1.25rem .75rem; display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; background: #fef9c3; color: #92400e; padding: .25rem .65rem; border-radius: 999px; font-weight: 600; }
.post-footer {
  padding: .65rem 1.25rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  display: flex; align-items: center; gap: .5rem;
}
.like-btn {
  display: flex; align-items: center; gap: .3rem;
  background: none; border: 1px solid var(--color-border);
  border-radius: 999px; padding: .3rem .75rem;
  font-size: .82rem; cursor: pointer; color: var(--color-muted);
  transition: all var(--transition);
}
.like-btn:hover, .like-btn.liked { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.comment-toggle-btn { background: none; border: none; cursor: pointer; font-size: .82rem; color: var(--color-muted); padding: .3rem .5rem; border-radius: var(--radius); transition: background var(--transition); }
.comment-toggle-btn:hover { background: var(--color-border); color: var(--color-text); }

.comments-section { border-top: 1px solid var(--color-border); }
.comments-section.hidden { display: none; }
.comment-item { padding: .75rem 1.25rem; border-bottom: 1px solid var(--color-border); display: flex; gap: .65rem; }
.comment-item:last-child { border-bottom: none; }
.comment-item .avatar { width: 28px; height: 28px; font-size: .68rem; }
.comment-item .c-author { font-weight: 700; font-size: .82rem; }
.comment-item .c-text  { font-size: .85rem; margin-top: .1rem; }
.comment-item .c-date  { font-size: .72rem; color: var(--color-muted); }
.comment-form { padding: .75rem 1.25rem; display: flex; gap: .65rem; align-items: flex-start; background: var(--color-bg); }
.comment-form input { flex: 1; padding: .5rem .75rem; border: 1.5px solid var(--color-border); border-radius: var(--radius); font-size: .875rem; outline: none; }
.comment-form input:focus { border-color: var(--color-primary); }

/* ─── Ankety ──────────────────────────────────────────────────────────────── */
.poll-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.poll-question { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.poll-options { display: flex; flex-direction: column; gap: .6rem; }
.poll-option-row { display: flex; align-items: center; gap: .75rem; }
.poll-option-row label { font-size: .875rem; cursor: pointer; flex: 1; }
.poll-option-row input[type=radio] { accent-color: var(--color-primary); }
.poll-bar-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .4rem; }
.poll-bar-label { font-size: .85rem; min-width: 160px; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poll-bar-wrap { flex: 1; height: 10px; background: var(--color-bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--color-border); }
.poll-bar-fill { height: 100%; background: var(--color-primary); border-radius: 999px; transition: width .5s; }
.poll-bar-count { font-size: .8rem; color: var(--color-muted); min-width: 24px; text-align: right; }
.poll-meta { font-size: .78rem; color: var(--color-muted); margin-top: .75rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.poll-voted-badge { font-size: .75rem; background: #dcfce7; color: var(--color-success); padding: .2rem .6rem; border-radius: 999px; font-weight: 600; }

/* ─── Šablony ─────────────────────────────────────────────────────────────── */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.template-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex; align-items: flex-start; gap: .85rem;
}
.template-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 10px; background: #dbeafe;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.template-info { flex: 1; min-width: 0; }
.template-info h4 { font-size: .9rem; font-weight: 700; margin-bottom: .2rem; }
.template-info p  { font-size: .78rem; color: var(--color-muted); }
.template-info .meta { font-size: .72rem; color: var(--color-muted); margin-top: .35rem; }

/* ─── Pomocné třídy ───────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex   { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.text-muted { color: var(--color-muted); font-size: .85rem; }
.text-sm    { font-size: .85rem; }
.text-xs    { font-size: .75rem; }
.text-center { text-align: center; }
.w-full { width: 100%; }

.loading-spinner {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem; color: var(--color-muted); gap: 1rem;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--color-muted);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: .75rem; }
.empty-state p { font-size: .9rem; }

.section-tabs { display: flex; gap: .25rem; margin-bottom: 1.25rem; background: var(--color-bg); padding: .25rem; border-radius: var(--radius); display: inline-flex; }
.tab-btn { padding: .4rem .9rem; border-radius: calc(var(--radius) - 2px); font-size: .85rem; font-weight: 600; cursor: pointer; border: none; background: none; color: var(--color-muted); transition: all var(--transition); }
.tab-btn.active { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow); }

/* ─── Toast notifikace ────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  display: flex; flex-direction: column; gap: .5rem;
  pointer-events: none;
}
.toast {
  background: var(--color-text); color: white;
  padding: .75rem 1.1rem; border-radius: var(--radius);
  font-size: .875rem; box-shadow: var(--shadow-md);
  animation: toastIn .25s ease; pointer-events: auto;
  display: flex; align-items: center; gap: .5rem;
  max-width: 360px;
}
.toast.success { background: var(--color-success); }
.toast.error   { background: var(--color-danger); }
.toast.warning { background: var(--color-warning); }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Přepínač stavu projektu ────────────────────────────────────────────── */
.stav-select {
  padding: .3rem .6rem; border-radius: var(--radius);
  font-size: .8rem; font-weight: 600; border: 1.5px solid var(--color-border);
  cursor: pointer; outline: none; background: var(--color-bg);
}

/* ─── Responzivita ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  #main-content { margin-left: 0; }
  .hamburger { display: block; }
  .dash-cols { grid-template-columns: 1fr; }
  .dash-cols > .card { margin-bottom: 0; }
  .kanban { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  #page-content { padding: 1rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .projects-grid { grid-template-columns: 1fr; }
  .templates-grid { grid-template-columns: 1fr; }
  .modal { max-width: 100%; max-height: 100vh; border-radius: var(--radius) var(--radius) 0 0; }
  .modal-backdrop { align-items: flex-end; }
}

/* ─── Sidebar overlay (mobil) ───────────────────────────────────────────── */
#sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99;
}
#sidebar-overlay.visible { display: block; }

/* ─── Archivované projekty ───────────────────────────────────────────────── */
.status-dot.archived { background: #f1f5f9; color: #94a3b8; }
.project-card-archived { opacity: .55; filter: grayscale(.4); }
.project-card-archived:hover { opacity: .85; }

/* ─── Finanční souhrn (dashboard) ────────────────────────────────────────── */
.fin-bar {
  display: flex; align-items: center; gap: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  padding: .6rem 1.25rem;
  flex-wrap: wrap;
}
.fin-bar-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem .85rem;
  flex: 1; min-width: 140px;
}
.fin-bar-icon { font-size: 1.05rem; }
.fin-bar-val  { font-size: 1rem; font-weight: 700; color: var(--color-text); }
.fin-bar-lbl  { font-size: .78rem; color: var(--color-muted); }
.fin-bar-sep  { width: 1px; height: 30px; background: var(--color-border); flex-shrink: 0; }

/* ─── Přehled termínů ────────────────────────────────────────────────────── */
.termin-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background var(--transition);
}
.termin-row:last-child { border-bottom: none; }
.termin-row:hover { background: #f8fafc; }
.termin-row.termin-overdue { background: #fff5f5; border-left: 3px solid var(--color-danger); }
.termin-row.termin-soon    { background: #fffbeb; border-left: 3px solid var(--color-warning); }
.termin-date {
  font-size: .8rem; font-weight: 700; color: var(--color-muted);
  min-width: 90px; flex-shrink: 0;
}
.termin-row.termin-overdue .termin-date { color: var(--color-danger); }
.termin-row.termin-soon    .termin-date { color: var(--color-warning); }
.termin-body { flex: 1; min-width: 0; }
.termin-name { font-size: .9rem; font-weight: 600; }
.termin-meta { font-size: .78rem; color: var(--color-muted); margin-top: .1rem; }
.termin-legend { font-size: .8rem; padding: .2rem .6rem; border-radius: 999px; }
.termin-legend.overdue { background: #fee2e2; color: var(--color-danger); }
.termin-legend.soon    { background: #fef9c3; color: var(--color-warning); }
.termin-legend.normal  { background: var(--color-bg); color: var(--color-muted); }

/* ─── Globální vyhledávání ───────────────────────────────────────────────── */
.search-group-title {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--color-muted);
  padding: .5rem 1rem .25rem;
}
.search-result-item {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .5rem 1rem; cursor: pointer;
  transition: background var(--transition);
}
.search-result-item:hover { background: var(--color-bg); }
.search-result-name { font-size: .875rem; font-weight: 600; }
.search-result-meta { font-size: .75rem; color: var(--color-muted); margin-top: .1rem; }

/* ─── Moje úkoly – filtr bar ─────────────────────────────────────────────── */
.ukoly-filter-bar {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.ukoly-filter-controls {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-left: auto;
}
.ukoly-filter-select {
  padding: .35rem .65rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .8rem; color: var(--color-text);
  background: var(--color-surface);
  cursor: pointer; outline: none;
}
.ukoly-filter-select:focus { border-color: var(--color-primary); }

/* ─── Tiskový přehled projektů ───────────────────────────────────────────── */
#print-projekty { display: none; }

@media print {
  /* Skrýt nepotřebné prvky */
  #sidebar, .topbar, #toast-container, .page-header > button,
  .page-header > input, .page-header > .btn,
  .proj-sekce-header, .project-card-footer,
  #print-projekty { display: block !important; }

  #sidebar, .topbar, #toast-container,
  .page-header > button, .page-header > input,
  #login-screen { display: none !important; }

  #main-content { margin-left: 0 !important; }
  #page-content { padding: 1rem !important; }

  body { background: white; }

  #print-content {
    display: block !important;
    font-family: sans-serif;
  }
  #print-content h1 { font-size: 1.2rem; margin-bottom: .25rem; }
  #print-content table {
    width: 100%; border-collapse: collapse;
    font-size: .78rem;
  }
  #print-content th, #print-content td {
    border: 1px solid #ccc;
    padding: .3rem .5rem;
    text-align: left;
  }
  #print-content th { background: #e8f0fe; font-weight: 700; }
  #print-content tr:nth-child(even) { background: #f8fafc; }

  /* Skrýt zbytek stránky při tisku – zobrazit jen tiskový obsah */
  #app > * { display: none !important; }
  #print-projekty { display: block !important; }
}

/* ─── Responzivita 768px – mobilní vylepšení ─────────────────────────────── */
@media (max-width: 768px) {
  /* Karty v detailu projektu → 1 sloupec */
  .detail-cards { grid-template-columns: 1fr !important; }
  /* Sekce projektů – menší text */
  .proj-sekce-label { font-size: .85rem; }
  /* Modal – full width, žádné zaoblení po stranách */
  .modal { width: 100% !important; max-width: 100% !important; border-radius: var(--radius) var(--radius) 0 0 !important; }
  .modal-backdrop { align-items: flex-end !important; padding: 0 !important; }
  /* Filtr moje úkoly */
  .ukoly-filter-controls { margin-left: 0; }
  /* Fin bar */
  .fin-bar { flex-direction: column; align-items: flex-start; padding: .5rem; }
  .fin-bar-sep { width: 100%; height: 1px; }
}
