/* Ref4EP-Portal — interne SPA, Sprint 1. */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: #222;
  background: #f7f7f9;
}

.portal-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: #1c2c4c;
  color: #fff;
}

.portal-header .brand {
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
}

.portal-header nav a {
  color: #fff;
  text-decoration: none;
  margin-right: 1rem;
  opacity: 0.85;
}

.portal-header nav a.active,
.portal-header nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

.portal-header .user {
  margin-left: auto;
  font-size: 0.875rem;
}

.portal-header .user .linklike {
  background: none;
  border: none;
  color: #fff;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}

main#app {
  padding: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

main#app table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 1rem;
}

main#app th,
main#app td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e3e3e8;
}

main#app th {
  background: #eef0f4;
  font-weight: 600;
}

.muted {
  color: #666;
}

.error {
  color: #b30000;
}

.success {
  color: #006400;
}

.warning {
  background: #fff7d6;
  border: 1px solid #e5c100;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
}

form.stacked {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 360px;
}

form.stacked label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

/* Checkbox-Zeile: Kästchen links, Text rechts, vertikal mittig.
 * Überschreibt das vertikale Standardlayout von ``form.stacked label``. */
.checkbox-row,
form.stacked label.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin: 0.6rem 0;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  margin: 0;
  flex: 0 0 auto;
}

form.stacked input {
  padding: 0.4rem 0.5rem;
  border: 1px solid #ccd;
  border-radius: 3px;
  font-size: 1rem;
}

form.stacked button,
button[type="submit"] {
  padding: 0.5rem 0.75rem;
  background: #1c2c4c;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1rem;
}

form.stacked textarea {
  padding: 0.4rem 0.5rem;
  border: 1px solid #ccd;
  border-radius: 3px;
  font: inherit;
  resize: vertical;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.section-header h2 {
  margin: 0;
}

.section-header button {
  background: #1c2c4c;
  color: #fff;
  border: none;
  padding: 0.4rem 0.75rem;
  border-radius: 3px;
  cursor: pointer;
}

.actions {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.actions button {
  background: #1c2c4c;
  color: #fff;
  border: none;
  padding: 0.4rem 0.75rem;
  border-radius: 3px;
  cursor: pointer;
}

/* Form-Action-Reihe (Speichern + Abbrechen) — gleicher Abstand und
 * sichtbarer Trenner zum Formular darüber. */
.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.form-actions button {
  padding: 0.5rem 0.9rem;
}

.form-actions button.secondary {
  background: #fff;
  color: #1c2c4c;
  border: 1px solid #1c2c4c;
}

/* Eingeklappte Form (Konto → Passwort ändern). */
details.collapsible > summary {
  cursor: pointer;
  padding: 0.4rem 0;
  font-weight: 600;
}

details.collapsible[open] > summary {
  margin-bottom: 0.5rem;
}

/* Kontaktliste auf der Partnerdetailseite. */
.contact-card {
  border: 1px solid #d6dfe9;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: #fff;
}

.contact-card.inactive {
  opacity: 0.6;
}

.contact-card .contact-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.contact-card .contact-head h4 {
  margin: 0;
}

.contact-card .contact-meta {
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.25rem;
}

.contact-card .contact-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dialog {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #ccd;
  border-radius: 4px;
  background: #fff;
}

.dialog h3 {
  margin-top: 0;
}

.field-hint {
  display: block;
  margin-top: 0.2rem;
  color: #555;
  font-size: 0.8rem;
}

.doc-description {
  white-space: pre-wrap;
  border-left: 3px solid #d6e4f5;
  padding: 0.4rem 0.75rem;
  background: #f7faff;
  margin: 0.75rem 0;
}

.actions button.danger {
  background: #8a1c1c;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-draft { background: #ddd; color: #444; }
.badge-review { background: #f5d97a; color: #5a4500; }
.badge-released { background: #b9e3b9; color: #1a4f1a; }
.badge-wp { background: #d6e4f5; color: #1c2c4c; }
.badge-internal { background: #e3d6f5; color: #3a1c5c; }
.badge-public { background: #fcd5c0; color: #6c1f00; }

tr.row-released {
  background: #f3fbef;
}

.audit-filters {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.audit-filters input {
  padding: 0.3rem 0.5rem;
  border: 1px solid #ccd;
  border-radius: 3px;
}

.audit-details {
  background: #f4f4f8;
  border: 1px solid #ddd;
  padding: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  overflow-x: auto;
}

.initial-password {
  display: block;
  padding: 0.6rem 0.9rem;
  margin: 0.5rem 0;
  font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, monospace;
  font-size: 1rem;
  background: #fff7d6;
  border: 1px solid #e5c100;
  border-radius: 3px;
  word-break: break-all;
}
