/* ===== CSS Variables ===== */
:root {
  --bg: #f8fafc;
  --bg-surface: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-muted: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #eff6ff;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --success: #22c55e;
  --success-light: #f0fdf4;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: 0.15s ease;
  --sidebar-width: 220px;
  --header-height: 56px;
  /* Font scale (5 levels) */
  --fs-xs:   0.6875rem; /* 11px – badges, mikrotext */
  --fs-sm:   0.75rem;   /* 12px – metadata, hints */
  --fs-ui:   0.8125rem; /* 13px – UI chrome, sekundárny text */
  --fs-base: 0.875rem;  /* 14px – tlačidlá, inputy */
  --fs-body: 0.9375rem; /* 15px – primárny obsah */
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-surface: #1e293b;
  --bg-hover: #334155;
  --bg-muted: #475569;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --border: #334155;
  --border-strong: #475569;
  --primary-light: #1e3a5f;
  --danger-light: #3b1212;
  --success-light: #0f2a1f;
  --warning-light: #2a1f0d;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
button { cursor: pointer; }
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ===== Typography ===== */
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.3; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: var(--fs-body); }
p { margin: 0 0 1rem; }
small { font-size: var(--fs-ui); color: var(--text-muted); }

/* ===== Layout ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-brand {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1.25rem;
  color: var(--text-muted);
  font-size: var(--fs-body);
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-item:hover, .nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}
.nav-item svg { flex-shrink: 0; }
.nav-section {
  padding: 0.5rem 1.25rem 0.25rem;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin-top: 0.5rem;
}
.sidebar-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: var(--fs-ui);
}

/* ===== Main content ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 1rem; font-weight: 600; flex: 1; }
.page-content {
  padding: 1.5rem;
  flex: 1;
}

/* ===== Cards / Surfaces ===== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.card-body { padding: 1.25rem; }
.card-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.875rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: 1.5;
  transition: background var(--transition), border-color var(--transition), color var(--transition),
              box-shadow var(--transition);
  white-space: nowrap;
  text-decoration: none !important;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); }
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.btn-sm {
  padding: 0.25rem 0.625rem;
  font-size: var(--fs-ui);
}
.btn-lg {
  padding: 0.625rem 1.25rem;
  font-size: 1rem;
}
.btn-icon {
  padding: 0.375rem;
  width: 2rem;
  height: 2rem;
  justify-content: center;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: var(--fs-base);
  font-weight: 500;
  margin-bottom: 0.375rem;
}
.form-control {
  display: block;
  width: 100%;
  padding: 0.4375rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text);
  font-size: var(--fs-body);
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-control::placeholder { color: var(--text-subtle); }
.form-control:disabled, .form-control[readonly] {
  background: var(--bg-muted);
  cursor: not-allowed;
}
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control,
input[type="date"].form-control,
input[type="number"].form-control { height: 2.25rem; padding-top: 0.36rem; padding-bottom: 0.36rem; box-sizing: border-box; }
.form-text { font-size: var(--fs-ui); color: var(--text-muted); margin-top: 0.25rem; }
.form-error { font-size: var(--fs-ui); color: var(--danger); margin-top: 0.25rem; }

/* ── Tiptap rich-text editor ───────────────────────────────────── */
.rte-wrap { position: relative; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-surface); }
.rte-link-popup { position: absolute; z-index: 200; background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0.3rem 0.4rem; display: flex; gap: 0.3rem; align-items: center; box-shadow: 0 4px 14px rgba(0,0,0,0.13); }
.rte-link-popup input[type=url] { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0.2rem 0.4rem; font-size: var(--fs-sm); width: 190px; background: var(--bg-surface); color: var(--text); outline: none; }
.rte-link-popup input[type=url]:focus { border-color: var(--primary); }
.rte-link-popup button { border: none; background: none; cursor: pointer; padding: 0.15rem 0.35rem; border-radius: 4px; font-size: 0.8rem; color: var(--text-muted); }
.rte-link-popup button:hover { background: var(--bg-muted); color: var(--text); }
.rte-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.rte-toolbar { display: flex; gap: 0.25rem; padding: 0.25rem 0.5rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rte-toolbar button { border: none; background: none; cursor: pointer; border-radius: 4px; padding: 0.15rem 0.35rem; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); line-height: 1.5; transition: background var(--transition), color var(--transition); }
.rte-toolbar button:hover, .rte-toolbar button.is-active { background: var(--bg-muted); color: var(--text); }
.rte-toolbar .rte-sep { width: 1px; background: var(--border); margin: 0.2rem 0.1rem; }
.rte-content { padding: 0.4375rem 0.75rem; min-height: 80px; font-size: var(--fs-body); line-height: 1.5; color: var(--text); outline: none; }
.rte-content > .ProseMirror { outline: none; min-height: 70px; width: 100%; }
.rte-content p { margin: 0 0 0.25em; }
.rte-content p:last-child { margin-bottom: 0; }
.rte-content ul, .rte-content ol { margin: 0.15em 0 0.25em 1.25em; padding: 0; }
.rte-content li { margin-bottom: 0.1em; }
.rte-content strong { font-weight: 700; }
.rte-content em { font-style: italic; }
.rte-content u { text-decoration: underline; }
.rte-content code { font-family: monospace; background: var(--bg-muted); border-radius: 3px; padding: 0.1em 0.3em; font-size: 0.9em; }
.rte-content a { color: var(--primary); text-decoration: underline; }
.rte-output u { text-decoration: underline; }
.rte-output code { font-family: monospace; background: var(--bg-muted); border-radius: 3px; padding: 0.1em 0.3em; font-size: 0.9em; }
.rte-output a { color: var(--primary); text-decoration: underline; }
.rte-content.is-empty::before { content: attr(data-placeholder); color: var(--text-subtle); pointer-events: none; float: left; height: 0; }
/* rendered HTML output (board description display) */
.rte-output p { margin: 0 0 0.3em; }
.rte-output p:last-child { margin-bottom: 0; }
.rte-output ul, .rte-output ol { margin: 0.15em 0 0.3em 1.25em; padding: 0; }
.rte-output li { margin-bottom: 0.1em; }
.form-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.badge-active   { background: var(--success-light); color: #16a34a; }
.badge-closed   { background: var(--bg-muted); color: var(--text-muted); }
.badge-primary  { background: var(--primary-light); color: var(--primary); }
.badge-warning  { background: var(--warning-light); color: #b45309; }
.badge-danger   { background: var(--danger-light); color: var(--danger); }

/* ===== Alerts ===== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: var(--fs-body);
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 1rem;
}
.alert-danger   { background: var(--danger-light); color: #b91c1c; border: 1px solid #fca5a5; }
.alert-success  { background: var(--success-light); color: #15803d; border: 1px solid #86efac; }
.alert-warning  { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-info     { background: var(--primary-light); color: #1d4ed8; border: 1px solid #93c5fd; }

/* ===== Board status bars ===== */
.board-status-bar {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1rem;
  margin: 0 1rem 0.25rem;
  border-radius: var(--radius-lg);
  font-size: var(--fs-base);
  line-height: 1.4;
}
.board-status-bar--warning {
  background: var(--warning-light);
  color: #92400e;
  border: 1px solid #fcd34d;
}
.board-status-bar--info {
  background: var(--primary-light);
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}
.board-status-bar__btn {
  margin-left: auto;
  flex-shrink: 0;
  padding: 0.2rem 0.625rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}
.board-status-bar__btn:hover { opacity: 1; background: rgba(0,0,0,0.07); }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-body);
}
.table th {
  text-align: left;
  padding: 0.625rem 0.875rem;
  font-size: var(--fs-ui);
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-hover); }

/* ===== Stats cards ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
}
.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.stat-label {
  font-size: var(--fs-ui);
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-weight: 600; font-size: 1rem; }
.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: none;
  background: var(--bg-muted, #f3f4f6);
  color: var(--text-muted);
  font-size: var(--fs-ui);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.modal-close:hover { background: #fee2e2; color: #dc2626; }
.modal-body { padding: 1.25rem; flex: 1; }
.modal-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem;
}
.modal-lg { max-width: 680px; }
.modal-xl { max-width: 900px; }

/* ===== Toast notifications ===== */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  font-size: var(--fs-base);
  min-width: 220px;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.2s ease;
  pointer-events: auto;
}
.toast-success { background: #166534; }
.toast-error   { background: #991b1b; }
.toast-warning { background: #92400e; }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Admin Login Page ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(circle at 12% 14%, #dbeafe 0%, transparent 34%),
              radial-gradient(circle at 88% 86%, #e2e8f0 0%, transparent 30%),
              linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
}
.login-box {
  width: 100%;
  max-width: 430px;
}
.login-logo {
  text-align: center;
  margin-bottom: 1.15rem;
}
.login-logo h1 {
  font-size: clamp(1.65rem, 3.6vw, 2.15rem);
  color: var(--text);
  margin-bottom: 0.45rem;
  letter-spacing: -0.015em;
}
.login-logo p {
  margin: 0;
}
.login-card {
  border-color: rgba(203, 213, 225, 0.9);
  box-shadow: var(--shadow-lg);
}
.login-back-link {
  margin-top: 0.9rem;
}

/* ===== Landing page ===== */
.landing-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(circle at 10% 10%, #dbeafe 0%, transparent 35%),
              radial-gradient(circle at 90% 90%, #e2e8f0 0%, transparent 30%),
              linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
}
.landing-hero { text-align: center; max-width: 620px; }
.landing-hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: var(--text);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.landing-hero p {
  color: var(--text-muted);
  font-size: 1.0625rem;
  margin: 0 auto 2rem;
  max-width: 44ch;
}
.landing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.125rem;
  max-width: 560px;
  width: 100%;
  margin-top: 1.5rem;
}
.landing-cards--single {
  grid-template-columns: 1fr;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 480px) { .landing-cards { grid-template-columns: 1fr; } }
.landing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-md);
}
.landing-card h3 { font-size: 1.05rem; }
.landing-card p { font-size: 0.875rem; color: var(--text-muted); margin: 0; }

/* ===== Board Access Page ===== */
.access-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bg);
}
.access-box {
  width: 100%;
  max-width: 380px;
}

/* ===== Board Layout ===== */
.board-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}
.board-canvas {
  flex: none;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: margin-right 0.25s ease;
}
.board-canvas.panel-open {
  margin-right: 360px;
}
.board-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
}
.board-title { font-weight: 700; font-size: 1.125rem; flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.4rem; position: relative; }
.board-title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-title--has-desc { cursor: default; }
.board-desc-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  max-width: 380px;
  min-width: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.6rem 0.85rem;
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--text);
  line-height: 1.55;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  word-break: break-word;
}
.board-title-info-btn { background: none; border: none; cursor: pointer; padding: 0; line-height: 1; color: var(--text-muted); opacity: 0.65; flex-shrink: 0; display: flex; align-items: center; }
.board-title-info-btn:hover { opacity: 1; }
.phase-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-ui);
  color: var(--text-muted);
}
.phase-badge {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius);
  padding: 0.25rem 0.625rem;
  font-size: var(--fs-ui);
  font-weight: 600;
}
.board-status-closed {
  background: var(--bg-muted);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: 0.25rem 0.625rem;
  font-size: var(--fs-ui);
  font-weight: 600;
}
.participants-bar {
  font-size: var(--fs-ui);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 0.125rem;
}
.zoom-controls .zoom-btn {
  padding: 0.15rem 0.4rem;
  min-width: 1.6rem;
  font-size: 1rem;
  line-height: 1;
}
.zoom-controls .zoom-label {
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  min-width: 2.5rem;
  text-align: center;
}
.board-header-timer {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  pointer-events: none;
  z-index: 1;
}
.board-header-timer > * { pointer-events: auto; }
.timer-display {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  padding: 0.2rem 0.65rem;
  background: var(--primary-light, #eff6ff);
  border-radius: 9999px;
  letter-spacing: 0.03em;
}
.timer-display.active {
  font-size: 1.4rem;
  padding: 0.25rem 0.8rem;
}
.timer-display.urgent { font-size: 1.4rem; padding: 0.25rem 0.8rem; color: var(--danger); background: #fff1f1; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.6; } }

/* ===== Columns area ===== */
.columns-area {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  padding: 1rem;
  gap: 0.875rem;
  align-items: stretch;
  min-height: 0;
}
.board-column {
  flex: 1 1 280px;
  min-width: 220px;
  max-width: 1200px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 200px;
  overflow: hidden;
  container-type: inline-size;
}
/* ===== Focus view: two-panel grouping layout ===== */
.focus-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.focus-view__header {
  display: flex;
  align-items: flex-end;
  padding: 0 1.25rem;
  padding-top: 0.4rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
  gap: 0.25rem;
}
.focus-view__tab {
  padding: 0.35rem 0.7rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  position: relative;
  bottom: -1px;
  transition: background 0.15s, color 0.15s;
  border: 1px solid transparent;
  border-bottom: none;
}
.focus-view__tab--active {
  background: #fff;
  border-color: var(--border);
  border-bottom: 1px solid #fff;
  z-index: 1;
}
.focus-view__tab--inactive {
  background: #e5e7eb;
  color: #4b5563 !important;
  border-top: 3px solid #d1d5db !important;
}
.focus-view__tab--inactive:hover {
  background: #fff !important;
  border-color: var(--border);
  border-bottom: 1px solid #fff;
  color: var(--tab-color) !important;
  border-top: 3px solid var(--tab-color) !important;
}
.focus-view__close {
  margin-left: auto;
  margin-bottom: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: none;
  background: var(--bg-muted, #f3f4f6);
  color: var(--text-muted);
  font-size: var(--fs-ui);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.focus-view__close:hover {
  background: #fee2e2;
  color: #dc2626;
}
.focus-view__panels {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.focus-view__left {
  flex: 3;
  padding: 0.75rem 1rem;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.focus-view__right {
  flex: 2;
  padding: 0.75rem 1rem;
  overflow-y: auto;
  background: var(--bg-muted, #f8f9fa);
}
.focus-view__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.5rem;
  align-content: start;
  min-height: 120px;
  flex: 1;
}
.focus-view__grid .focus-card {
  font-size: var(--fs-ui);
}
.focus-view__grid .retro-card {
  display: flex;
  flex-direction: column;
}
.focus-view__grid .retro-card .retro-card-footer {
  margin-top: auto;
}
.focus-view__groups {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.focus-view__groups .card-group {
  transition: box-shadow 0.15s;
}
.focus-view__groups .card-group:hover {
  box-shadow: var(--shadow-md);
}
.column-header {
  padding: 0.625rem 0.875rem;
  font-weight: 600;
  font-size: var(--fs-base);
  border-bottom: 3px solid;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.column-header-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.column-header-desc {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.35;
  padding-top: 0.3rem;
  opacity: 0.85;
  font-weight: 400;
}
.column-count {
  margin-left: auto;
  background: #fff;
  border: 1.5px solid currentColor;
  border-radius: 9999px;
  padding: 0.0625rem 0.5rem;
  font-size: var(--fs-sm);
  font-weight: 700;
}
.column-cards {
  padding: 0.5rem 0.625rem 0.625rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.column-add {
  padding: 0.375rem 0.5rem 0.5rem;
}

/* ===== Retro Cards ===== */
.retro-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.625rem 0.375rem;
  font-size: var(--fs-body);
  cursor: default;
  transition: box-shadow var(--transition);
  word-break: break-word;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.retro-card:hover { box-shadow: var(--shadow-md); }
.retro-card.own-card {
  border-left: 3px solid var(--primary);
  background: var(--primary-light, #eff6ff);
}
.retro-card.dragging { opacity: 0.5; }
.retro-card-footer {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.25rem;
  flex-wrap: nowrap;
}

/* Horizontálny layout na širších stĺpcoch (container query podľa šírky stĺpca) */
@container (min-width: 600px) {
  .retro-card {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
  }
  .retro-card > div:first-child {
    flex: 1;
    min-width: 0;
    word-break: break-word;
  }
  .retro-card-footer {
    flex-shrink: 0;
    margin-top: 0;
    white-space: nowrap;
  }
  /* V edit móde: vrát sa na column layout pre full-width textarea */
  .retro-card.retro-card-editing {
    flex-direction: column;
    align-items: stretch;
  }
}
.card-author { font-size: var(--fs-sm); color: var(--text-muted); flex: 1; }
.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.125rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--bg);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}
.vote-btn:hover { border-color: var(--primary); color: var(--primary); }
.vote-btn.voted  { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.vote-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.card-edit-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  opacity: 0;
  transition: opacity var(--transition);
  flex-shrink: 0;
}
.retro-card:hover .card-edit-actions,
.card-edit-actions.confirming { opacity: 1; }
.card-edit-actions .btn { padding: 0.1rem 0.2rem; font-size: var(--fs-base); line-height: 1; }

/* ===== Card Group ===== */
.card-group {
  border: 1px solid var(--border);
  border-left: 3px solid #f59e0b;
  border-radius: var(--radius);
  background: var(--bg-surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  transition: opacity 0.15s;
  container-type: inline-size;
}
.card-group-body {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* Horizontálny layout pre karty v skupinách (jednotný breakpoint ako na boarde) */
@container (min-width: 600px) {
  .card-group .retro-card {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
  }
  .card-group .retro-card > div:first-child {
    flex: 1;
    min-width: 0;
    word-break: break-word;
  }
  .card-group .retro-card-footer {
    flex-shrink: 0;
    margin-top: 0;
    white-space: nowrap;
  }
  .card-group .retro-card.retro-card-editing {
    flex-direction: column;
    align-items: stretch;
  }
}
.card-group.is-dragged {
  opacity: 0.4;
}
.card-group.drag-over-before {
  border-top: 3px solid var(--primary);
}
.card-group.drag-over-after {
  border-bottom: 3px solid var(--primary);
}
.card-group-header {
  font-size: var(--fs-ui);
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0 0.125rem 0.375rem;
  border-bottom: 1px solid var(--border);
  cursor: text;
}
.group-action-btn,
.group-rename-btn,
.group-dissolve-btn {
  opacity: 0;
  transition: opacity var(--transition);
}
.card-group:hover .group-action-btn,
.card-group:hover .group-rename-btn,
.card-group:hover .group-dissolve-btn { opacity: 1; }
.participant-edit-btn {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition), visibility var(--transition);
}
.participant-row:hover .participant-edit-btn,
.participant-row:focus-within .participant-edit-btn {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.participant-ready-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0 0.1rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
}
.participant-ready-indicator--placeholder {
  background: transparent;
}
.card-group-label-input {
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: var(--fs-ui);
  color: var(--text-muted);
  width: 100%;
  padding: 0.2rem 0.1rem;
}
.card-group-label-input:focus { outline: 2px solid var(--primary); border-radius: 2px; }

/* ===== Add card form ===== */
.add-card-form { display: flex; flex-direction: column; }
.add-card-ghost {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem;
  font-size: var(--fs-ui);
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  cursor: text;
  user-select: none;
  opacity: 0.65;
  transition: opacity 0.15s, border-color 0.15s, color 0.15s;
}
.add-card-ghost:hover { opacity: 1; border-color: var(--primary); color: var(--primary); }
.add-card-form:focus-within .add-card-ghost { display: none; }
.add-card-form:has(.add-card-textarea:not(:placeholder-shown)) .add-card-ghost { display: none; }

/* Warmup emoji buttons */
.warmup-emoji-btn {
  font-size: 2rem;
  line-height: 1;
  padding: 0.4rem 0.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  background: #fff;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
}
.warmup-emoji-btn:hover { border-color: var(--primary); transform: scale(1.15); }
.warmup-emoji-btn:active { transform: scale(0.95); }
.add-card-textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0;
  font-size: var(--fs-base);
  resize: none;
  height: 0;
  min-height: 0;
  overflow: hidden;
  pointer-events: none;
  font-family: inherit;
  background: var(--bg-surface);
  color: var(--text);
  transition: min-height 0.15s, padding 0.15s, border-color 0.15s;
}
.add-card-form:focus-within .add-card-textarea,
.add-card-form:has(.add-card-textarea:not(:placeholder-shown)) .add-card-textarea,
.retro-card .add-card-textarea {
  height: auto;
  min-height: 42px;
  padding: 0.3rem 0.5rem;
  pointer-events: auto;
  border-color: var(--border-strong);
}
.add-card-form:focus-within .add-card-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* ===== Phase progress bar ===== */
.phase-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  min-height: 44px;
}
.phase-step {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--fs-ui);
  white-space: nowrap;
  opacity: 0.5;
}
.phase-step.active { opacity: 1; color: var(--primary); font-weight: 600; }
.phase-step.done   { opacity: 0.7; color: var(--success); }
.phase-connector   { width: 1.5rem; height: 1px; background: var(--border-strong); flex-shrink: 0; }
.phase-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: 700;
  background: var(--bg-surface);
}
.phase-step.active .phase-dot {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.phase-step.done .phase-dot {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

/* ===== Sidebar panel (board actions, checkin, etc.) ===== */
.board-side-panel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: 360px;
  height: calc(100vh - var(--header-height));
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 40;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.board-side-panel.open { transform: translateX(0); }
.panel-header {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-body { padding: 1rem; overflow-y: auto; flex: 1; min-height: 0; }
.panel-overlay {
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.3);
  z-index: 39;
  display: none;
}
.panel-overlay.open { display: block; }

/* ===== Action items ===== */
.action-list { display: flex; flex-direction: column; gap: 0; }
.action-item {
  border-bottom: 1px solid var(--border);
  padding: 0.3rem 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
}
.action-item:last-child { border-bottom: none; }
.action-item.done { opacity: 0.55; }
.action-item .action-btns { opacity: 0 !important; transition: opacity .15s; }
.action-item:hover .action-btns { opacity: 1 !important; }
.action-checkbox {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}
.action-text { flex: 1; font-size: var(--fs-ui); line-height: 1.3; }
.action-meta { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.action-done-text { text-decoration: line-through; color: var(--text-muted); }

/* ===== Appreciation cards ===== */
.appreciation-card {
  background: linear-gradient(135deg, #fffbeb, #fef9c3);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  font-size: var(--fs-body);
}
.appreciation-header { font-size: var(--fs-ui); color: #92400e; margin-bottom: 0.375rem; }

/* ===== Check-in chip list ===== */
.checkin-chips {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.checkin-chip {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.75rem;
  font-size: var(--fs-body);
}

/* Warm-up chips: show action buttons only on hover */
.checkin-chips .chip-action {
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.checkin-chips > div:hover .chip-action {
  opacity: 1;
  pointer-events: auto;
}

/* Warm-up done block: show edit/delete only on hover */
.warmup-done-block .chip-action {
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.warmup-done-block:hover .chip-action {
  opacity: 1;
  pointer-events: auto;
}

/* Closing activity chips (inline flex pill style) */
.closing-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: var(--fs-body);
}
.closing-chip .chip-action {
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.closing-chip:hover .chip-action {
  opacity: 1;
  pointer-events: auto;
}

/* ===== Spinner ===== */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Sync indicator ===== */
.sync-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
}
.sync-dot.stale { background: var(--warning); animation: pulse 1.5s infinite; }
.sync-dot.error { background: var(--danger); }

/* ===== Visibility blocker (cards hidden phase) ===== */
.cards-hidden-overlay {
  background: linear-gradient(180deg, transparent 30%, var(--bg-surface) 70%);
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  pointer-events: none;
}
.cards-hidden-message {
  text-align: center;
  width: 100%;
  font-size: var(--fs-base);
  color: var(--text-muted);
}

/* ===== Empty states ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}
.empty-state p { font-size: var(--fs-body); }

/* ===== Misc utilities ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: var(--fs-base); }
.text-xs     { font-size: var(--fs-sm); }
.font-bold   { font-weight: 700; }
.font-medium { font-weight: 500; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full      { width: 100%; }
.hidden      { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .board-column { flex: 0 0 240px; }
  .page-content { padding: 1rem; }
  .board-side-panel { width: 100%; top: var(--header-height); height: calc(100vh - var(--header-height)); }
}

/* ===== Dropdown menu ===== */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  right: 0; top: calc(100% + 4px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: var(--fs-base);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-light); }
.dropdown-divider { height: 1px; background: var(--border); margin: 0.25rem 0; }

/* Admin phase bar at bottom: add padding to body so content doesn't hide under it */
.board-layout.admin-mode { padding-bottom: 44px; }
.board-layout.admin-mode .board-column { min-height: 200px; }

/* ===== DnD drag indicators (Alpine-native) ===== */

/* Card being dragged */
.retro-card.is-dragged {
  opacity: 0.4;
}

/* Drop indicator: top border = insert before */
.retro-card.drag-over-before {
  border-top: 3px solid var(--primary, #3b82f6);
  margin-top: -3px;
}

/* Drop indicator: bottom border = insert after */
.retro-card.drag-over-after {
  border-bottom: 3px solid var(--primary, #3b82f6);
  margin-bottom: -3px;
}

/* Drop indicator: Shift+hover = group mode */
.retro-card.drag-over-group {
  outline: 3px solid var(--primary, #3b82f6);
  outline-offset: 2px;
  background: var(--primary-light, #eff6ff) !important;
}
.retro-card.drag-over-group::after {
  content: 'Zgrupovať';
  position: absolute;
  top: 0.2rem;
  right: 0.35rem;
  left: auto;
  transform: none;
  font-size: var(--fs-xs);
  color: #fff;
  background: var(--primary, #3b82f6);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
}

/* During drag: subtle hint on all cards */
body.is-dragging .retro-card {
  cursor: grabbing;
}
body.is-dragging .retro-card[draggable="true"] {
  transition: border-color 0.1s, outline 0.1s;
}

/* Dissolve group button */
.group-dissolve-btn {
  padding: 0 4px;
  font-size: var(--fs-sm);
}

