/* ============================================================
   petrus — zentrales Design-System (Single Source of Truth)
   Farben aus dem FSSP-Wappen: Navy + Gold + Weiß.
   Regel: KEIN Inline-CSS. Jede Gestaltung läuft über Tokens
   und Komponentenklassen aus dieser Datei.
   ============================================================ */

:root {
  /* ── Markenfarben (aus dem Logo) ── */
  --navy:        #1d3a8a;
  --navy-700:    #16306e;
  --navy-900:    #0f2350;
  --gold:        #d4a017;
  --gold-300:    #e8be4e;
  --gold-700:    #b7860f;

  /* ── Neutrale Flächen ── */
  --bg:          #f5f6f9;
  --surface:     #ffffff;
  --surface-alt: #fafbfd;
  --ink:         #1a2238;
  --ink-muted:   #5b6478;
  --line:        #e3e6ee;

  /* ── Status ── */
  --ok:      #2e7d4f;
  --warn:    #b7860f;
  --danger:  #b3261e;

  /* ── Form ── */
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 2px rgba(15,35,80,.06), 0 4px 16px rgba(15,35,80,.06);
  --shadow-hover: 0 2px 6px rgba(15,35,80,.10), 0 10px 28px rgba(15,35,80,.12);

  /* ── Raster / Maße ── */
  --space:   16px;
  --maxw:    980px;
  --header-h: 60px;

  /* ── Typografie ── */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Reset / Basis ── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.petrus {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.petrus a { color: var(--navy); text-decoration: none; }
.petrus a:hover { color: var(--navy-700); }

/* ── Layout-Container ── */
.pt-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space); }
.pt-main { padding: calc(var(--space) * 1.5) var(--space) calc(var(--space) * 4); }

/* ── Kopfzeile mit echtem Logo (weiß, Gold-Akzentlinie) ── */
.pt-header {
  position: sticky; top: 0; z-index: 20;
  min-height: var(--header-h);
  background: var(--surface);
  color: var(--ink);
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(15,35,80,.04);
}
.pt-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: linear-gradient(90deg, var(--navy), var(--gold));
}
.pt-header .pt-wrap { display: flex; align-items: center; gap: 12px; width: 100%; }
.pt-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.pt-brand:hover { color: var(--ink); }
.pt-logo { height: 34px; width: auto; display: block; }
.pt-subtitle {
  color: var(--ink-muted); font-size: .85rem; font-weight: 600;
  padding-left: 12px; margin-left: 2px; border-left: 1px solid var(--line);
}
.pt-header-spacer { flex: 1; }
.pt-header-user { font-size: .85rem; color: var(--ink-muted); }

/* ── Kontext-/Transparenzleiste (zeigt aktiven Bereich/Standort) ── */
.pt-context {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.pt-context .pt-wrap {
  display: flex; align-items: center; gap: 10px;
  padding-top: 10px; padding-bottom: 10px;
  font-size: .85rem; color: var(--ink-muted);
}
.pt-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-alt); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px; color: var(--ink);
  font-size: .8rem;
}
.pt-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }

/* ── Seitentitel ── */
.pt-pagehead { margin: 0 0 calc(var(--space) * 1.25); }
.pt-pagehead h1 { font-size: 1.5rem; margin: 0 0 4px; color: var(--ink); }
.pt-pagehead p { margin: 0; color: var(--ink-muted); }

/* ── Aufgaben-/Modulkarten (klarer Flow) ── */
.pt-grid {
  display: grid; gap: var(--space);
  grid-template-columns: 1fr;
}
.pt-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
a.pt-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: #d3d8e6;
  color: var(--ink);
}
.pt-card-top { display: flex; align-items: center; gap: 12px; }
.pt-card-icon {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(29,58,138,.08);
  color: var(--navy);
}
.pt-card-icon svg { width: 22px; height: 22px; }
.pt-card h3 { margin: 0; font-size: 1.05rem; color: var(--ink); }
.pt-card p { margin: 0; color: var(--ink-muted); font-size: .9rem; }
.pt-card-foot {
  margin-top: auto; padding-top: 6px;
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 600; color: var(--navy);
}
.pt-card-foot::after { content: "→"; }

/* ── Buttons ── */
.pt-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--navy); color: #fff;
}
.pt-btn:hover { background: var(--navy-700); color: #fff; }
.pt-btn--ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.pt-btn--ghost:hover { background: var(--surface-alt); color: var(--navy); }
.pt-btn--gold { background: var(--gold); color: var(--navy-900); }
.pt-btn--gold:hover { background: var(--gold-700); color: #fff; }

/* ── Abschnitt ── */
.pt-section { margin-top: calc(var(--space) * 2); }
.pt-section-title {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-muted); margin: 0 0 12px; font-weight: 700;
}

/* ── Badges ── */
.pt-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 600;
  background: var(--surface-alt); border: 1px solid var(--line); color: var(--ink-muted);
}
.pt-badge--ok    { background: #e8f5ee; border-color: #cbe7d6; color: var(--ok); }
.pt-badge--soon  { background: #fdf3e0; border-color: #f1e2c0; color: var(--gold-700); }

/* ── Fußzeile ── */
.pt-footer {
  border-top: 1px solid var(--line);
  color: var(--ink-muted); font-size: .8rem;
  padding: var(--space); text-align: center;
}

/* ── Werkzeugleiste (Suche + Aktion) ── */
.pt-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: var(--space); }
.pt-search { position: relative; flex: 1; }
.pt-search input {
  width: 100%; font: inherit; padding: 11px 14px 11px 38px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
.pt-search input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(29,58,138,.12); }
.pt-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-muted); }

/* ── Liste ── */
.pt-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.pt-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.pt-row:last-child { border-bottom: 0; }
a.pt-row:hover { background: var(--surface-alt); color: var(--ink); }
.pt-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.pt-row-main { flex: 1; min-width: 0; }
.pt-row-main .nm { font-weight: 600; }
.pt-row-main .sub { font-size: .82rem; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-row-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pt-empty { padding: 40px 16px; text-align: center; color: var(--ink-muted); }

/* ── Detail ── */
.pt-detail { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.pt-dl { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; margin: 0; }
.pt-dl dt { color: var(--ink-muted); font-size: .88rem; }
.pt-dl dd { margin: 0; }
.pt-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.pt-detail-head h1 { margin: 0; font-size: 1.4rem; }

/* ── Formular ── */
.pt-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.pt-form-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.pt-field { display: flex; flex-direction: column; gap: 6px; }
.pt-field label { font-size: .85rem; font-weight: 600; color: var(--ink); }
.pt-field .req { color: var(--danger); }
.pt-field input, .pt-field select {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
}
.pt-field input:focus, .pt-field select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(29,58,138,.12); }
.pt-field .hint { font-size: .78rem; color: var(--ink-muted); }
.pt-form-actions { display: flex; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.pt-msg { padding: 10px 14px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 14px; display: none; }
.pt-msg.show { display: block; }
.pt-msg--err { background: #fbe9e7; border: 1px solid #f3c9c4; color: var(--danger); }
.pt-msg--ok { background: #e8f5ee; border: 1px solid #cbe7d6; color: var(--ok); }

/* ── CardDAV-Panel ── */
.pt-dav { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.pt-dav h3 { margin: 0 0 4px; font-size: 1.05rem; }
.pt-dav > p { margin: 0 0 14px; color: var(--ink-muted); font-size: .88rem; }
.pt-dav-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.pt-dav-row .g { font-weight: 600; min-width: 130px; }
.pt-dav-row code { flex: 1; min-width: 0; font-size: .78rem; color: var(--ink-muted); background: var(--surface-alt); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-copy { cursor: pointer; }

.pt-back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-muted); font-size: .88rem; margin-bottom: 12px; }
.pt-back::before { content: "←"; }

/* ── Reconcile-Vorschläge ── */
.pt-rec-box { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; }
.pt-rec-box .pt-assign { font-size: .82rem; padding: 7px 12px; }
.pt-row { flex-wrap: wrap; }

/* ── Kennzahl (Spender-Self-Service) ── */
.pt-stat { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.pt-stat .label { font-size: .85rem; color: rgba(255,255,255,.75); }
.pt-stat .value { font-size: 2rem; font-weight: 700; margin-top: 4px; }
.pt-stat .sub { font-size: .85rem; color: rgba(255,255,255,.75); margin-top: 6px; }
.pt-money { font-variant-numeric: tabular-nums; }
.pt-card-foot-actions { margin-top: 14px; }

/* ── Gottesdienstordnung ── */
.pt-ordtag { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pt-ordtag:last-child { border-bottom: 0; }
.pt-ordtag-head { display: flex; align-items: center; gap: 10px; }
.pt-ordtag-day { font-weight: 700; }
.pt-ordtag-feast { color: var(--ink); margin-top: 3px; }
.pt-ordtag-masses { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pt-mass { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .85rem; }
.pt-mass strong { color: var(--navy); }
.pt-ordtag-none { color: var(--ink-muted); font-size: .85rem; margin-top: 6px; }

/* liturgische Farben (Tupfer) */
.pt-lit { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); display: inline-block; }
.pt-lit--white  { background: #fbfbf7; }
.pt-lit--red    { background: #b3261e; }
.pt-lit--green  { background: #2e7d4f; }
.pt-lit--violet { background: #6b3fa0; }
.pt-lit--purple { background: #6b3fa0; }
.pt-lit--black  { background: #2b2b2b; }
.pt-lit--rose   { background: #d98ca6; }
.pt-lit--gold   { background: var(--gold); }
.pt-lit--none   { background: #cfd4de; }

/* ── Breite Form ab Tablet ── */
@media (min-width: 640px) {
  .pt-form-grid { grid-template-columns: 1fr 1fr; }
  .pt-field--full { grid-column: 1 / -1; }
}

/* ── Responsive: ab Tablet mehrspaltig ── */
@media (min-width: 640px) {
  .pt-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .pt-grid { grid-template-columns: 1fr 1fr 1fr; }
}
