/* KrálFoto Galerie – administrace. Barvy a písmo převzaté z kralfoto.cz. */

@font-face {
  font-family: "Montserrat Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/montserrat-latin-ext-wght-normal.woff2) format("woff2-variations");
  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: "Montserrat Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/montserrat-latin-wght-normal.woff2) format("woff2-variations");
  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 {
  --bg: #ffffff;
  --ink: #4d504a;
  --ink-dark: #2f312d;
  --logo: #7e7e60;
  --accent: #d49a6a;
  --accent-hover: #c98b58;
  --surface: #e5e7e2;
  --cream: #e3decf;
  --page: #f6f6f3;
  --line: #dcded8;
  --muted: #6c6f68;
  --max: 1200px;
  --gutter: 16px;
  --radius: 14px;

  /* Typy zakázek */
  --t-svatby: #d49a6a;
  --t-rodiny: #6f8fa3;
  --t-eventy: #7e7e60;
  --t-jine: #b3a98c;

  /* Stav */
  --s-ok: #6f8fa3;
  --s-todo: #c9962e;
  --s-urgent: #b9483a;
  --s-done: #5f8a55;

  --font: "Montserrat Variable", system-ui, sans-serif;
}
@media (min-width: 900px) {
  :root { --gutter: 32px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
}
h1, h2, h3 { font-weight: 500; color: var(--ink-dark); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; margin-top: 1.2em; }
a { color: var(--ink-dark); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
code { background: var(--surface); padding: .1em .35em; border-radius: 6px; font-size: .9em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.main { padding-top: 24px; padding-bottom: 64px; }
.center { text-align: center; padding-top: 18vh; }

/* Horní lišta: ikony v barevných dlaždicích (rozvržení podle toho, co Daniel zná z Náhledovek) */
.topbar { background: var(--bg); border-bottom: 1px solid var(--line); position: relative; z-index: 10; }
.topbar__inner { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 600; text-decoration: none; color: var(--logo); letter-spacing: .02em; padding: 6px 0; white-space: nowrap; }
.brand span { font-weight: 400; color: var(--ink); }
.topbar__tools { display: flex; gap: 6px; }
.tool { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--ink-dark); background: var(--page); text-decoration: none; }
.tool:hover, .tool.is-active { background: var(--surface); color: var(--ink-dark); }
.badge { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--s-urgent); color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; }
.ico { display: block; flex: none; }

.nav { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.nav__item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; border-radius: 12px; text-decoration: none; color: var(--ink); font-size: .74rem; font-weight: 500; white-space: nowrap; }
.nav__item:hover { background: var(--page); color: var(--ink-dark); }
.nav__item.is-active { background: var(--page); color: var(--ink-dark); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.nav__tile { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--tile, var(--surface)); color: var(--ink-dark); }
.nav--prehled { --tile: #f3e3d4; }
.nav--poptavky { --tile: #f5dcd4; }
.nav--zakazky { --tile: #e3e7d6; }
.nav--galerie { --tile: #dbe6ee; }
.nav--klienti { --tile: #e9e1ee; }
.nav--kalendar { --tile: #f2e9c9; }
.nav--statistiky { --tile: #d9eadf; }
@media (min-width: 600px) { .nav { grid-template-columns: repeat(7, 1fr); } }
@media (min-width: 900px) {
  .topbar { position: sticky; top: 0; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav__item { flex-direction: row; gap: 8px; padding: 5px 12px 5px 5px; font-size: .9rem; }
  .nav__tile { width: 32px; height: 32px; border-radius: 9px; }
}
@media (min-width: 1240px) {
  .topbar__inner { grid-template-columns: auto 1fr auto; }
  .nav { grid-column: 2; grid-row: 1; justify-content: center; }
  .topbar__tools { grid-column: 3; grid-row: 1; }
}

/* Nadpis stránky */
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.pagehead h1 { margin: 0; }
.pagehead__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.back { display: inline-block; font-size: .9rem; color: var(--muted); text-decoration: none; margin-bottom: 6px; }
.lead { font-size: 1.05rem; margin: -8px 0 20px; }
.section-title { margin-top: 32px; }

/* Tlačítka */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 22px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--ink-dark);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background-color .15s ease;
}
.btn:hover { background: var(--accent-hover); color: var(--ink-dark); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--ink-dark); outline-offset: 2px;
}
.btn--ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { background: var(--surface); }
.btn--danger { background: transparent; color: var(--s-urgent); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn--danger:hover { background: #f6e6e3; color: var(--s-urgent); }
.btn--small { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.inline-form { display: inline; margin: 0; }

/* Panely */
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.panel--quiet { background: transparent; }
.panel--accent { border-color: var(--accent); }
@media (min-width: 900px) { .panel { padding: 24px 28px; } }
.cols { display: grid; gap: 0 20px; }
@media (min-width: 980px) { .cols { grid-template-columns: 1fr 1fr; align-items: start; } }
details.panel > summary { cursor: pointer; font-weight: 500; color: var(--ink-dark); font-size: 1.1rem; }
details.panel[open] > summary { margin-bottom: 16px; }

/* Formuláře */
.form { display: grid; gap: 14px; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 4px; }
.field label { font-weight: 500; font-size: .92rem; color: var(--ink-dark); }
.req { color: var(--accent-hover); }
input, select, textarea {
  font: inherit; color: var(--ink-dark);
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg);
}
textarea { resize: vertical; min-height: 90px; }
input[type="checkbox"], input[type="radio"] { flex: none; width: 20px; min-height: 20px; height: 20px; accent-color: var(--accent-hover); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--s-urgent); }
.hint { color: var(--muted); font-size: .85rem; }
.error { color: var(--s-urgent); font-size: .85rem; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.copy { font-size: .85rem; background: var(--page); margin: 4px 0 12px; }

.search { display: flex; gap: 8px; margin-bottom: 18px; }
.search input { flex: 1; }

/* Hlášky */
.flash { background: #e9f1e6; color: #2f4a29; border-radius: 10px; padding: 10px 14px; margin: 0 0 18px; font-weight: 500; }
.notice { background: var(--cream); border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; }
.notice p { margin: 0 0 8px; }
.notice p:last-child { margin: 0; }
.notice--warn { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.notice--warn p { margin: 0; }
.empty { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.prewrap { white-space: pre-wrap; }
.footer-links { margin-top: 24px; font-size: .92rem; }

/* Štítky */
.tag { display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .02em; padding: 2px 10px; border-radius: 999px; color: #fff; background: var(--tc, var(--ink)); vertical-align: 1px; }
.t-svatby { --tc: var(--t-svatby); }
.t-rodiny { --tc: var(--t-rodiny); }
.t-eventy { --tc: var(--t-eventy); }
.t-jine { --tc: var(--t-jine); }
.tag.t-svatby, .tag.t-jine { color: var(--ink-dark); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 500; color: var(--sc); white-space: nowrap; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--sc); flex: none; }
.s-ok { --sc: var(--s-ok); }
.s-todo { --sc: #9a7020; }
.s-urgent { --sc: var(--s-urgent); }
.s-done { --sc: var(--s-done); }

/* Seznamy */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { display: grid; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; }
.card--link:hover { border-color: var(--accent); color: inherit; }
.card strong { color: var(--ink-dark); font-weight: 600; }

.list { list-style: none; margin: 0; padding: 0; }
.list.panel { padding: 4px 0; }
.list > li + li { border-top: 1px solid var(--line); }
.row-link { display: grid; gap: 4px 16px; padding: 12px 18px; text-decoration: none; color: inherit; }
.panel .list .row-link { padding-left: 0; padding-right: 0; }
.list.panel .row-link { padding: 12px 18px; }
.row-link:hover { background: var(--page); color: inherit; }
.row-link__date { font-weight: 600; color: var(--ink-dark); font-size: .92rem; }
.row-link__main strong { color: var(--ink-dark); font-weight: 600; }
.row-link__status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.progress { font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 1px 8px; }
@media (min-width: 760px) {
  .row-link { grid-template-columns: 150px 1fr auto; align-items: center; }
  .panel .list .row-link { grid-template-columns: 1fr auto; }
}

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { text-decoration: none; padding: 6px 16px; border-radius: 999px; font-weight: 500; font-size: .92rem; box-shadow: inset 0 0 0 1.5px var(--line); }
.tabs a.is-active { background: var(--ink-dark); color: #fff; box-shadow: none; }

/* Přehled */
.stats { display: grid; gap: 12px; margin-bottom: 20px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stat { display: grid; gap: 2px; align-content: start; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: inherit; }
.panel .stat { background: var(--page); border: 0; }
a.stat:hover { border-color: var(--accent); color: inherit; }
.stat__value { font-size: 1.7rem; font-weight: 500; color: var(--ink-dark); line-height: 1.2; }
.stat__label { font-size: .88rem; color: var(--muted); }
.meter { width: 100%; height: 8px; margin-top: 8px; appearance: none; border: 0; border-radius: 99px; background: var(--surface); overflow: hidden; }
.meter::-webkit-progress-bar { background: var(--surface); border-radius: 99px; }
.meter::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
.meter::-moz-progress-bar { background: var(--accent); border-radius: 99px; }

.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notes li { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 12px 0 0; }
.kv dt { color: var(--ink); }
.kv dd { margin: 0; text-align: right; font-weight: 600; color: var(--ink-dark); }

.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.table th { font-weight: 500; color: var(--muted); font-size: .85rem; }
.table .num { text-align: right; }

/* Checklist */
.checklist { gap: 0; }
.check-row { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.check-row__mark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; color: #fff; font-size: .9rem; margin-top: 2px; }
.check-row.is-done .check-row__mark { background: var(--s-done); border-color: var(--s-done); }
.check-row__body { display: grid; gap: 6px; }
.check-row__body label { font-weight: 500; color: var(--ink-dark); }
.check-row__inputs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.check-row__inputs input[type="date"] { width: auto; flex: 1 1 150px; max-width: 200px; }
.input-czk { width: 120px; flex: 0 0 120px; }
.checklist .actions { margin-top: 14px; }

/* Harmonogram */
.schedule { list-style: none; margin: 0; padding: 0; }
.schedule li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.schedule__time { font-weight: 600; color: var(--ink-dark); font-variant-numeric: tabular-nums; }

/* Kalendář */
.cal__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal__head h2 { margin: 0; min-width: 10ch; text-align: center; text-transform: capitalize; }
.cal__grid { display: none; }
.cal__mobile { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cal__item { display: flex; gap: 8px; align-items: center; text-decoration: none; border-left: 4px solid var(--tc); background: var(--page); border-radius: 6px; padding: 8px 10px; color: var(--ink-dark); font-size: .95rem; }
.cal__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sc); flex: none; }
@media (min-width: 760px) {
  .cal__mobile { display: none; }
  .cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
  .cal__wd { font-size: .8rem; font-weight: 600; color: var(--muted); padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--page); }
  .cal__day { min-height: 104px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .cal__day.is-other { background: var(--page); }
  .cal__day.is-other .cal__num { color: #a5a8a0; }
  .cal__num { font-size: .85rem; font-weight: 500; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
  .cal__day.is-today .cal__num { background: var(--accent); color: var(--ink-dark); font-weight: 700; }
  .cal__day .cal__item { padding: 4px 6px; font-size: .8rem; border-left-width: 3px; }
  .cal__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
}
@media (min-width: 1500px) { .cal__day { min-height: 128px; } }

.legend { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 14px; font-size: .85rem; color: var(--muted); }
.legend__group { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--tc); }

/* ---------- Galerie (administrace) ---------- */
[hidden] { display: none !important; }
.label { font-weight: 500; font-size: .92rem; color: var(--ink-dark); }
.grid3 { display: grid; gap: 14px; }
@media (min-width: 760px) { .grid3 { grid-template-columns: 2fr 1fr 1fr; align-items: start; } .grid3--even { grid-template-columns: 1fr 1fr 1fr; } }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.inline-fields { margin-top: 12px; }
.link-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 12px 0; }
.link-row > div { flex: 1 1 280px; min-width: 0; }
.link-row .copy { margin: 6px 0 0; }
.section-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; }
.section-row__form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1 1 320px; }
.section-row__form input { flex: 1 1 160px; width: auto; }
.btn:disabled { opacity: .4; cursor: default; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--ink-dark); outline-offset: 2px; }
.up-status { margin-top: 14px; padding: 14px; background: var(--page); border-radius: 10px; }
.up-text { margin: 8px 0 0; font-weight: 500; }
.up-errors { margin: 8px 0 0; padding-left: 1.2em; color: var(--s-urgent); font-size: .9rem; }
.copied { margin-left: 8px; }

.bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 14px; }
.bulk select { width: auto; flex: 0 1 220px; }
.pgrid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.pgrid--small { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); margin-bottom: 12px; }
@media (min-width: 1400px) { .pgrid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }
.pgrid__item { position: relative; display: grid; gap: 4px; background: var(--page); border-radius: 10px; padding: 6px; cursor: grab; }
.pgrid__item.is-dragging { opacity: .4; }
.pgrid__item--static { cursor: default; }
.pgrid__item--static img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.pgrid__item--static span { overflow-wrap: anywhere; }
.pgrid__item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--surface); pointer-events: none; }
.pgrid__check { position: absolute; top: 10px; left: 10px; background: rgba(255,255,255,.9); border-radius: 6px; padding: 4px; line-height: 0; }
.pgrid__meta { font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pgrid__meta .tag { font-size: .65rem; padding: 0 6px; }
.pgrid__tools { display: flex; gap: 4px; }
.pgrid__tools .btn--small { min-height: 30px; padding: 2px 10px; flex: 1; }
.hidden-photos { margin-top: 18px; }
.hidden-photos summary { cursor: pointer; font-weight: 500; margin-bottom: 10px; }



/* ---------- Fáze 4: CRM ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.s-muted { --sc: var(--muted); }
.overdue { color: var(--s-urgent); font-weight: 600; }

/* Filtry jako čipy (kategorie, typ kontaktu) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.chips a { text-decoration: none; font-size: .85rem; padding: 4px 12px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.chips a:hover { color: var(--ink-dark); box-shadow: inset 0 0 0 1px var(--accent); }
.chips a.is-active { background: var(--cream); box-shadow: inset 0 0 0 1px var(--cream); color: var(--ink-dark); font-weight: 600; }
.kind-chip, .warn-chip { display: inline-block; font-size: .74rem; font-weight: 600; padding: 1px 9px; border-radius: 999px; background: var(--page); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); vertical-align: 1px; }
.warn-chip { margin-left: 6px; background: #f8e3df; box-shadow: none; color: var(--s-urgent); }
.card__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }

/* Úvod Přehledu */
.hello { display: grid; gap: 4px; margin-bottom: 20px; }
.eyebrow { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--logo); }
.hello h1 { margin: 0; }
.hello .lead { margin: 0; }
.hello__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
@media (min-width: 760px) {
  .hello { grid-template-columns: 1fr auto; align-items: end; }
  .hello .eyebrow, .hello h1, .hello .lead { grid-column: 1; }
  .hello__actions { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
}

/* Dlaždice s velkým číslem */
.tiles { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-bottom: 20px; }
@media (min-width: 980px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { display: grid; gap: 2px; align-content: start; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 16px; text-decoration: none; color: inherit; min-width: 0; }
a.tile:hover { border-color: var(--accent); color: inherit; }
.tile__icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--tile, var(--surface)); color: var(--ink-dark); margin-bottom: 8px; }
.tile__label { font-weight: 600; color: var(--ink-dark); font-size: .95rem; }
.tile__value { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 600; color: var(--ink-dark); line-height: 1.15; overflow-wrap: anywhere; }
.tile__sub { font-size: .82rem; color: var(--muted); }
.tile--prehled { --tile: #f3e3d4; }
.tile--poptavky { --tile: #f5dcd4; }
.tile--zakazky { --tile: #e3e7d6; }
.tile--galerie { --tile: #dbe6ee; }
.tile--platby { --tile: #f2e9c9; }
.tile--statistiky { --tile: #d9eadf; }
div.tile { border-top: 4px solid var(--tile); }

/* Poslední aktivita */
.panel--feed { background: #f7f5fa; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed__item { display: grid; gap: 2px; padding: 10px 0 10px 18px; border-bottom: 1px solid var(--line); position: relative; }
.feed__item:last-child { border-bottom: 0; }
.feed__item::before { content: ""; position: absolute; left: 0; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--logo); }
.feed__item.k-view::before { background: var(--s-ok); }
.feed__item.k-selection::before { background: var(--s-done); }
.feed__item a { text-decoration: none; color: var(--ink-dark); font-weight: 500; }
.feed__item a:hover { color: var(--accent-hover); }

/* Údaje poptávky */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.notice ul { margin: 6px 0 0; padding-left: 20px; flex-basis: 100%; }

/* Historie (časová osa) */
.timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.timeline__item { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.timeline__kind { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--logo); }
.timeline__when { font-size: .8rem; color: var(--muted); text-align: right; }
.timeline__text { grid-column: 1 / -1; margin: 0; }
.timeline__item.k-system .timeline__text, .timeline__item.k-view .timeline__text { color: var(--muted); font-size: .92rem; }
.add-activity__row { display: grid; gap: 8px; }
@media (min-width: 600px) { .add-activity__row { grid-template-columns: 150px 1fr; } }
.add-activity .actions { margin-top: 8px; }

/* Statistiky */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table-wrap .table { min-width: 640px; }
.table tbody th { color: var(--ink-dark); font-weight: 500; font-size: .95rem; }
.table__sub th { padding-left: 22px; color: var(--muted); font-weight: 400; }
.table__sub td { color: var(--muted); font-size: .9rem; }
.delta { font-size: .82rem; font-weight: 600; white-space: nowrap; }
.delta--up { color: var(--s-done); }
.delta--down { color: var(--s-urgent); }
.chart { display: block; width: 100%; height: auto; max-height: 280px; }
.chart__axis { stroke: var(--line); stroke-width: 1; }
.chart__now { fill: var(--accent); }
.chart__prev { fill: var(--surface); }
.chart__label { font-size: 12px; fill: var(--muted); font-family: var(--font); }
.legend__now::before, .legend__prev::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--accent); }
.legend__prev::before { background: var(--surface); }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.year-pick { display: flex; gap: 6px; align-items: center; }
.year-pick select { width: auto; }
.facts a[href^="tel"] { white-space: nowrap; }

/* ---------- Fáze 5: alba ---------- */
.album-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.album-toolbar .tabs { margin-bottom: 0; }
.search--compact { margin: 0; }
.search--compact input { min-width: 220px; }
.albums { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.album { display: grid; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 14px 14px 12px; text-decoration: none; color: inherit; height: 100%; }
.album:hover { border-color: var(--accent); color: inherit; box-shadow: 0 6px 20px rgba(47,49,45,.06); }
.album__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.album__title { color: var(--ink-dark); font-weight: 600; overflow-wrap: anywhere; }
.album__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: .85rem; color: var(--ink); }
.album__meta > span { display: inline-flex; align-items: center; gap: 4px; }
.album__meta .ico { width: 16px; height: 16px; color: var(--logo); }
.album__meta .status { margin-left: auto; }
.album__mosaic { display: grid; gap: 3px; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--page); }
.album__mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album__mosaic img:first-child { grid-row: 1 / span 2; }
.album__mosaic.n1 { grid-template-columns: 1fr; }
.album__mosaic.n2 { grid-template-columns: 2fr 1fr; }
.album__mosaic.n2 img:nth-child(2), .album__mosaic.n3 img:nth-child(n+2) { grid-row: span 1; }
.album__mosaic.n2 img:nth-child(2) { grid-row: 1 / span 2; }
.album__mosaic.n3 { grid-template-columns: 2fr 1fr; }
.album__mosaic.n4 img:nth-child(4) { grid-column: 2 / span 2; }
.album__empty { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-items: center; color: var(--muted); font-size: .9rem; }
.album__foot { overflow-wrap: anywhere; }
.mode-chip { display: inline-block; flex: none; font-size: .74rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.mode-preview { background: #e9e1ee; color: #5b4a68; }
.mode-delivery { background: #d9eadf; color: #3f6b4c; }
.album-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: -10px 0 18px; font-size: .92rem; }
.statusbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; background: #eaf3e7; border: 1px solid #cfe3c8; border-radius: 14px; padding: 10px 14px; margin-bottom: 18px; }
.statusbar__tag { background: var(--s-done); color: #fff; font-weight: 600; font-size: .8rem; border-radius: 999px; padding: 3px 12px; }
.statusbar p { margin: 0; flex: 1 1 260px; }
.note-bubble { font-style: italic; color: var(--ink); overflow-wrap: anywhere; }
.wm-layout { display: grid; gap: 20px; }
@media (min-width: 980px) { .wm-layout { grid-template-columns: 1fr 1fr; align-items: start; } }
.wm-preview { margin: 0; }
.wm-preview canvas { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--page); }
.wm-form input[type="range"] { width: 100%; accent-color: var(--accent); }
@media print {
  .topbar, .pagehead__actions, .back, .flash { display: none !important; }
  body, .panel { background: #fff !important; border: 0 !important; box-shadow: none !important; }
  .main { padding: 0 !important; }
}
input[type="range"] { min-height: 0; padding: 0; border: 0; background: none; }

/* Hromadné akce v seznamu zakázek */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 10px; }
.bulk-bar select { width: auto; min-height: 38px; padding: 6px 10px; font-size: .9rem; }
.bulk-bar__all { font-size: .9rem; margin-right: 4px; }
.bulk-bar__sort { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.bulk-form:not(.has-selection) .bulk-bar select[name="akce"], .bulk-form:not(.has-selection) .bulk-bar button { opacity: .55; }
.list--select > li { display: grid; grid-template-columns: auto 1fr; align-items: center; }
.list--select .row-check { display: grid; place-items: center; align-self: stretch; padding: 0 4px 0 16px; cursor: pointer; }
.list--select .row-link { padding-left: 10px; }
.list--select > li:has(input:checked) { background: #fbf4ec; }
@media (max-width: 599px) {
  .bulk-bar__sort { margin-left: 0; width: 100%; }
  .bulk-bar__sort select { flex: 1; }
  .list--select .row-check { padding-left: 12px; }
}
