/* Administrace – navazuje na proměnné ze style.css */
body.admin { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; background: var(--cream); font-size: .95rem; }
.adm-side { background: var(--black); color: #bdb5a3; padding: 1.6rem 1.2rem; display: flex; flex-direction: column; gap: 2rem; position: sticky; top: 0; height: 100vh; }
.adm-logo { color: #f3efe6; line-height: 0; }
.adm-logo .logo__svg { height: 76px; }
.adm-nav { display: grid; gap: .2rem; }
.adm-nav a { color: #d9d2c2; text-decoration: none; padding: .7rem .9rem; border-radius: var(--radius); font-weight: 600; }
.adm-nav a:hover { background: var(--ink-2); color: var(--white); }
.adm-nav a.is-active { background: var(--ink-2); color: var(--gold-light); box-shadow: inset 3px 0 0 var(--gold); }
.adm-user { margin-top: auto; display: grid; gap: .5rem; font-size: .85rem; }
.adm-user a, .adm-user button { color: var(--gold-light); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-align: left; text-decoration: none; }
.adm-main { padding: clamp(1.2rem, 3vw, 2.6rem); max-width: 1200px; width: 100%; }
.adm-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.6rem; }
.adm-head h1 { font-size: clamp(2rem, 3vw, 2.6rem); margin: 0; }
.adm-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem; margin-bottom: 1.4rem; }
.adm-card h2 { font-size: 1.5rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--white); }
th, td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; background: #fcfaf5; }
tr:hover td { background: #fdfbf6; }
/* Celý řádek je klikací: odkaz v řádku se roztáhne přes něj. */
tr.row-link { position: relative; cursor: pointer; }
tr.row-link:hover td { background: #f8f1e2; }
.row-link__a::after { content: ""; position: absolute; inset: 0; }
.row-link__a { white-space: nowrap; font-weight: 600; }
.badge { display: inline-block; padding: .25em .6em; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.badge--ok { background: #e4f1e6; color: var(--ok); }
.badge--draft { background: #f3eee2; color: #674c18; }
.badge--old { background: #eee; color: #777; }
.badge--nova { background: #f1e2c4; color: #674c18; }
.badge--resi_se { background: #e2ecf7; color: #234b78; }
.badge--vyrizena { background: #e4f1e6; color: var(--ok); }
.badge--zamitnuta { background: #eee; color: #666; }
.inline-form { display: inline; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold-text); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn--danger { color: var(--error); }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1.2rem; }
.filters select { width: auto; }
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1.4rem; }
.stat { background: var(--black); color: #bdb5a3; padding: 1.3rem 1.4rem; border-radius: var(--radius); }
.stat__diff { display: block; margin-top: .3rem; font-size: .8rem; color: #8f8778; }
.stat strong { display: block; font: 600 2.2rem/1 var(--serif); color: var(--gold-light); margin-bottom: .3rem; }
.edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.edit-grid textarea { min-height: 520px; font: .85rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; overflow-x: auto; }
.preview { max-height: 760px; overflow: auto; }
.preview .day { grid-template-columns: 110px minmax(0, 1fr); padding: 1rem; gap: 1rem; }
.preview .day__name { font-size: 1.25rem; }
.dl { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: .1rem 1.2rem; margin: 0; }
.dl dt { color: var(--muted); font-size: .88rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.dl dd { margin: 0; padding: .5rem 0; border-bottom: 1px solid var(--line); white-space: pre-wrap; }
.dropzone { border: 2px dashed #d6cdb8; border-radius: var(--radius); padding: 2rem; text-align: center; background: #fcfaf5; }
.dropzone input { margin-top: 1rem; }
.login { display: grid; place-items: center; min-height: 100vh; grid-column: 1 / -1; padding: 1rem;
  position: relative; isolation: isolate; background: var(--cream); }
.login::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 110px; z-index: -1; background: var(--strip);
  -webkit-mask-image: linear-gradient(#000 45%, transparent 80%); mask-image: linear-gradient(#000 45%, transparent 80%); }
.login::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: clamp(70px, 12vw, 160px); z-index: -1; background: var(--food-row); opacity: .8; }
.login .adm-card { width: min(100%, 420px); }
@media (max-width: 900px) {
  body.admin { grid-template-columns: 1fr; }
  .adm-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1rem; }
  .adm-nav { grid-auto-flow: column; overflow-x: auto; }
  .adm-user { margin: 0 0 0 auto; grid-auto-flow: column; }
  .edit-grid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { border: 0; padding-bottom: 0; }
}

/* --- návštěvnost ----------------------------------------------------------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); overflow: hidden; }
.seg a { padding: .5rem .9rem; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .85rem; }
.seg a + a { border-left: 1px solid var(--line); }
.seg a.is-active { background: var(--ink); color: var(--white); }
.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .6rem; height: 260px; }
.chart__axis { display: flex; flex-direction: column; justify-content: space-between; font-size: .75rem; color: var(--muted); text-align: right; padding-bottom: 1.4rem; margin-top: -.45em; }
.chart__plot { display: flex; align-items: stretch; gap: 2px; padding-bottom: 1.4rem; position: relative;
  background: linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--line), var(--line)) 0 calc(50% - .7rem) / 100% 1px no-repeat;
  border-bottom: 1px solid #cfc6b1; }
.chart__col { position: relative; flex: 1 1 0; display: flex; align-items: flex-end; min-width: 0; outline: none; }
.chart__col.is-weekend { background: #faf6ee; }
.chart__bar { width: 100%; max-width: 28px; margin-inline: auto; background: var(--gold-text); border-radius: 4px 4px 0 0; min-height: 0; }
.chart__col:hover .chart__bar, .chart__col:focus .chart__bar { background: var(--ink); }
.chart__x { position: absolute; left: 50%; bottom: -1.4rem; transform: translateX(-50%); font-size: .7rem; color: var(--muted); white-space: nowrap; }
.chart__tip { display: none; position: absolute; top: 0; left: 50%; transform: translate(-50%, calc(-100% - 6px)); z-index: 2; background: var(--black); color: #e8e1d0;
  padding: .5rem .7rem; border-radius: var(--radius); font-size: .78rem; line-height: 1.4; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow); }
.chart__tip b { display: block; color: var(--white); }
.chart__col:hover .chart__tip, .chart__col:focus .chart__tip { display: block; }
/* U krajních sloupců se popisek nesmí vysunout z grafu. */
.chart__col:nth-child(-n+2) .chart__tip { left: 0; transform: translate(0, calc(-100% - 6px)); }
.chart__col:nth-last-child(-n+2) .chart__tip { left: auto; right: 0; transform: translate(0, calc(-100% - 6px)); }
details summary { cursor: pointer; font-weight: 600; color: var(--gold-text); }
details .table-wrap { margin-top: .8rem; max-height: 360px; overflow: auto; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 0 1.4rem; align-items: start; }
.meter { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1rem; margin-bottom: .9rem; }
.meter__val { font-weight: 700; }
.meter__track { grid-column: 1 / -1; height: 8px; background: #f1ebdd; border-radius: 4px; overflow: hidden; }
.meter__fill { height: 100%; background: var(--gold-text); border-radius: 4px; }

/* Lišta konceptu v úpravě jídelníčku s tlačítkem Zveřejnit */
.draft-bar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem 1.4rem; margin-bottom: 1.4rem;
  background: #faf4ea; border: 1px solid #e6ca94; border-left: 4px solid var(--gold-text); border-radius: var(--radius); }
.draft-bar form { margin: 0; }
