/* Editor příruček DV-1 — jednoduchý čistý styl */
* { box-sizing: border-box; }
body {
  font-family: "Liberation Sans", "DejaVu Sans", system-ui, sans-serif;
  margin: 0; color: #1a1a1a; background: #f4f5f7; line-height: 1.5;
}
header {
  background: #fff; border-bottom: 2px solid #0a3d62;
  padding: 14px 28px; display: flex; align-items: baseline; gap: 16px;
}
.logo { font-size: 22px; letter-spacing: 1px; color: #0a3d62; text-decoration: none; }
.logo b { font-weight: 700; }
.subtitle { color: #666; font-size: 14px; }
.topnav { margin-left: auto; display: flex; gap: 18px; }
.topnav a { color: #0a3d62; text-decoration: none; font-size: 14px; font-weight: 600; }
.topnav a:hover { text-decoration: underline; }
main { max-width: 960px; margin: 24px auto; padding: 0 20px; }
footer { max-width: 960px; margin: 24px auto; padding: 0 20px; color: #888; }

h1 { font-size: 24px; margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.muted { color: #888; }

/* Tlačítka */
.btn {
  display: inline-block; padding: 8px 14px; border: 1px solid #ccc;
  background: #fff; color: #1a1a1a; border-radius: 6px; cursor: pointer;
  text-decoration: none; font-size: 14px;
}
.btn:hover { background: #eef; }
.btn-primary { background: #0a3d62; color: #fff; border-color: #0a3d62; }
.btn-primary:hover { background: #0c4d7a; }
.btn-del { padding: 2px 9px; color: #b00; border-color: #e0b0b0; }
.btn-danger { color: #fff; background: #b02020; border-color: #b02020; }
.btn-danger:hover { background: #c83030; }
.btn-danger:disabled { background: #ddd; color: #888; border-color: #ccc; cursor: not-allowed; }

/* Lišta s info o použití + akce (duplikovat/smazat) */
.entity-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  padding: 10px 14px; background: #fff; border: 1px solid #e0e3e8; border-radius: 8px; }
.entity-bar .spacer { flex: 1; }
.entity-bar .used { color: #a05000; font-weight: 600; }

/* Sekce / fieldset */
.section {
  background: #fff; border: 1px solid #e0e3e8; border-radius: 8px;
  padding: 16px 20px; margin-bottom: 18px;
}
.section legend { font-weight: 700; color: #0a3d62; padding: 0 8px; }

/* Dynamické číslování datových sekcí — skryté (display:none) se přeskočí,
   takže nevznikají mezery při neinstalovaném vybavení. */
#data-form { counter-reset: secnum; }
#data-form > .section > legend::before {
  counter-increment: secnum;
  content: counter(secnum) ". ";
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; }
.field label { font-size: 13px; color: #444; margin-bottom: 3px; }
.field .req { color: #b00; }
.field input, .field select {
  padding: 7px 9px; border: 1px solid #ccc; border-radius: 5px; font-size: 14px;
}
.field input:focus, .field select:focus { outline: 2px solid #0a3d62; border-color: #0a3d62; }
.field .unit { font-size: 12px; color: #888; margin-top: 2px; }
.field .hint { font-size: 12px; color: #999; }

/* Volitelné vybavení — checkbox jako celořádkový box */
.field-check { grid-column: 1 / -1; }
.field-check .check-label {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid #e0e3e8; border-radius: 6px;
  padding: 11px 14px; background: #f7f9fb; cursor: pointer;
  font-size: 14px; color: #333;
}
.field-check .check-label:hover { border-color: #0a3d62; }
.field-check input[type="checkbox"] {
  width: 18px; height: 18px; flex: none; accent-color: #0a3d62; cursor: pointer;
}
.field-check .check-hint { color: #999; font-size: 13px; }

/* Panel tabulka */
.panel-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.panel-table th { text-align: left; font-size: 13px; color: #444; padding: 4px; }
.panel-table td { padding: 3px 4px; }
.panel-table input { width: 100%; padding: 6px 8px; border: 1px solid #ccc; border-radius: 5px; }
.panel-table input.num { width: 60px; }

/* Náhled palubní desky pod sekcí 6 */
.panel-preview { margin-top: 14px; }
.panel-preview img {
  max-width: 100%; height: auto; display: block;
  border: 1px solid #ccc; border-radius: 6px; background: #fff;
}

/* Seznam letadel */
table.list { width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid #e0e3e8; border-radius: 8px; overflow: hidden; }
table.list th { text-align: left; padding: 10px 14px; background: #f0f2f5; font-size: 13px; }
table.list td { padding: 10px 14px; border-top: 1px solid #eee; }
table.list .reg { font-weight: 700; font-size: 16px; }
.pdf-link { display: inline-block; font-size: 12px; color: #0a3d62; }
.pdf-link:hover { text-decoration: none; }

/* Flash zprávy */
.flashes { margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; }
.flash-ok { background: #e3f6e3; border: 1px solid #9ed99e; color: #1a661a; }
.flash-warn { background: #fff4d6; border: 1px solid #e6c35c; color: #7a5a00; }
.flash-error { background: #fbe3e3; border: 1px solid #e0a0a0; color: #a01010; }
.ok-text { color: #1a661a; }

.actions { margin: 8px 0 24px; }
.inline-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-group { display: flex; gap: 10px; flex-wrap: nowrap; }
.inline-form .hint { flex-basis: 100%; }
.checkbox { font-size: 14px; }
.hidden { display: none; }

pre.log {
  background: #1e1e1e; color: #e0e0e0; padding: 12px; border-radius: 6px;
  overflow-x: auto; font-size: 12px; line-height: 1.4;
}
code { background: #eef; padding: 1px 5px; border-radius: 3px; font-size: 13px; }

/* Overlay „Generuji…" během buildu */
.overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(244, 245, 247, 0.92);
  align-items: center; justify-content: center;
}
.overlay.show { display: flex; }
.overlay-box { text-align: center; max-width: 420px; padding: 0 20px; }
.overlay-title { font-size: 20px; font-weight: 700; color: #0a3d62; margin: 0 0 6px; }
.spinner {
  width: 52px; height: 52px; margin: 0 auto 18px;
  border: 5px solid #ccd5e0; border-top-color: #0a3d62; border-radius: 50%;
  animation: av-spin 0.9s linear infinite;
}
@keyframes av-spin { to { transform: rotate(360deg); } }

/* Pokyny k tisku na výsledkové stránce */
.print-help ul { margin: 6px 0 10px; padding-left: 22px; }
.print-help li { margin-bottom: 5px; }
.print-help p { margin: 8px 0; }

/* Náhled dat před generováním (confirm.html) */
table.kv { width: 100%; border-collapse: collapse; }
table.kv td { padding: 5px 8px; border-top: 1px solid #eef0f3; vertical-align: top; }
table.kv tr:first-child td { border-top: none; }
.kv-label { color: #555; width: 55%; }
.kv-value { font-weight: 600; color: #1a1a1a; }
.kv-unit { font-weight: 400; color: #888; font-size: 12px; }
.kv-group { margin: 12px 0 2px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px; color: #0a3d62; }
.kv-group:first-child { margin-top: 0; }
.badge-missing {
  display: inline-block; background: #fbe3e3; border: 1px solid #e0a0a0;
  color: #a01010; font-size: 11px; font-weight: 700; padding: 1px 7px;
  border-radius: 10px; text-transform: uppercase; letter-spacing: 0.3px;
}
.warn-btn { background: none; border: 0; padding: 0 0 0 6px; cursor: pointer; vertical-align: middle; }
.warn-btn:hover svg path { fill: #ffd84a; }
.miss-dialog { border: 1px solid #c9b25a; border-radius: 8px; padding: 18px 22px; max-width: 560px; }
.miss-dialog::backdrop { background: rgba(0,0,0,0.35); }
.miss-dialog h2 { margin: 0 0 6px; font-size: 18px; }
.miss-dialog h3 { margin: 12px 0 2px; font-size: 14px; }
.missing-list { margin: 6px 0 0; padding-left: 22px; }
.missing-list li { margin-bottom: 2px; }

/* přihlášení, správa uživatelů */
.login-form { display: flex; flex-direction: column; gap: 12px; max-width: 360px; }
.login-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
.login-form .hint { font-weight: normal; font-size: 12px; color: #555; margin-top: 2px; }
.logout-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
