/* ============================================
   YDOT.CZ ToDo List – style.css
   Doplňuje sdílený /css/style.css
   ============================================ */

/* Lokální font – stejný jako na ydot.cz */
@font-face {
  font-family: 'Comfortaa';
  src: url('../../fonts/Comfortaa-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* ── Variables ──────────────────────────────── */
:root {
  --app-bg:         #f0f2f7;
  --surface:        #ffffff;
  --surface-2:      #f8fafc;
  --border:         #e2e8f0;
  --text:           #1a1a2e;
  --text-muted:     #64748b;
  --accent:         #6366f1;
  --accent-light:   #eef2ff;
  --accent-hover:   #4f46e5;
  --danger:         #ef4444;
  --success:        #22c55e;
  --warning:        #f59e0b;
  --premium:        #f59e0b;

  /* Priorita */
  --p-low:      #38bdf8;
  --p-medium:   #fb923c;
  --p-high:     #ef4444;
  --p-critical: #1a1a2e;

  /* Kapacita bar */
  --bar-h:    28px;
  --bar-r:    14px;
  --bar-bg:   #d1d5db;
  --bar-done: #22c55e;
  --bar-undo: #a3e635;

  /* Layout */
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 2px 12px rgba(26,26,46,.08);
  --shadow-md:  0 4px 24px rgba(26,26,46,.14);
  --transition: .2s cubic-bezier(.4,0,.2,1);

  /* Font */
  --font: 'Comfortaa', 'Segoe UI', system-ui, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--app-bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Header ────────────────────────────────── */
.site-header {
  padding: 0 20px;
  height: 60px;
  min-height: 60px;
  overflow: visible;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
  /* display a grid layout definován níže v "Logo v headeru" sekci */
}

/* ══ Logo v headeru – pouze zarovnat na střed, zachovat původní font ══ */

/* Header: logo vlevo, menu vpravo */
.site-header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
}

.site-header .logo {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-items: center !important;
  margin-bottom: 0 !important;
  line-height: 1 !important;
  gap: 0 !important;
  /* Přepsat clamp(50px,12vw,100px) na kompaktní velikost pro header */
  font-size: 1.4rem !important;
  letter-spacing: 0.5px !important;
}

/* Anchor uvnitř loga – inline */
.site-header .logo > a {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  text-decoration: none !important;
  line-height: 1 !important;
}

/* Spany loga – zmenšit + zrušit animace */
.site-header .logo > a > span,
.site-header .logo .y,
.site-header .logo .dot,
.site-header .logo .dotb,
.site-header .logo .cz {
  display: inline !important;
  font-size: 1.4rem !important;
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
  animation: none !important;
}

/* "/ ToDo" – na stejném řádku jako logo, pod sdíleným font-size */
.header-app-label {
  display: inline-flex !important;
  align-items: center !important;
  margin-left: .4em;
  font-size: .35em;     /* relativně k font-size loga */
  color: #94a3b8;
  font-family: var(--font);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .875rem;
}

.user-email {
  color: var(--text-muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* .premium-badge odstraněno */

.btn-logout {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .8rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.btn-logout:hover { background: var(--surface-2); }

.btn-nav {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .8rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn-nav:hover { background: var(--accent-light); color: var(--accent); }

/* ── Layout ─────────────────────────────────── */
.app-layout {
  max-width: 1337px;
  margin: 0 auto;
  padding: 20px 20px;   /* rovnoměrné odsazení 20px ze všech stran */
}

/* ── Upgrade banner ─────────────────────────── */
.upgrade-banner {
  background: linear-gradient(135deg, #fef9c3, #fef08a);
  border: 1px solid #fde047;
  border-radius: var(--radius);
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: .9rem;
  font-weight: 500;
  flex-wrap: wrap;
}

.btn-premium {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: .8rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition);
}
.btn-premium:hover { opacity: .9; }

/* ── ★ iTunes-style Capacity Bar ─────────────── */
.capacity-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.capacity-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: .75rem;
}

.capacity-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.01em;
}

.capacity-numbers {
  font-size: .8rem;
  color: var(--text-muted);
}

.capacity-numbers strong {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
}

/* Hlavní bar – jako iTunes storage */
.cap-bar-wrap {
  position: relative;
  height: var(--bar-h);
  border-radius: var(--bar-r);
  background: var(--bar-bg);
  overflow: hidden;
  cursor: default;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.12);
}

/* Segmenty úkolů */
.cap-segments {
  display: flex;
  height: 100%;
  width: 100%;
  position: absolute;
  inset: 0;
}

.cap-seg {
  height: 100%;
  transition: width .5s cubic-bezier(.4,0,.2,1), opacity var(--transition);
  position: relative;
}

.cap-seg.done-seg {
  opacity: .45;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    rgba(255,255,255,.3) 4px,
    rgba(255,255,255,.3) 8px
  ) !important;
}

/* Styl segmentů baru dle stylu karty */
.cap-seg.seg-chalk {
  background-image: repeating-linear-gradient(
    0deg, transparent, transparent 5px,
    rgba(255,255,255,.18) 5px, rgba(255,255,255,.18) 6px
  ) !important;
  /* barva přes background-color, pattern přes image */
  background-blend-mode: overlay;
}

.cap-seg.seg-dashed {
  background-image: repeating-linear-gradient(
    90deg, transparent, transparent 6px,
    rgba(255,255,255,.25) 6px, rgba(255,255,255,.25) 10px
  ) !important;
  background-blend-mode: overlay;
}

.cap-seg.seg-grid {
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 5px, rgba(255,255,255,.15) 5px, rgba(255,255,255,.15) 6px),
    repeating-linear-gradient(90deg, transparent, transparent 5px, rgba(255,255,255,.15) 5px, rgba(255,255,255,.15) 6px) !important;
  background-blend-mode: overlay;
}

/* solid styl = žádný overlay, čistá barva */
.cap-seg.seg-solid {}

/* Odlesk – "glass" effect jako iTunes */
.cap-bar-gloss {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,.35) 0%,
    rgba(255,255,255,.05) 55%,
    rgba(0,0,0,.05) 100%
  );
  border-radius: var(--bar-r);
  pointer-events: none;
  z-index: 2;
}

/* Tick mark na 100 */
.cap-bar-ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.cap-tick {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: rgba(255,255,255,.5);
}

/* Tooltip při hoveru */
.cap-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  font-size: .72rem;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 10;
}
.cap-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--text);
}

.cap-seg:hover .cap-tooltip { opacity: 1; }

/* Legenda pod barem */
.cap-legend {
  display: flex;
  gap: 1rem;
  margin-top: .6rem;
  flex-wrap: wrap;
}

.cap-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  color: var(--text-muted);
}

.cap-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Stav přeplnění */
.cap-bar-wrap.overloaded {
  animation: shake .4s ease;
}

.cap-overload-msg {
  display: none;
  color: var(--danger);
  font-size: .78rem;
  margin-top: .4rem;
  font-weight: 600;
}
/* Overload message is controlled by JS (updateSliderMax) */

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  40%      { transform: translateX(4px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}

/* ── Stats row ──────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform var(--transition);
}
.stat-card:hover { transform: translateY(-2px); }

.stat-card .val {
  font-family: var(--font);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}
.stat-card.done .val { color: var(--success); }
.stat-card.overdue .val { color: var(--danger); }
.stat-card.pending .val { color: var(--warning); }

.stat-card .lbl {
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 3px;
}

/* ── Toolbar ────────────────────────────────── */
.toolbar {
  display: flex;
  gap: .6rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-wrap {
  flex: 1;
  min-width: 180px;
  position: relative;
}

.search-wrap input {
  width: 100%;
  padding: .55rem .9rem .55rem 2.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .875rem;
  background: var(--surface);
  transition: border var(--transition), box-shadow var(--transition);
  color: var(--text);
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.search-wrap .ico {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: .9rem;
}

.filter-select {
  padding: .55rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .875rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border var(--transition);
}
.filter-select:focus { outline: none; border-color: var(--accent); }

/* ── Btn ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,.35); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: .3rem .7rem; font-size: .78rem; }
.btn-icon { padding: .35rem .45rem; aspect-ratio: 1; }

/* ── Add-form card ──────────────────────────── */
.add-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.add-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: border var(--transition);
}
.add-card-header:hover { background: var(--surface-2); }
.add-card[open] .add-card-header { border-bottom-color: var(--border); }

.add-card-header h2 {
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 700;
}

.add-card-body {
  padding: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}
.form-grid .full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

.form-control {
  padding: .55rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .875rem;
  color: var(--text);
  background: var(--surface);
  transition: border var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

textarea.form-control { resize: vertical; min-height: 70px; }

/* Váha slider */
.weight-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.weight-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  cursor: pointer;
  outline: none;
}
.weight-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  cursor: pointer;
}
.weight-val {
  min-width: 42px;
  text-align: right;
  font-weight: 700;
  font-size: .95rem;
  color: var(--accent);
}

/* Barva swatches */
.color-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 30px;
}

.color-swatch {
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  outline: none;
  flex-shrink: 0;
}
.color-swatch:hover { transform: scale(1.2); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.color-swatch.active { border-color: #1a1a2e; transform: scale(1.15); box-shadow: 0 2px 8px rgba(0,0,0,.3); }

.color-custom {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
  flex-shrink: 0;
}

/* Styl karet */
.style-opts {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  min-height: 34px;
}

.style-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  font-weight: 600;
}
.style-btn.active, .style-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* ── Todo list ──────────────────────────────── */
.todo-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

/* Prázdný stav */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: .75rem; }
.empty-state h3 { font-family: var(--font); font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: .4rem; }

/* ── Todo karta ─────────────────────────────── */
.todo-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  padding: .9rem 1.1rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  border-left: 4px solid transparent;
  cursor: default;
}

.todo-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Styly karet */
.todo-card.style-solid {
  border-left-width: 4px;
  border-left-style: solid;
}

.todo-card.style-chalk {
  border-left-width: 4px;
  border-left-style: solid;
  background: var(--surface);
  position: relative;
}
.todo-card.style-chalk::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 24px,
    rgba(0,0,0,.03) 24px,
    rgba(0,0,0,.03) 25px
  );
  pointer-events: none;
}

.todo-card.style-dashed {
  border: 2px dashed var(--border);
  border-left: 4px solid transparent;
}

.todo-card.style-grid {
  background-image:
    linear-gradient(rgba(99,102,241,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,.04) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Splněný úkol */
.todo-card.is-done {
  opacity: .6;
}
.todo-card.is-done .todo-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Checkmark */
.todo-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  margin-top: 2px;
}
.todo-check:hover { border-color: var(--accent); background: var(--accent-light); }
.todo-card.is-done .todo-check {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.todo-body { flex: 1; min-width: 0; }

.todo-title {
  font-weight: 600;
  font-size: .95rem;
  word-break: break-word;
  margin-bottom: 2px;
}

.todo-desc {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: .45rem;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.todo-meta {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Priorita badge */
.badge-priority {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 7px;
  border-radius: 4px;
}
.p-low      { background: #e0f2fe; color: #0369a1; }
.p-medium   { background: #fef9c3; color: #854d0e; }
.p-high     { background: #fee2e2; color: #dc2626; }
.p-critical { background: #1a1a2e; color: #f1f5f9; }

/* Deadline */
.badge-deadline {
  font-size: .72rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.badge-deadline.overdue { color: var(--danger); font-weight: 700; }

/* Váha */
.badge-weight {
  font-size: .72rem;
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
}

/* Kategorie */
.badge-cat {
  font-size: .68rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  color: #fff;
}

/* Štítky */
.badge-tag {
  font-size: .65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Akce na kartě */
.todo-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
  flex-shrink: 0;
}
.todo-card:hover .todo-actions { opacity: 1; }

/* ── Modal ──────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,15,35,.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(.97);
  transition: transform .2s;
}
.modal-backdrop.open .modal { transform: none; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-family: var(--font); font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-muted); line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--text); }

.modal-body { padding: 1.4rem; }
.modal-footer { padding: .9rem 1.4rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; justify-content: flex-end; }

/* ── Toast ──────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: .7rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn .25s ease;
  display: flex;
  align-items: center;
  gap: .5rem;
  max-width: 300px;
}

.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--text); }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@keyframes toastOut {
  to { transform: translateX(120%); opacity: 0; }
}

/* ── Loading skeleton ───────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 640px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: 1; }
  .toolbar { flex-direction: column; }
  .search-wrap { width: 100%; }
  .header-right .user-email { display: none; }
  .app-layout { margin: 1rem auto; }
}

@media (max-width: 420px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .todo-actions { opacity: 1; }
  .cap-legend { display: none; }
}

/* ── Animace vstupu ─────────────────────────── */
.todo-card {
  animation: cardIn .3s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ── Kategorie manager ──────────────────────── */
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  color: #fff;
}
.cat-chip:hover { opacity: .85; }

/* ── Tags input ─────────────────────────────── */
.tags-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: .4rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 40px;
  cursor: text;
  transition: border var(--transition), box-shadow var(--transition);
}
.tags-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.tags-input-wrap input {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: .875rem;
  flex: 1;
  min-width: 80px;
  background: transparent;
  color: var(--text);
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
}
.tag-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 0;
  line-height: 1;
  font-size: .8rem;
}

/* ══ Settings page ══════════════════════════════ */
.settings-page {
  max-width: 700px;
}

.settings-header {
  margin-bottom: 2rem;
}
.settings-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: .3rem;
}
.settings-header p {
  color: var(--text-muted);
  font-size: .9rem;
}

.settings-section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .85rem;
}
.settings-section-header h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.lock-badge {
  font-size: .75rem;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 20px;
}

/* Add form */
.cat-add-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.cat-add-card h3 {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: .85rem;
}
.cat-add-form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.cat-color-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.cat-color-row label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Category list rows */
.cat-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: box-shadow var(--transition);
  animation: cardIn .25s ease;
}
.cat-row:hover {
  box-shadow: var(--shadow);
}
.cat-row-left {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.cat-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.1);
}
.cat-row-name {
  font-weight: 600;
  font-size: .9rem;
}
.cat-row-actions {
  display: flex;
  gap: .4rem;
}

@media (max-width: 480px) {
  .cat-row { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .cat-row-actions { width: 100%; }
  .settings-section { padding: 1rem; }
}

/* ══ Hamburger menu (mobilní navigace) ═════════════════════════════ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 4px;
  cursor: pointer;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  flex-shrink: 0;
}
.hamburger:hover { background: var(--surface-2); }
.hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease, width .2s ease;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 8px 32px rgba(26,26,46,.12);
  z-index: 99;
  padding: .75rem 1.25rem 1rem;
  flex-direction: column;
  gap: .25rem;
  animation: slideDown .2s ease;
}
.mobile-nav.open { display: flex; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mobile-nav-user {
  font-size: .78rem;
  color: var(--text-muted);
  padding: .4rem .5rem .75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-nav a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem .75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.mobile-nav a:hover { background: var(--surface-2); }
.mobile-nav a.logout { color: var(--danger); }
.mobile-nav a.logout:hover { background: #fef2f2; }

/* Mobile overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 60px;
  background: rgba(0,0,0,.2);
  z-index: 98;
}
.mobile-nav-overlay.open { display: block; }

@media (max-width: 700px) {
  .hamburger { display: flex; }
  .header-right { display: none; }
  /* Grid na mobilech – 3 sloupce stačí pro stats */
  .site-header {
    display: flex !important;
    justify-content: space-between !important;
  }
}
