/* Barvy a rozměry podle schváleného návrhu (claude.ai/artifact/NvTXpYwcbFCC9RxMPr8UEL) */
:root {
  --bg: #f3f4f6; --card: #ffffff; --line: #e5e7eb; --line2: #f3f4f6; --ink: #111827; --ink2: #374151;
  --mute: #6b7280; --blue: #1d4ed8; --red: #b91c1c; --orange: #c2410c; --green: #15803d;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
       color: var(--ink); font-size: 14px; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: #1e40af; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* hlavička */
.top { display: flex; align-items: center; gap: 20px; padding: 0 24px; min-height: 56px; background: var(--card);
       border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; }
.brand span { color: var(--mute); font-weight: 500; }
.brand a { color: var(--mute); font-weight: 500; margin-left: 6px; font-size: 13px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 6px; color: var(--ink2); font-weight: 500; white-space: nowrap; }
.tabs a span { color: var(--mute); }
.tabs a.on { background: var(--ink); color: #fff; font-weight: 600; }
.tabs a.on span { color: #fff; opacity: .7; }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--bg);
          border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-width: 260px; }
.search input { border: 0; background: transparent; outline: none; width: 100%; color: var(--ink); }
.avatar { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center;
          justify-content: center; font-weight: 600; font-size: 12px; flex: none; }
.who { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center;
       justify-content: center; font-size: 11px; font-weight: 700; }
.userbox { display: flex; align-items: center; gap: 8px; }
.userbox form { margin: 0; }
.linkbtn { border: 0; background: none; color: var(--mute); cursor: pointer; padding: 4px; }

/* rozložení fronty */
.layout { display: flex; flex-wrap: wrap; min-height: calc(100vh - 56px); }
.side { flex: 0 1 236px; min-width: 200px; padding: 20px 16px; border-right: 1px solid var(--line);
        background: var(--card); display: flex; flex-direction: column; gap: 22px; }
.side h4 { font-size: 11px; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .06em;
           padding: 0 8px 6px; margin: 0; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; justify-content: space-between; align-items: center; padding: 7px 8px;
              border-radius: 6px; color: var(--ink2); }
.side nav a span.n { color: var(--mute); }
.side nav a.on { background: #eff6ff; color: #1e3a8a; font-weight: 600; }
.side nav a.on span.n { color: #1e3a8a; }
.side .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.main { flex: 999 1 560px; min-width: 0; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat .l { font-size: 11px; color: var(--mute); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat .v small { font-size: 13px; color: var(--mute); font-weight: 500; }

.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bar h1 { margin: 0; font-size: 18px; font-weight: 700; }
.bar .meta { color: var(--mute); }
.bar .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid #d1d5db;
       border-radius: 6px; background: var(--card); font-weight: 500; color: var(--ink2); font-size: 13px;
       cursor: pointer; white-space: nowrap; }
.btn:hover { color: var(--ink); border-color: #9ca3af; }
.btn.dark { border: 0; background: var(--ink); color: #fff; font-weight: 600; }
.btn.on { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.list { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.row { display: grid; grid-template-columns: 12px 190px minmax(0, 1fr) 150px 110px 80px 36px; gap: 14px;
       align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line2); color: var(--ink); }
.row:hover { background: #f9fafb; color: var(--ink); }
.row .dot { width: 10px; height: 10px; border-radius: 50%; }
.two { display: flex; flex-direction: column; min-width: 0; }
.two b, .two .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.two b { font-weight: 600; }
.two .s { font-size: 12px; color: var(--mute); }
.two .subj { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 4px 8px;
        border-radius: 999px; justify-self: start; white-space: nowrap; }
.ai { font-size: 12px; font-weight: 600; color: var(--mute); }
.ai.ready { color: var(--green); } .ai.scen { color: #9a3412; }
.agecol { font-size: 12px; font-weight: 600; }
.lockinfo { font-size: 11px; color: var(--orange); }
.empty { padding: 32px; text-align: center; color: var(--mute); }
.foot { font-size: 12px; color: var(--mute); }
.pager { display: flex; gap: 8px; }

/* detail */
.dhead { display: flex; align-items: center; gap: 16px; padding: 10px 24px; min-height: 56px; background: var(--card);
         border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dhead .title { display: flex; flex-direction: column; min-width: 0; }
.dhead .title b { font-size: 16px; }
.dhead .title span { font-size: 12px; color: var(--mute); }
.dhead .tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dhead select { font-size: 13px; padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; }
.saved { color: var(--green); font-size: 12px; }
.dwrap { display: flex; flex-wrap: wrap; gap: 20px; padding: 20px 24px; align-items: flex-start; }
.dmain { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.daside { flex: 1 1 320px; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
        display: flex; flex-direction: column; gap: 10px; }
.card h3 { margin: 0; font-size: 14px; font-weight: 700; display: flex; justify-content: space-between; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; font-size: 13px; }
.kv .k { color: var(--mute); }
.items { border-top: 1px solid var(--line2); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.item b { font-weight: 600; } .item .st { font-weight: 600; white-space: nowrap; }
.small { font-size: 13px; line-height: 1.5; }
.muted { color: var(--mute); }

.banner { display: flex; align-items: center; gap: 10px; border-radius: 10px; padding: 12px 14px; flex-wrap: wrap; }
.banner.scen { background: #fff7ed; border: 1px solid #fdba74; color: #7c2d12; }
.banner.scen b { color: #9a3412; }
.banner.err { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.banner.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }

.thread { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px;
          display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line2); }
.msg:first-child { border-top: 0; padding-top: 0; }
.msg .h { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mute); flex-wrap: wrap; }
.msg .h b { color: var(--ink); font-weight: 600; }
.msg .body { margin: 0; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.out { background: #f9fafb; margin: 0 -18px; padding: 14px 18px; }
.msg.note { background: #fefce8; margin: 0 -18px; padding: 14px 18px; }
.msg.auto .body { color: var(--mute); }
.tagx { background: #fee2e2; color: #991b1b; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.att { font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.att a, .att span { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; color: var(--ink2); }

.editor { background: var(--card); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; }
.editor .eh { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line2); flex-wrap: wrap; }
.editor .eh .meta { font-size: 12px; color: var(--mute); }
.editor .eh .r { margin-left: auto; display: flex; gap: 8px; }
.editor textarea { font-size: 14px; line-height: 1.55; border: 0; outline: none; resize: vertical; padding: 14px 16px;
                   color: var(--ink); background: transparent; min-height: 260px; width: 100%; }
.editor .ef { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line2); flex-wrap: wrap; }
.editor .ef .meta { margin-left: auto; font-size: 12px; color: var(--mute); }
.big { padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.big.dark { border: 0; background: var(--ink); color: #fff; }
.big.light { border: 1px solid #d1d5db; background: #fff; color: var(--ink); }
.big.ghost { border: 0; background: transparent; color: var(--mute); font-weight: 500; }
.tagrow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tag { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 8px;
       border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--ink2); }
.tag form { display: inline; margin: 0; }
.tag button { border: 0; background: none; color: var(--mute); cursor: pointer; padding: 0 0 0 2px; }
details.pop { position: relative; }
details.pop summary { list-style: none; }
details.pop summary::-webkit-details-marker { display: none; }
details.pop .panel { position: absolute; right: 0; top: 40px; z-index: 5; background: #fff; border: 1px solid var(--line);
                     border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.08); padding: 12px; width: 300px;
                     display: flex; flex-direction: column; gap: 8px; }
.panel input, .panel textarea { border: 1px solid #d1d5db; border-radius: 6px; padding: 7px 9px; width: 100%; }
.actions-card button { text-align: left; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px;
                       background: #fff; font-size: 13px; color: var(--ink); }
.actions-card button[disabled] { color: var(--mute); cursor: not-allowed; }

/* přihlášení */
.login { max-width: 360px; margin: 12vh auto; background: #fff; border: 1px solid var(--line); border-radius: 12px;
         padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login input { border: 1px solid #d1d5db; border-radius: 8px; padding: 10px 12px; width: 100%; }
.login label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; color: var(--ink2); }

/* mobil: rychlé odbavení */
.quick { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); font-size: 15px; }
.qhead { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; background: #fff; border-bottom: 1px solid var(--line);
         position: sticky; top: 0; z-index: 2; }
.qhead .t { display: flex; flex-direction: column; }
.qhead .t b { font-weight: 700; } .qhead .t span { font-size: 12px; color: var(--mute); }
.qbody { flex: 1 1 auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.qcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.qcard p { margin: 0; line-height: 1.5; font-size: 14px; color: var(--ink2); white-space: pre-wrap; max-height: 260px; overflow: auto; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip { white-space: nowrap; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line);
        background: #f9fafb; color: var(--ink2); }
.qdraft { background: #fff; border: 2px solid var(--ink); border-radius: 12px; display: flex; flex-direction: column; }
.qdraft .h { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line2); font-size: 12px; color: var(--mute); }
.qdraft .h b { color: var(--ink); }
.qdraft textarea { width: 100%; font-size: 14px; line-height: 1.5; border: 0; outline: none; resize: vertical; padding: 10px 14px;
                   color: var(--ink); background: transparent; min-height: 220px; }
.qdraft textarea[readonly] { color: var(--ink); }
.qfoot { padding: 10px 16px 18px; background: #fff; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px;
         position: sticky; bottom: 0; }
.qfoot .send { height: 52px; border: 0; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; font-size: 16px; width: 100%; cursor: pointer; }
.qfoot .three { display: flex; gap: 8px; }
.qfoot .three > * { flex: 1 1 0; height: 44px; border: 1px solid #d1d5db; border-radius: 10px; background: #fff; font-weight: 600;
                    font-size: 14px; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.qfoot .three form { display: flex; } .qfoot .three form button { all: unset; flex: 1; text-align: center; color: var(--red); cursor: pointer; }

@media (max-width: 1100px) {
  .row { grid-template-columns: 12px 160px minmax(0, 1fr) 130px 70px 32px; }
  .row .ai { display: none; }
}
@media (max-width: 760px) {
  .top { padding: 8px 16px; gap: 10px; }
  .search { order: 5; min-width: 0; width: 100%; margin-left: 0; }
  .userbox { margin-left: auto; }
  .side { flex: 1 1 100%; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 10px; }
  .side nav { flex-direction: row; overflow-x: auto; gap: 6px; }
  .side nav a { white-space: nowrap; border: 1px solid var(--line); gap: 6px; }
  .side h4 { display: none; }
  .main { padding: 14px 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: 10px minmax(0, 1fr) auto; grid-template-areas: "dot cust age" "dot subj subj" "dot pill who";
         gap: 4px 10px; }
  .row .dot { grid-area: dot; align-self: start; margin-top: 5px; }
  .row .cust { grid-area: cust; } .row .subjc { grid-area: subj; } .row .pill { grid-area: pill; }
  .row .agecol { grid-area: age; } .row .who { grid-area: who; justify-self: end; } .row .ai { display: none; }
  .dhead { padding: 10px 16px; } .dwrap { padding: 14px 16px; } .daside { max-width: none; }
  .editor .ef .meta { margin-left: 0; }
}
