/* LektorenPlan Web – warme Papieroptik
   Farben: Tinte, Salbeigrün, Gold, Burgunder, warmes Papier. */

:root {
  --paper: #f5efe2;
  --paper-deep: #ede4d2;
  --paper-soft: #faf6ec;
  --card: #fffdf7;
  --card-alt: #f8f2e4;
  --ink: #2b332d;
  --ink-soft: #4a5047;
  --muted: #77715f;
  --muted-light: #9a937f;
  --line: #ddd2bd;
  --line-soft: #e9e0ce;
  --green: #315e50;
  --green-dark: #244a3f;
  --green-soft: #e3ece4;
  --gold: #b9943f;
  --gold-soft: #f4ead0;
  --burgundy: #7c3b3f;
  --burgundy-soft: #f3e2e1;
  --blue-soft: #e5ebef;
  --shadow-sm: 0 1px 2px rgba(54, 43, 25, .06), 0 2px 8px rgba(54, 43, 25, .04);
  --shadow: 0 2px 4px rgba(54, 43, 25, .06), 0 14px 34px rgba(54, 43, 25, .07);
  --radius: 14px;
  --radius-sm: 9px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  background:
    radial-gradient(1200px 600px at 82% -8%, rgba(194, 161, 77, .13), transparent 58%),
    radial-gradient(900px 500px at 4% 102%, rgba(49, 94, 80, .10), transparent 62%),
    linear-gradient(180deg, #fbf7ed 0%, var(--paper) 42%, #f1e9d9 100%);
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { color: var(--green); }
img, svg { max-width: 100%; }
h1, h2, h3, h4, h5 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -.012em; color: var(--ink); }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.02rem; }
p { margin: 0; }
small { font-size: .82em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

.eyebrow {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .25rem;
}

.icon { width: 18px; height: 18px; flex: 0 0 auto; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .82rem; word-break: break-all; }
.muted-row { opacity: .62; }
.hidden, [hidden] { display: none !important; }

/* ---------- Buttons and chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 40px; padding: .55rem 1rem;
  border: 1px solid transparent; border-radius: 999px;
  font-weight: 650; font-size: .9rem; line-height: 1.1;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--green); color: #fffdf6; box-shadow: 0 4px 12px rgba(36, 74, 63, .22); }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-secondary { background: var(--gold-soft); color: #5d4718; border-color: #dcc98f; }
.btn-secondary:hover { background: #efdfae; color: #4b390f; }
.btn-ghost { background: rgba(255, 253, 247, .5); border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover { background: var(--card); border-color: var(--gold); color: var(--ink); }
.btn-danger { background: var(--burgundy); color: #fff7f3; }
.btn-danger:hover { background: #652e32; color: #fff; }
.btn-small { min-height: 34px; padding: .38rem .78rem; font-size: .82rem; }
.btn-tiny { min-height: 30px; padding: .3rem .65rem; font-size: .76rem; }
.btn-block { width: 100%; }
.btn:disabled, button:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--muted);
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.icon-button:hover { background: var(--paper-deep); color: var(--ink); border-color: var(--line-soft); }
.icon-button.danger:hover { background: var(--burgundy-soft); color: var(--burgundy); }
.icon-button:disabled { opacity: .35; }

.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  min-height: 32px; padding: .34rem .7rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 253, 247, .6); color: var(--ink-soft);
  font-size: .8rem; font-weight: 550; white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.chip:hover { background: var(--card); border-color: var(--gold); color: var(--ink); }
.chip.active { background: var(--green); border-color: var(--green); color: #fff; }
.chip .icon { width: 15px; height: 15px; }

.text-link { display: inline-flex; align-items: center; gap: .25rem; font-weight: 600; font-size: .86rem; }
.text-link .icon { width: 15px; height: 15px; }

/* ---------- Badges, avatars ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .28rem;
  padding: .18rem .5rem; border-radius: 999px;
  font-size: .68rem; font-weight: 700; letter-spacing: .035em;
  line-height: 1.35; white-space: nowrap;
}
.badge-neutral { background: #f0eadc; color: #68614f; border: 1px solid #e3d8c3; }
.badge-green { background: var(--green-soft); color: var(--green-dark); border: 1px solid #c9dbce; }
.badge-gold { background: var(--gold-soft); color: #6b511a; border: 1px solid #e6d49f; }
.badge-burgundy { background: var(--burgundy-soft); color: var(--burgundy); border: 1px solid #e6c8c7; }
.badge-rank { text-transform: uppercase; letter-spacing: .08em; }
.badge-rank.rank-H, .badge-rank.rank-F { background: var(--burgundy-soft); color: var(--burgundy); border-color: #e5c4c3; }
.badge-rank.rank-G, .badge-rank.rank-g { background: var(--gold-soft); color: #6b511a; border-color: #e6d49f; }
.badge-color { background: color-mix(in srgb, var(--badge-color) 15%, #fff); color: color-mix(in srgb, var(--badge-color) 78%, #222); border: 1px solid color-mix(in srgb, var(--badge-color) 35%, #fff); }
.badge-color::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--badge-color); }
.badge-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }

.count-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 26px; padding: 0 .55rem;
  border-radius: 999px; background: var(--paper-deep); color: var(--ink-soft);
  font-size: .78rem; font-weight: 700;
}
.count-pill.warn { background: var(--burgundy-soft); color: var(--burgundy); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(145deg, #dce8de, #f2ecdc);
  border: 1px solid #cbd9ca; color: var(--green-dark);
  font-family: var(--serif); font-size: .95rem; font-weight: 700;
  flex: 0 0 auto;
}
.avatar.small { width: 32px; height: 32px; font-size: .78rem; }
.avatar.tiny { width: 27px; height: 27px; font-size: .7rem; }
.avatar.large { width: 66px; height: 66px; font-size: 1.4rem; }

.demo-pill {
  display: inline-flex; padding: .1rem .45rem; border-radius: 999px;
  background: var(--gold-soft); color: #725518; font-size: .64rem;
  font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
}

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }
.sidebar {
  position: sticky; top: 0; align-self: flex-start;
  display: flex; flex-direction: column;
  width: 268px; min-height: 100vh; max-height: 100vh;
  padding: 1.2rem 1rem 1rem;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, .82), rgba(246, 239, 226, .92)),
    radial-gradient(400px 180px at 0% 0%, rgba(194, 161, 77, .13), transparent 70%);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); padding: .2rem .35rem 1rem; }
.brand:hover { color: var(--ink); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(150deg, #f9f0d8, #e8dcc1);
  border: 1px solid #d9c89e; color: var(--green-dark);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.brand-mark svg { width: 30px; height: 30px; }
.brand-mark.large { width: 64px; height: 64px; border-radius: 18px; }
.brand-mark.large svg { width: 46px; height: 46px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--serif); font-size: 1.28rem; letter-spacing: -.02em; }
.brand-text small { color: var(--muted); font-size: .67rem; letter-spacing: .04em; }

.tenant-switch { padding: .6rem .35rem .9rem; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.field-caption { display: block; margin-bottom: .3rem; color: var(--muted); font-size: .65rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.tenant-form select {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); font-size: .85rem; font-weight: 600;
}

.nav { display: flex; flex-direction: column; gap: .16rem; padding: .9rem 0 1rem; }
.nav-heading { margin: .85rem .55rem .3rem; color: var(--muted-light); font-size: .62rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .52rem .7rem; border-radius: 9px;
  color: var(--ink-soft); font-size: .87rem; font-weight: 560;
  border: 1px solid transparent;
  transition: background .13s ease, color .13s ease, border-color .13s ease;
}
.nav-link .icon { width: 17px; height: 17px; color: var(--muted); }
.nav-link:hover { background: rgba(255, 253, 247, .85); color: var(--ink); border-color: var(--line-soft); }
.nav-link.active { background: var(--green); color: #fffdf7; border-color: var(--green); box-shadow: 0 4px 12px rgba(36, 74, 63, .16); }
.nav-link.active .icon { color: #f1e8d3; }
.sidebar-foot { margin-top: auto; padding: 1rem .35rem .2rem; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: .25rem; color: var(--muted); font-size: .68rem; }
.sidebar-foot .version { font-weight: 650; }
.sidebar-foot .source { color: var(--muted-light); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.15rem clamp(1.1rem, 2.6vw, 2.2rem) 1rem;
  border-bottom: 1px solid var(--line-soft);
}
.topbar-left { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.nav-toggle { display: none; flex: 0 0 auto; }
.sidebar-close { display: none; position: absolute; top: .95rem; right: .8rem; }
.topbar-title .eyebrow { margin-bottom: .1rem; }
.topbar-title h1 { font-size: clamp(1.45rem, 2.3vw, 2rem); line-height: 1.1; }
.topbar-actions { display: flex; align-items: center; gap: .6rem; }
.account { display: flex; align-items: center; gap: .55rem; padding: .28rem .35rem .28rem .55rem; border-left: 1px solid var(--line); margin-left: .25rem; }
.account-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.account-text strong { font-size: .8rem; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-text small { color: var(--muted); font-size: .67rem; }

.content { flex: 1; padding: 1.25rem clamp(1.1rem, 2.6vw, 2.2rem) 2.2rem; }
.app-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem;
  padding: .8rem clamp(1.1rem, 2.6vw, 2.2rem) 1.2rem;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-light); font-size: .68rem;
}

.page-stack { display: flex; flex-direction: column; gap: 1rem; }
.card {
  background: rgba(255, 253, 247, .9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.15rem;
  backdrop-filter: blur(2px);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.card-head h3 { margin-top: .1rem; }
.card-head .eyebrow { margin-bottom: .15rem; }
.card-foot { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; }
.two-column { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.two-column > .page-stack { gap: 1rem; }

/* ---------- Flash, notice ---------- */
.flash {
  display: flex; align-items: flex-start; gap: .65rem;
  margin: 1rem clamp(1.1rem, 2.6vw, 2.2rem) 0;
  padding: .7rem .9rem;
  border-radius: 10px; border: 1px solid #c9dbce;
  background: #eef5ec; color: #2e5545; font-size: .88rem; font-weight: 550;
  box-shadow: var(--shadow-sm);
}
.flash-error { background: #f9e9e7; border-color: #e5bfbb; color: #743236; }
.flash-info { background: #f6efd9; border-color: #e1d19e; color: #6c561d; }
.flash-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255, 255, 255, .65); font-size: .72rem; font-weight: 800;
  flex: 0 0 auto;
}
.notice {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: .9rem 1rem; border: 1px dashed #d7c58f; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #fbf5e4, #f7eed7); color: #5d4a1c;
  font-size: .87rem;
}
.notice .icon { color: var(--gold); width: 22px; height: 22px; margin-top: .1rem; }
.notice strong { display: block; margin-bottom: .1rem; }

/* ---------- Page intro / toolbar ---------- */
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; padding: .35rem .2rem .2rem; }
.page-intro h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-bottom: .3rem; }
.page-intro p { max-width: 70ch; color: var(--muted); font-size: .9rem; }
.intro-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.intro-stats { display: flex; gap: 1.4rem; padding: .35rem .2rem; }
.intro-stats div { display: flex; flex-direction: column; align-items: flex-end; }
.intro-stats strong { font-family: var(--serif); font-size: 1.55rem; line-height: 1; color: var(--green-dark); }
.intro-stats span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.toolbar { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .7rem .9rem; }
.toolbar-group { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.range-nav { gap: .35rem; }
.range-form { display: flex; align-items: flex-end; gap: .45rem; flex-wrap: wrap; }
.field-inline { display: flex; flex-direction: column; gap: .15rem; }
.field-inline span { color: var(--muted); font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.field-inline input { min-height: 34px; padding: .25rem .45rem; border: 1px solid var(--line); border-radius: 7px; background: var(--card); font-size: .82rem; }
.inline-form { display: inline-flex; }
.inline-range { margin-top: .6rem; }

.range-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 1.2rem; flex-wrap: wrap;
  padding: 1rem 1.2rem;
  border: 1px solid #d9c9a2; border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(255, 252, 243, .95), rgba(247, 238, 216, .9)),
    radial-gradient(500px 160px at 100% 0%, rgba(49, 94, 80, .1), transparent 60%);
  box-shadow: var(--shadow-sm);
}
.range-banner h2 { font-size: clamp(1.3rem, 2vw, 1.75rem); }
.range-banner p { color: var(--muted); font-size: .86rem; margin-top: .15rem; }
.range-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; justify-content: flex-end; }

.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.stat-strip.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mini-stat {
  display: flex; flex-direction: column; gap: .1rem;
  padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 253, 247, .75); box-shadow: var(--shadow-sm);
}
.mini-stat-label { color: var(--muted); font-size: .67rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.mini-stat strong { font-family: var(--serif); font-size: 1.55rem; line-height: 1.1; color: var(--green-dark); }
.mini-stat small { color: var(--muted); font-size: .72rem; }
.mini-stat.warn strong { color: var(--burgundy); }

/* ---------- Forms ---------- */
.form-stack { display: flex; flex-direction: column; gap: .8rem; }
.form-stack.compact { gap: .55rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: .22rem; min-width: 0; }
.field.narrow { max-width: 280px; }
.field-label { color: var(--ink-soft); font-size: .74rem; font-weight: 700; letter-spacing: .015em; }
.field-label small { color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 38px; padding: .45rem .6rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink);
  font-size: .88rem;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.field textarea { min-height: 66px; resize: vertical; line-height: 1.4; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(49, 94, 80, .12);
}
.field input[type="color"] { padding: .18rem; min-height: 38px; }
.field-group { display: flex; flex-direction: column; gap: .35rem; }
.field-hint { color: var(--muted); font-size: .75rem; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: .7rem 1.1rem; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem .9rem; }
.checkbox-list { display: flex; flex-direction: column; gap: .35rem; max-height: 220px; overflow-y: auto; padding: .1rem; }
.check { display: inline-flex; align-items: flex-start; gap: .45rem; color: var(--ink-soft); font-size: .84rem; cursor: pointer; }
.check input { width: 15px; height: 15px; margin-top: .13rem; accent-color: var(--green); flex: 0 0 auto; }
.check.standalone { padding-top: .3rem; }
.check-inline { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.check-inline input { accent-color: var(--green); }
.weekday-grid { display: flex; gap: .35rem; flex-wrap: wrap; }
.weekday-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.weekday-check span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 34px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font-size: .76rem; font-weight: 700; cursor: pointer;
}
.weekday-check input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.form-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.search-field { display: flex; align-items: center; gap: .4rem; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.search-field .icon { width: 16px; height: 16px; color: var(--muted); }
.search-field input { border: 0; background: transparent; outline: none; font-size: .83rem; min-width: 180px; }

.file-drop {
  display: flex; align-items: center; gap: .9rem;
  padding: 1.3rem 1rem; border: 1.5px dashed #cdbfa0; border-radius: 12px;
  background: linear-gradient(135deg, #fcf8ee, #f6eedd); cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.file-drop:hover, .file-drop.dragging { border-color: var(--green); background: #f1f4e8; }
.file-drop .icon { width: 28px; height: 28px; color: var(--green); }
.file-drop span { display: flex; flex-direction: column; }
.file-drop strong { font-size: .9rem; }
.file-drop small { color: var(--muted); font-size: .75rem; }
.file-drop input { display: none; }
.btn.is-busy, button.is-busy { opacity: .55; cursor: progress; }
.plan-filter-empty td { padding: 2rem 1rem; text-align: center; color: var(--muted); }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table th, .data-table td { padding: .55rem .5rem; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: .83rem; vertical-align: middle; }
.data-table thead th { color: var(--muted); font-size: .66rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.data-table tbody tr:hover { background: rgba(247, 241, 227, .7); }
.data-table td small { color: var(--muted); }
.data-table .row-actions, .row-actions { display: flex; align-items: center; gap: .1rem; justify-content: flex-end; }
.compact-table th, .compact-table td { padding: .42rem .35rem; }
.person-inline { display: inline-flex; align-items: center; gap: .45rem; }
.person-inline > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.person-inline strong { font-size: .83rem; }
.person-inline small { color: var(--muted); font-size: .7rem; }
.tenant-tags { display: flex; flex-wrap: wrap; gap: .2rem; max-width: 330px; }
.table-note { color: var(--muted); font-size: .74rem; padding: 0 .25rem; }

.calendar-card { background: rgba(255, 253, 247, .9); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.calendar-table { min-width: 960px; }
.calendar-table thead th {
  position: sticky; top: 0; z-index: 2;
  padding: .55rem .45rem; text-align: left;
  background: #f8f2e4;
  border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: .65rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase;
}
.calendar-table thead th.col-date { width: 78px; }
.calendar-table thead th.col-liturgy { width: 27%; }
.calendar-table .col-church { min-width: 165px; }
.calendar-table td { border-bottom: 1px solid var(--line-soft); padding: .48rem .45rem; vertical-align: top; font-size: .8rem; }
.plan-row.is-sunday { background: rgba(248, 240, 218, .55); }
.plan-row.is-highfeast { background: rgba(124, 59, 63, .075); }
.plan-row.is-feast { background: rgba(194, 161, 77, .09); }
.plan-row.is-obligation { background: rgba(49, 94, 80, .06); }
.plan-row:hover { background: rgba(239, 233, 217, .65); }
.date-cell { position: relative; padding-left: .7rem !important; }
.date-number { font-family: var(--serif); font-size: 1.32rem; line-height: 1; font-weight: 650; }
.date-meta { display: flex; gap: .28rem; color: var(--muted); font-size: .65rem; margin-top: .12rem; text-transform: uppercase; letter-spacing: .04em; }
.liturgical-bar { position: absolute; left: 0; top: .45rem; bottom: .45rem; width: 3px; border-radius: 3px; opacity: .85; }
.liturgy-title { display: flex; align-items: flex-start; gap: .35rem; font-size: .82rem; line-height: 1.3; }
.liturgy-title strong { font-weight: 650; }
.feast-glyph { width: 17px; height: 17px; flex: 0 0 auto; color: var(--gold); margin-top: .05rem; }
.liturgy-meta { display: flex; flex-wrap: wrap; gap: .2rem; margin-top: .22rem; }
.readings { margin-top: .25rem; color: var(--muted); font-size: .69rem; line-height: 1.35; }
.liturgy-remark { margin-top: .16rem; color: var(--muted); font-size: .68rem; font-style: italic; }
.church-cell { background: rgba(255, 253, 247, .35); }
.empty-cell { color: #c7bda7; font-size: .9rem; }
.service-stack { display: flex; flex-direction: column; gap: .25rem; }
.service-card {
  display: flex; flex-direction: column; gap: .06rem;
  padding: .28rem .38rem; border-radius: 7px;
  border: 1px solid transparent; background: rgba(255, 255, 255, .55);
  color: var(--ink); line-height: 1.25;
  transition: background .13s ease, border-color .13s ease, transform .13s ease;
}
.service-card:hover { background: #fffdf7; border-color: #d8c9a9; transform: translateY(-1px); color: var(--ink); }
.service-card.open { border-left: 3px solid var(--burgundy); }
.service-card.staffed { border-left: 3px solid var(--green); }
.service-time { font-size: .66rem; font-weight: 750; color: var(--muted); letter-spacing: .03em; }
.service-title { font-size: .76rem; font-weight: 650; }
.service-kind { margin-left: .25rem; padding: 0 .25rem; border-radius: 4px; background: var(--burgundy-soft); color: var(--burgundy); font-size: .55rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.service-location { color: var(--muted); font-size: .65rem; font-style: italic; }
.service-people { display: flex; flex-wrap: wrap; gap: .18rem; margin-top: .13rem; }
.person-chip { padding: 0 .28rem; border-radius: 4px; font-size: .62rem; font-weight: 650; background: #eef2e8; color: var(--green-dark); }
.person-chip.role-K { background: var(--gold-soft); color: #6d5219; }
.open-badge { color: var(--burgundy); font-size: .6rem; font-weight: 750; }
.church-head { display: flex; align-items: center; gap: .4rem; }
.church-glyph { width: 38px; height: 28px; flex: 0 0 auto; }
.church-head-text { display: flex; flex-direction: column; line-height: 1.15; }
.church-head-text strong { color: var(--ink-soft); font-size: .74rem; text-transform: none; letter-spacing: 0; }
.church-head-text small { color: var(--muted); font-size: .6rem; text-transform: none; letter-spacing: 0; }

.plan-legend { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 0 .15rem; }
.filter-chips { display: flex; gap: .3rem; flex-wrap: wrap; }
.legend-items { display: flex; gap: .8rem; flex-wrap: wrap; color: var(--muted); font-size: .72rem; }
.legend-items span { display: inline-flex; align-items: center; gap: .3rem; }
.swatch { width: 13px; height: 13px; border-radius: 3px; display: inline-block; border: 1px solid var(--line); }
.swatch.sunday { background: #f8f0da; }
.swatch.feast { background: #f0dfe0; }
.swatch.open { background: var(--burgundy); border-color: var(--burgundy); }

/* Mobile Tageszusammenfassung (ersetzt die breite Tabelle auf kleinen Geräten) */
.plan-mobile-list { display: none; }
.plan-mobile-hint { padding: .55rem .75rem 0; color: var(--muted); font-size: .7rem; }
.plan-mobile-empty { padding: 1.5rem .9rem; text-align: center; }
.plan-day-card { border-bottom: 1px solid var(--line-soft); background: rgba(255, 253, 247, .55); }
.plan-day-card[hidden] { display: none !important; }
.plan-day-card:last-of-type { border-bottom: 0; }
.plan-day-card.is-sunday { background: rgba(248, 240, 218, .55); }
.plan-day-card.is-highfeast { background: rgba(124, 59, 63, .075); }
.plan-day-card.is-feast { background: rgba(194, 161, 77, .09); }
.plan-day-card.is-obligation { background: rgba(49, 94, 80, .06); }
.plan-day-summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem .75rem;
  transition: background .13s ease;
}
.plan-day-summary::-webkit-details-marker { display: none; }
.plan-day-summary:hover { background: rgba(239, 233, 217, .55); }
.plan-day-card[open] > .plan-day-summary { background: rgba(237, 228, 210, .38); }
.plan-day-summary .day-date { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 46px; padding-left: .45rem; }
.plan-day-summary .date-number { font-size: 1.25rem; }
.plan-day-summary .date-meta { flex-direction: column; align-items: center; gap: 0; font-size: .58rem; margin-top: .05rem; }
.day-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .18rem; }
.day-title { display: flex; align-items: flex-start; gap: .35rem; font-size: .81rem; line-height: 1.28; }
.day-title strong { font-weight: 650; }
.day-status { display: flex; flex-wrap: wrap; gap: .15rem .5rem; color: var(--muted); font-size: .68rem; }
.day-status-open { color: var(--burgundy); font-weight: 750; }
.day-status-ok { color: var(--green); font-weight: 650; }
.day-chevron {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 25px; height: 25px; border-radius: 50%;
  color: var(--muted); background: rgba(237, 228, 210, .65);
  transition: transform .15s ease, background .15s ease;
}
.day-chevron .icon { width: 15px; height: 15px; }
.plan-day-card[open] .day-chevron { transform: rotate(90deg); background: var(--gold-soft); color: #6d5219; }
.day-details { display: flex; flex-direction: column; gap: .55rem; padding: .1rem .75rem .85rem; }
.day-readings { align-self: flex-start; margin-top: 0; }
.day-church { border: 1px solid var(--line-soft); border-radius: 10px; padding: .55rem .6rem; background: rgba(255, 253, 247, .78); }
.day-church-head { display: flex; align-items: center; gap: .45rem; margin-bottom: .4rem; }
.day-church-head .church-glyph { width: 34px; height: 25px; color: var(--green-dark); }
.day-church-head > span { display: flex; flex-direction: column; line-height: 1.15; }
.day-church-head strong { font-size: .75rem; color: var(--ink-soft); }
.day-church-head small { color: var(--muted); font-size: .63rem; }
.day-service-card { padding: .45rem .55rem; background: #fffdf7; border-color: var(--line-soft); }
.day-service-card .service-title { font-size: .8rem; }
.day-service-card .service-time { font-size: .68rem; }
.day-service-card .person-chip { font-size: .65rem; }

/* ---------- Plan timeline and presets ---------- */
.filter-form { display: flex; align-items: flex-end; gap: .4rem; }
.filter-form select { min-width: 160px; }
.preset-menu { position: relative; }
.preset-menu summary { list-style: none; cursor: pointer; }
.preset-menu summary::-webkit-details-marker { display: none; }
.preset-panel {
  position: absolute; right: 0; top: calc(100% + .45rem); z-index: 30;
  width: min(430px, 88vw); padding: .8rem;
  display: flex; flex-direction: column; gap: .7rem;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fffdf7; box-shadow: var(--shadow);
}
.preset-group { display: flex; flex-direction: column; gap: .3rem; }
.preset-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .3rem; }
.preset-link {
  display: flex; flex-direction: column; gap: .08rem; padding: .35rem .5rem;
  border: 1px solid var(--line-soft); border-radius: 8px;
  color: var(--ink-soft); font-size: .78rem; font-weight: 650;
  background: rgba(250, 246, 236, .7);
}
.preset-link:hover { border-color: var(--gold); background: #fffdf7; color: var(--ink); }
.preset-link small { color: var(--muted); font-size: .64rem; font-weight: 500; }
.plan-timeline { padding: .9rem 1.1rem 1rem; }
.timeline-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .7rem; }
.timeline-head h3 { font-size: 1rem; }
.timeline-legend { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .68rem; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: #e7dfcd; display: inline-block; margin-left: .35rem; }
.timeline-dot.has-data { background: var(--green); }
.timeline { position: relative; }
.timeline-markers { position: relative; height: 48px; }
.timeline-marker { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .12rem; }
.timeline-marker:nth-child(even) { top: 18px; }
.timeline-marker i { width: 2px; height: 9px; background: var(--gold); display: block; }
.timeline-marker em { font-style: normal; color: var(--muted); font-size: .61rem; white-space: nowrap; }
.timeline-marker.marker-calendar i { background: var(--burgundy); }
.timeline-track {
  position: relative; height: 38px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); background: #f4eee1;
}
.timeline-segment {
  position: absolute; top: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  border-right: 1px solid rgba(255, 253, 247, .8);
  color: #7a705b; font-size: .6rem; font-weight: 700;
  background: repeating-linear-gradient(135deg, #eee7d6, #eee7d6 5px, #e9e1cd 5px, #e9e1cd 10px);
}
.timeline-segment.has-data {
  color: #f7f3e8;
  background: linear-gradient(180deg, #477363, #315e50);
}
.timeline-segment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 .18rem; }

.readings { display: inline-flex; align-items: center; gap: .2rem; text-decoration: none; }
.readings:hover { color: var(--green-dark); text-decoration: underline; }
.readings .icon { width: 11px; height: 11px; opacity: .7; }

/* ---------- Church overview ---------- */
.church-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 1rem; }
.church-card { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 253, 247, .88); box-shadow: var(--shadow-sm); padding: .9rem 1rem; }
.church-card-head { display: flex; align-items: center; gap: .75rem; padding-bottom: .65rem; border-bottom: 1px solid var(--line-soft); }
.church-card-head .church-glyph { width: 56px; height: 40px; color: var(--green-dark); }
.church-card-head h3 { font-size: 1.05rem; }
.church-card-head p { color: var(--muted); font-size: .72rem; }
.church-card-head .count-pill { margin-left: auto; }
.template-list { display: flex; flex-direction: column; }
.template-row { display: flex; align-items: center; gap: .65rem; padding: .55rem 0; border-bottom: 1px solid var(--line-soft); }
.template-row:last-child { border-bottom: 0; }
.template-when { display: flex; flex-direction: column; min-width: 76px; }
.template-when strong { font-size: .76rem; color: var(--green-dark); }
.template-when span { font-size: .7rem; color: var(--muted); }
.template-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.template-main strong { font-size: .82rem; }
.template-main small { color: var(--muted); font-size: .68rem; }
.template-actions { display: flex; align-items: center; gap: .1rem; }

/* ---------- Detail pages ---------- */
.detail-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.1rem 1.2rem; }
.detail-hero-main { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.detail-church .church-glyph { width: 96px; height: 68px; color: var(--green-dark); }
.detail-hero h2 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); }
.detail-place { color: var(--muted); font-size: .85rem; margin: .1rem 0 .4rem; }
.detail-hero-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .9fr); gap: 1rem; align-items: start; }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: .4rem .8rem; margin: .2rem 0 0; font-size: .84rem; }
.detail-list dt { color: var(--muted); font-size: .72rem; font-weight: 650; }
.detail-list dd { margin: 0; }
.detail-list.tight { gap: .3rem .8rem; margin-top: .8rem; }
.side-note { background: linear-gradient(145deg, #faf4e5, #f6eedc); border-color: #ddd0ad; }
.side-note p { color: #635535; font-size: .84rem; margin: .2rem 0 .6rem; }
.inline-note { margin-top: 1rem; padding: .9rem 1rem; }
.empty-note { color: var(--muted); font-size: .82rem; padding: .5rem 0; }

.assignment-list { display: flex; flex-direction: column; gap: .35rem; }
.assignment-row { display: flex; align-items: center; gap: .55rem; padding: .45rem .5rem; border: 1px solid var(--line-soft); border-radius: 9px; background: rgba(250, 246, 236, .65); }
.assignment-person { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.2; }
.assignment-person strong { font-size: .86rem; }
.assignment-person small { color: var(--muted); font-size: .7rem; }
.assignment-actions { display: flex; align-items: center; gap: .1rem; }
.candidate-block { margin-top: .9rem; padding-top: .8rem; border-top: 1px dashed var(--line); }
.candidate { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .5rem .55rem; border-radius: 9px; border: 1px solid var(--line-soft); background: var(--card); margin-top: .35rem; }
.candidate.blocked { opacity: .6; }
.candidate-main { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 190px; }
.candidate-main > div { display: flex; flex-direction: column; line-height: 1.2; }
.candidate-main strong { font-size: .84rem; }
.candidate-main small { color: var(--muted); font-size: .7rem; }
.candidate-tags { display: flex; gap: .2rem; flex-wrap: wrap; }
.candidate-form { display: flex; align-items: center; gap: .45rem; }

/* ---------- Team ---------- */
.team-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .8fr); gap: 1rem; align-items: start; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .7rem; }
.person-card { display: flex; flex-direction: column; gap: .5rem; padding: .8rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 253, 247, .8); }
.person-card.inactive { opacity: .65; }
.person-card-head { display: flex; align-items: center; gap: .55rem; }
.person-card-name { flex: 1; min-width: 0; line-height: 1.2; }
.person-card-name h4 { font-size: .95rem; }
.person-card-name span { color: var(--muted); font-size: .7rem; }
.person-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .2rem; padding: .45rem .1rem; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.person-stats div { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.person-stats strong { font-family: var(--serif); font-size: 1.05rem; color: var(--green-dark); }
.person-stats span { color: var(--muted); font-size: .6rem; text-transform: uppercase; letter-spacing: .04em; }
.person-stats.large strong { font-size: 1.4rem; }
.person-details { display: flex; flex-direction: column; font-size: .73rem; color: var(--muted); overflow: hidden; }
.person-details a { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.preference-tags { display: flex; flex-wrap: wrap; gap: .18rem; }
.person-foot { display: flex; justify-content: space-between; gap: .5rem; color: var(--muted); font-size: .66rem; }
.absence-list { display: flex; flex-direction: column; }
.absence-row { display: flex; align-items: center; gap: .7rem; padding: .5rem .1rem; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.absence-row:hover { color: var(--ink); background: rgba(247, 241, 227, .6); }
.absence-row:last-child { border-bottom: 0; }
.absence-dates { display: flex; flex-direction: column; min-width: 74px; line-height: 1.15; }
.absence-dates strong { font-size: .76rem; }
.absence-dates small { color: var(--muted); font-size: .65rem; }
.absence-person { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.absence-person strong { font-size: .79rem; }
.absence-person small { color: var(--muted); font-size: .68rem; }

.compact-list { display: flex; flex-direction: column; margin-top: .5rem; }
.compact-row { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: .5rem .1rem; border-bottom: 1px solid var(--line-soft); }
.compact-row:last-child { border-bottom: 0; }
.compact-row > div:first-child { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.compact-row strong { font-size: .8rem; }
.compact-row small { color: var(--muted); font-size: .69rem; }

/* ---------- Statistics ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.stats-grid .span-2 { grid-column: span 2; }
.month-chart { display: flex; align-items: flex-end; gap: .45rem; min-height: 190px; padding: .7rem .2rem 0; overflow-x: auto; }
.month-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: .25rem; min-width: 46px; flex: 1; }
.month-count { font-size: .66rem; color: var(--muted); }
.month-bar-track { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 130px; border-bottom: 1px solid var(--line); }
.month-bar { width: 60%; max-width: 26px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, var(--green), #487d69); min-height: 2px; }
.month-label { color: var(--muted); font-size: .64rem; text-align: center; white-space: nowrap; }
.fairness-box { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; }
.fairness-box div { display: flex; flex-direction: column; padding: .55rem .65rem; border-radius: 9px; background: var(--paper-soft); border: 1px solid var(--line-soft); }
.fairness-box span { color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; }
.fairness-box strong { font-family: var(--serif); font-size: 1.35rem; color: var(--green-dark); }
.inline-bar { height: 8px; border-radius: 999px; background: var(--paper-deep); overflow: hidden; width: 100%; min-width: 70px; }
.inline-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4c7d69, var(--green)); }
.inline-bar.tall { height: 10px; }
.bar-cell { min-width: 100px; }
.church-stat-list { display: flex; flex-direction: column; gap: .55rem; }
.church-stat-row { display: flex; align-items: center; gap: .6rem; }
.church-stat-icon .church-glyph { width: 52px; height: 38px; color: var(--green-dark); }
.church-stat-main { flex: 1; min-width: 0; }
.church-stat-head { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .2rem; }
.church-stat-head strong { font-size: .8rem; }
.church-stat-head span { color: var(--muted); font-size: .68rem; }
.church-stat-meta { display: flex; flex-direction: column; align-items: flex-end; min-width: 64px; line-height: 1.15; }
.church-stat-meta strong { font-family: var(--serif); font-size: 1.05rem; color: var(--green-dark); }
.church-stat-meta span { color: var(--muted); font-size: .64rem; }
.big-number-block { display: flex; flex-direction: column; align-items: flex-start; padding: .4rem 0; }
.big-number-block strong { font-family: var(--serif); font-size: 3rem; line-height: 1; color: var(--green-dark); }
.big-number-block span { font-size: .9rem; color: var(--ink-soft); }
.big-number-block small { color: var(--muted); font-size: .74rem; margin-top: .2rem; }

/* ---------- Exchange ---------- */
.export-option { display: flex; flex-direction: column; gap: .7rem; padding: .85rem 0; border-bottom: 1px solid var(--line-soft); }
.export-option:last-of-type { border-bottom: 0; }
.export-option h4 { margin-bottom: .2rem; }
.export-option p { color: var(--muted); font-size: .82rem; margin-bottom: .45rem; }
.export-option > .btn { align-self: flex-start; }
.preview-panel { display: flex; flex-direction: column; gap: .8rem; }
.preview-head h4 { margin: .25rem 0 .1rem; }
.preview-head p { color: var(--muted); font-size: .78rem; }
.preview-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.preview-counts div { display: flex; flex-direction: column; padding: .5rem .6rem; border-radius: 8px; background: var(--paper-soft); border: 1px solid var(--line-soft); }
.preview-counts strong { font-family: var(--serif); font-size: 1.15rem; color: var(--green-dark); }
.preview-counts span { color: var(--muted); font-size: .68rem; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .9fr); gap: 1.2rem; }
.settings-copy h4 { margin-bottom: .25rem; }
.settings-copy p { color: var(--muted); font-size: .84rem; margin-bottom: .6rem; }
.settings-fields { display: flex; flex-direction: column; gap: .65rem; }
.inline-meta { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem .55rem; border-radius: 8px; background: var(--paper-soft); border: 1px solid var(--line-soft); font-size: .76rem; }
.inline-meta span { color: var(--muted); }
.source-note { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .72rem; }
.source-note .icon { width: 14px; height: 14px; }
.weight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.data-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; margin-bottom: 1rem; }
.data-summary div { display: flex; flex-direction: column; align-items: center; padding: .5rem; border-radius: 9px; background: var(--paper-soft); border: 1px solid var(--line-soft); }
.data-summary strong { font-family: var(--serif); font-size: 1.25rem; color: var(--green-dark); }
.data-summary span { color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; }
.danger-zone { border-left: 2px solid #e3c5c2; padding-left: .9rem; }
.danger-block { display: flex; flex-direction: column; gap: .5rem; padding-bottom: .7rem; border-bottom: 1px dashed var(--line); }
.danger-block:last-child { border-bottom: 0; padding-bottom: 0; }
.danger-block h4 { color: var(--burgundy); }
.danger-block p { color: var(--muted); font-size: .78rem; }
.delete-form { display: flex; flex-direction: column; gap: .45rem; }
.about-card { display: flex; align-items: center; gap: 1rem; background: linear-gradient(140deg, #fbf6ea, #f5edda); border-color: #ddd0ae; }
.about-mark { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); flex: 0 0 auto; }
.about-mark .icon { width: 26px; height: 26px; }
.about-card p { color: var(--muted); font-size: .82rem; margin-top: .2rem; }

/* ---------- Administration ---------- */
.admin-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .8fr); gap: 1rem; align-items: start; }
.admin-layout.wide-form { grid-template-columns: minmax(0, 1.45fr) minmax(330px, .9fr); }
.admin-list { display: flex; flex-direction: column; }
.admin-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .85rem .1rem; border-bottom: 1px solid var(--line-soft); }
.admin-row:last-child { border-bottom: 0; }
.admin-row-main { min-width: 0; }
.admin-row-title { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.admin-row-title h4 { font-size: 1rem; }
.admin-row p { color: var(--muted); font-size: .76rem; margin-top: .18rem; }
.admin-row-actions { display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; justify-content: flex-end; }
.admin-metrics { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .35rem; color: var(--muted); font-size: .7rem; }
.admin-metrics strong { color: var(--ink-soft); font-size: .76rem; }
.church-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: .7rem; }
.church-admin-card { display: flex; flex-direction: column; gap: .5rem; padding: .75rem; border: 1px solid var(--line); border-radius: 11px; background: var(--card); }
.church-admin-art { display: flex; justify-content: center; padding: .35rem; border-radius: 8px; background: linear-gradient(160deg, var(--paper-soft), var(--paper-deep)); }
.church-admin-art .church-glyph { width: 84px; height: 60px; color: var(--green-dark); }
.church-admin-body { display: flex; flex-direction: column; gap: .2rem; }
.church-admin-body p { color: var(--muted); font-size: .72rem; }
.church-admin-card .admin-row-actions { justify-content: flex-end; }
.color-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .12); }

/* ---------- Auth ---------- */
.auth-page { display: flex; align-items: center; justify-content: center; padding: 2rem 1.2rem; }
.auth-shell { width: min(100%, 1080px); margin: 0 auto; }
.auth-flash { margin: 0 0 1rem; }
.auth-card {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  overflow: hidden; border: 1px solid #d8c9a7; border-radius: 22px;
  background: var(--card); box-shadow: 0 30px 80px rgba(56, 43, 20, .16), 0 2px 0 rgba(255, 255, 255, .6) inset;
}
.auth-art {
  display: flex; flex-direction: column; gap: 1.1rem; justify-content: space-between;
  padding: clamp(1.4rem, 3vw, 2.4rem);
  background:
    radial-gradient(500px 300px at 90% 10%, rgba(194, 161, 77, .22), transparent 65%),
    radial-gradient(400px 300px at 10% 90%, rgba(49, 94, 80, .18), transparent 65%),
    linear-gradient(150deg, #2e5548 0%, #28493f 48%, #233f37 100%);
  color: #f7f0df;
}
.auth-brand { display: flex; align-items: center; gap: .9rem; }
.auth-brand h1 { color: #fdf7e8; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1; }
.auth-brand p { color: #d7d8c5; font-size: .84rem; margin-top: .3rem; max-width: 30ch; }
.auth-art .brand-mark { background: rgba(255, 253, 247, .12); border-color: rgba(255, 255, 255, .2); color: #f0dfa9; }
.auth-church { display: flex; justify-content: center; padding: .4rem 0 .1rem; }
.auth-church .church-glyph { width: min(100%, 330px); height: auto; opacity: .95; }
.auth-quote { position: relative; padding-left: 1.3rem; color: #e7e1cd; }
.quote-mark { position: absolute; left: 0; top: -.5rem; font-family: var(--serif); font-size: 2.8rem; color: var(--gold); line-height: 1; }
.auth-quote p { font-family: var(--serif); font-size: clamp(1rem, 1.7vw, 1.2rem); line-height: 1.4; font-style: italic; }
.quote-source { display: block; margin-top: .35rem; color: #bfc8b6; font-size: .68rem; letter-spacing: .05em; text-transform: uppercase; }
.auth-badges { display: flex; gap: .35rem; }
.auth-badges .badge { background: rgba(255, 253, 247, .1); border-color: rgba(255, 255, 255, .16); color: #eee5cf; }
.auth-form-panel { display: flex; flex-direction: column; justify-content: center; gap: 1rem; padding: clamp(1.4rem, 3vw, 2.5rem); background: linear-gradient(160deg, #fffdf7, #faf5e8); }
.auth-form-head h2 { font-size: 2rem; margin: .1rem 0 .35rem; }
.auth-form-head p { color: var(--muted); font-size: .85rem; }
.auth-form-panel .form-stack { gap: .9rem; }
.demo-accounts { padding: .8rem .9rem; border: 1px dashed #d8c79b; border-radius: 11px; background: #fbf4e1; }
.demo-accounts-title { display: block; color: #7a5d1c; font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .4rem; }
.demo-account-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.demo-account-grid div { display: flex; flex-direction: column; gap: .1rem; font-size: .69rem; color: #6d5a2e; }
.demo-account-grid strong { font-family: var(--mono); font-size: .72rem; color: #4f411f; }
.auth-note { display: flex; align-items: flex-start; gap: .4rem; color: var(--muted); font-size: .7rem; }
.auth-note .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-top: .35rem; flex: 0 0 auto; }
.auth-foot { text-align: center; color: var(--muted-light); font-size: .7rem; margin-top: 1rem; }

/* ---------- Error / no tenant ---------- */
.error-page { display: flex; align-items: center; gap: 1.5rem; padding: 2rem; max-width: 760px; margin: 3rem auto; }
.error-code { display: flex; align-items: center; justify-content: center; width: 110px; height: 110px; border-radius: 50%; background: var(--gold-soft); border: 1px solid #e2d199; color: #8c6a23; font-family: var(--serif); font-size: 2.1rem; flex: 0 0 auto; }
.error-page h2 { margin-bottom: .35rem; }
.error-page p { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }

/* ---------- Versendung ---------- */
.dispatch-page .range-label { font-family: var(--serif); font-size: .95rem; color: var(--ink-soft); }
.dispatch-bulk { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.dispatch-table td { vertical-align: top; }
.dispatch-table select { min-width: 9.5rem; }
.dispatch-person { display: flex; flex-direction: column; gap: .1rem; min-width: 11rem; }
.dispatch-person strong { font-size: .9rem; }
.dispatch-person small { color: var(--muted); }
.dispatch-person a { font-size: .78rem; color: var(--green); word-break: break-all; }
.dispatch-no-mail { font-size: .78rem; color: var(--burgundy); }
.dispatch-warn { display: block; color: var(--burgundy); font-size: .72rem; }
.dispatch-cover { white-space: nowrap; }
.dispatch-cover .check { font-size: .8rem; }
.dispatch-details summary { cursor: pointer; color: var(--green-dark); font-size: .8rem; }
.dispatch-details ul { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.dispatch-details li {
  display: grid; grid-template-columns: 6.5rem 3.2rem minmax(4rem, 1fr) auto; gap: .45rem;
  font-size: .74rem; color: var(--muted); padding: .18rem .4rem;
  border-left: 2px solid var(--line-soft); background: var(--card-alt); border-radius: 0 5px 5px 0;
}
.dispatch-actions { gap: .5rem; flex-wrap: wrap; }
.dispatch-last-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: .9rem; }
.dispatch-last-grid div { display: flex; flex-direction: column; gap: .1rem; }
.dispatch-last-grid strong { font-family: var(--serif); font-size: 1rem; }
.dispatch-log-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dispatch-log-list li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .55rem;
  padding: .45rem .2rem; border-bottom: 1px solid var(--line-soft); font-size: .82rem;
}
.dispatch-log-list li:last-child { border-bottom: 0; }
.dispatch-log-list li strong { min-width: 11rem; }
.dispatch-log-list li small { flex-basis: 100%; color: var(--muted); }
.dispatch-log-status { font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: var(--muted); }
.dispatch-log-status.status-sent, .dispatch-log-status.status-pdf { color: var(--green-dark); }
.dispatch-log-status.status-failed { color: var(--burgundy); }
.notice-gold { border-style: dashed; }

/* ---------- Utilities and responsive ---------- */
[data-plan-row].filtered { display: none; }
[data-plan-row].filtered + [data-plan-row].filtered { border-top: 0; }
.plan-table-empty { padding: 2rem; text-align: center; color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid .span-2 { grid-column: span 2; }
  .detail-grid { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr); }
  .auth-card { grid-template-columns: 1fr; }
  .auth-art { min-height: 360px; }
  .auth-church { display: none; }
}
@media (max-width: 980px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-104%); transition: transform .2s ease; box-shadow: 0 0 60px rgba(43, 51, 45, .25); }
  .sidebar.open { transform: translateX(0); }
  .nav-toggle { display: inline-flex; }
  .sidebar-close { display: inline-flex; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(38, 45, 39, .3); z-index: 9; }
  .topbar { position: sticky; top: 0; z-index: 8; background: rgba(250, 246, 236, .93); backdrop-filter: blur(8px); }
  .two-column, .team-layout, .detail-grid, .admin-layout, .admin-layout.wide-form { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-intro { flex-direction: column; align-items: flex-start; }
  .intro-stats { align-self: stretch; justify-content: flex-start; }
  .intro-stats div { align-items: flex-start; }
  .settings-grid { grid-template-columns: 1fr; }
  .data-summary { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .plan-table-desktop { display: none; }
  .plan-mobile-list { display: flex; flex-direction: column; }
  .plan-timeline { padding: .8rem .85rem .9rem; }
  .timeline-legend { font-size: .62rem; }
  .preset-menu { position: static; }
  .preset-panel { left: .5rem; right: .5rem; top: auto; width: auto; max-height: 68vh; overflow-y: auto; }
}
@media (max-width: 640px) {
  .content { padding: 1rem .8rem 1.6rem; }
  .toolbar { flex-direction: column; align-items: stretch; gap: .6rem; }
  .toolbar-group { width: 100%; justify-content: flex-start; }
  .range-nav { justify-content: space-between; }
  .range-nav > .icon-button { order: 1; }
  .range-form { order: 3; width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
  .range-form .btn { grid-column: 1 / -1; }
  .filter-form { width: 100%; }
  .filter-form .field-inline { flex: 1; }
  .filter-form select { min-width: 0; width: 100%; }
  .plan-legend { flex-direction: column; align-items: stretch; gap: .45rem; }
  .preset-panel { left: .4rem; right: .4rem; }
  .topbar { padding: .8rem .8rem; }
  .topbar-title h1 { font-size: 1.3rem; }
  .account-text { display: none; }
  .stat-strip, .stat-strip.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: 1fr; }
  .stats-grid .span-2 { grid-column: span 1; }
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .month-chart { gap: .25rem; }
  .month-bar-wrap { min-width: 38px; }
  .preview-counts { grid-template-columns: repeat(2, 1fr); }
  .data-summary { grid-template-columns: repeat(2, 1fr); }
  .detail-church .church-glyph { width: 70px; height: 50px; }
  .error-page { flex-direction: column; text-align: center; padding: 1.4rem; }
  .error-code { width: 84px; height: 84px; font-size: 1.6rem; }
  .auth-form-panel { padding: 1.3rem; }
  .demo-account-grid { grid-template-columns: 1fr; }
  .church-overview { grid-template-columns: 1fr; }
  .topbar-actions .btn span { display: none; }
  .dispatch-last-grid { grid-template-columns: 1fr; }
  .dispatch-actions .btn { width: 100%; justify-content: center; }
  .dispatch-bulk { justify-content: flex-start; }
}

@media print {
  .sidebar, .topbar, .app-footer, .flash, .toolbar, .range-actions, .filter-chips, .legend-items, .plan-legend, .btn { display: none !important; }
  .app-shell, .app-main, .content { display: block; padding: 0; }
  body { background: #fff; }
  .card, .calendar-card { box-shadow: none; border-color: #bbb; }
  .calendar-table { min-width: 0; font-size: 9pt; }
  .plan-mobile-list { display: none !important; }
  .plan-table-desktop { display: block !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
