/* ============================================================================
   barox office – projektspezifisches CSS
   Baut auf barox-design-system.css auf. Ausschliesslich ueber die Tokens
   (CSS-Variablen) arbeiten, keine Hex-Werte hart codieren.
   ========================================================================== */

/* Das Design-System liefert die Farben der Buttons, aber die Box-Masse nur
   ueber die zusaetzliche Klasse .btn. Damit ein blosses .btn-primary im
   Markup richtig aussieht, wird das Kastenmass hier nachgereicht. */
.btn-primary, .btn-secondary {
  display: inline-block; font-family: var(--font-text);
  font-size: 0.95rem; font-weight: 700;
  border: 2px solid transparent; border-radius: var(--radius);
  padding: 10px 22px; cursor: pointer; text-decoration: none; text-align: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-secondary { border-color: var(--navy); }

.page-main { padding: 28px 20px 60px; }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--amber); color: var(--navy); padding: 10px 16px; font-weight: 700;
}
.skip-link:focus { left: 8px; top: 8px; z-index: 100; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.brand-suffix {
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  color: var(--navy); border-left: 2px solid var(--amber); padding-left: 14px;
}

.hidden { display: none !important; }
.muted { color: var(--grey); font-size: 0.9rem; }
.grow { flex: 1; }

.alert-warn { background: #fff7e0; border-left: 4px solid var(--warning); color: #6b5100; }

/* --------------------------- Kopf der Uebersicht -------------------------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 26px;
}
.page-head h1 { margin-bottom: 6px; }
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.empty-state {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  border-top: 3px solid var(--amber);
  padding: 44px 40px; max-width: 62ch; margin: 20px auto; text-align: center;
}
.empty-state p { color: var(--grey); margin-bottom: 22px; }

/* -------------------------------- Plankarten ------------------------------ */
.plan-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}
.plan-card {
  display: flex; flex-direction: column;
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); border-top: 3px solid var(--amber);
  overflow: hidden; transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.plan-thumb {
  display: flex; align-items: center; justify-content: center;
  height: 168px; background: var(--navy-10); overflow: hidden;
}
.plan-thumb img { width: 100%; height: 100%; object-fit: contain; }
.plan-thumb-empty { color: var(--navy-60); font-size: 0.88rem; }
.plan-card-body { padding: 18px 20px 6px; flex: 1; }
.plan-card-body h2 { font-size: 1.08rem; margin-bottom: 6px; }
.plan-card-body h2 a { text-decoration: none; }
.plan-notes {
  color: var(--grey); font-size: 0.88rem; margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.plan-meta { display: flex; gap: 20px; margin: 0 0 10px; }
.plan-meta div { margin: 0; }
.plan-meta dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--navy-60); }
.plan-meta dd { margin: 0; font-weight: 700; color: var(--navy); font-size: 0.98rem; }
.plan-date { font-size: 0.82rem; color: var(--grey); margin: 0 0 12px; }
.plan-card-actions {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 12px 20px; border-top: 1px solid var(--line); background: #fbfcfd;
}

.inline-form { display: inline; margin: 0; }

.btn-small {
  display: inline-block; font: inherit; font-size: 0.85rem; font-weight: 500;
  padding: 6px 12px; border-radius: var(--radius);
  border: 1px solid var(--navy-40); background: var(--white); color: var(--navy);
  cursor: pointer; text-decoration: none;
}
.btn-small:hover { border-color: var(--navy); background: var(--navy-10); color: var(--navy); }
.btn-small.full { width: 100%; }
.btn-small[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-danger { color: var(--error); border-color: #e3bdb9; }
.btn-danger:hover { background: #fdecea; border-color: var(--error); color: var(--error); }
.btn-accent { border-color: var(--amber); background: var(--amber); color: var(--navy); font-weight: 700; }
.btn-accent:hover { background: var(--amber-light); border-color: var(--amber-light); }
.btn-accent[disabled] { background: var(--navy-10); border-color: var(--navy-20); color: var(--navy-60); }
.btn-primary-s { border-color: var(--navy); background: var(--navy); color: var(--white); font-weight: 700; }
.btn-primary-s:hover { background: #013d69; border-color: #013d69; color: var(--white); }

/* --------------------------------- Dialoge -------------------------------- */
.dlg {
  border: none; border-radius: var(--radius-lg); padding: 0;
  box-shadow: 0 24px 60px rgba(0, 45, 78, 0.28);
  width: min(94vw, 520px); color: var(--ink);
}
.dlg-wide { width: min(94vw, 680px); }
.dlg::backdrop { background: rgba(0, 45, 78, 0.45); }
.dlg > form, .dlg > * { margin: 0; }
.dlg > form { padding: 26px 28px; }
.dlg > h2, .dlg > p, .dlg > label, .dlg > input, .dlg > select, .dlg > textarea,
.dlg > div, .dlg > ul, .dlg > fieldset { margin-left: 28px; margin-right: 28px; }
.dlg > h2 { margin-top: 26px; }
.dlg h2 { border-top: 3px solid transparent; }
.dlg label { margin-top: 14px; }
.dlg-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin: 24px 0 0; padding: 16px 28px; background: #f7f9fa; border-top: 1px solid var(--line);
}
.dlg > .dlg-actions { margin-left: 0; margin-right: 0; }
.form-hint { color: var(--grey); font-size: 0.86rem; margin: 8px 0 0; }
.dlg-msg { font-size: 0.9rem; margin: 12px 0 0; min-height: 1.2em; }
.dlg-msg.error { color: var(--error); }
.dlg-msg.success { color: var(--success); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.with-unit { display: flex; align-items: center; gap: 6px; }
.with-unit input { width: 100%; }
.with-unit em { font-style: normal; color: var(--grey); font-size: 0.85rem; }

input[type="number"] {
  width: 100%; font: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--white); border: 1px solid var(--navy-40);
  border-radius: var(--radius); padding: 8px 10px;
}
input[type="color"] {
  width: 56px; height: 34px; padding: 2px; border: 1px solid var(--navy-40);
  border-radius: var(--radius); background: var(--white);
}

.export-list { list-style: none; padding: 0; }
.export-list li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.export-list li:last-child { border-bottom: none; }
.export-list strong { display: block; color: var(--navy); }
.export-list p { color: var(--grey); font-size: 0.88rem; margin: 4px 0 10px; }

@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr; }
}
