/* ========== ZÁKLAD & PROMĚNNÉ ========== */
:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --card-bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-weak: #dbeafe;
  --border: #e5e7eb;
  --ring: rgba(37, 99, 235, 0.35);
  --radius: 14px;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.09);

  /* tlačítka – sjednocené */
  --btn-bg: var(--panel);
  --btn-bdr: #d1d5db;
  --btn-txt: var(--text);
  --btn-accent: var(--primary);
  --btn-accent-txt: #fff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --panel: #111520;
    --card-bg: #101826;
    --text: #e5e7eb;
    --muted: #9aa3b2;
    --primary: #60a5fa;
    --primary-weak: #1f2a44;
    --border: #1f2637;
    --ring: rgba(96, 165, 250, 0.45);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.45);

    --btn-bg: var(--panel);
    --btn-bdr: var(--border);
    --btn-txt: var(--text);
    --btn-accent: #2d62ff;
    --btn-accent-txt: #fff;
  }
}

/* Reset */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== ROZVRŽENÍ ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px clamp(16px, 2.2vw, 28px);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  gap: 24px;
}

/* ========== HLAVIČKA ========== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  backdrop-filter: saturate(120%) blur(6px);
}

header .left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.logo {
  max-width: clamp(160px, 26vw, 300px);
  height: auto;
  display: block;
}

.date {
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* ========== OBSAH ========== */
main {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Sekce */
.section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow-sm);
}

/* Hlavička sekce */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6px 8px 6px;
  border-bottom: 1px dashed var(--border);
}

.section-header .title h2 {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.badge {
  font-size: 0.85rem;
  color: var(--primary);
  background: var(--primary-weak);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent);
}

/* GRID karet */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

/* ========== KARTA DLAŽDICE (sjednocená) ========== */
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 12px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  outline: none;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

.card:focus-visible {
  box-shadow: 0 0 0 4px var(--ring), var(--shadow-lg);
  border-color: var(--primary);
}

.card img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 85%, transparent), transparent);
  padding: 8px;
  transition: transform .2s ease;
}

.card:hover img {
  transform: scale(1.04);
}

.card span {
  display: block;
  text-align: center;
  font-weight: 600;
  font-size: .98rem;
  line-height: 1.25;
}

/* jednotný vzhled odkazů uvnitř karty (pokud má karta víc linků) */
.card .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.card .links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: .92rem;
  text-decoration: none;
  color: inherit;
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
}

.card .links a:hover {
  background: rgba(0, 0, 0, .04);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
  .card .links a:hover {
    background: rgba(255, 255, 255, .05);
  }
}

/* Prázdný stav */
.empty {
  text-align: center;
  color: var(--muted);
  background: repeating-linear-gradient(-45deg, transparent 0 8px, color-mix(in srgb, var(--border) 50%, transparent) 8px 16px);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

/* ========== TLAČÍTKA ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--btn-bdr);
  background: var(--btn-bg);
  color: var(--btn-txt);
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s ease, filter .12s ease, box-shadow .12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn.primary {
  background: var(--btn-accent);
  border-color: transparent;
  color: var(--btn-accent-txt);
}

/* ========== LOGIN DIALOG – NAMESPACED ========== */
dialog.login {
  width: min(440px, 92vw);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

dialog.login::backdrop {
  background: rgba(0, 0, 0, .5);
}

/* !!! Důležité: nepoužívej .card pro login, ať se neplete s dlaždicemi */
.login-card {
  padding: 22px;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.login-card p.sub {
  margin: .25rem 0 1rem;
  color: var(--muted);
  font-size: .95rem;
}

.login-card label {
  display: block;
  margin: .6rem 0 .35rem;
}

.login-card input[type=email],
.login-card input[type=password] {
  width: 100%;
  padding: .75rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, black);
  background: color-mix(in srgb, var(--panel) 90%, black);
  color: var(--text);
}

.login-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: .8rem;
}

.error {
  background: #2a1120;
  color: #ff93a5;
  border: 1px solid #522030;
  padding: .6rem .75rem;
  border-radius: 10px;
  margin: .6rem 0 0;
}

.links {
  margin-top: 1rem;
  font-size: .95rem;
}

.links a {
  color: color-mix(in srgb, var(--primary) 70%, #9db4ff);
  text-decoration: none;
}

.closebar {
  display: flex;
  justify-content: flex-end;
  padding: 10px 12px 0 12px;
}

.closebtn {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

/* ========== PATIČKA ========== */
footer {
  margin-top: auto;
  text-align: center;
  color: var(--muted);
  font-size: .92rem;
  padding: 8px;
}

/* ========== DOSTUPNOST & DETAILY ========== */
.card:active {
  transform: translateY(-1px);
}

.card:focus {
  outline: none;
}

/* Responzivita */
@media (max-width: 640px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .date {
    align-self: flex-end;
  }
}

/* Preferované omezení pohybu */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* Tisk – jednoduchý seznam */
@media print {
  :root {
    --bg: #fff;
  }

  body {
    background: #fff;
  }

  header,
  .section,
  footer {
    box-shadow: none;
  }

  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


.edit-button {
  display: inline-block;
  margin: 1rem 0;
  padding: 0.6rem 1.2rem;
  background: var(--primary);
  color: white;
  font-weight: 600;
  border-radius: 14px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, transform 0.2s;
}

.edit-button:hover {
  background: #1e4fbe;
  transform: translateY(-2px);
}

.edit-button:active {
  transform: translateY(0);
}


/* ===== To-Do lišta ===== */
.todo-bar {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
}

.todo-bar input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
}

.todo-bar button {
  padding: 8px 12px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
  font-size: 18px;
}

#todo-list {
  display: flex;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

#todo-list li {
  background: var(--primary-weak);
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: 0.2s;
}

#todo-list li.done {
  text-decoration: line-through;
  opacity: 0.5;
}

#todo-list li {
  background: var(--primary-weak);
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.todo-main {
  display: flex;
  flex-direction: column;
}

.todo-text {
  font-weight: 500;
}

.todo-date {
  font-size: 11px;
  color: var(--muted);
}

.todo-delete {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}

.todo-delete:hover {
  opacity: 1;
}

#todo-list li.done .todo-text {
  text-decoration: line-through;
  opacity: 0.6;
}

.odpad-card {
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, .65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .08);
  margin: 14px 0;
}

.odpad-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.odpad-card__title {
  font-weight: 800;
  font-size: 1.05rem;
}

.odpad-card__sub {
  opacity: .7;
  font-size: .9rem;
}

.odpad-card__link {
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, .10);
  background: rgba(255, 255, 255, .7);
  color: inherit;
  font-weight: 600;
}

.odpad-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.odpad-pill {
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .10);
  background: rgba(255, 255, 255, .7);
  white-space: nowrap;
}

.odpad-pill--bio {
  /* zelený nádech bez tvrdých barev */
  background: rgba(46, 204, 113, .15);
}

.odpad-msg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.odpad-msg--muted {
  opacity: .75;
  padding-top: 6px;
}

.odpad-badge {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .10);
  background: rgba(255, 255, 255, .75);
  font-weight: 700;
}

.odpad-badge--hot {
  background: rgba(46, 204, 113, .18);
}

.odpad-next {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, .18);
}

.odpad-next__title {
  font-weight: 800;
  margin-bottom: 6px;
}

.odpad-next__list {
  margin: 0;
  padding-left: 18px;
  opacity: .9;
}


.odpad-card {
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, .65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .08);
  margin: 14px 0;
}

.odpad-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.odpad-card__title {
  font-weight: 800;
  font-size: 1.05rem;
}

.odpad-card__sub {
  opacity: .7;
  font-size: .9rem;
}

.odpad-card__link {
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, .10);
  background: rgba(255, 255, 255, .7);
  color: inherit;
  font-weight: 700;
  white-space: nowrap;
}

.odpad-card__body {
  margin-top: 8px;
}

.odpad-empty {
  opacity: .8;
  padding: 10px 0;
}

.odpad-events {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.odpad-event {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: rgba(255, 255, 255, .7);
}

.odpad-event__pill {
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .10);
  background: rgba(255, 255, 255, .75);
  white-space: nowrap;
}

.odpad-event__text {
  font-weight: 700;
}

.odpad-event__when {
  margin-right: 6px;
}

.odpad-event__date {
  opacity: .8;
}

.odpad-event--bio {
  background: rgba(46, 204, 113, .13);
}

.odpad-event--komunal {
  background: rgba(52, 152, 219, .12);
}

.odpad-event--plast_papir {
  background: rgba(155, 89, 182, .12);
}

.odpad-next {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, .18);
}

.odpad-next__title {
  font-weight: 900;
  margin-bottom: 6px;
}

.odpad-next__list {
  margin: 0;
  padding-left: 18px;
  opacity: .92;
}


.odpad-ico {
  display: inline-flex;
  width: 1.25em;
  justify-content: center;
  margin-right: 6px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  /* vpravo užší sloupec pro odpad */
  gap: 16px;
  align-items: start;
}

.home-col {
  min-width: 0;
  /* aby se v gridu nelámaly divné overflow věci */
  padding-left: 26px;
  /* klíčové – aby to nebylo nalepené na kraj */
  padding-right: 8px;
  padding-top: 20px;

}

/* na menších displejích pod sebe */
@media (max-width: 980px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 981px) {
  .home-col--odpad {
    position: sticky;
    top: 14px;
  }
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  /* trochu užší a konzistentní */
  gap: 16px;
  align-items: start;
}

@media (min-width: 981px) {
  .home-col--odpad {
    position: sticky;
    top: 90px;
    /* aby to nelezlo pod header */
  }
}

@media (max-width: 980px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

.home-col--odpad {
  padding-top: 6px;
}

.odpad-event__when {
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: rgba(255, 255, 255, .75);
}

.odpad-empty,
.odpad-msg--muted {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(0, 0, 0, .18);
  background: rgba(255, 255, 255, .55);
}

/* panel doprava: víc "dashboard" */
.home-col--odpad {
  padding-top: 6px;
}

@media (min-width: 981px) {
  .home-col--odpad {
    position: sticky;
    top: 92px;
  }
}

/* karta odpadu jako "widget" */
.odpad-card {
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .08);
}

.odpad-card__head {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  margin-bottom: 12px;
}

.odpad-card__title {
  font-weight: 900;
  font-size: 1.05rem;
}

.odpad-card__sub {
  opacity: .75;
  font-size: .9rem;
}

/* event řádky */
.odpad-events {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.odpad-event {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: rgba(255, 255, 255, .75);
}

.odpad-event__left {
  min-width: 0;
}

.odpad-event__pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  white-space: nowrap;
}

.odpad-ico {
  width: 1.25em;
  display: inline-flex;
  justify-content: center;
}

.odpad-event__meta {
  margin-top: 4px;
  font-size: .88rem;
  opacity: .75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* badge (dnes/zítra/za X dní) */
.odpad-event__badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  border: 1px solid rgba(0, 0, 0, .10);
  background: rgba(255, 255, 255, .8);
  white-space: nowrap;
}

.odpad-event__badge.is-hot {
  background: rgba(255, 230, 0, .18);
  /* jemné zvýraznění */
}

/* jemné barevné pozadí podle typu */
.odpad-event--bio {
  background: rgba(46, 204, 113, .14);
}

.odpad-event--komunal {
  background: rgba(52, 152, 219, .14);
}

.odpad-event--plast_papir {
  background: rgba(155, 89, 182, .14);
}

/* "nic se neděje" jako info box */
.odpad-empty,
.odpad-msg--muted {
  display: block;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(0, 0, 0, .18);
  background: rgba(255, 255, 255, .6);
  font-weight: 700;
  opacity: .85;
}

/* Nejbližší termíny */
.odpad-next {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, .06);
}

.odpad-next__title {
  font-weight: 900;
  margin-bottom: 8px;
}

.odpad-next__list {
  margin: 0;
  padding-left: 18px;
  opacity: .92;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 980px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}




/* celý blok TODO odsadit od kraje */
.todo-bar,
#todo-list {
  margin-left: 16px;
  /* zleva */
  margin-right: 16px;
  /* ať to dýchá i zprava */
}

/* trochu mezera mezi inputem a seznamem */
#todo-list {
  margin-top: 12px;
  padding-left: 0;
  /* zruší defaultní odsazení <ul> */
  list-style: none;
  /* bez teček */
}

/* rozestupy mezi úkoly */
#todo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  /* řádková mezera | mezera mezi chipy */
}

/* pokud chceš, aby se chipy na mobilu víc skládaly */
@media (max-width: 520px) {
  #todo-list {
    gap: 10px 10px;
  }
}


.ha-widget {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(10px);
}

.ha-widget__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ha-widget__title {
  font-weight: 700;
}

.ha-widget__meta {
  font-size: 12px;
  opacity: .8;
  white-space: nowrap;
}

.ha-widget__grid {
  display: grid;
  gap: 8px;
}

.ha-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ha-label {
  opacity: .85
}

.ha-val {
  font-variant-numeric: tabular-nums
}

.ha-muted {
  opacity: .75
}


.home-col--sidebar {
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* mezera mezi widgety */
}

@media (min-width: 981px) {
  .home-col--sidebar {
    position: sticky;
    top: 92px;
    /* stejně jako máš odpad */
  }
}


/* ====== FINAL DASHBOARD LAYOUT (override) ====== */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 980px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

/* pravý panel = stack widgetů */
.home-col--sidebar {
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 0;
  /* v pravém panelu nechceme velké odsazení */
  padding-right: 0;
}

@media (min-width: 981px) {
  .home-col--sidebar {
    position: sticky;
    top: 92px;
  }
}

/* původní odpad sloupec už nepoužíváme – kdyby někde zůstal, vypneme sticky */
.home-col--odpad {
  position: static !important;
  top: auto !important;
}


/* ===== FINAL override (vyhraje vždy) ===== */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 980px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

.home-col--sidebar {
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 0;
  padding-right: 0;
}

@media (min-width: 981px) {
  .home-col--sidebar {
    position: sticky;
    top: 92px;
  }
}

/* ===== FINAL override (vyhraje vždy) ===== */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 980px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

.home-col--sidebar {
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 0;
  padding-right: 0;
}

@media (min-width: 981px) {
  .home-col--sidebar {
    position: sticky;
    top: 92px;
  }
}

.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-right: 20px;
}

/* HA metriky v jednom řádku */
.ha-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.ha-metric {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: rgba(255, 255, 255, .75);
}

.ha-ico {
  width: 1.2em;
  text-align: center;
}

.ha-name {
  font-weight: 700;
  opacity: .85;
}

.ha-num {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.ha-num small {
  font-weight: 700;
  opacity: .7;
  margin-left: 4px;
}

/* mobil: 2 sloupce */
@media (max-width: 700px) {
  .ha-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* horní dashboard – HA + todo bez mezery */
.home-top {
  display: flex;
  flex-direction: column;
  gap: 0;
  /* 🔑 tady mizí mezera */
}

/* ===== TODO karta ===== */
.todo-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 14px 16px 16px;
}

/* hlavička karty */
.todo-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.todo-card__head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

/* todo input lišta už nebude „sticky“ přes celou stránku */
.todo-bar {
  position: relative;
  top: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  border: none;
}



.mb-widget {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  margin: 0 0 16px 0;
}

.mb-widget__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  margin-bottom: 10px;
}

.mb-widget__title {
  font-weight: 900;
  font-size: 1.05rem;
}

.mb-widget__meta {
  font-size: 12px;
  opacity: .75;
  white-space: nowrap;
}

.mb-widget__empty {
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(0, 0, 0, .18);
  background: rgba(255, 255, 255, .6);
  opacity: .9;
  font-weight: 700;
}

.mb-widget__body {
  font-size: 0.98rem;
  line-height: 1.5;
}

.mb-widget__body h1,
.mb-widget__body h2,
.mb-widget__body h3 {
  margin: 10px 0 6px;
}

.mb-widget__body ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.mb-widget {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  margin: 0 0 16px 0;
}

.mb-widget__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  margin-bottom: 10px;
}

.mb-widget__title {
  font-weight: 900;
  font-size: 1.05rem;
}

.mb-widget__meta {
  font-size: 12px;
  opacity: .75;
  white-space: nowrap;
}

.mb-widget__body p {
  margin: 8px 0;
}

.mb-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.mb-list li {
  margin: 6px 0;
}

.mb-widget__sources {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, .12);
}

.mb-widget__sources-title.market-brief .mb-body {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.market-brief .mb-summary {
  background: rgba(255, 255, 255, .65);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 14px;
  padding: 14px 14px;
  line-height: 1.5;
  white-space: normal;
}

.market-brief .mb-sources {
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 14px;
  padding: 12px 14px;
}

.market-brief .mb-sources__title {
  font-weight: 900;
  margin-bottom: 8px;
  opacity: .9;
}

.market-brief .mb-sources ul {
  margin: 0;
  padding-left: 18px;
}

.market-brief .mb-sources a {
  text-decoration: none;
  font-weight: 700;
}

.mb-sources {
  margin: 0;
  padding-left: 18px;
}

.mb-sources li {
  margin: 6px 0;
}

.mb-sources a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
}

.mb-sources a:hover {
  text-decoration: underline;
}

.mb-src-date {
  margin-left: 8px;
  font-size: 12px;
  opacity: .7;
}


.market-sources {
  margin-top: 1rem;
  opacity: 0.85;
}

.market-sources summary {
  cursor: pointer;
  font-weight: 600;
  color: #9db4ff;
}

.market-sources summary:hover {
  text-decoration: underline;
}

.market-sources ul {
  margin-top: 0.5rem;
  padding-left: 1.2rem;
  font-size: 0.9em;
}

.stocks {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin: 0 0 .5rem 0;
}

.stock {
  background: #0f1523;
  border: 1px solid #1f2a44;
  border-radius: 12px;
  padding: .55rem .7rem;
  min-width: 110px;
  text-align: center;
  color: #e5e7eb;
}

.stock .ticker {
  font-weight: 700;
  font-size: .85rem;
  opacity: .95;
}

.stock .price {
  font-size: 1.05rem;
  margin-top: .15rem;
}

.stock .change {
  font-size: .85rem;
  margin-top: .1rem;
}

.stock.up .change {
  color: #4ade80;
}

.stock.down .change {
  color: #f87171;
}

.stocks-updated {
  font-size: .8rem;
  opacity: .7;
  margin-bottom: 1rem;
}