/* Denní rádce (radce.js) — stránka #radce, pruh na Dashboardu a karta v Konektory → Agenti. Barvy jen z proměnných :root (styles.css). */

.rd { max-width: 960px; margin: 0 auto; padding: 4px 0 40px; }
.rd-load { color: var(--muted); padding: 24px 4px; }
.rd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rd-head__t { display: flex; align-items: center; gap: 8px; }
.rd-head__t h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.rd-head__acts { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.rd-who { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.rd-who .form__select { width: auto; padding-top: 4px; padding-bottom: 4px; font-size: 12px; }
.rd-ico { display: inline-flex; width: 14px; height: 14px; margin-right: 6px; }
.rd-ico svg { width: 14px; height: 14px; }
.rd-ico.is-spin svg { animation: rd-spin 1s linear infinite; }
@keyframes rd-spin { to { transform: rotate(360deg); } }

.rd-comp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.rd-chip { display: inline-flex; padding: 1px 8px; border-radius: 999px; background: var(--st-buy-bg); color: var(--st-buy-ink); font-weight: 700; font-size: 11.5px; }
.rd-chip--all { background: var(--bg-2); color: var(--ink-3); }
.rd-comp__hint { color: var(--muted-2); font-size: 11px; }

.rd-list { margin-top: 18px; display: flex; flex-direction: column; gap: 22px; }
.rd-err { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; border-radius: 12px; background: var(--lime-50); color: var(--c-brand-strong); font-size: 12.5px; }
.rd-err svg { width: 14px; height: 14px; flex: none; }
.rd-err span { flex: 1; min-width: 0; }
.rd-err button { border: 0; background: none; font: inherit; font-weight: 700; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.rd-err--top { margin-top: 14px; background: var(--st-bad-bg); color: var(--st-bad-ink); }

.rd-msg { display: flex; gap: 12px; }
.rd-msg.is-faded { opacity: .55; }
.rd-msg__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rd-av { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--lime); color: var(--ink); }
.rd-av svg { width: 17px; height: 17px; }
.rd-av--sm { width: 26px; height: 26px; }
.rd-av--sm svg { width: 14px; height: 14px; }
.rd-av.is-pulse { animation: rd-pulse 1.4s ease-in-out infinite; }
@keyframes rd-pulse { 50% { opacity: .5; } }
.rd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 11.5px; color: var(--muted-2); }
.rd-meta b { color: var(--ink); font-size: 13px; }
.rd-meta__acts { margin-left: auto; display: flex; gap: 4px; }
.rd-mini { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 2px 6px; border-radius: 6px; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.rd-mini:hover { background: var(--bg-2); color: var(--ink); }
.rd-mini svg { width: 12px; height: 12px; }
.rd-greet { padding: 10px 16px; border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; background: var(--bg); box-shadow: var(--shadow-sm); font-size: 14.5px; line-height: 1.4; }
.rd-none { margin: 0 4px; color: var(--muted-2); font-size: 12.5px; }

.rd-typing { padding: 10px 16px; border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; background: var(--bg); box-shadow: var(--shadow-sm); font-size: 13px; color: var(--muted); }
.rd-typing small { display: block; color: var(--muted-2); font-size: 11.5px; }
.rd-dots { display: inline-flex; gap: 3px; margin-right: 8px; transform: translateY(-2px); }
.rd-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime-600); animation: rd-bounce 1s infinite; }
.rd-dots i:nth-child(2) { animation-delay: .15s; }
.rd-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes rd-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Sekce podle naléhavosti */
.rd-sec { padding: 10px 16px 12px; border: 1px solid; border-radius: 4px 18px 18px 18px; }
.rd-sec__h { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.rd-sec__h span { opacity: .6; font-variant-numeric: tabular-nums; }
.rd-sec--urgent { background: var(--st-bad-bg); border-color: color-mix(in srgb, var(--st-bad) 25%, transparent); }
.rd-sec--urgent .rd-sec__h { color: var(--st-bad-ink); }
.rd-sec--high { background: var(--st-new-bg); border-color: color-mix(in srgb, var(--st-new) 35%, transparent); }
.rd-sec--high .rd-sec__h { color: var(--st-new-ink); }
.rd-sec--tasks { background: var(--st-buy-bg); border-color: color-mix(in srgb, var(--st-buy) 22%, transparent); }
.rd-sec--tasks .rd-sec__h { color: var(--st-buy-ink); }
.rd-sec--other { background: var(--st-ready-bg); border-color: color-mix(in srgb, var(--st-ready) 22%, transparent); }
.rd-sec--other .rd-sec__h { color: var(--st-ready-ink); }
.rd-sec--info { background: var(--bg-1); border-color: var(--line); }
.rd-sec--info .rd-sec__h { color: var(--muted); }

.rd-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
/* Řádky jako běžný text (ikonka na okraji), aby se dlouhý název zalomil vedle ní i na telefonu. */
.rd-item__head { position: relative; padding-left: 12px; font-size: 13.5px; line-height: 1.35; min-width: 0; }
.rd-dot { position: absolute; left: 0; top: .5em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.rd-item__title { font-weight: 700; color: var(--ink); }
.rd-item__note { margin-left: 4px; color: var(--muted); }
.rd-item__sub { margin-left: 4px; color: var(--muted-2); font-size: 11px; }
.rd-item__done { display: flex; align-items: flex-start; gap: 4px; margin: 2px 0 0 12px; font-size: 12px; color: var(--ok); line-height: 1.35; }
.rd-item__done svg { width: 12px; height: 12px; flex: none; margin-top: 2px; }
.rd-buls, .rd-kids { list-style: none; margin: 2px 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rd-kids { margin-left: 20px; }
.rd-bul__row { position: relative; padding-left: 19px; font-size: 12.8px; line-height: 20px; min-width: 0; }
.rd-bul__row > * + * { margin-left: 6px; vertical-align: 1px; }
.rd-st { position: absolute; left: 0; top: 3px; display: inline-flex; }
.rd-st svg { width: 13px; height: 13px; }
.rd-st--todo { color: var(--muted-2); }
.rd-st--late { color: var(--danger); }
.rd-st--waiting { color: var(--warn); }
.rd-st--done { color: var(--ok); }
.rd-st--info { color: var(--info); }
.rd-link { border: 0; background: none; padding: 0; margin: 0; font: inherit; line-height: inherit; text-align: left; color: inherit; cursor: pointer; text-decoration: none; text-underline-offset: 2px; }
.rd-bul__row > .rd-st + * { margin-left: 0; vertical-align: baseline; }
.rd-link:hover { color: var(--c-link); text-decoration: underline; }
/* Uzavřený doklad v rádci. Vlastní třída rd-closed, ne obecná is-closed: ta přeškrtávala i sbalenou Historii a poznámky
   v oknech dokladů (zpravy.js, .msg-history.is-closed) — připomínka vlastníka 5. 11. 2026. */
.rd-closed { color: var(--muted-2) !important; text-decoration: line-through; }
.rd-gone { font-size: 11px; color: var(--muted-2); }
.rd-kind { padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--muted-2); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.rd-donetag { color: var(--ok); font-size: 11px; font-weight: 700; }
.rd-due { display: inline-flex; align-items: center; gap: 3px; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 80%, transparent); color: var(--muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rd-due svg { width: 10px; height: 10px; }
.rd-due--late { background: var(--st-bad-bg); color: var(--st-bad-ink); }
.rd-due--soon { background: var(--st-new-bg); color: var(--st-new-ink); }
.rd-person { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.rd-ava { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-2); color: var(--ink-3); font-size: 8px; font-weight: 800; }

.rd-empty { padding: 28px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-md); text-align: center; color: var(--muted); }
.rd-empty svg { width: 24px; height: 24px; color: var(--lime-600); }
.rd-empty p { margin: 6px 0 12px; font-weight: 700; font-size: 13.5px; }

.rd-old h2 { margin: 0 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--muted-2); }
.rd-day { margin-bottom: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); box-shadow: var(--shadow-sm); }
.rd-day summary { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12.5px; cursor: pointer; list-style: none; }
.rd-day summary::-webkit-details-marker { display: none; }
.rd-day summary b::first-letter { text-transform: uppercase; }
.rd-day__g { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.rd-day > .rd-msg { padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.rd-pill { padding: 0 6px; border-radius: 999px; font-size: 10.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rd-pill--urgent { background: var(--st-bad-bg); color: var(--st-bad-ink); }
.rd-pill--high { background: var(--st-new-bg); color: var(--st-new-ink); }
.rd-pill--tasks { background: var(--st-buy-bg); color: var(--st-buy-ink); }

/* Pruh na Přehledu Dashboardu */
.rd-teaser { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); box-shadow: var(--shadow-sm); font-size: 13px; }
.rd-teaser__g { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.rd-teaser .btn { flex: none; }

/* Konektory → Agenti → Denní rádce */
.rds { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); }
.rds__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.rds__warn { margin: 0; padding: 6px 12px; border-bottom: 1px solid var(--line); color: var(--c-brand-strong); font-size: 12px; }
.rds__body { padding: 12px; display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.rds__row { display: flex; flex-direction: column; gap: 4px; }
.rds__row--grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.rds__row--grid label { display: flex; flex-direction: column; gap: 4px; }
.rds__lbl { font-size: 12px; font-weight: 700; color: var(--muted); }
.rds__lbl .muted { font-weight: 400; }
.rds__opt, .rds__chk { display: flex; align-items: center; gap: 6px; }
.rds__tbl { max-width: 560px; }
.rds__tbl td, .rds__tbl th { padding-top: 4px; padding-bottom: 4px; }
.rds__link { align-self: flex-start; border: 0; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 700; color: var(--c-link); cursor: pointer; }
.rds__skill { max-height: 300px; overflow: auto; margin: 0; padding: 10px; border-radius: var(--r-xs); background: var(--bg-1); white-space: pre-wrap; font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }
.rds__save { display: flex; align-items: center; gap: 10px; }
.rds__msg.is-ok { color: var(--ok); font-size: 12px; }
.rds__msg.is-err { color: var(--danger); font-size: 12px; }
.rds__foot { margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

@media (max-width: 640px) {
  .rd-head__acts { margin-left: 0; width: 100%; }
  .rd-meta__acts { margin-left: 0; }
  .rd-msg { gap: 8px; }
  .rd-av { width: 28px; height: 28px; }
}
