/* styles/base.css — Reset, typografie, utility třídy, layout */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-bg-page:    #f0f0f0;
  --c-bg:         #f8f9fa;
  --c-surface:    #ffffff;
  --c-border:     #e5e7eb;
  --c-border-light: #f3f4f6;
  --c-text:       #1a1a1a;
  --c-text-muted: #6b7280;
  --c-text-light: #9ca3af;
  --c-primary:    #4f46e5;
  --c-primary-bg: #eef2ff;
  --c-green:      #16a34a;
  --c-green-bg:   #f0fdf4;
  --c-orange:     #ea580c;
  --c-orange-bg:  #fff7ed;
  --c-blue:       #2563eb;
  --c-blue-bg:    #eff6ff;
  --c-nzu:        #059669;
  --c-nzu-bg:     #ecfdf5;
  --c-radius:     8px;
  --c-shadow:     0 1px 4px rgba(0,0,0,0.08);
  --c-shadow-md:  0 4px 16px rgba(0,0,0,0.10);
}

/* ─── TÉMA: TLUMENÝ ─────────────────────────────────────────────────────────── */
[data-theme="darker"] {
  --c-bg-page:    #d8d8d2;
  --c-bg:         #e2e2dc;
  --c-surface:    #eaeae4;
  --c-border:     #c4c4bc;
  --c-border-light: #d4d4cc;
  --c-text-light: #7a7a72;
}
/* Chipy – stejné jako světlá varianta */
[data-theme="darker"] .chip-done    { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; opacity: 1; }
[data-theme="darker"] .chip-active  { background: #fff7ed; color: #c2410c; border-color: #fed7aa; opacity: 1; }
[data-theme="darker"] .chip-waiting { background: #f3f4f6; color: #6b7280; border-color: #d1d5db; opacity: 0.75; }

/* ─── TÉMA: TMAVÝ ───────────────────────────────────────────────────────────── */
/* Chipy – stejné jako světlá varianta */
[data-theme="dark"] .chip-done    { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; opacity: 1; }
[data-theme="dark"] .chip-active  { background: #fff7ed; color: #c2410c; border-color: #fed7aa; opacity: 1; }
[data-theme="dark"] .chip-waiting { background: #f3f4f6; color: #6b7280; border-color: #d1d5db; opacity: 0.75; }

[data-theme="dark"] {
  --c-bg-page:    #0f1117;
  --c-bg:         #1a1d27;
  --c-surface:    #242838;
  --c-border:     #343848;
  --c-border-light: #2a2e3e;
  --c-text:       #e8eaf0;
  --c-text-muted: #8892a4;
  --c-text-light: #5a6478;
  --c-primary:    #818cf8;
  --c-primary-bg: #1e1b4b;
  --c-green:      #4ade80;
  --c-green-bg:   #14532d;
  --c-orange:     #fb923c;
  --c-orange-bg:  #431407;
  --c-blue:       #60a5fa;
  --c-blue-bg:    #1e3a5f;
  --c-nzu:        #34d399;
  --c-nzu-bg:     #064e3b;
  --c-shadow:     0 1px 4px rgba(0,0,0,0.4);
  --c-shadow-md:  0 4px 20px rgba(0,0,0,0.5);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg-page);
  transition: background 0.2s, color 0.2s;
}

#app { min-height: 100vh; }

/* ─── TYPOGRAPHY ────────────────────────────────────────────────────────────── */
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p  { color: var(--c-text-muted); }

/* ─── BUTTONS ───────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--c-primary); color: white;
  border: none; border-radius: var(--c-radius);
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary.btn-large { padding: 12px 28px; font-size: 15px; }

.btn-secondary {
  background: var(--c-surface); color: var(--c-text);
  border: 1px solid var(--c-border); border-radius: var(--c-radius);
  padding: 7px 14px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.15s;
}
.btn-secondary:hover { background: var(--c-bg); }

/* Outline-primary — bílé pozadí, modré ohraničení + text. Zvýraznění
   sekundárních akcí které jsou ale "primárně užitečné" (např. import,
   pick customer). Vizuálně mezi btn-secondary a btn-primary. */
.btn-outline-primary {
  background: var(--c-surface); color: var(--c-primary);
  border: 1.5px solid var(--c-primary); border-radius: var(--c-radius);
  padding: 7px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.btn-outline-primary:hover { background: var(--c-primary-bg); }

.btn-danger {
  background: #fef2f2; color: #dc2626;
  border: 1px solid #fecaca; border-radius: var(--c-radius);
  padding: 7px 14px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.15s;
}
.btn-danger:hover { background: #fee2e2; }

.btn-back {
  background: none; border: none;
  color: var(--c-primary); font-size: 14px; font-weight: 600;
  cursor: pointer; padding: 6px 0;
}
.btn-back:hover { opacity: 0.75; }

/* ─── INPUTS ────────────────────────────────────────────────────────────────── */
.input {
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--c-border); border-radius: 6px;
  font-size: 13px; background: var(--c-surface); color: var(--c-text);
  transition: border-color 0.15s;
}
.input:focus { outline: none; border-color: var(--c-primary); }
textarea.input { resize: vertical; min-height: 60px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

/* ─── PROGRESS BAR ──────────────────────────────────────────────────────────── */
.progress-bar-bg  { background: var(--c-border); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-bar-fill { background: var(--c-primary); height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.nzu-bar .progress-bar-fill { background: var(--c-nzu); }

/* ─── BADGES ────────────────────────────────────────────────────────────────── */
.badge-nzu { background: var(--c-nzu-bg); color: var(--c-nzu); border: 1px solid #6ee7b7; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; }

/* ─── STATUS BADGE ──────────────────────────────────────────────────────────── */
.status-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px; border: 1px solid; white-space: nowrap; }
.status-icon  { font-size: 10px; }

/* ─── LOADING / ERROR ───────────────────────────────────────────────────────── */
.loading { color: var(--c-text-muted); padding: 24px; text-align: center; font-size: 13px; }
.error   { color: #dc2626; padding: 16px; background: #fef2f2; border-radius: var(--c-radius); }
.empty-state { color: var(--c-text-muted); padding: 32px; text-align: center; }

/* ─── MODAL ─────────────────────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.modal-box { position: relative; background: var(--c-surface); border-radius: 12px; padding: 24px; min-width: 340px; max-width: 520px; box-shadow: var(--c-shadow-md); display: flex; flex-direction: column; gap: 12px; }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.modal-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ─── SPLASH / ACCESS PROMPT ────────────────────────────────────────────────── */
.splash, .access-prompt {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; gap: 12px; padding: 32px;
}
.splash-logo  { font-size: 48px; }
.splash-title { font-size: 24px; font-weight: 700; }
.splash-subtitle { color: var(--c-text-muted); }
.access-icon  { font-size: 40px; }
.access-prompt h2 { text-align: center; }
.access-prompt p  { text-align: center; max-width: 400px; }
.access-hint  { font-size: 13px; color: var(--c-text-light); }
.access-hint code { background: var(--c-bg); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.error-msg { color: #dc2626; font-size: 13px; margin-top: 8px; }

.browser-hint { background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--c-radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; margin: 8px 0; max-width: 420px; }
.browser-step { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; }
.browser-step-num { background: var(--c-primary); color: white; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.browser-step code { background: var(--c-surface); border: 1px solid var(--c-border); padding: 1px 5px; border-radius: 3px; font-size: 11px; word-break: break-all; }

/* ─── NASTAVENÍ MODAL ───────────────────────────────────────────────────────── */
.settings-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.settings-box {
  background: var(--c-surface); border-radius: 12px; padding: 24px 28px;
  width: 400px; max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  animation: slideUp 0.15s ease;
}
@keyframes slideUp { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.settings-title        { font-size: 16px; font-weight: 700; margin-bottom: 18px; }
.settings-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--c-text-muted); margin-bottom: 10px; }
.settings-folder-row   { background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 8px; padding: 12px 14px; margin-bottom: 20px; }
.settings-folder-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--c-text-muted); margin-bottom: 4px; }
.settings-folder-name  { font-size: 14px; font-weight: 600; color: var(--c-text); }
.settings-hint         { font-size: 13px; color: var(--c-text-muted); line-height: 1.5; margin-bottom: 16px; }
.settings-hint strong  { color: var(--c-text); }
.settings-actions      { display: flex; gap: 8px; margin-top: 20px; }

/* Theme picker */
.theme-picker { display: flex; gap: 10px; margin-bottom: 4px; }
.theme-option {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 2px solid var(--c-border); border-radius: 8px; padding: 8px 6px;
  cursor: pointer; background: none; transition: border-color 0.15s;
}
.theme-option:hover    { border-color: var(--c-primary); }
.theme-option.selected { border-color: var(--c-primary); background: var(--c-primary-bg); }
.theme-option span     { font-size: 11px; font-weight: 600; color: var(--c-text-muted); }
.theme-option.selected span { color: var(--c-primary); }

.theme-preview {
  width: 100%; height: 44px; border-radius: 5px; overflow: hidden;
  display: flex; flex-direction: column; gap: 3px; padding: 5px;
  border: 1px solid rgba(0,0,0,0.08);
}
.theme-preview-bar  { height: 7px; border-radius: 3px; }
.theme-preview-card { height: 14px; border-radius: 3px; }

/* Světlý */
.tp-light { background: #f0f0f0; }
.tp-light .theme-preview-bar  { background: #ffffff; }
.tp-light .theme-preview-card { background: #ffffff; }

/* Tlumený */
.tp-darker { background: #d8d8d2; }
.tp-darker .theme-preview-bar  { background: #eaeae4; }
.tp-darker .theme-preview-card { background: #eaeae4; }

/* Tmavý */
.tp-dark { background: #0f1117; }
.tp-dark .theme-preview-bar  { background: #242838; }

/* ─── TASKS VIEW ─────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
}

.tasks-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.tasks-title { display: flex; align-items: baseline; gap: 10px; }
.tasks-subtitle { color: var(--c-text-muted); font-size: 13px; }

.tasks-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.user-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--c-text-muted);
}
.user-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.user-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.user-btn.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  font-weight: 600;
}

.tasks-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}

.tasks-section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-muted);
  margin: 20px 0 8px;
}
.tasks-section-label:first-child { margin-top: 0; }
.tasks-section-overdue { color: var(--c-orange); }
.tasks-section-done    { color: var(--c-text-light); }

.task-card {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--c-radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--c-shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.task-card:hover { border-color: var(--c-primary); box-shadow: var(--c-shadow-md); }

.task-card-overdue {
  border-left: 4px solid var(--c-orange);
  background: var(--c-orange-bg);
}
.task-card-done {
  opacity: 0.65;
  border-color: var(--c-border-light);
}
.task-card-done:hover { opacity: 0.85; }

.task-card-main { flex: 1; min-width: 0; }

.task-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.task-assignee {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* Řešitelé — dvě výrazně odlišné, nemodré JIRA-ish barvy (nekolidují se stavy). */
.assignee-petr  { background: #eae6ff; color: #5243aa; }  /* fialová */
.assignee-artem { background: #ffe2ef; color: #a4246b; }  /* purpurová */

.task-deadline { font-size: 12px; color: var(--c-text-muted); }
.task-deadline-overdue { color: var(--c-orange); font-weight: 600; }
.task-deadline-none    { color: var(--c-text-light); font-style: italic; }

.task-created-by {
  font-size: 11px;
  color: var(--c-text-light);
  margin-left: auto;
}

.task-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.4;
  word-break: break-word;
}
.task-title-done { text-decoration: line-through; color: var(--c-text-muted); }

.task-desc {
  font-size: 13px;
  color: var(--c-text-muted);
  margin-top: 4px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.task-done-info {
  font-size: 12px;
  color: var(--c-text-light);
  margin-top: 6px;
}

.task-card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.task-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  color: var(--c-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}
.task-btn:hover  { background: var(--c-surface); color: var(--c-text); }
.task-btn-done   { border-color: var(--c-green); color: var(--c-green); }
.task-btn-done:hover   { background: var(--c-green-bg); }
.task-btn-reopen { border-color: var(--c-blue); color: var(--c-blue); }
.task-btn-reopen:hover { background: var(--c-blue-bg); }
.task-btn-delete { border-color: #fca5a5; color: #ef4444; }
.task-btn-delete:hover { background: #fef2f2; }

.tasks-empty {
  text-align: center;
  color: var(--c-text-muted);
  padding: 48px 16px;
  font-size: 15px;
}

/* Modal */
.tasks-modal-box {
  background: var(--c-surface);
  border-radius: 12px;
  padding: 0;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--c-shadow-md);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--c-border);
}
.modal-header h2 { font-size: 16px; }
.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--c-text-muted);
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--c-bg); color: var(--c-text); }
.modal-body   { padding: 16px 20px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--c-border);
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-muted);
  margin: 12px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-label:first-child { margin-top: 0; }
.form-input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--c-radius);
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
}
.form-input:focus { outline: none; border-color: var(--c-primary); }
.form-textarea { resize: vertical; min-height: 70px; }
.form-row { display: flex; gap: 12px; }
.form-col { flex: 1; }
.form-error {
  margin-top: 10px;
  font-size: 13px;
  color: #ef4444;
  background: #fef2f2;
  border-radius: 6px;
  padding: 6px 10px;
}

@media (max-width: 500px) {
  .task-card { flex-direction: column; }
  .task-card-actions { flex-direction: row; flex-wrap: wrap; }
  .task-created-by { margin-left: 0; }
  .form-row { flex-direction: column; }
}

/* ─── SCAN SLOŽEK – kandidáti ────────────────────────────────────────────── */
.scan-found-info { font-size: 13px; color: var(--c-text-muted); margin-bottom: 8px; }
.modal-box { max-width: 560px; }
.scan-candidate-list {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 320px; overflow-y: auto;
  border: 1px solid var(--c-border); border-radius: 8px;
  padding: 4px 0; margin-bottom: 4px;
}
.scan-candidate {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; cursor: pointer; font-size: 13px;
  border-radius: 6px; transition: background 0.1s;
}
.scan-candidate:hover { background: var(--c-hover); }
.scan-candidate input[type="checkbox"] { width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; accent-color: var(--c-primary); }
.scan-cand-id   { font-family: monospace; font-size: 11px; color: var(--c-text-muted); min-width: 80px; }
.scan-cand-name { flex: 1; font-weight: 500; color: var(--c-text); }
.scan-cand-year { font-size: 11px; color: var(--c-text-muted); }

.import-result { font-size: 13px; padding: 10px 12px; border-radius: 8px; }
.import-result.success { background: #f0fdf4; color: #15803d; }
.import-result.error   { background: #fef2f2; color: #dc2626; }

/* ─── ÚKOLY: JIRA-style ─────────────────────────────────────────────────────── */
.tasks-tabbar { display: flex; gap: 4px; border-bottom: 2px solid var(--c-border); margin-bottom: 16px; flex-wrap: wrap; }
.tasks-tab {
  background: transparent; border: none; cursor: pointer; padding: 10px 16px;
  font-size: 14px; font-weight: 600; color: var(--c-text-muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tasks-tab:hover { color: var(--c-text); background: var(--c-bg); }
.tasks-tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.nav-task-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 9px; font-size: 11px; font-weight: 700; line-height: 1;
  background: #94a3b8; color: #fff; vertical-align: middle;
}
.nav-task-badge.has-new { background: #dc2626; }

/* Board zabírá širší plochu než ostatní pohledy (úzký 800px je na board málo). */
.tasks-page.tasks-wide { max-width: 1500px; }

/* Board filtr „jen moje úkoly" */
.board-filterbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.board-mine-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--c-text); cursor: pointer; user-select: none; }
.board-mine-toggle input { accent-color: var(--c-primary); width: 16px; height: 16px; }

/* Kanban board — JIRA-style: neutrální šedé sloupce, bílé karty, akcent jen u stavu. */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.kanban-col { background: #f4f5f7; border: none; border-radius: 6px; min-height: 140px; }
.kanban-col-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px 8px; font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em; color: #5e6c84;
  border-top: 3px solid #c1c7d0; border-radius: 6px 6px 0 0;
}
.kanban-col-head.st-new  { border-top-color: #6b778c; }   /* To Do — neutrální */
.kanban-col-head.st-prog { border-top-color: #0052cc; }   /* In Progress — modrá */
.kanban-col-head.st-wait { border-top-color: #ff991f; }   /* Čeká — oranžová */
.kanban-col-head.st-done { border-top-color: #00875a; }   /* Done — zelená */
.kanban-count { background: #dfe1e6; color: #5e6c84; border-radius: 9px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
/* Pozn.: třídy .kanban-* sdílí tasks board (.kanban) a dashboard widget
   (.kanban-grid) — dashboard.css je definuje znovu vč. max-height: 480px.
   Proto tasks board scopujeme přes `.kanban ...` (vyšší specificita), aby
   dashboard.css nepřebil výšku a sloupec se natáhl na celou obrazovku. */
.kanban .kanban-col-body {
  padding: 6px; display: flex; flex-direction: column; gap: 6px; min-height: 60px;
  /* Sloupec se natáhne na výšku obrazovky a scrolluje sám v sobě (ne celá
     stránka). Na velké obrazovce se tak vejde mnohem víc karet pod sebe. */
  max-height: calc(100vh - 210px);
  overflow-y: auto;
}
.kanban-col-body.drop-hover { background: #e9f2ff; outline: 2px dashed #4c9aff; outline-offset: -4px; border-radius: 6px; }
.kanban-empty { color: #97a0af; text-align: center; padding: 8px; font-size: 12px; }

.kanban-card {
  position: relative;
  background: #fff; border: 1px solid #dfe1e6; border-radius: 4px;
  padding: 6px 9px; cursor: pointer; display: block;
  box-shadow: 0 1px 1px rgba(9,30,66,.18);
}
/* Avatary řešitelů — barevná kolečka s iniciálou, vpravo dole na kartě (JIRA styl) */
.task-chips-right { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.task-avatars { display: inline-flex; flex-direction: row; }
.task-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; line-height: 1;
  box-shadow: 0 0 0 1.5px #fff;
}
.task-avatars .task-avatar:not(:first-child) { margin-left: -7px; }  /* lehký překryv */
/* Priorita — drobné textové označení vpravo nahoře (místo emoji ikony) */
.task-prio-tag {
  position: absolute; top: 7px; right: 9px;
  font-size: 9px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  line-height: 1;
}
.task-prio-tag.prio-high { color: #bf2600; }
.task-prio-tag.prio-low  { color: #97a0af; }
.kanban-card .task-title { padding-right: 54px; }  /* místo pro označení priority */
.kanban-card:hover { box-shadow: 0 2px 6px rgba(9,30,66,.22); border-color: #c1c7d0; }
.kanban-card.dragging { opacity: .5; }
/* Levý akcent JEN u vysoké priority (červená) — jinak žádný barevný proužek. */
.kanban-card.prio-high { border-left: 3px solid #ff5630; }
/* VÝRAZNÉ: název úkolu (co dělat) */
.kanban-card .task-title { font-weight: 600; font-size: 13.5px; line-height: 1.25; color: #172b4d; margin-bottom: 3px; }
/* VÝRAZNÉ: typ úkolu + realizace (kontext) */
.task-strongmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.task-typelabel { font-size: 12px; font-weight: 600; color: #172b4d; white-space: nowrap; }
.task-stepchip {
  font-size: 11px; font-weight: 600; color: #5e6c84; background: #f4f5f7;
  border: 1px solid #dfe1e6; padding: 1px 7px; border-radius: 3px; white-space: nowrap;
}
.task-real {
  font-size: 12px; font-weight: 600; color: #42526e; background: #ebecf0; border: none;
  padding: 2px 8px; border-radius: 3px; text-decoration: none; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.task-real:hover { background: #dfe1e6; color: #172b4d; }

/* POTLAČENÉ: tagy (priorita / řešitel / termín) — slabé, ne tučné */
.task-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.task-prio { font-size: 10px; font-weight: 500; padding: 1px 7px; border-radius: 3px; }
.task-prio.prio-high   { background: #ffebe6; color: #bf2600; }
.task-prio.prio-normal { background: #f4f5f7; color: #97a0af; }
.task-prio.prio-low    { background: #f4f5f7; color: #97a0af; }
.task-assignee { font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 3px; opacity: .9; background: #ebecf0; color: #42526e; }
.tasks-whoami { font-size: 13px; color: var(--c-text-muted); }
.tasks-whoami strong { color: var(--c-text); }
.task-deadline { font-size: 11px; font-weight: 400; color: #97a0af; white-space: nowrap; }
.task-deadline.overdue { color: #de350b; font-weight: 600; }

/* Seznam (řádky) */
.task-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px;
  margin-bottom: 6px; cursor: pointer; flex-wrap: wrap;
}
.task-row:hover { border-color: var(--c-primary); }
.task-row-done { opacity: .6; }
.task-row-done .task-row-title { text-decoration: line-through; }
.task-row-title { flex: 1; min-width: 160px; font-weight: 600; font-size: 13px; }
.task-status-pill { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; letter-spacing: .03em; }
.task-status-pill.st-new  { background: #ebecf0; color: #42526e; }
.task-status-pill.st-prog { background: #deebff; color: #0747a6; }
.task-status-pill.st-wait { background: #fff0b3; color: #974f0c; }
.task-status-pill.st-done { background: #e3fcef; color: #006644; }

/* Podle realizace */
.byreal-group { margin-bottom: 16px; }
.byreal-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 6px;
  background: var(--c-bg); border-radius: 8px; font-weight: 700; font-size: 14px;
  color: #1e40af; text-decoration: none;
}
.byreal-head:hover { background: #eff6ff; }
.byreal-head-none { color: var(--c-text-muted); }
.byreal-count { font-weight: 400; font-size: 12px; color: var(--c-text-muted); }

/* ── Modal nového úkolu (Todoist/Linear-style: hero název + vizuální výběr) ── */
/* Pevná hlavička + patička, scrollovatelné tělo → vejde se i na notebook. */
.tk-modal {
  max-width: 560px; width: 94%; padding: 18px 20px;
  max-height: 88vh; display: flex; flex-direction: column; gap: 10px;
}
.tk-modal .modal-header, .tk-modal .modal-footer { flex-shrink: 0; }
.tk-modal .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tk-body { display: flex; flex-direction: column; gap: 8px; padding-bottom: 46px; }
/* Rohové ikony (Smazat + Zavřít) + plovoucí Uložit — bez footeru/hlavičky */
.tk-cornerbtns { position: absolute; top: 8px; right: 10px; z-index: 3; display: flex; gap: 2px; }
.tk-icon-btn {
  border: none; background: transparent; cursor: pointer; font-size: 16px; line-height: 1;
  color: #97a0af; padding: 5px 7px; border-radius: 6px;
}
.tk-icon-btn:hover { background: #f4f5f7; color: #42526e; }
.tk-del-btn:hover { background: #ffebe6; color: #bf2600; }
.tk-save-fab {
  position: absolute; right: 18px; bottom: 14px; z-index: 3;
  padding: 8px 22px; border-radius: 8px; box-shadow: 0 3px 10px rgba(9,30,66,.28);
}
.tk-hero {
  border: none; border-bottom: 2px solid #dfe1e6; border-radius: 0;
  font-size: 17px; font-weight: 600; color: #172b4d; padding: 4px 2px; outline: none; width: 100%;
  padding-right: 56px;  /* místo pro 🗑 + ✕ v rohu */
}
.tk-hero:focus { border-bottom-color: #4c9aff; }
.tk-hero::placeholder { color: #a5adba; font-weight: 400; }
.tk-notes {
  border: 1px solid #dfe1e6; border-radius: 6px; padding: 7px 9px; width: 100%;
  font-family: inherit; font-size: 13px; resize: vertical; color: #172b4d; box-sizing: border-box;
}
.tk-notes:focus { outline: none; border-color: #4c9aff; }
.tk-field { display: flex; flex-direction: column; gap: 4px; }
.tk-flabel { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #5e6c84; }
/* Kompaktní řádek: popisek vlevo + ovladač vpravo (Jira context-field styl) */
.tk-prop { display: flex; align-items: flex-start; gap: 10px; }
.tk-prop-label { width: 70px; flex-shrink: 0; padding-top: 6px; font-size: 12px; font-weight: 600; color: #5e6c84; }
.tk-prop .tk-real-row { flex: 1; }
.tk-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tk-chip {
  border: 1px solid #dfe1e6; background: #fff; border-radius: 14px; padding: 4px 10px;
  font-size: 12px; cursor: pointer; color: #42526e; transition: all .12s; white-space: nowrap;
}
.tk-chip:hover { border-color: #4c9aff; background: #f4f8ff; }
.tk-chip.active { background: #0052cc; border-color: #0052cc; color: #fff; }
.tk-real-row { display: flex; align-items: center; gap: 8px; }
.tk-real-btn {
  flex: 1; text-align: left; border: 1px solid #dfe1e6; background: #fff; border-radius: 6px;
  padding: 7px 11px; cursor: pointer; font-size: 13px; color: #172b4d;
}
.tk-real-btn:hover { border-color: #4c9aff; background: #f4f8ff; }
.tk-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.tk-seg { display: inline-flex; border: 1px solid #dfe1e6; border-radius: 6px; overflow: hidden; flex-wrap: wrap; }
.tk-segbtn {
  border: none; border-right: 1px solid #dfe1e6; background: #fff; padding: 5px 9px;
  font-size: 12px; cursor: pointer; color: #42526e;
}
.tk-segbtn:last-child { border-right: none; }
.tk-segbtn:hover { background: #f4f5f7; }
.tk-segbtn.active { background: #253858; color: #fff; }
.tk-segbtn.seg-low.active    { background: #97a0af; }
.tk-segbtn.seg-normal.active { background: #5e6c84; }
.tk-segbtn.seg-high.active   { background: #de350b; }
.tk-date-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tk-date { width: auto; }
.tk-hint { font-size: 11px; color: #6b778c; line-height: 1.4; }

/* Vlákno komentářů v modalu */
.tk-thread { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.tk-comment { background: #f4f5f7; border-radius: 6px; padding: 7px 10px; }
.tk-comment-head { font-size: 11px; color: #5e6c84; margin-bottom: 2px; display: flex; gap: 8px; }
.tk-comment-head strong { color: #172b4d; }
.tk-comment-body { font-size: 13px; color: #172b4d; line-height: 1.4; }
.task-cmt { font-size: 11px; color: #5e6c84; white-space: nowrap; }

/* ── Mobil: úkoly použitelné na telefonu ──────────────────────────────────── */
@media (max-width: 720px) {
  .tasks-page { padding: 12px 10px 40px; }
  .tasks-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .tasks-header-right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .tasks-tabbar { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tasks-tab { white-space: nowrap; padding: 10px 12px; }
  /* Board: sloupce pod sebe, plná šířka, karty dobře klikatelné */
  .kanban { grid-template-columns: 1fr; gap: 10px; }
  .kanban-card { padding: 12px; }
  .kanban-card .task-title { font-size: 15px; }
  /* Modal přes celou výšku, scrollovatelný */
  .tk-modal { width: 96%; max-height: 92vh; display: flex; flex-direction: column; }
  .tk-modal .modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .tk-seg { width: 100%; }
  .tk-segbtn { flex: 1; padding: 9px 8px; }
  .tk-chip { padding: 8px 13px; }     /* větší touch target */
  .tk-hero { font-size: 17px; }
  /* Seznam / řádky se hezky zalomí */
  .task-row, .st-row, .rt-row { padding: 10px 12px; }
}
@media (max-width: 520px) { .tk-grid2 { grid-template-columns: 1fr; } }

/* Kalendář úkolů */
.tcal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.tcal-title { font-weight: 700; font-size: 16px; min-width: 150px; text-align: center; }
.tcal-nodeadline { font-size: 12px; color: var(--c-text-muted); margin-left: auto; }
.tcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.tcal-dow { margin-bottom: 4px; }
.tcal-dowcell { text-align: center; font-weight: 700; font-size: 12px; color: var(--c-text-muted); padding: 2px; }
.tcal-cell {
  min-height: 84px; background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: 6px; padding: 4px; cursor: pointer; overflow: hidden;
}
.tcal-cell:hover { border-color: var(--c-primary); }
.tcal-empty { background: transparent; border: none; cursor: default; }
.tcal-today { border-color: var(--c-primary); box-shadow: inset 0 0 0 1px var(--c-primary); }
.tcal-daynum { font-size: 12px; font-weight: 700; color: var(--c-text-muted); margin-bottom: 3px; }
.tcal-today .tcal-daynum { color: var(--c-primary); }
.tcal-chip {
  font-size: 10px; padding: 2px 5px; border-radius: 4px; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.tcal-chip.st-new  { background: #ebecf0; color: #42526e; }
.tcal-chip.st-prog { background: #deebff; color: #0747a6; }
.tcal-chip.st-wait { background: #fff0b3; color: #974f0c; }
.tcal-chip.st-done { background: #e3fcef; color: #006644; text-decoration: line-through; }
.tcal-chip.overdue { outline: 1px solid #dc2626; }
@media (max-width: 560px) {
  .tcal-cell { min-height: 60px; }
  .tcal-chip { font-size: 9px; }
}

/* Panel úkolů v realizaci (tab 📌 Úkoly) */
.rt-add { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.rt-add-input { flex: 1; min-width: 200px; }
.rt-add-assignee { width: auto; }
.rt-add-deadline { width: auto; }
.rt-list { display: flex; flex-direction: column; gap: 6px; }
.rt-empty { color: var(--c-text-muted); font-style: italic; padding: 12px; text-align: center; }
.rt-done-label { font-size: 12px; font-weight: 700; color: var(--c-text-muted); margin: 10px 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.rt-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px; flex-wrap: wrap; }
.rt-row-done { opacity: .6; }
.rt-row-done .rt-title { text-decoration: line-through; }
.rt-status { border: none; cursor: pointer; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 3px; text-transform: uppercase; letter-spacing: .03em; }
.rt-status.st-new  { background: #ebecf0; color: #42526e; }
.rt-status.st-prog { background: #deebff; color: #0747a6; }
.rt-status.st-wait { background: #fff0b3; color: #974f0c; }
.rt-status.st-done { background: #e3fcef; color: #006644; }
.rt-title { flex: 1; min-width: 140px; font-weight: 600; font-size: 13px; }
.rt-assignee { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 10px; }
.rt-deadline { font-size: 11px; color: var(--c-text-muted); white-space: nowrap; }
.rt-deadline.overdue { color: #dc2626; font-weight: 700; }
.rt-del { background: none; border: none; cursor: pointer; opacity: .5; }
.rt-del:hover { opacity: 1; }

@media (max-width: 860px) {
  .kanban { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .kanban { grid-template-columns: 1fr; }
}

/* ── E-mail intake chooser (📧 Přidat z e-mailu) ─────────────────────────── */
.ei-extracted { font-size: 13px; color: var(--c-text); background: #f4f5f7;
  border-radius: 6px; padding: 8px 10px; margin-bottom: 12px; }
.ei-regex { display: inline-block; margin-left: 6px; font-size: 11px; color: #b54708; }
.ei-section-title { font-size: 12px; font-weight: 700; color: var(--c-text-muted);
  text-transform: uppercase; letter-spacing: .4px; margin: 6px 0 6px; }
.ei-nomatch { font-size: 13px; color: var(--c-text-muted); margin: 4px 0 10px; }
.ei-match { display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border: 1px solid #dfe1e6; border-radius: 6px; margin-bottom: 6px; cursor: pointer; }
.ei-match:hover { border-color: #b3bac5; background: #fafbfc; }
.ei-match input { margin: 0; }
.ei-match-main { flex: 1 1 auto; font-size: 14px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.ei-match-id { font-family: ui-monospace, monospace; font-size: 12px; color: var(--c-text-muted); }
.ei-match-meta { font-size: 11px; color: var(--c-text-muted); white-space: nowrap; }
.ei-match-new { margin-top: 10px; border-style: dashed; }
.ei-badge { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; text-transform: uppercase; }
.ei-badge-offer { background: #e6f0ff; color: #1d4ed8; }
.ei-badge-real { background: #e7f7ee; color: #0f7b3f; }

/* ── LLM loading overlay (spinner při čekání na AI) ─────────────────────────── */
.llm-loading-overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .45); backdrop-filter: blur(1px);
}
.llm-loading-box {
  background: var(--c-surface, #fff); border-radius: 12px;
  padding: 22px 28px; box-shadow: var(--c-shadow-md, 0 8px 30px rgba(0,0,0,.2));
  display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 240px;
}
.llm-spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 4px solid var(--c-border, #e2e8f0);
  border-top-color: var(--c-primary, #3b82f6);
  animation: llm-spin .8s linear infinite;
}
@keyframes llm-spin { to { transform: rotate(360deg); } }
.llm-loading-msg { font-size: 14px; color: var(--c-text, #172b4d); font-weight: 500; text-align: center; }
