/* Allwyn design systém (stejné tokeny jako sběr požadavků): primární paleta a její tinty, písmo Poppins (OFL),
   tlačítka a filtry jako pilulka, karty se zaoblením 16 px. Barvu mimo paletu má jen chyba (červená). */
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url(fonts/poppins-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url(fonts/poppins-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url(fonts/poppins-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url(fonts/poppins-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url(fonts/poppins-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url(fonts/poppins-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url(fonts/poppins-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url(fonts/poppins-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --aw-dark-teal: #1D4757; --aw-turquoise: #27E2CC; --aw-yellow: #FCE428;
  --aw-teal-800: #153F4F; --aw-teal-600: #496E7A; --aw-teal-400: #829BA3; --aw-teal-200: #C3CFD1; --aw-teal-100: #E8ECEE;
  --aw-turq-700: #27C0B2; --aw-turq-400: #5DE9D9; --aw-turq-300: #93F0E5; --aw-turq-200: #C9F8F2; --aw-turq-100: #E9FCFA;
  --aw-yel-700: #FFCF2C; --aw-yel-400: #FDEB5E; --aw-yel-300: #FDF193; --aw-yel-200: #FEF8C9; --aw-yel-100: #FFFCE9;
  --bg: #F4F6F7; --card: #FFFFFF; --ink: var(--aw-dark-teal); --muted: var(--aw-teal-600);
  --line: #DCE3E6; --line-strong: var(--aw-teal-200);
  --bad: #B3261E; --bad-soft: #FBEAE8; --bad-line: #F0BDB8; --bad-ink: #8C1D18;
  --radius: 16px; --radius-sm: 8px; --shadow: 0 2px 10px rgba(29, 71, 87, .08);
  --font: 'Poppins', Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1 { font-size: 26px; line-height: 1.15; font-weight: 700; margin: 0; }
h2 { font-size: 16px; line-height: 1.25; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; line-height: 1.3; font-weight: 600; margin: 0 0 6px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
:focus-visible { outline: 2px solid var(--aw-turquoise); outline-offset: 2px; }

/* Lišta */
.topbar { background: var(--aw-dark-teal); color: #fff; display: flex; align-items: center; gap: 14px; padding: 0 18px; height: 62px; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; flex: none; }
.brand img { height: 22px; width: auto; display: block; }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .25); }
.brand-name b { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; }
.brand-name small { font-size: 12px; font-weight: 500; color: var(--aw-teal-200); }
.nav { display: flex; gap: 0; height: 100%; overflow-x: auto; }
.nav a { display: flex; align-items: center; padding: 0 8px; text-decoration: none; color: var(--aw-teal-200); border-bottom: 3px solid transparent; font-weight: 600; font-size: 13px; white-space: nowrap; }
/* Deset obrazovek se na užší obrazovce nevejde vedle loga a role: nejdřív ustoupí podtitul loga, pak písmo */
@media (max-width: 1500px) { .brand-name { display: none; } }
@media (max-width: 1340px) { .nav a { padding: 0 6px; font-size: 12.5px; } }
.nav a:hover { color: #fff; }
.nav a.active { color: #fff; border-bottom-color: var(--aw-turquoise); }
.spacer { flex: 1; }
.role { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--aw-teal-200); white-space: nowrap; }
.role select { background: var(--aw-teal-800); color: #fff; border: 1px solid var(--aw-teal-600); border-radius: 999px; padding: 6px 12px; font: inherit; font-weight: 500; }
.mode-pill { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; white-space: nowrap; background: var(--aw-yellow); color: var(--ink); }

/* Stránka */
.page { max-width: 1360px; margin: 0 auto; padding: 26px 24px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.loading { padding: 80px 0; text-align: center; color: var(--muted); font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; }
.grid-wide { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; margin-bottom: 18px; }
.stack > * + * { margin-top: 18px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.card + .card { margin-top: 18px; }
.grid2 > .card + .card, .grid3 > .card + .card, .grid-wide > .card + .card, .grid-wide > div > .card + .card { margin-top: 0; }
.grid-wide > div > .card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.mb { margin-bottom: 18px; }

/* Ukazatele */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border-top: 4px solid var(--aw-teal-200); }
.kpi .lbl { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .val { font-size: 22px; font-weight: 700; line-height: 1.2; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi.navy { border-top-color: var(--aw-dark-teal); }
.kpi.turq { border-top-color: var(--aw-turquoise); }
.kpi.yel { border-top-color: var(--aw-yel-700); }
.kpi.bad { border-top-color: var(--bad); }
.kpi.bad .val { color: var(--bad-ink); }

/* Tabulky */
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num, table.t th.num { text-align: right; }
table.t tr.hl td { background: var(--aw-turq-100); }
table.t tr.dim td { color: var(--aw-teal-400); }
table.t tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.scroll { max-height: 420px; overflow: auto; }
.scroll table.t th { position: sticky; top: 0; background: #fff; z-index: 1; }

/* Pilulky a štítky */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.6; background: var(--aw-teal-100); color: var(--ink); }
.pill.turq { background: var(--aw-turq-200); }
.pill.yel { background: var(--aw-yel-200); }
.pill.bad { background: var(--bad-soft); color: var(--bad-ink); }
.pill.navy { background: var(--aw-dark-teal); color: #fff; }
.pill.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.origin { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.origin.o-workshop { background: var(--aw-turq-200); }
.origin.o-dříve { background: var(--aw-teal-100); }
.origin.o-návrh { background: var(--aw-yel-200); }
.origin.o-předpoklad { background: var(--aw-yel-300); }
.origin.o-ilustrační { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--muted); }

/* Tlačítka a pole */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: var(--aw-dark-teal); color: #fff; padding: 9px 18px; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 1.2; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--aw-teal-800); }
.btn.teal { background: var(--aw-turquoise); color: var(--aw-dark-teal); }
.btn.teal:hover { background: var(--aw-turq-400); }
.btn.ghost { background: transparent; color: var(--aw-dark-teal); box-shadow: inset 0 0 0 2px var(--aw-dark-teal); }
.btn.ghost:hover { background: var(--aw-dark-teal); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 11px; }
.btn.danger { background: transparent; color: var(--bad-ink); box-shadow: inset 0 0 0 2px var(--bad-line); }
.btn.danger:hover { background: var(--bad-soft); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.chip { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; }
.link { color: var(--aw-turq-700); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
select.in, input.in, textarea.in { font: inherit; font-size: 13px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 7px 10px; }
input.in.num { width: 130px; text-align: right; }
.unit { display: inline-block; min-width: 78px; text-align: left; }
table.t td.info { max-width: 300px; }
label.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }

/* Záložky */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 7px 16px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 13px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.tabs a.active { background: var(--aw-dark-teal); color: #fff; box-shadow: none; }

/* Inbox orchestrátora */
.ibx { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; border-left: 5px solid var(--aw-turquoise); }
.ibx + .ibx { margin-top: 12px; }
.ibx.done { border-left-color: var(--aw-teal-200); opacity: .75; }
.ibx-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ibx-top .pnl { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.ibx-top .pnl.neg { color: var(--bad-ink); }
.ibx p { color: var(--ink); font-size: 13.5px; }
.ibx .prop { background: var(--aw-turq-100); border-radius: 10px; padding: 8px 12px; }
.pos { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.pos span { font-size: 12px; background: var(--aw-teal-100); border-radius: 999px; padding: 2px 10px; }
.pos b { font-weight: 600; }
.ibx-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ibx-act .why { flex: 1 1 240px; }
.agent { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 2px 10px 2px 4px; border-radius: 999px; background: var(--aw-teal-100); }
.agent i { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-style: normal; font-size: 10px; color: #fff; background: var(--aw-dark-teal); }
.agent.a-brand i { background: #7B5EA7; } .agent.a-produkt i { background: #C2410C; } .agent.a-sales i { background: var(--aw-turq-700); }
.agent.a-logistika i { background: var(--aw-dark-teal); } .agent.a-orchestrátor i { background: #111; } .agent.a-analytik i { background: #2563EB; } .agent.a-skaut i { background: var(--aw-yel-700); color: var(--ink); }
.agents { display: grid; gap: 10px; }
.agent-card { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; }
.agent-card p { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.log { font-size: 12.5px; }
.log li { margin-bottom: 6px; }

/* Upozornění */
.note { border-radius: 12px; padding: 12px 14px; font-size: 13.5px; }
.note.warn { background: var(--aw-yel-100); box-shadow: inset 0 0 0 1px var(--aw-yel-400); }
.note.bad { background: var(--bad-soft); box-shadow: inset 0 0 0 1px var(--bad-line); }
.note.ok { background: var(--aw-turq-100); box-shadow: inset 0 0 0 1px var(--aw-turq-300); }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.checks li:last-child { border-bottom: 0; }
.checks .ic { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.checks .ic.ok { background: var(--aw-turq-200); }
.checks .ic.no { background: var(--aw-yel-300); }

/* Grafy */
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .ax { font-size: 11px; fill: var(--muted); font-family: var(--font); }
svg.chart .lg text { font-size: 11px; fill: var(--ink); font-family: var(--font); }
svg.chart .mk { font-size: 11px; font-weight: 600; font-family: var(--font); }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .zero { stroke: var(--aw-teal-400); stroke-width: 1.2; }
.meter { display: inline-block; width: 90px; height: 7px; border-radius: 99px; background: var(--aw-teal-100); vertical-align: middle; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 99px; }

/* Varianty */
.variants th.rec, .variants td.rec { background: var(--aw-turq-100); }
.variants th.rec { color: var(--ink); }
.variants td { white-space: nowrap; }

/* Gantt portfolia */
.gantt text { font-family: var(--font); }

/* Živá AI (jen sdílená verze se serverem) */
.mode-pill.ai { background: var(--aw-turquoise); }
.mode-pill[hidden] { display: none; }
.pill.ai { background: #E3EBFD; color: #1D4ED8; }
textarea.in { display: block; width: 100%; resize: vertical; line-height: 1.45; }
.ask-row { display: flex; gap: 8px; align-items: center; }
.ask-row .in { flex: 1 1 auto; min-width: 0; }
details.ask { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
details.ask summary { cursor: pointer; color: var(--aw-turq-700); font-weight: 600; font-size: 13px; }
details.ask[open] summary { margin-bottom: 8px; }
.ai-answer { margin-top: 10px; border-radius: 12px; padding: 10px 14px; background: #F4F7FE; box-shadow: inset 0 0 0 1px #D9E3FA; font-size: 13.5px; }
.ai-q { font-weight: 700; margin-bottom: 4px; }
.ai-body p { margin: 4px 0; }
.ai-body ul { margin: 4px 0; padding-left: 18px; }
.ai-body li { margin-bottom: 4px; }
.ai-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.ai-wait { color: var(--muted); }
.err { color: var(--bad-ink); }
.spin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Hlášky */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--aw-dark-teal); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 13px; box-shadow: 0 6px 24px rgba(0, 0, 0, .2); z-index: 50; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .grid2, .grid3, .grid-wide { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .topbar { gap: 12px; padding: 0 12px; }
  .brand-name { display: none; }
  .page { padding: 18px 14px 50px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .fields { grid-template-columns: 1fr; }
}
