/* ============================================
   Dex Asistent — design system
   Cil: 1:1 s puvodnim Platform ERP (Apple-like)
   ============================================ */

:root {
  /* Barvy */
  --bg:             #f5f5f7;
  --bg-elev:        #ffffff;
  --bg-hover:       #fafafa;
  --border:         #e5e5e7;
  --border-strong:  #d2d2d7;
  --text:           #1d1d1f;
  --text-muted:     #6e6e73;
  --text-subtle:    #86868b;

  --accent:         #0071e3;
  --accent-hover:   #0077ed;
  --accent-soft:    #e8f1ff;

  --green:          #34c759;
  --green-soft:     #e8f8ea;
  --red:            #ff3b30;
  --red-soft:       #fde8e7;
  --orange:         #ff9500;
  --orange-soft:    #fff2e0;
  --purple:         #af52de;
  --purple-soft:    #f3e6f9;
  --blue-soft:      #e3f0ff;
  --teal-soft:      #e0f4f1;

  /* Geometrie */
  --radius-sm:      8px;
  --radius:         14px;
  --radius-lg:      18px;
  --shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow:         0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md:      0 4px 16px rgba(0, 0, 0, 0.08);

  /* Layout */
  --topbar-h:       60px;
  --max-w:          1440px;
  --gap:            16px;
  --gap-lg:         20px;

  /* Typo */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg:             #0e0e10;
  --bg-elev:        #1c1c1e;
  --bg-hover:       #2a2a2c;
  --border:         #2c2c2e;
  --border-strong:  #3a3a3c;
  --text:           #f5f5f7;
  --text-muted:     #aeaeb2;
  --text-subtle:    #8e8e93;

  --accent:         #0a84ff;
  --accent-hover:   #2c9aff;
  --accent-soft:    #0a2540;

  --green-soft:     #143e20;
  --red-soft:       #3b1a19;
  --orange-soft:    #3b2810;
  --purple-soft:    #2d1b3a;
  --blue-soft:      #0a2540;
  --teal-soft:      #0e2e2a;

  --shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow:         0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md:      0 4px 16px rgba(0, 0, 0, 0.6);
}

/* ============================================
   Base
   ============================================ */

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-family: var(--font);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* Scrollbar — subtilne */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================
   Topbar
   ============================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff9500, #ff6a00);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}

.project-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.project-switch:hover { background: var(--bg); }
.project-switch .chev { color: var(--text-subtle); font-size: 11px; }

/* Search — default collapsed (ikonka), po kliku expandne */
.search {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search input {
  width: 260px;
  height: 32px;
  padding: 0 34px 0 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: width 0.2s ease, border-color 0.15s, background 0.15s, opacity 0.15s;
}
.search input::placeholder { color: var(--text-subtle); }
.search input:focus { border-color: var(--accent); background: var(--bg-elev); }
.search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}
.search #searchToggle { display: none; }

.search.collapsed input,
.search.collapsed kbd {
  width: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
.search.collapsed #searchToggle { display: inline-flex; }
.search input { width: 340px; }

/* Search dropdown */
.search-dropdown {
  position: absolute;
  top: 38px;
  right: 0;
  width: 480px;
  max-height: 480px;
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  padding: 4px;
}
.search-dropdown[hidden] { display: none; }
.sd-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
}
.sd-item:hover { background: var(--bg); }
.sd-title { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-proj { color: var(--text-subtle); font-size: 11px; white-space: nowrap; }
.sd-loading, .sd-empty { padding: 12px; color: var(--text-muted); font-size: 12.5px; text-align: center; }
.sd-foot { padding: 8px 10px; border-top: 1px solid var(--border); color: var(--text-subtle); font-size: 11px; margin-top: 4px; }
.sd-section {
  padding: 8px 10px 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sd-count {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.topnav {
  display: flex;
  gap: 4px;
  flex: 0 1 auto;
  justify-content: center;
}
.topnav a {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.topnav a:hover { color: var(--text); background: var(--bg); text-decoration: none; }
.topnav a.active { color: var(--text); font-weight: 600; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
}
.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.user-name { font-size: 13px; font-weight: 500; color: var(--text); }
.logout-link { font-size: 13px; color: var(--text-muted); }
.logout-link:hover { color: var(--text); text-decoration: none; }

/* ============================================
   Main
   ============================================ */

.main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 24px 20px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-title { font-size: 28px; font-weight: 600; margin: 0; letter-spacing: -0.02em; }
.page-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Segmented control (Dnes/Tyden/Mesic/Rok) */
.segmented {
  display: inline-flex;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.segmented button {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 7px;
  transition: background 0.15s, color 0.15s;
}
.segmented button:hover { color: var(--text); }
.segmented button.active {
  background: var(--text);
  color: var(--bg-elev);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tabs button {
  position: relative;
  padding: 10px 2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); font-weight: 600; }
.tabs button.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ============================================
   Grid
   ============================================ */

.grid {
  display: grid;
  gap: 12px;
}
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: 1.6fr 1fr; }
.grid.cols-2-eq { grid-template-columns: 1fr 1fr; }

@media (max-width: 1100px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-2, .grid.cols-2-eq { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid.cols-4 { grid-template-columns: 1fr; }
  .main { padding: 16px; }
  .topnav { display: none; }
}

/* ============================================
   Card
   ============================================ */

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}
.card:hover { box-shadow: var(--shadow); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.card-title { font-size: 15px; font-weight: 600; }
.card-meta { font-size: 12px; color: var(--text-subtle); }
.card-actions { display: flex; gap: 6px; }

/* Metricka karta (4 nahore) - ultra kompaktni 2 radky */
.metric {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.metric-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.metric-body { flex: 1; min-width: 0; }
.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.metric-icon svg { width: 18px; height: 18px; }

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1.2;
}
.metric-value {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.metric-trend-label {
  font-size: 11px;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
}
.trend-pill.up   { color: var(--green); background: var(--green-soft); }
.trend-pill.down { color: var(--red);   background: var(--red-soft); }
.metric-trend .label { color: var(--text-subtle); }

/* Icon — jen ramovani, bez vyplne */
.ic-blue, .ic-orange, .ic-green, .ic-purple, .ic-red, .ic-teal {
  background: transparent;
  border: 1.5px solid currentColor;
}
.ic-blue    { color: var(--accent); }
.ic-orange  { color: var(--orange); }
.ic-green   { color: var(--green); }
.ic-purple  { color: var(--purple); }
.ic-red     { color: var(--red); }
.ic-teal    { color: #0c9488; }

/* Chart karta */
.chart-card .chart-wrap {
  position: relative;
  height: 280px;
}
.chart-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.chart-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
}

/* Grid uctu - 3 sloupce x 2 radky, decentni */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  row-gap: 12px;
  column-gap: 0;
}
@media (max-width: 640px) {
  .accounts-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Source badge (Asana) */
.src-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: 1px;
}
.src-badge.src-asana { background: rgba(240,106,106,.12); color: #f06a6a; }

/* ============================================
   Ukoly — full page
   ============================================ */

.summary-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid;
  border-radius: 999px;
  background: transparent;
  transition: transform 0.08s, box-shadow 0.15s;
}
.chip strong { font-weight: 700; }
.chip.chip-filter { cursor: pointer; user-select: none; }
.chip.chip-filter:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }

.chip.chip-inactive {
  border-color: var(--border);
  color: var(--text-subtle);
  background: transparent;
}
.chip.chip-active {
  font-weight: 600;
}

/* Source icon v chipu (J / A) */
.src-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  flex-shrink: 0;
}
.chip-sep {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 2px;
}

/* Komentar na tasku — bez podbarveni, jen ikona (viz .comment-badge) */
.comment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  font-size: 10px;
  border-radius: 50%;
  vertical-align: -3px;
  position: relative;
}
.comment-badge.unread {
  background: rgba(255, 59, 48, 0.15);
  filter: none;
}
.comment-badge.unread::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  border: 1.5px solid var(--bg-elev);
}
.comment-badge.read {
  background: var(--bg);
  border: 1px solid var(--border);
  filter: grayscale(0.6);
  opacity: 0.7;
}

.section-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: 0;
}

.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.task-item {
  display: grid;
  grid-template-columns: 26px 28px auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  transition: background 0.12s;
}
.task-item:hover { background: var(--bg); }

/* Star (zalozka) — vsude */
.task-star {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s, transform 0.05s;
}
.task-star:hover { background: rgba(255, 149, 0, 0.12); color: var(--orange); }
.task-star:active { transform: scale(0.9); }
.task-star.on { color: #f5a623; }
.task-item.is-bookmarked { background: rgba(255, 149, 0, 0.03); }
.task-item.is-bookmarked:hover { background: rgba(255, 149, 0, 0.06); }

/* Kompaktni bookmark list v dashboard widgetu - stejna vyska jako donut-list */
.bm-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bm-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
  line-height: 1.35;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
}
.bm-item:hover { background: transparent; }
.bm-item:hover .bm-title { color: var(--accent); }
.bm-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.bm-title {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.12s;
}
.bm-remove {
  width: 20px;
  height: 20px;
  font-size: 14px;
}

/* Zadavatel jako text na radku tasku */
.task-reporter {
  color: var(--text-subtle);
  font-size: 11px;
  font-style: italic;
  margin-right: 4px;
}

/* Avatar (resitel) */
.task-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  flex-shrink: 0;
  user-select: none;
}
.task-avatar.task-avatar-mine {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.src-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 5px;
  font-family: var(--font);
  letter-spacing: 0.02em;
}

.task-title {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-subtle);
  white-space: nowrap;
}
.task-status {
  padding: 1px 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
}
.task-project { color: var(--text-muted); }
.task-due {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  letter-spacing: 0.01em;
  min-width: 72px;
  justify-content: center;
}
.task-due.due-overdue {
  background: rgba(255, 59, 48, 0.12);
  color: var(--red);
}
.task-due.due-today {
  background: rgba(255, 149, 0, 0.15);
  color: var(--orange);
}
.task-due.due-future {
  background: rgba(52, 199, 89, 0.12);
  color: var(--green);
}
.task-due.due-none {
  color: var(--text-subtle);
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  font-weight: 500;
  font-style: italic;
}

.role-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.role-badge.role-creator { background: rgba(175,82,222,.12); color: var(--purple); }
.role-badge.role-both    { background: rgba(52,199,89,.12);  color: var(--green); }

/* Klikatelny task */
.task-item { cursor: pointer; }

/* ============================================
   Notifikace
   ============================================ */

.notif-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.notif-item {
  display: grid;
  grid-template-columns: 26px auto minmax(0, 1fr);
  gap: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  cursor: pointer;
  transition: background 0.12s;
  align-items: center;
  border-left: 3px solid transparent;
}
.notif-item:hover { background: var(--bg); }
.notif-item.notif-aboutme {
  border-left-color: var(--red);
}
/* Single-row notif - flexibilni content (title+author+snippet) v jednom sloupci */
.nf-content {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.nf-title {
  font-weight: 600;
  color: var(--text);
}
.nf-author {
  color: var(--text-muted);
  font-size: 12px;
}
.nf-author strong { font-weight: 500; color: var(--text); }
.nf-verb { color: var(--text-subtle); }
.nf-snippet {
  color: var(--text-subtle);
  font-style: italic;
}
.nf-time {
  color: var(--text-subtle);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}
.nf-link {
  color: var(--text-subtle);
  font-size: 12px;
  text-decoration: none;
  margin-left: 4px;
  padding: 0 2px;
}
.nf-link:hover { color: var(--accent); text-decoration: none; }

/* ============================================
   Modal (task detail)
   ============================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px 24px;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-backdrop[hidden] { display: none; }

.modal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 96px);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  z-index: 2;
}
.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.modal-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  margin: 4px 0 14px;
  color: var(--text);
}
.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 20px;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12.5px;
}
.modal-meta-grid dt {
  color: var(--text-subtle);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.modal-meta-grid dd {
  margin: 0;
  color: var(--text);
  font-weight: 500;
}

.modal-description {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}
.modal-description h2 { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.modal-description img, .modal-description table { max-width: 100%; }
.modal-description p { margin: 0 0 10px; }
.modal-description a { color: var(--accent); }

.modal-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover { background: var(--bg-elev); border-color: var(--border-strong); text-decoration: none; }

/* ============================================
   Modal layout (lepsi detail)
   ============================================ */

.ml-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-right: 44px; /* prostor pro krizek (modal-close) */
}
.src-tag-lg {
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 6px;
}
.ml-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.ml-pill.ml-status {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.ml-project {
  margin-left: auto;
  color: var(--text-subtle);
  font-size: 12px;
}
.btn-open-ext {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 12px;
}
.ml-top .ml-project + .btn-open-ext { margin-left: 0; }

/* Komentare v modalu */
.ml-count {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.ml-comments {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ml-comment {
  display: grid;
  grid-template-columns: 26px 32px 1fr;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
}
.ml-comment > .task-star { align-self: center; }
.ml-comment .task-avatar {
  width: 32px;
  height: 32px;
  font-size: 11px;
}
.ml-comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.ml-comment-head strong { font-size: 13px; font-weight: 600; color: var(--text); }
.ml-comment-time { font-size: 11px; color: var(--text-subtle); margin-left: auto; }
.ml-comment-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.ml-comment-text p { margin: 0 0 6px; }
.ml-comment-text p:last-child { margin-bottom: 0; }
.ml-comment-text a { color: var(--accent); }

/* Compose komentar */
.ml-empty {
  color: var(--text-subtle);
  font-size: 12.5px;
  padding: 4px 0 10px;
  font-style: italic;
}
.ml-compose {
  margin-top: 12px;
}
.ml-compose-text {
  width: 100%;
  min-height: 70px;
  max-height: 200px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s;
}
.ml-compose-text:focus { border-color: var(--accent); }
.ml-compose-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Akce (transitions / complete) */
.ml-actions-section { padding-top: 16px; }
.ml-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ml-actions-row.ml-actions-top {
  margin: 0 0 18px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ml-actions-loading {
  color: var(--text-subtle);
  font-size: 12px;
  padding: 4px 0;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-primary.btn-complete {
  background: transparent;
  border: 1.5px solid var(--green);
  color: var(--green);
}
.btn-primary.btn-complete:hover {
  background: var(--green);
  color: #fff;
}

/* Novy ukol - top bar + form */
.ukoly-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.btn-new-task {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 12.5px;
}
.nt-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nt-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nt-field input[type="text"],
.nt-field input[type="date"],
.nt-field select,
.nt-field textarea {
  width: 100%;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  outline: none;
  transition: border-color 0.15s;
}
.nt-field input:focus,
.nt-field select:focus,
.nt-field textarea:focus { border-color: var(--accent); }
.nt-field textarea { resize: vertical; min-height: 70px; }
.nt-radio {
  display: flex;
  gap: 16px;
}
.nt-radio label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  cursor: pointer;
}
.nt-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.nt-error {
  padding: 8px 10px;
  background: rgba(255,59,48,.08);
  color: var(--red);
  border-radius: 6px;
  font-size: 12.5px;
}
.nt-ok {
  padding: 8px 10px;
  background: rgba(52,199,89,.1);
  color: var(--green);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
}
.nt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.ml-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 20px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.ml-people {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 16px;
}
.ml-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ml-person .task-avatar {
  width: 36px;
  height: 36px;
  font-size: 12px;
  flex-shrink: 0;
}
.ml-person-label {
  font-size: 10px;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 1px;
}
.ml-person-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ml-due-value {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ml-due-detail {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-subtle);
}

.ml-labels {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ml-label {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.ml-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.ml-section-title {
  font-size: 11px;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 10px;
}
.ml-description {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
}
.ml-description img, .ml-description table { max-width: 100%; }
.ml-description p { margin: 0 0 10px; }
.ml-description a { color: var(--accent); }

.ml-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.ml-timestamps {
  font-size: 11px;
  color: var(--text-subtle);
}

@media (max-width: 640px) {
  .ml-people { grid-template-columns: 1fr; }
}
.account-tile {
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0;
  padding: 2px 16px;
  transition: background 0.12s;
}
.account-tile:nth-child(3n+1) {
  border-left: none;
  padding-left: 0;
}
@media (max-width: 640px) {
  .account-tile:nth-child(3n+1) { border-left: 1px solid var(--border); padding-left: 16px; }
  .account-tile:nth-child(2n+1) { border-left: none; padding-left: 0; }
}
.account-tile:hover { background: var(--bg); }
.account-name {
  font-size: 10.5px;
  color: var(--text-subtle);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.account-balance {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Donut info list vpravo */
.donut-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
  align-items: center;
}
.donut-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.donut-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
  line-height: 1.35;
}
.donut-list .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.donut-list .name { color: var(--text); }
.donut-list .value { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* ============================================
   Login
   ============================================ */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.field input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus { border-color: var(--accent); }

.btn {
  width: 100%;
  height: 40px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: white;
  background: var(--accent);
  border-radius: 8px;
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: default; }

.error-msg {
  font-size: 13px;
  color: var(--red);
  background: var(--red-soft);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  display: none;
}
.error-msg.show { display: block; }

/* ============================================
   Utility
   ============================================ */
.hidden { display: none !important; }
.mt-2  { margin-top: 6px; }
.mt-3  { margin-top: 10px; }
.mt-4  { margin-top: 12px; }
