/* Admin Padarasová — striedmy štýl v duchu webu (tmavá + sivá, bez pestrých farieb).
   Paleta je prevzatá z sites/padarasova/css/style.css, nie vymyslená. */

:root {
  --dark: #0a0a0a;
  --dark-soft: #1a1a1a;
  --text: #334155;
  --heading: #1e293b;
  --light-bg: #f7f7f8;
  --border: #e2e2e5;
  --muted: #6b7280;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --err: #b91c1c;
  --err-bg: #fef2f2;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--light-bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  /* úzke displeje: nikdy horizontálny scroll (clip, nie hidden — hidden blokuje sticky) */
  overflow-x: clip;
}

/* ── topbar ─────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--dark);
  color: #fff;
}
.topbar__brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .3px; }
.topbar__brand span { opacity: .55; font-weight: 400; }
.topbar__nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar__nav a {
  color: rgba(255,255,255,.8);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: .92rem;
}
.topbar__nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.topbar__logout { margin: 0; }

/* ── layout ─────────────────────────────────────────────────────────── */

.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 16px 80px; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head h1 { margin: 0 0 6px; font-size: 1.6rem; color: var(--heading); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.strong { font-weight: 600; color: var(--heading); text-decoration: none; }
.strong:hover { text-decoration: underline; }
.req { color: var(--err); }

/* ── tlačidlá ───────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--dark);
  border-radius: var(--radius-sm);
  background: var(--dark);
  color: #fff;
  font: inherit;
  font-size: .92rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--dark-soft); }
.btn--primary { background: var(--dark); }
.btn--ghost { background: #fff; color: var(--heading); border-color: var(--border); }
.btn--ghost:hover { background: #f1f1f3; }
.btn--danger { background: #fff; color: var(--err); border-color: #f3c8c8; }
.btn--danger:hover { background: var(--err-bg); }
.btn--sm { padding: 6px 11px; font-size: .85rem; }
.btn--block { width: 100%; }

/* ── oznamy ─────────────────────────────────────────────────────────── */

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; }
.alert--ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #bbf7d0; }
.alert--error { background: var(--err-bg); color: var(--err); border: 1px solid #fecaca; }
.alert ul { margin: 0; padding-left: 20px; }

.empty {
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

/* ── panel nástrojov ────────────────────────────────────────────────── */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar__right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar form { margin: 0; }
.search { display: flex; gap: 8px; flex-wrap: wrap; }
.search input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  min-width: 200px;
  max-width: 100%;
}

/* ── tabuľka ────────────────────────────────────────────────────────── */

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table th, .table td { padding: 11px 12px; text-align: left; vertical-align: middle; }
.table thead th {
  background: #fafafb;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.table tbody tr + tr td { border-top: 1px solid #f0f0f2; }
.row--hidden { opacity: .55; }
.col-photo { width: 64px; }
.col-actions { width: 1%; }
.col-actions form { display: inline; margin: 0; }
.col-actions > * { margin-right: 4px; }

.thumb {
  width: 48px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  background: #e7e7ea;
  display: block;
}
.thumb--lg { width: 120px; height: 150px; }

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .78rem;
  background: #eeeef1;
  color: var(--muted);
}
.tag--ok { background: var(--ok-bg); color: var(--ok); }

.pager { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 20px; }

/* ── formuláre ──────────────────────────────────────────────────────── */

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; color: var(--heading); font-size: .93rem; }
.field input[type="text"],
.field input[type="email"],
.field input[type="date"],
.field input[type="number"],
.field input[type="password"],
.field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  width: 100%;
  max-width: 100%;
}
.field textarea { resize: vertical; }
.field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.field-row .field { flex: 1 1 200px; }
.field-row .field--narrow { flex: 0 1 140px; }

.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; }

.photo-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.photo-row input[type="file"] { display: block; margin-bottom: 8px; max-width: 100%; }

.form__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── prihlásenie ────────────────────────────────────────────────────── */

.body--login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login { width: 100%; max-width: 380px; }
.login__title { margin: 0 0 4px; font-size: 1.4rem; color: var(--heading); text-align: center; }
.login__sub { margin: 0 0 22px; text-align: center; color: var(--muted); font-size: .93rem; }
.login .card { display: flex; flex-direction: column; gap: 16px; }

/* ── mobil / úzke displeje ──────────────────────────────────────────── */

@media (max-width: 720px) {
  .wrap { padding: 20px 14px 60px; }
  .page-head h1 { font-size: 1.35rem; }

  /* tabuľka sa na mobile rozpadne na karty — inak by pretekala von z obrazovky */
  .table, .table thead, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { display: none; }
  .table { border: 0; background: transparent; }
  .table tr {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 12px;
  }
  .table tbody tr + tr td { border-top: 0; }
  .table td { padding: 5px 0; }
  .table td::before {
    content: attr(data-label);
    display: block;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
  }
  .col-actions > * { margin: 4px 4px 0 0; }
}

@media (max-width: 380px) {
  .topbar { padding: 12px 14px; }
  .topbar__nav a { padding: 5px 7px; font-size: .85rem; }
  .btn { padding: 8px 12px; }
  .search input { min-width: 0; flex: 1 1 100%; }
}

/* ── kartičky ───────────────────────────────────────────────────────── */

.alert--warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.thumb--empty { display: inline-block; background: #ececef; }

.editor { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 22px; align-items: start; }
.editor__form fieldset { border: 0; border-top: 1px solid var(--border); margin: 0; padding: 14px 0 0;
                         display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.editor__form fieldset:first-child { border-top: 0; padding-top: 0; }
.editor__form legend { font-weight: 700; color: var(--heading); font-size: 1.05rem; padding: 0; margin-bottom: 4px; }
.editor__form select { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
                       font: inherit; background: #fff; max-width: 100%; }
.editor__nahlad { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.nahlad-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.nahlad { position: relative; width: 100%; overflow: hidden; border-radius: 6px;
          box-shadow: 0 4px 18px rgba(0,0,0,.16); background: #d9d9d9; }
.nahlad iframe { position: absolute; left: 0; top: 0; width: 1110px; height: 638px; border: 0;
                 transform-origin: 0 0; pointer-events: none; }
.nahlad__tah { position: absolute; inset: 0; cursor: grab; touch-action: none; }
.nahlad__tah.is-tah { cursor: grabbing; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; align-self: flex-start; }
.seg label { display: flex; align-items: center; gap: 6px; padding: 7px 12px; cursor: pointer; background: #fff; font-size: .92rem; }
.seg label + label { border-left: 1px solid var(--border); }
.seg label:has(input:checked) { background: var(--dark); color: #fff; }
.seg input { margin: 0; }

.range { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.range input { flex: 1; min-width: 0; }
.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-btn { cursor: pointer; }
[data-reset] { align-self: flex-start; }

.vystup { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.vystup h2 { font-size: 1.05rem; margin: 6px 0 0; color: var(--heading); }
.vystup p { margin: 0; }
.vystup form { margin: 0; }
.vystup__dalsie { border-top: 1px solid var(--border); padding-top: 12px; }
#zdielat-url a { word-break: break-all; }

.sablona-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.sablona-slot { display: flex; flex-direction: column; gap: 10px; }
.sablona-slot h2 { margin: 0; font-size: 1.05rem; color: var(--heading); }
.sablona-nahlad { background: repeating-conic-gradient(#e8e8ea 0 25%, #fff 0 50%) 0 0 / 16px 16px;
                  border-radius: 6px; aspect-ratio: 1110 / 638; overflow: hidden; }
.sablona-nahlad img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sablona-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.sablona-form input[type="file"] { max-width: 100%; }
.sablona-slot form { margin: 0; }

.versy { display: flex; flex-direction: column; gap: 12px; }
.vers-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.vers-item pre { margin: 0; font: inherit; white-space: pre-wrap; min-width: 0; }
.vers-item form { margin: 0; }

@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; }
  /* na mobile náhľad hore, aby bolo vidieť, čo sa mení */
  .editor__nahlad { position: static; order: -1; }
}

/* ── prihlásenie: odkazy, účet ──────────────────────────────────────── */
.login__link { color: var(--text); font-size: .9rem; text-align: center; }
.login__back { text-align: center; }
.ucet__h { font-size: 1.15rem; color: var(--heading); margin: 0 0 12px; }
